This is a macro to use Eddy’s tap output as a reference point for the bed mesh.
Bed mesh can be done with scan/rapid_scan/default methods.
There should be zero_reference_position in the config.
The trick is, as bed_mesh is relative to the 0, which is placed at zero_reference_position,
Z position derived from the tap can be used as a reference.
How to use, basically in any order:
BED_MESH_CALIBRATE METHOD=scan ADAPTIVE=1
BED_MESH_ADJ_FROM_TAP
// Or
BED_MESH_ADJ_FROM_TAP
BED_MESH_CALIBRATE METHOD=scan ADAPTIVE=1
The macro:
[gcode_macro _RELOAD_Z_OFFSET_FROM_PROBE]
gcode:
{% set Z = printer.toolhead.position.z %}
M118 Z adjust {Z} -> {Z - printer.probe.last_probe_position.z}
SET_KINEMATIC_POSITION Z={Z - printer.probe.last_probe_position.z}
[gcode_macro SET_Z_FROM_PROBE]
gcode:
{% set METHOD = params.METHOD | default("automatic") %}
{% set SAMPLES = params.SAMPLES | default(3) %}
{% set PROBE_SPEED = params.PROBE_SPEED | default(4) %}
{% set LIFT_SPEED = params.LIFT_SPEED | default(5) %}
{% set SAMPLE_RETRACT_DIST = params.SAMPLE_RETRACT_DIST | default(2) %}
PROBE METHOD={METHOD} SAMPLES={SAMPLES} PROBE_SPEED={PROBE_SPEED} LIFT_SPEED={LIFT_SPEED} SAMPLE_RETRACT_DIST={SAMPLE_RETRACT_DIST}
_RELOAD_Z_OFFSET_FROM_PROBE
G0 Z5
[gcode_macro BED_MESH_ADJ_FROM_TAP]
gcode:
{% set is_absolute = printer.gcode_move.absolute_coordinates %}
{% set zero_coords = printer.configfile.settings.bed_mesh.zero_reference_position %}
M118 {zero_coords[0]} {zero_coords[1]}
G90
G0 Z5 F300 # Z-Hop
G0 X{zero_coords[0]} Y{zero_coords[1]} F3000
SET_Z_FROM_PROBE METHOD=tap
G0 Z5 F300 # Z-Hop
{% if not is_absolute %}
G91
{% endif %}
I’ve tested by setting zero reference to 50, 50, and BED_MESH_CALIBRATE METHOD=scan MESH_MIN=300,300
So, bed mesh happens at the further right corner, then the toolhead goes to zero_ref X - x_offset, Y - y_offset.
So, upon BED_MESH_ADJ_FROM_TAP, nozzle moves to zero_ref X, Y; taps & updates current Z with tap’s data.
Basically, that is it.
Cross-linking: