This video demonstrates how an Arduino board can be interfaced with the Linux EMC2 CNC control package to serve as a manual pulse generator (MPG) and a remote DRO.
The Arduino is connected to a Grayhill GH6101-ND encoder (~$26 from Digikey) and a Sparkfun 20x4 character LCD, also about $20. A few switches and an LED are used to show the machine status and to select which axis to jog with the MPG. All communication with the host PC happens in serial mode over the USB cable.
On the host PC, a fairly simple custom HAL module in Python converts signals from the Arduino into input signals which go to HALUI to control the machine. HALUI outputs are also fed back out to the Arduino in the same script.
I chose to use the LCD because it gives an effectively unlimited number of display possibilities with only 6 pins, and I'm thinking about adding things like tool number/offset, absolute vs. program coordinates, spindle speed, feed rate override, etc.
For more on the project, see my blog at http://ckcnc.wordpress.com
would the arduino be easier to make a cnc machine?
jaytank31 1 month ago
@jaytank31 Short answer, no. Not even close. There are a lot of different groups working on this but AFAIK no one has really succeeded yet, as in, making something remotely competitive to Mach or EMC.
sansbury95 1 month ago
I think its limited by the lcd processing
kerfmas5 1 year ago
@kerfmas5 I fixed the problems with this about a month ago. The main problem turned out to be that the serial output buffer could overflow, and when it did, it would corrupt the input buffer. I solved the problem by creating a rate limiter on the output. If the user acted too fast (i.e. spinning the encoder >60RPM) it would simply ignore the inputs. This made it rock-solid.
sansbury95 1 year ago
That's a pretty cool project. I plan to start working on a CNC project soon and have started to dabble in Arduino coding as well. Do you think your 10 updates/second is limited by the baud rate that the Arduino is using? Nice project!
davi200 1 year ago
@davi200 No, I don't think so. Each message is 6 characters or 48 bits, which would mean 200 per second at 9600 baud, and the Arduino can go to 115.2kbps. That said, there's no need for anywhere near that many for this application, since all you're doing is giving the user feedback. I've found it feels good even down to 2x/second update rate so anything over 10x is just overkill.
sansbury95 1 year ago