STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
fsw::calibration::LcTare Struct Reference

One load cell's tare: the scale reads zero at the load it was holding when the operator pressed Tare. More...

#include <LcTareStore.hpp>

Collaboration diagram for fsw::calibration::LcTare:
[legend]

Public Attributes

uint16_t uid = 0
std::string entity
double adc_at_tare = 0.0
double offset_kg = 0.0
double set_at_ms = 0.0
uint64_t curve_fp = 0

Detailed Description

One load cell's tare: the scale reads zero at the load it was holding when the operator pressed Tare.

A tare is NOT a calibration point, and the difference is the reason this store exists separately from CubicCalibrationStore. A vented PT genuinely is at 0 psig, so capturing a zero on one is a true reference point and belongs in the shared fit. A load cell holding a tank is not at 0 kg: capturing that as a zero would inject a false point, and because add_point re-runs a least-squares fit over every point, it would tilt the whole cubic rather than shift its intercept. LC therefore gets a display-only tare, and its zero-capture keeps meaning "unloaded".

WHAT IS STORED IS THE ADC CODE, NOT THE KILOGRAMS.

offset_kg is a derived cache, re-evaluated from adc_at_tare through the current curve on every re-fit, clear, and profile swap. Persisting kilograms as the truth is the bug this layout exists to prevent: tare a 20 kg tank against a bad two-point fit that reads it as 18, improve the fit until the same tank evaluates to 20, and a frozen 18 kg offset displays 2 kg for a tank that never moved — a plausible-looking wrong number on a pad display. Re-deriving from the code gives 20 - 20 = 0.

Subtraction happens in kilograms, never in counts: the curve is a cubic, so offsetting its input shifts the slope you get instead of translating its output.

Definition at line 50 of file LcTareStore.hpp.

Member Data Documentation

◆ adc_at_tare

double fsw::calibration::LcTare::adc_at_tare = 0.0

Definition at line 53 of file LcTareStore.hpp.

◆ curve_fp

uint64_t fsw::calibration::LcTare::curve_fp = 0

◆ entity

std::string fsw::calibration::LcTare::entity

◆ offset_kg

◆ set_at_ms

double fsw::calibration::LcTare::set_at_ms = 0.0

Definition at line 55 of file LcTareStore.hpp.

◆ uid

uint16_t fsw::calibration::LcTare::uid = 0

Definition at line 51 of file LcTareStore.hpp.


The documentation for this struct was generated from the following file: