Kalman Filter Estimation of Lithium Battery SOC Based on Model Capacity Updating

High-precision estimation of lithium battery SOC can effectively optimize vehicle energy management, improve lithium battery safety protection, extend lithium battery cycle life, and reduce new energy vehicle costs. Based on the forgetting factor recursive least square method (FFRLS), Thevenin equivalent circuit model and Singular Value Decomposition-Unscented Kalman Filter (SVD-UKF), the SVD-UKF combined lithium battery SOC estimation algorithm with model capacity update is proposed, aiming at further improving the SOC estimation accuracy of lithium battery. The parameter identification of Thevenin model is studied by using the forgetting factor recursive least square method. To overcoming the shortcomings of Kalman filter linearization error and non-positive definite covariance matrix, the singular value decomposition unscented Kalman filter algorithm is proposed. It is worth mentioning that in order to consider the impact of battery available capacity attenuation on the estimation of lithium battery SOC, the model capacity update algorithm is used to optimize the model parameters and state joint estimation algorithm based on FFRLS & SVD-UKF. Verified by simulation and lithium battery test, the results show that the SVD-UKF algorithm based on model capacity update can accurately estimate the SOC of lithium battery in real time with the available capacity of lithium battery continuous attenuation. The purpose of improving the accuracy of SOC estimation of lithium batteries is achieved.


Introduction
State of charge (SOC) estimation of power battery is one of the core functions of battery management system. It is directly displayed as residual capacity and indirectly as driving range. SOC of power battery is an important basis for formulating optimal energy management strategy of vehicle electronic control system, which is of great significance for improving stability, safety, service life and energy utilization rate of power battery. In the actual design and production process, the power battery is composed of series and parallel cells. Due to the influence of factors such as the inconsistency between the cells, the difference of using environment, the increase of battery cycle times, and further the SOC cannot be measured directly, only by estimated indirectly, SOC estimation is one of the research hotspots of new energy vehicles. How to accurately estimate SOC based on the voltage, current, temperature and other simple physical information of power battery is a technical bottleneck in the design and production of new energy vehicle battery management system (BMS) [1][2][3][4][5].
Most of the research on battery SOC estimation algorithms are limited to the laboratory environment, such as specific temperature and current conditions, without considering factors which will affect the battery performance when the vehicle is operating. At the same time, there are many factors affecting battery SOC estimation, such as cell inconsistency, battery aging, temperature, dynamic hysteresis characteristics, self-discharge and charge-discharge rate, etc., which will affect the performance of the battery, resulting in the change of battery capacity. In reference [6], the battery terminal voltage curve is obtained by discharging the battery at different rates, and the battery SOC is accurately predicted by using statistical method to predict the battery open circuit voltage. The method is more suitable for obtaining the open circuit voltage (OCV) curve of the cell under laboratory conditions, and then the curve is applied to other SOC estimation algorithms. In reference [7], an intelligent SOC estimation algorithm is proposed based on Ah counting method. The algorithm is modified by referring to the charging and discharging efficiency of the battery to improve the SOC estimation accuracy. In reference [8], an equivalent circuit model including capacitors and inductors under high and low frequency operating conditions is established. The impedance value of the model is calculated by nonlinear least square fitting method under different charging conditions. However, if the system is not in steady state, the result of EIS estimation is not ideal. In reference [9], the battery state space model is obtained through mathematical derivation, and different Q w and R v settings are adopted based on Kalman filter to improve the estimation performance and effectively reduce the root mean square error. However, Kalman filter only have good estimation effect for linear system state, it cannot be used for nonlinear state estimation of power battery. In reference [10], the SOC of LiFePO4 battery is estimated by extended Kalman filter (EKF) and double EKF based on two battery models of zero hysteretic state and hysteretic state. The results show that the method can accurately estimate SOC in dynamic environment with maximum error less than 4%. In reference [11], a zero-state hysteresis model for lithium-ion battery is proposed based on AUKF. The advantage of the model is that it can adaptively correct the noise covariance in the process and observation state. At the same time, due to the simple structure of the zero-state hysteresis model, it can quickly and accurately estimate the battery state, and the calculation cost is low. SOC estimation algorithm also needs to consider such issues as accuracy, computation amount, real-time performance and computational cost, etc. In reference [12], an improved iterate calculation method is proposed to improve the charged state prediction accuracy of the lithiumion battery packs by introducing a novel splice Kalman filtering algorithm with adaptive robust performance. Because each model and estimation algorithm have defects, finding a model and algorithm with the best comprehensive performance is a problem that the majority of researchers have been committed to solve. Thus, in this paper, the Singular Value Decomposition-Unscented Kalman Filter (SVD-UKF) combined lithium battery SOC estimation algorithm with model capacity update is proposed to further improve the SOC estimation accuracy of lithium battery, which is based on the forgetting factor recursive least square method (FFRLS) and Thevenin equivalent circuit model.
In this paper, the Thevenin equivalent circuit model is used in Section 2 to emulate the dynamic behavior of battery. The forgetting factor recursive least square method and singular value decomposition unscented Kalman filter are combined in Section 3 to estimate the parameters and states of the model. At the same time, the capacity updating algorithm is also used to consider the influence of lithium battery available capacity attenuation on SOC estimation, so as to improve the accuracy and robustness of SOC estimation. The test results and errors are shown in Section 4 and the conclusion are drawn in Section 5.

