mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-14 10:17:56 -06:00
homing: Direct stepper phase detection from kinematic classes
Change the scheduling of the final homed position (which takes into account the stepper phases) so that it is scheduled from the kinematic classes instead of from the toolhead class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
781cf608d7
commit
2b5b899d35
4 changed files with 17 additions and 16 deletions
|
@ -28,9 +28,12 @@ class CartKinematics:
|
|||
max_xy_speed = min(s.max_velocity for s in self.steppers[:2])
|
||||
max_xy_accel = min(s.max_accel for s in self.steppers[:2])
|
||||
return max_xy_speed, max_xy_accel
|
||||
def get_homed_position(self):
|
||||
return [s.position_endstop + s.get_homed_offset()*s.step_dist
|
||||
for s in self.steppers]
|
||||
def get_homed_position(self, homing_state):
|
||||
pos = [None]*3
|
||||
for axis in homing_state.get_axes():
|
||||
s = self.steppers[axis]
|
||||
pos[axis] = s.position_endstop + s.get_homed_offset()*s.step_dist
|
||||
return pos
|
||||
def home(self, homing_state):
|
||||
# Each axis is homed independently and in order
|
||||
for axis in homing_state.get_axes():
|
||||
|
@ -59,6 +62,7 @@ class CartKinematics:
|
|||
# Home again
|
||||
coord[axis] = r2pos
|
||||
homing_state.plan_home(list(coord), homepos, [s], s.homing_speed/2.0)
|
||||
homing_state.plan_calc_position(self.get_homed_position)
|
||||
def motor_off(self, move_time):
|
||||
self.limits = [(1.0, -1.0)] * 3
|
||||
for stepper in self.steppers:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue