What exists today
Conversion model
EV_Calibration in firmware/include/evcore_measurement.h holds the parameters for raw-to-engineering-unit conversion:
EV_Calibrate refuses a zero revision, nonfinite values, a zero or subnormal gain, an empty range, a raw value outside the range, and a nonfinite result. This prevents obviously corrupted calibration from producing dangerous output decisions.
Sample flags
Measurements can carry flags that make them unusable for PASS/FAIL decisions:
Any flag makes the sample unusable for PASS/FAIL. An uncalibrated or invalid channel produces flagged, unusable samples, and the result is UNKNOWN, never a guess.
Storage format
EV_RecordEncode and EV_RecordDecode in firmware/include/evcore_storage.h store versioned, typed, generation-numbered byte records with a CRC32. This format is suitable for a calibration payload:
Reporting
INFO and every report currently state calibration=none or null, because no calibration is loaded yet. The raw ADC value stays with the scaled value so a calibration mistake can be corrected later (roadmap item 35).
What is missing
Divider ratios, amplifier gains, and references are open hardware items tracked in
hardware-open-items.md. No calibration constant has been chosen because the hardware baseline remains provisional.
Rules
The calibration system must follow these design rules:- Calibration only changes how raw readings are scaled. It never widens a safety limit or authorizes a stimulus.
- An uncalibrated or invalid channel produces flagged, unusable samples, and the result is UNKNOWN, never a guess.
- The raw ADC value stays with the scaled value, so a calibration mistake can be corrected later.
- A calibration record from an unknown format version is rejected, never reinterpreted. See versioning rules for the version policy.