diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-12-06 01:00:33 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-01-28 12:19:26 -0500 |
commit | ce9db609ad6f0f99c171b643464fe1e6963ec6c6 (patch) | |
tree | 5cc4ea8158c441b451e12619fc6d08a46a97bc86 /klippy/homing.py | |
parent | 6c252d30f5530982db0986b79f8eb1895f7d48f0 (diff) | |
download | kutter-ce9db609ad6f0f99c171b643464fe1e6963ec6c6.tar.gz kutter-ce9db609ad6f0f99c171b643464fe1e6963ec6c6.tar.xz kutter-ce9db609ad6f0f99c171b643464fe1e6963ec6c6.zip |
probe: Initial support for Z-Probe hardware
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/homing.py')
-rw-r--r-- | klippy/homing.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/klippy/homing.py b/klippy/homing.py index 3a926083..276c31d9 100644 --- a/klippy/homing.py +++ b/klippy/homing.py @@ -40,7 +40,7 @@ class Homing: dist_ticks = adjusted_freq * mcu_stepper.get_step_dist() ticks_per_step = math.ceil(dist_ticks / speed) return dist_ticks / ticks_per_step - def homing_move(self, movepos, endstops, speed): + def homing_move(self, movepos, endstops, speed, probe_pos=False): # Start endstop checking print_time = self.toolhead.get_last_move_time() for mcu_endstop, name in endstops: @@ -50,9 +50,10 @@ class Homing: print_time, ENDSTOP_SAMPLE_TIME, ENDSTOP_SAMPLE_COUNT, min_step_dist / speed) # Issue move + movepos = self._fill_coord(movepos) error = None try: - self.toolhead.move(self._fill_coord(movepos), speed) + self.toolhead.move(movepos, speed) except EndstopError as e: error = "Error during homing move: %s" % (str(e),) # Wait for endstops to trigger @@ -64,6 +65,11 @@ class Homing: except mcu_endstop.TimeoutError as e: if error is None: error = "Failed to home %s: %s" % (name, str(e)) + if probe_pos: + self.set_homed_position( + list(self.toolhead.get_kinematics().get_position()) + [None]) + else: + self.toolhead.set_position(movepos) if error is not None: raise EndstopError(error) def home(self, forcepos, movepos, endstops, speed, second_home=False): |