From 6f46e95b772227e460206abf170faa8c0f766358 Mon Sep 17 00:00:00 2001 From: Nico Tonnhofer Date: Fri, 16 Feb 2018 08:45:57 +0100 Subject: [PATCH] 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. --- dda.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dda.c b/dda.c index c855ade..9c5200a 100644 --- a/dda.c +++ b/dda.c @@ -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;