State of Charge Estimation for LiFePO4 Batteries Using Extended Kalman Filter

In recent years, the shift toward electric vehicles has accelerated, driven by global goals for carbon neutrality. Among various battery technologies, the LiFePO4 battery stands out due to its high energy density, long cycle life, and environmental friendliness. As a key component in battery management systems, accurate State of Charge (SoC) estimation is crucial for optimizing performance and safety. However, SoC cannot be measured directly and must be estimated through models and algorithms. In this article, I will discuss an approach based on the Extended Kalman Filter (EKF) algorithm for SoC estimation in LiFePO4 batteries, leveraging a second-order Thevenin equivalent circuit model. This method combines parameter identification via Hybrid Pulse Power Characteristic (HPPC) testing with real-time filtering to achieve high accuracy under diverse operating conditions. The LiFePO4 battery, with its stable chemistry and wide applications, serves as an ideal candidate for this study. Throughout this work, I will emphasize the importance of model precision and algorithmic robustness, supported by simulations and analyses.

To begin, selecting an appropriate battery model is essential for capturing the dynamic behavior of the LiFePO4 battery. Equivalent circuit models are preferred for their balance between complexity and accuracy, focusing on external electrical characteristics. Common models include the Rint model, Thevenin model, and PNGV model. For the LiFePO4 battery, I chose the second-order Thevenin model due to its ability to represent both electrochemical polarization and concentration polarization through two RC parallel networks. This model offers a good trade-off: it is more accurate than simpler models while avoiding the excessive computational burden of electrochemical models. The circuit consists of an open-circuit voltage (OCV) source, an ohmic resistance R0, and two RC branches with resistances R1, R2 and capacitances C1, C2. The governing equations are derived from Kirchhoff’s laws:

$$U_t = OCV – I R_0 – U_1 – U_2,$$
$$\frac{dU_1}{dt} = \frac{I}{C_1} – \frac{U_1}{R_1 C_1},$$
$$\frac{dU_2}{dt} = \frac{I}{C_2} – \frac{U_2}{R_2 C_2},$$

where \(U_t\) is the terminal voltage, \(I\) is the current (positive for charging, negative for discharging), and \(U_1\) and \(U_2\) are the voltages across the RC branches. For the LiFePO4 battery, this model effectively simulates transient responses and recovery characteristics, which are vital for SoC estimation in real-world scenarios like electric vehicle operation.

Parameter identification is a critical step to ensure the model accurately reflects the LiFePO4 battery’s behavior across different SoC levels. I conducted HPPC tests on a 100 Ah LiFePO4 battery, adjusting the SoC in 10% increments from 90% down to 10%. Each test involved discharge and charge pulses followed by rest periods to observe voltage dynamics. From these tests, I extracted the OCV-SoC relationship and other parameters. The OCV was measured after 2-hour rests, and a seventh-order polynomial fit was applied:

$$OCV(SoC) = 121.9 \times SoC^7 – 450.6 \times SoC^6 + 673 \times SoC^5 – 522.9 \times SoC^4 + 227.3 \times SoC^3 – 55.45 \times SoC^2 + 7.266 \times SoC + 2.847.$$

This equation allows for OCV approximation at any SoC point for the LiFePO4 battery. For other parameters, such as \(R_0\), \(R_1\), \(R_2\), \(C_1\), and \(C_2\), I analyzed the voltage transients during pulse tests. The ohmic resistance \(R_0\) was calculated from instantaneous voltage drops, while the RC parameters were derived from the zero-input response during rest periods using curve fitting. The results are summarized in the table below, showing how these parameters vary with SoC for the LiFePO4 battery. This variability underscores the need for a variable-parameter model to enhance accuracy.

SoC R0 (Ω) R1 (Ω) C1 (F) R2 (Ω) C2 (F) τ1 (s) τ2 (s)
0.9 0.00066275 0.00013100 3.434065440 0.00020860 46.51162753 0.000449 0.009699
0.8 0.00066500 0.00014350 3.537318050 0.00023470 46.75081772 0.000508 0.010964
0.7 0.00066500 0.00015130 3.534817361 0.00025535 48.94762528 0.000535 0.012498
0.6 0.00067100 0.00013455 3.361344246 0.00021940 48.03073865 0.000452 0.010538
0.5 0.00067050 0.00013835 3.198975739 0.00022595 45.49590467 0.000442 0.010281
0.4 0.00067500 0.00014895 3.129890819 0.00024350 48.52013629 0.000466 0.011814
0.3 0.00070175 0.00016455 2.951594234 0.00026740 51.44032895 0.000485 0.013755
0.2 0.00068800 0.00026700 3.207185310 0.00036980 46.40371325 0.000856 0.017161
0.1 0.00069950 0.00031350 3.114293325 0.00047420 53.36179239 0.000977 0.025304

In this table, τ1 = R1C1 and τ2 = R2C2 represent the time constants of the RC networks, which are crucial for modeling the dynamic response of the LiFePO4 battery. The data reveals that parameters change significantly at lower SoC levels, highlighting the importance of adaptive modeling for the LiFePO4 battery in practical applications.

With the model parameters identified, I proceeded to implement the Extended Kalman Filter algorithm for SoC estimation. The EKF is suitable for nonlinear systems like the LiFePO4 battery model, where the OCV-SoC relationship is polynomial. I formulated the state-space equations by defining the state vector as \(\mathbf{x} = [SoC, U_1, U_2]^T\), with current \(I\) as input and terminal voltage \(U_t\) as output. The continuous-time equations are discretized with a sampling interval Δt = 1 second, leading to:

