From 9fcd3e75cd69ba265cce41f436dc1d1187f433e6 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 24 Sep 2019 22:46:17 -0400 Subject: [PATCH] toolhead: Fix velocity jumps in accel_to_decel lookahead processing When reducing the maximum speed due to the max_accel_to_decel setting, move velocity limits must still be propagated. Otherwise, the trapezoid move planner may produce moves with velocity jumps. Signed-off-by: Dmitry Butyugin Signed-off-by: Kevin O'Connor --- klippy/toolhead.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/klippy/toolhead.py b/klippy/toolhead.py index 5b076dd5..f697cb1b 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -157,8 +157,9 @@ class MoveQueue: if delayed: # Propagate peak_cruise_v2 to any delayed moves if not update_flush_count and i < flush_count: - for m, ms_v2, me_v2 in delayed: - mc_v2 = min(peak_cruise_v2, ms_v2) + mc_v2 = peak_cruise_v2 + for m, ms_v2, me_v2 in reversed(delayed): + mc_v2 = min(mc_v2, ms_v2) m.set_junction(min(ms_v2, mc_v2), mc_v2 , min(me_v2, mc_v2)) del delayed[:]