Accurately estimating the State of Charge (SOC) of batteries is a fundamental and critical challenge for the effective management and reliable operation of modern battery energy storage systems (BESS). As global energy transitions accelerate, the role of BESS in integrating intermittent renewable sources and providing grid stability has become paramount. Precise SOC knowledge is indispensable for preventing overcharge and over-discharge, optimizing charge/discharge strategies, conducting state-of-health assessments, and ensuring the safety and longevity of the entire battery energy storage system. However, the SOC of a lithium-ion battery is an internal state that cannot be measured directly and must be inferred from external, measurable parameters such as terminal voltage and current. This estimation is complicated by the battery’s highly nonlinear electrochemical behavior, which exhibits significant time-varying characteristics due to factors like aging, temperature fluctuations, and varying operational loads.
Traditional methods for SOC estimation, such as the Ampere-hour (Ah) integration method and the Open-Circuit Voltage (OCV) method, have inherent limitations. The Ah integration method suffers from cumulative errors due to sensor inaccuracies and an unknown initial SOC, while the OCV method requires long rest periods for the battery voltage to stabilize, making it unsuitable for real-time applications within an active battery energy storage system. Consequently, model-based estimation techniques have gained prominence. Among these, Kalman Filter (KF) variants offer a robust framework for state estimation in dynamic systems by employing a “predict-measure-correct” recursive cycle. However, the performance of these filters is heavily dependent on the accuracy of the underlying battery model and its parameters. A critical advancement lies in moving from offline, look-up-table-based parameter identification to online, adaptive methods that can track parameter changes in real-time as the battery operates within the battery energy storage system.
This article presents a sophisticated joint estimation methodology for real-time SOC determination in lithium-ion batteries, specifically designed for applications within large-scale battery energy storage systems. The core of the method is the synergistic coupling of a Variable Forgetting Factor Recursive Least Squares (VFFRLS) algorithm for online parameter identification and an Unscented Kalman Filter (UKF) for robust state estimation. The VFFRLS algorithm continuously identifies and updates the parameters of a high-fidelity battery model based on real-time operational data. These updated parameters are then fed into the UKF algorithm, which performs the actual SOC estimation. This closed-loop, adaptive approach ensures that the SOC estimation remains accurate even as the battery’s internal characteristics evolve, addressing a key challenge in the long-term management of a battery energy storage system. We will detail the battery model, the online identification and state estimation algorithms, their integration, and finally, present experimental validation of the method’s superior accuracy and stability.
Battery Modeling for the Energy Storage System
The foundation of any model-based state estimation strategy is an accurate yet computationally efficient battery model. For implementation in a battery management system (BMS) controlling a battery energy storage system, equivalent circuit models (ECMs) are widely favored due to their good balance between simplicity and dynamic representation. We employ the Dual Polarization (DP) model, a second-order RC equivalent circuit, which effectively captures the major dynamic voltage behaviors of a lithium-ion battery cell, a fundamental unit of any battery energy storage system.

The DP model consists of a voltage source representing the open-circuit voltage \(U_{OC}\), an ohmic internal resistor \(R_0\), and two parallel RC networks (\(R_1C_1\) and \(R_2C_2\)). The RC networks model the polarization effects—short-term and long-term voltage relaxation dynamics—observed during and after charge/discharge pulses. \(U_t\) is the measurable terminal voltage, and \(I\) is the load current (positive for discharge, negative for charge).
The electrical behavior is described by the following equations:
$$
\begin{aligned}
U_t(t) &= U_{OC}(t) – I(t)R_0 – U_1(t) – U_2(t) \\
I(t) &= \frac{U_1(t)}{R_1} + C_1 \frac{dU_1(t)}{dt} \\
I(t) &= \frac{U_2(t)}{R_2} + C_2 \frac{dU_2(t)}{dt}
\end{aligned}
$$
where \(U_{OC}\) is a function of the SOC, often established experimentally: \(U_{OC} = f(SOC)\). Discretizing these equations with a sampling period \(T_s\) yields the model used for real-time simulation and estimation within the battery energy storage system’s BMS:
$$
U_t(k) = U_{OC}(k) – I(k)R_0 – I(k)R_1\left(1 – e^{-T_s/\tau_1}\right) – I(k)R_2\left(1 – e^{-T_s/\tau_2}\right)
$$
Here, \(k\) denotes the discrete time step, and \(\tau_1 = R_1C_1\), \(\tau_2 = R_2C_2\) are the time constants of the polarization circuits. The accuracy of SOC estimation using this model within a battery energy storage system hinges on knowing the precise values of the parameters \(\theta = [R_0, R_1, C_1, R_2, C_2]\), which are not constant and vary with SOC, temperature, aging (SOH), and load history.
Online Parameter Identification via Variable Forgetting Factor Recursive Least Squares (VFFRLS)
To adapt the DP model to the changing state of a battery cell in an operational battery energy storage system, we employ an online parameter identification algorithm. The Recursive Least Squares (RLS) algorithm is a classic choice due to its computational efficiency and suitability for real-time applications. However, standard RLS has a “data saturation” problem: as more data is processed, the algorithm becomes less responsive to new information, making it unable to track sudden changes in system parameters. This is addressed by introducing a forgetting factor \(\lambda\) (\(0 < \lambda \leq 1\)) that discounts older data. The update equations for the Forgetting Factor RLS (FFRLS) are:
$$
\begin{aligned}
e(k) &= y(k) – \phi^T(k)\hat{\theta}(k-1) \\
K(k) &= \frac{P(k-1)\phi(k)}{\lambda + \phi^T(k)P(k-1)\phi(k)} \\
\hat{\theta}(k) &= \hat{\theta}(k-1) + K(k)e(k) \\
P(k) &= \frac{1}{\lambda}\left[I – K(k)\phi^T(k)\right]P(k-1)
\end{aligned}
$$
Here, \(\hat{\theta}(k)\) is the parameter estimate vector, \(y(k)\) is the system output (a function of voltage), \(\phi(k)\) is the regressor vector (containing past currents and voltages), \(e(k)\) is the prediction error, \(K(k)\) is the gain vector, and \(P(k)\) is the error covariance matrix. A fixed \(\lambda\) presents a trade-off: a value close to 1 provides stability but slow adaptation, while a smaller value allows fast tracking but may cause instability and high noise sensitivity. This is suboptimal for a dynamic battery energy storage system.
We implement a Variable Forgetting Factor RLS (VFFRLS) where \(\lambda(k)\) is adjusted online based on the innovation sequence \(e(k)\). The formula is designed to increase responsiveness during dynamic transients and enhance stability during steady states:
$$
\lambda(k) = 1 – \frac{e^2(k)}{1 + K^T(k)P(k)K(k)}
$$
When the system state changes rapidly (e.g., a large load pulse in the battery energy storage system), the prediction error \(e(k)\) increases, causing \(\lambda(k)\) to decrease. This effectively “forgets” old data more quickly, allowing the algorithm to rapidly learn the new model parameters from fresh data. As the model converges and the error decreases, \(\lambda(k)\) increases towards 1, expanding the effective data window and providing a smooth, stable, and accurate parameter estimate with lower noise sensitivity.
To apply VFFRLS to the DP model, we derive its transfer function and convert it to a discrete-time Auto-Regressive with eXogenous input (ARX) form \(y(k) = \phi^T(k)\theta\). The regressor and parameter vectors for identification are:
$$
\begin{aligned}
\phi(k) &= [1, U_t(k-1), U_t(k-2), I(k), I(k-1), I(k-2)]^T \\
\theta(k) &= [(1-\alpha_1-\alpha_2)U_{OC}(k), \alpha_1, \alpha_2, \alpha_3, \alpha_4, \alpha_5]^T
\end{aligned}
$$
The VFFRLS algorithm recursively estimates \(\theta(k)\). The physical DP model parameters (\(R_0, R_1, C_1, R_2, C_2\)) are then recovered from the elements of \(\theta(k)\) via an algebraic transformation. Practical constraints (e.g., \(R_i > 0\), \(\tau_i > 0\)) are applied to the results to ensure physical plausibility and algorithm stability for the battery energy storage system.
State of Charge Estimation via Unscented Kalman Filter (UKF)
With an accurately identified model from the VFFRLS stage, we now address the core task: estimating the SOC. The UKF is a powerful nonlinear estimation filter that outperforms the Extended Kalman Filter (EKF) for battery applications because it does not require linearization of the system equations, which can introduce significant errors. The UKF uses a deterministic sampling technique known as the unscented transform to propagate the mean and covariance of the state distribution through the nonlinear system.
We define the state vector for our battery cell model as \(x_k = [SOC_k, U_{1,k}, U_{2,k}]^T\), where \(U_{1,k}\) and \(U_{2,k}\) are the polarization voltages. The system input is the measured current \(u_k = I_k\), and the output is the terminal voltage \(y_k = U_{t,k}\). The discrete-time nonlinear state-space model derived from the DP model is:
$$
\begin{aligned}
x_k &= f(x_{k-1}, u_{k-1}) + w_{k-1} \\
y_k &= h(x_k, u_k) + v_k
\end{aligned}
$$
where \(w_k\) and \(v_k\) are uncorrelated zero-mean Gaussian process and measurement noise with covariances \(Q_k\) and \(R_k\), respectively. The functions \(f(\cdot)\) and \(h(\cdot)\) are:
$$
\begin{aligned}
f(x_{k-1}, u_{k-1}) &=
\begin{bmatrix}
1 & 0 & 0\\
0 & e^{-T_s/(R_1C_1)} & 0\\
0 & 0 & e^{-T_s/(R_2C_2)}
\end{bmatrix} x_{k-1} + \begin{bmatrix}
-\frac{\eta T_s}{C_n} \\
R_1(1 – e^{-T_s/(R_1C_1)}) \\
R_2(1 – e^{-T_s/(R_2C_2)})
\end{bmatrix} u_{k-1} \\
h(x_k, u_k) &= U_{OC}(SOC_k) – U_{1,k} – U_{2,k} – R_0 u_k
\end{aligned}
$$
Here, \(C_n\) is the nominal capacity and \(\eta\) is the Coulombic efficiency. The UKF algorithm proceeds as follows for each time step \(k\) within the battery energy storage system’s BMS:
1. Initialization: Set initial state estimate \(\hat{x}_0\) and error covariance \(P_0\).
2. Sigma Point Calculation: Generate \(2L+1\) sigma points \(\mathcal{X}_{i,k-1}\) (where \(L\) is the state dimension) around the prior estimate \(\hat{x}_{k-1}\).
3. Time Update (Prediction): Propagate each sigma point through the state function \(f(\cdot)\) and compute the predicted state mean \(\hat{x}^-_k\) and covariance \(P^-_k\).
4. Measurement Update (Correction): Propagate the predicted sigma points through the measurement function \(h(\cdot)\). Compute the predicted measurement mean \(\hat{y}^-_k\), its covariance \(P_{y,k}\), and the cross-covariance \(P_{xy,k}\). Calculate the Kalman gain \(K_k\).
5. State Estimation: Update the state estimate and its covariance using the actual measurement \(y_k\) (the measured terminal voltage).
The relevant equations are summarized below:
$$
\begin{aligned}
\hat{x}^-_k &= \sum_{i=0}^{2L} W_i^{(m)} f(\mathcal{X}_{i,k-1}, u_{k-1}) \\
P^-_k &= \sum_{i=0}^{2L} W_i^{(c)} (f(\mathcal{X}_{i,k-1}) – \hat{x}^-_k)(f(\mathcal{X}_{i,k-1}) – \hat{x}^-_k)^T + Q_{k-1} \\
\hat{y}^-_k &= \sum_{i=0}^{2L} W_i^{(m)} h(f(\mathcal{X}_{i,k-1}), u_k) \\
P_{y,k} &= \sum_{i=0}^{2L} W_i^{(c)} (h(f(\mathcal{X}_{i,k-1})) – \hat{y}^-_k)(h(f(\mathcal{X}_{i,k-1})) – \hat{y}^-_k)^T + R_k \\
P_{xy,k} &= \sum_{i=0}^{2L} W_i^{(c)} (f(\mathcal{X}_{i,k-1}) – \hat{x}^-_k)(h(f(\mathcal{X}_{i,k-1})) – \hat{y}^-_k)^T \\
K_k &= P_{xy,k} P_{y,k}^{-1} \\
\hat{x}_k &= \hat{x}^-_k + K_k (y_k – \hat{y}^-_k) \\
P_k &= P^-_k – K_k P_{y,k} K_k^T
\end{aligned}
$$
Here, \(W_i^{(m)}\) and \(W_i^{(c)}\) are weights associated with the sigma points. This recursive process provides an optimal (in the minimum mean-square error sense) estimate of the SOC and the internal polarization voltages in real-time.
The Integrated VFFRLS-UKF Joint Estimation Method
The synergy between VFFRLS and UKF creates a powerful, self-correcting framework for SOC estimation in a battery energy storage system. The integration overcomes the individual limitations of each algorithm: UKF’s performance depends on accurate model parameters, while VFFRLS benefits from an accurate state (SOC) to determine the correct operating point for parameter identification (since \(U_{OC}\) is a function of SOC).
The joint algorithm operates in a closed loop as follows:
1. Initialization: Start with an initial SOC guess (e.g., from OCV after a long rest) and an initial set of model parameters (from an offline table or nominal values).
2. UKF Prediction/Correction Cycle: The UKF uses the current parameter set \(\theta_{k-1} = [R_0, R_1, C_1, R_2, C_2]_{k-1}\) in its state-space model \(f(\cdot)\) and \(h(\cdot)\) to estimate the state \(\hat{x}_k = [\widehat{SOC}_k, \hat{U}_{1,k}, \hat{U}_{2,k}]^T\).
3. OCV Look-up: The estimated \(\widehat{SOC}_k\) is used to obtain the corresponding open-circuit voltage \(U_{OC}(k)\) from the pre-characterized SOC-OCV curve.
4. VFFRLS Parameter Update: Using the measured \(I_k\), \(U_{t,k}\), and the \(U_{OC}(k)\) from step 3, the VFFRLS algorithm executes its update routine to compute a new, refined set of model parameters \(\theta_k\).
5. Model Update for UKF: The newly identified parameters \(\theta_k\) are fed back into the UKF’s state-space equations, updating the model for the next estimation cycle (step 2).
This continuous feedback ensures that the UKF always operates with a model that reflects the battery’s current internal impedance and dynamic characteristics, dramatically improving the accuracy and robustness of the SOC estimate over the battery’s lifespan within the energy storage system. The adaptive nature of VFFRLS ensures the parameter identification remains responsive to changes, a critical feature for managing a large-scale battery energy storage system subject to complex duty cycles.
Experimental Validation and Performance Analysis
The proposed VFFRLS-UKF joint estimation method was validated using experimental data from a commercial 96 Ah Lithium Iron Phosphate (LiFePO4) battery cell, representative of the cells used in grid-scale battery energy storage systems. Tests were conducted at a controlled temperature of 25°C ± 2°C. The Hybrid Pulse Power Characterization (HPPC) test profile, which includes discharge/charge pulses and rest periods, was used to excite the battery dynamics thoroughly.
1. Performance of VFFRLS Online Identification:
The VFFRLS algorithm’s ability to track model parameters was first evaluated. Figure 5 (in the original text) shows the terminal voltage calculated using the DP model with parameters identified by VFFRLS (with a fixed, well-tuned \(\lambda\)) versus the actual measured voltage. The model output closely follows the measurement. Figure 7 demonstrates the superior performance of the variable forgetting factor. The VFFRLS-adjusted model voltage shows excellent agreement with the real voltage throughout the test, including dynamic pulses and relaxation phases. In contrast, Figure 6 shows that with an inappropriately small fixed \(\lambda\), the identified model becomes unstable and diverges during dynamic events, which would be catastrophic for a battery energy storage system’s BMS.
The following table quantifies the terminal voltage estimation error for different forgetting factor strategies:
| Forgetting Factor Strategy | Mean Absolute Error (MAE) | Root Mean Square Error (RMSE) |
|---|---|---|
| Fixed λ = 1 (Standard RLS) | 1.767% | 3.479% |
| Fixed λ = 0.9995 | 1.760% | 3.476% |
| Variable λ (VFFRLS) | 1.700% | 3.470% |
The VFFRLS achieves the lowest errors, confirming its advantage in balancing tracking capability and noise immunity for reliable parameter identification in a battery energy storage system.
2. Performance of the Joint VFFRLS-UKF SOC Estimation:
The ultimate test is the accuracy of the SOC estimate. The “true” SOC reference was generated by high-precision Coulomb counting using calibrated current sensors. We compared three methods: (a) Standard Ah Integration (prone to drift), (b) The joint method using VFFRLS with an Extended Kalman Filter (VFFRLS-EKF), and (c) The proposed joint method using VFFRLS with UKF (VFFRLS-UKF).
The results are summarized in the table below:
| Estimation Algorithm | MAE of SOC | RMSE of SOC |
|---|---|---|
| Ah Integration | 0.98% | 1.21% |
| VFFRLS-EKF | 0.47% | 0.62% |
| VFFRLS-UKF (Proposed) | 0.31% | 0.40% |
The proposed VFFRLS-UKF method significantly outperforms both the simple Ah integration and the VFFRLS-EKF method. It reduces the SOC estimation error by approximately 34% compared to the EKF-based approach. The UKF’s ability to handle the nonlinearities of the \(U_{OC}(SOC)\) function and the system dynamics without approximation errors is the key contributor to this enhanced performance. The estimation remains stable and accurate throughout the entire HPPC test cycle, including during high-current pulses and the subsequent voltage relaxation, which is critical for the precise state awareness needed in a large-scale battery energy storage system.
Conclusion
This article has presented a comprehensive and advanced methodology for the real-time estimation of the State of Charge in lithium-ion batteries, with direct application to the sophisticated management needs of modern battery energy storage systems. The core innovation is the tight integration of a Variable Forgetting Factor Recursive Least Squares algorithm for adaptive online parameter identification and an Unscented Kalman Filter for robust nonlinear state estimation.
The VFFRLS component solves the critical problem of time-varying battery parameters by dynamically adjusting its forgetting factor based on the innovation error. This allows the model to rapidly adapt to dynamic load changes while maintaining stability and precision during steady-state operation—a vital feature for the varied and unpredictable duty cycles experienced by a grid-connected battery energy storage system. The UKF component provides a superior framework for SOC estimation compared to linearized filters like the EKF, as it accurately propagates the state distribution through the battery’s inherent nonlinearities without introducing linearization errors.
Experimental validation on a commercial LiFePO4 cell under a demanding HPPC profile confirms the effectiveness of the joint approach. The proposed VFFRLS-UKF method demonstrated a substantial improvement in SOC estimation accuracy, achieving an MAE of 0.31% and an RMSE of 0.40%, outperforming both traditional Ah integration and a VFFRLS-EKF combination. This level of accuracy and robustness is essential for optimizing charge/discharge strategies, preventing harmful operational extremes, conducting reliable state-of-health analytics, and maximizing the lifespan and economic return of a battery energy storage system. The method is computationally efficient and well-suited for implementation in the battery management systems that oversee complex, multi-cell battery energy storage systems, contributing to safer, more reliable, and more efficient energy storage solutions for the future grid.
