Browse Source

Probe margin. Bump config version (#18140)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
ellensp 4 years ago
parent
commit
ce62209bce
No account linked to committer's email address

+ 2
- 2
Marlin/Configuration.h View File

@@ -36,7 +36,7 @@
36 36
  * Advanced settings can be found in Configuration_adv.h
37 37
  *
38 38
  */
39
-#define CONFIGURATION_H_VERSION 020005
39
+#define CONFIGURATION_H_VERSION 020006
40 40
 
41 41
 //===========================================================================
42 42
 //============================= Getting Started =============================
@@ -976,7 +976,7 @@
976 976
 
977 977
 // Most probes should stay away from the edges of the bed, but
978 978
 // with NOZZLE_AS_PROBE this can be negative for a wider probing area.
979
-#define MIN_PROBE_EDGE 10
979
+#define PROBING_MARGIN 10
980 980
 
981 981
 // X and Y axis travel speed (mm/m) between probes
982 982
 #define XY_PROBE_SPEED 8000

+ 8
- 6
Marlin/Configuration_adv.h View File

@@ -31,7 +31,7 @@
31 31
  * Basic settings can be found in Configuration.h
32 32
  *
33 33
  */
34
-#define CONFIGURATION_ADV_H_VERSION 020005
34
+#define CONFIGURATION_ADV_H_VERSION 020006
35 35
 
36 36
 // @section temperature
37 37
 
@@ -1589,7 +1589,9 @@
1589 1589
 #endif
1590 1590
 
1591 1591
 /**
1592
- * Override MIN_PROBE_EDGE for each side of the build plate
1592
+ * Probing Margins
1593
+ *
1594
+ * Override PROBING_MARGIN for each side of the build plate
1593 1595
  * Useful to get probe points to exact positions on targets or
1594 1596
  * to allow leveling to avoid plate clamps on only specific
1595 1597
  * sides of the bed. With NOZZLE_AS_PROBE negative values are
@@ -1606,10 +1608,10 @@
1606 1608
  * the probe to be unable to reach any points.
1607 1609
  */
1608 1610
 #if PROBE_SELECTED && !IS_KINEMATIC
1609
-  //#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE
1610
-  //#define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE
1611
-  //#define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE
1612
-  //#define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE
1611
+  //#define PROBING_MARGIN_LEFT PROBING_MARGIN
1612
+  //#define PROBING_MARGIN_RIGHT PROBING_MARGIN
1613
+  //#define PROBING_MARGIN_FRONT PROBING_MARGIN
1614
+  //#define PROBING_MARGIN_BACK PROBING_MARGIN
1613 1615
 #endif
1614 1616
 
1615 1617
 #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)

+ 4
- 4
Marlin/src/feature/z_stepper_align.cpp View File

@@ -56,10 +56,10 @@ void ZStepperAlign::reset_to_default() {
56 56
 
57 57
     constexpr xyz_pos_t dpo = NOZZLE_TO_PROBE_OFFSET;
58 58
 
59
-    #define LTEST(N) (xy_init[N].x >= _MAX(X_MIN_BED + MIN_PROBE_EDGE_LEFT,  X_MIN_POS + dpo.x) - 0.00001f)
60
-    #define RTEST(N) (xy_init[N].x <= _MIN(X_MAX_BED - MIN_PROBE_EDGE_RIGHT, X_MAX_POS + dpo.x) + 0.00001f)
61
-    #define FTEST(N) (xy_init[N].y >= _MAX(Y_MIN_BED + MIN_PROBE_EDGE_FRONT, Y_MIN_POS + dpo.y) - 0.00001f)
62
-    #define BTEST(N) (xy_init[N].y <= _MIN(Y_MAX_BED - MIN_PROBE_EDGE_BACK,  Y_MAX_POS + dpo.y) + 0.00001f)
59
+    #define LTEST(N) (xy_init[N].x >= _MAX(X_MIN_BED + PROBING_MARGIN_LEFT,  X_MIN_POS + dpo.x) - 0.00001f)
60
+    #define RTEST(N) (xy_init[N].x <= _MIN(X_MAX_BED - PROBING_MARGIN_RIGHT, X_MAX_POS + dpo.x) + 0.00001f)
61
+    #define FTEST(N) (xy_init[N].y >= _MAX(Y_MIN_BED + PROBING_MARGIN_FRONT, Y_MIN_POS + dpo.y) - 0.00001f)
62
+    #define BTEST(N) (xy_init[N].y <= _MIN(Y_MAX_BED - PROBING_MARGIN_BACK,  Y_MAX_POS + dpo.y) + 0.00001f)
63 63
 
64 64
     static_assert(LTEST(0) && RTEST(0), "The 1st Z_STEPPER_ALIGN_XY X is unreachable with the default probe X offset.");
65 65
     static_assert(FTEST(0) && BTEST(0), "The 1st Z_STEPPER_ALIGN_XY Y is unreachable with the default probe Y offset.");

+ 18
- 18
Marlin/src/inc/Conditionals_post.h View File

@@ -2251,31 +2251,31 @@
2251 2251
  * Bed Probing bounds
2252 2252
  */
2253 2253
 
2254
-#ifndef MIN_PROBE_EDGE
2255
-  #define MIN_PROBE_EDGE 0
2254
+#ifndef PROBING_MARGIN
2255
+  #define PROBING_MARGIN 0
2256 2256
 #endif
2257 2257
 
2258 2258
 #if IS_KINEMATIC
2259
-  #undef MIN_PROBE_EDGE_LEFT
2260
-  #undef MIN_PROBE_EDGE_RIGHT
2261
-  #undef MIN_PROBE_EDGE_FRONT
2262
-  #undef MIN_PROBE_EDGE_BACK
2263
-  #define MIN_PROBE_EDGE_LEFT 0
2264
-  #define MIN_PROBE_EDGE_RIGHT 0
2265
-  #define MIN_PROBE_EDGE_FRONT 0
2266
-  #define MIN_PROBE_EDGE_BACK 0
2259
+  #undef PROBING_MARGIN_LEFT
2260
+  #undef PROBING_MARGIN_RIGHT
2261
+  #undef PROBING_MARGIN_FRONT
2262
+  #undef PROBING_MARGIN_BACK
2263
+  #define PROBING_MARGIN_LEFT 0
2264
+  #define PROBING_MARGIN_RIGHT 0
2265
+  #define PROBING_MARGIN_FRONT 0
2266
+  #define PROBING_MARGIN_BACK 0
2267 2267
 #else
2268
-  #ifndef MIN_PROBE_EDGE_LEFT
2269
-    #define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE
2268
+  #ifndef PROBING_MARGIN_LEFT
2269
+    #define PROBING_MARGIN_LEFT PROBING_MARGIN
2270 2270
   #endif
2271
-  #ifndef MIN_PROBE_EDGE_RIGHT
2272
-    #define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE
2271
+  #ifndef PROBING_MARGIN_RIGHT
2272
+    #define PROBING_MARGIN_RIGHT PROBING_MARGIN
2273 2273
   #endif
2274
-  #ifndef MIN_PROBE_EDGE_FRONT
2275
-    #define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE
2274
+  #ifndef PROBING_MARGIN_FRONT
2275
+    #define PROBING_MARGIN_FRONT PROBING_MARGIN
2276 2276
   #endif
2277
-  #ifndef MIN_PROBE_EDGE_BACK
2278
-    #define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE
2277
+  #ifndef PROBING_MARGIN_BACK
2278
+    #define PROBING_MARGIN_BACK PROBING_MARGIN
2279 2279
   #endif
2280 2280
 #endif
2281 2281
 

+ 30
- 12
Marlin/src/inc/SanityCheck.h View File

@@ -283,9 +283,9 @@
283 283
 #elif defined(NEOPIXEL_RGBW_LED)
284 284
   #error "NEOPIXEL_RGBW_LED is now NEOPIXEL_LED. Please update your configuration."
285 285
 #elif ENABLED(DELTA) && defined(DELTA_PROBEABLE_RADIUS)
286
-  #error "Remove DELTA_PROBEABLE_RADIUS and use MIN_PROBE_EDGE to inset the probe area instead."
286
+  #error "Remove DELTA_PROBEABLE_RADIUS and use PROBING_MARGIN to inset the probe area instead."
287 287
 #elif ENABLED(DELTA) && defined(DELTA_CALIBRATION_RADIUS)
288
-  #error "Remove DELTA_CALIBRATION_RADIUS and use MIN_PROBE_EDGE to inset the probe area instead."
288
+  #error "Remove DELTA_CALIBRATION_RADIUS and use PROBING_MARGIN to inset the probe area instead."
289 289
 #elif defined(UBL_MESH_INSET)
290 290
   #error "UBL_MESH_INSET is now just MESH_INSET. Please update your configuration."
291 291
 #elif defined(UBL_MESH_MIN_X) || defined(UBL_MESH_MIN_Y) || defined(UBL_MESH_MAX_X) || defined(UBL_MESH_MAX_Y)
@@ -294,14 +294,24 @@
294 294
   #error "ABL_PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h."
295 295
 #elif defined(UBL_PROBE_PT_1_X) || defined(UBL_PROBE_PT_1_Y) || defined(UBL_PROBE_PT_2_X) || defined(UBL_PROBE_PT_2_Y) || defined(UBL_PROBE_PT_3_X) || defined(UBL_PROBE_PT_3_Y)
296 296
   #error "UBL_PROBE_PT_[123]_[XY] is no longer required. Please remove it from Configuration.h."
297
+#elif defined(MIN_PROBE_EDGE)
298
+  #error "MIN_PROBE_EDGE is now called PROBING_MARGIN. Please update your configuration."
299
+#elif defined(MIN_PROBE_EDGE_LEFT)
300
+  #error "MIN_PROBE_EDGE_LEFT is now called PROBING_MARGIN_LEFT. Please update your configuration."
301
+#elif defined(MIN_PROBE_EDGE_RIGHT)
302
+  #error "MIN_PROBE_EDGE_RIGHT is now called PROBING_MARGIN_RIGHT. Please update your configuration."
303
+#elif defined(MIN_PROBE_EDGE_FRONT)
304
+  #error "MIN_PROBE_EDGE_FRONT is now called PROBING_MARGIN_FRONT. Please update your configuration."
305
+#elif defined(MIN_PROBE_EDGE_BACK)
306
+  #error "MIN_PROBE_EDGE_BACK is now called PROBING_MARGIN_BACK. Please update your configuration."
297 307
 #elif defined(LEFT_PROBE_BED_POSITION)
298
-  #error "LEFT_PROBE_BED_POSITION is obsolete. Set a margin with MIN_PROBE_EDGE or MIN_PROBE_EDGE_LEFT instead."
308
+  #error "LEFT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_LEFT instead."
299 309
 #elif defined(RIGHT_PROBE_BED_POSITION)
300
-  #error "RIGHT_PROBE_BED_POSITION is obsolete. Set a margin with MIN_PROBE_EDGE or MIN_PROBE_EDGE_RIGHT instead."
310
+  #error "RIGHT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_RIGHT instead."
301 311
 #elif defined(FRONT_PROBE_BED_POSITION)
302
-  #error "FRONT_PROBE_BED_POSITION is obsolete. Set a margin with MIN_PROBE_EDGE or MIN_PROBE_EDGE_FRONT instead."
312
+  #error "FRONT_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_FRONT instead."
303 313
 #elif defined(BACK_PROBE_BED_POSITION)
304
-  #error "BACK_PROBE_BED_POSITION is obsolete. Set a margin with MIN_PROBE_EDGE or MIN_PROBE_EDGE_BACK instead."
314
+  #error "BACK_PROBE_BED_POSITION is obsolete. Set a margin with PROBING_MARGIN or PROBING_MARGIN_BACK instead."
305 315
 #elif defined(ENABLE_MESH_EDIT_GFX_OVERLAY)
306 316
   #error "ENABLE_MESH_EDIT_GFX_OVERLAY is now MESH_EDIT_GFX_OVERLAY. Please update your configuration."
307 317
 #elif defined(BABYSTEP_ZPROBE_GFX_REVERSE)
@@ -1263,12 +1273,20 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1263 1273
   #endif
1264 1274
 
1265 1275
   #if DISABLED(NOZZLE_AS_PROBE)
1266
-    static_assert(MIN_PROBE_EDGE >= 0, "MIN_PROBE_EDGE must be >= 0.");
1267
-    static_assert(MIN_PROBE_EDGE_BACK >= 0, "MIN_PROBE_EDGE_BACK must be >= 0.");
1268
-    static_assert(MIN_PROBE_EDGE_FRONT >= 0, "MIN_PROBE_EDGE_FRONT must be >= 0.");
1269
-    static_assert(MIN_PROBE_EDGE_LEFT >= 0, "MIN_PROBE_EDGE_LEFT must be >= 0.");
1270
-    static_assert(MIN_PROBE_EDGE_RIGHT >= 0, "MIN_PROBE_EDGE_RIGHT must be >= 0.");
1271
-  #endif
1276
+    static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0.");
1277
+    static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0.");
1278
+    static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0.");
1279
+    static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0.");
1280
+    static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0.");
1281
+  #endif
1282
+
1283
+  #define _MARGIN(A) TERN(IS_SCARA, SCARA_PRINTABLE_RADIUS, TERN(DELTA, DELTA_PRINTABLE_RADIUS, A##_CENTER))
1284
+  static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large.");
1285
+  static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large.");
1286
+  static_assert(PROBING_MARGIN_FRONT < _MARGIN(Y), "PROBING_MARGIN_FRONT is too large.");
1287
+  static_assert(PROBING_MARGIN_LEFT < _MARGIN(X), "PROBING_MARGIN_LEFT is too large.");
1288
+  static_assert(PROBING_MARGIN_RIGHT < _MARGIN(X), "PROBING_MARGIN_RIGHT is too large.");
1289
+  #undef _MARGIN
1272 1290
 
1273 1291
   /**
1274 1292
    * Make sure Z raise values are set

+ 1
- 1
Marlin/src/inc/Version.h View File

@@ -52,7 +52,7 @@
52 52
  * to alert users to major changes.
53 53
  */
54 54
 
55
-#define MARLIN_HEX_VERSION 020005
55
+#define MARLIN_HEX_VERSION 020006
56 56
 #ifndef REQUIRED_CONFIGURATION_H_VERSION
57 57
   #define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION
58 58
 #endif

+ 1
- 1
Marlin/src/module/delta.cpp View File

@@ -95,7 +95,7 @@ void recalc_delta_settings() {
95 95
   float delta_calibration_radius() {
96 96
     return calibration_radius_factor * (
97 97
       #if HAS_BED_PROBE
98
-        FLOOR((DELTA_PRINTABLE_RADIUS) - _MAX(HYPOT(probe.offset_xy.x, probe.offset_xy.y), MIN_PROBE_EDGE))
98
+        FLOOR((DELTA_PRINTABLE_RADIUS) - _MAX(HYPOT(probe.offset_xy.x, probe.offset_xy.y), PROBING_MARGIN))
99 99
       #else
100 100
         DELTA_PRINTABLE_RADIUS
101 101
       #endif

+ 7
- 7
Marlin/src/module/probe.h View File

@@ -54,11 +54,11 @@ public:
54 54
         // Note: This won't work on SCARA since the probe offset rotates with the arm.
55 55
         static inline bool can_reach(const float &rx, const float &ry) {
56 56
           return position_is_reachable(rx - offset_xy.x, ry - offset_xy.y) // The nozzle can go where it needs to go?
57
-              && position_is_reachable(rx, ry, ABS(MIN_PROBE_EDGE));       // Can the nozzle also go near there?
57
+              && position_is_reachable(rx, ry, ABS(PROBING_MARGIN));       // Can the nozzle also go near there?
58 58
         }
59 59
       #else
60 60
         FORCE_INLINE static bool can_reach(const float &rx, const float &ry) {
61
-          return position_is_reachable(rx, ry, MIN_PROBE_EDGE);
61
+          return position_is_reachable(rx, ry, PROBING_MARGIN);
62 62
         }
63 63
       #endif
64 64
 
@@ -131,7 +131,7 @@ public:
131 131
       );
132 132
 
133 133
       static inline float probe_radius() {
134
-        return printable_radius - _MAX(MIN_PROBE_EDGE, HYPOT(offset_xy.x, offset_xy.y));
134
+        return printable_radius - _MAX(PROBING_MARGIN, HYPOT(offset_xy.x, offset_xy.y));
135 135
       }
136 136
     #endif
137 137
 
@@ -140,7 +140,7 @@ public:
140 140
         #if IS_KINEMATIC
141 141
           (X_CENTER) - probe_radius()
142 142
         #else
143
-          _MAX((X_MIN_BED) + (MIN_PROBE_EDGE_LEFT), (X_MIN_POS) + offset_xy.x)
143
+          _MAX((X_MIN_BED) + (PROBING_MARGIN_LEFT), (X_MIN_POS) + offset_xy.x)
144 144
         #endif
145 145
       );
146 146
     }
@@ -149,7 +149,7 @@ public:
149 149
         #if IS_KINEMATIC
150 150
           (X_CENTER) + probe_radius()
151 151
         #else
152
-          _MIN((X_MAX_BED) - (MIN_PROBE_EDGE_RIGHT), (X_MAX_POS) + offset_xy.x)
152
+          _MIN((X_MAX_BED) - (PROBING_MARGIN_RIGHT), (X_MAX_POS) + offset_xy.x)
153 153
         #endif
154 154
       );
155 155
     }
@@ -158,7 +158,7 @@ public:
158 158
         #if IS_KINEMATIC
159 159
           (Y_CENTER) - probe_radius()
160 160
         #else
161
-          _MAX((Y_MIN_BED) + (MIN_PROBE_EDGE_FRONT), (Y_MIN_POS) + offset_xy.y)
161
+          _MAX((Y_MIN_BED) + (PROBING_MARGIN_FRONT), (Y_MIN_POS) + offset_xy.y)
162 162
         #endif
163 163
       );
164 164
     }
@@ -167,7 +167,7 @@ public:
167 167
         #if IS_KINEMATIC
168 168
           (Y_CENTER) + probe_radius()
169 169
         #else
170
-          _MIN((Y_MAX_BED) - (MIN_PROBE_EDGE_BACK), (Y_MAX_POS) + offset_xy.y)
170
+          _MIN((Y_MAX_BED) - (PROBING_MARGIN_BACK), (Y_MAX_POS) + offset_xy.y)
171 171
         #endif
172 172
       );
173 173
     }

Loading…
Cancel
Save