$$\mathbf{x}_{k+1} = \mathbf{A} \mathbf{x}_k + \mathbf{B} I_k + \mathbf{w}_k,$$
$$U_{t,k+1} = \mathbf{C} \mathbf{x}_{k+1} – R_0 I_k + v_k,$$

where \(\mathbf{w}_k\) and \(v_k\) are process and measurement noises with covariance matrices \(\mathbf{Q}\) and \(R\), respectively. The matrices are defined as:

$$\mathbf{A} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & e^{-\Delta t / \tau_1} & 0 \\ 0 & 0 & e^{-\Delta t / \tau_2} \end{bmatrix},$$
$$\mathbf{B} = \begin{bmatrix} -\eta \Delta t / C_n \\ R_1(1 – e^{-\Delta t / \tau_1}) \\ R_2(1 – e^{-\Delta t / \tau_2}) \end{bmatrix},$$
$$\mathbf{C} = \left[ \frac{\partial OCV(SoC)}{\partial SoC}, -1, -1 \right].$$

Here, \(C_n\) is the nominal capacity (105 Ah for this LiFePO4 battery), and \(\eta\) is the Coulomb efficiency (assumed 1 for simplicity). The EKF algorithm involves prediction and update steps: first, predicting the state and error covariance using the model; then, correcting them with the Kalman gain based on voltage measurements. The Kalman gain \(\mathbf{K}_k\) is computed as:

$$\mathbf{K}_k = \mathbf{P}_k^- \mathbf{C}^T (\mathbf{C} \mathbf{P}_k^- \mathbf{C}^T + R)^{-1},$$

where \(\mathbf{P}_k^-\) is the prior error covariance. This iterative process allows for real-time SoC estimation, effectively handling uncertainties in the LiFePO4 battery system. The variable-parameter approach ensures that model matrices \(\mathbf{A}\), \(\mathbf{B}\), and \(\mathbf{C}\) are updated according to the current SoC, enhancing accuracy across the entire operating range of the LiFePO4 battery.

To validate the EKF-based SoC estimation, I conducted simulations under various discharge conditions for the LiFePO4 battery. The reference SoC was obtained using the Ampere-hour integration method, which provides high accuracy under controlled settings. First, I tested constant-current discharge at 20 A, 60 A, and 100 A. The simulation results showed that the EKF estimates closely matched the reference values, with errors below 1.5% SoC for most of the discharge process. The table below summarizes the maximum errors observed for the LiFePO4 battery under these conditions, demonstrating the robustness of the approach.

Discharge Current (A) Maximum SoC Error (%) Average Voltage Error (V)
20 1.2 0.05
60 1.4 0.07
100 1.5 0.09

These errors are minimal, indicating that the second-order Thevenin model combined with EKF effectively captures the behavior of the LiFePO4 battery. The voltage error, calculated as the difference between simulated and measured terminal voltages, remained within ±0.1 V for SoC above 20%, further validating model precision for the LiFePO4 battery.

Next, I evaluated the system under a dynamic cycling discharge profile based on GB/T 31484-2015 standards for electric commercial vehicles. This profile includes multiple current steps, simulating real-world driving conditions for the LiFePO4 battery. The SoC estimation error was slightly higher in this case, particularly at SoC levels below 20%, where it reached up to 2.5%. This increase can be attributed to parameter identification challenges at low SoC for the LiFePO4 battery, as pulse currents were reduced and voltage changes became more rapid. The following equations illustrate the cumulative effect of errors in dynamic conditions:

$$\text{SoC error} = \text{SoC}_{\text{EKF}} – \text{SoC}_{\text{ref}},$$
$$\text{Voltage error} = U_{t,\text{sim}} – U_{t,\text{meas}},$$

where \(U_{t,\text{sim}}\) is derived from the model. Despite the higher errors at low SoC, the overall performance remained satisfactory, with average errors around 1% for the LiFePO4 battery. The table below provides a detailed breakdown of errors during cycling discharge for the LiFePO4 battery, highlighting the impact of SoC range on estimation accuracy.

SoC Range Average SoC Error (%) Maximum Voltage Error (V) Remarks on LiFePO4 Battery
Above 20% 0.8 0.10 Model parameters well-identified
Below 20% 2.3 0.20 Increased uncertainty due to voltage drop
Overall 1.2 0.15 Suitable for BMS applications

The results underscore the importance of adaptive parameter tuning for the LiFePO4 battery, especially at extreme SoC levels. In practice, this can be addressed by incorporating online parameter identification or using higher-order models. Nonetheless, the EKF algorithm demonstrated rapid convergence and resilience to initial errors, making it a reliable choice for SoC estimation in LiFePO4 battery systems.

In conclusion, this work presents a comprehensive framework for SoC estimation in LiFePO4 batteries using a variable-parameter second-order Thevenin model and the Extended Kalman Filter algorithm. Through HPPC testing, I identified key model parameters that vary with SoC, enabling accurate simulation of the LiFePO4 battery’s dynamic behavior. The EKF implementation effectively handled nonlinearities and noise, yielding SoC estimates with errors under 2.5% across constant-current and cycling discharge conditions. The LiFePO4 battery, with its stable performance and widespread use in electric vehicles, benefits greatly from such precise estimation methods. Future improvements could involve integrating temperature effects or using machine learning for parameter adaptation. Overall, this approach provides a solid foundation for advanced battery management systems, ensuring safe and efficient operation of LiFePO4 battery packs in real-world applications. The repeated focus on the LiFePO4 battery throughout this study highlights its significance in the energy storage landscape, and the methodologies discussed here can be extended to other battery chemistries with appropriate adjustments.

Scroll to Top