Adventures with LinuxCNC

So I am finally coming up for air after being buried by work and converting my machine to run with LinuxCNC instead of Mach 4.

I was not originally planning on switching to LinuxCNC for quite a while but I kept running into Windows 10 network communication issues. This caused havoc with the scripting around my ATC and finally came to a head when I was just starting a 4th axis job that would take 4 weeks of 18 hour days on the machine. I kept having problems right in the middle of a tool change which would cause the ATC script to error and e-stop the machine. This was a big problem because the machine would need to be re-homed and the homing sensors are not perfectly repeatable (no sensor is). I have found that they are good for about 0.015" of repeatability. If you are familiar with positional 4th axis work you will know that getting the work offset aligned perfectly with the center of rotation on the machine really matters. Whatever distance you are off gets doubled when you flip a part. As much as 0.03" of misalignment on a double sided part was not going to fly for this job. Having to re-find the offset and start the job from the right point every time there was a problem sounded like a recipe for disaster since I was not always going to be the person running the machine.

In a fit of rage, I decided it was time to drop Mach 4 and move to something more robust and easier to customize. I am sure that with enough time I could have improved my ATC scripting in Mach 4 to be better but I was tired of dealing with what I consider to be design flaws in that software. It just makes scripting in it so much more work than it needs to be.

I spent the next 3 weeks at work learning how to configure LinuxCNC and swapping out the ESS and Avid CRP850 BOB for a Mesa 7I96S and 7I84. I was in a pretty big rush because of the deadline for all that 4th axis work. Here is a picture of the electronics cabinet (please ignore the wiring mess,I was working 18-20 hour days and was in a hurry):

We have now been running flawlessly for about 6 months on LinuxCNC with the QtDragon_HD interface. It only took me a couple days to get all our custom scripting ported over. It was so much easier to write and debug than it ever was in Mach 4. We have not had a single communication or software problem since the system was finalized at the beginning of April. It is running on a small fanless PC with an Intel J6426 quad core.

I am particularly happy with greater gcode macro flexibility of LinuxCNC. You can do just about anything directly in gcode. If you do need to get more advanced, you can also use python. I have yet to find something that needed anything more that what I can do in a gcode subroutine.

The learning curve was pretty steep, especially when it comes to the first time setup of the PC to minimize latency and building the initial configuration. Thankfully there is a pretty active community forum that was quite helpful. The amount of existing add-on components and guidance is incredible. It feels so much more flexible and customizable than Mach 4. It took me about an hour to switch to using RS485 for full control of the spindle rather than analog 0-10v. It also means that I have access to individual error codes from the VFD inside LinuxCNC and can make automation based on them. I have added a front control panel with analog rapid, feed and spindle override controls. Our existing wireless and wired pendants both work great using pre-built configurations that I found.

There are a few controller options that are compatible with LinuxCNC. I picked a Mesa card for my machine. Because of the chip shortage, the only available option at the time was the 7I96S. It is a perfectly good card but required me to pull out the CRP850 break out board. This does not help with that wiring mess in the picture. Since then, more options have become available such as the 7I92TH which is a dual port IDC 26 pin header card. When I saw this I had the idea to try and see if I could make it work as a direct swap for the ESS.

It turned out to not be as simple as just plugging it in and configuring the pins in LinuxCNC but I did get it to work. It required a custom firmware (Mesa cards run on HostMot2 firmware which is thankfully open source) and a couple custom ribbon cables. It really cleans up that wiring mess. Here is a picture of it on top of the CRP850 with a 3D printed bracket:

I did decide to build a pretty close to plug and play kit from what I learned. It was a lot of work to start from scratch and I would have loved a kit that was mostly figured out already. From what I can see, Avid doesn’t want commercial sales happening on this forum. The stuff I put in my Tindie store is really just a hobby for me and not intended to be a full business but I wont link to it directly here. You will have to find it yourself if you are interested. You don’t need the kit to do what I did, it just helps you skip a bunch of work.

If anyone is considering building a new machine with LinuxCNC or upgrading one that is running on Mach 4, I highly recommend it.

Some beauty shots of the 4th axis work we did:

There was a bunch of hand work done after the parts came off the machine (mostly sanding) but 95% or so was all on the machine. This included all the mortise and tenon joints.


That work is georgeous. Truly spectacular that! How long do you think you spent on that project, start to finish? Not asking about the linux CNC conversion, but about the furniture. As an example, take 1 chair, all in, start to finish, how long do you think you’ve got into making 1 of those chairs including design time?

These were reproductions of some 150 year old chairs and sofas that were in pretty bad shape. The customer gave us the originals to reference but it was still about 4 weeks of 3D design and 2 weeks of CAM and simulation for each item. There is about 24 hours of machine time followed by 40-50 hours of labor in each piece. I think we made 8 chairs and 6 sofas.

1 Like

That furniture is really awesome!
So you bascially had to just measure the orginals and create all the models element by element? That is real dedication, I hope you made a lot of $$, you earned it.

Not enough $ but not a total loss. We did learn a bunch. First time we did reproductions of this extreme detail. My guess is that we just barely broke even. Really underestimated the sanding time. They did turn out beautiful. There is a chance they will come back for more in a year or so. At least then I won’t have to do all the modeling.

At some point I am going to get in there with my Fusion PCB editor open and do same thing you did but hopefully keep the AvidCNC boards and just toss that ESS thingy-muh-bob.

Everyone is like, “ooh, nice chairs” but I am like “ooh! You fixed your machine! Yay!”

Yes, jealous :rofl:

Give me time though. End of October is a magic date for my shop :grin:

1 Like

That’s the whole idea behind using the 7I92TH instead. It would be so clean and easy. Just plug it in instead of the ESS. I am even in the process of making a PCB that would use the I/O that goes to the 6th driver and the FF inputs as RS422/RS485 that will be compatible with Mesa’s serial daughter cards. Should give me 4 separate channels. Enormous amount of expansion capability.

1 Like

+1 for LinuxCNC! I originally was running my Avid Benchtop 24"x24" using a GRBL-based controller, which worked fine for a few years as I was learning about CNC but ultimately I got fed up with software stability issues in Universal G-Code Sender and decided it was time to move to something more robust. I got a Mesa 7i92 interface, did a deep dive on LinuxCNC and I don’t regret the decision at all. LinuxCNC is certainly more complicated, but it’s so much more capable. I used to break up a single setup into separate gcode files per-tool, but with LinuxCNC I can remap the M6 tool change and I added in tool length measurement so all I have to do now for tool changes mid-program is swap out the tool (no more manual Z probe after every tool change).

Also, amazing work on the furniture - that’s inspiring.


1 Like

Awesome and cool aren’t quite enough to compliment the furniture you replicated. You certainly have my respect! One of my buddies is a LinuxCNC guy and recommends it highly. I’m just up for learning a new OS at 77.

It’s really nice to see this thread, I’ve been thinking of dumping Mach 4 for something that wasn’t designed so horribly. As a software architect by trade, I nearly died the first time I actually poked into Mach 4 to make some customizations to accommodate my Haimer. Even cursory poking under the hood, and I suspect Mach works despite the best efforts of the development team…

I’ve not had much time to dig into LinuxCNC. I’m curious what drove you to that platform vs. some of the others that are out there? I’m not super versed on the pros and cons of the platforms available to us. I’m assuming it’s open source, so that’s a pro and a con in of itself (half my home network is based on a *nix platform of some flavor).

In my case, I work for Red Hat :wink:

But for this machine (my second), the availability of the Mesa cards made it more of a no-brainer.

I picked LinuxCNC for 3 reasons:

  1. Its open nature. I am not tied to open source, I just want something that is generally open for customization. As far as I can tell, nothing else out there comes even close. I suppose grblHAL does but I think that LinuxCNC is easier to customize and more powerful.
  2. The active community. The LinuxCNC forums are pretty active and there is lots of help available.
  3. Availability of controller hardware. Mesa cards are well supported and there are multiple versions available. The Mesa designer and company owner (I presume) is active on the forums and responds pretty quickly to questions. There are also other options like a Remora firmware based board.

I am so glad I switched from Mach4. The fact that an E-stop does not stop code execution and the GUI vs gcode LUA threads that only run one at a time with only registers to talk back and forth is so irritating to me. It makes scripting so much more difficult than it needs to be. Oh and don’t forget that the documentation is a mess, the support from the developer is non-existant and the community isn’t very active when compared to others.

So, here are the facts as I remember them. Take it with a grain of salt as I forget stuff and get my dates messed up;

In 1998 NIST (National Institute for Standards and Technology) began the RS274NGC project. It was an effort to simplify CNC controllers and quash the rise of custom g and m codes from manufacturers trying to get an edge over each other.

When it was released in 2000 it was seen as the USA trying to impose themselves over a market they had lost so the Japanese and European companies largely ignored RS264NGC.

A few smart folks took the source code from that paper and began a project called EMC. Since NIST is the government the source code was fair game.

EMC became LinuxCNC after a few legal battles.

The biggest innovation of course is what RS274NGC was designed to do, reduce the controller complexity and offload that functionality to the CAM. Suddenly CNC controllers where very cheap and widely available.

Then a professor ported the core of LinuxCNC to the Arduino and Grbl was born. Grbl gave birth to Marlin and the 3D printer industry exploded.

Today, all major CNC manufacturers in the USA are RS274NGC. Most Japanese and European OEM also support a large subset, specifically “Inverse Timing” being the key.

Anyways, why do I like LinuxCNC? Well, cuz it’s the granddaddy of the modern CNC machine? Cuz it just works?

I have 12 CNC machines. Only one of them runs Mach4. When that controller needs to be updated it will not be Mach4 after that.

This interests me,… I’ve heard so many things about Mach4 that I feel would bother me.

Well, it is a very basic motion planner. It runs on an OS that is relatively easy to install.

You have to remember AvidCNC’s target audience are noobs who are allergic to computers, so it works really well in that frame of mind.

It also works really well for people who are computer programmers but never worked with CNCs before.

But in that last case, it wears on you once you get past the basics.

If you are old hat with programming and machining and you named your son Linus, then start with LinuxCNC. Otherwise learn what you don’t like FIRST before you start spending to get something better. There is a lot of room for very expensive mistakes if you don’t know where you are going.