From 2b5b899d35d33ed6b8bfb90133d22095d0a56c66 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 18 Nov 2016 11:49:05 -0500 Subject: 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 --- klippy/cartesian.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'klippy/cartesian.py') diff --git a/klippy/cartesian.py b/klippy/cartesian.py index c1cddc7d..706ebc5e 100644 --- a/klippy/cartesian.py +++ b/klippy/cartesian.py @@ -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: -- cgit v1.2.3-70-g09d2