aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfess <fess@fess.org>2019-06-17 19:42:02 -0700
committerKevinOConnor <kevin@koconnor.net>2019-06-18 12:12:25 -0400
commitbd40690bd1f7196fa93fc914b9c433db806ddf00 (patch)
tree6b01b408c34a92c1a94ae79382aa0e019ec34554
parent46817752199adf4019dd5d8a74ad3d0f5986a49e (diff)
downloadkutter-bd40690bd1f7196fa93fc914b9c433db806ddf00.tar.gz
kutter-bd40690bd1f7196fa93fc914b9c433db806ddf00.tar.xz
kutter-bd40690bd1f7196fa93fc914b9c433db806ddf00.zip
quad_gantry_level: Support retries
Support retrying QUAD_GANTRY_LEVEL a configurable number of times to a configurable tolerance both in the config or as parameters. - By default keeps original behavior of no retries. - Adds parameters RETRIES and RETRY_TOLERANCE to QUAD_GANTRY_LEVEL gcode. - adds config options retries and retry_tolerance to `[quad_gantry_level]` - issues an error if we are getting worse intead of approaching tolerance - issues an error if retries were requested but we did not reach the tolerance in the specified number of retries Signed-off-by: John "Fess" Fessenden <fess@fess.org>
-rw-r--r--config/example-extras.cfg5
-rw-r--r--klippy/extras/quad_gantry_level.py4
2 files changed, 9 insertions, 0 deletions
diff --git a/config/example-extras.cfg b/config/example-extras.cfg
index 453e894a..63e3e70b 100644
--- a/config/example-extras.cfg
+++ b/config/example-extras.cfg
@@ -350,6 +350,11 @@
#max_adjust: 4
# Saftey limit if an ajustment greater than this value is requested
# quad_gantry_level will abort.
+#retries: 0
+# number of times to retry if the probed points aren't within tolerance
+#retry_tolerance: 0
+# if retries are enabled then retry if largest and smallest probed points
+# differ more than retry_tolerance
# In a multi-extruder printer add an additional extruder section for
diff --git a/klippy/extras/quad_gantry_level.py b/klippy/extras/quad_gantry_level.py
index 1f915d4f..4a66d577 100644
--- a/klippy/extras/quad_gantry_level.py
+++ b/klippy/extras/quad_gantry_level.py
@@ -9,6 +9,8 @@ import probe, z_tilt
class QuadGantryLevel:
def __init__(self, config):
self.printer = config.get_printer()
+ self.retry_helper = z_tilt.RetryHelper(config,
+ "Possibly Z motor numbering is wrong")
self.max_adjust = config.getfloat("max_adjust", 4, above=0)
self.horizontal_move_z = config.getfloat("horizontal_move_z", 5.0)
self.probe_helper = probe.ProbePointsHelper(config, self.probe_finalize)
@@ -36,6 +38,7 @@ class QuadGantryLevel:
cmd_QUAD_GANTRY_LEVEL_help = (
"Conform a moving, twistable gantry to the shape of a stationary bed")
def cmd_QUAD_GANTRY_LEVEL(self, params):
+ self.retry_helper.start(params)
self.probe_helper.start_probe(params)
def probe_finalize(self, offsets, positions):
# Mirror our perspective so the adjustments make sense
@@ -89,6 +92,7 @@ class QuadGantryLevel:
speed = self.probe_helper.get_lift_speed()
self.z_helper.adjust_steppers(z_adjust, speed)
+ return self.retry_helper.check_retry(z_positions)
def linefit(self,p1,p2):
if p1[1] == p2[1]:
# Straight line