|
@@ -929,24 +929,18 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
929
|
929
|
int moves_queued = movesplanned();
|
930
|
930
|
|
931
|
931
|
// Slow down when the buffer starts to empty, rather than wait at the corner for a buffer refill
|
932
|
|
- #if ENABLED(OLD_SLOWDOWN) || ENABLED(SLOWDOWN)
|
933
|
|
- bool mq = moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2;
|
934
|
|
- #if ENABLED(OLD_SLOWDOWN)
|
935
|
|
- if (mq) fr_mm_s *= 2.0 * moves_queued / (BLOCK_BUFFER_SIZE);
|
936
|
|
- #endif
|
937
|
|
- #if ENABLED(SLOWDOWN)
|
938
|
|
- // segment time im micro seconds
|
939
|
|
- unsigned long segment_time = lround(1000000.0/inverse_mm_s);
|
940
|
|
- if (mq) {
|
941
|
|
- if (segment_time < min_segment_time) {
|
942
|
|
- // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more.
|
943
|
|
- inverse_mm_s = 1000000.0 / (segment_time + lround(2 * (min_segment_time - segment_time) / moves_queued));
|
944
|
|
- #ifdef XY_FREQUENCY_LIMIT
|
945
|
|
- segment_time = lround(1000000.0 / inverse_mm_s);
|
946
|
|
- #endif
|
947
|
|
- }
|
|
932
|
+ #if ENABLED(SLOWDOWN)
|
|
933
|
+ // Segment time im micro seconds
|
|
934
|
+ unsigned long segment_time = lround(1000000.0 / inverse_mm_s);
|
|
935
|
+ if (moves_queued > 1 && moves_queued < (BLOCK_BUFFER_SIZE) / 2) {
|
|
936
|
+ if (segment_time < min_segment_time) {
|
|
937
|
+ // buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more.
|
|
938
|
+ inverse_mm_s = 1000000.0 / (segment_time + lround(2 * (min_segment_time - segment_time) / moves_queued));
|
|
939
|
+ #ifdef XY_FREQUENCY_LIMIT
|
|
940
|
+ segment_time = lround(1000000.0 / inverse_mm_s);
|
|
941
|
+ #endif
|
948
|
942
|
}
|
949
|
|
- #endif
|
|
943
|
+ }
|
950
|
944
|
#endif
|
951
|
945
|
|
952
|
946
|
block->nominal_speed = block->millimeters * inverse_mm_s; // (mm/sec) Always > 0
|