Home / Forum / Hardware / Analog buttons for machine control / Reply To: Analog buttons for machine control

Profile photo of Leo69Leo69
Post count: 343
#6131 |

I’m accustomed(spoiled) to a PC monitor with Mach3 so I think I’ll find the RepRap LCD a bit awkward. It doesn’t bother me on my 3d printer but a router needs more operator involvement and just jogging an axis is a frustrating exercise with the Marlin interface. There are some unused pins on the Mega2560 that we could use for controls but they’re hidden by the Ramps board so it would be a pain to break them out. On top of that, using those pins would require significant firmware edits which I prefer to avoid because I do plan to put an extruder on my build at some point and want my Marlin to be fully compatible.

I think a cheapo Chinese Arduino pro micro or mini clone would be perfect for a standalone pendant device and if we use a serial hookup we’ll just be sending commands that are already built in to the firmware the same way that host software like Printrun and Cura do. This means less firmware edits and maximum compatibility. I think we agree on requirements but you can PM me and detail them. Last year I designed and built a prototype 4-port Mitutoyo gage interface with HID output using a pro micro with about $20 in parts. People couldnt’t believe those things sell for around $500 in the commercial marketplace. I used every single input and output pin and still didn’t have enough for the eight buttons and rotary controller interface so I used a multiplexer circuit like you mentioned and it worked perfectly. I wouldn’t connect more than 5 switches per analog input myself. The more switches, the smaller voltage difference between each one. This increases the odds that a dirty switch may read as a different button due to the increased/decreased resistance and you don’t want that with a CNC control. If we build a pendant device using a separate MCU then we should have plenty of I/O pins available and possibly avoid the need for a multiplexing circuit.

I gave you some bad info on the filename extension mod the other day. Guess I read it to fast:) The correct patch is for the carreader.cpp file in the Marlin folder as I mentioned before.

Find this line:
if (!filenameIsDir && (p.name[8] != ‘G’ || p.name[9] == ‘~’)) continue;

Replace with:
if (!filenameIsDir && ((p.name[8] != ‘N’ && p.name[8] != ‘G’) || p.name[9] == ‘~’)) continue;

That patch will allow display of files with extension beginning with ‘G’ or ‘N’. I’m still connecting my motors to the Ramps board but I did load this firmware patch and was able to test and see that files displayed as expected and ran when executed.