dda.c: no cruising time when rampup_steps == move_step_no

In some cases when move_step_no is equal to rampup_steps, this
algorithm think it is cruising. When cruising it setup the dda->c
to dda->c_min. Which is wrong in that case.

So we let recalculate the dda->c now. The axis will become a little
bit faster for none-cruising movements. When it hits cruising,
it will be capped anyway to dda->c_min. So the "TODO: check is obsolete"
is not obsolete anymore.
This commit is contained in:
Nico Tonnhofer 2018-02-16 08:45:57 +01:00
parent b0a1d55f03
commit 6f46e95b77
1 changed files with 1 additions and 4 deletions

5
dda.c
View File

@ -865,7 +865,7 @@ void dda_clock() {
move_step_no = dda->total_steps - move_step;
recalc_speed = 0;
if (move_step_no < dda->rampup_steps) {
if (move_step_no <= dda->rampup_steps) {
#ifdef LOOKAHEAD
move_n = dda->start_steps + move_step_no;
#else
@ -896,9 +896,6 @@ void dda_clock() {
int_inv_sqrt(move_n)) >> 13;
#endif
// TODO: most likely this whole check is obsolete. It was left as a
// safety margin, only. Rampup steps calculation should be accurate
// now and give the requested target speed within a few percent.
if (move_c < dda->c_min) {
// We hit max speed not always exactly.
move_c = dda->c_min;