Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

Commit

Permalink
dda.c: no cruising time when rampup_steps == move_step_no
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Wurstnase committed Feb 16, 2018
1 parent b0a1d55 commit 6f46e95
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions dda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6f46e95

Please sign in to comment.