You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BMS: implement spec state machine with SN4-aligned charging + safety audit fixes
Reconcile the BMS state machine with the SN5 spec diagram, porting charging
behavior from SN4, then fix issues found in a full SN4-vs-SN5 safety audit.
State machine:
- Re-enable precharge voltage gate (3->4, IVT >= 90% pack), R2D gate (4->5),
and R2D-loss return (5->4); BSPD/APPS remain safe-default TODO stubs
- Central evaluate_faults() on the 1ms tick: cell V/T violations, sensor
timeouts (IVT + cell monitor), overcurrent, continuous IMD, contactor
feedback plausibility; drive group -> FAULT_BMS/IMD, charger group ->
FAULT_CHARGING (explicit handler faults coerced to match, per SN4/diagram)
- All fault states latch until power cycle (updateStateProtected generalized)
- Balance: console 6<->8 transitions + auto-return when cells balanced
Charging (ported from SN4, FreeRTOS-safe):
- New FEB_CAN_Charger module: extended-ID CCS protocol (0x1806E5F4 /
0x18FF50E5), Charging_Status soft/hard limits, trickle charge; charger
actively commanded OFF whenever connected and not in CHARGING;
done_charging re-arms on charger unplug
- New FEB_CAN_Heartbeat module: DASH/PCU presence drives LV_POWER <->
BATTERY_FREE (only-charger-on-CAN / reconnection)
Audit fixes:
- Lock-free ADBMS pack snapshots so the 1ms SM task never blocks on the
ADBMS mutex (temp scans hold it for tens of ms)
- CAN filter consolidation: heartbeats and IVT each use one mask filter;
boot usage drops from 14/14 banks (dynamic registrations silently dropped)
to 4/14; feb_can_filter now reports overflow instead of dropping silently
- Saturating violation counters; charging blocked until first cell scan
Thresholds marked TUNE must be set from real pack/fuse/charger ratings
before track use.
0 commit comments