Smoother motion by fixing calculating trapezoids and ISR stepping.
Fix rounding directions in calculate_trapezoid_for_block().
Fix off-by-ones errors in ac/deceleration steps in block_phase_isr.
Half-initialize ac/deceleration_time to smooth the speed change shock that happens between segments, which is critical as jerk/deviation adds to this.
The result is a smoother motion profile that follows the imposed acceleration limits with a well defined 0.5-1.5x error factor (or 2x if axis is starting from ~0). Errors are due to converting a real-valued motion profile into discrete numbers of steps.
Fixes are general and improve S_CURVE_ACCELERATION too (no endorsement implied).
Tested by looking at the generated step/dir impulses with a logic analyzer.
Enjoy the smoother motion or use more aggresive acceleration/jerk/deviation values for faster prints.
Also improves: #12491
Remove nominal_length, remove MINIMAL_STEP_RATE, add min_entry_speed_sqr, initial clean up of reverse_pass_kernel and forward_pass_kernel.
Removing MINIMAL_STEP_RATE allows for correct handling of moves with low acceleration, including fixing judder that's caused when the planner computes an entry speed based on minimum_planner_speed_sqr that's then promptly overriden by MINIMAL_STEP_RATE.
Added min_entry_speed_sqr to avoid a specific potential source of judder due to working with discrete steps rather continuous real-valued physics. The first step of any segment runs at initial_rate. If it is too low compared to acceleration_steps_per_s2 it will result in too much accumulated acceleration_time (see stepper.cpp) which will mean the following step will be at a much higher speed, and the speed change will significantly surpass the set acceleration_steps_per_s2 limit. Making sure we can match this limit is why we have minimum_planner_speed_sqr in the first place.
Optimal number of sqrts and trapezoid calculations.
Remove forward_pass(). Call forward_pass_kernel() from recalculate() instead.
Fix potential for large speed changes if planner falls behind.
group for clarity and review
as described
combined float sq
match modified names
Optimal number of sqrts and trapezoid calculations.
Remove forward_pass(). Call forward_pass_kernel() from recalculate() instead.
Fix potential for large speed changes if planner falls behind.
Save and use block->steps_per_mm to avoid many divisions.
Fix planner wrong trap generation
If the planner `entry_rate` or `final_rate` are larger thanthe `block->nominal_rate` then the trapezoid entry ramp continuously accelerates. Only happens if feed rate is less than MAXIMAL_STEP_RATE.
Update planner.cpp
removed
Update planner.h
Moved MINIMAL_STEP_RATE to this file.
Update planner.h
Added calc for MINIMAL_STEP_RATE
Update planner.h
fix minimal_step_rate calc
Update planner.h
Remove MINIMAL_STEP_RATE
Revert "Update planner.cpp"
This reverts commit 5e0158a8ee1340e5b0e6a7313eb5f5f7058bfa15.
Revert "Update planner.h"
This reverts commit 3da5d0c00102620dc7eddf46a30044773770a667.
Update planner.cpp
Update planner.h
Update planner.cpp
ws
Apply to min_step_rate