Inexpensive LinuxCNC interface for MPCNC

New Home Forum Software / Firmware Development Inexpensive LinuxCNC interface for MPCNC

This topic contains 22 replies, has 9 voices, and was last updated by  Bluff Chuffer 1 week, 6 days ago.

Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
    Posts
  • #91604

    dkj4linux
    Participant

    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.

    20190302_074745

    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…

    20190301_163046

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

    20190303_085146

    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

     

     

     

     

     

     

     

    3 users thanked author for this post.
    #91630

    Bluff Chuffer
    Participant

    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?

     

    #91631

    dkj4linux
    Participant

    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.

    Arduino-CNC-Shield-V3-Layout

    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.

    20190302_074745-1

    — David
    .

    1 user thanked author for this post.
    #91697

    dkj4linux
    Participant

    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

    #92045

    Bill
    Participant

    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.

    #92055

    Ian
    Participant

    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.

     

    #92068

    dkj4linux
    Participant

    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.

    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. 😉

    — David

    #92071

    dkj4linux
    Participant

    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.

    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”.

    #92199

    Bill
    Participant

    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. 🙂

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

    #92208

    dkj4linux
    Participant

    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. ?

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

    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  😉

    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

    #92211

    dkj4linux
    Participant

    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.

    20190306_211251

    20190306_211312

    20190306_211327

    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

     

    #93488

    Douglas Rohman
    Participant

    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.

     

     

    #93502

    Derek P
    Participant

    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.

    #93504

    dkj4linux
    Participant

    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.

    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 user thanked author for this post.
    #101921

    Tony
    Participant

    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…..

    • This reply was modified 3 weeks ago by  Tony.
    #101922

    kd2018
    Participant

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

    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

    #101926

    Tony
    Participant

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

    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

    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

     

    #101928

    Tony
    Participant

    https://forum.linuxcnc.org/18-computer/26295-usb-to-parallel-port-converter

    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.

    #101929

    Aaron
    Participant

    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

    #101930

    kd2018
    Participant

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

    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

    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

    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

    • This reply was modified 3 weeks ago by  kd2018.
    • This reply was modified 3 weeks ago by  kd2018.
    1 user thanked author for this post.
    #102282

    Bluff Chuffer
    Participant

    It’s taken a while, but I finally got the Breakout board and LinuxCNC to work. While the mobo did not have a pink parallel port socket, the Bios showed a parallel port and I found it was a series of 26 pins at the bottom of the board.

    I needed an adapter and bought this

    https://www.aliexpress.com/item/UN2F-Motherboard-DB25-1-Port-Serial-Parallel-PCI-Slot-Header-Cable-Bracket/1241286216.html?spm=2114.13010708.0.0.d4334c4dkdPHAN

    I also had to buy a parallel port cable and resorted to importing as I could not find anything local.

    With all this and using the cnc shield as the driver board  got it working. I have not had any success with a TB6560 driver, but I at least know the breakout board works and LinuxCNC may be worth struggling with.

    Got to give Mach3 a go too.

    I have another PC with a parallel port socket, so will try that. Most cheap modern mobo’s have few expansion ports so I expect LinuxCNC needs to adapt or face a bleak future.

    Keep persevering folks.

     

     

     

    1 user thanked author for this post.
    #102283

    kd2018
    Participant

    I have another PC with a parallel port socket, so will try that. Most cheap modern mobo’s have few expansion ports so I expect LinuxCNC needs to adapt or face a bleak future.

    The answer to that I think is the pci cards or mesa cards most recently discussed in this thread.

    #102550

    Bluff Chuffer
    Participant

    Hi,

    I have now got 2 PC’s with parallel ports functioning with linuxCNC. Also managed to get the TB6560 driver to work as well.

    My next task is to try using a RAMPS 1.4 shield to make use of the breakout boards 5 axis outputs. I imagine the total RAMPS 5A fuse on the power supply to the drivers should limit use to Nema 17 size motors.

    Now, what can I use it with!

     

Viewing 23 posts - 1 through 23 (of 23 total)

You must be logged in to reply to this topic.