4th Axis

The Printrbot CNC comes as a three axis machine, meaning it can move in X (left/right), Y (near/far), and Z (up/down). The TinyG controller can support more than just three axis, though, and the hardware actually has 4 stepper motor drivers.

Why a 4th axis?

The 4th axis is generally used for spinning the workpiece, much like a lathe. But where a lathe simply spins the workpiece constantly, a CNC 4th axis can move precisely to any position in both directions. This can be used for what is sometimes called "3+1 axis" where the workpiece can spin to a particular orientation, the 3-axis machine works on it, and then it can then spin to a new orientation and work continues.

Or, you can do full 4-axis work, for example making a screw thread or engraving text around a cylindrical object.

Hooking it up

On the Printrbot CNC, the Y-axis uses two stepper motors, each driven by separate driver on the TinyG. This means all 4 drivers on the TinyG were being used already. I could have freed up a driver by wiring the two Y steppers together so they worked in unison from one driver, but I didn't want to compromise their strength.

So, I decided to add another stepper driver, which would share the control signals from one of the existing on-board drivers. This is perfect for the Y-axis, since both steppers work in unison. I based the new driver on a Pololu DRV8825 stepper motor driver, and made a little adapter board in Eagle and had it made at OSH Park. This new driver, connected via the adapter board, plugs into a header on the TinyG (circled in red below).

Since this driver feeds off the same control signal as the built-in stepper driver, the Z axis still has all the power it had before and I now have room to add the 4th axis.

Here's a photo of this extra driver connected to the TinyG:

Note on TinyG headers: Each driver channel on the TinyG has a header with the control signals for that channel, but at least on my board, the 0.1" header was not populated with a connector. I had to solder one into the holes provided.

Note on stepper wiring for proper movement direction: The Y axis had used two separate drivers on the TinyG. These were configured with one operating in reverse mode and the other in normal mode, which is necessary because of the way the belts connect to the two Y steppers. Now that these are driven from one channel from the TinyG, this trick couldn't be used anymore. Fortunately this is easy to fix by simply swapping the pairs of stepper wires into my new driver. Specifically, I wired the "normal" one as A1:Blue, A2: Red, B1: Green, B2: Black, and the reversed one as: A1: Green, A2: Black, B1:Blue, B2: Red.

Note on microstepping: The TinyG has software-configurable microsteppping for each of its drivers. This added driver board has jumpers to set the microstepping setting. So I had to make sure the jumpers were set to match what I had configured in the TinyG for the Y axis.

The 4th axis itself

I found the 4th axis for $279 on amazon (Sunwin brand), and it looks like this:

The particular link I bought from isn't available anymore, but searching for "4th axis" and "CNC rotary axis" should get some results. I am perfectly happy with the unit I received. Below is how it looks when bolted down to the CNC:

Use on first project

My tests above used hand-written g-code, but for my first real project I wanted to use Fusion 360. I found a post-processor that can swap out either the X or Y axis for A (the 4th axis). The project was to make feet for a small cabinet that look like this:

So I created a model like this:

Notice how the X axis (red arrow) will need to become the rotational (4th, or A) axis. I made the model 157mm deep on the X axis (I'll explain why in a moment).

I then installed a special post processor into Fusion 360. To do this:

  • In Fusion 360, go to Preferences->CAM, and select "Enable Cloud Libraries"
  • Go to the A360 Drive website, and open the folder "CAMPosts"
  • Upload the post file (can be downloaded from this thread, and is also linked to this page below).

The post should now show up in Fusion 360 under "My Cloud Posts". In the properties for the post, I made sure that it was the X axis being swapped, and also set the diameter to 50mm. The circumference of a 50mm cylinder is 157mm, and since I set my model's X dimension to that, it will wrap completely around the 360 degrees of the stock.

I used a ball-nose bit, and made two of them at once. Here's the finished product:

Special thanks to the author of the post processor file, which is attributed to Mark from Hughes Tooling.