# Lithium-Ion Battery SOC Estimation Based on Adaptive Forgetting Factor Least Squares Online Identification and Unscented Kalman Filter

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Establishment of Equivalent Circuit and Open Circuit Voltage Model

#### 2.1. Equivalent Circuit Model

_{oc}is the open-circuit voltage; R

_{0}is the ohmic internal resistance; I is the operating current, and the charging direction is the positive direction of the current; R

_{1}is the polarization internal resistance; C

_{1}is the polarization capacitance [17]; U

_{1}is the polarization ring terminal voltage; and U

_{t}is the battery terminal voltage.

#### 2.2. Open Circuit Voltage Model

- The temperature control box controls the test environment temperature at 25 °C. After charging with a constant current at a rate of 1/3 C to a cut-off voltage of 4.2 V, charging at a constant voltage until the current is less than 0.02 C, and then standing for 1 h. It is considered fully charged at this time, SOC = 100%;
- Discharge 5% of the battery capacity at a rate of 1/3 C, and record the terminal voltage value at this moment after standing for 1 h;
- Repeat the previous step operation 20 times, that is, discharge the battery to SOC = 0.

_{oc}represents the open-circuit voltage and Z represents the SOC, the 6-order polynomial fitting Equation is:

## 3. Model Parameter Online Identification

#### 3.1. Forgetting Factor Recursive Least Squares

_{1}

_{,k}, θ

_{2,k}, θ

_{3,k}are the simplified representations of the time coefficients of k. The specific expression is:

_{1}C

_{1}.

_{oc}(k) is approximately equal to U

_{oc}(k − 1). Let θ

_{4,k}= U

_{oc}(k) − θ

_{1,k}U

_{oc}(k − 1),ie θ

_{4,k}= (1 − θ

_{1,k})U

_{oc}(k − 1). The formula conforms to the basic form of the least squares method. The parameter vector of least squares is

**θ**(k) = [θ

_{1,k},θ

_{2,k},θ

_{3,k},θ

_{4,k}]

^{T}, and the data vector is

**φ**(k) = [U

_{t}(k − 1),I(k),I(k − 1),1]. The parameter vector

**θ**(k) can be identified in real time with the aid of the least squares recursive formula.

**θ**(k), the model parameters of the equivalent circuit can be obtained by Equation (6):

**K**(k), the estimated parameter value is

_{e}**θ**(k), and the covariance matrix is

**P**(k). The forgetting factor least-squares recursive Equation is:

_{e}#### 3.2. Simulated Annealing Algorithm Optimizes Forgetting Factor

_{t}(k) −

**φ**(k)

**θ**(k − 1)|

_{t}(k) is the measured value of the terminal voltage,

**φ**(k)

**θ**(k − 1) is the terminal voltage value estimated by the recursive least square method, and the objective function is the absolute value of the terminal voltage error.

## 4. Joint Estimation of Battery SOC

#### 4.1. Principle of Battery SOC Estimation Based on UKF

