Close

Round and Round

A project log for MultiBot CNC v2

A low cost 3D printed CNC that can be built with minimal tools yet is capable of great things.

david-tuckerDavid Tucker 04/24/2022 at 03:150 Comments

I have circled back to the rotary axis again.  I wrote a small utility that can parse gcode and apply a transform to it. I made a bat shaped profile and generated a regular cut for it.

Then transforming the Y axis to A and applying a rescale of the A axis and adding an offset to the X axis I ended up with this twisted mess.  It is hard to see here but it is a real jumble that vaguely looks like a splinched bat.

Looking at the end of the cut you can see that it is not actually rotating around the axis properly.

I was wondering if the problem is my code or the viewer so I wrote some simple gcode by hand and loaded it into two different viewers that claim to handle rotary axis. That is UGS and NC Viewer.

I made a file that draws a series of longs along the X axis then rotates the A axis in small steps.  That loads up fine and looks great.

Then I wrote a new file that flips this around, rotating the A axis by 360 degrees then moving the X axis over 1 mm and rotating back to 0. You can see this renders nothing but a straight line.

That made me suspect that rotations were not being rendered properly, so I wrote this simpler file that rotates 90 degrees, moves over 10 mm and then rotates back 90 degrees.  You can see the renderer is drawing a straight line rather than a curve.

Finally I modified the last file by rotating in steps of 10 degrees rather than the full 90 degrees in one move.  This time it renders properly.  Clearly the viewer is rotating the points around the rotary axis properly, however it is not taking the movement of the rotary axis into account when drawing the lines.

You can download the example files from this link if you are curious to look them over.

There is another issue with the viewers.  They all assume the origin is set to the center of the rotary axis.  This is one way you could deal with this, possibly the best way to deal with this, but it is certainly feasible that the origin is set at the surface of the material.

---

NC Viewer works a bit better than UGS, it works correctly for any small angle rotation from 0-180 degrees, but incorrectly inverts the rotation for anything over 180 degrees.

Discussions