diff --git a/docs/Config_Changes.md b/docs/Config_Changes.md index cf2e5d759..7fe758d7a 100644 --- a/docs/Config_Changes.md +++ b/docs/Config_Changes.md @@ -8,6 +8,15 @@ All dates in this document are approximate. ## Changes +20260318: The `[probe_eddy_current]` config options `speed`, +`lift_speed`, `samples`, `sample_retract_dist`, `samples_result`, +`samples_tolerance`, and `samples_tolerance_retries` no longer apply +to probe commands using `METHOD=scan`, `METHOD=rapid_scan`, nor +`METHOD=tap`. To use different settings, supply the equivalent +`PROBE_SPEED`, `LIFT_SPEED`, `SAMPLES`, `SAMPLE_RETRACT_DIST`, +`SAMPLES_RESULT`, `SAMPLES_TOLERANCE`, or `SAMPLES_TOLERANCE_RETRIES` +parameter with the probe command. + 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. diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index db0ca25f2..d247a9ecc 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -2330,6 +2330,8 @@ sensor_type: ldc1612 # settings" section for a description of the above parameters. #x_offset: #y_offset: +# The distance (in mm) between the probe and the nozzle along the +# x and y axes. The default is 0. #speed: #lift_speed: #samples: @@ -2337,7 +2339,10 @@ sensor_type: ldc1612 #samples_result: #samples_tolerance: #samples_tolerance_retries: -# See the "probe" section for information on these parameters. +# See the "probe" section for information on these parameters. Note +# that the settings here apply only to regular probe commands. These +# settings do not have an effect if using a probe "METHOD" of +# "scan", "rapid_scan", or "tap". #tap_threshold: # Noise cutoff/stop trigger threshold (in Hz). Specify this value to # enable support for "METHOD=tap" probe commands. See Eddy_Probe.md diff --git a/docs/Eddy_Probe.md b/docs/Eddy_Probe.md index e3de7da02..14bc1e7e8 100644 --- a/docs/Eddy_Probe.md +++ b/docs/Eddy_Probe.md @@ -116,15 +116,6 @@ Practically, it ensures that the Eddy's output data absolute value change per second (velocity) is high enough - higher than the noise level, and that upon collision it always decreases by at least this value. -``` -[probe_eddy_current my_probe] -# eddy probe configuration... -# Recommended starting values for the tap -#samples: 3 -#samples_tolerance: 0.025 -#samples_tolerance_retries: 3 -``` - Before setting it to any other value, it is necessary to install `scipy`: ```bash diff --git a/klippy/extras/probe_eddy_current.py b/klippy/extras/probe_eddy_current.py index f3567e8b6..abefcf8d7 100644 --- a/klippy/extras/probe_eddy_current.py +++ b/klippy/extras/probe_eddy_current.py @@ -657,7 +657,7 @@ class EddyScanningProbe: self._calibration.verify_calibrated() self._gather = EddyGatherSamples(self._printer, self._sensor_helper) self._sample_time = gcmd.get_float("SAMPLE_TIME", 0.100, above=0.0) - self._is_rapid = gcmd.get("METHOD", "scan") == 'rapid_scan' + self._is_rapid = gcmd.get("METHOD", "scan").lower() == 'rapid_scan' return self def run_probe(self, gcmd): toolhead = self._printer.lookup_object("toolhead") @@ -691,6 +691,33 @@ class EddyProbeOffsets: def get_offsets(self, gcmd=None): return self.x_offset, self.y_offset, 0. +# Wrapper around ProbeParameterHelper +class EddyParameterHelper: + def __init__(self, config): + self._param_helper = probe.ProbeParameterHelper(config) + def get_probe_params(self, gcmd=None): + method = None + if gcmd is not None: + method = gcmd.get('METHOD', '').lower() + if method not in ['scan', 'rapid_scan', 'tap']: + return self._param_helper.get_probe_params(gcmd) + probe_speed = gcmd.get_float("PROBE_SPEED", 5.0, above=0.) + lift_speed = gcmd.get_float("LIFT_SPEED", 5.0, above=0.) + samples = gcmd.get_int("SAMPLES", 1, minval=1) + samp_retract_dist = gcmd.get_float("SAMPLE_RETRACT_DIST", 2.0, above=0.) + if method in ['scan', 'rapid_scan']: + samp_retract_dist = 0. + samp_tolerance = gcmd.get_float("SAMPLES_TOLERANCE", 0.100, minval=0.) + samp_retries = gcmd.get_int("SAMPLES_TOLERANCE_RETRIES", 0, minval=0) + samples_result = gcmd.get("SAMPLES_RESULT", 'average') + return {'probe_speed': probe_speed, + 'lift_speed': lift_speed, + 'samples': samples, + 'sample_retract_dist': samp_retract_dist, + 'samples_tolerance': samp_tolerance, + 'samples_tolerance_retries': samp_retries, + 'samples_result': samples_result} + # Main "printer object" class PrinterEddyProbe: def __init__(self, config): @@ -705,7 +732,7 @@ class PrinterEddyProbe: probe.LookupZSteppers(config, trig_analog.get_dispatch().add_stepper) # Basic probe requests self.probe_offsets = EddyProbeOffsets(config) - self.param_helper = probe.ProbeParameterHelper(config) + self.param_helper = EddyParameterHelper(config) self.eddy_descend = EddyDescend( config, self.sensor_helper, self.calibration, self.probe_offsets, self.param_helper, trig_analog)