G92 set and reset options

Moderators: TomKerekes, dynomotion

Post Reply
SamMarrocco
Posts: 85
Joined: Fri Apr 27, 2018 12:44 pm

G92 set and reset options

Post by SamMarrocco » Fri Dec 18, 2020 2:17 am

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.

User avatar
TomKerekes
Posts: 2676
Joined: Mon Dec 04, 2017 1:49 am

Re: G92 set and reset options

Post by TomKerekes » Fri Dec 18, 2020 5:32 pm

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
Regards,

Tom Kerekes
Dynomotion, Inc.

SamMarrocco
Posts: 85
Joined: Fri Apr 27, 2018 12:44 pm

Re: G92 set and reset options

Post by SamMarrocco » Fri Dec 18, 2020 6:12 pm

Thank you, Tom. I'll have to explore that a bit more.

SamMarrocco
Posts: 85
Joined: Fri Apr 27, 2018 12:44 pm

Re: G92 set and reset options

Post by SamMarrocco » Fri Jan 01, 2021 9:35 pm

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.

Post Reply