Revert "[1.1.x] Fix missing deceleration steps"
This commit is contained in:
parent
ec028faa1b
commit
ba9aa47260
@ -218,7 +218,7 @@ void Planner::calculate_trapezoid_for_block(block_t* const block, const float &e
|
|||||||
|
|
||||||
// Steps required for acceleration, deceleration to/from nominal rate
|
// Steps required for acceleration, deceleration to/from nominal rate
|
||||||
int32_t accelerate_steps = CEIL(estimate_acceleration_distance(initial_rate, block->nominal_rate, accel)),
|
int32_t accelerate_steps = CEIL(estimate_acceleration_distance(initial_rate, block->nominal_rate, accel)),
|
||||||
decelerate_steps = CEIL(estimate_acceleration_distance(block->nominal_rate, final_rate, -accel)),
|
decelerate_steps = FLOOR(estimate_acceleration_distance(block->nominal_rate, final_rate, -accel)),
|
||||||
// Steps between acceleration and deceleration, if any
|
// Steps between acceleration and deceleration, if any
|
||||||
plateau_steps = block->step_event_count - accelerate_steps - decelerate_steps;
|
plateau_steps = block->step_event_count - accelerate_steps - decelerate_steps;
|
||||||
|
|
||||||
|
@ -733,11 +733,8 @@ void Stepper::isr() {
|
|||||||
|
|
||||||
#endif // LIN_ADVANCE
|
#endif // LIN_ADVANCE
|
||||||
}
|
}
|
||||||
else if (step_events_completed >= (uint32_t)current_block->decelerate_after && current_block->step_event_count != (uint32_t)current_block->decelerate_after) {
|
else if (step_events_completed > (uint32_t)current_block->decelerate_after) {
|
||||||
uint16_t step_rate;
|
uint16_t step_rate;
|
||||||
// If we are entering the deceleration phase for the first time, we have to see how long we have been decelerating up to now. Equals last acceleration time interval.
|
|
||||||
if (!deceleration_time)
|
|
||||||
deceleration_time = calc_timer_interval(acc_step_rate);
|
|
||||||
MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate);
|
MultiU24X32toH16(step_rate, deceleration_time, current_block->acceleration_rate);
|
||||||
|
|
||||||
if (step_rate < acc_step_rate) { // Still decelerating?
|
if (step_rate < acc_step_rate) { // Still decelerating?
|
||||||
|
Loading…
Reference in New Issue
Block a user