diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-11-18 11:49:05 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-11-18 14:04:10 -0500 |
commit | 2b5b899d35d33ed6b8bfb90133d22095d0a56c66 (patch) | |
tree | 8a0c8eb604ee6a30de9ee21d4571200717eda33e /klippy/cartesian.py | |
parent | 781cf608d778798c976d3cb4edb6ea6b028b66e1 (diff) | |
download | kutter-2b5b899d35d33ed6b8bfb90133d22095d0a56c66.tar.gz kutter-2b5b899d35d33ed6b8bfb90133d22095d0a56c66.tar.xz kutter-2b5b899d35d33ed6b8bfb90133d22095d0a56c66.zip |
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>
Diffstat (limited to 'klippy/cartesian.py')
-rw-r--r-- | klippy/cartesian.py | 10 |
1 files changed, 7 insertions, 3 deletions
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: |