Gcode Sender for Rotary 4th Axis

I am starting to look at building a 4th Axis, a rotary axis. I have built an Arduino 2560/Ramps 1.6 setup with the GRBL MEGA 5X fork and it is up and running nicely with 3 axis (including dual Y axis). This works with UGS as the sender - Carbide Motion refuses to connect as there is some ‘secret fact’ that the Carbide 3D Controller PCB must share to prove the software is seeing a genuine ShapeOKO or Nomad.

I have created a post-processor in Vectric VCarve to generate A axis Gcode output and with the native cylindrical wrapping capability of the software it has successfully (and remarkably easily) generated XZA axis gcode output that is wrapped!!

So now the questions are;

  • does Camotics or other similar previewers have rotary axis capability? The version I have in Win10 doesn’t seem to understand the rotation
  • does UGS have ABC axis capability? Winder reported making great progress in 2018 in the ‘ABC’ fork of UGS, but the latest build does not appear to have this as yet. Anyone know the facts around this?

Super excited to be making progress on this, and will, if I can overcome the software questions, soon order a 4-jaw spindle chuck, paired centre and stepper drive. I have a small Walnut Burl that I really want to cut as a 3D Faberge Egg without the usual 2.5D compromises. Following that there is a whole long list of rotary projects - lamp stands, decorative radiator cover legs, and on and on :slight_smile:


This answer gets way out of hand, but might have some useful tidbits for you.

  1. You need a gcode generator that knows how to use a 4th axis - Carbide Create does not. You’ve solved this one.

  2. You need a gcode sender that doesn’t mess this these gcode commands. I do not know if CM can do it. I know that UGS can.

  3. On top of that, you need a grbl in between running on a board that knows what to do with it, and the steppers to do it. GRBL MEGA 5 is one, but at this point you’ve grown out of the stock control board. You can piece together a new board, etc, etc, etc an do so, but after 4 different boards, I settled on a more complete solution that included a board, and an well done ARM port of grbl. I’ve been using this one for well over a year: GRBL GRBL32 6-Axis CNC Controller F16 – 150KHz – Tom's Robotics

Here’s my first pass a an external drive setup with a keystudio board. Got everything in place, but shields failed all the time, and the documentation was terrible from keystudio. Steppers, Drives, Oh My! Adventures with replacement electronics and drives - #8 by stutaylo

The second try was a genuine protoneer board shield. That was ok, but kinda flaky too. Worked better than my first attempt at picking all the parts that seemed obvious, and seemed cheaper than more complex things like mach4.

Third try was an arm based board, from awesome.tech “superGRBL” - I liked the idea, but the CPU is soldered down, and managed to blow one up… The supergrbl code works, but it’s a mess to be honest. GitHub - paulusjacobus/SuperGerbil: STM32 driven ARM Grbl firmware. If I remember, this is based on yet another ARM port of grbl. Their dev was done an a 3D pro with a 4th axis ( ‘Maker’ Super Gerbil 4 Axis CNC controller – AwesomeTech) Seemed great at the time, but when I killed it, then repaired it, I realized how how unprotected the board was in some ways that I really didn’t like. With my tinker, can try #4. I think they have stopped selling this board, and were working on a replacement that fixed a number of my niggles about it - but that’s the last i heard about 18 months ago.

