Co-estimation of Lithium-ion Battery Capacity and State of Charge Using an Improved Dual Extended Kalman Filter

Accurate knowledge of a lithium-ion battery’s internal states is paramount for ensuring the safety, reliability, and longevity of modern energy storage systems and electric vehicles. Among these states, the State of Charge (SOC), defined as the ratio of available capacity to nominal capacity, is the most critical operational parameter, acting as a direct indicator of remaining energy. Concurrently, the actual usable capacity of a lithium-ion battery degrades over time due to complex aging mechanisms, making its precise estimation essential for assessing battery health and predicting end-of-life. The problem of inaccurate SOC estimation is particularly acute in demanding applications, such as mining electric locomotives, where batteries operate in harsh environments and are subjected to high-rate, fluctuating discharge currents. Over-charge or over-discharge events under such conditions can accelerate capacity fade, leading to irreversible damage. Therefore, a robust framework capable of co-estimating both the slowly-varying capacity and the fast-varying SOC in real-time is indispensable for advanced battery management systems (BMS).

Traditional methods for SOC estimation, such as coulomb counting and open-circuit voltage (OCV) lookup, suffer from cumulative errors and impractical resting requirements. Model-based filters, particularly the Extended Kalman Filter (EKF), have become a dominant solution due to their ability to handle system nonlinearities and measurement noise. The EKF linearizes the nonlinear battery model at each operating point. However, this linearization introduces inherent approximation errors, which can degrade estimation accuracy, especially under highly dynamic load profiles common to a lithium-ion battery in traction applications. To address the joint estimation problem, the Dual Extended Kalman Filter (DEKF) was proposed, employing two interacting EKFs operating on separate time scales: one for the fast SOC dynamics and another for the slow capacity degradation. While effective, the core linearization error from the standard EKF remains a bottleneck for precision.

In this work, I propose a comprehensive co-estimation framework that enhances the DEKF’s performance. The framework integrates three key components: (1) an online model parameter identification using the Forgetting Factor Recursive Least Squares (FFRLS) algorithm to ensure model fidelity under varying operating conditions; (2) a Finite Difference method to refine the linearization step within the EKF, leading to a Finite Difference Dual EKF (FDD-EKF); and (3) the synergistic operation of these algorithms for real-time, high-accuracy estimation of both the capacity and SOC of a lithium-ion battery. The performance of this FDD-EKF framework is rigorously validated under both constant-current and realistic dynamic driving cycles, demonstrating superior accuracy compared to conventional DEKF and parameter-fixed EKF approaches.

Lithium-ion Battery Modeling and Online Parameter Identification

An accurate yet computationally tractable model is the foundation of model-based estimation. I employ the second-order Resistance-Capacitance (RC) equivalent circuit model (ECM) to represent the dynamic behavior of the lithium-ion battery. This model offers a favorable balance between complexity and precision, capturing major dynamic effects like ohmic drop and polarization.

The second-order RC model consists of an ideal voltage source $U_{oc}(SOC)$, a series ohmic resistance $R_0$, and two parallel RC networks ($R_1$-$C_1$, $R_2$-$C_2$) that characterize the short-term and long-term polarization dynamics, respectively. The electrical behavior is governed by the following equations:

$$U_t(t) = U_{oc}(SOC(t)) – I(t)R_0 – U_1(t) – U_2(t)$$
$$\tau_1 \frac{dU_1(t)}{dt} + U_1(t) = I(t)R_1, \quad \tau_1 = R_1C_1$$
$$\tau_2 \frac{dU_2(t)}{dt} + U_2(t) = I(t)R_2, \quad \tau_2 = R_2C_2$$
$$\frac{dSOC(t)}{dt} = -\frac{\eta I(t)}{Q_n}$$

where $U_t$ is the terminal voltage, $I$ is the current (positive for discharge), $U_1$ and $U_2$ are the polarization voltages across the RC pairs, $\eta$ is the coulombic efficiency, and $Q_n$ is the nominal capacity of the lithium-ion battery.

