code wiki / (root) / nx_vessel_faults.nx

nx_vessel_faults.nx

buildroot/runtime/nx_vessel_faults.nx

3279 B74 linesdepth 5pulls 8 transitivereach 6 importersview sourcekind librarytopic vessel
docsdependenciesstructsconstsfunctions

about

nx_vessel_faults.nx -- H2 of the HARDWARE-IN-THE-LOOP ladder: FAULT INJECTION (the "iron bird" / FMEA rig). Aerospace proves a system fails safe by deliberately breaking it in simulation -- stuck actuators, dead sensors, lost power -- before it ever flies. H2 does the same for the fermenter: inject each hardware failure and prove the design contains the hazard or flags the batch, never silently overheating or shipping unsafe food. THE LAST LINE OF DEFENSE is an INDEPENDENT THERMAL CUTOFF -- a bimetallic thermostat / thermal fuse that acts on the TRUE temperature, wired around the controller. It catches the two failures the controller cannot: a heater stuck on (the command is irrelevant) and a dead sensor (the controller is blind). This is exactly how real appliances are made safe. genealogy_id: fmea_fault_injection + independent_thermal_cutoff + nishi_ferment_safety_r0

dependencies 5 imports · 6 importers

nx_syscalls.nx nx_ferment_safety.nx nx_ferment_thermal.nx nx_vessel_thermal.nx nx_vessel_io.nx nx_vessel_faults.nx nx_vessel_design.nx nx_vessel_design_test.nx nx_vessel_faults_test.nx nx_vessel_geometry_test.nx nx_vessel_twin.nx nx_vessel_twin_test.nx

imports: nx_syscalls.nxnx_ferment_safety.nxnx_ferment_thermal.nxnx_vessel_thermal.nxnx_vessel_io.nx

imported by: nx_vessel_design.nxnx_vessel_design_test.nxnx_vessel_faults_test.nxnx_vessel_geometry_test.nxnx_vessel_twin.nxnx_vessel_twin_test.nx

structs

none

consts

24const NX_VFAULT_NONE: i64 = 0
25const NX_VFAULT_HEATER_STUCK_ON: i64 = 1
26const NX_VFAULT_SENSOR_STUCK_LOW:i64 = 2
27const NX_VFAULT_POWER_LOSS: i64 = 3

functions

31func nx_thermal_cutoff(true_temp_mc: i64, cutoff_mc: i64, requested_duty: i64) -> i64
called by 1: nx_vessel_fault_run
38func nx_fault_heater_duty(fault: i64, controller_duty: i64) -> i64
called by 1: nx_vessel_fault_run
45func nx_fault_sensor_read(fault: i64, measured: i64, stuck_value: i64) -> i64
called by 1: nx_vessel_fault_run
54func nx_vessel_fault_run(env: *NxFermentSafetyEnvelope, twin: *NxVesselThermal,