STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
SensorCalibration.hpp File Reference
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdint>
#include <fstream>
#include <iostream>
#include <limits>
#include <map>
#include <regex>
#include <sstream>
#include <string>
#include <vector>
Include dependency graph for SensorCalibration.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fsw::calibration::PolynomialCalibration
class  fsw::calibration::SensorCalibrationManager
struct  fsw::calibration::rtd::CVDCoeffs
struct  fsw::calibration::tc::ColdJunctionConfig
 Cold junction compensation. More...

Namespaces

namespace  fsw
 Motorized ball valve position: raw ADC counts -> % open.
namespace  fsw::calibration
 Output smoothing for calibrated PT pressure, per sensor uid (ESP32 and LabJack T7 alike).
namespace  fsw::calibration::rtd
namespace  fsw::calibration::tc

Enumerations

enum class  fsw::calibration::tc::TCType {
  fsw::calibration::tc::K , fsw::calibration::tc::J , fsw::calibration::tc::T , fsw::calibration::tc::E ,
  fsw::calibration::tc::N , fsw::calibration::tc::S , fsw::calibration::tc::R , fsw::calibration::tc::B ,
  fsw::calibration::tc::CUSTOM
}

Functions

double fsw::calibration::rtd::temp_to_resistance_cvd (double t_c, const CVDCoeffs &cvd=CVDCoeffs{})
 Resistance (Ω) at temperature (°C), IEC 60751 Callendar-Van Dusen, the C term below 0 °C.
double fsw::calibration::rtd::resistance_to_temp_cvd_full (double resistance_ohms, const CVDCoeffs &cvd=CVDCoeffs{})
 The full CVD inverse: exact above 0 °C (the quadratic), Newton on the C term below it.
double fsw::calibration::rtd::rtd_board_adc_to_temp_c (int32_t adc_raw, double adc_ref_voltage, double excitation_ua, double r0_ohms)
 An ESP32 RTD board's reading -> °C: the ADC code (2^31 = adc_ref_voltage) is the voltage across the element carrying excitation_ua, so R = V / I, then the full CVD inverse.
double fsw::calibration::rtd::resistance_to_temp_cvd (double resistance_ohms, const CVDCoeffs &cvd=CVDCoeffs{})
 Convert resistance (Ω) to temperature (°C) using iterative CVD inverse.
double fsw::calibration::rtd::counts_to_resistance (int32_t counts, double gain, double offset)
 Convert ADC counts to resistance (assuming linear relationship).
std::vector< double > fsw::calibration::tc::nist_type_k_mv_to_c ()
 NIST ITS-90 Type K coefficients (0–1372 °C range, voltage in mV → temp in °C) Simplified 9th-order from NIST tables.