From 05edd556c318469647e929af1497f40793b1894d Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 1 Sep 2019 18:19:16 -0400 Subject: [PATCH] toolhead: Fix homing moves not apply kinematic acceleration limits During a "drip feed" move, both the move's maximum speed and maximum acceleration may be limited by the kinematics. Signed-off-by: Kevin O'Connor --- klippy/toolhead.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/klippy/toolhead.py b/klippy/toolhead.py index d739e919..5b076dd5 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -427,6 +427,7 @@ class ToolHead: return self.kin.check_move(move) speed = math.sqrt(move.max_cruise_v2) + move_accel = move.accel # Transition to "Flushed" state and then to "Drip" state self._full_flush() self.special_queuing_state = "Drip" @@ -442,9 +443,13 @@ class ToolHead: try: for i in range(num_moves-1): next_pos = [p + d for p, d in zip(prev_pos, submove_d)] - self.move_queue.add_move(Move(self, prev_pos, next_pos, speed)) + smove = Move(self, prev_pos, next_pos, speed) + smove.limit_speed(speed, move_accel) + self.move_queue.add_move(smove) prev_pos = next_pos - self.move_queue.add_move(Move(self, prev_pos, move.end_pos, speed)) + smove = Move(self, prev_pos, move.end_pos, speed) + smove.limit_speed(speed, move_accel) + self.move_queue.add_move(smove) self.move_queue.flush() except DripModeEndSignal as e: self.move_queue.reset()