diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d8f6af1fe8349f851889d1d49e99f300c67cb75f..ce046ca64795722fe5aa47270841325d2cdb0501 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1173,18 +1173,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 dda663900cbe8455e72ce494993b601eb18940da..81e2db8bd052db37ded46158525994d4d441b4ac 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -593,8 +593,6 @@ #error "Z_LATE_ENABLE can't be used with COREXZ." #elif defined(X_HOME_RETRACT_MM) #error "[XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM." -#elif defined(PROBE_SERVO_DEACTIVATION_DELAY) - #error "PROBE_SERVO_DEACTIVATION_DELAY has been replaced with DEACTIVATE_SERVOS_AFTER_MOVE and SERVO_DEACTIVATION_DELAY." #elif defined(BEEPER) #error "BEEPER is now BEEPER_PIN. Please update your pins definitions." #elif defined(SDCARDDETECT) @@ -635,6 +633,10 @@ #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." #elif defined(XY_TRAVEL_SPEED) #error "XY_TRAVEL_SPEED is deprecated. Use XY_PROBE_SPEED instead." +#elif defined(PROBE_SERVO_DEACTIVATION_DELAY) + #error "PROBE_SERVO_DEACTIVATION_DELAY is deprecated. Use DEACTIVATE_SERVOS_AFTER_MOVE instead." +#elif defined(SERVO_DEACTIVATION_DELAY) + #error "SERVO_DEACTIVATION_DELAY is deprecated. Use SERVO_DELAY instead." #endif #endif //SANITYCHECK_H diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index bbc7d10bf9855a737d9e3f797db12fca15294bd0..69997fbab7e785489cd7a045a95166537a70b35e 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -1172,18 +1172,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 4c79f69a1e4b14ac9582380d5512a3fe76248842..9acb21c1c3f0fd1ea687338576b421680c0faa2e 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -1156,18 +1156,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 28e0862faf8c0415701a2307c174c88702a918e1..9431c20845729c7d0e3d0032f44368e6ab9365d7 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -1154,18 +1154,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 2389c10a93d20ae367e99db86c894fe307f10e39..fd98445be6d81c2bb3d97ddede7d5510a1874158 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -1165,18 +1165,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 46db141181df668b2e5710e712260994517615b7..78ec36f7130c4cae53a37aed3f04dd241e9c6137 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -1167,18 +1167,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 1f7504e110edf4a9296990f58187505df056193e..115e69d61895f9e30030bd3f491b64b2ff97f1ec 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -1190,18 +1190,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 15e3d56adaaf598be57c08bebd0b86b4c1cc0249..a0445647f18ccb07d172b696c2231862f13ed1a1 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -1173,18 +1173,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 29f26f43d3c41aa23be4e124f31415004970e3f4..5f069bac50e39ac96b07a19f5c5e78190ee7c437 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -1170,18 +1170,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // #define NUM_SERVOS 0 // DGlass3D - Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 7b29ec92c9711397fab633fe4c297ed7c07d8a7d..ee7a0e0f8f1d6082cdcbc33e719b25fc5879f326 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -1181,18 +1181,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 5565df7e06bb3cff664ec44c0c2e372447bc103e..043ebb3f3817fd6d8067409ff34759e41929172c 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -1194,18 +1194,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 65ffac1a1ee6b6cfc14a8a6682aabfd56a64d41b..a15f582e0b5848a0d5458442e881af755f738562 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -1165,18 +1165,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 21a47e762919f8c0d6d1f70f8bb48bd5eafbecf4..e56c6b3274fe69bd16b2ef9026b5fe12880b6e06 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -1173,18 +1173,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 35202c9eade1dacdb441ccdb17d34e878b543245..f4147a0cca756db90c90710fe4d39c879fef3347 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -1258,18 +1258,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 46bb74b458c9eae1ed9e4efdbf62f1416cee99c7..f84451d8ead0e151c8a067f710bd9d91ae126439 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1252,18 +1252,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 f94964a16c8789057ef99798802eb819d02a459e..d6b6405af00e1005ddb7ed4f8b425ea7aa7b925e 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1255,18 +1255,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 d9b18cf7deeeb9d4fcab7f01804c192794f42a64..d6572bb9734444ae328566d13d172daebd20b77a 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -1255,18 +1255,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index d453fc5893ec70586ea524da71acf78143b85411..49dc55403370750a26305cec6377ff2999355762 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -1257,18 +1257,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 fcc45adec01e5ac7182cea2957576ba323661412..444c46e2368262f30da0fe0417d16779ca993fc9 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -1176,18 +1176,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 7fcf6e394371f101032c0afd9b9697237fd6fa6b..5d46e05e90b8d963d34683f9150bc7651d876be2 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -1167,18 +1167,16 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // //#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command +// Delay (in microseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY 300 + // Servo deactivation // // With this option servos are powered only during movement, then turned off to prevent jitter. //#define DEACTIVATE_SERVOS_AFTER_MOVE -#if ENABLED(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 1b8442a0de21dc2fe8b12282f67f532c43a855e7..cbc0026d415c5662752d1b1a83c9933658edc7f9 100644 --- a/Marlin/servo.cpp +++ b/Marlin/servo.cpp @@ -21,50 +21,35 @@ */ /** - servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 - Copyright (c) 2009 Michael Margolis. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * servo.cpp - Interrupt driven Servo library for Arduino using 16 bit timers- Version 2 + * Copyright (c) 2009 Michael Margolis. All right reserved. */ /** - - A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. - The servos are pulsed in the background using the value most recently written using the write() method - - Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. - Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. - - The methods are: - - Servo - Class for manipulating servo motors connected to Arduino pins. - - attach(pin ) - Attaches a servo motor to an i/o pin. - attach(pin, min, max ) - Attaches to a pin setting min and max values in microseconds - default min is 544, max is 2400 - - 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, angle) - Sequence of attach(pin), write(angle). - 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. - detach() - Stops an attached servos from pulsing its i/o pin. - -*/ + * A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. + * The servos are pulsed in the background using the value most recently written using the write() method + * + * Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. + * Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. + * + * The methods are: + * + * Servo - Class for manipulating servo motors connected to Arduino pins. + * + * attach(pin) - Attach a servo motor to an i/o pin. + * attach(pin, min, max) - Attach to a pin, setting min and max values in microseconds + * Default min is 544, max is 2400 + * + * write() - Set the servo angle in degrees. (Invalid angles —over MIN_PULSE_WIDTH— are treated as µs.) + * writeMicroseconds() - Set the servo pulse width in microseconds. + * move(pin, angle) - Sequence of attach(pin), write(angle), delay(SERVO_DELAY). + * With DEACTIVATE_SERVOS_AFTER_MOVE it detaches after SERVO_DELAY. + * read() - Get the last-written servo pulse width as an angle between 0 and 180. + * readMicroseconds() - Get the last-written servo pulse width in microseconds. + * attached() - Return true if a servo is attached. + * detach() - Stop an attached servo from pulsing its i/o pin. + * + */ #include "Configuration.h" #if HAS_SERVOS @@ -238,6 +223,7 @@ static void finISR(timer16_Sequence_t timer) { } #else //!WIRING // For arduino - in future: call here to a currently undefined function to reset the timer + UNUSED(timer); #endif } @@ -324,8 +310,8 @@ bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; } void Servo::move(int value) { if (this->attach(0) >= 0) { this->write(value); + delay(SERVO_DELAY); #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - delay(SERVO_DEACTIVATION_DELAY); this->detach(); #endif } diff --git a/Marlin/servo.h b/Marlin/servo.h index d764fc4401efbb97849d875514908ae054b02329..07532bc303474eecaa7ab0d6f8a4167f92b63237 100644 --- a/Marlin/servo.h +++ b/Marlin/servo.h @@ -63,7 +63,7 @@ attached() - Returns true if there is a servo attached. detach() - Stops an attached servos from pulsing its i/o pin. move(angle) - Sequence of attach(0), write(angle), - With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DEACTIVATION_DELAY and detach. + With DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY and detach. */ #ifndef servo_h @@ -147,7 +147,7 @@ class Servo { void writeMicroseconds(int value); // write pulse width in microseconds void move(int value); // attach the servo, then move to value // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds - // if DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DEACTIVATION_DELAY, then detach + // if DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY, then detach int read(); // returns current pulse width as an angle between 0 and 180 degrees int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release) bool attached(); // return true if this servo is attached, otherwise false