diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-10-27 11:43:24 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-10-27 11:43:24 -0400 |
commit | 936a4acd0d976927e06d1d3d47bdfc8e4296e33f (patch) | |
tree | 543a52381844bef03c21f5b68b7c67bf24c219b7 /klippy/kinematics/delta.py | |
parent | a33792f07e4d3f1f3c79c16d893b9193ef57e09d (diff) | |
download | kutter-936a4acd0d976927e06d1d3d47bdfc8e4296e33f.tar.gz kutter-936a4acd0d976927e06d1d3d47bdfc8e4296e33f.tar.xz kutter-936a4acd0d976927e06d1d3d47bdfc8e4296e33f.zip |
delta: Make sure to also exempt the homing retract move from boundary checks
Commit 459e5219 added a special case to the boundary checks to permit
homing moves. In some cases, the second home retract could also be
outside the normal boundary checks - extend the special case to also
permit that move.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/kinematics/delta.py')
-rw-r--r-- | klippy/kinematics/delta.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/klippy/kinematics/delta.py b/klippy/kinematics/delta.py index d770ec1d..e644534f 100644 --- a/klippy/kinematics/delta.py +++ b/klippy/kinematics/delta.py @@ -114,24 +114,27 @@ class DeltaKinematics: self.need_motor_enable = False def check_move(self, move): end_pos = move.end_pos - xy2 = end_pos[0]**2 + end_pos[1]**2 - if xy2 <= self.limit_xy2 and not move.axes_d[2]: + end_xy2 = end_pos[0]**2 + end_pos[1]**2 + if end_xy2 <= self.limit_xy2 and not move.axes_d[2]: # Normal XY move return if self.need_home: raise homing.EndstopMoveError(end_pos, "Must home first") + end_z = end_pos[2] limit_xy2 = self.max_xy2 - if end_pos[2] > self.limit_z: - limit_xy2 = min(limit_xy2, (self.max_z - end_pos[2])**2) - if (xy2 > limit_xy2 or end_pos[2] < self.min_z - or end_pos[2] > self.max_z) and end_pos[:3] != self.home_position: - raise homing.EndstopMoveError(end_pos) + if end_z > self.limit_z: + limit_xy2 = min(limit_xy2, (self.max_z - end_z)**2) + if end_xy2 > limit_xy2 or end_z > self.max_z or end_z < self.min_z: + # Move out of range - verify not a homing move + if (end_pos[:2] != self.home_position[:2] + or end_z < self.min_z or end_z > self.home_position[2]): + raise homing.EndstopMoveError(end_pos) if move.axes_d[2]: move.limit_speed(self.max_z_velocity, move.accel) limit_xy2 = -1. # Limit the speed/accel of this move if is is at the extreme # end of the build envelope - extreme_xy2 = max(xy2, move.start_pos[0]**2 + move.start_pos[1]**2) + extreme_xy2 = max(end_xy2, move.start_pos[0]**2 + move.start_pos[1]**2) if extreme_xy2 > self.slow_xy2: r = 0.5 if extreme_xy2 > self.very_slow_xy2: |