瀏覽代碼

Configurable SLOWDOWN divisor (#17171)

InsanityAutomation 4 年之前
父節點
當前提交
775a4294fc
No account linked to committer's email address
共有 2 個文件被更改,包括 9 次插入2 次删除
  1. 5
    1
      Marlin/Configuration_adv.h
  2. 4
    1
      Marlin/src/module/planner.cpp

+ 5
- 1
Marlin/Configuration_adv.h 查看文件

@@ -753,8 +753,12 @@
753 753
 // Minimum time that a segment needs to take if the buffer is emptied
754 754
 #define DEFAULT_MINSEGMENTTIME        20000   // (ms)
755 755
 
756
-// If defined the movements slow down when the look ahead buffer is only half full
756
+// Slow down the machine if the look ahead buffer is (by default) half full.
757
+// Increase the slowdown divisor for larger buffer sizes.
757 758
 #define SLOWDOWN
759
+#if ENABLED(SLOWDOWN)
760
+  #define SLOWDOWN_DIVISOR 2
761
+#endif
758 762
 
759 763
 // Frequency limit
760 764
 // See nophead's blog for more info

+ 4
- 1
Marlin/src/module/planner.cpp 查看文件

@@ -2041,7 +2041,10 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2041 2041
   #endif
2042 2042
 
2043 2043
   #if ENABLED(SLOWDOWN)
2044
-    if (WITHIN(moves_queued, 2, (BLOCK_BUFFER_SIZE) / 2 - 1)) {
2044
+    #ifndef SLOWDOWN_DIVISOR
2045
+      #define SLOWDOWN_DIVISOR 2
2046
+    #endif
2047
+    if (WITHIN(moves_queued, 2, (BLOCK_BUFFER_SIZE) / (SLOWDOWN_DIVISOR) - 1)) {
2045 2048
       if (segment_time_us < settings.min_segment_time_us) {
2046 2049
         // buffer is draining, add extra time.  The amount of time added increases if the buffer is still emptied more.
2047 2050
         const uint32_t nst = segment_time_us + LROUND(2 * (settings.min_segment_time_us - segment_time_us) / moves_queued);

Loading…
取消
儲存