Progress

How NOT to Design a 5 Axis CNC

Use my DIY 5 Axis CNC router as an example of what not to do when making your own. We'll cover the biggest problems that my machine had and how I would fix them.

This article is an accompaniment to the video:
How NOT to Design a 5 Axis CNC

Gantry Shape

The real size of my gantry.
What it should have been.

The first thing to cover is the issue with the shape of the gantry. In my case, the gantry structure was too much of a narrow/tall rectangle shape. The reason this is an issue has to do with how it absorbs torsional force coming from the long Z axis. When the machine Z axis is extended very far down towards the machine bed, any forces going through the tool while cutting, make the whole thing act like a big lever on the gantry.

How torque is induced in the gantry while cutting.

So because of this, we need a gantry with high torsional stiffness too. The most effective and efficient shape for torque is the hollow round bar. The following video gives a good explanation for this at 5:15. You don’t need to watch the whole video or understand the maths, just understand how the forces flow through the cross-section of the bar and why a circle is the most efficient use of material to absorb torque.

So, we know that a circular hollow bar would be ideal for handling torque, but that’s no practical for making a gantry, because you need to mount other things onto it like linear motion guides and ballscrews. So a square hollow bar is the best approximation to a circle that’s also easy to buy and easy to mount things to.

Cross section of gantry, showing the stresses under torque.

The goal is to have as much material of the available material as possible in the red. Green areas are doing little work, and thus is wasted material and weight. Above, on the left is the cross section of my gantry, and the square on the right is the ideal square counterpart.

At 1:07 in the video, he also briefly talks about a square bar and he explains how the cross-sectional shape gets distorted out of square. This is why it’s beneficial to have internal gussets welded inside the square gantry structure at regular intervals. The gussets help to resist the distorting of the square shape, thus helping to prevent torsion overall.

Machine gantry made translucent to show internal gussets better
Suggestion for how to place internal gussets in gantry.

I would consider securing the gussets by drilling holes in the gantry, lining up the gussets, and plug welding them in place through those holes. Not a very tough weld, but the goal is just stiffness, not toughness.

So knowing that material gets more efficient at absorbing torque the further away from the axis, we should aim to have as large a gantry as is practical. This means using thin walls and large width and height will be more efficient than thick walls and small width and height. Go as large and thin as you can before it becomes too weak in other ways, for example, crushing from side-on forces or vibrating too much like a metal silo.

Key points about gantry shape:

  • Make your gantry close to a square cross sectional shape
  • Aim for large width and height and keep the wall thickness as thick as in necessary (that may mean 15mm or 3mm, depending on your needs). Thicker is never bad for rigidity and dampening
  • Optionally, weld at least two internal gussets evently spaced along the inside fo the gantry

Gantry Style

There’s three common arrangements when making these large format router machines and they all have their pros and cons. I don’t know the correct names for them, so I go by:

  • Moving gantry beam
  • Moving gantry bridge
  • Moving table

The properties of rigidity and dampening can be very complex and I’m not in a position to talk in much more detail than this about it. There are videos on YouTube and other sources online (especially in forums) that talk about epoxy granite and concrete machines for vibration dampening.

Moving Gantry Beam

Moving gantry beam style of machine pros and cons.

Also known as a high rail gantry mill, thanks to Mr T on YouTube for that tip.

This is the type of machine I made (but no longer own).

Pros:

  • large work envelope for machine footprint
  • gantry is lighter than moving bridge, allowing faster acceleration
  • might be easier to make rigid than a moving bridge style
  • machine movement is always independent of the weight of the work piece

Cons:

  • very substantial base required
  • bad access to load and unload parts
  • the linear guide bearings which carry the gantry may experience greater lever moment forces

Moving Gantry Bridge

Moving gantry bridge style of machine pros and cons.

By the logic above, this might also be called a low rail gantry mill. Right?

Pros:

  • simple base to design and manufacture, just a relatively simple, flat, rectangular shape
  • excellent access to load and unload parts
  • large work envelope for machine footprint

Cons:

  • heaviest gantry leading to slower acceleration
  • possibly the hardest to build rigidly

Moving Table

Moving table style of machine pros and cons.

Pros

  • easiest of all to manufacture
  • requires only one ballscrew on the table where a moving gantry requires two
  • best chance of good rigidity

