nx_vessel_io.nx
buildroot/runtime/nx_vessel_io.nx
about
nx_vessel_io.nx -- H1 of the HARDWARE-IN-THE-LOOP ladder: realistic
SENSOR and ACTUATOR models, so the real control software is tested
against imperfect hardware -- not the perfect readings a unit test gives.
A real temperature probe has: thermal LAG (its own mass takes time to
reach the liquid's temperature), QUANTIZATION (a finite-bit ADC), and
NOISE. A real heater is PWM bang-bang with a power cap. H1 models all
of these so the R1 controller can be flown against them in the loop --
catching instability or offset from sensor lag BEFORE the build.
Deterministic by construction (no RNG): "noise" is a reproducible dither
keyed on the step index, so the gate is exact and repeatable.
genealogy_id: hardware_in_the_loop_sim + first_order_sensor_lag + pwm
dependencies 1 imports · 8 importers
imports: nx_syscalls.nx
imported by: nx_vessel_design.nxnx_vessel_design_test.nxnx_vessel_faults.nxnx_vessel_faults_test.nxnx_vessel_geometry_test.nxnx_vessel_io_test.nxnx_vessel_twin.nxnx_vessel_twin_test.nx
structs
| 18 | struct NxSensor |
consts
| none |
functions
| 25 | func nx_sensor_new(init_mc: i64, lag_alpha_milli: i64, |
| 37 | func nx_sensor_update(s: *NxSensor, true_temp_mc: i64, step: i64) -> i64 |
| 55 | func nx_heater_pwm(duty_milli: i64, phase: i64) -> i64 called by 1: main |