Tap - vvuk/eddy-ng GitHub Wiki
Tap depends on detecting when the sensor (thus toolhead) is no longer getting closer to the build plate. This should be caused by your nozzle touching the build plate. It will also be caused by extra filament goop at the tip of your nozzle, leading to wrong (way too high) z offset results. Ensure your nozzle is clean before doing a tap (see below for macro suggestions).
There is also usually some flex in the entire printer that can absorb some force when the initial contact happens. This means that the contact may be detected a little later than the first time the nozzle actually touched the plate. You can use the tap_adjust_z
parameter to add a value to the calculated height, because this amount of flex generally won't change.
First Tap
With XYZ homed, try:
PROBE_EDDY_NG_TAP
This will make contact with your build plate -- maximum contact -0.250, which is the default target Z at a default 3mm/s; the risk of build plate or nozzle damage is minimal, but if you're concerned you can experiment with TARGET_Z=-0.100
. You can also specify SAMPLES=1
to only do one sample. If it is successful, it will set a Z-offset as well as a "tap offset", which is used for more accurate bed meshing following a tap.
This command will write out /tmp/tap-samples.csv
on both success and failure. If you have problems, save this file and include it in a Github issue to help me diagnose.
If you installed Plotly, a graph will be generated in /tmp/tap.html
. See "Tap Graph" below for information about how to read this graph.
If you see errors, e.g. Error during homing probe: Sensor error (ldc status: UNREADCONV1 DRDY
and Tap failed at xxxx
, jump down to troubleshooting.
If you see "probe completed movement without triggering" errors, this means that the steppers moved down to TARGET_Z
and the probe didn't trigger. You may also see a "successful" tap, but the value may be suspiciously close to your TARGET_Z
. In both these cases, manually move the toolhead to TARGET_Z and check that it's actually making contact with the build plate (and not just lightly), as it probably won't be. Depending on your printer, you may need a lower TARGET_Z
, or re-calibrating may help. The TARGET_Z number does not mean the toolhead will move to that Z; if all goes well, a tap will be detected and the toolhead will be stopped well before. (As an example, on my wet noodle Ender 3, I need TARGET_Z=-0.500
for succesful taps, but typical Z offsets are in the -0.200 range.)
Successful Tap
After a successful tap, you should verify two things:
First, check that Z=0.0
feels reasonable. Put a piece of paper under the toolhead and manually move it down to 0 (or start at 0.5 and step down by 0.1). If everything worked well, there will be a good amount of friction.
If it's too much friction, or too little, run a few more taps. If the detection looks consistent, you can try to set tap_adjust_z
to add a constant value. You can experiment with changing this value at runtime: PROBE_EDDY_NG_SET_TAP_ADJUST_Z VALUE=0.050
, then run PROBE_EDDY_NG_TAP
again (see "Adjusting Tap Z" just below). The default tap setup does a maximum of 5 taps, looking for any 3 to have a standard deviation of 0.025 or less, and then takes the average of the 3. All of those values are configurable.
You can also look at the tap graph and see if tap detection looks early or late.
Second, do a bed mesh with BED_MESH_CALIBRATE METHOD=rapid_scan
. If everything is working correctly, the bed mesh deviation at the tap point should be very close to 0 (+/-0.005). (Klipper only for now.)
Adjusting Tap Z
When the toolhead comes into contact with the build plate and the steppers keep moving, the entire system flexes slightly, because the force that the steppers are exerting has to go somewhere. Depending on threshold, the stiffness of the rest of the system, and other factors, the detected tap Z offset may be (usually) slightly too low or (rarely) too high. You can use the config parameter tap_adjust_z
to specify a fixed value that will be added to the calculated Z offset when tapping, e.g.:
tap_adjust_z: 0.025
You can figure out this value by doing a TAP
, then manually moving the toolhead to 0.0 with a piece of paper underneath it. If it's too tight, move the toolhead up a bit until you get to what feels good to you for a first layer (don't forget to move up a bit higher and then back down to compensate for backlash). Once you get to what feels good, your Z position is your tap_adjust_z
. You can set this value in your config or override it at runtime using a command like PROBE_EDDY_NG_SET_TAP_ADJUST_Z VALUE=0.050
. This is useful if you want different tap_adjust_z
values for different materials, as you can include this in your slicer or start print.
Adjusting the Tap Threshold
Lower threshold values are beneficial only in order to have the tap operation make shorter contact with the build plate, but lower values also increase the chance of false positives.
The graph will show you a graph for "butter"; the threshold is compared to the distance between a peak and the next through, triggering as soon as that distance goes beyond the threshold. You can eyeball an appropriate threshold for your setup. You want the lowest value that won't trigger false taps earlier, plus a bit of margin.
Alternate Tap Mode
The default tap mode is butter
, which uses a Butterworth filter to accurately detect a tap. There is a less accurate moving-average mode called wma
(this used to be the original mode, but was replaced). It may be useful in some situations; the threshold for this mode tends to be higher. But it's also just as likely to be removed in the near future. If you run into scenarios where butter
does not give you a good result, but wma
does -- please let me know!
Tap Graph
If you install Plotly and you have write_tap_plot: true
(and optionally write_every_tap_plot: true
) set in your config or you pass PLOT=1
or PLOT=2
to the TAP
command, you will also have /tmp/tap.html
or /tmp/tap-#.html
(where # is the sample number) that you can look at:
You can click items in the legend to hide/show different lines, and you can scroll around and zoom in teh graph.
To read this graph, briefly:
- The
butter
line shows the filtered signal forbutter
mode. The threshold is compared to the distance between a peak and the next through (ignoring the first heavily wavy part of the signal graph). Note this will only show up on the graph if thescipy
package is installed. - The
accum
line shows the value that the tap threshold is compared to forwma
mode. - The current set tap threshold is shown as a dotted horizontal line
- Both what the sensor thinks the height is (
Z
) and where the toolhead thinks it is (KinZ
) are shown. If a tap is done at the same temperature calibration was done at, these should be fairly close, especially at lower heights. At higher temperatures there may be a difference between these (and that's fine), but it typically shouldn't be more than 1mm.- At some point the
Z
will flatten out whileKinZ
continues decreasing. This is the point of contact with the bed (the sensor isn't getting any closer, even though the steppers think they're moving the toolhead lower).
- At some point the
- The
Freq
line is the raw frequency reading from the sensor (this is converted intoZ
based on the calibration data).wma
,wma_d
,wma_d_avg
are a windowed moving average of the frequency, the derivative of that, and the average of that. These are used to calculate theaccum
value. - Two vertical lines are shown -- the second is the point at which tap triggered, and the first is the start of the tap, which is the position that's reported as the tap position.
It's hard to see in the above graph because the actual "tap" happens all the way on the right edge. A full graph where the toolhead completes the movement without a tap being detected (on purpose, by setting the threshold very high) looks like this:
The blue line (Z from sensor) flattens out before the red line (stepper Z), meaning that the sensor stopped moving closer to the plate even though the steppers wanted it to. That's the tap point.