Bladeren bron

✨ MAG_MOUNTED_PROBE (#24420)

Co-Authored-By: Scott Lahteine <thinkyhead@users.noreply.github.com>
Farva42 2 jaren geleden
bovenliggende
commit
5979aab1c7

+ 21
- 0
Marlin/Configuration.h Bestand weergeven

@@ -1343,6 +1343,27 @@
1343 1343
   #define Z_PROBE_RETRACT_X X_MAX_POS
1344 1344
 #endif
1345 1345
 
1346
+/**
1347
+ * Magnetically Mounted Probe
1348
+ * For probes such as Euclid, Klicky, Klackender, etc.
1349
+ */
1350
+//#define MAG_MOUNTED_PROBE
1351
+#if ENABLED(MAG_MOUNTED_PROBE)
1352
+  #define PROBE_DEPLOY_FEEDRATE (133*60)  // (mm/min) Probe deploy speed
1353
+  #define PROBE_STOW_FEEDRATE   (133*60)  // (mm/min) Probe stow speed
1354
+
1355
+  #define MAG_MOUNTED_DEPLOY_1 { PROBE_DEPLOY_FEEDRATE, { 245, 114, 30 } }  // Move to side Dock & Attach probe
1356
+  #define MAG_MOUNTED_DEPLOY_2 { PROBE_DEPLOY_FEEDRATE, { 210, 114, 30 } }  // Move probe off dock
1357
+  #define MAG_MOUNTED_DEPLOY_3 { PROBE_DEPLOY_FEEDRATE, {   0,   0,  0 } }  // Extra move if needed
1358
+  #define MAG_MOUNTED_DEPLOY_4 { PROBE_DEPLOY_FEEDRATE, {   0,   0,  0 } }  // Extra move if needed
1359
+  #define MAG_MOUNTED_DEPLOY_5 { PROBE_DEPLOY_FEEDRATE, {   0,   0,  0 } }  // Extra move if needed
1360
+  #define MAG_MOUNTED_STOW_1   { PROBE_STOW_FEEDRATE,   { 245, 114, 20 } }  // Move to dock
1361
+  #define MAG_MOUNTED_STOW_2   { PROBE_STOW_FEEDRATE,   { 245, 114,  0 } }  // Place probe beside remover
1362
+  #define MAG_MOUNTED_STOW_3   { PROBE_STOW_FEEDRATE,   { 230, 114,  0 } }  // Side move to remove probe
1363
+  #define MAG_MOUNTED_STOW_4   { PROBE_STOW_FEEDRATE,   { 210, 114, 20 } }  // Side move to remove probe
1364
+  #define MAG_MOUNTED_STOW_5   { PROBE_STOW_FEEDRATE,   {   0,   0,  0 } }  // Extra move if needed
1365
+#endif
1366
+
1346 1367
 // Duet Smart Effector (for delta printers) - https://bit.ly/2ul5U7J
1347 1368
 // When the pin is defined you can use M672 to set/reset the probe sensitivity.
1348 1369
 //#define DUET_SMART_EFFECTOR

+ 3
- 0
Marlin/Configuration_adv.h Bestand weergeven

@@ -1319,6 +1319,9 @@
1319 1319
       #define XATC_Y_POSITION Y_CENTER      // (mm) Y position to probe
1320 1320
       #define XATC_Z_OFFSETS { 0, 0, 0 }    // Z offsets for X axis sample points
1321 1321
     #endif
1322
+
1323
+    // Show Deploy / Stow Probe options in the Motion menu.
1324
+    #define PROBE_DEPLOY_STOW_MENU
1322 1325
   #endif
1323 1326
 
1324 1327
   // Include a page of printer information in the LCD Main Menu

+ 7
- 4
Marlin/src/inc/Conditionals_LCD.h Bestand weergeven

@@ -1047,9 +1047,12 @@
1047 1047
 #endif
1048 1048
 
1049 1049
 /**
1050
- * Set a flag for any type of bed probe, including the paper-test
1050
+ * Set flags for any form of bed probe
1051 1051
  */
1052
-#if ANY(HAS_Z_SERVO_PROBE, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, SOLENOID_PROBE, SENSORLESS_PROBING, RACK_AND_PINION_PROBE, MAGLEV4)
1052
+#if ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, SOLENOID_PROBE, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE)
1053
+  #define HAS_STOWABLE_PROBE 1
1054
+#endif
1055
+#if ANY(HAS_STOWABLE_PROBE, HAS_Z_SERVO_PROBE, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE)
1053 1056
   #define HAS_BED_PROBE 1
1054 1057
 #endif
1055 1058
 
@@ -1207,13 +1210,13 @@
1207 1210
   #if NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, HAS_DELTA_SENSORLESS_PROBING)
1208 1211
     #define USES_Z_MIN_PROBE_PIN 1
1209 1212
   #endif
1210
-  #if Z_HOME_TO_MIN && TERN1(USES_Z_MIN_PROBE_PIN, ENABLED(USE_PROBE_FOR_Z_HOMING))
1213
+  #if Z_HOME_TO_MIN && (DISABLED(USES_Z_MIN_PROBE_PIN) || USE_PROBE_FOR_Z_HOMING)
1211 1214
     #define HOMING_Z_WITH_PROBE 1
1212 1215
   #endif
1213 1216
   #ifndef Z_PROBE_LOW_POINT
1214 1217
     #define Z_PROBE_LOW_POINT -5
1215 1218
   #endif
1216
-  #if ENABLED(Z_PROBE_ALLEN_KEY)
1219
+  #if EITHER(Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE)
1217 1220
     #define PROBE_TRIGGERED_WHEN_STOWED_TEST 1 // Extra test for Allen Key Probe
1218 1221
   #endif
1219 1222
   #if MULTIPLE_PROBING > 1

+ 4
- 0
Marlin/src/inc/Conditionals_adv.h Bestand weergeven

@@ -79,6 +79,10 @@
79 79
   #define SERVO_DELAY { 50 }
80 80
 #endif
81 81
 
82
+#if !HAS_STOWABLE_PROBE
83
+  #undef PROBE_DEPLOY_STOW_MENU
84
+#endif
85
+
82 86
 #if !HAS_EXTRUDERS
83 87
   #define NO_VOLUMETRICS
84 88
   #undef TEMP_SENSOR_0

+ 10
- 3
Marlin/src/inc/SanityCheck.h Bestand weergeven

@@ -1627,8 +1627,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1627 1627
  */
1628 1628
 #if 1 < 0 \
1629 1629
   + (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \
1630
-  + COUNT_ENABLED(PROBE_MANUALLY, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4)
1631
-  #error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, MAGLEV4, or Z Servo."
1630
+  + COUNT_ENABLED(PROBE_MANUALLY, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE)
1631
+  #error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, MAGLEV4, MAG_MOUNTED_PROBE or Z Servo."
1632 1632
 #endif
1633 1633
 
1634 1634
 #if HAS_BED_PROBE
@@ -1735,12 +1735,19 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1735 1735
   #endif
1736 1736
 
1737 1737
   /**
1738
+   * Mag mounted probe requirements
1739
+   */
1740
+  #if BOTH(MAG_MOUNTED_PROBE, USE_PROBE_FOR_Z_HOMING) && DISABLED(Z_SAFE_HOMING)
1741
+    #error "MAG_MOUNTED_PROBE requires Z_SAFE_HOMING if it's being used to home Z."
1742
+  #endif
1743
+
1744
+  /**
1738 1745
    * MagLev V4 probe requirements
1739 1746
    */
1740 1747
   #if ENABLED(MAGLEV4)
1741 1748
     #if !PIN_EXISTS(MAGLEV_TRIGGER)
1742 1749
       #error "MAGLEV4 requires MAGLEV_TRIGGER_PIN to be defined."
1743
-    #elif DISABLED(Z_SAFE_HOMING)
1750
+    #elif ENABLED(HOMING_Z_WITH_PROBE) && DISABLED(Z_SAFE_HOMING)
1744 1751
       #error "MAGLEV4 requires Z_SAFE_HOMING."
1745 1752
     #elif MAGLEV_TRIGGER_DELAY != 15
1746 1753
       #error "MAGLEV_TRIGGER_DELAY should not be changed. Comment out this line to continue."

+ 8
- 0
Marlin/src/lcd/menu/menu_motion.cpp Bestand weergeven

@@ -349,6 +349,14 @@ void menu_motion() {
349 349
   #endif
350 350
 
351 351
   //
352
+  // Probe Deploy/Stow
353
+  //
354
+  #if ENABLED(PROBE_DEPLOY_STOW_MENU)
355
+    GCODES_ITEM(MSG_MANUAL_DEPLOY, F("M401"));
356
+    GCODES_ITEM(MSG_MANUAL_STOW, F("M402"));
357
+  #endif
358
+
359
+  //
352 360
   // Assisted Bed Tramming
353 361
   //
354 362
   #if ENABLED(ASSISTED_TRAMMING_WIZARD)

+ 52
- 2
Marlin/src/module/probe.cpp Bestand weergeven

@@ -264,7 +264,57 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
264 264
     #endif
265 265
   }
266 266
 
267
-#endif // Z_PROBE_ALLEN_KEY
267
+#elif ENABLED(MAG_MOUNTED_PROBE)
268
+
269
+  typedef struct { float fr_mm_min; xyz_pos_t where; } mag_probe_move_t;
270
+
271
+  inline void run_deploy_moves_script() {
272
+    #ifdef MAG_MOUNTED_DEPLOY_1
273
+      constexpr mag_probe_move_t deploy_1 = MAG_MOUNTED_DEPLOY_1;
274
+      do_blocking_move_to(deploy_1.where, MMM_TO_MMS(deploy_1.fr_mm_min));
275
+    #endif
276
+    #ifdef MAG_MOUNTED_DEPLOY_2
277
+      constexpr mag_probe_move_t deploy_2 = MAG_MOUNTED_DEPLOY_2;
278
+      do_blocking_move_to(deploy_2.where, MMM_TO_MMS(deploy_2.fr_mm_min));
279
+    #endif
280
+    #ifdef MAG_MOUNTED_DEPLOY_3
281
+      constexpr mag_probe_move_t deploy_3 = MAG_MOUNTED_DEPLOY_3;
282
+      do_blocking_move_to(deploy_3.where, MMM_TO_MMS(deploy_3.fr_mm_min));
283
+    #endif
284
+    #ifdef MAG_MOUNTED_DEPLOY_4
285
+      constexpr mag_probe_move_t deploy_4 = MAG_MOUNTED_DEPLOY_4;
286
+      do_blocking_move_to(deploy_4.where, MMM_TO_MMS(deploy_4.fr_mm_min));
287
+    #endif
288
+    #ifdef MAG_MOUNTED_DEPLOY_5
289
+      constexpr mag_probe_move_t deploy_5 = MAG_MOUNTED_DEPLOY_5;
290
+      do_blocking_move_to(deploy_5.where, MMM_TO_MMS(deploy_5.fr_mm_min));
291
+    #endif
292
+  }
293
+
294
+  inline void run_stow_moves_script() {
295
+    #ifdef MAG_MOUNTED_STOW_1
296
+      constexpr mag_probe_move_t stow_1 = MAG_MOUNTED_STOW_1;
297
+      do_blocking_move_to(stow_1.where, MMM_TO_MMS(stow_1.fr_mm_min));
298
+    #endif
299
+    #ifdef MAG_MOUNTED_STOW_2
300
+      constexpr mag_probe_move_t stow_2 = MAG_MOUNTED_STOW_2;
301
+      do_blocking_move_to(stow_2.where, MMM_TO_MMS(stow_2.fr_mm_min));
302
+    #endif
303
+    #ifdef MAG_MOUNTED_STOW_3
304
+      constexpr mag_probe_move_t stow_3 = MAG_MOUNTED_STOW_3;
305
+      do_blocking_move_to(stow_3.where, MMM_TO_MMS(stow_3.fr_mm_min));
306
+    #endif
307
+    #ifdef MAG_MOUNTED_STOW_4
308
+      constexpr mag_probe_move_t stow_4 = MAG_MOUNTED_STOW_4;
309
+      do_blocking_move_to(stow_4.where, MMM_TO_MMS(stow_4.fr_mm_min));
310
+    #endif
311
+    #ifdef MAG_MOUNTED_STOW_5
312
+      constexpr mag_probe_move_t stow_5 = MAG_MOUNTED_STOW_5;
313
+      do_blocking_move_to(stow_5.where, MMM_TO_MMS(stow_5.fr_mm_min));
314
+    #endif
315
+  }
316
+
317
+#endif // MAG_MOUNTED_PROBE
268 318
 
269 319
 #if HAS_QUIET_PROBING
270 320
 
@@ -350,7 +400,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
350 400
 
351 401
     servo[Z_PROBE_SERVO_NR].move(servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]);
352 402
 
353
-  #elif EITHER(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY)
403
+  #elif ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE)
354 404
 
355 405
     deploy ? run_deploy_moves_script() : run_stow_moves_script();
356 406
 

Laden…
Annuleren
Opslaan