Inexpensive LinuxCNC interface for MPCNC

Recently, after interacting with a couple of fellow Linux users over in the RCGroups forum, I’ve had my interest in LinuxCNC rekindled… which I’d first used when I started in the CNC and foam-cutting game. Over the past few days, working from my PC/CNC/electronics stash/junkbox, I’ve come up with a very inexpensive, not-too-complex, hardware interface between a LinuxCNC (or Mach3) PC’s parallel port and MPCNC… or most any machine driven with A4988/DRV8825 “stepstick” drivers.

For those unfamiliar with these parallel port interfaces, this is purely a hardware interface… there’s no firmware and/or “smarts” needed. LinuxCNC (and Mach3) runs on the PC and spews real-time control and timing signals out the PC’s parallel port pins… and step and direction signals for each axis is all we really need for basic control of the CNC machine attached to the other end.

After loading up a junker desktop PC from a LinuxCNC/EMC2 liveCD I had, I found a “Mach3 Interface Board” (a simple parallel-port breakout board) I’d picked up somewhere along the way. Having the step and direction signals from the parallel port broken out neatly, I started thinking along the lines of breadboarding up a few DRV8825 modules… and then realized that was already pretty much done with most any of the common, and very inexpensive, Arduino CNC shields out there. All I had to do was hard-wire/jumper a small handful of signals and I should be able to control a machine with LinuxCNC.

The A4988/DRV8825 modules need +5 volt logic power and motor power… +12 volt in this case. Then the step and direction signals for each axis… six of them, for X, Y, and Z. All of these (except motor power) are brought out to screw terminals on the edge of the breakout board. I also had on hand a couple of the Uno-based CNC shields… popular with GRBL users. In this case, I only needed the shield… without the Uno. Prototyping board jumpers made quick work of connecting the two boards together… and all the hardware was now in place.

[attachment file=91605]

Connect the parallel port to the breakout board and a CNC machine to the driver outputs, and… Voila! A cheap LinuxCNC to MPCNC interface.

First up, a small GRBL-based engraving machine was converted and tested…

[attachment file=91606]

Then the A4988 drivers were replaced with DRV8825 and their reference voltages set to about 0.7v…

[attachment file=91607]

And then the small engraver was replaced with MPCNC “Henry”… originally a foam-cutter machine I’d built for my late fishing/flying/golfing buddy. A bit of fiddling with the LinuxCNC’s “Stepconf” to configure for belt drive and 1/32 microstepping and the Dewalt replaced with a pen-holder…

Since Mach3 uses a PC parallel port, I see no reason that this shouldn’t work for it as well. The two boards making up the interface, even new, are commonly found online and shouldn’t run more than $20-$25 max for the both of them… a far cry cheaper than most parallel port interface boards designed for the task.

When I used LinuxCNC in the past, for router-cutting parts for another CNC machine and needle-cutting a fleet of RC foamy aircraft, I had used SketchUp/SketchUCAM… and the gcode it produced worked quite well. I’m sure that, with several years having passed, there’s even more options for a better toolchain going forward.

– David

 

 

 

 

 

 

 

7 Likes

Hi,

Since you have not slaved the shield to an Arduino, could the 4th driver position not also be used with that Controller board as a 4th axis?

 

Since the shield is simply being used as a “breadboard/prototyping” board for the driver modules, you can use that 4th position for anything you want. The shield I used has all the relevant connections in a single block of pins near the north-west corner of the board, by the Reset button. I used the X, Y, and Z step and dir pins… the A step and dir connections are routed to the 4th position.

[attachment file=91632]

In that pin block, I placed a jumper across the EN/GND pins (always enabled), jumpered the X/Y/Z step and dir pins from the breakout board, left the A step and dir pins open (since I wasn’t using it), and jumpered +5v and Gnd from the breakout board for the driver modules’ logic section. Connect +12 volt motor power on the shield’s screw terminal inputs and the board has everything it needs to power and drive the MPCNC.

[attachment file=91633]

– David
.

1 Like

Did a bit of “tuning”… adjusted the LinuxCNC max velocity and acceleration vaiues to match the MPCNC/Marlin values we commonly use. Definite improvement in the movement, more consistent with movement in Marlin-driven MPCNC, with sharper corrners… note especially the “M” in the lower plot (before adjustment) in contrast to the upper two plots (after adjustment)

