Various Laser / Spindle improvements (#15335)
This commit is contained in:
@@ -1451,7 +1451,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
* Deploying the Allen Key probe uses big moves in z direction. Too dangerous for an unhomed z-axis.
|
||||
*/
|
||||
#if ENABLED(Z_PROBE_ALLEN_KEY) && (Z_HOME_DIR < 0) && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
|
||||
#error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY"
|
||||
#error "You can't home to a z min endstop with a Z_PROBE_ALLEN_KEY."
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -2654,9 +2654,9 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
|
||||
#if ENABLED(BACKLASH_COMPENSATION)
|
||||
#ifndef BACKLASH_DISTANCE_MM
|
||||
#error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM"
|
||||
#error "BACKLASH_COMPENSATION requires BACKLASH_DISTANCE_MM."
|
||||
#elif !defined(BACKLASH_CORRECTION)
|
||||
#error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION"
|
||||
#error "BACKLASH_COMPENSATION requires BACKLASH_CORRECTION."
|
||||
#elif IS_CORE
|
||||
constexpr float backlash_arr[] = BACKLASH_DISTANCE_MM;
|
||||
static_assert(!backlash_arr[CORE_AXIS_1] && !backlash_arr[CORE_AXIS_2],
|
||||
@@ -2736,6 +2736,45 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
#endif
|
||||
|
||||
#if HAS_CUTTER
|
||||
#ifndef CUTTER_POWER_DISPLAY
|
||||
#error "CUTTER_POWER_DISPLAY is required with a spindle or laser. Please update your Configuration_adv.h."
|
||||
#elif !CUTTER_DISPLAY_IS(PWM) && !CUTTER_DISPLAY_IS(PERCENT) && !CUTTER_DISPLAY_IS(RPM)
|
||||
#error "CUTTER_POWER_DISPLAY must be PWM, PERCENT, or RPM. Please update your Configuration_adv.h."
|
||||
#endif
|
||||
|
||||
#if ENABLED(LASER_POWER_INLINE)
|
||||
#if ENABLED(SPINDLE_CHANGE_DIR)
|
||||
#error "SPINDLE_CHANGE_DIR and LASER_POWER_INLINE are incompatible."
|
||||
#elif ENABLED(LASER_MOVE_G0_OFF) && DISABLED(LASER_MOVE_POWER)
|
||||
#error "LASER_MOVE_G0_OFF requires LASER_MOVE_POWER. Please update your Configuration_adv.h."
|
||||
#endif
|
||||
#if ENABLED(LASER_POWER_INLINE_TRAPEZOID)
|
||||
#if DISABLED(SPINDLE_LASER_PWM)
|
||||
#error "LASER_POWER_INLINE_TRAPEZOID requires SPINDLE_LASER_PWM to function."
|
||||
#elif ENABLED(S_CURVE_ACCELERATION)
|
||||
//#ifndef LASER_POWER_INLINE_S_CURVE_ACCELERATION_WARN
|
||||
// #define LASER_POWER_INLINE_S_CURVE_ACCELERATION_WARN
|
||||
// #warning "Combining LASER_POWER_INLINE_TRAPEZOID with S_CURVE_ACCELERATION may result in unintended behavior."
|
||||
//#endif
|
||||
#endif
|
||||
#endif
|
||||
#if ENABLED(LASER_POWER_INLINE_INVERT)
|
||||
//#ifndef LASER_POWER_INLINE_INVERT_WARN
|
||||
// #define LASER_POWER_INLINE_INVERT_WARN
|
||||
// #warning "Enabling LASER_POWER_INLINE_INVERT means that `M5` won't kill the laser immediately; use `M5 I` instead."
|
||||
//#endif
|
||||
#endif
|
||||
#else
|
||||
#if SPINDLE_LASER_POWERUP_DELAY < 1
|
||||
#error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
|
||||
#elif SPINDLE_LASER_POWERDOWN_DELAY < 1
|
||||
#error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
|
||||
#elif ENABLED(LASER_MOVE_POWER)
|
||||
#error "LASER_MOVE_POWER requires LASER_POWER_INLINE."
|
||||
#elif ANY(LASER_POWER_INLINE_TRAPEZOID, LASER_POWER_INLINE_INVERT, LASER_MOVE_G0_OFF, LASER_MOVE_POWER)
|
||||
#error "Enabled an inline laser feature without inline laser power being enabled."
|
||||
#endif
|
||||
#endif
|
||||
#define _PIN_CONFLICT(P) (PIN_EXISTS(P) && P##_PIN == SPINDLE_LASER_PWM_PIN)
|
||||
#if BOTH(SPINDLE_FEATURE, LASER_FEATURE)
|
||||
#error "Enable only one of SPINDLE_FEATURE or LASER_FEATURE."
|
||||
@@ -2748,13 +2787,9 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
|
||||
#error "SPINDLE_LASER_PWM_PIN is required for SPINDLE_LASER_PWM."
|
||||
#elif !PWM_PIN(SPINDLE_LASER_PWM_PIN)
|
||||
#error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
|
||||
#elif SPINDLE_LASER_POWERUP_DELAY < 1
|
||||
#error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
|
||||
#elif SPINDLE_LASER_POWERDOWN_DELAY < 1
|
||||
#error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
|
||||
#elif !defined(SPINDLE_LASER_PWM_INVERT)
|
||||
#error "SPINDLE_LASER_PWM_INVERT is required for (SPINDLE|LASER)_FEATURE."
|
||||
#elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX)
|
||||
#elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX) || !defined(SPEED_POWER_STARTUP)
|
||||
#error "SPINDLE_LASER_PWM equation constant(s) missing."
|
||||
#elif _PIN_CONFLICT(X_MIN)
|
||||
#error "SPINDLE_LASER_PWM pin conflicts with X_MIN_PIN."
|
||||
|
Reference in New Issue
Block a user