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 <dmbutyugin@google.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-09-24 22:46:17 -04:00
parent f8f0c3f142
commit 9fcd3e75cd
1 changed files with 3 additions and 2 deletions

View File

@ -157,8 +157,9 @@ class MoveQueue:
if delayed: if delayed:
# Propagate peak_cruise_v2 to any delayed moves # Propagate peak_cruise_v2 to any delayed moves
if not update_flush_count and i < flush_count: if not update_flush_count and i < flush_count:
for m, ms_v2, me_v2 in delayed: mc_v2 = peak_cruise_v2
mc_v2 = min(peak_cruise_v2, ms_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 m.set_junction(min(ms_v2, mc_v2), mc_v2
, min(me_v2, mc_v2)) , min(me_v2, mc_v2))
del delayed[:] del delayed[:]