Просмотр исходного кода

🔧 Fix some LCD probing margins

Scott Lahteine 7 месяцев назад
Родитель
Сommit
0790a9d5df

+ 3 - 3
Marlin/src/gcode/bedlevel/G26.cpp

@@ -132,11 +132,11 @@
 #endif
 
 #ifndef G26_XY_FEEDRATE
-  #define G26_XY_FEEDRATE (PLANNER_XY_FEEDRATE() / 3.0)
+  #define G26_XY_FEEDRATE (PLANNER_XY_FEEDRATE_MM_S / 3.0)
 #endif
 
 #ifndef G26_XY_FEEDRATE_TRAVEL
-  #define G26_XY_FEEDRATE_TRAVEL (PLANNER_XY_FEEDRATE() / 1.5)
+  #define G26_XY_FEEDRATE_TRAVEL (PLANNER_XY_FEEDRATE_MM_S / 1.5)
 #endif
 
 #if CROSSHAIRS_SIZE >= INTERSECTION_CIRCLE_RADIUS
@@ -783,7 +783,7 @@ void GcodeSuite::G26() {
 
         g26.recover_filament(destination);
 
-        { REMEMBER(fr, feedrate_mm_s, PLANNER_XY_FEEDRATE() * 0.1f);
+        { REMEMBER(fr, feedrate_mm_s, PLANNER_XY_FEEDRATE_MM_S * 0.1f);
           plan_arc(endpoint, arc_offset, false, 0);  // Draw a counter-clockwise arc
           destination = current_position;
         }

+ 13 - 9
Marlin/src/inc/Conditionals_post.h

@@ -3099,20 +3099,12 @@
  * Bed Probing bounds
  */
 
-#ifndef PROBING_MARGIN
-  #define PROBING_MARGIN 0
-#endif
-
 #if IS_KINEMATIC
   #undef PROBING_MARGIN_LEFT
   #undef PROBING_MARGIN_RIGHT
   #undef PROBING_MARGIN_FRONT
   #undef PROBING_MARGIN_BACK
-  #define PROBING_MARGIN_LEFT 0
-  #define PROBING_MARGIN_RIGHT 0
-  #define PROBING_MARGIN_FRONT 0
-  #define PROBING_MARGIN_BACK 0
-#else
+#elif PROBING_MARGIN
   #ifndef PROBING_MARGIN_LEFT
     #define PROBING_MARGIN_LEFT PROBING_MARGIN
   #endif
@@ -3126,6 +3118,18 @@
     #define PROBING_MARGIN_BACK PROBING_MARGIN
   #endif
 #endif
+#ifndef PROBING_MARGIN_LEFT
+  #define PROBING_MARGIN_LEFT 0
+#endif
+#ifndef PROBING_MARGIN_RIGHT
+  #define PROBING_MARGIN_RIGHT 0
+#endif
+#ifndef PROBING_MARGIN_FRONT
+  #define PROBING_MARGIN_FRONT 0
+#endif
+#ifndef PROBING_MARGIN_BACK
+  #define PROBING_MARGIN_BACK 0
+#endif
 
 #if ENABLED(DELTA)
   /**

+ 4 - 4
Marlin/src/lcd/e3v2/jyersui/dwin.cpp

@@ -1377,10 +1377,10 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
       static bool use_probe = false;
 
       #if HAS_BED_PROBE
-        const float probe_x_min = _MAX(0 + corner_pos, X_MIN_POS + probe.offset.x, X_MIN_POS + PROBING_MARGIN) - probe.offset.x,
-                    probe_x_max = _MIN((X_BED_SIZE + X_MIN_POS) - corner_pos, X_MAX_POS + probe.offset.x, X_MAX_POS - PROBING_MARGIN) - probe.offset.x,
-                    probe_y_min = _MAX(0 + corner_pos, Y_MIN_POS + probe.offset.y, Y_MIN_POS + PROBING_MARGIN) - probe.offset.y,
-                    probe_y_max = _MIN((Y_BED_SIZE + Y_MIN_POS) - corner_pos, Y_MAX_POS + probe.offset.y, Y_MAX_POS - PROBING_MARGIN) - probe.offset.y;
+        const float probe_x_min = _MAX(0 + corner_pos, X_MIN_POS + probe.offset.x, X_MIN_POS + (PROBING_MARGIN_LEFT)) - probe.offset.x,
+                    probe_x_max = _MIN((X_BED_SIZE + X_MIN_POS) - corner_pos, X_MAX_POS + probe.offset.x, X_MAX_POS - (PROBING_MARGIN_RIGHT)) - probe.offset.x,
+                    probe_y_min = _MAX(0 + corner_pos, Y_MIN_POS + probe.offset.y, Y_MIN_POS + (PROBING_MARGIN_FRONT)) - probe.offset.y,
+                    probe_y_max = _MIN((Y_BED_SIZE + Y_MIN_POS) - corner_pos, Y_MAX_POS + probe.offset.y, Y_MAX_POS - (PROBING_MARGIN_BACK)) - probe.offset.y;
       #endif
 
       switch (item) {

+ 4 - 4
Marlin/src/lcd/e3v2/proui/dwin.cpp

@@ -2439,16 +2439,16 @@ void setFlow() { setPIntOnClick(FLOW_EDIT_MIN, FLOW_EDIT_MAX, []{ planner.refres
       else {
         // AUTO_BED_LEVELING_BILINEAR does not define MESH_INSET
         #ifndef MESH_MIN_X
-          #define MESH_MIN_X (_MAX(X_MIN_BED + PROBING_MARGIN, X_MIN_POS))
+          #define MESH_MIN_X (_MAX(X_MIN_BED + (PROBING_MARGIN_LEFT), X_MIN_POS))
         #endif
         #ifndef MESH_MIN_Y
-          #define MESH_MIN_Y (_MAX(Y_MIN_BED + PROBING_MARGIN, Y_MIN_POS))
+          #define MESH_MIN_Y (_MAX(Y_MIN_BED + (PROBING_MARGIN_FRONT), Y_MIN_POS))
         #endif
         #ifndef MESH_MAX_X
-          #define MESH_MAX_X (_MIN(X_MAX_BED - (PROBING_MARGIN), X_MAX_POS))
+          #define MESH_MAX_X (_MIN(X_MAX_BED - (PROBING_MARGIN_RIGHT), X_MAX_POS))
         #endif
         #ifndef MESH_MAX_Y
-          #define MESH_MAX_Y (_MIN(Y_MAX_BED - (PROBING_MARGIN), Y_MAX_POS))
+          #define MESH_MAX_Y (_MIN(Y_MAX_BED - (PROBING_MARGIN_BACK), Y_MAX_POS))
         #endif
 
         LIMIT(xpos, MESH_MIN_X, MESH_MAX_X);