probe_eddy_current: Support TAP_THRESHOLD parameter on "tap" probes
Some checks failed
Build test / build (push) Has been cancelled

Allow the "tap_threshold" to be overriden during PROBE type commands.
This makes it easier to calibrate an initial tap_threshold.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2026-02-23 20:55:33 -05:00
parent 391834ba12
commit 0624cce4b3
4 changed files with 19 additions and 8 deletions

View file

@ -2326,9 +2326,16 @@ sensor_type: ldc1612
#samples_tolerance:
#samples_tolerance_retries:
# See the "probe" section for information on these parameters.
#tap_threshold: 0
# Noise cutoff/stop trigger threshold delta Hz per sample
# See the Eddy_Probe.md for explanation
#tap_threshold:
# Noise cutoff/stop trigger threshold (in Hz). Specify this value to
# enable support for "METHOD=tap" probe commands. See Eddy_Probe.md
# for more information. Larger values make the tap detection less
# sensitive. That is, larger values make it less likely the toolhead
# will incorrectly stop early due to noise, while increasing the
# risk of the toolhead not correctly stopping when it first contacts
# the bed. If this value is specified then one may override its
# value at run-time using the "TAP_THRESHOLD" parameter on probe
# commands. The default is to not enable support for "tap" probing.
```
### [axis_twist_compensation]

View file

@ -123,7 +123,6 @@ and that upon collision it always decreases by at least this value.
#samples: 3
#samples_tolerance: 0.025
#samples_tolerance_retries: 3
tap_threshold: 0 # 0 means tap is disabled
```
Before setting it to any other value, it is necessary to install `scipy`:

View file

@ -1247,6 +1247,9 @@ additional parameters if a `[probe_eddy_current]` section is defined:
using `METHOD=rapid_scan` this specifies the measurement time window
at each target. If not specified, the default is 0.100 (which is
100ms).
- `TAP_THRESHOLD=<value>`: This overrides the `tap_threshold`
specified in the `[probe_eddy_current]` config section when probing
using `METHOD=tap`.
#### PROBE_EDDY_CURRENT_CALIBRATE
`PROBE_EDDY_CURRENT_CALIBRATE CHIP=<config_name>`: This starts a tool

View file

@ -486,7 +486,7 @@ class EddyTap:
self._z_min_position = probe.lookup_minimum_z(config)
self._gather = None
self._filter_design = None
self._tap_threshold = config.getfloat('tap_threshold', 0., minval=0.)
self._tap_threshold = config.getfloat('tap_threshold', 0., above=0.)
if self._tap_threshold:
self._setup_tap()
# Setup for "tap" probe request
@ -503,7 +503,7 @@ class EddyTap:
mcu = self._sensor_helper.get_mcu()
sos_filter = trigger_analog.MCU_SosFilter(mcu, cmd_queue, 5)
self._trigger_analog.setup_sos_filter(sos_filter)
def _prep_trigger_analog_tap(self):
def _prep_trigger_analog_tap(self, gcmd):
if not self._tap_threshold:
raise self._printer.command_error("Tap not configured")
sos_filter = self._trigger_analog.get_sos_filter()
@ -511,7 +511,9 @@ class EddyTap:
sos_filter.set_offset_scale(0, 1., auto_offset=True)
self._trigger_analog.set_raw_range(0, MAX_VALID_RAW_VALUE)
convert_frequency = self._sensor_helper.convert_frequency
raw_threshold = convert_frequency(self._tap_threshold)
tap_threshold = gcmd.get_float("TAP_THRESHOLD",
self._tap_threshold, above=0.)
raw_threshold = convert_frequency(tap_threshold)
self._trigger_analog.set_trigger('diff_peak_gt', raw_threshold)
# Measurement analysis to determine "tap" position
def _validate_samples_time(self, measures, start_time, end_time):
@ -572,7 +574,7 @@ class EddyTap:
trig_pos[0], trig_pos[1], trig_pos[2])
# Probe session interface
def start_probe_session(self, gcmd):
self._prep_trigger_analog_tap()
self._prep_trigger_analog_tap(gcmd)
self._gather = EddyGatherSamples(self._printer, self._sensor_helper)
return self
def run_probe(self, gcmd):