mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-08-06 13:34:06 -06:00
quad_gantry_level: Limit maximum adjustment
safety feature that prevents quad_gantry_level from trying to do a correction that might break things - if your probe fires early for whatever reason and tries to do an 8mm correction in one corner instead we abort if a correction is over a configurable limit by default 4mm configurable via `max_adjust` parameter in the config Signed-off-by: John "Fess" Fessenden <fess@fess.org>
This commit is contained in:
parent
af78d854ac
commit
0a9e3b744c
2 changed files with 13 additions and 0 deletions
|
@ -9,6 +9,7 @@ import probe
|
|||
class QuadGantryLevel:
|
||||
def __init__(self, config):
|
||||
self.printer = config.get_printer()
|
||||
self.max_adjust = config.getfloat("max_adjust", 4, above=0)
|
||||
self.horizontal_move_z = config.getfloat("horizontal_move_z", 5.0)
|
||||
self.printer.register_event_handler("klippy:connect",
|
||||
self.handle_connect)
|
||||
|
@ -83,6 +84,15 @@ class QuadGantryLevel:
|
|||
z_adjust = []
|
||||
for z in z_height:
|
||||
z_adjust.append(z_ave - z)
|
||||
|
||||
adjust_max = max(z_adjust)
|
||||
if adjust_max > self.max_adjust:
|
||||
self.gcode.respond_error(
|
||||
"Aborting quad_gantry_level " +
|
||||
"required adjustment %0.6f " % ( adjust_max ) +
|
||||
"is greater than max_adjust %0.6f" % (self.max_adjust))
|
||||
return
|
||||
|
||||
try:
|
||||
self.adjust_steppers(z_adjust)
|
||||
except:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue