From c6e564885e65b9bc4fbc490e62ffb3d743eaa1f0 Mon Sep 17 00:00:00 2001 From: David Fries Date: Tue, 11 Apr 2023 18:37:54 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20BLTOUCH=5FHS=5FEXTRA=5FCLEARANCE=20?= =?UTF-8?q?(#25655)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 11 +++++++++-- Marlin/src/feature/bltouch.h | 2 +- Marlin/src/inc/SanityCheck.h | 10 ++++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index a010480c61..17255d1f25 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -966,6 +966,9 @@ */ //#define BLTOUCH_SET_5V_MODE + // Safety: Enable voltage mode settings in the LCD menu. + //#define BLTOUCH_LCD_VOLTAGE_MENU + /** * Safety: Activate if connecting a probe with an unknown voltage mode. * V3.0: Set a probe into mode selected above at Marlin startup. Required for 5V mode on 3.0 @@ -984,8 +987,12 @@ */ //#define BLTOUCH_HS_MODE true - // Safety: Enable voltage mode settings in the LCD menu. - //#define BLTOUCH_LCD_VOLTAGE_MENU + #if ENABLED(BLTOUCH_HS_MODE) + // The probe Z offset (M851 Z) is the height at which the probe triggers. + // This must be large enough to keep the probe pin off the bed and prevent + // it from snagging on the bed clips. + #define BLTOUCH_HS_EXTRA_CLEARANCE 7 // Extra Z Clearance + #endif #endif // BLTOUCH diff --git a/Marlin/src/feature/bltouch.h b/Marlin/src/feature/bltouch.h index fa857bb96a..2ced649a4e 100644 --- a/Marlin/src/feature/bltouch.h +++ b/Marlin/src/feature/bltouch.h @@ -76,7 +76,7 @@ public: static constexpr bool high_speed_mode = false; #endif - static float z_extra_clearance() { return high_speed_mode ? 7 : 0; } + static float z_extra_clearance() { return high_speed_mode ? TERN0(BLTOUCH_HS_MODE, BLTOUCH_HS_EXTRA_CLEARANCE) : 0; } // DEPLOY and STOW are wrapped for error handling - these are used by homing and by probing static bool deploy() { return deploy_proc(); } diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 7dbd4c765d..5c594abff3 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1895,9 +1895,15 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS #endif #endif - #if ENABLED(BLTOUCH_HS_MODE) && BLTOUCH_HS_MODE == 0 - #error "BLTOUCH_HS_MODE must now be defined as true or false, indicating the default state." + #if ENABLED(BLTOUCH_HS_MODE) + #if BLTOUCH_HS_MODE == 0 + #error "BLTOUCH_HS_MODE must now be defined as true or false, indicating the default state." + #endif + #ifdef BLTOUCH_HS_EXTRA_CLEARANCE + static_assert(BLTOUCH_HS_EXTRA_CLEARANCE > 0, "BLTOUCH_HS_MODE requires a positive BLTOUCH_HS_EXTRA_CLEARANCE."); + #endif #endif + #if BLTOUCH_DELAY < 200 #error "BLTOUCH_DELAY less than 200 is unsafe and is not supported." #endif