Files
klipper-macros/macros/sensors/touch_compare.cfg
T
mangavalkandClaude Opus 5.5 b16961dba3 TOUCH_COMPARE: Beacon contact vs bd_pressure touch (extras/bdp_touch.py)
bd_pressure's endstop output is not wired, so BDP_TOUCH lowers the nozzle
in small steps and reads the force after each one, up to a force limit
(default 80) or 0.4 mm below the start, then lifts back. It reports the
threshold height and the zero-force height from a line fit and logs the
curve to klippy.log. TOUCH_COMPARE heats the nozzle to 150C, homes, and
alternates Beacon's contact probe with BDP_TOUCH at one spot, reporting
mean, spread and range of each and of the difference. Refuses while the
bdp_guard is armed or the sensor is in PA mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 16:58:20 +01:00

39 lines
1.7 KiB
INI

# Touch comparison: Beacon contact vs bd_pressure (needs extras/bdp_touch.py
# and the bd_pressure load-check firmware). See extras/bdp_touch.py.
#
# TOUCH_COMPARE [N=10] [X=175] [Y=175] [TEMP=150] [THRESHOLD=15] [STOP=80]
# [STEP=0.005] [START=0.1]
# Nozzle to TEMP (Beacon contact refuses above 180C), HOME (contact Z),
# then N pairs at X/Y: one Beacon contact probe, one BDP_TOUCH starting
# START mm above the Beacon result. Reports per method the mean, standard
# deviation and range, and the same for the per-pair difference.
# The nozzle must be clean (no ooze blob) and the bed soaked: a bed that
# still changes shape moves both results, the difference less so.
# Nozzle heater off at the end.
#
# BDP_TOUCH alone: touch at the current X/Y from the current Z (home first,
# start 0.1-0.2 mm above the bed).
[bdp_touch]
sensor: bd_pa
[gcode_macro TOUCH_COMPARE]
description: Compare Beacon contact and bd_pressure touches at one spot
gcode:
{% set temp = params.TEMP|default(150)|float %}
{% set x = params.X|default(175)|float %}
{% set y = params.Y|default(175)|float %}
{% if printer.print_stats.state in ("printing", "paused") %}
_ERROR MSG="TOUCH_COMPARE: a print is running"
{% elif temp > 180 or temp < 140 %}
_ERROR MSG="TOUCH_COMPARE: TEMP must be 140-180C (Beacon contact)"
{% else %}
M109 S{temp}
HOME
G90
G1 X{x} Y{y} Z5 F6000
M400
_TOUCH_COMPARE N={params.N|default(10)|int} START={params.START|default(0.1)|float} THRESHOLD={params.THRESHOLD|default(15)|float} STOP={params.STOP|default(80)|float} STEP={params.STEP|default(0.005)|float}
M104 S0
{% endif %}