Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLTouch::z_extra_clearance() use probe offset instead of full travel #25655

11 changes: 9 additions & 2 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/bltouch.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class BLTouch {
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(); }
Expand Down
10 changes: 8 additions & 2 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down