Model Parameter Identification
Thevenin model [13] is a first-order RC model, which adds an RC loop to simulate the polarization reaction inside the battery based on the Rint model. R 1 is the polarization impedance and C 1 is the polarization capacitance. Based on this, the influences of temperature and chargedischarge rate on the internal impedance dynamics of the battery can be simulated. Even the model cannot reflect the influences of self-discharge and cycle life on the dynamic characteristics of the battery, the model has the advantages of less computation, low computational cost, and the accuracy can meet the requirements of engineering application, so it is a widely used equivalent circuit model [14][15][16][17]. The Thevenin equivalent circuit model is shown in Fig. 1, and Eqs.
where, U oc,k represents the OCV, which can obtained by measuring the battery terminal voltage. U k is the terminal voltage, U 1,k is the polarization voltage across C 1 . In this paper, set E(k)= U k − U oc,k . Based on Laplace transform and bilinear transformation, linear discretization process from frequency domain to time domain of Eqs. (1) and (2) is carried out, and further simplified to obtain Eqs. (3) and (4): where, T represents the data sampling interval, then the values of a, b and c can be estimated by the system, so as to obtain the internal impedance parameters of the battery, as shown in Eq. (5): be the input of the system, θ(k) be the state variables of the system to be measured, y(k) be the output of the system. If the system error at k time is e(k), then Eq. (3) can be transformed into Eq. (6): Therefore, the parameters of Thevenin equivalent battery model can be estimated online by using the forgetting factor recursive least square method (FFRLS) based on the real-time terminal voltage and current of lithium battery. The FFRLS online identification of lithium battery equivalent circuit model parameter equations are shown in Eqs. (7)-(10): Step 1: calculate the gain K(k): Step 2: calculate the covariance P(k): Step 3: calculate the estimation error e(k): Step 4: update system state ∧ θ (k):

SOC Estimation Algorithm
The physical meaning of SOC of the battery is the ratio of the real-time capacity to the total capacity of the battery under charge and discharge, so it is often used to estimate the remaining capacity of the battery. When extended Kalman filter [18][19][20] is used to estimate battery SOC, linearization is needed to deal with the nonlinear battery state space model, which can cause the unavoidable linearization error, and the computationally costly Jacobian matrix calculation. For the highly nonlinear system, if the linearization is not established, the filtering performance will be reduced and the filtering results will be divergent, which will not only make the calculation complex, but also reduce the accuracy, resulting in the long running time of the program and poor effect. However, for nonlinear systems, unscented Kalman filter (UKF) [21][22][23][24] does not linearize the nonlinear function, but adopts statistical linearization method (UT-unscented transform), which does not need to derive Jacobian matrix. So, it does not ignore the highorder term, and can achieve the third-order Taylor expansion approximation effect, has a good estimation effect for highly nonlinear systems. At the same time, because UKF takes into account the system observation and process noise, it has strong robustness to noise. When the estimated value deviates from the real value of the system, it has the ability of self-updating according to the filter gain. It can adapt to all kinds of current changes in SOC estimation of ternary lithium battery, which is in line with the development demand of new energy vehicles for power battery system. However, in practical application, it is found that UKF is prone to produce nonpositive definite covariance matrix because of processor calculation errors, uncertain system noise and model disturbances. The singular value decomposition algorithm can solve this problem by restraining the non-positivity of covariance matrix of the system [25,26]. Accordingly, SVD-UKF (Singular Value Decomposition-Unscented Kalman Filter) algorithm can be proposed to estimate the SOC of lithium battery.