- Suppose the system state equation discretized from Section 3.1 is:$$\{\begin{array}{l}{x}_{k+1}=f\left({x}_{k},{u}_{k}\right)+{\omega}_{k}\\ {h}_{k}=g\left({x}_{k},{u}_{k}\right)+{\nu}_{k}\end{array}$$

**x**is the system state variable,

**x**= [SOC, U

_{1}]. u is the system input, u = I. h is the system output, h = U

_{t}.

**ω**is the state noise, and its covariance matrix is

**Q**. ν is the noise, its covariance matrix is

**R**.

_{c}is the battery capacity.

- 2.
- Initialization of state variables $\widehat{x}$ and covariance
**P**:$$\{\begin{array}{l}\widehat{x}=E[x]\\ P=E[(x-\widehat{x}){(x-\widehat{x})}^{\mathrm{T}}]\end{array}$$

^{m}

_{i}is the mean weight of the i-th sampling point, and ω

^{c}

_{i}is the i-th sampling point The weight of the covariance.

- 3.
- Update state one-step predicted value and covariance:$$\{\begin{array}{l}{x}_{i,k\mid k-1}=f\left({x}_{i,k-1},{i}_{k-1}\right)\hfill \\ {x}_{k\mid k-1}={\displaystyle \sum _{i=0}^{2n}}{\omega}_{i}^{m}{x}_{i,k\mid k-1}\hfill \\ {\mathit{P}}_{k\mid k-1}={\displaystyle \sum _{i=0}^{2n}}{\omega}_{i}^{c}\left({x}_{i,k-1}-{x}_{k\mid k-1}\right){\left({x}_{i,k-1}-{x}_{k\mid k-1}\right)}^{\mathrm{T}}+Q\hfill \end{array}$$
- 4.
- Observation and Sigma point set observations mean prediction:$$\{\begin{array}{l}{h}_{i,k\mid k-1}=g\left({x}_{i,k\mid k-1},{i}_{k-1}\right)\hfill \\ {h}_{k\mid k-1}={\displaystyle \sum _{i=0}^{2n}{\omega}_{i}^{m}{y}_{i,k\mid k-1}}\hfill \end{array}$$
- 5.
- Observation covariance update:$$\{\begin{array}{c}{\mathit{P}}_{hh,k}={\displaystyle {\displaystyle \sum}_{i=0}^{2n}}{\omega}_{i}^{c}\left({h}_{i,k\mid k-1}-{h}_{k\mid k-1}\right){\left({h}_{i,k\mid k-1}-{h}_{k\mid k-1}\right)}^{\mathrm{T}}+\mathit{R}\\ {\mathit{P}}_{xh,k}={\displaystyle {\displaystyle \sum}_{i=0}^{2n}}{\omega}_{i}^{c}\left({x}_{i,k\mid k-1}-{x}_{k\mid k-1}\right){\left({h}_{i,k\mid k-1}-{h}_{k\mid k-1}\right)}^{\mathrm{T}}\end{array}$$

**P**

_{hh}is the covariance of the system predictive quantity, and

**P**

_{xh}is the covariance of the state quantity and the predictive quantity.

- 6.
- Calculate Kalman gain:$${\mathit{K}}_{k+1}={\mathit{P}}_{xh,k}{\mathit{P}}_{hh,k}^{-1}$$
- 7.
- State matrix and covariance measurement update:$$\{\begin{array}{r}\hfill {x}_{k+1\mid k+1}={x}_{k+1|k+1}+{K}_{k+1}\left({h}_{k+1}-{h}_{k+1|k}\right)\\ \hfill {\mathit{P}}_{x,k+1\mid k+1}={\mathit{P}}_{x,k+1\mid k}-{K}_{k+1}{\mathit{P}}_{xy,k+1}{K}_{k+1}^{\mathrm{T}}\end{array}$$

#### 4.2. SA-FFRLS Combined with UKF to Estimate SOC

## 5. Algorithm Verification

#### 5.1. Introduction to Test and Simulation

#### 5.2. Comparison of Simulation Results

#### 5.3. Algorithm Robustness Verification

## 6. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Shen, J.W.; Xiong, J.; Shu, X.; Li, G.; Zhang, Y.J.; Chen, Z.; Liu, Y.G. State of charge estimation framework for lithium-ion batteries based on square root cubature Kalman filter under wide operation temperature range. Int. J. Energy Res.
**2020**, 45, 5586–5601. [Google Scholar] [CrossRef] - Xiong, R.; He, H.; Sun, F.; Zhao, K. Evaluation on State of Charge Estimation of Batteries with Adaptive Extended Kalman Filter by Experiment Approach. IEEE Trans. Veh. Technol.
**2012**, 62, 108–117. [Google Scholar] [CrossRef] - Xiong, R.; He, H.; Sun, F.; Liu, X.; Liu, Z. Model-based state of charge and peak power capability joint estimation of lithium-ion battery in plug-in hybrid electric vehicles. J. Power Sources
**2013**, 229, 159–169. [Google Scholar] [CrossRef] - Lee, J.; Nam, O.; Cho, B. Li-ion battery SOC estimation method based on the reduced order extended Kalman filtering. J. Power Sources
**2007**, 174, 9–15. [Google Scholar] [CrossRef] - Ye, M.; Guo, H.; Cao, B. A model-based adaptive state of charge estimator for a lithium-ion battery using an improved adaptive particle filter. Appl. Energy
**2017**, 190, 740–748. [Google Scholar] [CrossRef] - Luo, Y.; Qi, P.W.; Kan, Y.Z. Parameter Identification of Lithium Battery Model Based on Simulated Annealing Algorithm. Automot. Eng.
**2018**, 40, 1418–1425. [Google Scholar] - Wang, W.L.; He, F.; Zheng, Y.L. Estimation of Lithium Battery SOC Based on RLS-EKF Joint Algorithm. Power Technol.
**2020**, 44, 1498–1501. [Google Scholar] - Partovibbakhsh, M.; Liu, G. An Adaptive Unscented Kalman Filtering Approach for Online Estimation of Model Parameters and State of Charge of Lithium-Ion Batteries for Autonomous Mobile Robots. IEEE Trans. Control Syst. Technol.
**2015**, 23, 357–363. [Google Scholar] [CrossRef] - Pang, Z.H.; Cui, H. System Identification and Adaptive Control MATLAB Simulation, 1st ed.; Beijing University of Aeronautics and Astronautics Press: Beijing, China, 2013; pp. 30–45. [Google Scholar]
- Zheng, L.D.; Dong, J.Y.; Ma, Q. SOC Estimation of Lithium Battery Based on Parameter Identification and AEKF. Power Technol.
**2020**, 44, 1502–1505. [Google Scholar] - Xu, J.L.; Ma, G.Q. Research on Online Lithium-ion Battery SOC Estimation Based on UKF. Power Technol.
**2019**, 43, 1615–1618. [Google Scholar] - Ouyang, T.; Xu, P.; Chen, J.; Lu, J.; Chen, N. An Online Prediction of Capacity and Remaining Useful Life of Lithium-Ion Batteries Based on Simultaneous Input and State Estimation Algorithm. IEEE Trans. Power Electron.
**2020**, 36, 8102–8113. [Google Scholar] [CrossRef] - Xie, Y.; Zheng, J.; Li, W.; Lee, K.; Zhang, Y.; Liu, J.; Dan, D.; Wu, C.; Wang, P. An improved electrothermal-coupled model for the temperature estimation of an air-cooled battery pack. Int. J. Energy Res.
**2019**, 44, 2037–2060. [Google Scholar] [CrossRef] - Tan, F.M.; Wang, Q. Power Battery SOC Estimation Model Based on Improved Unscented Kalman Filter Algorithm. Automot. Technol.
**2019**, 3, 18–24. [Google Scholar] - Muhammad, S.; Rafique, M.U.; Li, S.; Shao, Z.; Wang, Q.; Guan, N. A Robust Algorithm for State-of-Charge Estimation with Gain Optimization. IEEE Trans. Ind. Inform.
**2017**, 13, 2983–2994. [Google Scholar] [CrossRef] - Hu, Y. Iterative and recursive least squares estimation algorithms for moving average systems. Simul. Model. Pract. Theory
**2013**, 34, 12–19. [Google Scholar] [CrossRef] - Han, Y.Y. Estimation of State of Charge of Lithium Battery Based on Improved Kalman Filter Algorithm. Master’s Thesis, Nanjing University of Posts and Telecommunications, Nanjing, China, 2020. [Google Scholar]
- Yang, N.; Zhang, X.; Li, G. State-of-charge estimation for lithium ion batteries via the simulation of lithium distribution in the electrode particles. J. Power Sources
**2014**, 272, 68–78. [Google Scholar] [CrossRef] - Liu, Y.L.; Dai, S.; Cheng, Z. Lithium-ion Battery SOC Estimation Based on Finite Difference Extended Kalman Filter. J. Electrotech. Technol.
**2014**, 29, 221–228. [Google Scholar] - Duan, J.; Wang, P.; Ma, W.; Qiu, X.; Tian, X.; Fang, S. State of Charge Estimation of Lithium Battery Based on Improved Correntropy Extended Kalman Filter. Energies
**2020**, 13, 4197. [Google Scholar] [CrossRef] - Yu, P.; Wang, S.L.; Yu, C.M. Lithium Battery SOC Estimation Based on Adaptive Fractional-Order Extended Kalman. Energy Storage Sci. Technol.
**2021**, 10, 335–341. [Google Scholar]

**Figure 6.**Terminal voltage error comparison: (

**a**) λ = 0.95 vs. adaptive λ, (

**b**) λ = 0.97 vs. adaptive λ, (

**c**) λ = 0.99 vs. adaptive λ.

**Figure 7.**SOC estimation results and error comparison: (

**a**) Comparison of SOC estimation results, (

**b**) SOC estimation error absolute value comparison.

Parameter | a_{1} | a_{2} | a_{3} | a_{4} | a_{5} | a_{6} | a_{7} |
---|---|---|---|---|---|---|---|

Value | −43.56 | 155.4 | −215.7 | 146.6 | −50.16 | 8.674 | 2.991 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Wang, H.; Zheng, Y.; Yu, Y.
Lithium-Ion Battery SOC Estimation Based on Adaptive Forgetting Factor Least Squares Online Identification and Unscented Kalman Filter. *Mathematics* **2021**, *9*, 1733.
https://doi.org/10.3390/math9151733

**AMA Style**

Wang H, Zheng Y, Yu Y.
Lithium-Ion Battery SOC Estimation Based on Adaptive Forgetting Factor Least Squares Online Identification and Unscented Kalman Filter. *Mathematics*. 2021; 9(15):1733.
https://doi.org/10.3390/math9151733

**Chicago/Turabian Style**

Wang, Hao, Yanping Zheng, and Yang Yu.
2021. "Lithium-Ion Battery SOC Estimation Based on Adaptive Forgetting Factor Least Squares Online Identification and Unscented Kalman Filter" *Mathematics* 9, no. 15: 1733.
https://doi.org/10.3390/math9151733