delta: Add a special case to the limit checks for the homing position

When a delta printer has different arm lengths or different endstop
positions then the homing position falls outside of the normal
printable area.  Add a special check to the range checking code to
permit this move instead of homing to a position near the actual
homing position.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-10-08 15:36:41 -04:00
parent bd1ba86839
commit 459e521991
1 changed files with 5 additions and 4 deletions

View File

@ -54,6 +54,8 @@ class DeltaKinematics:
# Setup boundary checks # Setup boundary checks
self.need_motor_enable = self.need_home = True self.need_motor_enable = self.need_home = True
self.limit_xy2 = -1. self.limit_xy2 = -1.
self.home_position = tuple(
self._actuator_to_cartesian(self.abs_endstops))
self.max_z = min([rail.get_homing_info().position_endstop self.max_z = min([rail.get_homing_info().position_endstop
for rail in self.rails]) for rail in self.rails])
self.min_z = config.getfloat('minimum_z_position', 0, maxval=self.max_z) self.min_z = config.getfloat('minimum_z_position', 0, maxval=self.max_z)
@ -97,10 +99,9 @@ class DeltaKinematics:
def home(self, homing_state): def home(self, homing_state):
# All axes are homed simultaneously # All axes are homed simultaneously
homing_state.set_axes([0, 1, 2]) homing_state.set_axes([0, 1, 2])
homepos = [0., 0., self.max_z, None] forcepos = list(self.home_position)
forcepos = list(homepos)
forcepos[2] = -1.5 * math.sqrt(max(self.arm2)-self.max_xy2) forcepos[2] = -1.5 * math.sqrt(max(self.arm2)-self.max_xy2)
homing_state.home_rails(self.rails, forcepos, homepos, homing_state.home_rails(self.rails, forcepos, self.home_position,
limit_speed=self.max_z_velocity) limit_speed=self.max_z_velocity)
# Set final homed position # Set final homed position
spos = [ep + rail.get_homed_offset() spos = [ep + rail.get_homed_offset()
@ -127,7 +128,7 @@ class DeltaKinematics:
if end_pos[2] > self.limit_z: if end_pos[2] > self.limit_z:
limit_xy2 = min(limit_xy2, (self.max_z - end_pos[2])**2) limit_xy2 = min(limit_xy2, (self.max_z - end_pos[2])**2)
if (xy2 > limit_xy2 or end_pos[2] < self.min_z if (xy2 > limit_xy2 or end_pos[2] < self.min_z
or end_pos[2] > self.max_z): or end_pos[2] > self.max_z) and end_pos[:3] != self.home_position:
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)