aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-10-04 14:58:17 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-10-04 20:10:12 -0400
commit6d7d079bab1a54b2f36a8d465c9bebee3078b5d6 (patch)
tree35512a977ecf285ad6eb02da3d217401a83eef92
parent4ef0db50872a53d1adf8364a20b22e1ce85e3a2a (diff)
downloadkutter-6d7d079bab1a54b2f36a8d465c9bebee3078b5d6.tar.gz
kutter-6d7d079bab1a54b2f36a8d465c9bebee3078b5d6.tar.xz
kutter-6d7d079bab1a54b2f36a8d465c9bebee3078b5d6.zip
tuning_tower: Only cancel tuning tower test if extrude at notably lower z
Some print start scripts may extrude at a position slightly higher than the first z layer height. Tweak the backwards z test to reduce the chance of the tuning test ending prematurely. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--klippy/extras/tuning_tower.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/klippy/extras/tuning_tower.py b/klippy/extras/tuning_tower.py
index 7f536108..675e6ef8 100644
--- a/klippy/extras/tuning_tower.py
+++ b/klippy/extras/tuning_tower.py
@@ -5,6 +5,8 @@
# This file may be distributed under the terms of the GNU GPLv3 license.
import math, logging
+CANCEL_Z_DELTA=2.0
+
class TuningTower:
def __init__(self, config):
self.printer = config.get_printer()
@@ -48,7 +50,10 @@ class TuningTower:
and newpos[:3] != self.last_position[:3]):
# Extrusion move at new z height
z = newpos[2]
- if z > self.last_z:
+ if z < self.last_z - CANCEL_Z_DELTA:
+ # Extrude at a lower z height - probably start of new print
+ self.end_test()
+ else:
# Process update
oldval = self.calc_value(self.last_z)
newval = self.calc_value(z)
@@ -57,8 +62,6 @@ class TuningTower:
gcode = self.printer.lookup_object("gcode")
gcode.run_script_from_command("%s %s=%.9f" % (
self.command, self.parameter, newval))
- else:
- self.end_test()
# Forward move to actual handler
self.last_position[:] = newpos
normal_transform.move(newpos, speed)