Repository navigation
Description
Firmware version
1.5.2.13_20260722102206 (installed via official OTA). Code references below are to this repository, branch main (v1.5.2 release)
Firmware source
Official release
Third-party firmware source
N/A
Was the configuration modified?
No
What configuration changes were made?
N/A
Was the source code modified?
No
What source code changes were made?
N/A
How can the issue be reproduced?
- Start a print with valid measured flow calibration factors on all heads (in my test:
extruder2 = 0.023951, measured by the printer's own flow calibration the previous day).
Do not request flow calibration for this job. Factors can be observed via Moonraker:- store:
curl "http://PRINTER_IP/server/files/config/snapmaker/flow_calibrator.json" - live:
curl "http://PRINTER_IP/printer/objects/query?extruder2=pressure_advance"
- store:
- Mid-print, cut the active head's filament upstream of the feeder and let it run out.
The printer detects the runout and pauses. - At the runout prompt, feed the same spool back in and press Resume. (Nothing else —
no filament screen, no unload menu.) - Observe the factor before, during, and after with the two queries above. I polled both
every 5 seconds through the whole event (attached:pa_store_poll.csv).
What was the actual result?
The head's measured factor is destroyed at the filament-load step — in both the live
pressure_advance and the persisted store — and replaced with the per-class default
(0.02 for PLA). The remainder of the print runs at the default, 16.5% below the measured
value for this head. From the attached 5-second poll (columns: live PA / stored factor for
extruder2):
07:14:48 paused 0.023951 / 0.023951 <- runout pause: detection alone wipes nothing
07:16:02 paused 0.023951 / 0.023951
07:16:07 paused 0.02 / 0.02 <- wiped when filament was fed / resume handling began
07:17:52 printing 0.02 / 0.02 <- rest of print at default (-16.5%)
Additional data points from the same sessions:
- A pause + resume cycle without a filament load (07:03–07:05, same print) left all
factors untouched — the load is the trigger, not pause/resume. - The touchscreen filament screen path (unload + reload) produces the identical wipe
(tested the previous day on extruder1: 0.023893 → 0.02). - No re-measurement occurs at resume:
flow_calculator.log(attached) shows no
calibration activity during the event. - The discarded values are good: re-measuring the wiped head on the next flow-calibrated
print returned 0.023967 vs 0.023893 before the wipe — 0.3% repeatability on the same
spool. The 0.02 default is 16–19% off the measured values on my machine.
Where this happens in the code:
klippy/extras/print_task_config.py,cmd_INNER_CHECK_AND_RELOAD_FILAMENT_INFO
(line 824, called from theINNER_RESUMEmacro): in the
is_runout and self.filament_info_backupbranch, the previous filament's type, vendor,
sub_type, softness, and colors are restored from backup — i.e. the firmware itself
models the reload as "same filament, continue" — and then line 857 unconditionally runs
FLOW_RESET_K EXTRUDER={extruder_index}.klippy/extras/flow_calibrator.py,_reset_pressure_advance()(line 476, the
FLOW_RESET_Khandler): applies the class default from
filament_parameters.get_flow_k(...)to the extruder and persists it via
_save_config()— so the measured factor is destroyed in
snapmaker/flow_calibrator.json, not just overridden for the session.- The touchscreen load path reaches the same wipe through the sibling
FLOW_RESET_K
call sites atprint_task_config.py:365and:679.
Note this also implies auto_replenish_filament degrades the head to the default on
every automatic replenish (it necessarily loads filament mid-print) — I have not tested
that path yet, but it follows the same code.
What was the expected result?
When the firmware's own runout branch restores the previous filament's metadata from
backup ("same filament, continue"), the measured flow factor should survive with it —
the branch's premise applies to the calibration exactly as much as to the metadata. All
inputs for a safe policy are already available in that function:
- Minimum: skip
FLOW_RESET_K(or restore the backed-up factor) when the backup
filament info is being restored. - Better: keep the factor when the reloaded filament matches by RFID tag UID, or by
declared vendor/type/sub-type when untagged; reset to the class default only for a
genuinely different filament (current behavior, which is correct for that case). - Optionally: offer a single-head re-measure at resume (~3.5 min). The resume sequence
already parks at the discard position with the head at temperature, which is where and
how flow calibration runs anyway.
Log files
pa_store_poll.csv— 5-second Moonraker poll across the whole test: print state, live
pressure_advancefor all four heads, and the four stored factors from
snapmaker/flow_calibrator.json. Covers baseline, a control pause/resume without
filament load (07:03), the runout pause (07:14:48), the wipe (07:16:07), and the
resumed print.flow_calculator.log— the flow calibration service's own log, showing measurement
activity on Aug 12 and Aug 16 and none during the runout/resume event.console_excerpt.txt— Klipper console history for the pause and resume sequences,
captured live via/server/gcode_storeduring the event (note:klippy.logon this
unit has not been written since initial setup day, and the gcode_store ring buffer
evicts within hours, so this excerpt was captured in real time).
Activity
alandebortolo commentedon Nov 7, 2026
Thanks for the 5-second poll: it is what located the wipe. The factor is already 0.02 at 07:16:07 and
Resuming...only comes at 07:16:14, so the first reset happens before the resume handler runs. It is the RFID reader's answer when the switch reads "present" again (_rfid_filament_info_update_cbrunsFLOW_RESET_K, and an untagged spool reads as the empty card); for an untagged spool, Resume'sINNER_CHECK_AND_RELOAD_FILAMENT_INFOthen restores the backed-up filament and resets a second time._reset_pressure_advance()writes the class default toflow_calibrator.json, which is why 0.02 survived into the next prints.Fix in draft PR #27 (your item 1, applied to both calls): while the print is paused, a spool that is untagged or whose tag matches the backed-up vendor/type/sub-type keeps the measured factor; a tag for a different filament still resets, and so does
SET_PRINT_FILAMENT_CONFIGfrom the screen. One file,klippy/extras/print_task_config.py, +13/-2.I ran it on the firmware in Klipper batch mode (2.0.0 and 2.1.0), through the real runout, reload and Resume path: stock goes 0.023951 -> 0.02 live and on disk right at the feed, patched keeps 0.023951, and a PETG tag still resets to 0.05 (test and logs). Batch mode has no sensor and no reader, so I could not run it on a printer. If you can run the patched file on your U1, the check is your own poll: runout, feed the same spool back, Resume, and
extruder2.pressure_advanceplus the stored factor should stay at 0.023951. Either way, please tell me what you see.