delta: Allow the user to specify a minimum z position

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-12-22 21:44:56 -05:00
parent 978777f09f
commit 6c252d30f5
2 changed files with 5 additions and 1 deletions

View File

@ -99,6 +99,9 @@ max_z_velocity: 150
# maximum speed of up/down moves (which require a higher step rate
# than other moves on a delta printer). The default is to use
# max_velocity for max_z_velocity.
#minimum_z_position: 0
# The minimum Z position that the user may command the head to move
# to. The default is 0.
delta_radius: 174.75
# Radius (in mm) of the horizontal circle formed by the three linear
# axis towers. This parameter may also be calculated as:

View File

@ -33,6 +33,7 @@ class DeltaKinematics:
for s, arm2 in zip(self.steppers, self.arm2)]
self.limit_xy2 = -1.
self.max_z = min([s.position_endstop for s in self.steppers])
self.min_z = config.getfloat('minimum_z_position', 0, maxval=self.max_z)
self.limit_z = min([ep - arm
for ep, arm in zip(self.endstops, arm_lengths)])
logging.info(
@ -148,7 +149,7 @@ class DeltaKinematics:
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] < 0. or end_pos[2] > self.max_z:
if xy2 > limit_xy2 or end_pos[2] < self.min_z or end_pos[2] > self.max_z:
raise homing.EndstopMoveError(end_pos)
if move.axes_d[2]:
move.limit_speed(self.max_z_velocity, move.accel)