Page 1 of 1

Checking for G52 offset active

Posted: Tue Jan 17, 2023 2:51 pm
by Sword
Hey all,

I've been digging through some docs to see if there's a way to track/check if a G52 offset is active or in play, by way of a system variable, or with the implementation of "PLC Words" in the upcoming version.

Desired goal is to have a way of quickly seeing that an offset is active or not. I'll often run a part that I may see needs a bit more depth of cut after running the first blank, so I'll apply a small amount of Z offset to cut through on subsequent blanks. Another scenario might be two blanks that need the same cut, so after running the first one, I'll apply a X offset for the second blank. On occasion, I've forgotten to clear the G52 offset before doing something else, and would like to have some kind of visible option to see that it's still active. A button LED could be an option, but possibly better than that would be a "PLC Word" that could be displayed on a "Clear G52 Offset" button that I already have in place.

Just looking for some thoughts, thanks.

Edited: Another good easy option would be if the "Active Codes" display had G52 on it.

Re: Checking for G52 offset active

Posted: Tue Jan 17, 2023 4:07 pm
by cnckeith
hello. i assume your vcp button is "G52 X0Y0" so you can manually clear any G52 offsets applied

i'll have to look into adding G52 to active g codes, its kinda old school but useful way of doing things so i'm sure it was not on the priority list to have being displayed on the active g code list.

Re: Checking for G52 offset active

Posted: Tue Jan 17, 2023 4:56 pm
by Sword
Thanks Keith, that works for me. Yes, currently the button is just "G52 X0Y0Z0". I might add more to it later, but using MDI is fast and simple for setting the offset amount, and then the button is quick for clearing it. Just need to make the button blink when active. 8-)

Yup, old school, but quick and effective, until I forget to clear it! ;)

Re: Checking for G52 offset active

Posted: Tue Jan 17, 2023 5:42 pm
by cncsnw
Since G52 is implemented in the G code parser, there is nothing in the PLC program that would or could respond to the G52 offset amount.

In a CNC macro, you could compare the current WCS offset value (plus the current tool height offset value, if Z) to the difference between #504x and #502x (i.e. the difference between local-coordinates position and machine-coordinates position for that axis).

That is a little clumsy, since you could only execute your check by executing G codes, but that would allow, for example, a check in your M3 macro that pauses and prompts you if it sees that a G52 offset is active, before beginning a machining operation. Just make sure it does not interrupt a tapping cycle....

Re: Checking for G52 offset active

Posted: Sun Feb 26, 2023 5:02 pm
by Greg82
I am using G52 for X and Y in an M-Code that turns on and lowers a drill below the height of the main spindle and a different M-Code that resets the G52 and turns off the drill. This works great under normal operation but if the Estop gets pressed it doesn't reset the G52. The plc disables the M-Code to turn off and raise the drill on Estop. Is there a way to called G52 X0 Y0 when the EStop is pressed or released or is the only way to be safe is to have this in the beginning of all programs?