// PROJECT 007

EV Battery Monitoring System

Real-time battery management system for a 400V lithium-ion EV pack. Custom BMS firmware handles cell-level monitoring over CAN bus, SoC/SoH estimation via extended Kalman filter, thermal management, and ISO 26262 ASIL-B compliant fault handling — improving pack reliability and safety.

CAN 2.0BBMSEmbedded C FreeRTOSISO 26262STM32H7 CANopenLi-Ion / NMC
// CELL MODULES Module 1 (12S) Vcell, Temp, SoC Module 2 (12S) Vcell, Temp, SoC Module 3 (12S) Vcell, Temp, SoC Module 4 (12S) Vcell, Temp, SoC Total: 48S / 400V // STM32H7 BMS MCU CELL MEASUREMENT AFE: LTC6813-1 SPI @ 1 MHz SOC / SOH ESTIMATION Extended Kalman Filter Coulomb Counting PROTECTION LOGIC OV / UV / OT / OC ASIL-B Fault Tree BALANCING Passive / Active CAN 500 kbps output // CAN BUS CAN 2.0B 500 kbps // VEHICLE SYSTEMS VCU (Vehicle Control) Receives SoC, SoH, faults Instrument Cluster SoC display, range estimate Charger Interface CC/CV charge profile Thermal Mgmt Coolant valve control Diagnostics (UDS) ISO 14229 / CAN
Problem
Battery Safety Risk
Lack of real-time cell-level monitoring created safety risks — overcharge, thermal runaway, and cell imbalance were undetected until failure. Warranty costs were rising.
Solution
Real-Time BMS Diagnostics
Custom STM32H7 BMS firmware with LTC6813 AFE, extended Kalman filter for SoC/SoH, FreeRTOS task architecture, and ISO 26262 ASIL-B fault handling over CAN.
Result
Improved Pack Reliability
Cell imbalance detection reduced by 40%, early fault detection prevented 3 thermal events in field trials, and pack lifespan extended by an estimated 18 months.
±1%SoC Accuracy (EKF)
10msFault Response Time
48SCell Count (400V)
ASIL-BSafety Level

SoC Estimation — Extended Kalman Filter

State-of-charge estimation uses an Extended Kalman Filter (EKF) operating on a 2RC equivalent circuit model. The filter fuses coulomb counting with open-circuit voltage lookup to maintain ±1% accuracy across the full charge/discharge envelope, including dynamic load conditions.

/* EKF State: [SoC, V_RC1, V_RC2] */
typedef struct {
    float soc;          // State of Charge (0.0–1.0)
    float v_rc1;        // RC1 polarisation voltage
    float v_rc2;        // RC2 polarisation voltage
    float P[3][3];      // Error covariance matrix
} ekf_state_t;

void bms_ekf_update(ekf_state_t *st, float i_meas, float v_meas, float dt) {
    /* Prediction step */
    st->soc  -= (i_meas * dt) / Q_NOMINAL;   // Coulomb counting
    st->v_rc1 = exp(-dt/TAU1) * st->v_rc1 + R1*(1-exp(-dt/TAU1))*i_meas;
    st->v_rc2 = exp(-dt/TAU2) * st->v_rc2 + R2*(1-exp(-dt/TAU2))*i_meas;

    /* Innovation: measured vs predicted terminal voltage */
    float v_pred = ocv_lookup(st->soc) - st->v_rc1 - st->v_rc2 - R0*i_meas;
    float innov  = v_meas - v_pred;

    /* Update step (simplified) */
    float K = st->P[0][0] / (st->P[0][0] + R_NOISE);
    st->soc  += K * innov;
    st->P[0][0] *= (1.0f - K);   // Covariance update
}

CAN Message Architecture

0x300 — BMS_StatusSoC (%), SoH (%), Pack Voltage, Pack Current — 100ms
0x301 — Cell_Voltages_1Cells 1–8 voltage (mV) — 500ms
0x302 — Cell_Voltages_2Cells 9–16 voltage (mV) — 500ms
0x310 — Thermal_StatusMin/Max/Avg cell temp, coolant temp — 200ms
0x320 — Fault_StatusFault codes, DTC active flags — on-change, QoS critical
0x330 — Charge_LimitsMax charge/discharge current, target voltage — 1s

Safety & Fault Architecture (ISO 26262 ASIL-B)

Technology Stack

MCUSTM32H743 @ 480 MHz, 2 MB Flash, 1 MB SRAM
AFELTC6813-1 (12-cell measurement, isoSPI chain)
FirmwareEmbedded C, FreeRTOS 10.x, HAL + CMSIS
CANCAN 2.0B @ 500 kbps, CANopen DS301, FDCAN peripheral
SafetyISO 26262 ASIL-B, hardware OV/OC comparator, WDT
DiagnosticsUDS (ISO 14229), DTC logging to Flash, CANalyzer validation
← All Projects