I also decided to see what would happen if I tried to load Ryan’s “crown” gcode file – without alteration of any kind – into LinuxCNC. My thinking was that the Marlin gcode “pallet” should be a subset of the fuller implementation of LinuxCNC’s. Aside from a couple of “warnings” – not “errors” – about file termination, they were easily dismissed and the file ran to completion anyway…

– David

It’s worth noting, even though the cost is pretty low, that with most PCs you’ll have to buy a parallel port interface board, since that port is no longer provided by default.

I have the Rambo 1.4 board and gave up on LinuxCNC when research showed that it’s not capable of supporting a USB interface. - I am now using Octoprint courtesy of the V1Pi image. It works well and lets me use OctoRemote on my phone to jog the machine.

 

1 Like

You’re right, of course, Bill. This is not for everybody. I was speaking primarily of just the interface between a parallel port and the CNC machine. In my case, I was replacing a HobbyCNC 3-axis driver board that was only good for unipolar steppers… and though considered “inexpensive”, even as a kit, it still cost considerably more than this little two-board interface.

WRT to the PC, I am a “packrat” and have a pretty well-stocked PC/CNC/electronics stash/junkbox. I had a half-dozen or more old desktop towers – with parallel port – to choose from and, thankfully, LinuxCNC doesn’t require the latest, fastest, most powerful, machine to run it. A junker PC and HDD (this one greeted me with a Win2000 BSOD…) and a LinuxCNC/EMC2 liveCD… and you’re good to go. I suspect that nowadays one could look around and find a suitable machine sitting unused in a friend or family member’s closet that they’d be happy to get rid of. Even if you had to buy one online, you should be able to get a modest refurbished machine for pretty cheap. :wink:

– David

1 Like

Ian,

I’m not trying to talk anybody out of using the Marlin/GRBL/RAMPS/miniRambo/Rambo/etc machines we all know and love.

Where you “gave up” on LinuxCNC when you learned of it not supporting USB… I’m a “returning customer” and knew full well its requirements. I started my journey with LinuxCNC/EMC2 long before there was an MPCNC to play with and, in this case, I decided to see if I could “upgrade” my old BuildYourCNC-inspired, lead-screw and LinuxCNC/EMC2-driven, wooden, CNC machine to something a bit more modern. I’ve built/rebuilt enough MPCNC-based machines, and variants, that I was looking for something, not only useful to me, but a bit different.

I recognize this is not for everybody. But we do have a number of Linux and LinuxCNC (and Mach3) “lovers” residing in this forum and I presented this primarily for them… and anybody else who’s interested in a relatively clean and inexpensive interface between a PC’s parallel port and our “stepstick”-driven machines.

– David

EDIT: Ian, I don’t know your background, so by way of explanation… LinuxCNC is running on a real-time OS, on dedicated to the task PC hardware, and is spewing out real-time control signals for the CNC machine through the parallel port. There’s no firmware or “smarts” in this interface circuitry and USB is historically not fast enough for the required data rates and precise timing… hence no USB “support”.

Heheh, I’m at a customer site ATM and have filled up the back of my truck with old computers and UPSes… And not one of the computers is old enough to have a parallel port, even though the newest is around 10 years old. :slight_smile:

Of course, I think I’m old enough to have a parallel port, if it’s ever needed…

1 Like

Bummer! What can I say? Not sure what age has to do with it… but I’m going on 73, and feeling every bit of it :wink:

In anticipation of refamiliarizing myself with LinuxCNC/EMC, and not having a really nice desktop set up in my house anymore, I actually broke down and bought a Dell Optiplex refurb from Walmart.com for $150 and free shipping. I made sure it had the requisite parallel port, of course… and knowing I could use it for any/all my desktop needs helped make the choice easy. It’s way more machine, with 8G of ram and large SSD, than needed for LinuxCNC, of course, but it’s what I went with… and it was available.

About the same time, I checked in with my old co-workers/technology guys at the local school district, where I worked until retirement, to see what older “hangar queen” machines may be laying around, headed for the recyclers, and with no hope of ever being fixed or put back into service. One fellow works on the side – maybe similar to the work you do, Bill – and he’d just removed and replaced several machines for a client… Dell’s which still worked (just outdated and broken crap-OS…), all with parallel ports, and all headed for the recyclers. I walked away with 3 machines… all suitable to this task.

Then I rescued the Ubuntu/EMC2 computer and parallel port interface board from my old wooden CNC… and with a power supply replacement and that Win2000 BSOD disk drive, I now had yet another working machine.

Turns out, I really didn’t need to spend the $150 after all… but I now had 5 very nice working machines, gathered over 2-3 days.

