Browse Source

MagLev V4 probe by MDD (#23192)

FB4S_WIFI
Ave6683 3 years ago
committed by Scott Lahteine
parent
commit
d8c5e49281
  1. 11
      Marlin/Configuration.h
  2. 4
      Marlin/src/MarlinCore.cpp
  3. 3
      Marlin/src/core/utility.cpp
  4. 2
      Marlin/src/inc/Conditionals_LCD.h
  5. 23
      Marlin/src/inc/SanityCheck.h
  6. 15
      Marlin/src/module/probe.cpp

11
Marlin/Configuration.h

@ -1094,6 +1094,17 @@
*/ */
//#define BLTOUCH //#define BLTOUCH
/**
* MagLev V4 probe by MDD
*
* This probe is deployed and activated by powering a built-in electromagnet.
*/
//#define MAGLEV4
#if ENABLED(MAGLEV4)
//#define MAGLEV_TRIGGER_PIN 11 // Set to the connected digital output
#define MAGLEV_TRIGGER_DELAY 15 // Changing this risks overheating the coil
#endif
/** /**
* Touch-MI Probe by hotends.fr * Touch-MI Probe by hotends.fr
* *

4
Marlin/src/MarlinCore.cpp

@ -1502,6 +1502,10 @@ void setup() {
SETUP_RUN(bltouch.init(/*set_voltage=*/true)); SETUP_RUN(bltouch.init(/*set_voltage=*/true));
#endif #endif
#if ENABLED(MAGLEV4)
OUT_WRITE(MAGLEV_TRIGGER_PIN, LOW);
#endif
#if ENABLED(I2C_POSITION_ENCODERS) #if ENABLED(I2C_POSITION_ENCODERS)
SETUP_RUN(I2CPEM.init()); SETUP_RUN(I2CPEM.init());
#endif #endif

3
Marlin/src/core/utility.cpp

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

2
Marlin/src/inc/Conditionals_LCD.h

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

23
Marlin/src/inc/SanityCheck.h

@ -1509,8 +1509,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
*/ */
#if 1 < 0 \ #if 1 < 0 \
+ (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \ + (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \
+ 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) + 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)
#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." #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."
#endif #endif
#if HAS_BED_PROBE #if HAS_BED_PROBE
@ -1612,6 +1612,19 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#endif #endif
#endif #endif
/**
* MagLev V4 probe requirements
*/
#if ENABLED(MAGLEV4)
#if !PIN_EXISTS(MAGLEV_TRIGGER)
#error "MAGLEV4 requires MAGLEV_TRIGGER_PIN to be defined."
#elif DISABLED(Z_SAFE_HOMING)
#error "MAGLEV4 requires Z_SAFE_HOMING."
#elif MAGLEV_TRIGGER_DELAY != 15
#error "MAGLEV_TRIGGER_DELAY should not be changed. Comment out this line to continue."
#endif
#endif
/** /**
* Require pin options and pins to be defined * Require pin options and pins to be defined
*/ */
@ -1699,11 +1712,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
* Require some kind of probe for bed leveling and probe testing * Require some kind of probe for bed leveling and probe testing
*/ */
#if HAS_ABL_NOT_UBL && !PROBE_SELECTED #if HAS_ABL_NOT_UBL && !PROBE_SELECTED
#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." #error "Auto Bed Leveling requires either PROBE_MANUALLY, SENSORLESS_PROBING, or a real probe."
#endif #endif
#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
#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." #error "Z_MIN_PROBE_REPEATABILITY_TEST requires a real probe."
#endif #endif
#endif #endif
@ -3447,7 +3460,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#if ENABLED(MECHANICAL_GANTRY_CALIBRATION) #if ENABLED(MECHANICAL_GANTRY_CALIBRATION)
#if NONE(HAS_MOTOR_CURRENT_DAC, HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC, HAS_TRINAMIC_CONFIG, HAS_MOTOR_CURRENT_PWM) #if NONE(HAS_MOTOR_CURRENT_DAC, HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC, HAS_TRINAMIC_CONFIG, HAS_MOTOR_CURRENT_PWM)
#error "It is highly recommended to have adjustable current drivers to prevent damage. Disable this line to continue anyway." #error "Adjustable current drivers are highly recommended to prevent damage. Comment out this line to continue anyway."
#elif !defined(GANTRY_CALIBRATION_CURRENT) #elif !defined(GANTRY_CALIBRATION_CURRENT)
#error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_CURRENT to be set." #error "MECHANICAL_GANTRY_CALIBRATION Requires GANTRY_CALIBRATION_CURRENT to be set."
#elif !defined(GANTRY_CALIBRATION_EXTRA_HEIGHT) #elif !defined(GANTRY_CALIBRATION_EXTRA_HEIGHT)

15
Marlin/src/module/probe.cpp

@ -121,6 +121,17 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
#endif #endif
} }
#elif ENABLED(MAGLEV4)
// Write trigger pin to release the probe
inline void maglev_deploy() {
WRITE(MAGLEV_TRIGGER_PIN, HIGH);
delay(MAGLEV_TRIGGER_DELAY);
WRITE(MAGLEV_TRIGGER_PIN, LOW);
}
inline void maglev_idle() { do_blocking_move_to_z(10); }
#elif ENABLED(TOUCH_MI_PROBE) #elif ENABLED(TOUCH_MI_PROBE)
// Move to the magnet to unlock the probe // Move to the magnet to unlock the probe
@ -311,6 +322,10 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
WRITE(SOL1_PIN, deploy); WRITE(SOL1_PIN, deploy);
#endif #endif
#elif ENABLED(MAGLEV4)
deploy ? maglev_deploy() : maglev_idle();
#elif ENABLED(Z_PROBE_SLED) #elif ENABLED(Z_PROBE_SLED)
dock_sled(!deploy); dock_sled(!deploy);

Loading…
Cancel
Save