diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-10-25 19:11:05 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-10-25 19:19:29 -0400 |
commit | 6a96e83ea923ebd0d3a84da218afda020b8b9612 (patch) | |
tree | 695901a66269bf24df3c1555a0fa5184a820ee73 /klippy/cartesian.py | |
parent | 306db9a8516a42258346a1292da550199a06d8d6 (diff) | |
download | kutter-6a96e83ea923ebd0d3a84da218afda020b8b9612.tar.gz kutter-6a96e83ea923ebd0d3a84da218afda020b8b9612.tar.xz kutter-6a96e83ea923ebd0d3a84da218afda020b8b9612.zip |
toolhead: Store both the start and end position in the Move class
Store the start position (in addition to the existing end position) in
the Move class. The start position can be useful to the kinematic
classes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/cartesian.py')
-rw-r--r-- | klippy/cartesian.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/klippy/cartesian.py b/klippy/cartesian.py index 860ce9fd..60fe9976 100644 --- a/klippy/cartesian.py +++ b/klippy/cartesian.py @@ -67,16 +67,17 @@ class CartKinematics: def query_endstops(self, move_time): return homing.QueryEndstops(["x", "y", "z"], self.steppers) def check_endstops(self, move): + end_pos = move.end_pos for i in StepList: if (move.axes_d[i] - and (move.pos[i] < self.limits[i][0] - or move.pos[i] > self.limits[i][1])): + and (end_pos[i] < self.limits[i][0] + or end_pos[i] > self.limits[i][1])): if self.limits[i][0] > self.limits[i][1]: - raise homing.EndstopError(move.pos, "Must home axis first") - raise homing.EndstopError(move.pos) + raise homing.EndstopError(end_pos, "Must home axis first") + raise homing.EndstopError(end_pos) def check_move(self, move): limits = self.limits - xpos, ypos = move.pos[:2] + xpos, ypos = move.end_pos[:2] if (xpos < limits[0][0] or xpos > limits[0][1] or ypos < limits[1][0] or ypos > limits[1][1]): self.check_endstops(move) @@ -96,7 +97,8 @@ class CartKinematics: inv_accel = 1. / move.accel inv_cruise_v = 1. / move.cruise_v for i in StepList: - new_step_pos = int(move.pos[i]*self.steppers[i].inv_step_dist + 0.5) + new_step_pos = int( + move.end_pos[i]*self.steppers[i].inv_step_dist + 0.5) steps = new_step_pos - self.stepper_pos[i] if not steps: continue |