-
Notifications
You must be signed in to change notification settings - Fork 0
Z Compensation
klippy/extras/z_compensate.py — per-print auto-Z-offset tuning. This is new code, not a port —
Creality's real z_compensate_wrapper.so has no published source anywhere we could find, so this
module's design was worked out from strong reverse-engineering evidence (it delegates into
PRTouch's own primitives, and its bl_offset config value matches [bltouch]'s own y_offset
exactly).
It runs once per print, before bed-mesh calibration — a per-print thermal/wear fine-tune, not a
one-time factory calibration. By default it applies the correction as a live SET_GCODE_OFFSET
for that session; making it permanent is opt-in (persist_offset), since baking it straight into
the saved probe z_offset via SAVE_CONFIG would trigger a Klippy restart mid-print, which is
obviously not what you want.
The XY-reference fix got live-qualified alongside PRTouch's own — same underlying correction, applied here too.
It exposes structured status (not gcode text) through Klipper's normal object-status/webhooks mechanism, so GuppyScreen and Moonraker can poll it programmatically instead of parsing command output.
One thing that looks like a mistake but isn't: [z_compensate] has its own tri_min_hold/
tri_max_hold values, separate from [prtouch_v2]'s — that's a genuine per-feature sensitivity
tune, not a duplicate.
See also: PRTouch, NebulaOS Changes.