SYS-007: Calibration and Fill Level Ownership
Context
Each dispenser weighs its bottle with its own load cell (SYS-001). The load cell keeps its calibration across power cycles, but takes its current load as the zero point at every power up. Bottles stay in place and are refilled from the top, and power can cycle with half full bottles on the scales. So a reading says how far the weight has moved since the last zero point, not how full a bottle is.
A Pod also needs to know how much a dispenser delivers per motor step, so that a pour doesn’t have to wait on the scale the whole way.
Dispense carries only millilitres, and the Station has no other use for motor steps.
Decision
The Pod owns calibration.
A load cell’s calibration stays on the load cell, and a dispenser’s calibration stays in the Pod’s EEPROM.
DispenserStartCalibration carries a run time rather than a step count.
The Pod runs the dispenser for that time, measures what came out at rest, derives the calibration, and uses it at once.
The Station only sees the measured amount in millilitres.
A run where next to nothing came out leaves the previous calibration in place.
The Station owns the fill level. It keeps the last fill level of every dispenser on disk and corrects it from a weight reading when a Pod connects. The Pod pours by how far the weight falls, so it needs no absolute weight.
Consequences
-
Good: A Pod stays self-contained, so it can be recalibrated or swapped as a single unit (SYS-001).
-
Good: The Station knows nothing about motor steps, and the same message works for pumps and valves.
-
Good: A power cycle with half full bottles doesn’t disturb pouring.
-
Bad: An Operator can’t review a calibration before it applies. A wrong one is replaced by running again.
-
Bad: The accuracy depends on the run time, because the load cell reads to about 1 g. A short run gives a rough calibration, and a long one costs more liquid.
-
Bad: A bottle refilled while the Station is off stays unnoticed until someone corrects its fill level.
-
Bad: Load cell readings drift, by up to about 20 g in an hour as measured, so a fill level kept over hours can be that far off.
Effect on the Quality Goals
-
QG-03: Better for power cycles, because pouring needs no absolute weight. Worse for fill levels, because a bottle refilled while the Station is off goes unnoticed and load cell drift of up to about 20 g in an hour can offset a kept fill level.
-
QG-04: Better, because the Pod stays self-contained and calibrates itself from a run time. Worse, because an Operator cannot review a calibration before it applies, and a wrong one is only replaced by running again.
Alternatives Considered
Calibrating a pump by step count
The Station would send a number of steps and read back the amount.
Rejected: the Station would have to know about motor steps only for this one message, and the idea doesn’t apply to valves.