MagLev V4 probe by MDD (#23192)

This commit is contained in:
Ave6683 2021-12-27 22:28:27 +01:00 committed by Scott Lahteine
parent 4e72df9a28
commit d8c5e49281
6 changed files with 51 additions and 7 deletions

View File

@ -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
* *

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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);