diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 8339e7ab748ecf220e7d517b79c1eda1a36c18bd..454bcbe20f8320b1e60b76940214ab641b9d51d2 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/Marlin/src/HAL/HAL_AVR/SanityCheck.h b/Marlin/src/HAL/HAL_AVR/SanityCheck.h index 68bfdc16a01b2389de0e01458f0869826747a769..3bcd2f7c205537b62b41b1a27477694be1fdfc1c 100644 --- a/Marlin/src/HAL/HAL_AVR/SanityCheck.h +++ b/Marlin/src/HAL/HAL_AVR/SanityCheck.h @@ -22,7 +22,7 @@ #pragma once /** - * Test AVR specific configuration values for errors at compile-time. + * Test AVR-specific configuration values for errors at compile-time. */ /** @@ -43,65 +43,15 @@ #endif /** - * Sanity checks for Spindle / Laser + * Sanity checks for Spindle / Laser PWM */ -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !PIN_EXISTS(SPINDLE_LASER_ENA) - #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENA_PIN." - #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR) - #error "SPINDLE_DIR_PIN not defined." - #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM) - #if !(WITHIN(SPINDLE_LASER_PWM_PIN, 2, 13) || WITHIN(SPINDLE_LASER_PWM_PIN, 44, 46)) - #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 missing." - #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX) - #error "SPINDLE_LASER_PWM equation constant(s) missing." - #elif SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13) - #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt." - #elif PIN_EXISTS(X_MAX) && X_MAX_PIN == SPINDLE_LASER_PWM_PIN - #error "SPINDLE_LASER_PWM pin is in use by X_MAX endstop." - #elif PIN_EXISTS(X_MIN) && X_MIN_PIN == SPINDLE_LASER_PWM_PIN - #error "SPINDLE_LASER_PWM pin is in use by X_MIN endstop." - #elif PIN_EXISTS(Z_STEP) && Z_STEP_PIN == SPINDLE_LASER_PWM_PIN - #error "SPINDLE_LASER_PWM pin in use by Z_STEP." - #elif NUM_SERVOS > 0 && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5) - #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system." - #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN." - #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN." - #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN." - #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN." - #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN." - #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN." - #elif PIN_EXISTS(E5_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E5_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E5_AUTO_FAN_PIN." - #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by FAN_PIN." - #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN - #error "SPINDLE_LASER_PWM_PIN is used by FAN1_PIN." - #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN - #error "SPINDLE_LASER_PWM_PIN is used by FAN2_PIN." - #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN." - #elif PIN_EXISTS(MOTOR_CURRENT_PWM_XY) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_XY_PIN - #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_XY." - #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_Z_PIN - #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_Z." - #elif PIN_EXISTS(MOTOR_CURRENT_PWM_E) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_E_PIN - #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_E." - #endif +#if ENABLED(SPINDLE_LASER_PWM) + #if SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13) + #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt." + #elif NUM_SERVOS > 0 && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5) + #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system." #endif -#endif // SPINDLE_LASER_ENABLE +#endif /** * The Trinamic library includes SoftwareSerial.h, leading to a compile error. diff --git a/Marlin/src/HAL/HAL_LINUX/SanityCheck.h b/Marlin/src/HAL/HAL_LINUX/SanityCheck.h index 0b4322512f411f7b6e649044b67c27abfb27aad0..bb65bed6cc0ba982247668dc66e21b0cdf3b8075 100644 --- a/Marlin/src/HAL/HAL_LINUX/SanityCheck.h +++ b/Marlin/src/HAL/HAL_LINUX/SanityCheck.h @@ -21,50 +21,13 @@ */ /** - * Test X86_64 configuration values for errors at compile-time. + * Test X86_64-specific configuration values for errors at compile-time. */ -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !PIN_EXISTS(SPINDLE_LASER_ENA) - #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENA_PIN." - #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR) - #error "SPINDLE_DIR_PIN not defined." - #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM) - #if !PWM_PIN(SPINDLE_LASER_PWM_PIN) - #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin." - #elif !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) - #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" - #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 missing." - #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX) - #error "SPINDLE_LASER_PWM equation constant(s) missing." - #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN." - #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN." - #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN." - #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN." - #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN." - #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN." - #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN." - #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN." - #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN." - #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN." - #endif - #endif -#endif // SPINDLE_LASER_ENABLE +// Emulating RAMPS +#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) + #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" +#endif #if ENABLED(FAST_PWM_FAN) #error "FAST_PWM_FAN is not yet implemented for this platform." diff --git a/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h b/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h index c0ba833f25f197bfa14b016f20abc710eb0ade8f..4813be28f77aabb6efc8e1a30ff8a3aa2fd1715c 100644 --- a/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h +++ b/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h @@ -21,50 +21,12 @@ */ /** - * Test Re-ARM specific configuration values for errors at compile-time. + * Test LPC176x-specific configuration values for errors at compile-time. */ -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !PIN_EXISTS(SPINDLE_LASER_ENA) - #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENA_PIN." - #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR) - #error "SPINDLE_DIR_PIN not defined." - #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM) - #if !PWM_PIN(SPINDLE_LASER_PWM_PIN) - #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin." - #elif !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) - #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" - #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 missing." - #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX) - #error "SPINDLE_LASER_PWM equation constant(s) missing." - #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN." - #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN." - #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN." - #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN." - #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN." - #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN." - #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN." - #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN." - #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN." - #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN." - #endif - #endif -#endif // SPINDLE_LASER_ENABLE +//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) +// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" +//#endif #if IS_RE_ARM_BOARD && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI) #error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 require TMC_USE_SW_SPI" diff --git a/Marlin/src/HAL/HAL_STM32/SanityCheck.h b/Marlin/src/HAL/HAL_STM32/SanityCheck.h index 6c6ede24b48dcbb082c70ad7535a3c317df26066..8188c8747132d116e53f2a99340ea04f6cd4f9eb 100644 --- a/Marlin/src/HAL/HAL_STM32/SanityCheck.h +++ b/Marlin/src/HAL/HAL_STM32/SanityCheck.h @@ -22,49 +22,11 @@ #pragma once /** - * Test Re-ARM specific configuration values for errors at compile-time. + * Test STM32-specific configuration values for errors at compile-time. */ -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !PIN_EXISTS(SPINDLE_LASER_ENA) - #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENA_PIN." - #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR) - #error "SPINDLE_DIR_PIN not defined." - #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM) - #if !PWM_PIN(SPINDLE_LASER_PWM_PIN) - #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin." - #elif !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) - #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" - #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 missing." - #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX) - #error "SPINDLE_LASER_PWM equation constant(s) missing." - #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN." - #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN." - #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN." - #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN." - #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN." - #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN." - #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN." - #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN." - #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN." - #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN." - #endif - #endif -#endif // SPINDLE_LASER_ENABLE +//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) +// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" +//#endif #if ENABLED(EMERGENCY_PARSER) #error "EMERGENCY_PARSER is not yet implemented for STM32. Disable EMERGENCY_PARSER to continue." diff --git a/Marlin/src/HAL/HAL_STM32F1/SanityCheck.h b/Marlin/src/HAL/HAL_STM32F1/SanityCheck.h index c1470ca51ea33d5678c979eaea5f17df1788cc47..483ee9f3936de60f1726ac0c118490be66dc9c68 100644 --- a/Marlin/src/HAL/HAL_STM32F1/SanityCheck.h +++ b/Marlin/src/HAL/HAL_STM32F1/SanityCheck.h @@ -21,52 +21,9 @@ */ /** - * HAL for stm32duino.com based on Libmaple and compatible (STM32F1) + * Test STM32F1-specific configuration values for errors at compile-time. */ -/** - * Test Re-ARM specific configuration values for errors at compile-time. - */ -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !PIN_EXISTS(SPINDLE_LASER_ENA) - #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENA_PIN." - #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR) - #error "SPINDLE_DIR_PIN not defined." - #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM) - #if !PWM_PIN(SPINDLE_LASER_PWM_PIN) - #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin." - #elif SPINDLE_LASER_POWERUP_DELAY < 0 - #error "SPINDLE_LASER_POWERUP_DELAY must be positive" - #elif SPINDLE_LASER_POWERDOWN_DELAY < 0 - #error "SPINDLE_LASER_POWERDOWN_DELAY must be positive" - #elif !defined(SPINDLE_LASER_PWM_INVERT) - #error "SPINDLE_LASER_PWM_INVERT missing." - #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX) - #error "SPINDLE_LASER_PWM equation constant(s) missing." - #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN." - #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN." - #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN." - #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN." - #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN." - #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN." - #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN." - #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN." - #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN." - #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN." - #endif - #endif -#endif // SPINDLE_LASER_ENABLE - #if ENABLED(EMERGENCY_PARSER) #error "EMERGENCY_PARSER is not yet implemented for STM32F1. Disable EMERGENCY_PARSER to continue." #endif diff --git a/Marlin/src/HAL/HAL_STM32F4/SanityCheck.h b/Marlin/src/HAL/HAL_STM32F4/SanityCheck.h index 441daf925731d0eb7211d2ad4270c5cb67af65fc..7b1629bb289cfcf011a218f7aa2b23686090bdd4 100644 --- a/Marlin/src/HAL/HAL_STM32F4/SanityCheck.h +++ b/Marlin/src/HAL/HAL_STM32F4/SanityCheck.h @@ -21,49 +21,11 @@ */ /** - * Test Re-ARM specific configuration values for errors at compile-time. + * Test STM32F4-specific configuration values for errors at compile-time. */ -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !PIN_EXISTS(SPINDLE_LASER_ENA) - #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENA_PIN." - #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR) - #error "SPINDLE_DIR_PIN not defined." - #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM) - #if !PWM_PIN(SPINDLE_LASER_PWM_PIN) - #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin." - #elif !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) - #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" - #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 missing." - #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX) - #error "SPINDLE_LASER_PWM equation constant(s) missing." - #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN." - #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN." - #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN." - #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN." - #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN." - #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN." - #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN." - #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN." - #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN." - #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN." - #endif - #endif -#endif // SPINDLE_LASER_ENABLE +//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) +// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" +//#endif #if ENABLED(EMERGENCY_PARSER) #error "EMERGENCY_PARSER is not yet implemented for STM32F4. Disable EMERGENCY_PARSER to continue." diff --git a/Marlin/src/HAL/HAL_STM32F7/SanityCheck.h b/Marlin/src/HAL/HAL_STM32F7/SanityCheck.h index 8ba1f870c20eac38ca2e0f53f0fff476a818bfda..cb999ef97d80e4bc758fefbbac509357d79b8727 100644 --- a/Marlin/src/HAL/HAL_STM32F7/SanityCheck.h +++ b/Marlin/src/HAL/HAL_STM32F7/SanityCheck.h @@ -21,51 +21,11 @@ */ /** - * Test Re-ARM specific configuration values for errors at compile-time. + * Test STM32F7-specific configuration values for errors at compile-time. */ -#if ENABLED(SPINDLE_LASER_ENABLE) - #if !PIN_EXISTS(SPINDLE_LASER_ENA) - #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENA_PIN." - #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR) - #error "SPINDLE_DIR_PIN not defined." - #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM) - #if !PWM_PIN(SPINDLE_LASER_PWM_PIN) - #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin." - #elif !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) - #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" - #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 missing." - #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX) - #error "SPINDLE_LASER_PWM equation constant(s) missing." - #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN." - #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN." - #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN." - #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN." - #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN." - #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN." - #elif PIN_EXISTS(E5_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E5_AUTO_FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by E5_AUTO_FAN_PIN." - #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN." - #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN." - #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN." - #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN." - #endif - #endif -#endif // SPINDLE_LASER_ENABLE +//#if ENABLED(SPINDLE_LASER_PWM) && !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11) +// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" +//#endif #if ENABLED(EMERGENCY_PARSER) #error "EMERGENCY_PARSER is not yet implemented for STM32F7. Disable EMERGENCY_PARSER to continue." diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 4ec88d8aeff880c3002ce1b3f1baf539f80e1970..cd02fc38e953c00de967da2e322c0dc6bde969b2 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -106,6 +106,10 @@ #include "feature/tmc_util.h" #endif +#if HAS_CUTTER + #include "feature/spindle_laser.h" +#endif + #if ENABLED(SDSUPPORT) CardReader card; #endif @@ -967,15 +971,8 @@ void setup() { OUT_WRITE(PHOTOGRAPH_PIN, LOW); #endif - #if ENABLED(SPINDLE_LASER_ENABLE) - OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ENABLE_INVERT); // init spindle to off - #if SPINDLE_DIR_CHANGE - OUT_WRITE(SPINDLE_DIR_PIN, SPINDLE_INVERT_DIR ? 255 : 0); // init rotation to clockwise (M3) - #endif - #if ENABLED(SPINDLE_LASER_PWM) && defined(SPINDLE_LASER_PWM_PIN) && SPINDLE_LASER_PWM_PIN >= 0 - SET_PWM(SPINDLE_LASER_PWM_PIN); - analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); // set to lowest speed - #endif + #if HAS_CUTTER + cutter.init(); #endif #if ENABLED(COOLANT_MIST) diff --git a/Marlin/src/feature/spindle_laser.cpp b/Marlin/src/feature/spindle_laser.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8c0316c7850e7d8e06181ea5d63d274a55c450d8 --- /dev/null +++ b/Marlin/src/feature/spindle_laser.cpp @@ -0,0 +1,99 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +/** + * feature/spindle_laser.cpp + */ + +#include "../inc/MarlinConfig.h" + +#if HAS_CUTTER + +#include "spindle_laser.h" + +SpindleLaser cutter; + +cutter_power_t SpindleLaser::power; // = 0 + +void SpindleLaser::init() { + OUT_WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_HIGH); // Init spindle to off + #if ENABLED(SPINDLE_CHANGE_DIR) + OUT_WRITE(SPINDLE_DIR_PIN, SPINDLE_INVERT_DIR ? 255 : 0); // Init rotation to clockwise (M3) + #endif + #if ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM) + SET_PWM(SPINDLE_LASER_PWM_PIN); + analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); // set to lowest speed + #endif +} + +#if ENABLED(SPINDLE_LASER_PWM) + + /** + * ocr_val_mode() is used for debugging and to get the points needed to compute the RPM vs ocr_val line + * + * it accepts inputs of 0-255 + */ + void SpindleLaser::set_ocr(const uint8_t ocr) { + WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ACTIVE_HIGH); // turn spindle on (active low) + #if ENABLED(SPINDLE_LASER_PWM) + analogWrite(SPINDLE_LASER_PWM_PIN, (SPINDLE_LASER_PWM_INVERT) ? 255 - ocr : ocr); + #endif + } + +#endif + +void SpindleLaser::update_output() { + const bool ena = enabled(); + #if ENABLED(SPINDLE_LASER_PWM) + if (ena) { + constexpr float inv_slope = RECIPROCAL(SPEED_POWER_SLOPE), + min_ocr = (SPEED_POWER_MIN - (SPEED_POWER_INTERCEPT)) * inv_slope, // Minimum allowed + max_ocr = (SPEED_POWER_MAX - (SPEED_POWER_INTERCEPT)) * inv_slope; // Maximum allowed + int16_t ocr_val; + if (power <= SPEED_POWER_MIN) ocr_val = min_ocr; // Use minimum if set below + else if (power >= SPEED_POWER_MAX) ocr_val = max_ocr; // Use maximum if set above + else ocr_val = (power - (SPEED_POWER_INTERCEPT)) * inv_slope; // Use calculated OCR value + set_ocr(ocr_val & 0xFF); // ...limited to Atmel PWM max + } + else { // Convert RPM to PWM duty cycle + WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ACTIVE_HIGH); // Turn spindle off (active low) + analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); // Only write low byte + } + #else + WRITE(SPINDLE_LASER_ENA_PIN, ena ? SPINDLE_LASER_ACTIVE_HIGH : !SPINDLE_LASER_ACTIVE_HIGH); + #endif + power_delay(ena); +} + +#if ENABLED(SPINDLE_CHANGE_DIR) + + void SpindleLaser::set_direction(const bool reverse) { + const bool dir_state = (reverse == SPINDLE_INVERT_DIR); // Forward (M3) HIGH when not inverted + #if ENABLED(SPINDLE_STOP_ON_DIR_CHANGE) + if (enabled() && READ(SPINDLE_DIR_PIN) != dir_state) disable(); + #endif + WRITE(SPINDLE_DIR_PIN, dir_state); + } + +#endif + +#endif // HAS_CUTTER diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h new file mode 100644 index 0000000000000000000000000000000000000000..cb514d5f3eddbc698932541a607d92e5776eb07e --- /dev/null +++ b/Marlin/src/feature/spindle_laser.h @@ -0,0 +1,83 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +#pragma once + +/** + * feature/spindle_laser.h + * Support for Laser Power or Spindle Power & Direction + */ + +#include "../inc/MarlinConfig.h" + +#if ENABLED(SPINDLE_FEATURE) + #define _MSG_CUTTER(M) MSG_SPINDLE_##M +#else + #define _MSG_CUTTER(M) MSG_LASER_##M +#endif +#define MSG_CUTTER(M) _MSG_CUTTER(M) + +#if SPEED_POWER_MAX > 255 + #define cutter_power_t uint16_t + #define CUTTER_MENU_TYPE uint16_5 +#else + #define cutter_power_t uint8_t + #define CUTTER_MENU_TYPE uint8 +#endif + +class SpindleLaser { +public: + static cutter_power_t power; + + static void init(); + + static inline bool enabled() { return !!power; } + + static inline void set_power(const uint8_t pwr) { power = pwr; update_output(); } + + static inline void set_enabled(const bool enable) { set_power(enable ? 255 : 0); } + + //static bool active() { return READ(SPINDLE_LASER_ENA_PIN) == SPINDLE_LASER_ACTIVE_HIGH; } + + #if ENABLED(SPINDLE_LASER_PWM) + static void update_output(); + static void set_ocr(const uint8_t ocr); + static inline void set_ocr_power(const uint8_t pwr) { power = pwr; set_ocr(pwr); } + #else + static inline void update_output() { } + #endif + + // Wait for spindle to spin up or spin down + static inline void power_delay(const bool on) { safe_delay(on ? SPINDLE_LASER_POWERUP_DELAY : SPINDLE_LASER_POWERDOWN_DELAY); } + + #if ENABLED(SPINDLE_CHANGE_DIR) + static void set_direction(const bool reverse); + #else + static inline void set_direction(const bool reverse) { UNUSED(reverse); } + #endif + + static inline void disable() { set_enabled(false); } + static inline void enable_forward() { set_direction(false); set_enabled(true); } + static inline void enable_reverse() { set_direction(true); set_enabled(true); } + +}; + +extern SpindleLaser cutter; diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index 132f7bb399162cf4afe6148faeaa19825501965a..6b8497ea40f9cec83c81aed1253df13cb9b17cc8 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -22,23 +22,23 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SPINDLE_LASER_ENABLE) +#if HAS_CUTTER #include "../gcode.h" +#include "../../feature/spindle_laser.h" #include "../../module/stepper.h" -uint8_t spindle_laser_power; // = 0 - /** - * M3: Spindle Clockwise - * M4: Spindle Counter-clockwise + * M3 - Cutter ON (Clockwise) + * M4 - Cutter ON (Counter-clockwise) * - * S0 turns off spindle. + * S<power> - Set power. S0 turns it off. + * O<ocr> - Set power and OCR * - * If no speed PWM output is defined then M3/M4 just turns it on. + * If no PWM pin is defined then M3/M4 just turns it on. * - * At least 12.8KHz (50Hz * 256) is needed for spindle PWM. - * Hardware PWM is required. ISRs are too slow. + * At least 12.8KHz (50Hz * 256) is needed for Spindle PWM. + * Hardware PWM is required on AVR. ISRs are too slow. * * NOTE: WGM for timers 3, 4, and 5 must be either Mode 1 or Mode 5. * No other settings give a PWM signal that goes from 0 to 5 volts. @@ -59,114 +59,28 @@ uint8_t spindle_laser_power; // = 0 * * PWM duty cycle goes from 0 (off) to 255 (always on). */ - -// Wait for spindle to come up to speed -inline void delay_for_power_up() { safe_delay(SPINDLE_LASER_POWERUP_DELAY); } - -// Wait for spindle to stop turning -inline void delay_for_power_down() { safe_delay(SPINDLE_LASER_POWERDOWN_DELAY); } - -/** - * ocr_val_mode() is used for debugging and to get the points needed to compute the RPM vs ocr_val line - * - * it accepts inputs of 0-255 - */ - -inline void set_spindle_laser_ocr(const uint8_t ocr) { - WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ENABLE_INVERT); // turn spindle on (active low) - #if ENABLED(SPINDLE_LASER_PWM) - analogWrite(SPINDLE_LASER_PWM_PIN, (SPINDLE_LASER_PWM_INVERT) ? 255 - ocr : ocr); - #endif -} - -#if ENABLED(SPINDLE_LASER_PWM) - - void update_spindle_laser_power() { - if (spindle_laser_power == 0) { - WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ENABLE_INVERT); // turn spindle off (active low) - analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); // only write low byte - delay_for_power_down(); - } - else { // Convert RPM to PWM duty cycle - constexpr float inv_slope = 1.0f / (SPEED_POWER_SLOPE), - min_ocr = (SPEED_POWER_MIN - (SPEED_POWER_INTERCEPT)) * inv_slope, // Minimum allowed - max_ocr = (SPEED_POWER_MAX - (SPEED_POWER_INTERCEPT)) * inv_slope; // Maximum allowed - int16_t ocr_val; - if (spindle_laser_power <= SPEED_POWER_MIN) ocr_val = min_ocr; // Use minimum if set below - else if (spindle_laser_power >= SPEED_POWER_MAX) ocr_val = max_ocr; // Use maximum if set above - else ocr_val = (spindle_laser_power - (SPEED_POWER_INTERCEPT)) * inv_slope; // Use calculated OCR value - set_spindle_laser_ocr(ocr_val & 0xFF); // ...limited to Atmel PWM max - delay_for_power_up(); - } - } - -#endif // SPINDLE_LASER_PWM - -bool spindle_laser_enabled() { - return !!spindle_laser_power; // READ(SPINDLE_LASER_ENA_PIN) == SPINDLE_LASER_ENABLE_INVERT; -} - -void set_spindle_laser_enabled(const bool enable) { - // Enabled by PWM setting elsewhere - spindle_laser_power = enable ? 255 : 0; - #if ENABLED(SPINDLE_LASER_PWM) - update_spindle_laser_power(); - #else - if (enable) { - WRITE(SPINDLE_LASER_ENA_PIN, SPINDLE_LASER_ENABLE_INVERT); - delay_for_power_up(); - } - else { - WRITE(SPINDLE_LASER_ENA_PIN, !SPINDLE_LASER_ENABLE_INVERT); - delay_for_power_down(); - } - #endif -} - -#if SPINDLE_DIR_CHANGE - - void set_spindle_direction(const bool reverse_dir) { - const bool dir_state = (reverse_dir == SPINDLE_INVERT_DIR); // Forward (M3) HIGH when not inverted - if (SPINDLE_STOP_ON_DIR_CHANGE && spindle_laser_enabled() && READ(SPINDLE_DIR_PIN) != dir_state) - set_spindle_laser_enabled(false); - WRITE(SPINDLE_DIR_PIN, dir_state); - } - -#endif - void GcodeSuite::M3_M4(const bool is_M4) { - planner.synchronize(); // wait until previous movement commands (G0/G0/G2/G3) have completed before playing with the spindle + planner.synchronize(); // Wait for previous movement commands (G0/G0/G2/G3) to complete before changing power - #if SPINDLE_DIR_CHANGE - set_spindle_direction(is_M4); - #endif + cutter.set_direction(is_M4); - /** - * Our final value for ocr_val is an unsigned 8 bit value between 0 and 255 which usually means uint8_t. - * Went to uint16_t because some of the uint8_t calculations would sometimes give 1000 0000 rather than 1111 1111. - * Then needed to AND the uint16_t result with 0x00FF to make sure we only wrote the byte of interest. - */ #if ENABLED(SPINDLE_LASER_PWM) - if (parser.seen('O')) { - spindle_laser_power = parser.value_byte(); - set_spindle_laser_ocr(spindle_laser_power); - } - else { - spindle_laser_power = parser.intval('S', 255); - update_spindle_laser_power(); - } + if (parser.seen('O')) + cutter.set_ocr_power(parser.value_byte()); // The OCR is a value from 0 to 255 (uint8_t) + else + cutter.set_power(parser.intval('S', 255)); #else - set_spindle_laser_enabled(true); + cutter.set_enabled(true); #endif } /** - * M5 turn off spindle + * M5 - Cutter OFF */ void GcodeSuite::M5() { planner.synchronize(); - set_spindle_laser_enabled(false); + cutter.set_enabled(false); } -#endif // SPINDLE_LASER_ENABLE +#endif // HAS_CUTTER diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 98091f78fd1836d035ae1bdaf875ecee81043d19..4b4bc70a2362dfaae12535a81ab83ff9e2ee1840 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -322,7 +322,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 1: M0_M1(); break; // M1: Conditional stop - Wait for user button press on LCD #endif - #if ENABLED(SPINDLE_LASER_ENABLE) + #if HAS_CUTTER case 3: M3_M4(false); break; // M3: Turn ON Laser | Spindle (clockwise), set Power | Speed case 4: M3_M4(true ); break; // M4: Turn ON Laser | Spindle (counter-clockwise), set Power | Speed case 5: M5(); break; // M5: Turn OFF Laser | Spindle diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index d5656c7a4356827b7b2395182ff995a703276c6f..8878cf9abf9d21f94c56e133b142ce28d8e57dcc 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -75,9 +75,9 @@ * * M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) * M1 -> M0 - * M3 - Turn ON Laser | Spindle (clockwise), set Power | Speed. (Requires SPINDLE_LASER_ENABLE) - * M4 - Turn ON Laser | Spindle (counter-clockwise), set Power | Speed. (Requires SPINDLE_LASER_ENABLE) - * M5 - Turn OFF Laser | Spindle. (Requires SPINDLE_LASER_ENABLE) + * M3 - Turn ON Laser | Spindle (clockwise), set Power | Speed. (Requires SPINDLE_FEATURE or LASER_FEATURE) + * M4 - Turn ON Laser | Spindle (counter-clockwise), set Power | Speed. (Requires SPINDLE_FEATURE or LASER_FEATURE) + * M5 - Turn OFF Laser | Spindle. (Requires SPINDLE_FEATURE or LASER_FEATURE) * M7 - Turn mist coolant ON. (Requires COOLANT_CONTROL) * M8 - Turn flood coolant ON. (Requires COOLANT_CONTROL) * M9 - Turn coolant OFF. (Requires COOLANT_CONTROL) @@ -453,7 +453,7 @@ private: static void M0_M1(); #endif - #if ENABLED(SPINDLE_LASER_ENABLE) + #if HAS_CUTTER static void M3_M4(const bool is_M4); static void M5(); #endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 0e2295cbaac12945a5f0534ac7e10b6453fd6bdb..f4b0c3fb10ce393aa24f93a1dedb1535bcb5440e 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -26,6 +26,8 @@ * Defines that depend on advanced configuration. */ +#define HAS_CUTTER EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #if !defined(__AVR__) || !defined(USBCON) // Define constants and variables for buffering serial data. // Use only 0 or powers of 2 greater than 1 diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 83d081d932267041bf98c87e24f52a5d47d454d4..06f51920f533d206b04d685d2a354438c60beb4a 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1692,7 +1692,7 @@ #endif #endif -// needs to be here so that we catch the above changes to our defines +// Defined here to catch the above defines #if ENABLED(SDCARD_SORT_ALPHA) #define HAS_FOLDER_SORTING (FOLDER_SORTING || ENABLED(SDSORT_GCODE)) #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index a0a416e3e251594475dae647ffd1b5606a688e02..37174c9b71d63acf4701a1770246027f7964863f 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -348,8 +348,16 @@ #error "MAX6675_SS is now MAX6675_SS_PIN. Please update your configuration and/or pins." #elif defined(MAX6675_SS2) #error "MAX6675_SS2 is now MAX6675_SS2_PIN. Please update your configuration and/or pins." +#elif defined(SPINDLE_LASER_ENABLE) + #error "SPINDLE_LASER_ENABLE is now SPINDLE_FEATURE or LASER_FEATURE. Please update your Configuration_adv.h." #elif defined(SPINDLE_LASER_ENABLE_PIN) - #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN. Please update your configuration and/or pins." + #error "SPINDLE_LASER_ENABLE_PIN is now SPINDLE_LASER_ENA_PIN. Please update your Configuration_adv.h and/or pins." +#elif defined(SPINDLE_DIR_CHANGE) + #error "SPINDLE_DIR_CHANGE is now SPINDLE_CHANGE_DIR. Please update your Configuration_adv.h." +#elif defined(SPINDLE_STOP_ON_DIR_CHANGE) + #error "SPINDLE_STOP_ON_DIR_CHANGE is now SPINDLE_CHANGE_DIR_STOP. Please update your Configuration_adv.h." +#elif defined(SPINDLE_LASER_ENABLE_INVERT) + #error "SPINDLE_LASER_ENABLE_INVERT is now SPINDLE_LASER_ACTIVE_HIGH. Please update your Configuration_adv.h." #elif defined(CHAMBER_HEATER_PIN) #error "CHAMBER_HEATER_PIN is now HEATER_CHAMBER_PIN. Please update your configuration and/or pins." #elif defined(TMC_Z_CALIBRATION) @@ -2284,3 +2292,63 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #error "MIN_ and MAX_SOFTWARE_ENDSTOPS are both required with offset hotends." #endif #endif + +#if HAS_CUTTER + #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." + #elif !PIN_EXISTS(SPINDLE_LASER_ENA) + #error "(SPINDLE|LASER)_FEATURE requires SPINDLE_LASER_ENA_PIN." + #elif ENABLED(SPINDLE_CHANGE_DIR) && !PIN_EXISTS(SPINDLE_DIR) + #error "SPINDLE_DIR_PIN is required for SPINDLE_CHANGE_DIR." + #elif ENABLED(SPINDLE_LASER_PWM) + #if !defined(SPINDLE_LASER_PWM_PIN) || SPINDLE_LASER_PWM_PIN < 0 + #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) + #error "SPINDLE_LASER_PWM equation constant(s) missing." + #elif _PIN_CONFLICT(X_MIN) + #error "SPINDLE_LASER_PWM pin conflicts with X_MIN_PIN." + #elif _PIN_CONFLICT(X_MAX) + #error "SPINDLE_LASER_PWM pin conflicts with X_MAX_PIN." + #elif _PIN_CONFLICT(Z_STEP) + #error "SPINDLE_LASER_PWM pin conflicts with Z_STEP_PIN." + #elif _PIN_CONFLICT(CASE_LIGHT) + #error "SPINDLE_LASER_PWM_PIN conflicts with CASE_LIGHT_PIN." + #elif _PIN_CONFLICT(E0_AUTO_FAN) + #error "SPINDLE_LASER_PWM_PIN conflicts with E0_AUTO_FAN_PIN." + #elif _PIN_CONFLICT(E1_AUTO_FAN) + #error "SPINDLE_LASER_PWM_PIN conflicts with E1_AUTO_FAN_PIN." + #elif _PIN_CONFLICT(E2_AUTO_FAN) + #error "SPINDLE_LASER_PWM_PIN conflicts with E2_AUTO_FAN_PIN." + #elif _PIN_CONFLICT(E3_AUTO_FAN) + #error "SPINDLE_LASER_PWM_PIN conflicts with E3_AUTO_FAN_PIN." + #elif _PIN_CONFLICT(E4_AUTO_FAN) + #error "SPINDLE_LASER_PWM_PIN conflicts with E4_AUTO_FAN_PIN." + #elif _PIN_CONFLICT(E5_AUTO_FAN) + #error "SPINDLE_LASER_PWM_PIN conflicts with E5_AUTO_FAN_PIN." + #elif _PIN_CONFLICT(FAN) + #error "SPINDLE_LASER_PWM_PIN conflicts with FAN_PIN." + #elif _PIN_CONFLICT(FAN1) + #error "SPINDLE_LASER_PWM_PIN conflicts with FAN1_PIN." + #elif _PIN_CONFLICT(FAN2) + #error "SPINDLE_LASER_PWM_PIN conflicts with FAN2_PIN." + #elif _PIN_CONFLICT(CONTROLLERFAN) + #error "SPINDLE_LASER_PWM_PIN conflicts with CONTROLLERFAN_PIN." + #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_XY) + #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_XY." + #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_Z) + #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_Z." + #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_E) + #error "SPINDLE_LASER_PWM_PIN conflicts with MOTOR_CURRENT_PWM_E." + #endif + #endif + #undef _PIN_CONFLICT +#endif diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 2fee46b2fefbba3666bdee6bca7e4fc03f53341b..dcb96e6d76b6fdeaaa022704f615dd143a4040e4 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -190,6 +190,18 @@ #ifndef MSG_LASER_POWER #define MSG_LASER_POWER _UxGT("Laser power") #endif +#ifndef MSG_SPINDLE_MENU + #define MSG_SPINDLE_MENU _UxGT("Spindle Control") +#endif +#ifndef MSG_SPINDLE_OFF + #define MSG_SPINDLE_OFF _UxGT("Spindle Off") +#endif +#ifndef MSG_SPINDLE_ON + #define MSG_SPINDLE_ON _UxGT("Spindle On") +#endif +#ifndef MSG_SPINDLE_POWER + #define MSG_SPINDLE_POWER _UxGT("Spindle power") +#endif #ifndef MSG_SPINDLE_REVERSE #define MSG_SPINDLE_REVERSE _UxGT("Spindle Reverse") #endif diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index f13b370d29701de5c21bd355b4c40ad214f980df..16dfd22a436260f176ce273f4e716e3ed52e4507 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -162,7 +162,8 @@ DEFINE_MENU_EDIT_ITEM(int4); // 1234, -123 right-justified DEFINE_MENU_EDIT_ITEM(int8); // 123, -12 right-justified DEFINE_MENU_EDIT_ITEM(uint8); // 123 right-justified DEFINE_MENU_EDIT_ITEM(uint16_3); // 123, -12 right-justified -DEFINE_MENU_EDIT_ITEM(uint16_4); // 1234, -123 right-justified +DEFINE_MENU_EDIT_ITEM(uint16_4); // 1234 right-justified +DEFINE_MENU_EDIT_ITEM(uint16_5); // 12345 right-justified DEFINE_MENU_EDIT_ITEM(float3); // 123 right-justified DEFINE_MENU_EDIT_ITEM(float52); // 123.45 DEFINE_MENU_EDIT_ITEM(float43); // 1.234 diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 8135d2a97395602c6d873805620a38389f984c8d..fb1e45474b737964b6665266d1972aaa5564fddc 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -51,8 +51,9 @@ DECLARE_MENU_EDIT_TYPE(int16_t, int3, i16tostr3, 1 ); // 123 DECLARE_MENU_EDIT_TYPE(int16_t, int4, i16tostr4sign, 1 ); // 1234, -123 right-justified DECLARE_MENU_EDIT_TYPE(int8_t, int8, i8tostr3, 1 ); // 123, -12 right-justified DECLARE_MENU_EDIT_TYPE(uint8_t, uint8, ui8tostr3, 1 ); // 123 right-justified -DECLARE_MENU_EDIT_TYPE(uint16_t, uint16_3, ui16tostr3, 1 ); // 123, -12 right-justified -DECLARE_MENU_EDIT_TYPE(uint16_t, uint16_4, ui16tostr4, 0.1 ); // 1234, -123 right-justified +DECLARE_MENU_EDIT_TYPE(uint16_t, uint16_3, ui16tostr3, 1 ); // 123 right-justified +DECLARE_MENU_EDIT_TYPE(uint16_t, uint16_4, ui16tostr4, 0.1 ); // 1234 right-justified +DECLARE_MENU_EDIT_TYPE(uint16_t, uint16_5, ui16tostr5, 0.01 ); // 12345 right-justified DECLARE_MENU_EDIT_TYPE(float, float3, ftostr3, 1 ); // 123 right-justified DECLARE_MENU_EDIT_TYPE(float, float52, ftostr42_52, 100 ); // _2.34, 12.34, -2.34 or 123.45, -23.45 DECLARE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000 ); // 1.234 @@ -121,8 +122,9 @@ DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int3); // 123, -12 right-justif DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int4); // 1234, -123 right-justified DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int8); // 123, -12 right-justified DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint8); // 123 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint16_3); // 123, -12 right-justified -DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint16_4); // 1234, -123 right-justified +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint16_3); // 123 right-justified +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint16_4); // 1234 right-justified +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint16_5); // 12345 right-justified DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float3); // 123 right-justified DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float52); // _2.34, 12.34, -2.34 or 123.45, -23.45 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float43); // 1.234 @@ -206,6 +208,7 @@ DECLARE_MENU_EDIT_ITEM(int8); DECLARE_MENU_EDIT_ITEM(uint8); DECLARE_MENU_EDIT_ITEM(uint16_3); DECLARE_MENU_EDIT_ITEM(uint16_4); +DECLARE_MENU_EDIT_ITEM(uint16_5); DECLARE_MENU_EDIT_ITEM(float3); DECLARE_MENU_EDIT_ITEM(float52); DECLARE_MENU_EDIT_ITEM(float43); diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index b1887a9bb61007e3d41477556a013e4144b70bc8..0d338f148c0f172269f6ac74100e08ee6cf12468 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -74,6 +74,11 @@ void menu_configuration(); void menu_led(); #endif +#if HAS_CUTTER + #include "../../feature/spindle_laser.h" + void menu_spindle_laser(); +#endif + #if ENABLED(MIXING_EXTRUDER) void menu_mixer(); #endif @@ -153,6 +158,10 @@ void menu_main() { MENU_ITEM(submenu, MSG_MOTION, menu_motion); } + #if HAS_CUTTER + MENU_ITEM(submenu, MSG_CUTTER(MENU), menu_spindle_laser); + #endif + MENU_ITEM(submenu, MSG_TEMPERATURE, menu_temperature); #if ENABLED(MIXING_EXTRUDER) diff --git a/Marlin/src/lcd/menu/menu_spindle_laser.cpp b/Marlin/src/lcd/menu/menu_spindle_laser.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d26be6f1edd390b59f13cf1cb6d68512153d4aa3 --- /dev/null +++ b/Marlin/src/lcd/menu/menu_spindle_laser.cpp @@ -0,0 +1,54 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +// +// Spindle / Laser Menu +// + +#include "../../inc/MarlinConfig.h" + +#if HAS_CUTTER + + #include "menu.h" + + #include "../../feature/spindle_laser.h" + + void menu_spindle_laser() { + + START_MENU(); + MENU_BACK(MSG_MAIN); + if (cutter.enabled()) { + #if ENABLED(SPINDLE_LASER_PWM) + MENU_ITEM_EDIT_CALLBACK(CUTTER_MENU_TYPE, MSG_CUTTER(POWER), &cutter.power, SPEED_POWER_MIN, SPEED_POWER_MAX, cutter.update_output); + #endif + MENU_ITEM(function, MSG_CUTTER(OFF), cutter.disable); + } + else { + MENU_ITEM(function, MSG_CUTTER(ON), cutter.enable_forward); + #if ENABLED(SPINDLE_CHANGE_DIR) + MENU_ITEM(function, MSG_SPINDLE_REVERSE, cutter.enable_reverse); + #endif + } + END_MENU(); + } + +#endif // HAS_CUTTER diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index dd6bd233a9dbd6ddf83d3725c14d94e94199fbb1..c84e56435c237eddce243f7692f2b41f6ce3604c 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -303,48 +303,6 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb #endif // HAS_TEMP_HOTEND || HAS_HEATED_BED -#if ENABLED(SPINDLE_LASER_ENABLE) - - extern uint8_t spindle_laser_power; - bool spindle_laser_enabled(); - void set_spindle_laser_enabled(const bool enabled); - #if ENABLED(SPINDLE_LASER_PWM) - void update_spindle_laser_power(); - #endif - - inline void _lcd_spindle_laser_off() { set_spindle_laser_enabled(false); } - void set_spindle_direction(bool); - inline void _lcd_spindle_laser_on(const bool is_M4) { - #if SPINDLE_DIR_CHANGE - set_spindle_direction(is_M4); - #endif - set_spindle_laser_enabled(true); - } - inline void _lcd_spindle_laser_on() { _lcd_spindle_laser_on(false); } - #if SPINDLE_DIR_CHANGE - inline void _lcd_spindle_on_reverse() { _lcd_spindle_laser_on(true); } - #endif - - void menu_spindle_laser() { - START_MENU(); - MENU_BACK(MSG_MAIN); - if (spindle_laser_enabled()) { - #if ENABLED(SPINDLE_LASER_PWM) - MENU_ITEM_EDIT_CALLBACK(uint8, MSG_LASER_POWER, &spindle_laser_power, SPEED_POWER_MIN, SPEED_POWER_MAX, update_spindle_laser_power); - #endif - MENU_ITEM(function, MSG_LASER_OFF, _lcd_spindle_laser_off); - } - else { - MENU_ITEM(function, MSG_LASER_ON, _lcd_spindle_laser_on); - #if SPINDLE_DIR_CHANGE - MENU_ITEM(function, MSG_SPINDLE_REVERSE, _lcd_spindle_on_reverse); - #endif - } - END_MENU(); - } - -#endif // SPINDLE_LASER_ENABLE - void menu_temperature() { START_MENU(); MENU_BACK(MSG_MAIN); @@ -415,10 +373,6 @@ void menu_temperature() { #endif #endif // FAN_COUNT > 0 - #if ENABLED(SPINDLE_LASER_ENABLE) - MENU_ITEM(submenu, MSG_LASER_MENU, menu_spindle_laser); - #endif - #if HAS_TEMP_HOTEND // diff --git a/Marlin/src/libs/numtostr.cpp b/Marlin/src/libs/numtostr.cpp index 09ebf64d2fd01dc0b4dfceec2d2b0aed6946bab3..78f7370fbf19559b9006c53d70b9ad3a31c6f699 100644 --- a/Marlin/src/libs/numtostr.cpp +++ b/Marlin/src/libs/numtostr.cpp @@ -57,12 +57,14 @@ char* i8tostr3(const int8_t x) { return &conv[4]; } -// Convert unsigned 16bit int to string 123 format -char* ui16tostr3(const uint16_t xx) { +// Convert unsigned 16bit int to string 12345 format +char* ui16tostr5(const uint16_t xx) { + conv[2] = RJDIGIT(xx, 10000); + conv[3] = RJDIGIT(xx, 1000); conv[4] = RJDIGIT(xx, 100); conv[5] = RJDIGIT(xx, 10); conv[6] = DIGIMOD(xx, 1); - return &conv[4]; + return &conv[2]; } // Convert unsigned 16bit int to string 1234 format @@ -74,6 +76,14 @@ char* ui16tostr4(const uint16_t xx) { return &conv[3]; } +// Convert unsigned 16bit int to string 123 format +char* ui16tostr3(const uint16_t xx) { + conv[4] = RJDIGIT(xx, 100); + conv[5] = RJDIGIT(xx, 10); + conv[6] = DIGIMOD(xx, 1); + return &conv[4]; +} + // Convert signed 16bit int to rj string with 123 or -12 format char* i16tostr3(const int16_t x) { int xx = x; @@ -215,12 +225,7 @@ char* ftostr54sign(const float &f, char plus/*=' '*/) { // Convert unsigned float to rj string with 12345 format char* ftostr5rj(const float &f) { const long i = ((f < 0 ? -f : f) * 10 + 5) / 10; - conv[2] = RJDIGIT(i, 10000); - conv[3] = RJDIGIT(i, 1000); - conv[4] = RJDIGIT(i, 100); - conv[5] = RJDIGIT(i, 10); - conv[6] = DIGIMOD(i, 1); - return &conv[2]; + return ui16tostr5(i); } // Convert signed float to string with +1234.5 format diff --git a/Marlin/src/libs/numtostr.h b/Marlin/src/libs/numtostr.h index a0da4804ed5dd6b965fb039b17bd0b51211d7ec5..91f88b9843299fa7e5e5bb6f3fe7228d3d876bec 100644 --- a/Marlin/src/libs/numtostr.h +++ b/Marlin/src/libs/numtostr.h @@ -32,12 +32,15 @@ char* ui8tostr3(const uint8_t i); // Convert int8_t to string with 123 format char* i8tostr3(const int8_t x); -// Convert uint16_t to string with 123 format -char* ui16tostr3(const uint16_t x); +// Convert uint16_t to string with 12345 format +char* ui16tostr5(const uint16_t x); // Convert uint16_t to string with 1234 format char* ui16tostr4(const uint16_t x); +// Convert uint16_t to string with 123 format +char* ui16tostr3(const uint16_t x); + // Convert int16_t to string with 123 format char* i16tostr3(const int16_t x); diff --git a/Marlin/src/pins/pins_3DRAG.h b/Marlin/src/pins/pins_3DRAG.h index f82269b70dd15c88615c1cbee48c37a1938075a3..361ef107dddb4e6d465a5de8f40105ace5d99d2f 100644 --- a/Marlin/src/pins/pins_3DRAG.h +++ b/Marlin/src/pins/pins_3DRAG.h @@ -140,7 +140,7 @@ #undef SPINDLE_LASER_ENA_PIN #undef SPINDLE_DIR_PIN -#if ENABLED(SPINDLE_LASER_ENABLE) +#if HAS_CUTTER #if !EXTRUDERS #undef E0_DIR_PIN #undef E0_ENABLE_PIN diff --git a/Marlin/src/pins/pins_AZTEEG_X3.h b/Marlin/src/pins/pins_AZTEEG_X3.h index e7076cba9bae6555f36137b11afe09754f3521c8..15029fc30466833f56dac717fd4f572bd01a430e 100644 --- a/Marlin/src/pins/pins_AZTEEG_X3.h +++ b/Marlin/src/pins/pins_AZTEEG_X3.h @@ -84,7 +84,7 @@ #undef SPINDLE_LASER_ENA_PIN #undef SPINDLE_DIR_PIN -#if ENABLED(SPINDLE_LASER_ENABLE) +#if HAS_CUTTER #undef SDA // use EXP3 header #undef SCL #if SERVO0_PIN == 7 diff --git a/Marlin/src/pins/pins_AZTEEG_X3_PRO.h b/Marlin/src/pins/pins_AZTEEG_X3_PRO.h index bae70258e96f15f73a7a77cb648273dc1ee4849e..e34ce4b3ecefd1c0e6e59d80d707db8fd576440f 100644 --- a/Marlin/src/pins/pins_AZTEEG_X3_PRO.h +++ b/Marlin/src/pins/pins_AZTEEG_X3_PRO.h @@ -157,7 +157,7 @@ #undef SPINDLE_LASER_ENA_PIN #undef SPINDLE_DIR_PIN -#if ENABLED(SPINDLE_LASER_ENABLE) // EXP2 header +#if HAS_CUTTER // EXP2 header #if ANY(VIKI2, miniVIKI) #undef BTN_EN2 #define BTN_EN2 31 // need 7 for the spindle speed PWM diff --git a/Marlin/src/pins/pins_COHESION3D_MINI.h b/Marlin/src/pins/pins_COHESION3D_MINI.h index 2076a5aeb2a5d4bca09bfdbf8fa2bc4ec6037e8c..b4aa2397d0556b07d7156e79ed433108cfd185e3 100644 --- a/Marlin/src/pins/pins_COHESION3D_MINI.h +++ b/Marlin/src/pins/pins_COHESION3D_MINI.h @@ -116,7 +116,7 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if ENABLED(SPINDLE_LASER_ENABLE) +#if HAS_CUTTER #undef HEATER_0_PIN #define SPINDLE_LASER_ENA_PIN P2_07 // FET 1 #undef HEATER_BED_PIN diff --git a/Marlin/src/pins/pins_COHESION3D_REMIX.h b/Marlin/src/pins/pins_COHESION3D_REMIX.h index e97742746d557009fc550f06ab75e54d1cd6e1b3..feb270b6406ca054b07c958dbd2ef0f870f11e5e 100644 --- a/Marlin/src/pins/pins_COHESION3D_REMIX.h +++ b/Marlin/src/pins/pins_COHESION3D_REMIX.h @@ -137,7 +137,7 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if ENABLED(SPINDLE_LASER_ENABLE) +#if HAS_CUTTER #undef HEATER_0_PIN #undef HEATER_BED_PIN #undef FAN_PIN diff --git a/Marlin/src/pins/pins_FORMBOT_RAPTOR2.h b/Marlin/src/pins/pins_FORMBOT_RAPTOR2.h index 733308f9736a8483989b18d860e22282f472df98..278f83422017be77da35f97431ca2c165010776e 100644 --- a/Marlin/src/pins/pins_FORMBOT_RAPTOR2.h +++ b/Marlin/src/pins/pins_FORMBOT_RAPTOR2.h @@ -40,7 +40,7 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENA) +#if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) #if !NUM_SERVOS // Try to use servo connector first #define SPINDLE_LASER_ENA_PIN 6 // Pin should have a pullup/pulldown! #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM diff --git a/Marlin/src/pins/pins_MINITRONICS.h b/Marlin/src/pins/pins_MINITRONICS.h index f54a4f85f3fcac9c92d66a8cfa3447c87ec3dbd9..cac17779a46d7ec2fd025e361f4cd00b27bd2863 100644 --- a/Marlin/src/pins/pins_MINITRONICS.h +++ b/Marlin/src/pins/pins_MINITRONICS.h @@ -130,7 +130,7 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if ENABLED(SPINDLE_LASER_ENABLE) // assumes we're only doing CNC work (no 3D printing) +#if HAS_CUTTER // assumes we're only doing CNC work (no 3D printing) #undef HEATER_BED_PIN #undef TEMP_BED_PIN // need to free up some pins but also need to #undef TEMP_0_PIN // re-assign them (to unused pins) because Marlin diff --git a/Marlin/src/pins/pins_RAMPS.h b/Marlin/src/pins/pins_RAMPS.h index 9bee431fedfb502ecf64c89fc076f6bcfbd30886..9e0d7f89c1c9ff798b87284bf37852a7f12c117a 100644 --- a/Marlin/src/pins/pins_RAMPS.h +++ b/Marlin/src/pins/pins_RAMPS.h @@ -255,17 +255,17 @@ #if ENABLED(CASE_LIGHT_ENABLE) && !defined(CASE_LIGHT_PIN) && !defined(SPINDLE_LASER_ENA_PIN) #if NUM_SERVOS <= 1 // try to use servo connector first - #define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM + #define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM #elif AUX2_PINS_FREE - #define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM + #define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM #endif #endif // // M3/M4/M5 - Spindle/Laser Control // -#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENA) - #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first +#if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN) + #if !NUM_SERVOS // Use servo connector if possible #define SPINDLE_LASER_ENA_PIN 4 // Pin should have a pullup/pulldown! #define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM #define SPINDLE_DIR_PIN 5 @@ -273,6 +273,8 @@ #define SPINDLE_LASER_ENA_PIN 40 // Pin should have a pullup/pulldown! #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM #define SPINDLE_DIR_PIN 65 + #else + #error "No auto-assignable Spindle/Laser pins available." #endif #endif diff --git a/Marlin/src/pins/pins_RAMPS_FD_V1.h b/Marlin/src/pins/pins_RAMPS_FD_V1.h index 875c2e76b9f9bbc1606cd97f17f7e33f7eac6d39..633da90c34f1f2dac5b064ee92cefabf3642f33d 100644 --- a/Marlin/src/pins/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/pins_RAMPS_FD_V1.h @@ -227,7 +227,7 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if HOTENDS < 3 && ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENA) +#if HOTENDS < 3 && HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) #define SPINDLE_LASER_ENA_PIN 45 // Use E2 ENA #define SPINDLE_LASER_PWM_PIN 12 // MUST BE HARDWARE PWM #define SPINDLE_DIR_PIN 47 // Use E2 DIR diff --git a/Marlin/src/pins/pins_RAMPS_LINUX.h b/Marlin/src/pins/pins_RAMPS_LINUX.h index ff99ed7bedef1085f69e02fd6c162c7756c91f7c..e22a3ba01ffeed5e677ac406bbfc12fecb96f5d6 100644 --- a/Marlin/src/pins/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/pins_RAMPS_LINUX.h @@ -228,7 +228,7 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENA) +#if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first #define SPINDLE_LASER_ENA_PIN 4 // Pin should have a pullup/pulldown! #define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM diff --git a/Marlin/src/pins/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/pins_RAMPS_RE_ARM.h index 3cb5376890a050fea4fd4a671e5e61e0cfb5a8a5..5e4ad77febdd78162f12ed0f114b5031c46cbb36 100644 --- a/Marlin/src/pins/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/pins_RAMPS_RE_ARM.h @@ -239,9 +239,13 @@ // M3/M4/M5 - Spindle/Laser Control // Use servo pins, if available // -#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENA) +#if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) #if NUM_SERVOS > 1 - #error "SPINDLE_LASER_ENABLE requires 3 free servo pins." + #if ENABLED(SPINDLE_FEATURE) + #error "SPINDLE_FEATURE requires 3 free servo pins." + #else + #error "LASER_FEATURE requires 3 free servo pins." + #endif #endif #define SPINDLE_LASER_ENA_PIN SERVO1_PIN // (6) Pin should have a pullup/pulldown! #define SPINDLE_LASER_PWM_PIN SERVO3_PIN // (4) MUST BE HARDWARE PWM diff --git a/Marlin/src/pins/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/pins_SANGUINOLOLU_11.h index 15cfad896b5158977aa019a488e92e47418ad290..7b20300877bb6e4042df847bc9ddce42f337966c 100644 --- a/Marlin/src/pins/pins_SANGUINOLOLU_11.h +++ b/Marlin/src/pins/pins_SANGUINOLOLU_11.h @@ -137,7 +137,7 @@ #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED #endif -#if DISABLED(SPINDLE_LASER_ENABLE) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(ULTRA_LCD, NEWPANEL) // try to use IO Header +#if NONE(SPINDLE_FEATURE, LASER_FEATURE) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(ULTRA_LCD, NEWPANEL) // try to use IO Header #define CASE_LIGHT_PIN 4 // MUST BE HARDWARE PWM - see if IO Header is available #endif @@ -276,7 +276,7 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if ENABLED(SPINDLE_LASER_ENABLE) +#if HAS_CUTTER #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(ULTRA_LCD, NEWPANEL) // try to use IO Header #define SPINDLE_LASER_ENA_PIN 10 // Pin should have a pullup/pulldown! @@ -322,4 +322,4 @@ #define SPINDLE_LASER_ENA_PIN 21 // Pin should have a pullup! #define SPINDLE_DIR_PIN -1 // No pin available on the socket for the direction pin #endif -#endif // SPINDLE_LASER_ENABLE +#endif diff --git a/Marlin/src/pins/pins_STM3R_MINI.h b/Marlin/src/pins/pins_STM3R_MINI.h index 2088ea7a480587c9a5635ef7d00fbd74dacf4f6d..63eda1252fb50b0ea511ec63f87c6addb67aae97 100644 --- a/Marlin/src/pins/pins_STM3R_MINI.h +++ b/Marlin/src/pins/pins_STM3R_MINI.h @@ -106,7 +106,7 @@ #define TEMP_2_PIN PA3 // Laser control -#if ENABLED(SPINDLE_LASER_ENABLE) +#if HAS_CUTTER #define SPINDLE_LASER_PWM_PIN PB8 #define SPINDLE_LASER_ENA_PIN PD5 #endif diff --git a/Marlin/src/pins/pins_ULTIMAIN_2.h b/Marlin/src/pins/pins_ULTIMAIN_2.h index 821494d129ec49102db7e09355369b70965ad815..ac4d1c24a2844f6b71d21f7c39f55dbd5e8c97f2 100644 --- a/Marlin/src/pins/pins_ULTIMAIN_2.h +++ b/Marlin/src/pins/pins_ULTIMAIN_2.h @@ -128,7 +128,7 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if ENABLED(SPINDLE_LASER_ENABLE) // use the LED_PIN for spindle speed control or case light +#if HAS_CUTTER // use the LED_PIN for spindle speed control or case light #undef LED_PIN #define SPINDLE_DIR_PIN 16 #define SPINDLE_LASER_ENA_PIN 17 // Pin should have a pullup! diff --git a/Marlin/src/pins/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/pins_ULTIMAKER_OLD.h index 2ea264d881a1a83e893ef85073b3200224a8fd98..4064d90134f8bc12b76faa2bba6b8b07adc1f09c 100644 --- a/Marlin/src/pins/pins_ULTIMAKER_OLD.h +++ b/Marlin/src/pins/pins_ULTIMAKER_OLD.h @@ -80,7 +80,7 @@ #endif #if ENABLED(BOARD_REV_1_0) - #if ENABLED(SPINDLE_LASER_ENABLE) + #if HAS_CUTTER #define X_STOP_PIN 13 // SW1 (didn't change) - also has a useable hardware PWM #define Y_STOP_PIN 12 // SW2 #define Z_STOP_PIN 11 // SW3 @@ -106,7 +106,7 @@ // // Z Probe (when not Z_MIN_PIN) // -#if !defined(Z_MIN_PROBE_PIN) && !BOTH(SPINDLE_LASER_ENABLE, BOARD_REV_1_0) +#if !defined(Z_MIN_PROBE_PIN) && !(HAS_CUTTER && ENABLED(BOARD_REV_1_0)) #define Z_MIN_PROBE_PIN Z_MAX_PIN #endif @@ -125,7 +125,7 @@ #define Z_DIR_PIN 39 #define Z_ENABLE_PIN 35 -#if BOTH(SPINDLE_LASER_ENABLE, BOARD_REV_1_1_TO_1_3) && EXTRUDERS == 1 +#if HAS_CUTTER && ENABLED(BOARD_REV_1_1_TO_1_3) && EXTRUDERS == 1 // Move E0 to the spare and get Spindle/Laser signals from E0 #define E0_STEP_PIN 49 #define E0_DIR_PIN 47 @@ -214,7 +214,7 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if ENABLED(SPINDLE_LASER_ENABLE) +#if HAS_CUTTER #if EITHER(BOARD_REV_1_0, BOARD_REV_1_5) // Use the last three SW positions #define SPINDLE_DIR_PIN 10 // 1.0: SW4 1.5: EXP3-6 ("10") #define SPINDLE_LASER_PWM_PIN 9 // 1.0: SW5 1.5: EXP3-7 ( "9") .. MUST BE HARDWARE PWM diff --git a/Marlin/src/pins/pins_Z_BOLT_X_SERIES.h b/Marlin/src/pins/pins_Z_BOLT_X_SERIES.h index b8d4fdee38c7b7e67487e059a1c3036fee8d6b77..19114700183253a5f4fe0f44383049f575c88cb0 100644 --- a/Marlin/src/pins/pins_Z_BOLT_X_SERIES.h +++ b/Marlin/src/pins/pins_Z_BOLT_X_SERIES.h @@ -177,7 +177,7 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENA) +#if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) #if !defined(NUM_SERVOS) || NUM_SERVOS == 0 // try to use servo connector first #define SPINDLE_LASER_ENA_PIN 4 // Pin should have a pullup/pulldown! #define SPINDLE_LASER_PWM_PIN 6 // MUST BE HARDWARE PWM diff --git a/buildroot/share/tests/megaatmega2560-tests b/buildroot/share/tests/megaatmega2560-tests index 49b077e31c11303deea69e67d9f783de4de5c5f5..119438af09b85a4cad260fe9e5ddae3e851f68da 100755 --- a/buildroot/share/tests/megaatmega2560-tests +++ b/buildroot/share/tests/megaatmega2560-tests @@ -58,7 +58,7 @@ opt_set TEMP_SENSOR_3 20 opt_set TEMP_SENSOR_4 1000 opt_set TEMP_SENSOR_BED 1 opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_EDITING ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION \ - EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT GCODE_MACROS SPINDLE_LASER_ENABLE \ + EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT GCODE_MACROS \ USB_FLASH_DRIVE_SUPPORT SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES LIGHTWEIGHT_UI \ CUSTOM_USER_MENUS I2C_POSITION_ENCODERS BABYSTEPPING BABYSTEP_XY LIN_ADVANCE NANODLP_Z_SYNC QUICK_HOME JUNCTION_DEVIATION MULTI_NOZZLE_DUPLICATION exec_test $1 $2 "Azteeg X3 with 5 extruders, RRDFGSC, probeless UBL, Linear Advance, and more" @@ -87,8 +87,8 @@ exec_test $1 $2 "RAMPS with ZONESTAR_LCD, Servo Probe, 3-Point ABL, DEBUG_LEVELI # Test MESH_BED_LEVELING feature, with LCD # restore_configs -opt_enable MESH_BED_LEVELING G26_MESH_EDITING MESH_G28_REST_ORIGIN LCD_BED_LEVELING MESH_EDIT_MENU ULTIMAKERCONTROLLER -exec_test $1 $2 "MESH_BED_LEVELING feature, with LCD" +opt_enable SPINDLE_FEATURE MESH_BED_LEVELING G26_MESH_EDITING MESH_G28_REST_ORIGIN LCD_BED_LEVELING MESH_EDIT_MENU ULTIMAKERCONTROLLER +exec_test $1 $2 "Spindle, MESH_BED_LEVELING, and LCD" # # Test MINIRAMBO with PWM_MOTOR_CURRENT and many features diff --git a/config/default/Configuration_adv.h b/config/default/Configuration_adv.h index 3dd9a673fe35f2973961ecb4b4dfac8bbc0003f1..82190449a37d48ca378acd22fa7082ebf3b78304 100644 --- a/config/default/Configuration_adv.h +++ b/config/default/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h index 4134562e37285172cb2042dfd4cb4157fff4d880..cffb6842ca2027d9d1463b9b005ea0544295a553 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 5621b211a3e85e3a8fb73bdc7c56da33a13d9a83..d2db52ff132802a1e8eda4eb4095583ecffbec15 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/AliExpress/UM2pExt/Configuration_adv.h b/config/examples/AliExpress/UM2pExt/Configuration_adv.h index 8d8b300f5b3037b198fd10c0e49cc7bf787fdb9a..b7c6ea5573ac5254cdf8a9cded9b64052b33d203 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration_adv.h +++ b/config/examples/AliExpress/UM2pExt/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Anet/A2/Configuration_adv.h b/config/examples/Anet/A2/Configuration_adv.h index c988f821809bba53f84902ad090ecdfef77bc277..c0724e11c3288f45b67a67640d8a5865456b2d0e 100644 --- a/config/examples/Anet/A2/Configuration_adv.h +++ b/config/examples/Anet/A2/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Anet/A2plus/Configuration_adv.h b/config/examples/Anet/A2plus/Configuration_adv.h index c988f821809bba53f84902ad090ecdfef77bc277..c0724e11c3288f45b67a67640d8a5865456b2d0e 100644 --- a/config/examples/Anet/A2plus/Configuration_adv.h +++ b/config/examples/Anet/A2plus/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Anet/A6/Configuration_adv.h b/config/examples/Anet/A6/Configuration_adv.h index ac340d3b0af13b77adda0f13232d0a47b9678f0f..ba1fdb63d83dcc5245ea284cd25d29ac26c2e3c9 100644 --- a/config/examples/Anet/A6/Configuration_adv.h +++ b/config/examples/Anet/A6/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Anet/A8/Configuration_adv.h b/config/examples/Anet/A8/Configuration_adv.h index 56481693a949419e3f5a62bef37c6b7322e517da..4a9f54b4d67614ba8724fd0252f4b237adab225e 100644 --- a/config/examples/Anet/A8/Configuration_adv.h +++ b/config/examples/Anet/A8/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Anet/A8plus/Configuration_adv.h b/config/examples/Anet/A8plus/Configuration_adv.h index 095214594c577251043ff55e03c57dbf94893ba2..db7162fb50774c028c43cce513fe1a7ee6a534f3 100644 --- a/config/examples/Anet/A8plus/Configuration_adv.h +++ b/config/examples/Anet/A8plus/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Anet/E16/Configuration_adv.h b/config/examples/Anet/E16/Configuration_adv.h index ba52e4978858dfd2f45cf861296e32449d633d0b..3d23a4094907c8b3454fe8801baba614e014af42 100644 --- a/config/examples/Anet/E16/Configuration_adv.h +++ b/config/examples/Anet/E16/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/AnyCubic/i3/Configuration_adv.h b/config/examples/AnyCubic/i3/Configuration_adv.h index 7a2a4b0ebc1fd4d10a43341142317d671db0dd14..99db078094aa9fd49e3f7d15de4aefae67d4f6e3 100644 --- a/config/examples/AnyCubic/i3/Configuration_adv.h +++ b/config/examples/AnyCubic/i3/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/ArmEd/Configuration_adv.h b/config/examples/ArmEd/Configuration_adv.h index 32a374fa025512c3482e4865b2b023bfba38e17b..a12d56e22cab5587d7df6e5aa374fccfc7a9003c 100644 --- a/config/examples/ArmEd/Configuration_adv.h +++ b/config/examples/ArmEd/Configuration_adv.h @@ -2125,36 +2125,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h index b0e0f0023da315431a11cf96a67d096d773b1364..cefd204c714b0efd73e45edd3002774395b25e08 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/BIBO/TouchX/default/Configuration_adv.h b/config/examples/BIBO/TouchX/default/Configuration_adv.h index e6d8673d40dcf07719d4bea5ccc90f7c8ed707e6..26708ace498c4646de643dd9679a3f095f56722d 100644 --- a/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/BQ/Hephestos/Configuration_adv.h b/config/examples/BQ/Hephestos/Configuration_adv.h index 47e9601646d967ca46bf678f945f48e065f379f5..ad2db8e8f81c15f8acc5edee93e50a6b2a505edb 100644 --- a/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/config/examples/BQ/Hephestos/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/BQ/Hephestos_2/Configuration_adv.h b/config/examples/BQ/Hephestos_2/Configuration_adv.h index ae4c205b6303cb1e07a8f4c463bc6f0127c6ade0..75485afc073c4ecb52bb79a78308491b5168c1a6 100644 --- a/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -2129,36 +2129,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/BQ/WITBOX/Configuration_adv.h b/config/examples/BQ/WITBOX/Configuration_adv.h index 47e9601646d967ca46bf678f945f48e065f379f5..ad2db8e8f81c15f8acc5edee93e50a6b2a505edb 100644 --- a/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/config/examples/BQ/WITBOX/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Cartesio/Configuration_adv.h b/config/examples/Cartesio/Configuration_adv.h index 2a2be5cdf5648759aadacf8d83e992a24be92c7a..a981df4000fe1188749dccdc2d69f51a15fb896a 100644 --- a/config/examples/Cartesio/Configuration_adv.h +++ b/config/examples/Cartesio/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Creality/CR-10/Configuration_adv.h b/config/examples/Creality/CR-10/Configuration_adv.h index ef0bad95b619693843c4e82fb7dc0f6693bd7614..ae461d75e01785350bb06fb6a22aee5cdef96610 100644 --- a/config/examples/Creality/CR-10/Configuration_adv.h +++ b/config/examples/Creality/CR-10/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Creality/CR-10S/Configuration_adv.h b/config/examples/Creality/CR-10S/Configuration_adv.h index 916d5b2f81838cf0e5cc0237cba07fbcf506e25f..caa4f0fecee0958526be32d2cd917a9fedd0ce6b 100644 --- a/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Creality/CR-10_5S/Configuration_adv.h b/config/examples/Creality/CR-10_5S/Configuration_adv.h index efb37fcc82e857c363024a87830b52f2436b330e..b006919d7fa7de298c1b02685420ee04f32ba0a5 100644 --- a/config/examples/Creality/CR-10_5S/Configuration_adv.h +++ b/config/examples/Creality/CR-10_5S/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Creality/CR-10mini/Configuration_adv.h b/config/examples/Creality/CR-10mini/Configuration_adv.h index 194e1fb981b20ab9a08d8d64944f279061909074..d3584a08312631bd95ffd2188550d26ee2fe7892 100644 --- a/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Creality/CR-8/Configuration_adv.h b/config/examples/Creality/CR-8/Configuration_adv.h index 39166dea079906a57f4b654af40ec40089eb7bf4..b013843a8aad587478a3d90c8093039976288f0e 100644 --- a/config/examples/Creality/CR-8/Configuration_adv.h +++ b/config/examples/Creality/CR-8/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Creality/Ender-2/Configuration_adv.h b/config/examples/Creality/Ender-2/Configuration_adv.h index a99ce43310897ea6f1a0d326ddeba68b55bc1302..98e3eb41260141e1f5f94c0ff7adfa19b5fadb56 100644 --- a/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/config/examples/Creality/Ender-2/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Creality/Ender-3/Configuration_adv.h b/config/examples/Creality/Ender-3/Configuration_adv.h index bf3db48cc1767fbf309e8abe0cb4b3c6951e67cd..1f62b760bbcf2f613fb4d9f60ec96f8823c77be3 100644 --- a/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Creality/Ender-4/Configuration_adv.h b/config/examples/Creality/Ender-4/Configuration_adv.h index 18d4ce59796b1f16b9a4565141558cf523debe74..0533774f01eb405f8fc2b90f91df82c60e6615e8 100644 --- a/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/config/examples/Creality/Ender-4/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h b/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h index e283bdad0ce57cc71bf6b98d3941271481304cfa..85a49df14d02c0fdfcb9e2283d745a27c8ef506f 100644 --- a/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h +++ b/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h b/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h index 45e64e3f59945d54de910c30661e0c6012859e7b..dc2c0b9182ee2abca1f6ea1f926d1cdac5187842 100755 --- a/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h +++ b/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Einstart-S/Configuration_adv.h b/config/examples/Einstart-S/Configuration_adv.h index 1d28d2fdd652217dc69345e49cc0ad1661ad348f..6ea4e2bd06b556553994d9c59d01d3f91bcd36b8 100644 --- a/config/examples/Einstart-S/Configuration_adv.h +++ b/config/examples/Einstart-S/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Felix/Configuration_adv.h b/config/examples/Felix/Configuration_adv.h index 8e8973fab5cdee1645cdbc824edda9a86dca9a0f..afbe8f9dc1541a9d1ccc431a7ac80586a7738b92 100644 --- a/config/examples/Felix/Configuration_adv.h +++ b/config/examples/Felix/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/FlashForge/CreatorPro/Configuration_adv.h b/config/examples/FlashForge/CreatorPro/Configuration_adv.h index 867915c8379a455b8d5daceef07feeb5936567b6..c193bd57a2e423d27af4d579cef5e600f90cd813 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration_adv.h +++ b/config/examples/FlashForge/CreatorPro/Configuration_adv.h @@ -2120,36 +2120,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/FolgerTech/i3-2020/Configuration_adv.h b/config/examples/FolgerTech/i3-2020/Configuration_adv.h index 8635203df8c27ddf3c54c8a98394e5c2770b725d..d5dfe400005682d04f3f3d375a73996187b6b2a2 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Formbot/Raptor/Configuration_adv.h b/config/examples/Formbot/Raptor/Configuration_adv.h index 01e0db7330c96739bc588bc2ff241cfaa4b729c1..0753ccaf14dbdcd731e261bf4f7ba5355df15f56 100644 --- a/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/config/examples/Formbot/Raptor/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h index dc17649d69dffffcdaf42b9fdfed8f05b5560f39..d3b351154feccb93d69dfa09891865d33b587c2f 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h @@ -2125,36 +2125,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Formbot/T_Rex_3/Configuration_adv.h b/config/examples/Formbot/T_Rex_3/Configuration_adv.h index f2f226e2c0bd6a2a995e2ba1c818d1c723ffbdd1..990d5858127ffb38455b398e42ed79b9e1eaa915 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_3/Configuration_adv.h @@ -2125,36 +2125,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Fysetc/AIO_II/Configuration_adv.h b/config/examples/Fysetc/AIO_II/Configuration_adv.h index fb7d33760b2f50e7a8f1650d4c27aef6bf2d4119..5b846a73632e9bd990a2c2df4570357e5fc91785 100644 --- a/config/examples/Fysetc/AIO_II/Configuration_adv.h +++ b/config/examples/Fysetc/AIO_II/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Fysetc/CHEETAH/Configuration_adv.h b/config/examples/Fysetc/CHEETAH/Configuration_adv.h index 87d5f4de5d785a24bc261667a3c17a59b67f8736..c06dd564c812b0a3ce55e01359d56d9cc7b6c72b 100644 --- a/config/examples/Fysetc/CHEETAH/Configuration_adv.h +++ b/config/examples/Fysetc/CHEETAH/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Fysetc/F6_13/Configuration_adv.h b/config/examples/Fysetc/F6_13/Configuration_adv.h index 5a11c03a02d9c81f48f32b467b6cfb3d5bf1252e..df85984303d426ad914182ec33ce88f7ef944b4c 100644 --- a/config/examples/Fysetc/F6_13/Configuration_adv.h +++ b/config/examples/Fysetc/F6_13/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Geeetech/A10/Configuration_adv.h b/config/examples/Geeetech/A10/Configuration_adv.h index 2bb1ad83bb2c0c1ab52efb32f6e4a5fd60af84b1..3b2798a1c1e783dc4e36c6d8cfb21c5e357b30d3 100644 --- a/config/examples/Geeetech/A10/Configuration_adv.h +++ b/config/examples/Geeetech/A10/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Geeetech/A10M/Configuration_adv.h b/config/examples/Geeetech/A10M/Configuration_adv.h index e61e7178ecfdbe4eac77f58dc802f84666cfc74d..ac62d27641f525cf084d2cc4a57a9f6089f78aae 100644 --- a/config/examples/Geeetech/A10M/Configuration_adv.h +++ b/config/examples/Geeetech/A10M/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Geeetech/A20M/Configuration_adv.h b/config/examples/Geeetech/A20M/Configuration_adv.h index abe146bf784fed8893a9633e2378575bc0059f9f..70231c3773fcb10c137f866f6280d2bfc65b2087 100644 --- a/config/examples/Geeetech/A20M/Configuration_adv.h +++ b/config/examples/Geeetech/A20M/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Geeetech/MeCreator2/Configuration_adv.h b/config/examples/Geeetech/MeCreator2/Configuration_adv.h index 19c2630997ce0cb9f2e522f378bd9d8731e6f6b9..67ab2d478a8f03605ebfe10cdad04eb5a0b482a1 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -2120,36 +2120,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h index 2bb1ad83bb2c0c1ab52efb32f6e4a5fd60af84b1..3b2798a1c1e783dc4e36c6d8cfb21c5e357b30d3 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h index 2bb1ad83bb2c0c1ab52efb32f6e4a5fd60af84b1..3b2798a1c1e783dc4e36c6d8cfb21c5e357b30d3 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Infitary/i3-M508/Configuration_adv.h b/config/examples/Infitary/i3-M508/Configuration_adv.h index a2c805102730791c401fc3e4b6862c9891a8c844..8178dfdb96b76dc78ed2a648be1fc5366c57b6f9 100644 --- a/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/JGAurora/A1/Configuration_adv.h b/config/examples/JGAurora/A1/Configuration_adv.h index a0deef379b53181cadc626d20a92dbd01cb7ccd2..4abbb7c748c4ca76472a44ac61d3cff49a781ebc 100644 --- a/config/examples/JGAurora/A1/Configuration_adv.h +++ b/config/examples/JGAurora/A1/Configuration_adv.h @@ -2126,36 +2126,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/JGAurora/A5/Configuration_adv.h b/config/examples/JGAurora/A5/Configuration_adv.h index ec4f59d79e7b62c3333e1375668d23bc1fb682f4..56d1f14d149186629f88893051baf70875e009df 100644 --- a/config/examples/JGAurora/A5/Configuration_adv.h +++ b/config/examples/JGAurora/A5/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/JGAurora/A5S/Configuration_adv.h b/config/examples/JGAurora/A5S/Configuration_adv.h index a0deef379b53181cadc626d20a92dbd01cb7ccd2..4abbb7c748c4ca76472a44ac61d3cff49a781ebc 100644 --- a/config/examples/JGAurora/A5S/Configuration_adv.h +++ b/config/examples/JGAurora/A5S/Configuration_adv.h @@ -2126,36 +2126,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/MakerParts/Configuration_adv.h b/config/examples/MakerParts/Configuration_adv.h index 0e56f40e43540553119cae732a9ab87d98b5310d..aa20a83c577574877d9e7c12c388e3e4c2ae9e59 100644 --- a/config/examples/MakerParts/Configuration_adv.h +++ b/config/examples/MakerParts/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Malyan/M150/Configuration_adv.h b/config/examples/Malyan/M150/Configuration_adv.h index 0b527ef374080c3eed3ec2f82a8ff95c3bc7fd89..b7b410126335fd567d1060fa6f7b8b86286d2635 100644 --- a/config/examples/Malyan/M150/Configuration_adv.h +++ b/config/examples/Malyan/M150/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Malyan/M200/Configuration_adv.h b/config/examples/Malyan/M200/Configuration_adv.h index 768a13d15ae8df8deef3ea2687e09ad75baf25f0..65af378ed14b563cba56398d315a09401a12586d 100644 --- a/config/examples/Malyan/M200/Configuration_adv.h +++ b/config/examples/Malyan/M200/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/config/examples/Micromake/C1/enhanced/Configuration_adv.h index 3522d62e47e09fb5a370f8d1c557c84e88612303..c58d0439d70c9a17d484f9220c00e2e82afc85d8 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Mks/Robin/Configuration_adv.h b/config/examples/Mks/Robin/Configuration_adv.h index 3ad7a482c3d74c29bef00e7b874fd1046094cba6..54a2ecfce23601d0c18bd9626cd1dbd301a8c935 100644 --- a/config/examples/Mks/Robin/Configuration_adv.h +++ b/config/examples/Mks/Robin/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Mks/Sbase/Configuration_adv.h b/config/examples/Mks/Sbase/Configuration_adv.h index 921179e73999e0b41f83fb1f6bb1c7b852f9b8e1..af7a88bedcc811032efec94674f77864f858dd5e 100644 --- a/config/examples/Mks/Sbase/Configuration_adv.h +++ b/config/examples/Mks/Sbase/Configuration_adv.h @@ -2122,36 +2122,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/RapideLite/RL200/Configuration_adv.h b/config/examples/RapideLite/RL200/Configuration_adv.h index a793a1aa4ffe7df4056089e44732f5ed0caecb86..b3555b11faaf9c913acde70ee373dff9bdfae3d3 100644 --- a/config/examples/RapideLite/RL200/Configuration_adv.h +++ b/config/examples/RapideLite/RL200/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/RigidBot/Configuration_adv.h b/config/examples/RigidBot/Configuration_adv.h index 5233865d6a2e0060d8472afe4031d4563526406b..b08625decb8ec799d3f4255a5c7995d49b49b6f4 100644 --- a/config/examples/RigidBot/Configuration_adv.h +++ b/config/examples/RigidBot/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/SCARA/Configuration_adv.h b/config/examples/SCARA/Configuration_adv.h index f6affb8f317ba79dd9f4d4e8642c06bc1fdfd4c1..f1263551ad50b16d671c0eb3cad8b39d699cb063 100644 --- a/config/examples/SCARA/Configuration_adv.h +++ b/config/examples/SCARA/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h b/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h index f9c170668bd6881a8b3247accc36e2151f19785a..1fa2b41ffe56b0aefd08ff5e1d669127b262dfc2 100644 --- a/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h +++ b/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Sanguinololu/Configuration_adv.h b/config/examples/Sanguinololu/Configuration_adv.h index 9d5e7a6256da7de10137d197d12773741e37a61c..df16e6096f5148c6dd068f2abce59242bd510221 100644 --- a/config/examples/Sanguinololu/Configuration_adv.h +++ b/config/examples/Sanguinololu/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Tevo/Tarantula Pro/Configuration_adv.h b/config/examples/Tevo/Tarantula Pro/Configuration_adv.h index 63ac676eab6de5351530e32fe4e0e0dc11853204..898ed1a38eb9bdb7a3f53033f8f384dd46d84c8a 100755 --- a/config/examples/Tevo/Tarantula Pro/Configuration_adv.h +++ b/config/examples/Tevo/Tarantula Pro/Configuration_adv.h @@ -2117,36 +2117,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/TheBorg/Configuration_adv.h b/config/examples/TheBorg/Configuration_adv.h index 3156664ba3d4b4d47ac74096aca078ea025b14d2..39dea8bca98c196508be08fb56bb6c236e25fe0f 100644 --- a/config/examples/TheBorg/Configuration_adv.h +++ b/config/examples/TheBorg/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/TinyBoy2/Configuration_adv.h b/config/examples/TinyBoy2/Configuration_adv.h index 9da41887f5a20755817f3957fd677d854d18c6cd..a6db83a7764fd097fc27b7e70c373390af643c89 100644 --- a/config/examples/TinyBoy2/Configuration_adv.h +++ b/config/examples/TinyBoy2/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Tronxy/X3A/Configuration_adv.h b/config/examples/Tronxy/X3A/Configuration_adv.h index dfb66e8afb768ba9c9c0c6f4d18f268bd9ff47a1..9a1edb6b69279a185221799166667bbdff660cbb 100644 --- a/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/config/examples/Tronxy/X3A/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Tronxy/X5S-2E/Configuration_adv.h b/config/examples/Tronxy/X5S-2E/Configuration_adv.h index 224c3e1c79b278c3fa577404ac28a719573b62ae..7e3aa80393a174b015ff08279eea5470977caa51 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration_adv.h +++ b/config/examples/Tronxy/X5S-2E/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/UltiMachine/Archim1/Configuration_adv.h b/config/examples/UltiMachine/Archim1/Configuration_adv.h index 8f8ed9217863433918ed3042722c771a8bb336d0..10fdef4ef32e0fb95b1bda305eeaeab10ff72cff 100644 --- a/config/examples/UltiMachine/Archim1/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim1/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/UltiMachine/Archim2/Configuration_adv.h b/config/examples/UltiMachine/Archim2/Configuration_adv.h index 57d03352a8a24762638d646c35317791db394967..ebb7e9d8a59926122f487e00d6bbd7937c2d04d0 100644 --- a/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/VORONDesign/Configuration_adv.h b/config/examples/VORONDesign/Configuration_adv.h index 2e065499742f22ef3555d87d0e829572c4faa663..cb996c1bd75692430a57f18ed9eba06b93c3a69c 100644 --- a/config/examples/VORONDesign/Configuration_adv.h +++ b/config/examples/VORONDesign/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Velleman/K8200/Configuration_adv.h b/config/examples/Velleman/K8200/Configuration_adv.h index 3bbe12bde9fd0075952dc9e940f979a4bdfe2e5a..98f2aaf39986f45f143c4a936e81532bcd5b58b0 100644 --- a/config/examples/Velleman/K8200/Configuration_adv.h +++ b/config/examples/Velleman/K8200/Configuration_adv.h @@ -2134,36 +2134,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Velleman/K8400/Configuration_adv.h b/config/examples/Velleman/K8400/Configuration_adv.h index e6fa4038ca89358925f381741aa7dbeb2d29cafa..9cae06a1cccc0b4f6d457931d56c2a0939035558 100644 --- a/config/examples/Velleman/K8400/Configuration_adv.h +++ b/config/examples/Velleman/K8400/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/WASP/PowerWASP/Configuration_adv.h b/config/examples/WASP/PowerWASP/Configuration_adv.h index 4971b99b72da6f7e483bd612325d1fce2feec460..6a988ad14448777e82863c6687312470710ef57f 100644 --- a/config/examples/WASP/PowerWASP/Configuration_adv.h +++ b/config/examples/WASP/PowerWASP/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index 94f7c9341abe94a5c03991896dcf7b6efecfd25e..9e44cdfe099e2835e729b1c96432045e474b3538 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h index 22fbb103f06b25992b07bcf4f7c7e0593df3a752..9981bb566e73c4baf30712a8ddc4ef9d7d241cd1 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index 60b1124503cb2192a6feda07248a5868b5a8b1ce..43bc573e14d3eb43bf3f391ee4fe1316a149b20f 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/delta/FLSUN/kossel/Configuration_adv.h b/config/examples/delta/FLSUN/kossel/Configuration_adv.h index 60b1124503cb2192a6feda07248a5868b5a8b1ce..43bc573e14d3eb43bf3f391ee4fe1316a149b20f 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index 945db45bace301940e20407848152960da4e91d2..27bd3e2edf7acf321df41562e279d3526d274bb5 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h index 945db45bace301940e20407848152960da4e91d2..27bd3e2edf7acf321df41562e279d3526d274bb5 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/delta/MKS/SBASE/Configuration_adv.h b/config/examples/delta/MKS/SBASE/Configuration_adv.h index 8b547f4fce53e362221c1a623b0ff84606c35099..f15d5d09c35c6f0afead4141c6055efb9a5a6b0c 100644 --- a/config/examples/delta/MKS/SBASE/Configuration_adv.h +++ b/config/examples/delta/MKS/SBASE/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/delta/Tevo Little Monster/Configuration_adv.h b/config/examples/delta/Tevo Little Monster/Configuration_adv.h index cfc88a03c3dcdaaa0979aa13ab45a229a4b6d6c4..e43cc7ef6b1b4da2ad28174fc0ca130b87e4c17d 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration_adv.h +++ b/config/examples/delta/Tevo Little Monster/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/delta/generic/Configuration_adv.h b/config/examples/delta/generic/Configuration_adv.h index 945db45bace301940e20407848152960da4e91d2..27bd3e2edf7acf321df41562e279d3526d274bb5 100644 --- a/config/examples/delta/generic/Configuration_adv.h +++ b/config/examples/delta/generic/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/delta/kossel_mini/Configuration_adv.h b/config/examples/delta/kossel_mini/Configuration_adv.h index 945db45bace301940e20407848152960da4e91d2..27bd3e2edf7acf321df41562e279d3526d274bb5 100644 --- a/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/kossel_mini/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/delta/kossel_xl/Configuration_adv.h b/config/examples/delta/kossel_xl/Configuration_adv.h index a6c12d57babdc4140ed1bed4dc62237e9324ab66..76613e5658ad4962bb36329ffa1e011fcae64bc6 100644 --- a/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/config/examples/delta/kossel_xl/Configuration_adv.h @@ -2123,36 +2123,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/config/examples/gCreate/gMax1.5+/Configuration_adv.h index 638d1ae825d788916500901d8dc0e0fd9e8f5734..c6bb20c1f08c8b63cc0df1254960357dbfda3a00 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/makibox/Configuration_adv.h b/config/examples/makibox/Configuration_adv.h index a191b13fe900fb944608b2217e70a0d4bd2b7ac2..198e79d6dcbc7bd01447d6421e139b6919d4b24f 100644 --- a/config/examples/makibox/Configuration_adv.h +++ b/config/examples/makibox/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/tvrrug/Round2/Configuration_adv.h b/config/examples/tvrrug/Round2/Configuration_adv.h index d16c7fb62606ee8cf116ac37b536f2750e1caa63..962e545b2f4b9cf4704eeecee4c0c33a2b22ef40 100644 --- a/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/config/examples/tvrrug/Round2/Configuration_adv.h @@ -2121,36 +2121,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /** diff --git a/config/examples/wt150/Configuration_adv.h b/config/examples/wt150/Configuration_adv.h index 165f91f8d3e6c2940907f34b25e89a27a6de8af1..07bfa06045675d66859b1915ab2a3c24ce92c3cd 100644 --- a/config/examples/wt150/Configuration_adv.h +++ b/config/examples/wt150/Configuration_adv.h @@ -2122,36 +2122,38 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE -#if ENABLED(SPINDLE_LASER_ENABLE) - - #define SPINDLE_LASER_ENABLE_INVERT false // Set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // Set to true if your controller supports setting the speed/power +//#define SPINDLE_FEATURE +//#define LASER_FEATURE +#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) + #define SPINDLE_LASER_ACTIVE_HIGH false // Set to "true" if the on/off function is active HIGH + #define SPINDLE_LASER_PWM true // Set to "true" if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // Set to "true" if the speed/power goes up when you want it to go slower #define SPINDLE_LASER_POWERUP_DELAY 5000 // (ms) Delay to allow the spindle/laser to come up to speed/power #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // (ms) Delay to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // Set to true if your spindle controller supports changing spindle direction - #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // Set to true if Marlin should stop the spindle before changing rotation direction - - /** - * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power - * - * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT - * where PWM duty cycle varies from 0 to 255 - * - * set the following for your controller (ALL MUST BE SET) - */ - #define SPEED_POWER_SLOPE 118.4 - #define SPEED_POWER_INTERCEPT 0 - #define SPEED_POWER_MIN 5000 - #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #if ENABLED(SPINDLE_FEATURE) + //#define SPINDLE_CHANGE_DIR // Enable if your spindle controller can change spindle direction + #define SPINDLE_CHANGE_DIR_STOP // Enable if the spindle should stop before changing spin direction + #define SPINDLE_INVERT_DIR false // Set to "true" if the spin direction is reversed - //#define SPEED_POWER_SLOPE 0.3922 - //#define SPEED_POWER_INTERCEPT 0 - //#define SPEED_POWER_MIN 10 - //#define SPEED_POWER_MAX 100 // 0-100% + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + #else + #define SPEED_POWER_SLOPE 0.3922 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 10 + #define SPEED_POWER_MAX 100 // 0-100% + #endif #endif /**