bltouch: Use hmove.check_no_movement() to verify bltouch deployed

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-03-29 14:29:33 -04:00
parent cdaf9379b0
commit c9ae89e142
1 changed files with 3 additions and 10 deletions

View File

@ -1,6 +1,6 @@
# BLTouch support # BLTouch support
# #
# Copyright (C) 2018-2020 Kevin O'Connor <kevin@koconnor.net> # Copyright (C) 2018-2021 Kevin O'Connor <kevin@koconnor.net>
# #
# This file may be distributed under the terms of the GNU GPLv3 license. # This file may be distributed under the terms of the GNU GPLv3 license.
import logging import logging
@ -55,7 +55,6 @@ class BLTouchEndstopWrapper:
'pin_up_reports_not_triggered', True) 'pin_up_reports_not_triggered', True)
self.pin_up_touch_triggered = config.getboolean( self.pin_up_touch_triggered = config.getboolean(
'pin_up_touch_mode_reports_triggered', True) 'pin_up_touch_mode_reports_triggered', True)
self.start_mcu_pos = []
# Calculate pin move time # Calculate pin move time
self.pin_move_time = config.getfloat('pin_move_time', 0.680, above=0.) self.pin_move_time = config.getfloat('pin_move_time', 0.680, above=0.)
# Wrappers # Wrappers
@ -183,17 +182,11 @@ class BLTouchEndstopWrapper:
if self.multi == 'FIRST': if self.multi == 'FIRST':
self.multi = 'ON' self.multi = 'ON'
self.sync_print_time() self.sync_print_time()
toolhead = self.printer.lookup_object('toolhead')
toolhead.flush_step_generation()
self.start_mcu_pos = [(s, s.get_mcu_position())
for s in self.mcu_endstop.get_steppers()]
def probe_finish(self, hmove): def probe_finish(self, hmove):
if self.multi == 'OFF': if self.multi == 'OFF':
self.raise_probe() self.raise_probe()
self.sync_print_time() self.sync_print_time()
# Verify the probe actually deployed during the attempt if hmove.check_no_movement() is not None:
for s, mcu_pos in self.start_mcu_pos:
if s.get_mcu_position() == mcu_pos:
raise self.printer.command_error("BLTouch failed to deploy") raise self.printer.command_error("BLTouch failed to deploy")
def home_start(self, print_time, sample_time, sample_count, rest_time, def home_start(self, print_time, sample_time, sample_count, rest_time,
triggered=True): triggered=True):