Skip to main content
EVCore treats calibration as data, not as scattered constants. The knowledge base (section 11) establishes this principle, and the current firmware provides the foundation for a complete calibration system. This page describes what exists today, what is missing, and the rules the eventual design must follow.

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:
The format uses explicit little-endian headers and bounded payloads, not native struct images. A CRC catches accidental corruption; it does not authenticate the data. A valid CRC record still needs semantic validation.

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.