Quellcode durchsuchen

✨ MagLev V4 probe by MDD (#23192)

Ave6683 vor 2 Jahren
Ursprung
Commit
d557db8425
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 11
- 0
Marlin/Configuration.h Datei anzeigen

@@ -1090,6 +1090,17 @@
1090 1090
 //#define BLTOUCH
1091 1091
 
1092 1092
 /**
1093
+ * MagLev V4 probe by MDD
1094
+ *
1095
+ * This probe is deployed and activated by powering a built-in electromagnet.
1096
+ */
1097
+//#define MAGLEV4
1098
+#if ENABLED(MAGLEV4)
1099
+  //#define MAGLEV_TRIGGER_PIN 11     // Set to the connected digital output
1100
+  #define MAGLEV_TRIGGER_DELAY 15     // Changing this risks overheating the coil
1101
+#endif
1102
+
1103
+/**
1093 1104
  * Touch-MI Probe by hotends.fr
1094 1105
  *
1095 1106
  * This probe is deployed and activated by moving the X-axis to a magnet at the edge of the bed.

+ 4
- 0
Marlin/src/MarlinCore.cpp Datei anzeigen

@@ -1502,6 +1502,10 @@ void setup() {
1502 1502
     SETUP_RUN(bltouch.init(/*set_voltage=*/true));
1503 1503
   #endif
1504 1504
 
1505
+  #if ENABLED(MAGLEV4)
1506
+    OUT_WRITE(MAGLEV_TRIGGER_PIN, LOW);
1507
+  #endif
1508
+
1505 1509
   #if ENABLED(I2C_POSITION_ENCODERS)
1506 1510
     SETUP_RUN(I2CPEM.init());
1507 1511
   #endif

+ 2
- 1
Marlin/src/core/utility.cpp Datei anzeigen

@@ -74,7 +74,8 @@ void safe_delay(millis_t ms) {
74 74
       TERN_(Z_PROBE_SLED, "Z_PROBE_SLED")
75 75
       TERN_(Z_PROBE_ALLEN_KEY, "Z_PROBE_ALLEN_KEY")
76 76
       TERN_(SOLENOID_PROBE, "SOLENOID_PROBE")
77
-      TERN(PROBE_SELECTED, "", "NONE")
77
+      TERN_(MAGLEV4, "MAGLEV4")
78
+      IF_DISABLED(PROBE_SELECTED, "NONE")
78 79
     );
79 80
 
80 81
     #if HAS_BED_PROBE

+ 1
- 1
Marlin/src/inc/Conditionals_LCD.h Datei anzeigen

@@ -822,7 +822,7 @@
822 822
 /**
823 823
  * Set a flag for any type of bed probe, including the paper-test
824 824
  */
825
-#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)
825
+#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)
826 826
   #define HAS_BED_PROBE 1
827 827
 #endif
828 828
 

+ 18
- 5
Marlin/src/inc/SanityCheck.h Datei anzeigen

@@ -1509,8 +1509,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1509 1509
  */
1510 1510
 #if 1 < 0 \
1511 1511
   + (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \
1512
-  + 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)
1513
-  #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, or Z Servo."
1512
+  + 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)
1513
+  #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."
1514 1514
 #endif
1515 1515
 
1516 1516
 #if HAS_BED_PROBE
@@ -1613,6 +1613,19 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1613 1613
   #endif
1614 1614
 
1615 1615
   /**
1616
+   * MagLev V4 probe requirements
1617
+   */
1618
+  #if ENABLED(MAGLEV4)
1619
+    #if !PIN_EXISTS(MAGLEV_TRIGGER)
1620
+      #error "MAGLEV4 requires MAGLEV_TRIGGER_PIN to be defined."
1621
+    #elif DISABLED(Z_SAFE_HOMING)
1622
+      #error "MAGLEV4 requires Z_SAFE_HOMING."
1623
+    #elif MAGLEV_TRIGGER_DELAY != 15
1624
+      #error "MAGLEV_TRIGGER_DELAY should not be changed. Comment out this line to continue."
1625
+    #endif
1626
+  #endif
1627
+
1628
+  /**
1616 1629
    * Require pin options and pins to be defined
1617 1630
    */
1618 1631
   #if ENABLED(SENSORLESS_PROBING)
@@ -1699,11 +1712,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1699 1712
    * Require some kind of probe for bed leveling and probe testing
1700 1713
    */
1701 1714
   #if HAS_ABL_NOT_UBL && !PROBE_SELECTED
1702
-    #error "Auto Bed Leveling requires one of these: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or a Z Servo."
1715
+    #error "Auto Bed Leveling requires either PROBE_MANUALLY, SENSORLESS_PROBING, or a real probe."
1703 1716
   #endif
1704 1717
 
1705 1718
   #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
1706
-    #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a probe: FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo."
1719
+    #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a real probe."
1707 1720
   #endif
1708 1721
 
1709 1722
 #endif
@@ -3443,7 +3456,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
3443 3456
 
3444 3457
 #if ENABLED(MECHANICAL_GANTRY_CALIBRATION)
3445 3458
   #if NONE(HAS_MOTOR_CURRENT_DAC, HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC, HAS_TRINAMIC_CONFIG, HAS_MOTOR_CURRENT_PWM)
3446
-    #error "It is highly recommended to have adjustable current drivers to prevent damage. Disable this line to continue anyway."
3459
+    #error "Adjustable current drivers are highly recommended to prevent damage. Comment out this line to continue anyway."
3447 3460
   #elif !defined(GANTRY_CALIBRATION_CURRENT)
3448 3461
     #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_CURRENT to be set."
3449 3462
   #elif !defined(GANTRY_CALIBRATION_EXTRA_HEIGHT)

+ 15
- 0
Marlin/src/module/probe.cpp Datei anzeigen

@@ -121,6 +121,17 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
121 121
     #endif
122 122
   }
123 123
 
124
+#elif ENABLED(MAGLEV4)
125
+
126
+  // Write trigger pin to release the probe
127
+  inline void maglev_deploy() {
128
+    WRITE(MAGLEV_TRIGGER_PIN, HIGH);
129
+    delay(MAGLEV_TRIGGER_DELAY);
130
+    WRITE(MAGLEV_TRIGGER_PIN, LOW);
131
+  }
132
+
133
+  inline void maglev_idle() { do_blocking_move_to_z(10); }
134
+
124 135
 #elif ENABLED(TOUCH_MI_PROBE)
125 136
 
126 137
   // Move to the magnet to unlock the probe
@@ -311,6 +322,10 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
311 322
       WRITE(SOL1_PIN, deploy);
312 323
     #endif
313 324
 
325
+  #elif ENABLED(MAGLEV4)
326
+
327
+    deploy ? maglev_deploy() : maglev_idle();
328
+
314 329
   #elif ENABLED(Z_PROBE_SLED)
315 330
 
316 331
     dock_sled(!deploy);

Laden…
Abbrechen
Speichern