瀏覽代碼

📝 Note about UBL bad splits

Scott Lahteine 2 年之前
父節點
當前提交
884f7c7db9
共有 1 個檔案被更改,包括 16 行新增2 行删除
  1. 16
    2
      Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp

+ 16
- 2
Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp 查看文件

@@ -36,8 +36,18 @@
36 36
 #include "../../../MarlinCore.h"
37 37
 #include <math.h>
38 38
 
39
+//#define DEBUG_UBL_MOTION
40
+#define DEBUG_OUT ENABLED(DEBUG_UBL_MOTION)
41
+#include "../../../core/debug_out.h"
42
+
39 43
 #if !UBL_SEGMENTED
40 44
 
45
+  // TODO: The first and last parts of a move might result in very short segment(s)
46
+  //       after getting split on the cell boundary, so moves like that should not
47
+  //       get split. This will be most common for moves that start/end near the
48
+  //       corners of cells. To fix the issue, simply check if the start/end of the line
49
+  //       is very close to a cell boundary in advance and don't split the line there.
50
+
41 51
   void unified_bed_leveling::line_to_destination_cartesian(const_feedRate_t scaled_fr_mm_s, const uint8_t extruder) {
42 52
     /**
43 53
      * Much of the nozzle movement will be within the same cell. So we will do as little computation
@@ -176,7 +186,9 @@
176 186
           dest.z += z0;
177 187
           planner.buffer_segment(dest, scaled_fr_mm_s, extruder);
178 188
 
179
-        } //else printf("FIRST MOVE PRUNED  ");
189
+        }
190
+        else
191
+          DEBUG_ECHOLNPGM("[ubl] skip Y segment");
180 192
       }
181 193
 
182 194
       // At the final destination? Usually not, but when on a Y Mesh Line it's completed.
@@ -225,7 +237,9 @@
225 237
           dest.z += z0;
226 238
           if (!planner.buffer_segment(dest, scaled_fr_mm_s, extruder)) break;
227 239
 
228
-        } //else printf("FIRST MOVE PRUNED  ");
240
+        }
241
+        else
242
+          DEBUG_ECHOLNPGM("[ubl] skip Y segment");
229 243
       }
230 244
 
231 245
       if (xy_pos_t(current_position) != xy_pos_t(end))

Loading…
取消
儲存