I’ve also checked online and suitable machines can be had for well under $100, some with free shipping. Many/most Dell/Intel machines still have parallel ports… some of the other brands don’t. I’d also shy away from AMD machines. OS-less is best/cheaper… but there is a particular glee I get every time I install Linux, using the whole disk, on a never used/booted Windows installation (goes back to my Linux advocacy days, I suppose…). 2G-4G of RAM and any old HDD is adequate.

Bill, I respect your maturity, your judgement, and your background/experience, so I’ll just say the following for others… who are not so knowledgeable as you:

The truth is… if someone really wants to set up a LinuxCNC system and is willing to turn over a few rocks, all the necessary bits and pieces are out there. If just curious and unsure of what LinuxCNC brings to the party… you may want to pass.

– David

1 Like

So I’m getting ready for my next victim… er, candidate.

I cleared some space in my work area and brought my FoamRipper machine out where I can get to it. I moved it as gently as I could and also took the opportunity to cut 2’ off the 6’8" interior door that serves as a work surface. After setting it up I checked it out and was thrilled to see that it still operates as it did when I put it away before last Christmas. It currently has Marlin running on a Mega/RAMPS board stack and uses LCD and SD card for control and input.

[attachment file=92212]

[attachment file=92213]

[attachment file=92214]

I air-milled a sheet of DTFB to insure all was as expected, using the current Marlin-based setup, before I do the LinuxCNC conversion. The 3-sheet DTFB vacuum pad I was testing when I put it away is sitting on the work surface for reference.

– David

 

Could the linux cnc work with the rambo v1.4? I really like how easy it was to set up with my old sherline mill. I really would like the ability to use the native came interface in linuxcnc with this.

 

 

No, linuxcnc will not run on a rambo. You need something like an old PC to run linuxcnc. You can also consider machinekit on a beaglebone but you will need some hardware capable of running a linux kernel.

Douglas,

LinuxCNC is the CNC control software that runs on a dedicated PC, with parallel port. There is no other controller and firmware in the system… Mega/RAMPS. miniRambo, Rambo, Marlin, GRBL, or other. The interface discussed here is a “dumb” interface… circuitry that simply takes the step and direction signal from the PC’s parallel port and feeds the “stepstick” (A4988/DRV8825) stepper motor drivers on a popular, inexpensive, CNC “shield” – without the Uno – to drive a MPCNC/LowRider.

– David

1 Like

Guess who was pretty excited about this until he realized he was staring at a serial port…

EDIT

So, 20 minutes later, I’m looking at the LinuxCNC documentation and various parts on Amazon…

Lots of “unused” pins on the parallel plug. By counting, it seems that there are enough to control 5 steppers independently as well as the limit switches for dual endstops. Can LinuxCNC do that?

Additionally, all the cnc shields I’ve found have either 3 or 4 stepper driver ports. Would a guy just use 2 shields with the appropriate wires coming off the breakout?

I mean, my MPCNC is already running on RAMBO, and I like that it’s a really small controller so the chances of me following up on this are pretty slim, buuuuuuut… I do like to tinker…

Mesa electronics has you covered… but it may not make sense financially depending on what you’re doing… it probably wont make sense :wink:

My old pc didn’t have a parallel port so I’m trying out this breakout board that connects via ethernet. http://store.mesanet.com/index.php?route=product/product&path=83_85&product_id=311

1 Like

Whoa…

Why not something like this? Goes right in the PCI slot, 22 bucks.

https://www.amazon.com/Port-Express-Profile-Parallel-Adapter/dp/B001Q7X0Z8/ref=asc_df_B001Q7X0Z8/?tag=hyprod-20&linkCode=df0&hvadid=309833041189&hvpos=1o4&hvnetw=g&hvrand=10684932668376340141&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9030019&hvtargid=pla-435373349478&psc=1

 

In case anyone reads this later it appears the pci slot is about 15 times slower to respond than the parallel port…big difference in latency, I guess. So that’s why not.

Some parallel port pci cards work well, I forget which ones though, but usually the breakout board vendors will have an appropriate model in stock or recommended

PCI devices in the computer I’m using send the latency through the roof. The ethernet card does the step generation anyway so computer latency is less of an issue. It will be more functional for my purpose in a plasma machine and has lots of IO compared to parallel port setups. It will allow me to put some distance between the plasma and the computer if I need to. And I’m hoping it’ll be somewhat “upgrade proof” or reusable when the day comes that I need to swap out computers… that’s the idea anyway

2 Likes