|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| struct | Reading |
Functions | |
| double | counts_to_ma (uint32_t counts) |
| double | ma_to_percent_open (double ma) |
| % open, clamped to 0-100 (a loop a little outside 4-20 mA is still the end of travel). | |
| Reading | from_counts (uint32_t counts) |
Variables | |
| constexpr double | kAdcMaxCounts = 4095.0 |
| constexpr double | kAdcRefVolts = 3.3 |
| constexpr double | kShuntOhms = 100.0 |
| constexpr double | kLoopMinMa = 4.0 |
| constexpr double | kLoopMaxMa = 20.0 |
| constexpr double | kNoSignalMa = 2.0 |
| Below this the loop is open or unpowered: no position, not "fully closed". | |
| constexpr uint8_t | kStatusOk = 1 |
| cal_status values published beside the position. | |
| constexpr uint8_t | kStatusNoSignal = 2 |
|
inline |
Definition at line 40 of file ValvePosition.hpp.
References kAdcMaxCounts, kAdcRefVolts, and kShuntOhms.
Referenced by from_counts(), and main().
|
inline |
Definition at line 57 of file ValvePosition.hpp.
References counts_to_ma(), kNoSignalMa, kStatusNoSignal, kStatusOk, and ma_to_percent_open().
|
inline |
% open, clamped to 0-100 (a loop a little outside 4-20 mA is still the end of travel).
Definition at line 45 of file ValvePosition.hpp.
References kLoopMaxMa, and kLoopMinMa.
Referenced by from_counts().
|
constexpr |
Definition at line 20 of file ValvePosition.hpp.
Referenced by counts_to_ma().
|
constexpr |
Definition at line 21 of file ValvePosition.hpp.
Referenced by counts_to_ma().
|
constexpr |
Definition at line 24 of file ValvePosition.hpp.
Referenced by ma_to_percent_open().
|
constexpr |
Definition at line 23 of file ValvePosition.hpp.
Referenced by ma_to_percent_open().
|
constexpr |
Below this the loop is open or unpowered: no position, not "fully closed".
Anything from here up to 4 mA is a closed valve, rounded to 0 % open.
Not 3.5 mA (or NAMUR's 3.6): the ESP32's ADC1 at 11 dB, read raw as counts / 4095 * 3.3 V, reads about 0.1 V low at this end, about 1 mA of loop current. On 2026-11-05 the Ox Vent valve, physically closed, read a steady 353-356 counts = 2.86 mA by this formula, and was shown as NO SIGNAL; the same valve read 0 counts while its loop was unpowered. 2 mA sits clear of both.
Definition at line 34 of file ValvePosition.hpp.
Referenced by from_counts().
|
constexpr |
Definition at line 22 of file ValvePosition.hpp.
Referenced by counts_to_ma().
|
constexpr |
Definition at line 38 of file ValvePosition.hpp.
Referenced by from_counts(), and main().
|
constexpr |
cal_status values published beside the position.
Definition at line 37 of file ValvePosition.hpp.
Referenced by from_counts(), and main().