InsanityAutomation
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
2 deletions
-
Marlin/Configuration_adv.h
-
Marlin/src/module/planner.cpp
|
|
@ -753,8 +753,12 @@ |
|
|
|
// Minimum time that a segment needs to take if the buffer is emptied
|
|
|
|
#define DEFAULT_MINSEGMENTTIME 20000 // (ms)
|
|
|
|
|
|
|
|
// If defined the movements slow down when the look ahead buffer is only half full
|
|
|
|
// Slow down the machine if the look ahead buffer is (by default) half full.
|
|
|
|
// Increase the slowdown divisor for larger buffer sizes.
|
|
|
|
#define SLOWDOWN |
|
|
|
#if ENABLED(SLOWDOWN) |
|
|
|
#define SLOWDOWN_DIVISOR 2 |
|
|
|
#endif |
|
|
|
|
|
|
|
// Frequency limit
|
|
|
|
// See nophead's blog for more info
|
|
|
|
|
|
@ -2041,7 +2041,10 @@ bool Planner::_populate_block(block_t * const block, bool split_move, |
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLED(SLOWDOWN) |
|
|
|
if (WITHIN(moves_queued, 2, (BLOCK_BUFFER_SIZE) / 2 - 1)) { |
|
|
|
#ifndef SLOWDOWN_DIVISOR |
|
|
|
#define SLOWDOWN_DIVISOR 2 |
|
|
|
#endif |
|
|
|
if (WITHIN(moves_queued, 2, (BLOCK_BUFFER_SIZE) / (SLOWDOWN_DIVISOR) - 1)) { |
|
|
|
if (segment_time_us < settings.min_segment_time_us) { |
|
|
|
// buffer is draining, add extra time. The amount of time added increases if the buffer is still emptied more.
|
|
|
|
const uint32_t nst = segment_time_us + LROUND(2 * (settings.min_segment_time_us - segment_time_us) / moves_queued); |
|
|
|