Cons

  • movement affected by the weight of the work piece
  • poor work envelope for machine footprint

The following is a rough decision triangle to help make more sense of these pros and cons. It’s not the ultimate guide, it’s just something handy that might help someone. There’s always going to be exceptions that influence the decision about what type of machine to make.

Gantry Orientation

Top view of my machine, arrow pointing out the long distance spanned by the gantry.

The longer the gantry is the harder it is to build it rigid, and the heavier it gets. As you make it longer, you have to make it thicker, taller and wider. This all quickly increases the weight, and weight slows acceleration. Unless you really need the wide open access, I think it’s much better to design your machine so the gantry spans across the shorter side of the base to keep it short, rigid and fast accelerating.

I made the mistake of building my machine to have a large gantry and it did result in a gantry only barely good enough for the intended purpose (cutting wood and plastics). It did make for a cool looking machine and great access, but I never really needed the access that badly.

There was another driving force for my decision to make a large gantry: I only needed to buy one long ballscrew. If the gantry travels the longer side of the machine base, you need two long ballscrews, potentially costing more in the end. Note that linear guides aren’t affected in the same way, you always need the same amount of linear guides.

Linear Motion Guides

SBR16 linear motion guides.

Thanks to my very limited budget, I went with the SBR round linear motion guides. These are as cheap in quality as their price, big surprise, huh? They seriously lack rigidity and they don’t run very smoothly. Let me share a short comment thread that appeared on the video that this blog post corresponds to:

Thank you for your input dekutree64 and jevon homitzky.

Additionally, I designed the gantry rails to be too close together, causing a lot of stress from lever moment previously mentioned.

Real size of the carriage pieces that carry the gantry.

These carriages that support the entire gantry should have been spaced further apart. The vertical distance from the guides and the tool when extended all the way down should be no more than 4x the spacing between the bearings, which I think I was close to that limit. However, I was already using bad guides, so the whole situation was not great. 350mm would have been more appropriate.

A better suited size.

Motion Controller

The CNC controller setup that I went with was not a great option for a 5 axis machine. I used Mach4 with the Warp9 Ethernet Smooth Stepper (ESS). I made this decision before I even knew a 5 axis machine needs to offset the linear axes to compensate for the movement induced by the tilting tool, called Rotation Tool Centre Point (RTCP), though there are other names in the industry. If you don’t know what I’m talking about, watch this video where I explain it in detail:

There was other issues with this Mach4/ESS combination relating to reliability. One time, while running a fairly intense gcode program where it’s reading through a lot of lines of code rapidly and using the inverse-time feedrate mode, the controller miscalculated somehow, and went off on a strange path the ruined the workpiece.

There was also a couple moments where letting go of a jog button didn’t stop the machine jogging - a GREAT way to make you paranoid of your machine every time you jog it.

Mach4 does have a nice screen editor to make it look just how you want, that’s a nice feature. It’s honestly a decent option for common 3 axis applications, just not 5 axis.

Mach4 custom 5 axis screen in development.

Unfortunately, the lack of flexibility makes Mach4 ineligible for use in any of my future projects. I might build myself a 3 axis router if I ever get the opportunity and then I’ll already have the controller and motors ready to go.

Where will I be looking for a better controller? Dynomotion or LinuxCNC are the two on my short list. I’ve actually already bought the hardware from Dynomotion for my current 5 axis mill conversion project:

https://www.machsuper.com/articles/pascal-pt1

The Dynomotion logo.

Dynomotion is compelling to me because it runs on Windows (I’ve never really touched the Linux operating system). Dynomotion also offers high flexibility to write programs to modify behaviour (essential for customising RTCP features), and the software and hardware are made by the same company. The whole package seems to be a really high quality system, just not as popular as LinuxCNC or Mach4. Also, being a commercial solution, I expect good support. I’m not sure LinuxCNC can offer that.

Dynomtion's Kflop motion controller board.

LinuxCNC is open source and has a long history of being adapted to individual needs with sophisticated features. Tormach’s own custom controller software is an adapted and polished version of LinuxCNC, for example. So LinuxCNC remains an option if Dynomotion doesn’t offer the flexibility I need for future projects (I’m thinking DIY 5 axis mill-turn), but for now I’m interested to see what I can do with it.

Disclaimer: I have no affiliations with Dynomotion or any other company or product mentioned in this article.

If you haven't already, give the video a watch