From 12167bc8f35d231a726801890a097de7094470f7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 2 Nov 2016 01:28:19 -0500 Subject: [PATCH] OLD_SLOWDOWN does nothing, so remove it --- Marlin/planner.cpp | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 5c64c609a..4ee21af89 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -929,24 +929,18 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const int moves_queued = movesplanned(); // Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill - #if ENABLED(OLD_SLOWDOWN) || ENABLED(SLOWDOWN) - bool mq = moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2; - #if ENABLED(OLD_SLOWDOWN) - if (mq) fr_mm_s *= 2.0 * moves_queued / (BLOCK_BUFFER_SIZE); - #endif - #if ENABLED(SLOWDOWN) - // segment time im micro seconds - unsigned long segment_time = lround(1000000.0/inverse_mm_s); - if (mq) { - if (segment_time < min_segment_time) { - // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. - inverse_mm_s = 1000000.0 / (segment_time + lround(2 * (min_segment_time - segment_time) / moves_queued)); - #ifdef XY_FREQUENCY_LIMIT - segment_time = lround(1000000.0 / inverse_mm_s); - #endif - } + #if ENABLED(SLOWDOWN) + // Segment time im micro seconds + unsigned long segment_time = lround(1000000.0 / inverse_mm_s); + if (moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2) { + if (segment_time < min_segment_time) { + // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more. + inverse_mm_s = 1000000.0 / (segment_time + lround(2 * (min_segment_time - segment_time) / moves_queued)); + #ifdef XY_FREQUENCY_LIMIT + segment_time = lround(1000000.0 / inverse_mm_s); + #endif } - #endif + } #endif block->nominal_speed = block->millimeters * inverse_mm_s; // (mm/sec) Always > 0