probe_eddy_current: Rename config option z_offset to descend_z

The config option 'z_offset' name is confusing as its behavior is
notably different from how other probe hardware uses 'z_offset'.
Rename to 'descend_z' to make its behavior more clear.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor committed 2026-03-24 13:07:19 -04:00
1 parent 7f5e918331
commit 20df766e21
6 files changed
+32 -15

No files matched your search

+1
View File
@@ -50,3 +50,4 @@ frequency: 24000000
i2c_address: 42
i2c_mcu: carto
i2c_bus: i2c1_PB6_PB7
descend_z: 0.5
+4
View File
@@ -8,6 +8,10 @@ All dates in this document are approximate.
## Changes
20260318: The `[probe_eddy_current]` config option `z_offset` has been
renamed to `descend_z`. Using the old name is deprecated and it will
be removed in the near future.
20260214: The `MANUAL_STEPPER` G-Code command `STOP_ON_ENDSTOP`
parameter has changed. See the
[MANUAL_STEPPER](G-Codes.md#manual_stepper) documentation for
+1 -1
View File
@@ -2317,7 +2317,7 @@ sensor_type: ldc1612
#intb_pin:
# MCU gpio pin connected to the ldc1612 sensor's INTB pin (if
# available). The default is to not use the INTB pin.
#z_offset:
#descend_z:
# The nominal distance (in mm) between the nozzle and bed that a
# probing attempt should stop at. This parameter must be provided.
#i2c_address:
+7 -7
View File
@@ -11,7 +11,7 @@ for further details.
Start by declaring a
[probe_eddy_current config section](Config_Reference.md#probe_eddy_current)
in the printer.cfg file. It is recommended to set the `z_offset` to
in the printer.cfg file. It is recommended to set `descend_z` to
0.5mm. It is typical for the sensor to require an `x_offset` and
`y_offset`. If these values are not known, one should estimate the
values during initial calibration.
@@ -42,11 +42,11 @@ tool completes it will output the sensor performance data:
```
probe_eddy_current: noise 0.000642mm, MAD_Hz=11.314 in 2525 queries
Total frequency range: 45000.012 Hz
z_offset: 0.250 # noise 0.000200mm, MAD_Hz=11.000
z_offset: 0.530 # noise 0.000300mm, MAD_Hz=12.000
z_offset: 1.010 # noise 0.000400mm, MAD_Hz=14.000
z_offset: 2.010 # noise 0.000600mm, MAD_Hz=12.000
z_offset: 3.010 # noise 0.000700mm, MAD_Hz=9.000
z: 0.250 # noise 0.000200mm, MAD_Hz=11.000
z: 0.530 # noise 0.000300mm, MAD_Hz=12.000
z: 1.010 # noise 0.000400mm, MAD_Hz=14.000
z: 2.010 # noise 0.000600mm, MAD_Hz=12.000
z: 3.010 # noise 0.000700mm, MAD_Hz=9.000
```
issue a `SAVE_CONFIG` command to save the results to
the printer.cfg and restart.
@@ -167,7 +167,7 @@ calibration routine output:
```
probe_eddy_current: noise 0.000642mm, MAD_Hz=11.314
...
z_offset: 1.010 # noise 0.000400mm, MAD_Hz=14.000
z: 1.010 # noise 0.000400mm, MAD_Hz=14.000
```
The estimation will be:
```
+18 -6
View File
@@ -206,7 +206,7 @@ class EddyCalibration:
for pos, _, mad_hz, mad_mm in filtered:
if len(points) and points[0] <= pos:
points.pop(0)
msg = "z_offset: %.3f # noise %.6fmm, MAD_Hz=%.3f\n" % (
msg = "z: %.3f # noise %.6fmm, MAD_Hz=%.3f\n" % (
pos, mad_mm, mad_hz)
gcode.respond_info(msg)
return filtered
@@ -399,6 +399,12 @@ class EddyDescend:
self._probe_offsets = probe_offsets
self._param_helper = param_helper
self._trigger_analog = trigger_analog
if (config.get('z_offset', None, note_valid=False) is not None
and config.get('descend_z', None, note_valid=False) is None):
config.deprecate('z_offset')
self._descend_z = config.getfloat('z_offset', above=0.)
else:
self._descend_z = config.getfloat('descend_z', above=0.)
self._z_min_position = probe.lookup_minimum_z(config)
self._gather = None
def _prep_trigger_analog(self):
@@ -406,8 +412,7 @@ class EddyDescend:
sos_filter.set_filter_design(None)
sos_filter.set_offset_scale(0, 1.)
self._trigger_analog.set_raw_range(0, MAX_VALID_RAW_VALUE)
z_offset = self._probe_offsets.get_offsets()[2]
trigger_freq = self._calibration.height_to_freq(z_offset)
trigger_freq = self._calibration.height_to_freq(self._descend_z)
conv_freq = self._sensor_helper.convert_frequency(trigger_freq)
self._trigger_analog.set_trigger('gt', conv_freq)
# Probe session interface
@@ -471,8 +476,7 @@ class EddyEndstopWrapper:
def probe_finish(self, hmove):
pass
def get_position_endstop(self):
z_offset = self._eddy_descend._probe_offsets.get_offsets()[2]
return z_offset
return self._eddy_descend._descend_z
# Probing helper for "tap" requests
class EddyTap:
@@ -661,6 +665,14 @@ class EddyScanningProbe:
self._gather.finish()
self._gather = None
# Eddy specific ProbeOffsets class (does not store z_offset)
class EddyProbeOffsets:
def __init__(self, config):
self.x_offset = config.getfloat('x_offset', 0.)
self.y_offset = config.getfloat('y_offset', 0.)
def get_offsets(self, gcmd=None):
return self.x_offset, self.y_offset, 0.
# Main "printer object"
class PrinterEddyProbe:
def __init__(self, config):
@@ -674,7 +686,7 @@ class PrinterEddyProbe:
trig_analog = trigger_analog.MCU_trigger_analog(self.sensor_helper)
probe.LookupZSteppers(config, trig_analog.get_dispatch().add_stepper)
# Basic probe requests
self.probe_offsets = probe.ProbeOffsetsHelper(config)
self.probe_offsets = EddyProbeOffsets(config)
self.param_helper = probe.ProbeParameterHelper(config)
self.eddy_descend = EddyDescend(
config, self.sensor_helper, self.calibration, self.probe_offsets,
+1 -1
View File
@@ -57,7 +57,7 @@ min_temp: 0
max_temp: 130
[probe_eddy_current eddy]
z_offset: 0.4
descend_z: 0.4
x_offset: -5
y_offset: -4
sensor_type: ldc1612