aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-01-04 19:18:09 -0500
committerKevin O'Connor <kevin@koconnor.net>2019-01-21 09:52:11 -0500
commit99f96f283230e2ceac139a4d9de072574be3364f (patch)
treedb950117e36bca776082d775831cacb40f048ebd /klippy/extras
parent04f5baa18272140aff2342a0bbe92ef253f2cd91 (diff)
downloadkutter-99f96f283230e2ceac139a4d9de072574be3364f.tar.gz
kutter-99f96f283230e2ceac139a4d9de072574be3364f.tar.xz
kutter-99f96f283230e2ceac139a4d9de072574be3364f.zip
bltouch: Use pin_down mode for probing
The BLTouch is more accurate when probing in "pin_down" mode than "touch_mode" (at least on some hardware). Rework the code to use that mode. When probing in pin_down mode, the BLTouch can go into an error state if a pin_up is not sent immediately after a touch signal. Rework the pin_up code to reduce the time it takes to transmit the command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r--klippy/extras/bltouch.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/klippy/extras/bltouch.py b/klippy/extras/bltouch.py
index 902703ad..7276c361 100644
--- a/klippy/extras/bltouch.py
+++ b/klippy/extras/bltouch.py
@@ -59,6 +59,10 @@ class BLTouchEndstopWrapper:
kin = self.printer.lookup_object('toolhead').get_kinematics()
for stepper in kin.get_steppers('Z'):
stepper.add_to_endstop(self)
+ def sync_mcu_print_time(self):
+ curtime = self.printer.get_reactor().monotonic()
+ est_time = self.mcu_pwm.get_mcu().estimated_print_time(curtime)
+ self.next_cmd_time = max(self.next_cmd_time, est_time + MIN_CMD_TIME)
def sync_print_time(self):
toolhead = self.printer.lookup_object('toolhead')
print_time = toolhead.get_last_move_time()
@@ -100,14 +104,14 @@ class BLTouchEndstopWrapper:
def home_prepare(self):
self.test_sensor()
self.sync_print_time()
- self.send_cmd('pin_down', duration=self.pin_move_time)
- self.send_cmd('touch_mode')
+ self.send_cmd('pin_down', duration=self.pin_move_time - MIN_CMD_TIME)
+ self.send_cmd(None)
self.sync_print_time()
self.mcu_endstop.home_prepare()
self.start_mcu_pos = [(s, s.get_mcu_position())
for s in self.mcu_endstop.get_steppers()]
def home_finalize(self):
- self.sync_print_time()
+ self.sync_mcu_print_time()
self.send_cmd('reset')
self.send_cmd('pin_up', duration=self.pin_move_time - MIN_CMD_TIME)
self.send_cmd(None)