π 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.