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>
This commit is contained in:
Kevin O'Connor 2018-10-27 11:43:24 -04:00
parent a33792f07e
commit 936a4acd0d
1 changed files with 11 additions and 8 deletions

View File

@ -114,24 +114,27 @@ class DeltaKinematics:
self.need_motor_enable = False self.need_motor_enable = False
def check_move(self, move): def check_move(self, move):
end_pos = move.end_pos end_pos = move.end_pos
xy2 = end_pos[0]**2 + end_pos[1]**2 end_xy2 = end_pos[0]**2 + end_pos[1]**2
if xy2 <= self.limit_xy2 and not move.axes_d[2]: if end_xy2 <= self.limit_xy2 and not move.axes_d[2]:
# Normal XY move # Normal XY move
return return
if self.need_home: if self.need_home:
raise homing.EndstopMoveError(end_pos, "Must home first") raise homing.EndstopMoveError(end_pos, "Must home first")
end_z = end_pos[2]
limit_xy2 = self.max_xy2 limit_xy2 = self.max_xy2
if end_pos[2] > self.limit_z: if end_z > self.limit_z:
limit_xy2 = min(limit_xy2, (self.max_z - end_pos[2])**2) limit_xy2 = min(limit_xy2, (self.max_z - end_z)**2)
if (xy2 > limit_xy2 or end_pos[2] < self.min_z if end_xy2 > limit_xy2 or end_z > self.max_z or end_z < self.min_z:
or end_pos[2] > self.max_z) and end_pos[:3] != self.home_position: # 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) raise homing.EndstopMoveError(end_pos)
if move.axes_d[2]: if move.axes_d[2]:
move.limit_speed(self.max_z_velocity, move.accel) move.limit_speed(self.max_z_velocity, move.accel)
limit_xy2 = -1. limit_xy2 = -1.
# Limit the speed/accel of this move if is is at the extreme # Limit the speed/accel of this move if is is at the extreme
# end of the build envelope # 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: if extreme_xy2 > self.slow_xy2:
r = 0.5 r = 0.5
if extreme_xy2 > self.very_slow_xy2: if extreme_xy2 > self.very_slow_xy2: