// PROJECT 001

EV Battery Management System

Full-stack BMS firmware for a 400V li-ion pack with cell balancing algorithms, SoC/SoH estimation, ISO 26262 ASIL-B compliance, and CANopen communication stack. Deployed in a series-production EV powertrain.

C / EmbeddedFreeRTOSCAN / CANopenISO 26262STM32ASIL-B
// CELL STACK — 96S4P 4.18V 4.17V 4.19V 4.21V 4.18V 4.17V ... 96 cells ▲ BAL SoC: 87.3% SoH: 98.1% Temp: 28.4°C Current: -42.8A // SoC ESTIMATION — EKF — Coulomb count -- EKF corrected // CANopen PDO ID: 0x181 DLC: 8 TPDO1: SoC: 87.3% Volt: 399.2V Curr: -42.8A Temp: 28.4°C Flags: 0x00 ● SYSTEM OK CONTACTOR: CLOSED BALANCING: ACTIVE (1 cell) UPTIME: 847h 23m FW: v2.4.1-prod
400VPack Voltage
ASIL-BSafety Level
±1%SoC Accuracy
CANopenProtocol
PlatformSTM32G474 · ARM Cortex-M4 @ 170 MHz
RTOSFreeRTOS 10.4 with MPU protection
Cell ChemistryNMC Li-ion · 96S4P configuration
CommsCANopen + CAN FD · LIN for aux sensors
SafetyISO 26262 ASIL-B · IEC 61508 SIL-2
BalancingPassive dissipation + Active bypass
EstimationExtended Kalman Filter + Coulomb counting

Project Overview

Designed and implemented the complete BMS firmware stack for a 96S4P (400V) NMC lithium-ion battery pack used in a series-production electric vehicle. The system handles all safety-critical functions from cell monitoring to CAN communication with the vehicle ECU.

Key Challenges

SoC Estimation Algorithm

/* EKF predict step — called every 100ms */
void bms_ekf_predict(EKF_t *ekf, float current_A, float dt_s) {
    /* State: SoC (0.0 to 1.0) */
    ekf->x -= (current_A * dt_s) / PACK_CAPACITY_AS;
    ekf->x  = fclampf(ekf->x, 0.0f, 1.0f);
    ekf->P += ekf->Q;  /* Covariance propagation */
}

/* EKF update step — triggered when current < 1A (relaxed) */
void bms_ekf_update(EKF_t *ekf, float v_terminal) {
    float v_ocv  = ocv_lookup(ekf->x, bms.temp_avg_C);
    float H      = docv_dsoc(ekf->x);   /* Jacobian */
    float S      = H * ekf->P * H + ekf->R;
    float K      = ekf->P * H / S;      /* Kalman gain */
    ekf->x      += K * (v_terminal - v_ocv);
    ekf->P       = (1.0f - K * H) * ekf->P;
}

Architecture

Test & Validation

Next →
AWS Fleet Telematics Gateway
← All Projects