Why is G52 Persistence configured on by default?

I know it’s just an INI file variable change, but I’m struggling to think of a case where G52 persistence is a preferred default behavior.

I know this is a limitation of LinuxCNC-based controllers, but G52 doesn’t behave like it does on practically every other controller. Since LinuxCNC shares parameters/registers with G92 (WHY???), it can cause unintended behavior much more easily than in other G-Code flavours.

The point of G52 is to do Local WCS offsets on just one work offset, and was introduced as a safer alternative to G92, but it’s global on LinuxCNC variants, and in practical terms, is treated by the controller as a G92 offset that gets set relative to the WCS origin instead of the tool position. With persistence on, a G52 offset survives changing work offsets, M2, M30, M99 (if the G52 is set in a subprogram) and M72, and even reboots. If you abort a cycle, the G52 offset gets treated as a G92 on the next toolpath you run without any indication that it’s active. No other controller/gcode flavor that I’ve used has this behavior.

Yes, obviously you should always Add a G52 X0 Y0 Z0 at EOF and after setting modals in your files if you use G52. This doesn’t solve the abort problem.

Unfortunately my post isn’t the best, and uses fanuc style subprograms and expects fanuc style G52 behavior. For files with a lot of subs, I can’t just recall modals after an M99, I have to disable the offset after every sub call manually.

I’ve also run into unintended behavior when calling probing macros after repeats of the same cycle if a G52 is present. The probing macro (and only the probing macro) seems to retain an offset, again, without indicating that visually or in the console, unless you wrap your code (top AND bottom) with G92.1 (Zeroing out G52 doesn’t seem to work. No idea why. If I had to guess it’s because that’s the only way to zero out the registers in absolute or G53, but I haven’t exported the baked in probing subroutines to see what they’re actually doing.) - for some reason resetting the offset with this method makes the toolpath display show an offset that is not there in reality, but is there in the display. (the red lines indicating progress are displaced by the same distance that would be present in real life if you did not add this mitigation)

Not the end of the world, but it is annoying.

You can change one config line in the INI file in the pathpilot firmware and stop it from misbehaving by default. I really don’t see a case for why you wouldn’t, and I really wish Tormach would ship pathpilot firmware and updates with that setting configured correctly.

@TKOHam - thanks for bringing this up. To my knowledge this has not been on our radar, certainly it’s not something I wrote intentionally 15+ years ago when we were first writing the mill configurations. I’ll bring it up with the team.

@Rogge I don’t blame anyone on y’all’s end, it’s a thing linuxCNC decided to just do wrong for no reason when they were implementing G52, as far as I can tell. They certainly haven’t run out of system registers/parameters above 5000 in the reserved section, so I have no idea why they made these 2 offset methods share all their data and behavior. The practical consequence is that G52 is just G92 in their system with a different reference point when you call it. It also limits functionality because you can’t run the 2 offset methods at the same time. Huge oversight IMO

If anything, LinuxCNC devs should have fixed this in the 25+ years they’ve had since implementation.

Any program that still calls G92 (dangerous, somewhat outmoded) will still work perfectly fine with persistence disabled unless you’re running it on a machine from 1989, which I don’t think covers any Tormach products, so it’s a very low risk change.

The worst case scenario is someone may have to change a couple lines of code to re-initiate g92 after ending a subprogram or after a G2/G30 (how this case can even happen, I don’t know) in their postprocessor, or remove a couple lines of code that redundantly clears the registers. I doubt that’ll make any waves.

I’ve been digging into every scrap of documentation I could find on Pathpilot, LinuxCNC and my CAM software to try to debug this for days, so im sorry if the original post shows my frustration.

IIRC HAAS has a switch to change to FANUC mode from HAAS mode for G52 so there may be reasons to do it either way.