nx_ferment_thermal.nx
buildroot/runtime/nx_ferment_thermal.nx
about
nx_ferment_thermal.nx -- R1 hardware rung: vessel temperature hold.
Composes nx_pid (control loop) + nx_ferment_safety (the never-poison
envelope CLAMPS every commanded setpoint, so the loop can NEVER
target a temperature above culture-kill). Heat-only actuator model
(a yogurt/cheese vessel heats; cooling is passive loss to ambient) --
the cheapest real hardware.
TWO independent safety layers, so no PID mistuning can cook a culture:
1. setpoint CLAMP at construction (kill - margin), and
2. a hard thermal INTERLOCK in every step: at/above the ceiling the
heater command is forced to 0 regardless of the controller.
With a bounded per-step heat (heater_max * heat_gain) smaller than the
margin, the vessel can never cross culture-kill in a single step.
Proven by the gate: unsafe setpoints clamp; the command is heat-only
and bounded; a room-temperature vessel is driven up into the setpoint
neighborhood; and temperature NEVER reaches culture-kill across the
whole run (the ceiling holds DYNAMICALLY, not just at config time).
genealogy_id: ziegler_nichols_1942_pid (via nx_pid)
+ nishi_ferment_safety_envelope_2026 (via nx_ferment_safety)
dependencies 3 imports · 6 importers
imports: nx_syscalls.nxnx_pid.nxnx_ferment_safety.nx
imported by: nx_ferment_thermal_test.nxnx_vessel_design.nxnx_vessel_design_test.nxnx_vessel_faults.nxnx_vessel_faults_test.nxnx_vessel_io_test.nx
structs
| 30 | struct NxFermentThermal |
consts
| 28 | const NX_FT_SAFE_MARGIN_MILLI_C: i64 = 1000 // hold setpoint + interlock 1 C below kill |
functions
| 38 | func nx_ferment_thermal_safe_setpoint(env: *NxFermentSafetyEnvelope, requested_milli_c: i64) -> i64 |
| 45 | func nx_ferment_thermal_new(env: *NxFermentSafetyEnvelope, called by 3: mainnx_vessel_fault_runmain calls 3: sys_mmapnx_pid_initnx_ferment_thermal_safe_setpoint |
| 63 | func nx_ferment_thermal_step(t: *NxFermentThermal, measured_milli_c: i64) -> i64 |
| 74 | func nx_ferment_plant_step(temp_milli_c: i64, heater_cmd: i64, ambient_milli_c: i64, called by 1: main |