For digital implementation in a BMS, the continuous-time model must be discretized. Using a sampling period $\Delta t$ and the zero-order hold (ZOH) assumption for current, the discrete-time state-space representation is derived. The state vector is chosen as $\mathbf{x}_k = [SOC_k, U_{1,k}, U_{2,k}]^T$, with the input being the measured current $I_k$ and the output being the terminal voltage $U_{t,k}$.

$$\mathbf{x}_{k+1} = \mathbf{A}_k \mathbf{x}_k + \mathbf{B}_k I_k + \mathbf{w}_k$$
$$U_{t,k} = U_{oc}(SOC_k) – I_k R_{0,k} – U_{1,k} – U_{2,k} + v_k$$

Where $\mathbf{w}_k$ and $v_k$ are the process and measurement noise, assumed to be white Gaussian. The matrices are defined as:

$$
\mathbf{A}_k = \begin{bmatrix}
1 & 0 & 0 \\
0 & \exp(-\Delta t / \tau_{1,k}) & 0 \\
0 & 0 & \exp(-\Delta t / \tau_{2,k})
\end{bmatrix}, \quad
\mathbf{B}_k = \begin{bmatrix}
-\frac{\eta \Delta t}{Q_n} \\
R_{1,k}(1 – \exp(-\Delta t / \tau_{1,k})) \\
R_{2,k}(1 – \exp(-\Delta t / \tau_{2,k}))
\end{bmatrix}
$$

The model parameters $\theta_k = [R_{0,k}, R_{1,k}, C_{1,k}, R_{2,k}, C_{2,k}]$ are not constant; they vary with SOC, temperature, and aging state of the lithium-ion battery. To maintain model accuracy, these parameters must be identified online. I employ the Forgetting Factor Recursive Least Squares (FFRLS) algorithm for this task. The FFRLS algorithm recursively updates parameter estimates, giving more weight to recent data, which is ideal for tracking the time-varying nature of a lithium-ion battery’s internal impedance.

The discrete-time model equation can be rearranged into a linear-in-parameters form: $y_k = \boldsymbol{\varphi}_k^T \boldsymbol{\theta}_k$, where $y_k$ is a constructed output and $\boldsymbol{\varphi}_k$ is the regressor vector containing past voltages and currents. The standard RLS equations with a forgetting factor $\lambda$ (typically $0.95 < \lambda < 1$) are:

$$ \mathbf{L}_k = \frac{\mathbf{P}_{k-1} \boldsymbol{\varphi}_k}{\lambda + \boldsymbol{\varphi}_k^T \mathbf{P}_{k-1} \boldsymbol{\varphi}_k} $$
$$ \hat{\boldsymbol{\theta}}_k = \hat{\boldsymbol{\theta}}_{k-1} + \mathbf{L}_k (y_k – \boldsymbol{\varphi}_k^T \hat{\boldsymbol{\theta}}_{k-1}) $$
$$ \mathbf{P}_k = \frac{1}{\lambda} (\mathbf{P}_{k-1} – \mathbf{L}_k \boldsymbol{\varphi}_k^T \mathbf{P}_{k-1}) $$

This FFRLS routine runs in parallel with the state estimator, providing real-time updates for the model parameters $\hat{\boldsymbol{\theta}}_k$ at every sampling instant, ensuring the state-space matrices $\mathbf{A}_k$ and $\mathbf{B}_k$ reflect the current condition of the lithium-ion battery.

Improved Dual Extended Kalman Filter with Finite Difference Linearization

The core estimation challenge involves two variables with disparate rates of change: the SOC (changing rapidly with current) and the capacity $Q$ (degrading slowly over cycles). The Dual Extended Kalman Filter (DEKF) addresses this by running two intertwined EKFs. One EKF (the *state filter*) estimates the SOC and polarization voltages ($\mathbf{x}_k$), while the other (the *parameter filter*) estimates the capacity $Q_n$. They exchange information: the state filter uses the latest capacity estimate, and the parameter filter uses the state estimates to formulate its observation model.

