Open
Conversation
…ce.md Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add a new create_probe_result() helper function that can generate a ProbeResult using a toolhead position and a set of probe offsets. Use this helper in other modules. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
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>
Theoretically a "tap" probe should detect the exact point that the nozzle contacts the bed. In practice, however, there can be a systemic bias that one may wish to account for. This bias may be due to backlash, thermal expansion, a detection bias, or similar issues. Add a new tap_z_offset config parameter to allow users to specify an offset. Also, update the Z_OFFSET_APPLY_PROBE command to support modifying this value. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
…nd "tap" Add a new EddyParameterHelper to override ProbeParameterHelper. Only use the printer.cfg lift_speed, samples, sample_retract_dist, samples_result, samples_tolerance, and samples_tolerance_retries settings for normal probe operations. Don't use these defaults when using a "METHOD" set to "scan", "rapid_scan", or "tap". Each of these probing mechanisms is distinct and it's unlikely a user could meaningfully set a default for all of them. Don't set sample_retract_dist when using "scan" and "rapid_scan" modes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Perform lifting at the end of EddyTap.run_probe(). This is in preparation for performing tap analysis during retraction. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't calculate the nozzle/bed contact position from the descent movement. Instead, obtain the data during the lifting movement and determine the contact point by analyzing where the nozzle separates from the bed. This improves the precision and repeatability of the "tap" results. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
nefelim4ag
reviewed
Mar 11, 2026
| # Recommended starting values for the tap | ||
| #samples: 3 | ||
| #samples_tolerance: 0.025 | ||
| #samples_tolerance_retries: 3 |
Collaborator
There was a problem hiding this comment.
JFYI: This does not make sense after adding the new interface, because they only make sense as the tap params, which now only apply from gcmd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes the recent ldc1612 eddy current "tap" support to determine the bed/nozzle contact point by analyzing the post-contact lift movement (previously the code determined the point of contact by analyzing the descent).
There are some advantages to calculating the probe position by analyzing the lift movement:
The code on this PR implements a kind of "least squares" search of the measurement data to find the point of contact. Specifically, putting noise aside, the sensor readings around the point of contact are expected to follow:
z=contact_z):sensor_frequency(z) = k0z<=contact_z):sensor_frequency(z) = k0 + k1*(z - contact_z)z>=contact_z):sensor_frequency(z) = k0 + k2*(z - contact_z) + k3*(z - contact_z)*(z - contact_z)Given the above formulas the code tries to find solutions for
contact_z,k0,k1,k2, andk3such that it minimizes the squares of the deviation from the actual sensor frequency measurements (ie, a "least squares solution").This may best be seen with a picture:

In this example, the line shown was the "best fit" for the measurement data. (Note how the final "contact point" of
z=1.054421is actually between two measurements.)Initial tests are indicating that this method of analyzing the tap position can produce more repeatable and more precise results. However, there are some known caveats:
This PR also includes some additional changes that were needed as prerequisites:
tap_z_offsetconfig parameter has been provided. This is similar to thez_offsetparameter found on other types of probes. It allows the user to specify a nominal Z offset between what the tap code provides and the actual desired Z value during prints. Even though the contact point would nominally occur at exactly Z=0, there can be cases where backlash, thermal expansion, and similar may make an offset desirable.[probe_eddy_current]z_offsetparameter has been renamed todescend_z. This is to avoid confusion with thez_offsetfound in other common probe configs and to avoid confusion with the newtap_z_offset.speed,lift_speed, etc. config options are no longer utilized. If a user wishes to change any of these settings from their defaults then they will need to provide the new values on the probe command-line (eg,PROBE_SPEED=9,LIFT_SPEED=3.0, etc.). This was implemented because the new code is sensitive to these types of probe settings and the defaults used for regular probing attempts would not be meaningful for "tap" probes.-Kevin
Note, I also have a development branch at https://github.com/KevinOConnor/klipper-dev/tree/work-tap-20260224 . It has some debugging code. In particular it contains the
scripts/tap_graph.pyscript that was used to generate the graph above.