From 47ce810f524c1816288638d5c0f789a98a0989b5 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 13 Jun 2016 20:18:24 -0700 Subject: [PATCH 1/3] Remove support for XY servo endstops --- .travis.yml | 2 +- Marlin/Conditionals.h | 10 -- Marlin/Configuration.h | 6 +- Marlin/Marlin_main.cpp | 165 +++++++----------- Marlin/SanityCheck.h | 27 ++- .../Felix/Configuration.h | 6 +- .../Felix/DUAL/Configuration.h | 6 +- .../Hephestos/Configuration.h | 6 +- .../Hephestos_2/Configuration.h | 6 +- .../K8200/Configuration.h | 6 +- .../RepRapWorld/Megatronics/Configuration.h | 6 +- .../RigidBot/Configuration.h | 6 +- .../SCARA/Configuration.h | 6 +- .../TAZ4/Configuration.h | 6 +- .../WITBOX/Configuration.h | 6 +- .../adafruit/ST7565/Configuration.h | 6 +- .../delta/biv2.5/Configuration.h | 6 +- .../delta/generic/Configuration.h | 6 +- .../delta/kossel_mini/Configuration.h | 6 +- .../delta/kossel_pro/Configuration.h | 6 +- .../delta/kossel_xl/Configuration.h | 6 +- .../makibox/Configuration.h | 6 +- .../tvrrug/Round2/Configuration.h | 6 +- 23 files changed, 114 insertions(+), 204 deletions(-) diff --git a/.travis.yml b/.travis.yml index 496b616aa0..89459cbe72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,7 +104,7 @@ script: # # Test AUTO_BED_LEVELING & DEBUG_LEVELING_FEATURE with Servos # - - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR SERVO_ENDSTOP_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE + - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE - build_marlin # # Test EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER, diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 3ccfe57f7d..4987e0055b 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -764,19 +764,9 @@ #define HAS_BUZZER (PIN_EXISTS(BEEPER) || defined(LCD_USE_I2C_BUZZER)) #if HAS_SERVOS - #ifndef X_ENDSTOP_SERVO_NR - #define X_ENDSTOP_SERVO_NR -1 - #endif - #ifndef Y_ENDSTOP_SERVO_NR - #define Y_ENDSTOP_SERVO_NR -1 - #endif #ifndef Z_ENDSTOP_SERVO_NR #define Z_ENDSTOP_SERVO_NR -1 #endif - #if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || HAS_Z_ENDSTOP_SERVO - #define HAS_SERVO_ENDSTOPS - #define SERVO_ENDSTOP_IDS { X_ENDSTOP_SERVO_NR, Y_ENDSTOP_SERVO_NR, Z_ENDSTOP_SERVO_NR } - #endif #endif #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED)) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 509427b61b..7e5417c799 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -420,7 +420,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1164,10 +1164,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3d63bec3df..26525d8568 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -391,9 +391,8 @@ static uint8_t target_extruder; }; #endif -#if ENABLED(HAS_SERVO_ENDSTOPS) - const int servo_endstop_id[] = SERVO_ENDSTOP_IDS; - const int servo_endstop_angle[][2] = SERVO_ENDSTOP_ANGLES; +#if HAS_Z_ENDSTOP_SERVO + const int z_servo_angle[2] = Z_SERVO_ANGLES; #endif #if ENABLED(BARICUDA) @@ -488,10 +487,8 @@ static bool send_ok[BUFSIZE]; #if HAS_SERVOS Servo servo[NUM_SERVOS]; #define MOVE_SERVO(I, P) servo[I].move(P) - #define SERVO_ENDSTOP_EXISTS(I) (servo_endstop_id[I] >= 0) - #define MOVE_SERVO_ENDSTOP(I, J) MOVE_SERVO(servo_endstop_id[I], servo_endstop_angle[I][J]) - #define DEPLOY_SERVO_ENDSTOP(I) MOVE_SERVO_ENDSTOP(I, 0) - #define STOW_SERVO_ENDSTOP(I) MOVE_SERVO_ENDSTOP(I, 1) + #define DEPLOY_Z_SERVO() MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[0]) + #define STOW_Z_SERVO() MOVE_SERVO(Z_ENDSTOP_SERVO_NR, z_servo_angle[1]) #endif #ifdef CHDK @@ -749,14 +746,12 @@ void servo_init() { servo[3].detach(); #endif - #if ENABLED(HAS_SERVO_ENDSTOPS) + #if HAS_Z_ENDSTOP_SERVO endstops.enable_z_probe(false); /** - * Set position of all defined Servo Endstops - * - * ** UNSAFE! - NEEDS UPDATE! ** + * Set position of Z Servo Endstop * * The servo might be deployed and positioned too low to stow * when starting up the machine or rebooting the board. @@ -764,11 +759,8 @@ void servo_init() { * homing has been done - no homing with z-probe without init! * */ - for (int i = 0; i < 3; i++) - if (SERVO_ENDSTOP_EXISTS(i)) - STOW_SERVO_ENDSTOP(i); - - #endif // HAS_SERVO_ENDSTOPS + STOW_Z_SERVO(); + #endif // HAS_Z_ENDSTOP_SERVO } @@ -1837,11 +1829,10 @@ static void setup_for_endstop_move() { if (endstops.z_probe_enabled) return; - #if ENABLED(HAS_SERVO_ENDSTOPS) + #if HAS_Z_ENDSTOP_SERVO // Engage Z Servo endstop if enabled - if (SERVO_ENDSTOP_EXISTS(Z_AXIS)) - DEPLOY_SERVO_ENDSTOP(Z_AXIS); + DEPLOY_Z_SERVO(); #elif ENABLED(Z_PROBE_ALLEN_KEY) feedrate = Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE; @@ -1925,7 +1916,7 @@ static void setup_for_endstop_move() { } static void stow_z_probe(bool doRaise = true) { - #if !(ENABLED(HAS_SERVO_ENDSTOPS) && (Z_RAISE_AFTER_PROBING > 0)) + #if !(HAS_Z_ENDSTOP_SERVO && (Z_RAISE_AFTER_PROBING > 0)) UNUSED(doRaise); #endif #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -1934,21 +1925,18 @@ static void setup_for_endstop_move() { if (!endstops.z_probe_enabled) return; - #if ENABLED(HAS_SERVO_ENDSTOPS) + #if HAS_Z_ENDSTOP_SERVO // Retract Z Servo endstop if enabled - if (SERVO_ENDSTOP_EXISTS(Z_AXIS)) { + #if Z_RAISE_AFTER_PROBING > 0 + if (doRaise) { + raise_z_after_probing(); // this also updates current_position + stepper.synchronize(); + } + #endif - #if Z_RAISE_AFTER_PROBING > 0 - if (doRaise) { - raise_z_after_probing(); // this also updates current_position - stepper.synchronize(); - } - #endif - - // Change the Z servo angle - STOW_SERVO_ENDSTOP(Z_AXIS); - } + // Change the Z servo angle + STOW_Z_SERVO(); #elif ENABLED(Z_PROBE_ALLEN_KEY) @@ -2168,16 +2156,25 @@ static void setup_for_endstop_move() { #endif // DELTA - #if ENABLED(HAS_SERVO_ENDSTOPS) && DISABLED(Z_PROBE_SLED) + #if HAS_Z_ENDSTOP_SERVO && DISABLED(Z_PROBE_SLED) - void raise_z_for_servo() { - float zpos = current_position[Z_AXIS], z_dest = Z_RAISE_BEFORE_PROBING; - /** - * The zprobe_zoffset is negative any switch below the nozzle, so - * multiply by Z_HOME_DIR (-1) to move enough away from bed for the probe - */ - z_dest += axis_homed[Z_AXIS] ? zprobe_zoffset * Z_HOME_DIR : zpos; - if (zpos < z_dest) do_blocking_move_to_z(z_dest); // also updates current_position + /** + * Raise Z to a minimum height to make room for a servo to move + * + * zprobe_zoffset: Negative of the Z height where the probe engages + * z_dest: The before / after probing raise distance + * + * The zprobe_zoffset is negative for a switch below the nozzle, so + * multiply by Z_HOME_DIR (-1) to move enough away from the bed. + */ + void raise_z_for_servo(float z_dest) { + z_dest += home_offset[Z_AXIS]; + + if ((Z_HOME_DIR) < 0 && zprobe_zoffset < 0) + z_dest -= zprobe_zoffset; + + if (z_dest > current_position[Z_AXIS]) + do_blocking_move_to_z(z_dest); // also updates current_position } #endif @@ -2277,23 +2274,24 @@ static void homeaxis(AxisEnum axis) { sync_plan_position(); #if ENABLED(Z_PROBE_SLED) - #define _Z_SERVO_TEST (axis != Z_AXIS) // already deployed Z - #define _Z_SERVO_SUBTEST false // Z will never be invoked #define _Z_DEPLOY (dock_sled(false)) #define _Z_STOW (dock_sled(true)) - #elif SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) #define _Z_SERVO_TEST (axis != Z_AXIS) // already deployed Z #define _Z_SERVO_SUBTEST false // Z will never be invoked + #elif SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) #define _Z_DEPLOY (deploy_z_probe()) #define _Z_STOW (stow_z_probe()) - #elif ENABLED(HAS_SERVO_ENDSTOPS) + #define _Z_SERVO_TEST (axis != Z_AXIS) // already deployed Z + #define _Z_SERVO_SUBTEST false // Z will never be invoked + #elif HAS_Z_ENDSTOP_SERVO + #define _Z_DEPLOY do{ raise_z_for_servo(Z_RAISE_BEFORE_PROBING); DEPLOY_Z_SERVO(); endstops.z_probe_enabled = true; }while(0) + #define _Z_STOW do{ raise_z_for_servo(Z_RAISE_AFTER_PROBING); STOW_Z_SERVO(); endstops.z_probe_enabled = false; }while(0) #define _Z_SERVO_TEST true // Z not deployed yet #define _Z_SERVO_SUBTEST (axis == Z_AXIS) // Z is a probe #endif - // If there's a Z probe that needs deployment... - #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) - // ...and homing Z towards the bed? Deploy it. + // Homing Z towards the bed? Deploy the Z probe or endstop. + #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_ENDSTOP_SERVO if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_DEPLOY)); @@ -2302,14 +2300,6 @@ static void homeaxis(AxisEnum axis) { } #endif - #if ENABLED(HAS_SERVO_ENDSTOPS) - // Engage an X, Y (or Z) Servo endstop if enabled - if (_Z_SERVO_TEST && SERVO_ENDSTOP_EXISTS(axis)) { - DEPLOY_SERVO_ENDSTOP(axis); - if (_Z_SERVO_SUBTEST) endstops.z_probe_enabled = true; - } - #endif - // Set a flag for Z motor locking #if ENABLED(Z_DUAL_ENDSTOPS) if (axis == Z_AXIS) stepper.set_homing_flag(true); @@ -2423,8 +2413,8 @@ static void homeaxis(AxisEnum axis) { axis_known_position[axis] = true; axis_homed[axis] = true; - // Put away the Z probe with a function - #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) + // Put away the Z probe + #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_ENDSTOP_SERVO if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_STOW)); @@ -2433,33 +2423,6 @@ static void homeaxis(AxisEnum axis) { } #endif - // Retract X, Y (or Z) Servo endstop if enabled - #if ENABLED(HAS_SERVO_ENDSTOPS) - if (_Z_SERVO_TEST && SERVO_ENDSTOP_EXISTS(axis)) { - // Raise the servo probe before stow outside ABL context. - // This is a workaround to allow use of a Servo Probe without - // ABL until more global probe handling is implemented. - #if Z_RAISE_AFTER_PROBING > 0 - if (axis == Z_AXIS) { - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOPAIR("Raise Z (after) by ", Z_RAISE_AFTER_PROBING); - #endif - current_position[Z_AXIS] = Z_RAISE_AFTER_PROBING; - feedrate = homing_feedrate[Z_AXIS]; - line_to_current_position(); - stepper.synchronize(); - } - #endif - - #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_ENDSTOPS > Stow with servo.move()"); - #endif - STOW_SERVO_ENDSTOP(axis); - if (_Z_SERVO_SUBTEST) endstops.enable_z_probe(false); - } - - #endif // HAS_SERVO_ENDSTOPS - } #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -3801,7 +3764,7 @@ inline void gcode_G28() { #endif current_position[Z_AXIS] = -zprobe_zoffset + (z_tmp - real_z) - #if ENABLED(HAS_SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) + #if HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) + Z_RAISE_AFTER_PROBING #endif ; @@ -3816,11 +3779,9 @@ inline void gcode_G28() { // Sled assembly for Cartesian bots #if ENABLED(Z_PROBE_SLED) dock_sled(true); // dock the sled - #else + #elif !HAS_Z_ENDSTOP_SERVO && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) // Raise Z axis for non-delta and non servo based probes - #if DISABLED(HAS_SERVO_ENDSTOPS) && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) - raise_z_after_probing(); - #endif + raise_z_after_probing(); #endif #endif // !DELTA @@ -3862,8 +3823,8 @@ inline void gcode_G28() { * G30: Do a single Z probe at the current XY */ inline void gcode_G30() { - #if ENABLED(HAS_SERVO_ENDSTOPS) - raise_z_for_servo(); + #if HAS_Z_ENDSTOP_SERVO + raise_z_for_servo(Z_RAISE_BEFORE_PROBING); #endif deploy_z_probe(); // Engage Z Servo endstop if available. Z_PROBE_SLED is missed here. @@ -3884,8 +3845,8 @@ inline void gcode_G28() { clean_up_after_endstop_move(); // Too early. must be done after the stowing. - #if ENABLED(HAS_SERVO_ENDSTOPS) - raise_z_for_servo(); + #if HAS_Z_ENDSTOP_SERVO + raise_z_for_servo(Z_RAISE_AFTER_PROBING); #endif stow_z_probe(false); // Retract Z Servo endstop if available. Z_PROBE_SLED is missed here. @@ -6019,14 +5980,14 @@ inline void gcode_M303() { */ inline void gcode_M400() { stepper.synchronize(); } -#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(Z_PROBE_SLED) && (ENABLED(HAS_SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY)) +#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(Z_PROBE_SLED) && (HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_ALLEN_KEY)) /** * M401: Engage Z Servo endstop if available */ inline void gcode_M401() { - #if ENABLED(HAS_SERVO_ENDSTOPS) - raise_z_for_servo(); + #if HAS_Z_ENDSTOP_SERVO + raise_z_for_servo(Z_RAISE_BEFORE_PROBING); #endif deploy_z_probe(); } @@ -6035,13 +5996,13 @@ inline void gcode_M400() { stepper.synchronize(); } * M402: Retract Z Servo endstop if enabled */ inline void gcode_M402() { - #if ENABLED(HAS_SERVO_ENDSTOPS) - raise_z_for_servo(); + #if HAS_Z_ENDSTOP_SERVO + raise_z_for_servo(Z_RAISE_AFTER_PROBING); #endif stow_z_probe(false); } -#endif // AUTO_BED_LEVELING_FEATURE && (ENABLED(HAS_SERVO_ENDSTOPS) || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED +#endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_ENDSTOP_SERVO || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED #if ENABLED(FILAMENT_WIDTH_SENSOR) @@ -7338,14 +7299,14 @@ void process_next_command() { gcode_M400(); break; - #if ENABLED(AUTO_BED_LEVELING_FEATURE) && (ENABLED(HAS_SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY)) && DISABLED(Z_PROBE_SLED) + #if ENABLED(AUTO_BED_LEVELING_FEATURE) && (HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_ALLEN_KEY)) && DISABLED(Z_PROBE_SLED) case 401: gcode_M401(); break; case 402: gcode_M402(); break; - #endif // AUTO_BED_LEVELING_FEATURE && (ENABLED(HAS_SERVO_ENDSTOPS) || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED + #endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_ENDSTOP_SERVO || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED #if ENABLED(FILAMENT_WIDTH_SENSOR) case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 063f4af22c..5aea3663c0 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -170,26 +170,19 @@ /** * Limited number of servos */ -#if NUM_SERVOS > 4 - #error "The maximum number of SERVOS in Marlin is 4." -#endif #if defined(NUM_SERVOS) && NUM_SERVOS > 0 - #if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || Z_ENDSTOP_SERVO_NR >= 0 - #if X_ENDSTOP_SERVO_NR >= NUM_SERVOS - #error "X_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS." - #elif Y_ENDSTOP_SERVO_NR >= NUM_SERVOS - #error "Y_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS." - #elif Z_ENDSTOP_SERVO_NR >= NUM_SERVOS - #error "Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS." - #endif + #if NUM_SERVOS > 4 + #error "The maximum number of SERVOS in Marlin is 4." + #elif HAS_Z_ENDSTOP_SERVO && Z_ENDSTOP_SERVO_NR >= NUM_SERVOS + #error "Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS." #endif #endif /** * Servo deactivation depends on servo endstops */ -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && DISABLED(HAS_SERVO_ENDSTOPS) - #error "At least one of the ?_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE." +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_ENDSTOP_SERVO + #error "Z_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE." #endif /** @@ -288,8 +281,8 @@ //#if Z_ENDSTOP_SERVO_NR < 0 // #error "You must have Z_ENDSTOP_SERVO_NR set to at least 0 or above to use Z_MIN_PROBE_ENDSTOP." //#endif - //#ifndef SERVO_ENDSTOP_ANGLES - // #error "You must have SERVO_ENDSTOP_ANGLES defined for Z Extend and Retract to use Z_MIN_PROBE_ENDSTOP." + //#ifndef Z_SERVO_ANGLES + // #error "You must have Z_SERVO_ANGLES defined for Z Extend and Retract to use Z_MIN_PROBE_ENDSTOP." //#endif #endif @@ -613,6 +606,10 @@ #error "PID_PARAMS_PER_EXTRUDER is deprecated. Use PID_PARAMS_PER_HOTEND instead." #elif defined(EXTRUDER_WATTS) #error "EXTRUDER_WATTS is deprecated. Use HOTEND_WATTS instead." +#elif defined(SERVO_ENDSTOP_ANGLES) + #error "SERVO_ENDSTOP_ANGLES is deprecated. Use Z_SERVO_ANGLES instead." +#elif defined(X_ENDSTOP_SERVO_NR) || defined(Y_ENDSTOP_SERVO_NR) + #error "X_ENDSTOP_SERVO_NR and Y_ENDSTOP_SERVO_NR are deprecated and should be removed." #endif #endif //SANITYCHECK_H diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index f92302db53..4ae2fd7aee 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -402,7 +402,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1147,10 +1147,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index c243209d5e..fe0c5898da 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -400,7 +400,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1145,10 +1145,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 34ee387ee5..337d3617c9 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -412,7 +412,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1156,10 +1156,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index d5e6a0df04..30c7fb081c 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -414,7 +414,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1158,10 +1158,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 6797fcd89f..a5b4cbf475 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -437,7 +437,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1181,10 +1181,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 9a4a2c7fbd..e9a1f6e24f 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -420,7 +420,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1164,10 +1164,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index dff38c635e..c327bcae39 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -414,7 +414,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1161,10 +1161,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 5ac806382b..4dd49cff2a 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -428,7 +428,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1172,10 +1172,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 5c1742d68c..a76f9f740e 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -441,7 +441,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1185,10 +1185,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 4055e15a3f..64e36be919 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -412,7 +412,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1156,10 +1156,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index fdbf9a8697..d6281d3bea 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -420,7 +420,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1164,10 +1164,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index d6b783a95b..08e1246935 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -462,7 +462,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1253,10 +1253,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 6f2963c37b..bdf73c02d0 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -462,7 +462,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1247,10 +1247,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 5b4436647e..db683c539c 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -462,7 +462,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1250,10 +1250,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 9ec47259dd..f9b9459cb6 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -451,7 +451,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1250,10 +1250,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 646c894163..102490e205 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -460,7 +460,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1252,10 +1252,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 2ad761ce59..2328949874 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -423,7 +423,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1167,10 +1167,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 4d8b04e38c..d8aadd709f 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -410,7 +410,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // To use a separate Z probe, your board must define a Z_MIN_PROBE_PIN. // // For a servo-based Z probe, you must set up servo support below, including -// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and SERVO_ENDSTOP_ANGLES. +// NUM_SERVOS, Z_ENDSTOP_SERVO_NR and Z_SERVO_ANGLES. // // - RAMPS 1.3/1.4 boards may be able to use the 5V, GND, and Aux4->D32 pin. // - Use 5V for powered (usu. inductive) sensors. @@ -1158,10 +1158,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo // This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes. // Use M851 to set the Z probe vertical offset from the nozzle. Store that setting with M500. // -//#define X_ENDSTOP_SERVO_NR 1 -//#define Y_ENDSTOP_SERVO_NR 2 //#define Z_ENDSTOP_SERVO_NR 0 -//#define SERVO_ENDSTOP_ANGLES {{0,0}, {0,0}, {70,0}} // X,Y,Z Axis Extend and Retract angles +//#define Z_SERVO_ANGLES {70,0} // Z Servo Extend and Retract angles // Servo deactivation // From 1bed392c682f1f053fafb94ca51136f4f0003084 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 16 Jun 2016 18:15:48 -0700 Subject: [PATCH 2/3] HAS_Z_ENDSTOP_SERVO => HAS_Z_SERVO_ENDSTOP --- Marlin/Conditionals.h | 6 +++--- Marlin/Marlin_main.cpp | 40 ++++++++++++++++++++-------------------- Marlin/SanityCheck.h | 12 ++++++------ 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 4987e0055b..dba97862c6 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -373,8 +373,8 @@ #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER)) #endif - #define HAS_Z_ENDSTOP_SERVO (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0) - #define SERVO_LEVELING (ENABLED(AUTO_BED_LEVELING_FEATURE) && HAS_Z_ENDSTOP_SERVO) + #define HAS_Z_SERVO_ENDSTOP (defined(Z_ENDSTOP_SERVO_NR) && Z_ENDSTOP_SERVO_NR >= 0) + #define SERVO_LEVELING (ENABLED(AUTO_BED_LEVELING_FEATURE) && HAS_Z_SERVO_ENDSTOP) /** * Sled Options @@ -769,7 +769,7 @@ #endif #endif - #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED)) + #define PROBE_SELECTED (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED)) #define PROBE_PIN_CONFIGURED (HAS_Z_MIN_PROBE_PIN || (HAS_Z_MIN && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN))) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 26525d8568..8d5361659f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -391,7 +391,7 @@ static uint8_t target_extruder; }; #endif -#if HAS_Z_ENDSTOP_SERVO +#if HAS_Z_SERVO_ENDSTOP const int z_servo_angle[2] = Z_SERVO_ANGLES; #endif @@ -746,7 +746,7 @@ void servo_init() { servo[3].detach(); #endif - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP endstops.enable_z_probe(false); @@ -760,7 +760,7 @@ void servo_init() { * */ STOW_Z_SERVO(); - #endif // HAS_Z_ENDSTOP_SERVO + #endif // HAS_Z_SERVO_ENDSTOP } @@ -1829,7 +1829,7 @@ static void setup_for_endstop_move() { if (endstops.z_probe_enabled) return; - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP // Engage Z Servo endstop if enabled DEPLOY_Z_SERVO(); @@ -1916,7 +1916,7 @@ static void setup_for_endstop_move() { } static void stow_z_probe(bool doRaise = true) { - #if !(HAS_Z_ENDSTOP_SERVO && (Z_RAISE_AFTER_PROBING > 0)) + #if !(HAS_Z_SERVO_ENDSTOP && (Z_RAISE_AFTER_PROBING > 0)) UNUSED(doRaise); #endif #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -1925,7 +1925,7 @@ static void setup_for_endstop_move() { if (!endstops.z_probe_enabled) return; - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP // Retract Z Servo endstop if enabled #if Z_RAISE_AFTER_PROBING > 0 @@ -2156,7 +2156,7 @@ static void setup_for_endstop_move() { #endif // DELTA - #if HAS_Z_ENDSTOP_SERVO && DISABLED(Z_PROBE_SLED) + #if HAS_Z_SERVO_ENDSTOP /** * Raise Z to a minimum height to make room for a servo to move @@ -2283,7 +2283,7 @@ static void homeaxis(AxisEnum axis) { #define _Z_STOW (stow_z_probe()) #define _Z_SERVO_TEST (axis != Z_AXIS) // already deployed Z #define _Z_SERVO_SUBTEST false // Z will never be invoked - #elif HAS_Z_ENDSTOP_SERVO + #elif HAS_Z_SERVO_ENDSTOP #define _Z_DEPLOY do{ raise_z_for_servo(Z_RAISE_BEFORE_PROBING); DEPLOY_Z_SERVO(); endstops.z_probe_enabled = true; }while(0) #define _Z_STOW do{ raise_z_for_servo(Z_RAISE_AFTER_PROBING); STOW_Z_SERVO(); endstops.z_probe_enabled = false; }while(0) #define _Z_SERVO_TEST true // Z not deployed yet @@ -2291,7 +2291,7 @@ static void homeaxis(AxisEnum axis) { #endif // Homing Z towards the bed? Deploy the Z probe or endstop. - #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_ENDSTOP_SERVO + #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_SERVO_ENDSTOP if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_DEPLOY)); @@ -2414,7 +2414,7 @@ static void homeaxis(AxisEnum axis) { axis_homed[axis] = true; // Put away the Z probe - #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_ENDSTOP_SERVO + #if ENABLED(Z_PROBE_SLED) || SERVO_LEVELING || ENABLED(FIX_MOUNTED_PROBE) || HAS_Z_SERVO_ENDSTOP if (axis == Z_AXIS && axis_home_dir < 0) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> SERVO_LEVELING > " STRINGIFY(_Z_STOW)); @@ -3764,7 +3764,7 @@ inline void gcode_G28() { #endif current_position[Z_AXIS] = -zprobe_zoffset + (z_tmp - real_z) - #if HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) + #if HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) + Z_RAISE_AFTER_PROBING #endif ; @@ -3779,7 +3779,7 @@ inline void gcode_G28() { // Sled assembly for Cartesian bots #if ENABLED(Z_PROBE_SLED) dock_sled(true); // dock the sled - #elif !HAS_Z_ENDSTOP_SERVO && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) + #elif !HAS_Z_SERVO_ENDSTOP && DISABLED(Z_PROBE_ALLEN_KEY) && DISABLED(Z_PROBE_SLED) // Raise Z axis for non-delta and non servo based probes raise_z_after_probing(); #endif @@ -3823,7 +3823,7 @@ inline void gcode_G28() { * G30: Do a single Z probe at the current XY */ inline void gcode_G30() { - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP raise_z_for_servo(Z_RAISE_BEFORE_PROBING); #endif deploy_z_probe(); // Engage Z Servo endstop if available. Z_PROBE_SLED is missed here. @@ -3845,7 +3845,7 @@ inline void gcode_G28() { clean_up_after_endstop_move(); // Too early. must be done after the stowing. - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP raise_z_for_servo(Z_RAISE_AFTER_PROBING); #endif stow_z_probe(false); // Retract Z Servo endstop if available. Z_PROBE_SLED is missed here. @@ -5980,13 +5980,13 @@ inline void gcode_M303() { */ inline void gcode_M400() { stepper.synchronize(); } -#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(Z_PROBE_SLED) && (HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_ALLEN_KEY)) +#if ENABLED(AUTO_BED_LEVELING_FEATURE) && DISABLED(Z_PROBE_SLED) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_ALLEN_KEY)) /** * M401: Engage Z Servo endstop if available */ inline void gcode_M401() { - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP raise_z_for_servo(Z_RAISE_BEFORE_PROBING); #endif deploy_z_probe(); @@ -5996,13 +5996,13 @@ inline void gcode_M400() { stepper.synchronize(); } * M402: Retract Z Servo endstop if enabled */ inline void gcode_M402() { - #if HAS_Z_ENDSTOP_SERVO + #if HAS_Z_SERVO_ENDSTOP raise_z_for_servo(Z_RAISE_AFTER_PROBING); #endif stow_z_probe(false); } -#endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_ENDSTOP_SERVO || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED +#endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_SERVO_ENDSTOP || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED #if ENABLED(FILAMENT_WIDTH_SENSOR) @@ -7299,14 +7299,14 @@ void process_next_command() { gcode_M400(); break; - #if ENABLED(AUTO_BED_LEVELING_FEATURE) && (HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_ALLEN_KEY)) && DISABLED(Z_PROBE_SLED) + #if ENABLED(AUTO_BED_LEVELING_FEATURE) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_ALLEN_KEY)) && DISABLED(Z_PROBE_SLED) case 401: gcode_M401(); break; case 402: gcode_M402(); break; - #endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_ENDSTOP_SERVO || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED + #endif // AUTO_BED_LEVELING_FEATURE && (HAS_Z_SERVO_ENDSTOP || Z_PROBE_ALLEN_KEY) && !Z_PROBE_SLED #if ENABLED(FILAMENT_WIDTH_SENSOR) case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 5aea3663c0..bc3bf650bc 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -173,7 +173,7 @@ #if defined(NUM_SERVOS) && NUM_SERVOS > 0 #if NUM_SERVOS > 4 #error "The maximum number of SERVOS in Marlin is 4." - #elif HAS_Z_ENDSTOP_SERVO && Z_ENDSTOP_SERVO_NR >= NUM_SERVOS + #elif HAS_Z_SERVO_ENDSTOP && Z_ENDSTOP_SERVO_NR >= NUM_SERVOS #error "Z_ENDSTOP_SERVO_NR must be smaller than NUM_SERVOS." #endif #endif @@ -181,7 +181,7 @@ /** * Servo deactivation depends on servo endstops */ -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_ENDSTOP_SERVO +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && !HAS_Z_SERVO_ENDSTOP #error "Z_ENDSTOP_SERVO_NR is required for DEACTIVATE_SERVOS_AFTER_MOVE." #endif @@ -246,10 +246,10 @@ /** * Only allow one probe option to be defined */ - #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED))) \ - || (ENABLED(MECHANICAL_PROBE) && (ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED))) \ - || (ENABLED(Z_PROBE_ALLEN_KEY) && (HAS_Z_ENDSTOP_SERVO || ENABLED(Z_PROBE_SLED))) \ - || (HAS_Z_ENDSTOP_SERVO && ENABLED(Z_PROBE_SLED)) + #if (ENABLED(FIX_MOUNTED_PROBE) && (ENABLED(MECHANICAL_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ + || (ENABLED(MECHANICAL_PROBE) && (ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ + || (ENABLED(Z_PROBE_ALLEN_KEY) && (HAS_Z_SERVO_ENDSTOP || ENABLED(Z_PROBE_SLED))) \ + || (HAS_Z_SERVO_ENDSTOP && ENABLED(Z_PROBE_SLED)) #error "Please define only one type of probe: Z Servo, MECHANICAL_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or FIX_MOUNTED_PROBE." #endif From e189f6a8428e84993e624b81c1cef4f210a12ccd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 16 Jun 2016 19:26:30 -0700 Subject: [PATCH 3/3] Patch Travis test for bed leveling --- .travis.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 89459cbe72..40a6525234 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,10 +90,11 @@ script: - opt_enable PIDTEMPBED - build_marlin # - # Test AUTO_BED_LEVELING & DEBUG_LEVELING_FEATURE + # Test AUTO_BED_LEVELING_FEATURE & DEBUG_LEVELING_FEATURE with a Servo Probe # - restore_configs - - opt_enable ENABLE_AUTO_BED_LEVELING DEBUG_LEVELING_FEATURE + - opt_enable AUTO_BED_LEVELING_FEATURE DEBUG_LEVELING_FEATURE + - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE - build_marlin # # Test MESH_BED_LEVELING feature, with LCD @@ -102,11 +103,6 @@ script: - opt_enable MESH_BED_LEVELING MESH_G28_REST_ORIGIN MANUAL_BED_LEVELING ULTIMAKERCONTROLLER - build_marlin # - # Test AUTO_BED_LEVELING & DEBUG_LEVELING_FEATURE with Servos - # - - opt_enable NUM_SERVOS Z_ENDSTOP_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE - - build_marlin - # # Test EEPROM_SETTINGS, EEPROM_CHITCHAT, M100_FREE_MEMORY_WATCHER, # INCH_MODE_SUPPORT, TEMPERATURE_UNITS_SUPPORT #