However, the conventional EKF’s first-order Taylor series linearization can introduce significant errors for highly nonlinear systems. The observation equation $U_{oc}(SOC)$ is particularly nonlinear. To mitigate this, I replace the analytical Jacobian computation in the EKF with a Finite Difference (FD) approximation, creating a more robust FDD-EKF.

In the standard EKF, the measurement matrix $\mathbf{H}_k$ is computed as the Jacobian of the output function $h(\mathbf{x}_k, I_k)$ with respect to the state vector. For our model:

$$ \mathbf{H}_k^{EKF} = \frac{\partial h}{\partial \mathbf{x}} \bigg|_{\hat{\mathbf{x}}_{k|k-1}} = \left[ \frac{dU_{oc}}{dSOC} \bigg|_{SOC=\widehat{SOC}_{k|k-1}}, -1, -1 \right] $$

The term $\frac{dU_{oc}}{dSOC}$ requires knowledge of the OCV-SOC curve’s derivative, which can be sensitive to linearization point inaccuracies. The finite difference method approximates this derivative without needing an explicit functional form. Using a central difference scheme for better accuracy:

$$ \frac{\partial h}{\partial SOC} \approx \frac{h(\widehat{SOC}_{k|k-1}+ \delta, \hat{U}_{1,k|k-1}, \hat{U}_{2,k|k-1}, I_k) – h(\widehat{SOC}_{k|k-1}- \delta, \hat{U}_{1,k|k-1}, \hat{U}_{2,k|k-1}, I_k)}{2\delta} $$

where $\delta$ is a small perturbation (e.g., 0.01). This yields a numerically computed measurement matrix $\mathbf{H}_k^{FD}$. This approach is more robust as it directly reflects the local nonlinearity of the system at the predicted state, reducing linearization errors inherent in the analytical Jacobian for the lithium-ion battery model.

The complete FDD-EKF algorithm for co-estimation is structured as follows. The two filters operate with different state vectors and dynamics models but share information.

1. State Filter (for $\mathbf{x}_k = [SOC_k, U_{1,k}, U_{2,k}]^T$)
This filter runs at the fast sampling rate (e.g., 1 Hz).

  • Prediction Step:
    State: $\hat{\mathbf{x}}_{k|k-1} = \mathbf{A}_{k-1} \hat{\mathbf{x}}_{k-1|k-1} + \mathbf{B}_{k-1} I_{k-1}$
    Covariance: $\mathbf{P}_{k|k-1}^x = \mathbf{A}_{k-1} \mathbf{P}_{k-1|k-1}^x \mathbf{A}_{k-1}^T + \mathbf{Q}^x$
    (where $\mathbf{A}_{k-1}, \mathbf{B}_{k-1}$ use parameters from FFRLS and capacity $\hat{Q}_{k-1}$ from the parameter filter)
  • Update Step:
    Innovation: $\tilde{y}_k = U_{t,k} – h(\hat{\mathbf{x}}_{k|k-1}, I_k)$
    Compute $\mathbf{H}_k^{FD}$ using finite difference as described.
    Kalman Gain: $\mathbf{K}_k^x = \mathbf{P}_{k|k-1}^x (\mathbf{H}_k^{FD})^T [\mathbf{H}_k^{FD} \mathbf{P}_{k|k-1}^x (\mathbf{H}_k^{FD})^T + \mathbf{R}]^{-1}$
    State Update: $\hat{\mathbf{x}}_{k|k} = \hat{\mathbf{x}}_{k|k-1} + \mathbf{K}_k^x \tilde{y}_k$
    Covariance Update: $\mathbf{P}_{k|k}^x = (\mathbf{I} – \mathbf{K}_k^x \mathbf{H}_k^{FD}) \mathbf{P}_{k|k-1}^x$

