From d8ec9938fc80b698a7808d2c36bf0e58a3926255 Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Sat, 19 Aug 2023 09:34:10 -0600 Subject: [PATCH] Enabled safety stops in Marlin config. --- .../Gladiola_SingleExtruder/Configuration.h | 6 +-- .../Configuration_summary.txt | 5 ++- .../Configuration.h | 2 +- .../Configuration_summary.txt | 5 ++- .../Tilapia_SingleExtruder/Configuration.h | 2 +- .../Configuration_summary.txt | 1 + .../Tilapia_SingleExtruder/Configuration.h | 6 +-- .../Configuration_summary.txt | 3 ++ .../Quiver_DualExtruder/Configuration.h | 2 +- .../Configuration_summary.txt | 3 +- .../Configuration.h | 2 +- .../Configuration_summary.txt | 3 +- config/examples/build-config.js | 41 +++++++++++++------ 13 files changed, 54 insertions(+), 27 deletions(-) diff --git a/config/examples/AlephObjects/standard/Gladiola_Mini/Gladiola_SingleExtruder/Configuration.h b/config/examples/AlephObjects/standard/Gladiola_Mini/Gladiola_SingleExtruder/Configuration.h index deb9e3fc9333..95d6d2e96699 100644 --- a/config/examples/AlephObjects/standard/Gladiola_Mini/Gladiola_SingleExtruder/Configuration.h +++ b/config/examples/AlephObjects/standard/Gladiola_Mini/Gladiola_SingleExtruder/Configuration.h @@ -1772,9 +1772,9 @@ * If an axis has endstops on both ends the one specified above is used for * homing, while the other can be used for things like SD_ABORT_ON_ENDSTOP_HIT. */ -//#define X_SAFETY_STOP -//#define Y_SAFETY_STOP -//#define Z_SAFETY_STOP +#define X_SAFETY_STOP // <-- changed +#define Y_SAFETY_STOP // <-- changed +#define Z_SAFETY_STOP // <-- changed //#define I_SAFETY_STOP //#define J_SAFETY_STOP //#define K_SAFETY_STOP diff --git a/config/examples/AlephObjects/standard/Gladiola_Mini/Gladiola_SingleExtruder/Configuration_summary.txt b/config/examples/AlephObjects/standard/Gladiola_Mini/Gladiola_SingleExtruder/Configuration_summary.txt index a86b075a22b6..3d9900fcfdcf 100644 --- a/config/examples/AlephObjects/standard/Gladiola_Mini/Gladiola_SingleExtruder/Configuration_summary.txt +++ b/config/examples/AlephObjects/standard/Gladiola_Mini/Gladiola_SingleExtruder/Configuration_summary.txt @@ -158,6 +158,7 @@ #define X_MAX_POS 165.8 #define X_MIN_ENDSTOP_HIT_STATE LOW #define X_MIN_POS 0 +#define X_SAFETY_STOP #define Y_BED_SIZE 155.8 #define Y_DRIVER_TYPE A4988 #define Y_HOME_DIR 1 @@ -165,6 +166,7 @@ #define Y_MAX_POS 196 #define Y_MIN_ENDSTOP_HIT_STATE LOW #define Y_MIN_POS -8 +#define Y_SAFETY_STOP #define Z_CLEARANCE_BETWEEN_PROBES 5 #define Z_CLEARANCE_DEPLOY_PROBE 5 #define Z_CLEARANCE_FOR_HOMING 4 @@ -181,4 +183,5 @@ #define Z_PROBE_FEEDRATE_SLOW 60 #define Z_PROBE_LOW_POINT -5 #define Z_PROBE_OFFSET_RANGE_MAX 5 -#define Z_PROBE_OFFSET_RANGE_MIN -2 \ No newline at end of file +#define Z_PROBE_OFFSET_RANGE_MIN -2 +#define Z_SAFETY_STOP \ No newline at end of file diff --git a/config/examples/AlephObjects/standard/Hibiscus_Mini2/CecropiaSilk_SingleExtruderAeroV2/Configuration.h b/config/examples/AlephObjects/standard/Hibiscus_Mini2/CecropiaSilk_SingleExtruderAeroV2/Configuration.h index c172aea4ab13..01e90d4fb35f 100644 --- a/config/examples/AlephObjects/standard/Hibiscus_Mini2/CecropiaSilk_SingleExtruderAeroV2/Configuration.h +++ b/config/examples/AlephObjects/standard/Hibiscus_Mini2/CecropiaSilk_SingleExtruderAeroV2/Configuration.h @@ -1774,7 +1774,7 @@ */ //#define X_SAFETY_STOP //#define Y_SAFETY_STOP -//#define Z_SAFETY_STOP +#define Z_SAFETY_STOP // <-- changed //#define I_SAFETY_STOP //#define J_SAFETY_STOP //#define K_SAFETY_STOP diff --git a/config/examples/AlephObjects/standard/Hibiscus_Mini2/CecropiaSilk_SingleExtruderAeroV2/Configuration_summary.txt b/config/examples/AlephObjects/standard/Hibiscus_Mini2/CecropiaSilk_SingleExtruderAeroV2/Configuration_summary.txt index 3208baac1440..6bf4df3219cf 100644 --- a/config/examples/AlephObjects/standard/Hibiscus_Mini2/CecropiaSilk_SingleExtruderAeroV2/Configuration_summary.txt +++ b/config/examples/AlephObjects/standard/Hibiscus_Mini2/CecropiaSilk_SingleExtruderAeroV2/Configuration_summary.txt @@ -226,6 +226,7 @@ #define X_MIN_ENDSTOP_HIT_STATE LOW #define X_MIN_POS -3 #define X_RSENSE 0.12 +//#define X_SAFETY_STOP #define X_STALL_SENSITIVITY 4 #define Y_BED_SIZE 157 #define Y_CURRENT 920 @@ -237,6 +238,7 @@ #define Y_MIN_ENDSTOP_HIT_STATE HIGH #define Y_MIN_POS -5 #define Y_RSENSE 0.12 +//#define Y_SAFETY_STOP #define Y_STALL_SENSITIVITY 4 #define Z_CLEARANCE_BETWEEN_PROBES 5 #define Z_CLEARANCE_DEPLOY_PROBE 5 @@ -257,4 +259,5 @@ #define Z_PROBE_LOW_POINT -5 #define Z_PROBE_OFFSET_RANGE_MAX 5 #define Z_PROBE_OFFSET_RANGE_MIN -2 -#define Z_RSENSE 0.12 \ No newline at end of file +#define Z_RSENSE 0.12 +#define Z_SAFETY_STOP \ No newline at end of file diff --git a/config/examples/AlephObjects/standard/Juniper_TAZ5/Tilapia_SingleExtruder/Configuration.h b/config/examples/AlephObjects/standard/Juniper_TAZ5/Tilapia_SingleExtruder/Configuration.h index 9bb94bc0ce02..072e08117110 100644 --- a/config/examples/AlephObjects/standard/Juniper_TAZ5/Tilapia_SingleExtruder/Configuration.h +++ b/config/examples/AlephObjects/standard/Juniper_TAZ5/Tilapia_SingleExtruder/Configuration.h @@ -1774,7 +1774,7 @@ */ //#define X_SAFETY_STOP //#define Y_SAFETY_STOP -//#define Z_SAFETY_STOP +#define Z_SAFETY_STOP // <-- changed //#define I_SAFETY_STOP //#define J_SAFETY_STOP //#define K_SAFETY_STOP diff --git a/config/examples/AlephObjects/standard/Juniper_TAZ5/Tilapia_SingleExtruder/Configuration_summary.txt b/config/examples/AlephObjects/standard/Juniper_TAZ5/Tilapia_SingleExtruder/Configuration_summary.txt index f2afa7e8720f..445c000a5a08 100644 --- a/config/examples/AlephObjects/standard/Juniper_TAZ5/Tilapia_SingleExtruder/Configuration_summary.txt +++ b/config/examples/AlephObjects/standard/Juniper_TAZ5/Tilapia_SingleExtruder/Configuration_summary.txt @@ -183,6 +183,7 @@ #define Z_MIN_POS 0 #define Z_MIN_PROBE_ENDSTOP_HIT_STATE LOW #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN +#define Z_SAFETY_STOP #define Z_SAFE_HOMING #define Z_SAFE_HOMING_X_POINT 10 #define Z_SAFE_HOMING_Y_POINT 10 \ No newline at end of file diff --git a/config/examples/AlephObjects/standard/Oliveoil_TAZ6/Tilapia_SingleExtruder/Configuration.h b/config/examples/AlephObjects/standard/Oliveoil_TAZ6/Tilapia_SingleExtruder/Configuration.h index f3e5427e55ea..03b3821124a8 100644 --- a/config/examples/AlephObjects/standard/Oliveoil_TAZ6/Tilapia_SingleExtruder/Configuration.h +++ b/config/examples/AlephObjects/standard/Oliveoil_TAZ6/Tilapia_SingleExtruder/Configuration.h @@ -1772,9 +1772,9 @@ * If an axis has endstops on both ends the one specified above is used for * homing, while the other can be used for things like SD_ABORT_ON_ENDSTOP_HIT. */ -//#define X_SAFETY_STOP -//#define Y_SAFETY_STOP -//#define Z_SAFETY_STOP +#define X_SAFETY_STOP // <-- changed +#define Y_SAFETY_STOP // <-- changed +#define Z_SAFETY_STOP // <-- changed //#define I_SAFETY_STOP //#define J_SAFETY_STOP //#define K_SAFETY_STOP diff --git a/config/examples/AlephObjects/standard/Oliveoil_TAZ6/Tilapia_SingleExtruder/Configuration_summary.txt b/config/examples/AlephObjects/standard/Oliveoil_TAZ6/Tilapia_SingleExtruder/Configuration_summary.txt index ef4f828575e6..8335d5bb821e 100644 --- a/config/examples/AlephObjects/standard/Oliveoil_TAZ6/Tilapia_SingleExtruder/Configuration_summary.txt +++ b/config/examples/AlephObjects/standard/Oliveoil_TAZ6/Tilapia_SingleExtruder/Configuration_summary.txt @@ -195,6 +195,7 @@ #define X_MAX_POS 301.5 #define X_MIN_ENDSTOP_HIT_STATE HIGH #define X_MIN_POS -20.1 +#define X_SAFETY_STOP #define Y_BED_SIZE 281.4 #define Y_DRIVER_TYPE A4988 #define Y_HOME_DIR 1 @@ -202,6 +203,7 @@ #define Y_MAX_POS 304.5 #define Y_MIN_ENDSTOP_HIT_STATE HIGH #define Y_MIN_POS -20.1 +#define Y_SAFETY_STOP #define Z_CLEARANCE_BETWEEN_PROBES 5 #define Z_CLEARANCE_DEPLOY_PROBE 5 #define Z_CLEARANCE_FOR_HOMING 5 @@ -220,6 +222,7 @@ #define Z_PROBE_LOW_POINT -2 #define Z_PROBE_OFFSET_RANGE_MAX 5 #define Z_PROBE_OFFSET_RANGE_MIN -2 +#define Z_SAFETY_STOP #define Z_SAFE_HOMING #define Z_SAFE_HOMING_X_POINT -19 #define Z_SAFE_HOMING_Y_POINT 258 \ No newline at end of file diff --git a/config/examples/AlephObjects/standard/Quiver_TAZPro/Quiver_DualExtruder/Configuration.h b/config/examples/AlephObjects/standard/Quiver_TAZPro/Quiver_DualExtruder/Configuration.h index 9e94ef8d8a3e..432c3652279c 100644 --- a/config/examples/AlephObjects/standard/Quiver_TAZPro/Quiver_DualExtruder/Configuration.h +++ b/config/examples/AlephObjects/standard/Quiver_TAZPro/Quiver_DualExtruder/Configuration.h @@ -1774,7 +1774,7 @@ */ //#define X_SAFETY_STOP //#define Y_SAFETY_STOP -//#define Z_SAFETY_STOP +#define Z_SAFETY_STOP // <-- changed //#define I_SAFETY_STOP //#define J_SAFETY_STOP //#define K_SAFETY_STOP diff --git a/config/examples/AlephObjects/standard/Quiver_TAZPro/Quiver_DualExtruder/Configuration_summary.txt b/config/examples/AlephObjects/standard/Quiver_TAZPro/Quiver_DualExtruder/Configuration_summary.txt index 6eeae2b8bbaa..5b181f3dfb2e 100644 --- a/config/examples/AlephObjects/standard/Quiver_TAZPro/Quiver_DualExtruder/Configuration_summary.txt +++ b/config/examples/AlephObjects/standard/Quiver_TAZPro/Quiver_DualExtruder/Configuration_summary.txt @@ -268,4 +268,5 @@ #define Z_PROBE_LOW_POINT -2 #define Z_PROBE_OFFSET_RANGE_MAX 5 #define Z_PROBE_OFFSET_RANGE_MIN -2 -#define Z_RSENSE 0.12 \ No newline at end of file +#define Z_RSENSE 0.12 +#define Z_SAFETY_STOP \ No newline at end of file diff --git a/config/examples/AlephObjects/standard/Redgum_TAZWorkhorse/Goldenrod_HardenedExtruder/Configuration.h b/config/examples/AlephObjects/standard/Redgum_TAZWorkhorse/Goldenrod_HardenedExtruder/Configuration.h index 71d369ead19f..514e78e83f9d 100644 --- a/config/examples/AlephObjects/standard/Redgum_TAZWorkhorse/Goldenrod_HardenedExtruder/Configuration.h +++ b/config/examples/AlephObjects/standard/Redgum_TAZWorkhorse/Goldenrod_HardenedExtruder/Configuration.h @@ -1774,7 +1774,7 @@ */ //#define X_SAFETY_STOP //#define Y_SAFETY_STOP -//#define Z_SAFETY_STOP +#define Z_SAFETY_STOP // <-- changed //#define I_SAFETY_STOP //#define J_SAFETY_STOP //#define K_SAFETY_STOP diff --git a/config/examples/AlephObjects/standard/Redgum_TAZWorkhorse/Goldenrod_HardenedExtruder/Configuration_summary.txt b/config/examples/AlephObjects/standard/Redgum_TAZWorkhorse/Goldenrod_HardenedExtruder/Configuration_summary.txt index e5ab04ddd676..594d7ae4ad2c 100644 --- a/config/examples/AlephObjects/standard/Redgum_TAZWorkhorse/Goldenrod_HardenedExtruder/Configuration_summary.txt +++ b/config/examples/AlephObjects/standard/Redgum_TAZWorkhorse/Goldenrod_HardenedExtruder/Configuration_summary.txt @@ -231,4 +231,5 @@ #define Z_PROBE_FEEDRATE_SLOW 60 #define Z_PROBE_LOW_POINT -2 #define Z_PROBE_OFFSET_RANGE_MAX 5 -#define Z_PROBE_OFFSET_RANGE_MIN -2 \ No newline at end of file +#define Z_PROBE_OFFSET_RANGE_MIN -2 +#define Z_SAFETY_STOP \ No newline at end of file diff --git a/config/examples/build-config.js b/config/examples/build-config.js index 363b48f99cd0..2279332d0225 100644 --- a/config/examples/build-config.js +++ b/config/examples/build-config.js @@ -891,23 +891,33 @@ function make_config(PRINTER, TOOLHEAD) { MARLIN["X_HOME_DIR"] = -1 // Home left MARLIN["Y_HOME_DIR"] = 1 // Home bed forward MARLIN["QUICK_HOME"] = true + MARLIN["X_SAFETY_STOP"] = !PRINTER.includes("Hibiscus_Mini2") + MARLIN["Y_SAFETY_STOP"] = !PRINTER.includes("Hibiscus_Mini2") && !USE_BTT_002 + MARLIN["Z_SAFETY_STOP"] = !USE_BTT_002 } else if (PRINTER.includes("Juniper_TAZ5") || PRINTER.includes("Guava_TAZ4")) { MARLIN["X_HOME_DIR"] = -1 // Home left MARLIN["Y_HOME_DIR"] = -1 // Home bed rear MARLIN["QUICK_HOME"] = true + MARLIN["Z_SAFETY_STOP"] = true } else if (PRINTER.includes("Redgum_TAZWorkhorse") || PRINTER.includes("SynDaver_Axi")) { MARLIN["X_HOME_DIR"] = -1 // Home left MARLIN["Y_HOME_DIR"] = -1 // Home bed rear MARLIN["QUICK_HOME"] = true + MARLIN["Z_SAFETY_STOP"] = true } else if (IS_TAZ) { MARLIN["X_HOME_DIR"] = -1 // Home left MARLIN["Y_HOME_DIR"] = 1 // Home bed forward MARLIN["QUICK_HOME"] = true + if(!PRINTER.includes("Quiver_TAZPro")) { + MARLIN["X_SAFETY_STOP"] = true + MARLIN["Y_SAFETY_STOP"] = true + } + MARLIN["Z_SAFETY_STOP"] = true } if (USE_HOME_BUTTON || ["BLTouch", "Inductive"].includes(PROBE_STYLE) || @@ -1325,6 +1335,7 @@ function make_config(PRINTER, TOOLHEAD) { if (TOOLHEAD_IS_UNIVERSAL && USE_Z_SCREW) { MARLIN["USE_XMAX_PLUG"] = false + MARLIN["X_SAFETY_STOP"] = false MARLIN["NO_MOTION_BEFORE_HOMING"] = true ADAPTER_X_OFFSET = 0 ADAPTER_Y_OFFSET = IS_TAZ ? -2.0 : -7.2 @@ -3066,24 +3077,28 @@ function make_config(PRINTER, TOOLHEAD) { MARLIN["TOOLHEAD_TYPE"] = C_STRING(TOOLHEAD_TYPE) - function checkEndstop(u,assertion) { - if(MARLIN.hasOwnProperty(u)) { - if(!assertion) { - console.log("WARNING:", u, "not supported on this version of Marlin"); - } - delete MARLIN[u]; + function checkEndstop(axis) { + function a(s) { + return s.replace("X",axis); + } + if(MARLIN[a("X_HOME_DIR")] == -1) { + if(!ENABLED(a("USE_XMIN_PLUG"))) console.log("WARNING:", a("USE_XMIN_PLUG"), "needs to be enabled"); + if( ENABLED(a("USE_XMAX_PLUG")) && !ENABLED(a("X_SAFETY_STOP"))) console.log("WARNING:", a("X_SAFETY_STOP"), "needs to be enabled"); + if(!ENABLED(a("USE_XMAX_PLUG")) && ENABLED(a("X_SAFETY_STOP"))) console.log("WARNING:", a("X_SAFETY_STOP"), "needs to be disabled"); + } else { + if(!ENABLED(a("USE_XMAX_PLUG"))) console.log("WARNING:", a("USE_XMAX_PLUG"), "needs to be enabled"); + if( ENABLED(a("USE_XMIN_PLUG")) && !ENABLED(a("X_SAFETY_STOP"))) console.log("WARNING:", a("X_SAFETY_STOP"), "needs to be enabled"); + if(!ENABLED(a("USE_XMIN_PLUG")) && ENABLED(a("X_SAFETY_STOP"))) console.log("WARNING:", a("X_SAFETY_STOP"), "needs to be disabled"); } + delete MARLIN[a("USE_XMIN_PLUG")]; + delete MARLIN[a("USE_XMAX_PLUG")]; } // As of https://github.com/MarlinFirmware/Marlin/pull/25748, USE_*_PLUG is no longer used, // but keep it around for now. - checkEndstop("USE_XMIN_PLUG", MARLIN["X_HOME_DIR"] == -1); - checkEndstop("USE_YMIN_PLUG", MARLIN["Y_HOME_DIR"] == -1); - checkEndstop("USE_ZMIN_PLUG", MARLIN["Z_HOME_DIR"] == -1); - checkEndstop("USE_XMAX_PLUG", MARLIN["X_HOME_DIR"] == 1); - checkEndstop("USE_YMAX_PLUG", MARLIN["Y_HOME_DIR"] == 1); - checkEndstop("USE_ZMAX_PLUG", MARLIN["Z_HOME_DIR"] == 1); - + checkEndstop("X"); + checkEndstop("Y"); + checkEndstop("Z"); return MARLIN } /***************************** END OF CONFIGURATION ****************************/