The fourth try was toms robotics, and I must say it was not the easiest to set up, but by far the most flexible. But having the code readily available with all the arduino board hacks out of it made it a lot cleaner, faster view into what was going on. The blue pill boards are cheap, they are pluggable, well supported, powerful, easy to swap out, I got it working well with a debugger quickly. It’s got scew terminals for everything, and clear labeling on the top and bottom of the board. I did run across a few bugs, but they were quick to resolve with Tom. ( GRBL GRBL32 6-Axis CNC Controller F16 – 150KHz – Tom's Robotics) I’m really happy with this board, the firmware, and it just works for the setup I have. I did have to do a few things to fix issues - my xl came with physical switches, and they were somewhat problematic. To use induction switches really requires ~7v. Anyone selling 5v inductive switches are selling “binned” parts (they test off the line as workng at 5v and go into a 5v bin) - the problem seems to be “works once” vs “keeps working” isn’t being well tested for, and I’ve had them work fine for a few months then suddenly stop working. So I wanted to run at 12v…but unlike the supergerbil board, high voltage isn’t supported directly, so needed to put together a tiny diode clipper (one diode, one resistor per switch pin - not hard, just a hassle that would be much easier done on the board. Read all about them here: Diode Clippers and Clampers | Circuit Types and Applications )


Some really useful notes, @mikep, thank you. Looking at the Tom’s Robotics board, am I right in thinking this uses Pololu-style drivers, or jump-through boards to connect to external drivers? Your journey shows use of external drivers, presumably because you were pushing for higher torque/speed, but did you gain any experience using plug-in drivers like the Pololu ones?
I have a completely standard 3XL except for HDZ, Prox-Sensors and VFD Spindle - and speed so far has not been a problem for the sort of jobs I have run (it’s a hobby for me). Using 8825-based drivers gives a rating on paper of 2A with heat-sinking, peak 2.5A, which ought to be enough for the stock NEMA-23 with 24V PSU (I will clip the power feed diode on the RAMPS 1.6 to allow higher than 12v working for the drivers).
Are you using the 6-axis UGS that Will Winder was progressing on the non-HAL fork? I got the latest nightly build and it still doesn’t seem to have the multi-axis enhancements as yet - but otherwise I really like the package

I wanted to be able to do larger, higher impedance steppers, and made some miscalculations along the way. Stock steppers are powered ok with the stock setup, but I had already upgraded steppers before I had upgraded the board, and wanted to get the most of the stepper upgrade that was clearly down on power… So, new board gave me the ability to get to higher psu voltage, and a lot more variety in stepper drives (that are WAY quiter than the stock), i can go to servos (prices are coming down). pololu type drivers For the price, I could do stepper modules which are more robust, and if you shop carefully, you can get the ones that arent just the same parts jammed in a different case. These all have much higher degrees of steps.turn (micro stepping taken to an extreme). This is another case where I could buy sme cabability wth a fairy small investment. The arm board will do up to 150k steps/sec. divided across the drivers being used (so using 3 drivers, 50k steps/sec…give it some breathing room and call it 40k. 5 axis would be a pretty safe 30k.sec max. The nighlies I had looked at had enogh to work with multiple axis, i tink it had some trouble with visualization. I’d really like to see ugs get a flatness filter so i can build circuit boards - warped material is difficult to deal with. I haven’t super interested in adding more axis.

1 Like

I did this, among other things, when I upgraded my Nomad’s electronics.

The controller I went for was the EdingCNC CNC720 and I’m quite happy with it. It has its own G-code sender which definitely supports 4-axis G-code and also has built-in toolpath previews.

And FWIW, if you’re replacing the controller anyway, I’d recommend using a more capable controller than GRBL. EdingCNC of course is great but there are other budget-friendly options as well.

The controller I’ve been eyeing recently is LinuxCNC on a Raspberry Pi with a Mesa Electronics board like the 7C81 or 7i76e.

Controllers like these have a number of benefits that can be really handy, especially if you decide to upgrade more in the future:

  • Inputs and support for encoders
  • Differential outputs for stepper drivers (so you can run longer cables and separate the steppers from the controller, if you prefer)
  • Various GPIO outputs for coolant, toolchangers, alarms and the like
  • RS485 and/or MODBUS communication
  • High step rates (if you want to use high-resolution servos or tons of microstepping on a stepper driver)
  • Some of them come with support (EdingCNC is pretty responsive to me, I see the Mesa Electronics folks are pretty active on the LinuxCNC forums)
  • Better G-code support (e.g. flow control and macros in your G-code)
  • Pretty universal support for 4-axis toolpaths
    • I believe LinuxCNC has support for 4-axis toolpath previews as well
  • Support for tool width/length compensation
  • More rugged build, e.g. terminal blocks for I/O rather than flimsy dupont connectors

And a LinuxCNC + Mesa build should cost ~$250, not much more than what the links @mikep posted.