|
PER Firmware
|
PDU controls and monitors low-voltage power rails and cooling hardware for the car.
main.cstate.c / state.hg_pdu_state) for all PDU logic.switches.c / switches.hfaults.c / faults.hcooling.c / cooling.hcooling_bangbang.c / cooling_bangbang.htelemetry.c / telemetry.hled/fan_control/flow_rate/g_pdu_state)The shared state contains:
rail_voltage_mv for 24V/5V/3V3 measurements.switch_current_ma[] for sensed currents (switch and rail channels).mux_adc_counts[] and next_mux_channel for mux-sampled inputs.next_rail_fault_index for staggered rail fault scanning.cooling_command for requested/applied cooling outputs.Defined in main.c:
CAN_rx_update (0 ms)CAN_tx_update (5 ms)switches_periodic (15 ms)cooling_periodic (100 ms)faults_periodic (100 ms)fault_library_periodic (100 ms)telemetry_flow_periodic (200 ms)LED_periodic (500 ms)telemetry_power_periodic (500 ms)The bang-bang backend is present for future policy work, but disabled to preserve current behavior.
COOLING_ENABLE_BANGBANG in cooling_bangbang.h0 (default): backend is a no-op.1: motor temp based bang-bang updates are applied.Current non-bangbang behavior remains the active policy path.