The > condition here can allow extra uSeconds of time to creep in to the stepping:
|
this->last_step_time = now; |
Since the condition to advance a step is >=, the result will be fewer steps than expected, in a given time frame.
This can be fixed by changing Stepper.cpp:201 to:
this->last_step_time += this->step_delay;
Argument for the existing code: that if the processor gets bogged down, the motors will step slower, and guarantee step counts. But, everything slows down.
Argument for updating the code: start to finish timing stays correct, but as the processor bogs down, it can lose steps at higher speeds.
Thank you for your attention to this detail.
Gerald Lafreniere
The
>condition here can allow extra uSeconds of time to creep in to the stepping:Stepper/src/Stepper.cpp
Line 201 in 4068b93
Since the condition to advance a step is
>=, the result will be fewer steps than expected, in a given time frame.This can be fixed by changing
Stepper.cpp:201to:Argument for the existing code: that if the processor gets bogged down, the motors will step slower, and guarantee step counts. But, everything slows down.
Argument for updating the code: start to finish timing stays correct, but as the processor bogs down, it can lose steps at higher speeds.
Thank you for your attention to this detail.
Gerald Lafreniere