The “brains”, the “orchestrator”, the “smarts” of a CNC machine – without some program to interpret instructions, your router or printer isn’t getting very far. Of course, we know of the popular Marlin and the uniquely simple GRBL, but have you met LinuxCNC? Well, we’re here to make introductions.

Stepper-driven machines require software to bridge the gap between our instructions and their motion. That is, after all, the computer numerically controlled (CNC) portion of our wonderful machines. While it’s common to see this role fulfilled by a controller board, LinuxCNC takes a different approach.

In this article, we’ll be going over what LinuxCNC is, a summary of what a setup may look like, and a few considerations. Then, we’ll point out some unique features it has and some limitations. Finally, we’ll compare it to other options and what else might suit your CNC machine. Let’s get right to it!

Back to Contents

All About LinuxCNC

What Is It?

A PC running a CNC router via LinuxCNC
A PC running a CNC router via LinuxCNC (Source: rcKeith via YouTube)

LinuxCNC is an open-source operating system, specially developed to work as a CNC controller with minimal extra hardware. It’s known for turning regular old PCs into extremely flexible CNC controllers. This isn’t without its drawbacks, but it is unique in its benefits.

This unique and complex piece of software is a specialized Linux image built specifically for operating CNC machines. This image is installed as the operating system on almost any ordinary PC. An entire OS installation is necessary due to its intricate task.

In order to use a PC to instruct low-level hardware such as stepper motors, it needs to have defined timing. LinuxCNC achieves this by running as a real-time operating system (RTOS).

Of course, LinuxCNC isn’t the perfect all-in-one tool for your machine, but it’s a very flexible one. On one end, you have to prepare your G-code instructions using your own CAM software to pass onto LinuxCNC. Then, on the hardware side, you have to decide what stepper driver to buy for your machine. Everything between these two points, including the interface, the machine-specific configuration, and even peripherals, can be controlled and set up using LinuxCNC.

Since LinuxCNC tries to accomplish so much, it’s no surprise that it requires good planning to run smoothly. With this in mind, let’s go over the basics of a decent setup.

Back to Contents

Advertisement
Advertisement
Advertisement
All About LinuxCNC

Features

A custom graphical user interface (GUI) made for LinuxCNC
A custom graphical user interface (GUI) made for LinuxCNC (Source: loboy via LinuxCNC Forum)

As we’ve seen, LinuxCNC is a bit different in its approach to CNC. Most of the work is done on a PC, and that demands precise timing. This precision comes from LinuxCNC running as an RTOS. This allows your regular PC to perform operations usually reserved for lower-level hardware.

Such low-level control calls for some sort of abstraction between the code and the hardware. Indeed, this is why the hardware abstraction layer (HAL) is such a big deal. While most users don’t interact with it directly, HAL provides the tools necessary for developers to apply LinuxCNC’s functionality to a wide variety of machines. Essentially, it gives LinuxCNC the flexibility to work with any stepper-driven machine.

This brings us to perhaps the most important aspect of any open source project – the community. LinuxCNC has been around for a long time, and its community is still running strong. It only takes a bit of research to find that the feature you’ve been looking for is already implemented in some way. All of this isn’t to say LinuxCNC is perfect but rather a really good choice.

Back to Contents

Advertisement
Advertisement
Advertisement
All About LinuxCNC

Setup

LinuxCNC being set up
LinuxCNC being set up (Source: russtuff via YouTube)

LinuxCNC’s operation requires a different setup than most hobby CNC machines. We’ll go over the basic considerations of a LinuxCNC setup here, but if you’re looking for something more in-depth and general to CNC routers, check out our article on building a CNC Router from scratch. That said, the two main pieces of hardware that need to be considered with LinuxCNC are the PC and the stepper drivers.

PC

LinuxCNC can run on surprisingly low specs. This means that the old PC you have yet to find a use for may be the perfect candidate. Laptops, however, aren’t recommended.

The crucial factor in your PC choice is the latency measured by LinuxCNC. The software comes with a latency test that measures what they call “jitter”. Because LinuxCNC runs as an RTOS, this allows it to produce the pulses required to drive steppers with minimal jitter.

To confirm the latency performance of your PC,  you could test out the OS straight from the CD or USB drive before installing it. However, it may be better to look over LinuxCNC’s system requirements to get some more information before you test anything.

Stepper Drivers

Choosing the right stepper driver board may take some research depending on your needs. There are parallel port-connected boards and Ethernet-connected boards. Based on their forum, it’s clear that Mesa cards are the most commonly used. Mesa makes a variety of Linux-supported boards.

Installation & Configuration

Beyond the hardware, the setup of LinuxCNC’s software can be straightforward. There are wizards to help you input the details of your CNC machine and Mesa card. This can be enough for standard setups, but specific features of your machine may require editing of the .ini and .hal files. These will be the two main sources of your setup’s configuration.

In addition to all of this, you can also customize your user interface. There are various built-in options and plenty of customization available. LinuxCNC comes with a lot of flexibility, and that can be intimidating. To nail down your perfect setup, we recommend checking out the LinuxCNC forums where other users frequently document their experiences.

Back to Contents

Advertisement
Advertisement
Advertisement
All About LinuxCNC

Alternatives

An Arduino paired with some stepper drivers
An Arduino paired with some stepper drivers (Source: Arrow)

While LinuxCNC is a solid choice, it isn’t the only one, and it may not be the best one for your situation. It’s important to know what you need and which of the options will better fit your requirements before making a decision.

Most hobby CNC machines don’t run as close to a PC as LinuxCNC. GRBL, for example, runs on an Arduino Uno and simply takes in G-code instructions. It’s simple, it can run on three axes, and it doesn’t require a fully dedicated PC. This means that if you don’t need any fancy features, you might be better off finding some good open-source firmware and an Arduino.

On the opposite end of the spectrum, some machines demand a more serious setup. Mach 3 and Mach 4 are well known for more industrial and commercial use. They run on dedicated computers and have extensive features. If you need company-backed support and are willing to pay for it, this may be a better fit.

Making the right choice isn’t always easy, and there are more options out there, which is why having a clear idea of what your objective and capacities are is the first step.

Back to Contents

Advertisement
Advertisement

License: The text of "LinuxCNC: A Simple Guide" by All3DP is licensed under a Creative Commons Attribution 4.0 International License.

Stay informed with notifications from All3DP.

You get a notification when a new article is published.

You can’t subscribe to updates from All3DP. Learn more… Subscribe to updates

You can’t subscribe to updates from All3DP. Learn more…

Advertisement