From c56eec29f0e63a0c5147b59439fec39115d9ee44 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 2 Apr 2017 10:55:00 -0500 Subject: [PATCH] Configurable delay for BLTouch servo emulation --- Marlin/Conditionals_LCD.h | 3 +++ Marlin/Configuration.h | 1 + Marlin/Marlin_main.cpp | 2 +- Marlin/example_configurations/Cartesio/Configuration.h | 1 + Marlin/example_configurations/Felix/Configuration.h | 1 + Marlin/example_configurations/Felix/DUAL/Configuration.h | 1 + Marlin/example_configurations/Hephestos/Configuration.h | 1 + Marlin/example_configurations/Hephestos_2/Configuration.h | 1 + Marlin/example_configurations/K8200/Configuration.h | 1 + Marlin/example_configurations/K8400/Configuration.h | 1 + Marlin/example_configurations/K8400/Dual-head/Configuration.h | 1 + .../RepRapWorld/Megatronics/Configuration.h | 1 + Marlin/example_configurations/RigidBot/Configuration.h | 1 + Marlin/example_configurations/SCARA/Configuration.h | 1 + Marlin/example_configurations/TAZ4/Configuration.h | 1 + Marlin/example_configurations/TinyBoy2/Configuration.h | 1 + Marlin/example_configurations/WITBOX/Configuration.h | 1 + Marlin/example_configurations/adafruit/ST7565/Configuration.h | 1 + .../delta/flsun_kossel_mini/Configuration.h | 1 + Marlin/example_configurations/delta/generic/Configuration.h | 1 + .../example_configurations/delta/kossel_mini/Configuration.h | 1 + Marlin/example_configurations/delta/kossel_pro/Configuration.h | 1 + Marlin/example_configurations/delta/kossel_xl/Configuration.h | 1 + Marlin/example_configurations/makibox/Configuration.h | 1 + Marlin/example_configurations/tvrrug/Round2/Configuration.h | 1 + 25 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h index 862e4827b..511cb019e 100644 --- a/Marlin/Conditionals_LCD.h +++ b/Marlin/Conditionals_LCD.h @@ -345,6 +345,9 @@ #undef DEACTIVATE_SERVOS_AFTER_MOVE #undef SERVO_DELAY #define SERVO_DELAY 50 + #ifndef BLTOUCH_DELAY + #define BLTOUCH_DELAY 375 + #endif #undef Z_SERVO_ANGLES #define Z_SERVO_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW } diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index bb554fa86..c303741c4 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -559,6 +559,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f1234dbc8..a2013c826 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1990,7 +1990,7 @@ static void clean_up_after_endstop_or_probe_move() { #if ENABLED(BLTOUCH) void bltouch_command(int angle) { servo[Z_ENDSTOP_SERVO_NR].move(angle); // Give the BL-Touch the command and wait - safe_delay(375); + safe_delay(BLTOUCH_DELAY); } void set_bltouch_deployed(const bool deploy) { diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 3fd0a7b4a..e7497693b 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -559,6 +559,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 0c7d070f7..c25b18494 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -542,6 +542,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 1b73fd408..69ff05641 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -542,6 +542,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 9ea0b4b23..3eb1b4dee 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -551,6 +551,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 8001b300d..5c9a5acb2 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -553,6 +553,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index d490c9bbf..2265ce131 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -588,6 +588,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index a76a149ba..d7a965bcd 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -559,6 +559,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 784af8ef6..fbc6b5c3a 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -559,6 +559,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 53634f5f5..2238891c9 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -559,6 +559,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 77a19b7e0..256d6cd57 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -558,6 +558,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 9ae75f391..e6204aa11 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -574,6 +574,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 9e1466db8..c58b09b9a 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -580,6 +580,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/TinyBoy2/Configuration.h b/Marlin/example_configurations/TinyBoy2/Configuration.h index 7e2cf0eac..a37da0036 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration.h @@ -605,6 +605,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 2375986b7..77c5f366f 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -551,6 +551,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 57e23c03e..c9d9c7eaf 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -559,6 +559,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h index e3851c929..2fbab8ba2 100644 --- a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h @@ -617,6 +617,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 4682962f4..358e781b6 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -604,6 +604,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index fbb17466b..879b31430 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -604,6 +604,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 81d935c9c..6fc7c721a 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -598,6 +598,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 9403f4431..3fd0445d7 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -617,6 +617,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 3f4a978da..dca380ed4 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -562,6 +562,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index da0961791..e5ba30695 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -555,6 +555,7 @@ // The BLTouch probe emulates a servo probe. // The default connector is SERVO 0. Set Z_ENDSTOP_SERVO_NR below to override. //#define BLTOUCH +//#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed // Z Servo Probe, such as an endstop switch on a rotating arm. //#define Z_ENDSTOP_SERVO_NR 0