A printer that will not print until I weigh the spool
A filament roll can be weighed full exactly once. My printer now refuses its first print until I have done it.
My 3D printer keeps track of its filament in Spoolman, which knows every roll I own and how much of each is left. I have now made the printer refuse to start a print on a new roll until I have put that roll on a kitchen scale. It sounds fussy. It is the cheapest fix I know for a number I could not trust on any roll I own.
Measurements hiding among guesses
Spoolman keeps three numbers for each roll: the filament it started with (the net weight on the label), the filament used so far, and the weight of the empty spool. Everything else is arithmetic. What is left is the start minus the used, and what the roll should weigh on a scale is what is left plus the empty spool. The used figure grows from what the printer reports pushing through the nozzle, so it drifts. When a print needs most of what a roll has left, I put the roll on the scale and type the reading into Spoolman, which takes off the empty spool and resets the used figure from the rest. That is where it falls apart.
Some of my empty spool weights are real: I have put emptied spools on the scale and typed in what it said. Others were copied from a similar filament, taken from Spoolman’s vendor default or simply assumed. In Spoolman they all look the same, a number in grams, and I never wrote down which was which. The measurements are in there, hidden among the guesses, and nothing tells them apart.
My Sunlu rolls show how it goes. Their weight is 162 g, copied from an older Sunlu filament, while the vendor default in Spoolman says 174 g. They disagree by 12 g, and I cannot say whether either of them was ever on a scale. My gembird spools carry a weight copied from a different brand altogether, and the Creality one had none. Every check on the scale was exactly as good as a number somebody once typed in, and I no longer knew which somebody.
Weigh it full, once
An empty spool on the scale is the best answer, when one exists. The next best is the full roll, straight out of its bag before the first print: the label says 1000 g of filament, so the spool is whatever the scale shows above that. I take the label at its word. It is the one number in this story that nobody copied.
That gives one chance per roll. After the first print the full weight is gone for good, and I know myself well enough to know I will be halfway through the second print before I remember.
The gate
The printer’s touchscreen runs a small display program of my own, which replaced the stock one after it started registering touches nobody made. It already knows which spool is active. Now, when that spool has never printed and has not been marked as weighed, the clock on the idle screen gives way to “New roll · weigh it before printing” and a Weighed button.
The display program cannot stop a print by itself, and Klipper, the firmware that can, cannot read Spoolman. So the display writes the spool’s number into a variable in Klipper, and the macro that starts every print checks it first. If it is set, the print stops with an error before anything heats or moves. Holding Weighed clears it, and so does ticking the box in Spoolman.
That box does a second job. It is the note I never kept: this roll was weighed, not guessed. When I put the spool weight worked out from it into Spoolman, I add a comment saying where it came from. A measurement nobody can tell from a guess is worth exactly as much as the guess.
“Never printed” was one more check than I expected. Spoolman leaves a spool’s first-used date empty on rolls I entered half used, so the gate also needs zero grams used, or it would have asked me to weigh rolls that went into Spoolman already half empty.
It fails open on purpose. After a Klipper restart the variable is empty until the display sets it again, within a second; with the display stopped, nothing blocks at all. It is a reminder with a lock on it, not a safe.
What the AI did, and what I did
I stated the rule and the wish: weigh the full roll when it leaves the bag, and make the printer remind me. The agent read the display code and the printer configuration, found where the active spool could be watched, and wrote the display change, the Klipper variable and the check at the start of a print. It also wrote down my rule wrong the first time, as “weigh an empty spool”. That is the better method, and the one that needs a spool I have already used up.
The first deploy stopped Klipper outright. The error message was meant to say “new roll #39 is not weighed”, and
Klipper’s configuration reads everything after a # as a comment, so the line was cut in half and Klipper halted on the
broken config. It was fixed within two minutes, and no print was running. The message now says “spool 39”, which is less
elegant and parses.
Sources
- Spoolman, filament inventory for 3D printers
- Spoolman’s spool weights, the source at v0.23.1, where a weighed spool resets the used figure
- Klipper, the printer firmware
- Klipper’s G-code macros, the variables and the macro that starts every print
- Klipper’s configuration parser, where
#starts a comment, even mid-line - Sunlu
- Gembird
- Creality