Recently I posted regarding the fun I’ve been having playing around with Rasperry Pi’s and Python. And, related, I discovered a rather meaty Python project called PyCNC and started playing with it. Rather than a real-time kernel it uses a clever DMA scheme to provide more accurately timed signals for driving the stepper motors of a small CNC machine. I couldn’t get it to work completely. It started throwing OS errors… and I then quickly realized I was in over my head so I put that project to the side for the time being.
Sadly [sic], I’d also heard rumors of more and more folks now running LinuxCNC on RPi’s. While I thought I had already checked off the LinuxCNC check box on my resume (I started using it in 2010 or thereabouts)… I decided to see what’s transpired over the past couple of years, while I wasn’t looking.
When last I left off, I had gifted all of you with my Inexpensive LinuxCNC interface for MPCNC… and a few of you brave souls weathered the storm. But I persevered and recreated a Ubuntu/LinuxCNC desktop PC setup that mimicked my original BuildYourCNC machine… using the PC’s parallel port and my little two-board interface consisting of an inexpensive Mach3 breakout board and CNC shield.
So now, several years removed, here I am staring at my RPi4 (4G ram) and, with only slightly renewed interest in CNC stuff, I thought I should be able to gift you once again… with Inexpensive LinuxCNC interface #2. Should be a snap since I’ve done it before… right?
Boy… was I ever wrong! Half a dozen (or more) tries to find a proper (i.e. working) RPi LinuxCNC image and then struggling with HAL for a week or so to direct step and direction signals to the RPi GPIO pins… and I’ve finally come up with a modestly successful – i.e. it moves! – setup using only an RPi4 and the same little CNC shield as before.
Gone are the desktop PC and the little Mach3 breakout board. RPi4, GPIO pins, and the little CNC shield carrying the DRV8825 drivers we all know and love… are all we need.
Here it is in action… just X and Y, for now. Oh, and Lightburn-generated gcode for my favorite little rulers…
There’s, of course, still a ton I don’t understand and probably never will… but it’s been interesting and has kept me off the streets at night. I’ve already got the Z-axis implemented… just not hooked up, for demo purposes. I probably should get the spindle going… since it’s there and of more interest to most folks, here. A laser might be trickier… as there seems to be less information out there about LinuxCNC and lasers.
But I’ll keep piddling along… who knows what lies ahead?
– David