Fix missing deceleration steps
Marlin never reached final_speed after deceleration.
This commit is contained in:
parent
a0bd811093
commit
4fa0937a55
2 changed files with 5 additions and 2 deletions
|
|
@ -733,8 +733,11 @@ void Stepper::isr() {
|
|||
|
||||
#endif // LIN_ADVANCE
|
||||
}
|
||||
else if (step_events_completed > (uint32_t)current_block->decelerate_after) {
|
||||
else if (step_events_completed >= (uint32_t)current_block->decelerate_after && current_block->step_event_count != (uint32_t)current_block->decelerate_after) {
|
||||
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);
|
||||
|
||||
if (step_rate < acc_step_rate) { // Still decelerating?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue