|
@@ -3354,7 +3354,7 @@ void gcode_get_destination() {
|
3354
|
3354
|
LOOP_XYZE(i) {
|
3355
|
3355
|
if (parser.seen(axis_codes[i])) {
|
3356
|
3356
|
const float v = parser.value_axis_units((AxisEnum)i) + (axis_relative_modes[i] || relative_mode ? current_position[i] : 0);
|
3357
|
|
- destination[i] = (i == E_AXIS ? v : LOGICAL_TO_NATIVE(v, i));
|
|
3357
|
+ destination[i] = i == E_AXIS ? v : LOGICAL_TO_NATIVE(v, i);
|
3358
|
3358
|
}
|
3359
|
3359
|
else
|
3360
|
3360
|
destination[i] = current_position[i];
|
|
@@ -12716,13 +12716,17 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
12716
|
12716
|
|
12717
|
12717
|
#endif // AUTO_BED_LEVELING_BILINEAR
|
12718
|
12718
|
|
12719
|
|
-#if IS_KINEMATIC && !UBL_DELTA
|
|
12719
|
+#if !UBL_DELTA
|
|
12720
|
+#if IS_KINEMATIC
|
12720
|
12721
|
|
12721
|
12722
|
/**
|
12722
|
12723
|
* Prepare a linear move in a DELTA or SCARA setup.
|
12723
|
12724
|
*
|
12724
|
12725
|
* This calls planner.buffer_line several times, adding
|
12725
|
12726
|
* small incremental moves for DELTA or SCARA.
|
|
12727
|
+ *
|
|
12728
|
+ * For Unified Bed Leveling (Delta or Segmented Cartesian)
|
|
12729
|
+ * the ubl.prepare_segmented_line_to method replaces this.
|
12726
|
12730
|
*/
|
12727
|
12731
|
inline bool prepare_kinematic_move_to(float rtarget[XYZE]) {
|
12728
|
12732
|
|
|
@@ -12841,46 +12845,45 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
12841
|
12845
|
return false;
|
12842
|
12846
|
}
|
12843
|
12847
|
|
12844
|
|
-#else // !IS_KINEMATIC || UBL_DELTA
|
|
12848
|
+#else // !IS_KINEMATIC
|
12845
|
12849
|
|
12846
|
12850
|
/**
|
12847
|
12851
|
* Prepare a linear move in a Cartesian setup.
|
12848
|
|
- * If Mesh Bed Leveling is enabled, perform a mesh move.
|
|
12852
|
+ *
|
|
12853
|
+ * When a mesh-based leveling system is active, moves are segmented
|
|
12854
|
+ * according to the configuration of the leveling system.
|
12849
|
12855
|
*
|
12850
|
12856
|
* Returns true if current_position[] was set to destination[]
|
12851
|
12857
|
*/
|
12852
|
12858
|
inline bool prepare_move_to_destination_cartesian() {
|
12853
|
|
- const float fr_scaled = MMS_SCALED(feedrate_mm_s);
|
12854
|
|
- #if HAS_MESH
|
12855
|
|
- if (!planner.leveling_active) {
|
12856
|
|
- line_to_destination(fr_scaled);
|
12857
|
|
- return false;
|
12858
|
|
- }
|
|
12859
|
+ #if HAS_MESH
|
|
12860
|
+ if (planner.leveling_active) {
|
12859
|
12861
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
12860
|
|
- ubl.line_to_destination_cartesian(fr_scaled, active_extruder); // UBL's motion routine needs to know about all moves,
|
12861
|
|
- return true; // even purely Z-Axis moves
|
|
12862
|
+ ubl.line_to_destination_cartesian(MMS_SCALED(feedrate_mm_s), active_extruder); // UBL's motion routine needs to know about
|
|
12863
|
+ return true; // all moves, including Z-only moves.
|
12862
|
12864
|
#else
|
|
12865
|
+ /**
|
|
12866
|
+ * For MBL and ABL-BILINEAR only segment moves when X or Y are involved.
|
|
12867
|
+ * Otherwise fall through to do a direct single move.
|
|
12868
|
+ */
|
12863
|
12869
|
if (current_position[X_AXIS] != destination[X_AXIS] || current_position[Y_AXIS] != destination[Y_AXIS]) {
|
12864
|
12870
|
#if ENABLED(MESH_BED_LEVELING)
|
12865
|
|
- mesh_line_to_destination(fr_scaled);
|
|
12871
|
+ mesh_line_to_destination(MMS_SCALED(feedrate_mm_s));
|
12866
|
12872
|
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
12867
|
|
- bilinear_line_to_destination(fr_scaled);
|
|
12873
|
+ bilinear_line_to_destination(MMS_SCALED(feedrate_mm_s));
|
12868
|
12874
|
#endif
|
12869
|
12875
|
return true;
|
12870
|
12876
|
}
|
12871
|
|
- else {
|
12872
|
|
- line_to_destination();
|
12873
|
|
- return false;
|
12874
|
|
- }
|
12875
|
12877
|
#endif
|
12876
|
|
- #else
|
12877
|
|
- line_to_destination();
|
12878
|
|
- #endif // HAS_MESH
|
|
12878
|
+ }
|
|
12879
|
+ #endif // HAS_MESH
|
12879
|
12880
|
|
|
12881
|
+ line_to_destination(MMS_SCALED(feedrate_mm_s));
|
12880
|
12882
|
return false;
|
12881
|
12883
|
}
|
12882
|
12884
|
|
12883
|
|
-#endif // !IS_KINEMATIC || UBL_DELTA
|
|
12885
|
+#endif // !IS_KINEMATIC
|
|
12886
|
+#endif // !UBL_DELTA
|
12884
|
12887
|
|
12885
|
12888
|
#if ENABLED(DUAL_X_CARRIAGE)
|
12886
|
12889
|
|