code wiki / (root) / nx_ferment_thermal.nx

nx_ferment_thermal.nx

buildroot/runtime/nx_ferment_thermal.nx

3732 B79 linesdepth 4pulls 5 transitivereach 9 importersview sourcekind librarytopic ferment
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_pid.nx nx_ferment_safety.nx nx_ferment_thermal.nx nx_ferment_thermal_test.nx nx_vessel_design.nx nx_vessel_design_test.nx nx_vessel_faults.nx nx_vessel_faults_test.nx nx_vessel_io_test.nx

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

30struct NxFermentThermal

consts

28const NX_FT_SAFE_MARGIN_MILLI_C: i64 = 1000 // hold setpoint + interlock 1 C below kill

functions

38func nx_ferment_thermal_safe_setpoint(env: *NxFermentSafetyEnvelope, requested_milli_c: i64) -> i64
45func nx_ferment_thermal_new(env: *NxFermentSafetyEnvelope,
63func nx_ferment_thermal_step(t: *NxFermentThermal, measured_milli_c: i64) -> i64
74func nx_ferment_plant_step(temp_milli_c: i64, heater_cmd: i64, ambient_milli_c: i64,
called by 1: main