2. Parameter Filter (for $Q_k$)
This filter runs at a slower rate (e.g., every N=10 state filter cycles) due to the slow variation of capacity in a lithium-ion battery.

  • Prediction Step:
    Parameter: $\hat{Q}_{k|k-1} = \hat{Q}_{k-1|k-1}$ (modeled as a random walk)
    Covariance: $\mathbf{P}_{k|k-1}^Q = \mathbf{P}_{k-1|k-1}^Q + \mathbf{Q}^Q$
  • Update Step:
    The observation for the capacity filter is derived from the coulomb counting principle over a window of time. The “measured” capacity change is inferred from the accumulated ampere-hours and the change in SOC estimated by the state filter.
    Innovation: The difference between the SOC change predicted by ampere-hour integration using current $\hat{Q}_{k|k-1}$ and the SOC change reported by the state filter $\Delta \widehat{SOC}$.
    The corresponding observation matrix is computed numerically using finite difference with respect to $Q$.
    Kalman Gain, parameter, and covariance updates proceed analogously to the state filter.

The symbiotic relationship is clear: the state filter needs an accurate $\hat{Q}$ for correct SOC tracking in its $\mathbf{B}$ matrix, and the parameter filter needs accurate $\Delta \widehat{SOC}$ from the state filter to update the capacity. The integrated FFRLS-FDD-EKF framework is summarized in the following table.

Table 1: Algorithmic Steps of the Integrated FFRLS-FDD-EKF Framework
Step FFRLS (Parameter ID) FDD-EKF State Filter FDD-EKF Parameter Filter
Input $I_k$, $U_{t,k}$ $I_k$, $U_{t,k}$, $\hat{\theta}_k$, $\hat{Q}_{k-1}$ $\Delta \widehat{SOC}$, $\sum I \Delta t$
Core Action Update model parameters $\hat{\theta}_k$ using RLS with forgetting. Predict & update $\hat{\mathbf{x}}_k$ using FD-linearized EKF. Predict & update $\hat{Q}_k$ using FD-linearized EKF.
Output $\hat{\theta}_k = [R_0, R_1, C_1, R_2, C_2]$ $\hat{\mathbf{x}}_k = [\widehat{SOC}_k, \hat{U}_{1,k}, \hat{U}_{2,k}]$ $\hat{Q}_k$ (Capacity)
Update Rate Every sample Every sample (Fast) Every N samples (Slow)

Experimental Validation and Results Analysis

To validate the proposed FFRLS-FDD-EKF algorithm, experimental tests were conducted on a commercial 18650 cylindrical lithium-ion battery (NCR18650B, 3.7V, 3.35Ah). The test bench comprised a programmable DC load (IT8812C), a Keithley 2260B DC power supply, a thermal chamber, and a data acquisition system. All tests were performed at a constant ambient temperature of 25°C.

Two distinct discharge profiles were used to evaluate performance:

  1. Constant Current (CC) Discharge: The fully charged battery was discharged at a steady 0.5C rate (≈1.67A) until the cut-off voltage of 2.5V.
  2. Dynamic Profile (Beijing Bus Dynamic Stress Test – BBDST): This profile, derived from real electric bus operation data, features highly fluctuating currents that simulate the strenuous conditions faced by a mining locomotive’s lithium-ion battery pack. It provides a rigorous test for algorithm robustness.

The performance of the proposed FFRLS-FDD-EKF method was compared against two benchmark algorithms:

  • DEKF with Offline Parameters: A standard DEKF using a fixed set of model parameters identified at the beginning of the test.
  • FFRLS-DEKF: A DEKF enhanced with online FFRLS parameter identification but using the standard analytical Jacobian.

The reference SOC for error calculation was obtained using high-precision coulomb counting with a known initial SOC. The reference capacity was determined from a separate constant-current discharge test. Key error metrics were calculated: Maximum Absolute Error (MAE), Average Absolute Error (AAE), and Root Mean Square Error (RMSE).

Results under Constant Current Discharge

Figure X (conceptual) shows the terminal voltage estimation comparison. The FFRLS-FDD-EKF and FFRLS-DEKF algorithms showed better tracking than the offline-parameter DEKF, especially during the high-polarization regions at the beginning and end of discharge. The finite difference refinement in FDD-EKF provided the smallest voltage residual error.

The SOC estimation results are quantitatively summarized in Table 2. While all algorithms performed reasonably well under this steady condition, the proposed FFRLS-FDD-EKF achieved the lowest error metrics. The finite difference linearization reduced the approximation error in the update step, yielding a more accurate SOC trajectory for the lithium-ion battery.

