aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/bltouch.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-12-01 22:09:06 -0500
committerKevin O'Connor <kevin@koconnor.net>2018-12-01 22:09:06 -0500
commitaac92ffb916ccf74a9c6692ded671f4f25312b7e (patch)
tree80fc608614a3a5c6b65990c7658b889f057e8187 /klippy/extras/bltouch.py
parent6df7356baa9d7b5abab749793bb2afdf4315bb31 (diff)
downloadkutter-aac92ffb916ccf74a9c6692ded671f4f25312b7e.tar.gz
kutter-aac92ffb916ccf74a9c6692ded671f4f25312b7e.tar.xz
kutter-aac92ffb916ccf74a9c6692ded671f4f25312b7e.zip
bltouch: Fix bug - must restore stepper position after homing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/bltouch.py')
-rw-r--r--klippy/extras/bltouch.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/klippy/extras/bltouch.py b/klippy/extras/bltouch.py
index c3ce14db..0cf07d79 100644
--- a/klippy/extras/bltouch.py
+++ b/klippy/extras/bltouch.py
@@ -57,16 +57,23 @@ class BLTouchEndstopWrapper:
if print_time < self.next_test_time:
self.next_test_time = print_time + TEST_TIME
return
+ # Raise the bltouch probe and test if probe is raised
self.send_cmd(print_time, CMD_RESET)
home_time = print_time + PIN_MOVE_TIME
self.send_cmd(home_time, CMD_TOUCH_MODE)
self.send_cmd(home_time + MIN_CMD_TIME, 0.)
+ # Perform endstop check to verify bltouch reports probe raised
+ prev_positions = [s.get_commanded_position()
+ for s in self.mcu_endstop.get_steppers()]
self.mcu_endstop.home_start(
home_time, ENDSTOP_SAMPLE_TIME, ENDSTOP_SAMPLE_COUNT, .001)
try:
self.mcu_endstop.home_wait(home_time + MIN_CMD_TIME)
except self.mcu_endstop.TimeoutError as e:
raise homing.EndstopError("BLTouch sensor test failed")
+ for s, pos in zip(self.mcu_endstop.get_steppers(), prev_positions):
+ s.set_commanded_position(pos)
+ # Test was successful
self.next_test_time = home_time + TEST_TIME
toolhead.reset_print_time(home_time + 2. * MIN_CMD_TIME)
def home_prepare(self):