Automatic Bed Leveling with Conditional Gcode Iterations
-
This post is deleted! -
@fcwilt said in Automatic Bed Leveling with Conditional Gcode Iterations:
I think you will find that a G91 G1 Z20 will raise Z by 20 unless it doesn't have that much room left of the axis.
Correct. G90 moves to an absolute point, G91 is relative to the current position.
https://duet3d.dozuki.com/Wiki/Gcode#Section_G90_Set_to_Absolute_Positioning
-
@Phaedrux If the command G90 G1 Z20 is used in one line, does G91 have to be used to return to absolute mode?
-
@mwolter That's a good question, and I'm not sure off the top of my head. Would have to test to see if it sticks in that format or not.
-
Another thing I noticed is repeatability with PindaV2 probe is not as consistent as BLTouchV3.1... So being that I use a bondtech bmg mosquito, I've made this modified version to scrap the Pinda and welcome the BLTouch. Will get it sorted on the printer and test it fully this weekend.
-
@Kolbi looks good! Is that SLS or MJF printed?
-
@mwolter It was done on an HP Multijet Fusion (MJF), using Nylon PA12.
-
@mwolter said in Automatic Bed Leveling with Conditional Gcode Iterations:
If the command G90 G1 Z20 is used in one line, does G91 have to be used to return to absolute mode?
yes, g-code knows nothing about white space or line breaks
(optionally you can use push and pop, M120, M121)
-
@mwolter said in Automatic Bed Leveling with Conditional Gcode Iterations:
@Phaedrux If the command G90 G1 Z20 is used in one line, does G91 have to be used to return to absolute mode?
G90 is absolute, G91 is relative.
Frederick
-
@fcwilt
That’s why I used that command. Pulled that command from another macro and couldn’t remember why it was created. It’s used to move some amount from the current position without needing to bounce back and forth from absolute to relative and back to absolute positioning. -
@mwolter said in Automatic Bed Leveling with Conditional Gcode Iterations:
@fcwilt
That’s why I used that command. Pulled that command from another macro and couldn’t remember why it was created. It’s used to move some amount from the current position without needing to bounce back and forth from absolute to relative and back to absolute positioning.But there is no reason not to make use of the two positioning modes, there is no downside to using them.
There is nothing to be gained by emulating relative mode using the object model as you are doing.
Frederick
-
@bearer said in Automatic Bed Leveling with Conditional Gcode Iterations:
optionally you can use push and pop, M120, M121
@bearer I read the gcode manual but these two functions still made little sense to me - best I can derive is a save state / restore state? Could you expand a little on these and give me some use examples?
Many thanks,
Kolbi -
-
@bearer Maybe because I just woke or hadn't gone on my run yet - but it is not completely crystal clear to me. Given the example below:
M120 ;push G91 ; relative positioning G0Z30 ; move Z 30mm M121 ;pop
I gather that 'M120; push' saves the current kinematic control state, then the user issues G91 & G0Z30 to relatively move the Z axis, and then returns to the previous control state by issuing an M121 - meaning that no M90 command was needed as M121 sorted that out?
-
@Kolbi said in Automatic Bed Leveling with Conditional Gcode Iterations:
meaning that no M90 command was needed as M121 sorted that out?
yes - but more importantly if you for reasons unknown already were in relative mode you would not return to absolute in error.
-
@bearer Ah ok - thanks! Besides rel/nonrel state changes - what would be an additional use case?
-
@Kolbi ref M120 docs; i only used for absolute/relative and feedrate
-
@bearer Thanks! I'll read the docs again and go for a run to let it soak in.
-
@bearer said in Automatic Bed Leveling with Conditional Gcode Iterations:
already were in relative mode you would not return to absolute in error
If I'm understanding correctly; If you are in currently in relative positioning and then you issue a G91 again - it would toggle, putting you in absolute positioning?
-
@Kolbi said in Automatic Bed Leveling with Conditional Gcode Iterations:
@bearer said in Automatic Bed Leveling with Conditional Gcode Iterations:
already were in relative mode you would not return to absolute in error
If I'm understanding correctly; If you are in currently in relative positioning and then you issue a G91 again - it would toggle, putting you in absolute positioning?
G90 sets the mode to absolute. Sending it again changes nothing.
G91 sets the mode to relative. Sending it again changes nothing.
Frederick