code wiki / (root) / nx_vessel_io.nx

nx_vessel_io.nx

buildroot/runtime/nx_vessel_io.nx

2361 B58 linesdepth 2pulls 2 transitivereach 8 importersview sourcekind librarytopic vessel
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_vessel_io.nx nx_vessel_design.nx nx_vessel_design_test.nx nx_vessel_faults.nx nx_vessel_faults_test.nx nx_vessel_geometry_test.nx nx_vessel_io_test.nx nx_vessel_twin.nx nx_vessel_twin_test.nx

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

18struct NxSensor

consts

none

functions

25func nx_sensor_new(init_mc: i64, lag_alpha_milli: i64,
called by 2: nx_vessel_fault_runmain calls 1: sys_mmap
37func nx_sensor_update(s: *NxSensor, true_temp_mc: i64, step: i64) -> i64
55func nx_heater_pwm(duty_milli: i64, phase: i64) -> i64
called by 1: main