diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 3bb02ba75..9ecbdb8f3 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -767,17 +767,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command -// If DEACTIVATE_SERVOS_AFTER_MOVE is defined, the servos will be turned on only during movement and then turned off to avoid jitter -// SERVO_DEACTIVATION_DELAY is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. -// If your servo does not reach the requested position, enlarge the time. -// You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. -// -//#define DEACTIVATE_SERVOS_AFTER_MOVE - -#ifdef DEACTIVATE_SERVOS_AFTER_MOVE - #define SERVO_DEACTIVATION_DELAY 300 -#endif - // Servo Endstops // // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. @@ -786,6 +775,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index b8e2f2590..d111f9131 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -84,6 +84,13 @@ #error The maximum number of SERVOS in Marlin is 4. #endif + /** + * Servo deactivation depends on servo endstops + */ + #if defined(DEACTIVATE_SERVOS_AFTER_MOVE) && !defined(SERVO_ENDSTOPS) + #error SERVO_ENDSTOPS is required for DEACTIVATE_SERVOS_AFTER_MOVE. + #endif + /** * Required LCD language */ diff --git a/Marlin/configurator/config/Configuration.h b/Marlin/configurator/config/Configuration.h index 497aac9f6..424dd1995 100644 --- a/Marlin/configurator/config/Configuration.h +++ b/Marlin/configurator/config/Configuration.h @@ -503,13 +503,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -781,6 +774,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 2fc31d0f0..85186922f 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -486,13 +486,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -765,6 +758,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 951c39a1d..d1d68b29a 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -512,13 +512,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -790,6 +783,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index abcc7e5e0..935b2b412 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -520,13 +520,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -798,6 +791,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 95596b5be..ae47a35d9 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -504,13 +504,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -782,6 +775,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 9112c0635..05f3cd8b0 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -503,13 +503,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -782,6 +775,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 01d7f2613..650f195cd 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -545,13 +545,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -823,6 +816,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index a29de2601..c59a6276b 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -512,13 +512,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -790,6 +783,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 35b2128c7..2c325f1c0 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -503,13 +503,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -781,6 +774,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index a6a3859a6..8844d6a67 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -624,13 +624,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE HOMING_FEEDRATE_Z #endif - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -909,6 +902,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index bde2a9ddb..9088318bd 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -624,13 +624,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE HOMING_FEEDRATE_Z #endif - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -909,6 +902,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 1fcc93db7..a9be123f8 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -628,13 +628,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE HOMING_FEEDRATE_Z #endif - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -913,6 +906,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 902f9c24a..b3d9bf180 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -641,13 +641,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE HOMING_FEEDRATE_Z #endif - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -936,6 +929,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 55024f477..0a5f8fb9a 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -507,13 +507,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -785,6 +778,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index ec89f8105..c266d0abf 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -509,13 +509,6 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. - //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk - //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it. - // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile. - -// #define PROBE_SERVO_DEACTIVATION_DELAY 300 - - //If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing, //it is highly recommended you let this Z_SAFE_HOMING enabled!!! @@ -791,6 +784,18 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles +// Servo deactivation +// +// With this option servos are powered only during movement, then turned off to prevent jitter. +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +#ifdef DEACTIVATE_SERVOS_AFTER_MOVE + // Delay (in microseconds) before turning the servo off. This depends on the servo speed. + // 300ms is a good value but you can try less delay. + // If the servo can't reach the requested position, increase it. + #define SERVO_DEACTIVATION_DELAY 300 +#endif + /**********************************************************************\ * Support for a filament diameter sensor * Also allows adjustment of diameter at print time (vs at slicing) diff --git a/Marlin/servo.cpp b/Marlin/servo.cpp index 6e3f398ce..21f5e0487 100644 --- a/Marlin/servo.cpp +++ b/Marlin/servo.cpp @@ -35,8 +35,8 @@ write() - Sets the servo angle in degrees. (invalid angle that is valid as pulse in microseconds is treated as microseconds) writeMicroseconds() - Sets the servo pulse width in microseconds - move(pin, angel) - Sequence of attach(pin), write(angel), - if DEACTIVATE_SERVOS_AFTER_MOVE is defined waits SERVO_DEACTIVATION_DELAY, than detaches. + move(pin, angel) - Sequence of attach(pin), write(angel). + With DEACTIVATE_SERVOS_AFTER_MOVE it waits SERVO_DEACTIVATION_DELAY and detaches. read() - Gets the last written servo pulse width as an angle between 0 and 180. readMicroseconds() - Gets the last written servo pulse width in microseconds. (was read_us() in first release) attached() - Returns true if there is a servo attached. diff --git a/Marlin/servo.h b/Marlin/servo.h index 4c58991c7..9a7864377 100644 --- a/Marlin/servo.h +++ b/Marlin/servo.h @@ -41,7 +41,7 @@ attached() - Returns true if there is a servo attached. detach() - Stops an attached servos from pulsing its i/o pin. move(pin, angel) - Sequence of attach(pin), write(angel), - if DEACTIVATE_SERVOS_AFTER_MOVE is defined waits SERVO_DEACTIVATION_DELAY, than detaches. + With DEACTIVATE_SERVOS_AFTER_MOVE it waits SERVO_DEACTIVATION_DELAY and detaches. */ #ifndef servo_h