Checking for G52 offset active

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Post Reply
Sword
Posts: 667
Joined: Fri Nov 30, 2018 1:04 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Thorp WI

Checking for G52 offset active

Post 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.
Scott
cnckeith
Posts: 7334
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Contact:

Re: Checking for G52 offset active

Post 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.
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
Sword
Posts: 667
Joined: Fri Nov 30, 2018 1:04 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Thorp WI

Re: Checking for G52 offset active

Post 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! ;)
Scott
cncsnw
Posts: 3854
Joined: Wed Mar 24, 2010 5:48 pm

Re: Checking for G52 offset active

Post 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....
Greg82
Posts: 6
Joined: Tue Nov 15, 2022 8:30 pm
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Checking for G52 offset active

Post 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?
Post Reply