From 0e410c9dfd98e6857fc8f3ab8a5356bcf55480a9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 16 Mar 2017 20:03:57 -0500 Subject: [PATCH] Software endstop options as simple switches --- Marlin/Conditionals_LCD.h | 2 +- Marlin/Configuration.h | 13 +++++++------ Marlin/Marlin_main.cpp | 8 ++++---- Marlin/SanityCheck.h | 2 ++ .../example_configurations/Cartesio/Configuration.h | 13 +++++++------ Marlin/example_configurations/Felix/Configuration.h | 11 ++++++----- .../Felix/DUAL/Configuration.h | 13 +++++++------ .../Hephestos/Configuration.h | 13 +++++++------ .../Hephestos_2/Configuration.h | 13 +++++++------ Marlin/example_configurations/K8200/Configuration.h | 13 +++++++------ Marlin/example_configurations/K8400/Configuration.h | 13 +++++++------ .../K8400/Dual-head/Configuration.h | 13 +++++++------ .../RepRapWorld/Megatronics/Configuration.h | 13 +++++++------ .../example_configurations/RigidBot/Configuration.h | 13 +++++++------ Marlin/example_configurations/SCARA/Configuration.h | 13 +++++++------ Marlin/example_configurations/TAZ4/Configuration.h | 13 +++++++------ .../example_configurations/WITBOX/Configuration.h | 13 +++++++------ .../adafruit/ST7565/Configuration.h | 13 +++++++------ .../delta/flsun_kossel_mini/Configuration.h | 13 +++++++------ .../delta/generic/Configuration.h | 13 +++++++------ .../delta/kossel_mini/Configuration.h | 13 +++++++------ .../delta/kossel_pro/Configuration.h | 13 +++++++------ .../delta/kossel_xl/Configuration.h | 13 +++++++------ .../example_configurations/makibox/Configuration.h | 13 +++++++------ .../tvrrug/Round2/Configuration.h | 13 +++++++------ Marlin/ultralcd.cpp | 4 ++-- 26 files changed, 162 insertions(+), 138 deletions(-) diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h index 0949dcee9..318a7834f 100644 --- a/Marlin/Conditionals_LCD.h +++ b/Marlin/Conditionals_LCD.h @@ -369,6 +369,6 @@ #undef Z_MIN_PROBE_ENDSTOP #endif - #define HAS_SOFTWARE_ENDSTOPS (ENABLED(min_software_endstops) || ENABLED(max_software_endstops)) + #define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS)) #endif //CONDITIONALS_LCD_H diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 541c52d08..11c05018d 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -705,16 +705,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -725,6 +721,11 @@ #define Y_MAX_POS 200 #define Z_MAX_POS 200 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index f4925d36f..8a99326d9 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7889,7 +7889,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n && (delayed_move_time || current_position[X_AXIS] != xhome) ) { float raised_z = current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT; - #if ENABLED(max_software_endstops) + #if ENABLED(MAX_SOFTWARE_ENDSTOPS) NOMORE(raised_z, soft_endstop_max[Z_AXIS]); #endif #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -7940,7 +7940,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n // record raised toolhead position for use by unpark COPY(raised_parked_position, current_position); raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT; - #if ENABLED(max_software_endstops) + #if ENABLED(MAX_SOFTWARE_ENDSTOPS) NOMORE(raised_parked_position[Z_AXIS], soft_endstop_max[Z_AXIS]); #endif active_extruder_parked = true; @@ -8983,12 +8983,12 @@ void ok_to_send() { */ void clamp_to_software_endstops(float target[XYZ]) { if (!soft_endstops_enabled) return; - #if ENABLED(min_software_endstops) + #if ENABLED(MIN_SOFTWARE_ENDSTOPS) NOLESS(target[X_AXIS], soft_endstop_min[X_AXIS]); NOLESS(target[Y_AXIS], soft_endstop_min[Y_AXIS]); NOLESS(target[Z_AXIS], soft_endstop_min[Z_AXIS]); #endif - #if ENABLED(max_software_endstops) + #if ENABLED(MAX_SOFTWARE_ENDSTOPS) NOMORE(target[X_AXIS], soft_endstop_max[X_AXIS]); NOMORE(target[Y_AXIS], soft_endstop_max[Y_AXIS]); NOMORE(target[Z_AXIS], soft_endstop_max[Z_AXIS]); diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index f144bf909..711e32b10 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -158,6 +158,8 @@ #error "LCD_PIN_RESET is now LCD_RESET_PIN. Please update your pins definitions." #elif defined(EXTRUDER_0_AUTO_FAN_PIN) || defined(EXTRUDER_1_AUTO_FAN_PIN) || defined(EXTRUDER_2_AUTO_FAN_PIN) || defined(EXTRUDER_3_AUTO_FAN_PIN) #error "EXTRUDER_[0123]_AUTO_FAN_PIN is now E[0123]_AUTO_FAN_PIN. Please update your Configuration_adv.h." +#elif defined(min_software_endstops) || defined(max_software_endstops) + #error "(min|max)_software_endstops are now (MIN|MAX)_SOFTWARE_ENDSTOPS. Please update your configuration." #endif /** diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 912ecb308..7c9e1f216 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -705,16 +705,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -725,6 +721,11 @@ #define Y_MAX_POS 270 #define Z_MAX_POS 400 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 875aef30d..577637919 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -688,16 +688,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN +// Direction of endstops when homing; 1=MAX, -1=MIN // :[-1, 1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -708,6 +704,11 @@ #define Y_MAX_POS 205 #define Z_MAX_POS 235 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 7f82de728..c4858da72 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -688,16 +688,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -708,6 +704,11 @@ #define Y_MAX_POS 205 #define Z_MAX_POS 235 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index 52c968b4f..6c3a4cdd1 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -697,16 +697,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -717,6 +713,11 @@ #define Y_MAX_POS 210 #define Z_MAX_POS 180 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 0e009becc..2d805a3e7 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -699,16 +699,12 @@ #define Z_HOMING_HEIGHT 5 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -719,6 +715,11 @@ #define Y_MAX_POS 297 #define Z_MAX_POS 210 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index dcc2f3a4e..e160c2d67 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -734,16 +734,12 @@ #define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -754,6 +750,11 @@ #define Y_MAX_POS 200 #define Z_MAX_POS 200 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 83f3074aa..28738bd7a 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -705,16 +705,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -725,6 +721,11 @@ #define Y_MAX_POS 200 #define Z_MAX_POS 190 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 3b1dd25e9..a70f637fc 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -705,16 +705,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -725,6 +721,11 @@ #define Y_MAX_POS 200 #define Z_MAX_POS 190 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index c2daa8b79..f3fe5a604 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -705,16 +705,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -725,6 +721,11 @@ #define Y_MAX_POS 200 #define Z_MAX_POS 200 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 760ddce5d..ac65922db 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -704,16 +704,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -724,6 +720,11 @@ #define Y_MAX_POS 248 // RigidBot regular is 248mm, RigitBot Big is 304mm #define Z_MAX_POS 254 // RigidBot regular and Big are 254mm +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index e10f0fa39..73efa36ef 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -720,16 +720,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR 1 #define Y_HOME_DIR 1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -740,6 +736,11 @@ #define Y_MAX_POS 200 #define Z_MAX_POS 225 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 0bac6f981..613c15bc2 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -726,16 +726,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -746,6 +742,11 @@ #define Y_MAX_POS 275 #define Z_MAX_POS 250 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 7ec857850..2c57ac958 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -697,16 +697,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR 1 #define Y_HOME_DIR 1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -717,6 +713,11 @@ #define Y_MAX_POS 210 #define Z_MAX_POS 200 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 96f997c3f..736996fcd 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -705,16 +705,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -725,6 +721,11 @@ #define Y_MAX_POS 200 #define Z_MAX_POS 200 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h index 64e09796a..c0e235610 100644 --- a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h @@ -807,16 +807,12 @@ #define Z_HOMING_HEIGHT 15 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR 1 // deltas always home to max #define Y_HOME_DIR 1 #define Z_HOME_DIR 1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -827,6 +823,11 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 271b42a64..3ad12adb2 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -791,16 +791,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR 1 // deltas always home to max #define Y_HOME_DIR 1 #define Z_HOME_DIR 1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -811,6 +807,11 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index dde95b82f..c7df7807e 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -794,16 +794,12 @@ //#define Z_HOMING_HEIGHT 15 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR 1 // deltas always home to max #define Y_HOME_DIR 1 #define Z_HOME_DIR 1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -814,6 +810,11 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 58b4fade3..f45bc4867 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -793,16 +793,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR 1 // deltas always home to max #define Y_HOME_DIR 1 #define Z_HOME_DIR 1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -813,6 +809,11 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 37fb2718a..d684b9dc7 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -797,16 +797,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR 1 // deltas always home to max #define Y_HOME_DIR 1 #define Z_HOME_DIR 1 -#define min_software_endstops false // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -817,6 +813,11 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// If enabled, axes won't move below MIN_POS in response to movement commands. +//#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 2d2f09f0a..9cbfde94b 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -708,16 +708,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -728,6 +724,11 @@ #define Y_MAX_POS 150 #define Z_MAX_POS 86 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 4e3b10daf..1f984aa89 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -701,16 +701,12 @@ //#define Z_HOMING_HEIGHT 4 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. -// ENDSTOP SETTINGS: -// Sets direction of endstops when homing; 1=MAX, -1=MIN -// :[-1, 1] +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below. - // @section machine // Travel limits after homing (units are in mm) @@ -721,6 +717,11 @@ #define Y_MAX_POS 205 #define Z_MAX_POS 120 +// If enabled, axes won't move below MIN_POS in response to movement commands. +#define MIN_SOFTWARE_ENDSTOPS +// If enabled, axes won't move above MAX_POS in response to movement commands. +#define MAX_SOFTWARE_ENDSTOPS + /** * Filament Runout Sensor * A mechanical or opto endstop is used to check for the presence of filament. diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 1d9531543..505c0fef0 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1602,10 +1602,10 @@ KeepDrawing: #if HAS_SOFTWARE_ENDSTOPS // Limit to software endstops, if enabled if (soft_endstops_enabled) { - #if ENABLED(min_software_endstops) + #if ENABLED(MIN_SOFTWARE_ENDSTOPS) min = soft_endstop_min[axis]; #endif - #if ENABLED(max_software_endstops) + #if ENABLED(MAX_SOFTWARE_ENDSTOPS) max = soft_endstop_max[axis]; #endif }