Skip to content

Commit 884f7c7

Browse files
committed
📝 Note about UBL bad splits
1 parent 95b7023 commit 884f7c7

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp

+16-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,18 @@
3636
#include "../../../MarlinCore.h"
3737
#include <math.h>
3838

39+
//#define DEBUG_UBL_MOTION
40+
#define DEBUG_OUT ENABLED(DEBUG_UBL_MOTION)
41+
#include "../../../core/debug_out.h"
42+
3943
#if !UBL_SEGMENTED
4044

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+
4151
void unified_bed_leveling::line_to_destination_cartesian(const_feedRate_t scaled_fr_mm_s, const uint8_t extruder) {
4252
/**
4353
* Much of the nozzle movement will be within the same cell. So we will do as little computation
@@ -176,7 +186,9 @@
176186
dest.z += z0;
177187
planner.buffer_segment(dest, scaled_fr_mm_s, extruder);
178188

179-
} //else printf("FIRST MOVE PRUNED ");
189+
}
190+
else
191+
DEBUG_ECHOLNPGM("[ubl] skip Y segment");
180192
}
181193

182194
// At the final destination? Usually not, but when on a Y Mesh Line it's completed.
@@ -225,7 +237,9 @@
225237
dest.z += z0;
226238
if (!planner.buffer_segment(dest, scaled_fr_mm_s, extruder)) break;
227239

228-
} //else printf("FIRST MOVE PRUNED ");
240+
}
241+
else
242+
DEBUG_ECHOLNPGM("[ubl] skip Y segment");
229243
}
230244

231245
if (xy_pos_t(current_position) != xy_pos_t(end))

0 commit comments

Comments
 (0)