Singular Value Decomposition
Singular value decomposition is a matrix decomposition method with good stability and accuracy. Suppose, A ∈ R m×n (m ≥ n), then the singular value decomposition of the matrix A is: where, U ∈ R m×m , ∈ R m×n , V ∈ R n×n , the column vectors of U and V are the left and right singular vectors of the matrix A respectively, S = diag(s 1 , s 2 , · · · , s r ) are the singular values of the matrix A, and s 1 ≥ s 1 ≥ · · · ≥ s 1 ≥ 0.

SVD-Unscented Transform
Suppose that the state vector of nonlinear system X is n-dimensional random vector, the mean and variance areX and P. The covariance matrix P is easy to become non positive definite, singular value decomposition is applied to P, then 2n + 1 Sigma point sets [X i ] are obtained by distributed sampling, as shown in Eqs. (12) and (13): where, ρ is the scaling factor, and the value is generally 1 ≤ ρ ≤ √ 2.
Then the mean weight w m i and covariance weight w c i of Sigma points are calculated by Eq. (14): where, the superscript m represents the mean value, c represents the covariance, and the subscript represents the i-th sampling point, parameter λ = a 2 (n + κ) − n is a scale parameter used to reduce the total prediction error, the value range of a is (e −4 ≤ a ≤ 1), determining the distribution state of Sigma point set. The κ is an unbounded value, β is a non-negative state distribution parameter used to refer to the influencing factors of higher-order terms in the Eq. (14).

SVD-Unscented Kalman Filter Algorithm
When SVD-UKF is used to estimate the SOC of ternary lithium battery, the nonlinear system equation is shown in Eqs. (15) and (16): The system state vector is X k = [SOC k , U 1 k ] T , the system control input is I k , corresponding to the lithium battery current, the charging direction is positive, and the discharge direction is negative; The system observation vector Z k corresponds to the terminal voltage U k of lithium battery. The basic steps of using UKF to estimate the SOC of lithium battery are as follows: 1) Initialization of lithium battery SOC estimation by SVD-UKF: 2) The first SVD-UT transform, the Sigma point set is obtained by Eqs. (13) and (14): The predicted residual error e k =g(X k , u k ) − Z k , then the discriminant statistics of state model error are as follows: The adaptive factor is: where, e k is the covariance matrix of e k , tr(•) is the matrix trace operator, and d is the empirical value, 1 < d < 2.5.
3) One step state prediction of sigma point set: 4) One step prediction of sigma point set, covariance matrix and its singular value decomposition are solved: where, svd{} is SVD decomposition operator.

5) According to the one step prediction value in 4), a new Sigma point set is obtained by SVD-UT transform:
6) Through the new sigma point set, the predicted observations are obtained from the system observation equation: 7) The mean and covariance of the predicted values of the system are obtained from the predicted observations of the new Sigma point set: 8) System state estimation and covariance updating: From the above process of using SVD-UKF to estimate the SOC of lithium battery, it can be seen that SVD-UKF does not linearize the nonlinear system at the estimated point using Taylor expansion as EKF does. Instead, the SVD-UT transform is used to obtain the sigma point set which is symmetrically distributed near the estimation point and consistent with the original system state mean and covariance, and avoid the non-positive definite problem of covariance matrix. Then, the Sigma point set is used for nonlinear mapping based on the state space model of the system, which is a statistical approximate linearization method. The accuracy of SVD-UKF can reach the third-order Taylor accuracy, and it does not neglect the influence of higher-order terms, and does not need to calculate the complex Jacobian matrix. Compared with EKF, the amount of computation is not much. So SVD-UKF is widely used in highly nonlinear systems [27].
The current maximum capacity C n given by the state space model in Eq. (15) is the initial capacity of lithium battery. In the actual using process, the current maximum capacity of lithium battery is decreasing. It can be seen that the smaller the current maximum capacity of lithium battery, the smaller the actual SOC value. When the new energy vehicle is actually used, especially when the number of cycles increases, it is necessary to re-estimate the current maximum capacity of the lithium battery to update the capacity of the model, and then correct the SOC estimation error. SOC of lithium battery is the ratio of current remaining capacity to current maximum capacity of lithium battery. At the same time, SOC can be estimated not only by SVD-UKF, but also by OCV-SOC curve. The relationship between SOC and OCV is fitted with experimental data, and the functional relationship between SOC and OCV is obtained as Eq. (28): U oc = 25.33z 6 − 79.42z 5 + 93.67z 4 − 50.31z 3 + 11.88z 2 − 0.4486z + 3.454 (28) According to the "parallelogram rule" of lithium battery voltage and SOC, the same voltage difference corresponding to the same SOC difference can be obtained under different life span and the same temperature and current environment. This means that in the charging curve of the battery, take two SOC points, SOC 1 , SOC 2 , the "dAH/dSOC" in this interval equal to the current available capacity.
As shown in Fig. 2, two SOC points, SOC a and SOC b , are obtained in the SOC estimation process, and the lithium battery capacity difference Ah between the two target points can be obtained by Ah integration, then the current maximum capacity of lithium battery can be calculated by Eq. (29) [28][29][30]: (29) where, setting SOC a = 30%, SOC b = 80%.

