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.
This commit is contained in:
committed by
InsanityAutomation
parent
3481add963
commit
efb4ffcc97
@@ -796,6 +796,10 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t
|
||||
|
||||
uint32_t final_rate = block->nominal_rate; // (steps per second)
|
||||
if (exit_factor < 1.0f) final_rate *= exit_factor;
|
||||
// Limit minimal step rate (Otherwise the timer will overflow.)
|
||||
NOLESS(initial_rate, uint32_t(MINIMAL_STEP_RATE));
|
||||
NOLESS(final_rate, uint32_t(MINIMAL_STEP_RATE));
|
||||
NOLESS(block->nominal_rate, (uint32_t)MINIMAL_STEP_RATE);
|
||||
|
||||
#if ANY(S_CURVE_ACCELERATION, LIN_ADVANCE)
|
||||
// If we have some plateau time, the cruise rate will be the nominal rate
|
||||
|
||||
Reference in New Issue
Block a user