aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/example-extras.cfg3
-rw-r--r--klippy/extras/quad_gantry_level.py10
2 files changed, 13 insertions, 0 deletions
diff --git a/config/example-extras.cfg b/config/example-extras.cfg
index f4033e5c..08c7fc42 100644
--- a/config/example-extras.cfg
+++ b/config/example-extras.cfg
@@ -371,6 +371,9 @@
#horizontal_move_z: 5
# The height (in mm) that the head should be commanded to move to
# just prior to starting a probe operation. The default is 5
+#max_adjust: 4
+# Saftey limit if an ajustment greater than this value is requested
+# quad_gantry_level will abort.
#samples: 1
# Number of probe samples per point. The defaut is 1
#samples_result: average
diff --git a/klippy/extras/quad_gantry_level.py b/klippy/extras/quad_gantry_level.py
index 7a85dec3..32dd3b7d 100644
--- a/klippy/extras/quad_gantry_level.py
+++ b/klippy/extras/quad_gantry_level.py
@@ -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: