Page 1 of 1

G92 set and reset options

Posted: Fri Dec 18, 2020 2:17 am
by SamMarrocco
I'm using G92 global offset and would like to set it programatically (that is, outside of using GCode G91 x y z). If the global offset for G92 is considered the 0 index of the Interpreter.SetOrigin() method, setting the G92 global offset be:

Interpreter.SetOrigin(0,x,y,z,a,b,c)

Does this function actually *sets* the offset from the machine location, or does it add an offset to any already existing offset?
The reason I ask is that, if it truly 'sets', I should be able to 'reset' the G92 global offset by using SetOrigin(0,0,0,0,0,0,0). If it adds to the existing offset, that would have no effect and I would need a method of resetting the offset to zeroes.

Re: G92 set and reset options

Posted: Fri Dec 18, 2020 5:32 pm
by TomKerekes
Hi Sam,
nterpreter.SetOrigin(0,x,y,z,a,b,c)

Does this function actually *sets* the offset from the machine location, or does it add an offset to any already existing offset?

The reason I ask is that, if it truly 'sets', I should be able to 'reset' the G92 global offset by using SetOrigin(0,0,0,0,0,0,0). If it adds to the existing offset, that would have no effect and I would need a method of resetting the offset to zeroes.
It 'sets' the offsets. But it only changes the GCode Vars 5211... The active Axis Offsets also need to be updated with:

KM.CoordMotion.Interpreter.SetupParams.X_AxisOffset = 0;
KM.CoordMotion.Interpreter.SetupParams.Y_AxisOffset = 0;
KM.CoordMotion.Interpreter.SetupParams.Z_AxisOffset = 0;
etc

Re: G92 set and reset options

Posted: Fri Dec 18, 2020 6:12 pm
by SamMarrocco
Thank you, Tom. I'll have to explore that a bit more.

Re: G92 set and reset options

Posted: Fri Jan 01, 2021 9:35 pm
by SamMarrocco
After exploring this a bit, I've decided that it makes more sense (for me) to utilize G52 codes instead of G92 as it is easier to reset from a GCode standpoint. Thank you.