From 71b4923208b0fda7810d923ae8e2a178030eebac Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 1 Dec 2016 16:04:48 -0500 Subject: [PATCH] delta: Support limiting the maximum velocity of z moves On a delta printer, z moves require the mcu to support the greatest number of steps per second. However, z moves are rare, so it makes sense to limit the velocity of z moves separately from the velocity of normal xy moves. Signed-off-by: Kevin O'Connor --- config/example-delta.cfg | 7 ++++++- klippy/delta.py | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config/example-delta.cfg b/config/example-delta.cfg index 5954be68..c2a46db0 100644 --- a/config/example-delta.cfg +++ b/config/example-delta.cfg @@ -79,8 +79,13 @@ pin_map: arduino [printer] kinematics: delta # This option must be "delta" for linear delta printers -max_velocity: 200 +max_velocity: 300 max_accel: 3000 +max_z_velocity: 200 +# For delta printers this limits the maximum velocity (in mm/s) of +# moves with z axis movement. This setting can be used to reduce the +# maximum speed of up/down moves (which require a higher step rate +# than other moves on a delta printer). delta_arm_length: 333.0 # Length (in mm) of the diagonal rods that connect the linear axes # to the print head diff --git a/klippy/delta.py b/klippy/delta.py index 3b2ad674..ef7dbde7 100644 --- a/klippy/delta.py +++ b/klippy/delta.py @@ -14,6 +14,7 @@ class DeltaKinematics: printer, config.getsection('stepper_' + n), n) for n in ['a', 'b', 'c']] self.need_motor_enable = True + self.max_z_velocity = config.getfloat('max_z_velocity', 9999999.9) radius = config.getfloat('delta_radius') arm_length = config.getfloat('delta_arm_length') self.arm_length2 = arm_length**2 @@ -122,6 +123,8 @@ class DeltaKinematics: if end_pos[2] > self.limit_z: if end_pos[2] > self.max_z or xy2 > (self.max_z - end_pos[2])**2: raise homing.EndstopMoveError(end_pos) + if move.axes_d[2]: + move.limit_speed(self.max_z_velocity, 9999999.9) def move_z(self, move_time, move): if not move.axes_d[2]: return