Figure 2: Capacity difference of battery
In order to ensure the reliability and stability of the estimated current maximum capacity of lithium battery, the convergence coefficient δ is used to determine whether the current estimated maximum capacity is reliable. The convergence coefficient δ is shown in Eq. (30): where,Ĉ n,k represents the maximum capacity of lithium battery estimated at time k; δ ≤ 2%, C n =Ĉ n,k+1 ; δ > 2%, C n =Ĉ n,k .

Test Result
In order to verify the reliability of the model parameter identification, the test data of dynamic stress test (DST) condition and federal urban driving schedule (FUDS) condition are used to verify the Thevenin model and FFRLS parameter identification method under Simulink environment. The initial SOC is 100%, the test temperature is set to 25 • C the charging current is positive and the discharge current is negative.  Figs. 5b and 6b, respectively. The verification results show that the estimated voltage of the model can always follow the actual voltage very well, no matter how drastic the current changes under the two conditions. It can be seen that the accuracy of FFRLS online identification results in the first half of the working condition is very good, and the error is within 0.02 V. In the latter half, the error of FFRLS online identification results is doubled. This is because as the number of charging and discharging increases, the activity of the chemical substances inside the battery decreases, the polarization phenomenon is obvious, and the parameters of the battery model also fluctuate, which leads to an increase in the error of the online parameter identification results. But the accuracy is still within the allowable range. Therefore, the FFRLS online parameter identification method can accurately estimate the internal impedance parameters of the battery under the current working conditions when it is used for the parameter identification of Thevenin model.   9 shows the variation of the maximum available capacity of the ternary lithium battery in the endurance cycle. The initial value of the maximum available capacity is 37.2 Ah, which decreases sharply in the initial 55 h, and then tends to stabilize to 35.8 Ah. It is consistent with the change of lithium battery capacity during actual use.
In order to verify that the SVD-UKF algorithm based on model capacity updating can estimate the SOC with high accuracy under the condition of continuous decline of cell capacity, the 1st, 6th and 72nd discharge processes are selected for analysis and comparison. The SOC estimation comparison diagram of the 1st, 6th and 72nd discharge process is shown in Figs. 10-12, and the SOC estimation error results of the three discharge processes are shown in Table 1, where AE is absolute error and RMSE is root mean square error.  As it can be seen, as the discharge reaction progresses, the internal material activity of the battery decreases, and the polarization phenomenon is obvious. The estimation error of the SVD-UKF algorithm gradually increases, and finally reaches 5.7%. However, the estimation error of the SVD-UKF algorithm based on capacity updating has always been maintained at about 2%, whose error has not changed much. The results show that the SVD-UKF based on capacity updating can estimate the SOC of lithium battery in real time. The SVD-UKF algorithm based on capacity updating has convergence and can meet the accuracy requirements of the battery under dynamic working conditions.

Conclusion
In this paper, the Thevenin equivalent circuit model is adopted to simulate the dynamic behavior of battery. The parameters of battery model are identified by combining the forgetting factor recursive least square method with singular value decomposition unscented Kalman filter. What's more, in order to improve the accuracy and robustness of SOC estimation, the capacity updating algorithm is also used, which consider the influence of lithium battery available capacity attenuation on SOC estimation.
The comparative analysis shows that when the initial capacity is 37.2 Ah, the estimation error of the two SOC estimation algorithms is less than 4%, and the SVD-UKF algorithm based on capacity update has higher accuracy, reaching 2.2% estimation error. As the capacity of lithium battery decreases from 37 Ah to 35 Ah, the estimation error of SVD-UKF algorithm increases gradually, and finally reaches 5.7%. The SVD-UKF algorithm based on capacity updating can control the estimation error at about 2%. Therefore, when the maximum available capacity of lithium battery is continuously declining, the SVD-UKF based on capacity update can estimate the SOC of lithium battery in real time excellently, and the absolute error is less than 3%, and the algorithm does not show divergence phenomenon.
It is verified that the SOC estimation algorithm based on capacity update proposed in this paper can estimate the SOC of ternary lithium battery with real-time and high accuracy under the condition of lithium battery capacity attenuation, which realizes the research purpose of improving the SOC estimation accuracy in this paper.