πŸŽ“ Lesson 11 D5

Extended Kalman Filter Implementation for SoC

The Extended Kalman Filter (EKF) is a smart math tool that estimates a battery’s remaining charge by combining real sensor measurements with predictions from a battery model, even when the system behaves in complex, non-linear ways.

🎯 Learning Objectives

  • βœ“ Explain the role of Jacobian linearization in adapting the Kalman Filter for non-linear battery dynamics
  • βœ“ Calculate Jacobian matrices for a first-order equivalent circuit model (ECM) of a lithium-ion cell
  • βœ“ Design an EKF estimator in MATLAB or Python to fuse voltage, current, and temperature measurements for SoC estimation
  • βœ“ Analyze estimation error and convergence behavior under dynamic load profiles (e.g., UDDS or WLTP drive cycles)
  • βœ“ Apply tuning parameters (Q, R, Pβ‚€) to balance responsiveness and noise rejection in real-time SoC estimation

πŸ“– Why This Matters

Accurate State of Charge (SoC) estimation is critical for safety, longevity, and performance of battery energy storage systems β€” especially in mining equipment (e.g., electric haul trucks) operating under extreme thermal and load transients. Unlike simple Coulomb counting, the EKF accounts for voltage hysteresis, internal resistance drift, and temperature-dependent capacity loss β€” making it the industry-standard estimator deployed in commercial BMS for off-highway vehicles (e.g., CAT R1700, Komatsu HD785). Without robust SoC estimation, over-discharge risks cell damage, while overestimation compromises mission-critical runtime prediction.

πŸ“˜ Core Principles

The EKF extends the linear Kalman Filter to handle non-linear systems like batteries by approximating the non-linear state transition and measurement functions via first-order Taylor expansions β€” i.e., computing Jacobians at each time step. The battery state vector typically includes SoC and open-circuit voltage (OCV), while inputs include current and temperature. The process model captures OCV–SoC hysteresis and polarization dynamics; the measurement model relates terminal voltage to SoC, resistance, and SOC-dependent OCV. Key theoretical considerations include observability (can SoC be uniquely inferred from voltage/current?), numerical stability (Jacobian singularity near low/high SoC), and consistency between model fidelity and computational constraints on embedded BMS hardware.

πŸ“ EKF Prediction and Update Steps

The EKF operates in two phases: (1) Time update (prediction) uses the non-linear process model and its Jacobian Fβ‚– to project state and covariance forward; (2) Measurement update (correction) uses the non-linear measurement model and its Jacobian Hβ‚– to fuse new voltage data. Proper initialization and covariance tuning are essential to avoid divergence.

πŸ’‘ Worked Example

Problem: Given a first-order ECM: xβ‚– = [SoCβ‚–, Vβ‚šβ‚–]α΅€, with f(xₖ₋₁,uₖ₋₁) = [SoCₖ₋₁ βˆ’ (Ξ·Β·iₖ₋₁)/(3600Β·Cβ‚™), Vβ‚šβ‚–β‚‹β‚Β·exp(βˆ’Ξ”t/Ο„) + Rβ‚šΒ·iₖ₋₁·(1βˆ’exp(βˆ’Ξ”t/Ο„))], where Ξ·=0.98, Cβ‚™=120 Ah, iₖ₋₁=βˆ’150 A, Ξ”t=1 s, Ο„=45 s, Rβ‚š=0.002 Ξ©. Compute Jacobian Fβ‚– at xβ‚€ = [0.7, 0.1]α΅€.
1. Step 1: Identify partial derivatives βˆ‚f₁/βˆ‚SoC = 1, βˆ‚f₁/βˆ‚Vβ‚š = 0; βˆ‚fβ‚‚/βˆ‚SoC = 0, βˆ‚fβ‚‚/βˆ‚Vβ‚š = exp(βˆ’1/45) β‰ˆ 0.978.
2. Step 2: Assemble Fβ‚– = [[1, 0], [0, 0.978]].
3. Step 3: Verify Fβ‚– is stable (eigenvalues < 1): λ₁=1, Ξ»β‚‚β‰ˆ0.978 β†’ marginally stable β€” acceptable for SoC tracking with correction.
Answer: Fβ‚– = [[1.000, 0.000], [0.000, 0.978]], confirming local linearization is numerically sound for this timestep.

πŸ—οΈ Real-World Application

In the 2023 deployment of the Liebherr T 282C electric-drive haul truck retrofit, the OEM integrated an EKF-based SoC estimator using a dual-polarization ECM trained on -20Β°C to 55Β°C lab cycling data. The estimator fused CAN-bus current/voltage/temperature telemetry at 10 Hz and achieved Β±1.2% SoC RMSE across 200+ mine-shift cycles β€” outperforming Coulomb counting (Β±4.7%) and Luenberger observers (Β±2.9%). Critical success factors included online Jacobian recomputation every 5 seconds and adaptive R-matrix scaling based on current magnitude to suppress noise during regenerative braking spikes.

πŸ“š References