Skip to content

Commit ea70b63

Browse files
marciotthinkyhead
authored andcommitted
✨ Z_PROBE_ERROR_TOLERANCE (expose) (MarlinFirmware#26229)
Co-authored-by: Scott Lahteine <[email protected]>
1 parent 9f4269c commit ea70b63

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Marlin/Configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,7 @@
16361636
#define Z_CLEARANCE_DEPLOY_PROBE 10 // (mm) Z Clearance for Deploy/Stow
16371637
#define Z_CLEARANCE_BETWEEN_PROBES 5 // (mm) Z Clearance between probe points
16381638
#define Z_CLEARANCE_MULTI_PROBE 5 // (mm) Z Clearance between multiple probes
1639+
#define Z_PROBE_ERROR_TOLERANCE 3 // (mm) Tolerance for early trigger (<= -probe.offset.z + ZPET)
16391640
//#define Z_AFTER_PROBING 5 // (mm) Z position after probing is done
16401641

16411642
#define Z_PROBE_LOW_POINT -2 // (mm) Farthest distance below the trigger-point to go before stopping

Marlin/src/inc/Conditionals_LCD.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,9 @@
14451445
#ifndef Z_CLEARANCE_MULTI_PROBE
14461446
#define Z_CLEARANCE_MULTI_PROBE 5
14471447
#endif
1448+
#ifndef Z_PROBE_ERROR_TOLERANCE
1449+
#define Z_PROBE_ERROR_TOLERANCE Z_CLEARANCE_MULTI_PROBE
1450+
#endif
14481451
#if MULTIPLE_PROBING > 1
14491452
#if EXTRA_PROBING > 0
14501453
#define TOTAL_PROBING (MULTIPLE_PROBING + EXTRA_PROBING)
@@ -1459,9 +1462,9 @@
14591462
#undef Z_MIN_PROBE_REPEATABILITY_TEST
14601463
#undef HOMING_Z_WITH_PROBE
14611464
#undef Z_CLEARANCE_MULTI_PROBE
1465+
#undef Z_PROBE_ERROR_TOLERANCE
14621466
#undef MULTIPLE_PROBING
14631467
#undef EXTRA_PROBING
1464-
#undef Z_CLEARANCE_DEPLOY_PROBE
14651468
#undef Z_PROBE_OFFSET_RANGE_MIN
14661469
#undef Z_PROBE_OFFSET_RANGE_MAX
14671470
#undef PAUSE_BEFORE_DEPLOY_STOW
@@ -1477,6 +1480,9 @@
14771480
#undef NOZZLE_TO_PROBE_OFFSET
14781481
#endif
14791482

1483+
#ifndef Z_CLEARANCE_DEPLOY_PROBE
1484+
#define Z_CLEARANCE_DEPLOY_PROBE 10
1485+
#endif
14801486
#ifndef Z_PROBE_LOW_POINT
14811487
#define Z_PROBE_LOW_POINT -5
14821488
#endif

Marlin/src/module/probe.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
735735
*
736736
* @param sanity_check Flag to compare the probe result with the expected result
737737
* based on the probe Z offset. If the result is too far away
738-
* (more than 2mm too early) then consider it an error.
738+
* (more than Z_PROBE_ERROR_TOLERANCE too early) then throw an error.
739739
* @param z_min_point Override the minimum probing height (-2mm), to allow deeper probing.
740740
* @param z_clearance Z clearance to apply on probe failure.
741741
*
@@ -747,7 +747,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/, const_float_t z_min_p
747747
const float zoffs = SUM_TERN(HAS_HOTEND_OFFSET, -offset.z, hotend_offset[active_extruder].z);
748748

749749
auto try_to_probe = [&](PGM_P const plbl, const_float_t z_probe_low_point, const feedRate_t fr_mm_s, const bool scheck) -> bool {
750-
constexpr float error_tolerance = 2.0f;
750+
constexpr float error_tolerance = Z_PROBE_ERROR_TOLERANCE;
751751
if (DEBUGGING(LEVELING)) {
752752
DEBUG_ECHOPGM_P(plbl);
753753
DEBUG_ECHOLNPGM("> try_to_probe(..., ", z_probe_low_point, ", ", fr_mm_s, ", ...)");

0 commit comments

Comments
 (0)