mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-14 18:28:00 -06:00
probe: Initial support for Z-Probe hardware
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
6c252d30f5
commit
ce9db609ad
7 changed files with 91 additions and 6 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue