Using G02 arc instead of multiple line segments

No matter what settings i use, the output gcode never uses the g02 arc code, just a large collection of G01 line segmenrt s

LB and MillMage do not use circular interpolation in their G-Code.

1 Like

Ah, I see. Thanks.

1 Like

It’s mostly pointless to do so, as the only thing it really gets you is file compression. The controllers all convert them back into segments for execution anyway.

We might, at some point, try to add an “arc reclaimer” to the GCode output, but it’ll likely cost more processing time than it’s worth.

1 Like

No worries, just curious. Thanks for the clarification.

1 Like

This may be true for the devices that you control motion for but for those of us using machines that are Mach 3/4 or UCCNC where arc is supported are maybe not getting the best g-code to process. I have a Stepcraft D840 that has a UC100 and is driven by UCCNC. Code generated by Vectric or Fusion makes use of the G02 command like this:

(Starting a Clockwise Arc)

N12770 G02 X115.399 Y94.555 I-1.267 J-0.956

Are you saying that UCCNC is converting those G02 commands to a collection of G01 commands in memory? I’m no expert and genuinely curious. I’ve had Lightburn for several years now and I’m currently playing with a MillMage trial.

Thanks!

Yes - controllers convert arc segments into linear motion.

1 Like

Do not know where you can find the parameters in the controllers using the above software, but I think $11 and $12 in GRBL control the output moves if IJK programming is used.

Thanks Colin. I probably should have done this before I asked my question but I am still curious about why the industry would have ever developed the arc commands in the case you are making. So…..I asked AI and got an enlightening explanation. It was a lengthy response and rather than paste the whole thing I shared this link

Seems that controllers are much better at planning the moves when given G02/G03 than when given a series of G01 moves.

I worked with higher end CNC routers starting in 1985. The controllers had very limited memory, and all of the geometry was lines, arcs, and circles. I was surprised when I started with LB, and they broke all curves into line segments in GCode. It might have something to do with LB being bezier based, verses a lot of CAD programs that are simple lines, arcs, and circles. When we imported car striping files into our CAD system, we used curve fitting software that converted their bezier curves into a series of arcs that fit those curves.

I know some high end controllers in the old days used short line segments, but I didn’t have access to them.

1 Like

They usually aren’t - trajectory planning while maintaining acceleration / deceleration limits is simpler with a single code path (lines) than with one that handles multiple different types of primitives, so most firmware breaks arcs into simple linear segments so the planning engine only has to deal with one type of thing.

Arc commands made a lot more sense when gcode was written and edited by hand, and/or stored on punch cards or limited memory.

1 Like

As a seasoned CNC programmer, I beg to differ. Arc interpolation (being a G02 - G03 in ISO or a C in heidenhain) is ALWAYS preferred to G01 or L commands, as it gives much smoother results. In a sense, it is true that the machine only moves in discreet steps along the axis, but an arc command makes the machine move in steps as fine as the controller can handle, while a series of linear motion commands dictates the deviation from a true arc, and the machine can’t make it better.

it is a bit like the difference from an STL file that approximate a surface with triangles and a true 3d model that uses equations to define the shape of a surface. That said, I have never used millmage as I do have access to professional CNC software like powermill

MillMage doesn’t have the ability to represent true arcs. We use Bezier splines, which come very close, but not exact.

GRBL and all other derived firmwares use internal approximations, as evidenced by this setting:

$12 – Arc tolerance, mm

Grbl renders G2/G3 circles, arcs, and helices by subdividing them into teeny tiny lines, such that the arc tracing accuracy is never below this value. You will probably never need to adjust this setting, since 0.002mm is well below the accuracy of most all CNC machines. But if you find that your circles are too crude or arc tracing is performing slowly, adjust this setting. Lower values give higher precision but may lead to performance issues by overloading Grbl with too many tiny lines. Alternately, higher values traces to a lower precision, but can speed up arc performance since Grbl has fewer lines to deal with.

Since MillMage is not intended to be used for machining engine parts, we’re generally not concerned with motor-step level accuracy.

As a seasoned CNC programmer, you’re likely used to the kinds of machines that cost a year’s salary or more, not the hobby-level equipment we’re targeting.

3 Likes

Yes I program for those machines, and I also have a hobby CNC router in my shed (MACH3 controlled) and I can assure you the difference is visible there too

As a seasoned CNC Technician understanding the electronics and mechanics of those $250K machines, I agree with @LightBurn. Hobby class CNC mills were never intended to duplicate the big boys. They can only mimmic them. Mechanical rigidity has much more effect on the cut finish than the electronics. When my 3018 is pushed to the limit, it chatters and sounds like the machine will fall apart. Push the big boys to their limit and you just snap off a tool or the tool bar.

1 Like

Does millmage support cubic/quadratic splines? (G5/5.1) [grblhal does]

Added to the question above, what’s the default chord length in millmage and can we change it?

Arc tolerance is how the motion planner calculates changes in acceleration.

I do like the approach above. Hobbyists get hung up on accuracy, and it’s generally not required for projects. Bezier curves make nice looking arcs, which for most people is what matters. Its best to know what you’re working with so the transparency above is appreciated. I do work with small parts on mine in O1/O2 to 0.02mm tolerance or so for clock and lathe parts, but for the majority of work I do it doesn’t matter. However it is worth knowing exactly the limitations so you can switch as required.

That said electronics do matter, and we do push our hobby mills far closer to their capacity than we do industrial machines. Snapping a few aliexpress endmills on my hobby mill to push f&s can be fun, crashing anything is at worst a few hundred pounds worth of damage and a day or three downtime. Crashing an Okuma or Kern spindle runs you five or six figures and a few months downtime, and breaking a tool with a minor crash can run three or four figures each.

1 Like

Did a test. Used MillMage to create a Profile arc segment and then created the GCode output. Pulled out one step from the GCode and used that to sort-of draft an actual size segment.

I used Lightburn only because it was easier to manipulate the layer colors. In lightburn, with a lot of effort, I managed to put the ends of a line segment in the same grid position as indicated by the GCode (included in the drawing).

Once I got the line segment ends where I wanted them, I used the Measure tool on the line.

Chord Length?: I have no idea if it varies depending on the arc (circle) parameters, but I got 0.60mm for the segment length.
Change It?: I doubt it. I could find nothing in MillMage to show we could. My smallest mill is 0.80mm, and I suspect that would still generate a fairly smooth curve without showing much scallop or step effect.

Lightburn and GCode files attached.

Arc Segment Investigation.lbrn2 (155.8 KB)

Arc Increments.NC.txt (1.1 KB)

This was actually a fun project. :grin:

1 Like

No, and not G02/G03 either.