Table 2: SOC Estimation Error Comparison under Constant Current Discharge
Algorithm Max. Abs. Error (MAE) % Avg. Abs. Error (AAE) % RMSE %
DEKF (Offline Params) 1.70 0.75 0.85
FFRLS-DEKF 1.60 0.70 0.81
FFRLS-FDD-EKF (Proposed) 1.27 0.68 0.79

Results under Dynamic BBDST Profile

The dynamic profile presented a much greater challenge. The superiority of the proposed method became significantly more pronounced. Figure Y (conceptual) illustrates the SOC estimation curves. The DEKF with offline parameters struggled to track the reference, accumulating error during high-current pulses and recovery phases. The FFRLS-DEKF showed marked improvement by adapting model parameters online. However, the FFRLS-FDD-EKF demonstrated the most stable and accurate tracking throughout the entire stressful cycle, closely following the reference SOC of the lithium-ion battery.

Table 3 presents the decisive results. The proposed algorithm reduced the RMSE by approximately 44% compared to the offline-parameter DEKF and by 36% compared to the FFRLS-DEKF. The maximum error was also substantially contained below 0.4%. This clearly validates the hypothesis that combining online parameter identification (FFRLS) with improved linearization (Finite Difference) is highly effective for SOC estimation under real-world, dynamic operating conditions for a lithium-ion battery.

Table 3: SOC Estimation Error Comparison under Dynamic BBDST Profile
Algorithm Max. Abs. Error (MAE) % Avg. Abs. Error (AAE) % RMSE %
DEKF (Offline Params) 1.08 0.21 0.25
FFRLS-DEKF 0.49 0.14 0.22
FFRLS-FDD-EKF (Proposed) 0.38 0.11 0.14

Furthermore, the capacity estimation capability of the FDD-EKF framework was evaluated. Starting from an initial guess, all DEKF-based methods converged towards the battery’s actual capacity. The proposed method showed faster convergence and lower steady-state estimation noise compared to the other two, as it benefited from more accurate state estimates during its update phase. The capacity estimation error metrics are summarized in Table 4.

Table 4: Capacity Estimation Error Comparison (Final Portion of BBDST Test)
Algorithm Max. Abs. Error (mAh) Avg. Abs. Error (mAh) RMSE (mAh)
DEKF (Offline Params) 118.45 27.28 41.49
FFRLS-DEKF 123.05 22.17 38.16
FFRLS-FDD-EKF (Proposed) 111.27 21.71 37.16

Conclusion

In this work, I have developed and validated an advanced co-estimation framework for the simultaneous online determination of State of Charge (SOC) and capacity in lithium-ion batteries. The framework innovatively integrates online model parameter identification via the Forgetting Factor Recursive Least Squares (FFRLS) algorithm with an enhanced Dual Extended Kalman Filter (DEKF), where the conventional linearization step is improved using a Finite Difference (FD) method. This FFRLS-FDD-EKF approach effectively addresses the limitations of standard EKF-based methods, namely, the errors induced by model parameter drift and first-order Taylor series linearization.

Experimental results under both constant-current and highly dynamic driving cycles demonstrate the superior performance of the proposed method. Specifically, for the challenging dynamic profile representative of real-world applications like mining locomotives, the algorithm achieved an SOC estimation RMSE of only 0.14% and a maximum absolute error of 0.38%, significantly outperforming conventional DEKF and FFRLS-aided DEKF. The framework also provided stable and convergent estimates of the lithium-ion battery’s capacity, a key health indicator.

The practical implications are substantial. By providing highly accurate and robust estimates of both SOC and capacity in real-time, this co-estimation framework enables smarter battery management. It can help prevent harmful over-charge and over-discharge events, optimize charging strategies, assess state-of-health, and ultimately extend the operational life and enhance the safety of lithium-ion battery packs in demanding applications such as electric vehicles, grid storage, and industrial machinery. The proposed FFRLS-FDD-EKF algorithm represents a significant step towards more reliable and intelligent battery management systems.

Scroll to Top