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:
parent
b0a1d55f03
commit
6f46e95b77
5
dda.c
5
dda.c
|
|
@ -865,7 +865,7 @@ void dda_clock() {
|
||||||
move_step_no = dda->total_steps - move_step;
|
move_step_no = dda->total_steps - move_step;
|
||||||
|
|
||||||
recalc_speed = 0;
|
recalc_speed = 0;
|
||||||
if (move_step_no < dda->rampup_steps) {
|
if (move_step_no <= dda->rampup_steps) {
|
||||||
#ifdef LOOKAHEAD
|
#ifdef LOOKAHEAD
|
||||||
move_n = dda->start_steps + move_step_no;
|
move_n = dda->start_steps + move_step_no;
|
||||||
#else
|
#else
|
||||||
|
|
@ -896,9 +896,6 @@ void dda_clock() {
|
||||||
int_inv_sqrt(move_n)) >> 13;
|
int_inv_sqrt(move_n)) >> 13;
|
||||||
#endif
|
#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) {
|
if (move_c < dda->c_min) {
|
||||||
// We hit max speed not always exactly.
|
// We hit max speed not always exactly.
|
||||||
move_c = dda->c_min;
|
move_c = dda->c_min;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue