Files
firmware/docs/notes/60-background.md
T
Oleksandr ShyshatskyiandClaude Opus 5 d05565284d Sections E, F, G: wrong values, stale claims, overclaims
E -- values and counts. The START_PRINT prologue has no M400 and an idle
timeout of 864000, not 1800000. The nozzle-clean temperature comes from the
material table FIRST, so NOZZLE=240 with no per-tool temp cleans at 220 --
documented backwards before. TOOLS is the paired 0:220,2:240 form. The wipe Z
is the raw eddy frame, not the homed one. The runout M117 strings are
"T<n> clog" / "T<n> out of filament", not E-codes. Grab-verify raises
E0051+tool, not E0143. Docks are at X~297; 250/280 are staging waypoints. The
grab sequence is documented in the order _grab actually emits it. ff_print
exposes seven status fields, not nine, and never emits TOOLS=. Package sizes
reconciled against the real artifacts (62MB built, ~93MB stock, ~370MB of CI
assets, ~60s not 90s). testing.md's sample output block matched no header the
code prints, so it is replaced with the real ones; its pytest row listed two
of six suites.

F -- stale claims. _FF_PREFLIGHT is not "missing". SDCARD_SET_CHANNEL is not
still issued (764af2a). The app and Moonraker do not coexist; the app is gone.
TOOLCHANGE_STATUS has nothing to compare against since the JSON reader was
removed. The JSON is re-imported every boot until a nozzle is saved, not once.
The 23-check render harness was deleted in 91604c2. PURGE now wipes by
default. 50-print-lifecycle.md gained the section on how the sequences are
actually entered now -- [ff_print], not the slicer. The dead "profiles"
concept is gone from three files, one of which printed it on every replica run.

G -- overclaims. The README no longer says a stock reflash puts the printer
back "exactly as it was": it says what is restored and what survives inert,
which is what test-recovery actually asserts. The random ssh password is
conditional on ROOT_PW_HASH being unset. verify.sh no longer warns "ssh will
not start" on every build for a dropbear we deliberately do not ship -- the
check now reads the way round it means. case-install.sh's read-only block says
it asserts nothing. An uncalibrated tool contributes z_adjust, not zero, in
three operator-facing places. offset_base does not cancel out in X/Y. The
safe-moves file's Z50 promise is scoped to its own lines, with the implicit
prepare's G1 Z10 spelled out.

48 passed, 5 skipped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 19:48:43 +03:00

3.1 KiB
Raw Blame History

Background: filament system, calibration, persistent state

Context recovered from the binary. Written when none of it was ported and the stock touchscreen still handled it; both halves of that have since changed. The runout handling, filament load/unload and the offset calibration below ARE ported now (ff-runout.cfg, ff-filament.cfg, ff_tool_offset.py), and there is no stock touchscreen on a modded printer — firmwareExe is replaced and HelixScreen is the only UI. What is genuinely still unported is marked as such per item. Kept as reference.

Filament system

  • 4 channels; per-channel presence (fd_ex0..3) and motion/clog (fm_ex0..3) sensors; manual_stepper gear_stepper is the tool lock motor, not a feed hub. Errors: E0162 runout, E0163 clog.
  • Runout auto-swap (the flagship app feature): on runout mid-print the app pauses, finds another channel with the same material/color, switches channel (possibly a head change), refeeds, purges, restores position and resumes. All app-side.
  • Load ≈ heat, G92 E0, G1 E150/G1 E145 long feed; unload ≈ feed assist then retract ramp G1 E-50 F150 … tip forming.
  • Pre-print screen parses 3MF per-tool type/color and lets the user remap slicer tools to physical channels (SDCARD_SET_GCODE_EX_USED_BASE/CHANGED).
  • Drying box: separate MCU on /dev/ttyS3, own textual protocol (DryingService), 2 chambers with temp/humidity control. Not Klipper at all.

Calibration flows (all driven by the app)

  • Bed leveling: eddy probe, 10×10 bicubic; factory mesh saved as profile MESH_DATA, per-print mesh as default; SAVE_CONFIG after.
  • Nozzle offset calibration (testEddyExtruderOffsetForward*): heats and cleans each nozzle, probes the fixed under-bed sensor with the eddy, then touches it with each nozzle; circular probing + least-squares circle fit for XY; results → tN_offset_x/y/z, z_station_pos in extruder.json. Reimplemented in Klipper as STATION_CALIBRATE / TOOL_OFFSET_CALIBRATE (45-tool-offset-calibration.md, 46-offset-calibration-recovered.md); the JSON is imported by FF_IMPORT_FIRMWARE_CONFIG — automatically, on every startup, for as long as no [ff_tool n] has a saved nozzle position — and is never a runtime source.
  • Input shaper: STEPPER_RESONANCE_FACTORY_CALIBRATE (fork) / SHAPER_CALIBRATE.
  • Auto PA: prints slow-fast-slow line patterns per PA candidate, scores via PA_ACTION/PA_GET (sensor unknown), stores per-tool table via SET_PA_ADVANCE.

Persistent state map (/usr/data/firmwareRes/config/)

  • extruder.json, test.json, zoffset.json — motion-critical, see 40-offsets.md. Back these up.
  • filament.json — per-channel exN_filament_type/color/diameter.
  • general.json/print.json — UI toggles: levelOpen (per-print leveling), openDoorPause, filamentDetected, aiCheck, camera, LED…
  • total.json — maintenance counters/service reminders.
  • levelData — 10×10 mesh copy the UI renders.

Also worth backing up before any experiment: /usr/data/config/printer.cfg (+ printer.base/macro/motor/override.cfg) and the whole /usr/prog/klipper/ fork tree.