diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-12-13 16:58:34 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-12-16 11:06:41 -0500 |
commit | ccc25a03d5fc4a17f7112e2b343335aa71a48faf (patch) | |
tree | b1882a61c25f6718ebb84dc08a66e1b4be0c519d /klippy/extras | |
parent | ce064e6e2d842632c5c39341882f24f6ed20243c (diff) | |
download | kutter-ccc25a03d5fc4a17f7112e2b343335aa71a48faf.tar.gz kutter-ccc25a03d5fc4a17f7112e2b343335aa71a48faf.tar.xz kutter-ccc25a03d5fc4a17f7112e2b343335aa71a48faf.zip |
bltouch: Add a config option to disable the bltouch sensor test
It appears some bltouch "clones" do not report the probe as triggered
when put in "touch mode" while the pin is raised. Add a config option
to allow users to disable the test.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras')
-rw-r--r-- | klippy/extras/bltouch.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/klippy/extras/bltouch.py b/klippy/extras/bltouch.py index 9da9646d..58a78ca4 100644 --- a/klippy/extras/bltouch.py +++ b/klippy/extras/bltouch.py @@ -23,7 +23,6 @@ Commands = { class BLTouchEndstopWrapper: def __init__(self, config): self.printer = config.get_printer() - self.next_test_time = 0. self.position_endstop = config.getfloat('z_offset') # Create a pwm object to handle the control pin ppins = self.printer.lookup_object('pins') @@ -36,6 +35,9 @@ class BLTouchEndstopWrapper: mcu = pin_params['chip'] mcu.register_config_callback(self._build_config) self.mcu_endstop = mcu.setup_pin('endstop', pin_params) + # Setup for sensor test + self.next_test_time = 0. + self.test_sensor_pin = config.getboolean('test_sensor_pin', True) # Calculate pin move time pmt = max(config.getfloat('pin_move_time', 0.200), MIN_CMD_TIME) self.pin_move_time = math.ceil(pmt / SIGNAL_PERIOD) * SIGNAL_PERIOD @@ -58,6 +60,8 @@ class BLTouchEndstopWrapper: def send_cmd(self, print_time, cmd): self.mcu_pwm.set_pwm(print_time, Commands[cmd] / SIGNAL_PERIOD) def test_sensor(self): + if not self.test_sensor_pin: + return toolhead = self.printer.lookup_object('toolhead') print_time = toolhead.get_last_move_time() if print_time < self.next_test_time: |