Enhancing Stability and Robustness of State-of-Charge Estimation for Lithium-Ion Batteries by Using Improved Adaptive Kalman Filter Algorithms

: The traditional Kalman ﬁlter algorithms have disadvantages of poor stability (the program cannot converge or crash), robustness (sensitive to the initial errors) and accuracy, partially resulted from the fact that noise covariance matrices in the algorithms need to be set artiﬁcially. To overcome the above problems, some adaptive Kalman ﬁlter (AKF) algorithms are studied, but the problems still remain unsolved. In this study, two improved AKF algorithms, the improved Sage-Husa and innovation-based adaptive estimation (IAE) algorithms, are proposed. Under the different operating conditions, the estimation accuracy, ﬁlter stability, and robustness of the two proposed algorithms are analyzed. Results show that the state of charge ( SOC ) Max error based on the improved Sage-Husa and the improved IAE is less than 3% and 1.5%, respectively, while the Max errors of the original algorithms is larger than 16% and 4% The two proposed algorithms have higher ﬁlter stability than the traditional algorithms. In addition, analyses of the robustness of the two proposed algorithms are carried out by changing the initial parameters, proving that neither are sensitive to the initial errors.


Introduction
Considering the current severe environmental challenges and gradual exhaustion of non-renewable fossil fuels, electric vehicles (EVs) have been recognized by the global automotive industry as a potential alternative to the widely used internal combustion engine vehicles [1]. To improve the economic cost and cruising range of EVs, many studies focus on advancing the battery technology suitable for EVs [2]. Lithium-ion batteries have entered the market due to their high operating voltage, environmental friendliness, high specific energy, and long cycle life [3,4].
To guarantee the safety and reliability of EVs, battery management system (BMS) is equipped in the EVs. One of the key functions of the BMS is to estimate the state-of-charge (SOC) of batteries, which is defined as the ratio of the battery's current capacity to the nominal capacity [5]. Based on the SOC estimation, the BMS adopts an appropriate control strategy to make the EVs work safely and efficiently [6].
At present, the widely used SOC estimation methods include measuring internal resistances, the ampere-time integration method, open circuit voltage method, support vector machine, neural networks, and extended Kalman filter (EKF) [7]. Among them, the EKF is often used in engineering application due to its ability to handle nonlinear problems. However, applying the EKF algorithm to the SOC estimation may result in poor accuracy. Furthermore, the algorithm may diverge when noise statistics are unknown and time-varying [8,9]. In addition, the EKF algorithm uses the first-order Taylor expansion to linearize processing equations. This approximate method may lead to an inaccurate SOC estimation resulting from ignoring high-order terms and calculating the complex Jacobian matrix [10,11]. To overcome these limitations, a variety of improved methods have been proposed, including UKF, CDKF, DEKF, and SRUKF. Compared with the improved algorithm, the EKF is generally seemed as the traditional Kalman filter algorithms, which is firstly proposed by Plett [12]. While these methods have merits of improving the accuracy, the employed filter is based on the premise that the priori statistical properties of noise are known and given [13][14][15][16][17][18][19][20]. However, it is not possible to obtain the accurate statistical characteristics of noise in real applications [21]. There are two main drawbacks if the given noise covariance matrix is applied. On the one hand, the estimation program cannot converge or it can crash, and the expected accuracy is hard to achieve, when the given noise error is set to be too small. On the other hand, the estimation program stops running soon, and the estimation precision cannot meet the actual requirement since the given precision is approached easily, when the noise error is set to be high.
To solve these problems, some adaptive algorithms combined with the Kalman filter have been studied, including the maximum likelihood and Sage-Husa algorithms. Xiong, R et al. [22,23] used the adaptive EKF derived from the maximum likelihood criterion to jointly estimate the SOC and state-of-power. The results of these studies demonstrated that the estimation accuracy can be kept high under the condition of a huge initial estimation error. Partovibakhsh, M et al. [24] used the adaptive unscented Kalman filter (UKF) algorithm based on the maximum likelihood criterion to estimate the battery SOC in an autonomous intelligent robot. Compared to the UKF, the average simulation accuracy was improved by 8%. Wang et al. [25] studied the effectiveness of the adaptive Sage-Husa Kalman filter method in improving the accuracy of the EKF under FUDS conditions. Liu et al. [26] proposed a new Sage-Husa adaptive square root UKF method. This method is based on the DP model and verifies the accuracy of the SOC estimation under constant current and UDDS conditions. It achieves a higher precision compared to the EKF and UKF, while improving the robustness of the underlying filter. The measurement and system noise of the Sage-Husa algorithm and the maximum likelihood algorithm often causes the local divergence or even non-convergence of the filter, since their respective non-negativity and positive definiteness cannot be guaranteed [18,19,25]. Based on the above discussion, Fan et al. [27] proposed a formula for updating the process noise covariance matrix Q and measurement noise covariance matrix R when the adaptive Sage-Husa Kalman filter is applied to SINS/GPS integrated navigation systems. The formula for R and Q is simplified to ensure their respective positive definiteness and non-negativity [27]. Mohamed and Schwarz [28] provided an expression for deriving R using a residual sequence instead of an innovation sequence. It was proved that the expression has some numerical advantages when applied to integrated navigation systems. This expression does not contain a minus sign, thus allowing to avoid the filter divergence and guaranteeing the positive definiteness of R. Hence, the two improved adaptive algorithms allow to improve the stability of the underlying filter and satisfy the estimation precision. When applying these two improved adaptive algorithms to the SOC estimation, we adopt different processing methods for Q and R, which will be discussed in Sections 3.1 and 3.2. Furthermore, appropriately setting the initial parameters remains an open problem for both the existing improved Kalman filter algorithms and adaptive Kalman filter algorithms.
In this study, the DP model is chosen as the basis of the adaptive Kalman filter algorithm to provide the reliability of the estimation. The two traditional adaptive algorithms are introduced and employed to estimate the battery SOC. After discussing the problem of the filter divergence caused by traditional adaptive algorithms in real applications, we propose some improved algorithms to resolve it and verify their stability and robustness under static and dynamic current conditions. This study provides a basis for setting the initial values of P 0 , Q, and R, which is an important step toward reducing the impact of the initial parameters on the convergence time and estimation error.

Experiments
In our experiment, we studied an 18,650 cylindrical graphite||NCM battery from Sony, for which the nominal capacity and nominal voltage are 2500 mAh and 3.6 V, respectively. As shown in Figure 1, the battery test platform is comprised of a battery charging and discharging device (BTS-5V300A), an alternating temperature and humidity test chamber (GDJS-150), a PC host computer control system, and 2500-mAh/3.6-V lithium-ion batteries. All experiments were conducted at a room temperature of 25 • C, and the data logging frequency was 1 Hz.

Adaptive Sage-Husa Kalman Filter
The Kalman filter is a method for optimal estimation of state variables based on closedloop control. It mainly involves the state variable update (time update) and measurement update. The general expressions of the state and measurement equations can be written as: where f (x k−1 , u k−1 ) represents the state function of the system and h(x k , u k ) represents the observation function of the system. Based on the Kalman filter, the nonlinear state and measurement equations are linearized using appropriate mathematical methods to obtain the EKF [29,30]. First, Taylor's first-order expansion is performed on Equations (1) and (2), resulting in linear equations such as Equations (3) and (4): Then, the simplified linear equations are approximated as: Sage and Husa [31] established linear discrete systems based on Equations (5) and (6), and proposed an observation-based (z 1 , z 2 , . . . , z k ) noise statistic maximal posterior suboptimal unbiased estimator. Providing the recursive formulas of Q and R derived by Sage and Husa, they use the average distribution for the historical noise. In terms of the time-varying noise, the role of recent data should be emphasized, while the impact of old data should be gradually eliminated. On this basis, Deng [32] proposed a method for weighting the fading memory index, enabling the algorithm to estimate time-varying noise. The specific equations are defined as follows: From Equations (7)- (11), r k and q k denote the mean of the measurement noise v k and process noise ω k , respectively, d k denotes the adaptive factors, and b denotes the forgetting factor, which is generally set to 0.95-0.99. The expression of the innovation e k is e k = z k −ẑ k/k−1 , andẑ k/k−1 is the predicted value of the measured variable.
Unlike the Kalman filter, the Sage-Husa adaptive Kalman filter is time-varying with respect to the noise mean and noise covariance. Wei [33] pointed out that biased r k and q k may interfere with the coordination relationship between r k and q k , eventually leading to an increase in the estimation error, and this increases the bias of r k and q k further. Hence, it is assumed that the noise is Gaussian white noise, and the update calculation for r k and q k is discarded.
This study simplifies Equations (9) and (11). Our proposed methods are divided into two types: (1) for Equations (9) and (11), only the first part of the second expression is retained; (2) in Equation (9), the absolute value of the diagonal element in the second term is taken. The diagonal element of the second term for Equation (11) is taken as an absolute value, and the non-diagonal element is zero. The two methods are named as improved Sage-Husa1 (ISH I) and improved Sage-Husa 2 (ISH II), respectively. Thus, improving the process and measurement noise can be written as follows: ISH I: ISH II:

Adaptive Kalman Filter Based on the Maximum Likelihood Criterion
Mehra [34] pointed out that the convergence of the Sage-Husa adaptive Kalman filter has not been proved. In 1972, he proposed an improved approach, namely, the innovationbased adaptive estimation (IAE) method based on the innovation covariance matching and maximum likelihood. The IAE method makes estimations from the perspective of the maximum probability of the system measurement.
Suppose that the innovation sequence {e k } is a Gaussian white noise sequence and its theoretical covariance is: Bian et al. [35] proved that the maximum likelihood optimal estimate of C ek is: where M denotes the length of the moving average window. Thus, the covariance matrix of the adaptive measurement noise can be obtained as: The covariance matrix of the adaptive process noise can be expressed as [35]: We can then redefine the innovation as a residual sequence: whereẑ k denotes the optimal estimated current state variablex k . The optimal estimatedẑ k is updated using the following equation: Therefore, the improved IAE algorithm, called IIAE, is derived. The equations for improving the process noise covariance and measurement noise covariance can be written as:

State-of-Charge Estimation
The DP equivalent circuit model is often embedded in the Kalman filter [36,37] The DP model has been proved to provide better accuracy and strong dynamic adaptability compared with the Rint model, the Thevenin model, and the PNGV model [37]; thus, it was chosen in this study as the basis for comparing different algorithms. The structure of the DP model is shown in Figure 2. The mathematical relation of the DP model is obtained according to Kirchhoff's law of voltage and current [19] as: Discretization of Equation (1) can be expressed as: The classical SOC estimation is the ampere-time integral according to Equation (23). This method is simple in operation. However, its accuracy highly depends on the current sensor and required precise initial SOC. Thus, the AEKF algorithm is selected to estimate the SOC. Furthermore, the adaptive method realizes the SOC self-correction. U p1 , U p2 , and SOC are selected as the state variables, while the terminal voltage U L is the observed variable.
The definition equation for the SOC is as follows: where η denotes the discharge efficiency and C N denotes the rated capacity of the battery. Through linearization and discretization, the state and observation equations based on Equations (24) and (25) can be expressed as: Tables 1 and 2 show the basic equations regarding two kinds of adaptive Kalman filter algorithms. K k represents the Kalman gain, which determines the weight used by the previous step estimatex k−1 and measured value z k . If K k decreases, the weights of z k and x k−1 decrease. Step 1 Initialization : for k = 0, set b, (0), U p1 , U p2 , P(0), Q(0), and R(0) Step 2 Computation: for k = 1, 2, 3 . . . Time update: Kalman gain: Measurement update: Adaptive factor: Process noise covariance and measurement noise covariance update: ISH I: ISH II: Step 1 Initialization : for k = 0, set M, SOC(0), U p1 , U p2 , P(0), Q(0), and R(0) Step 2 Computation: For k = 1, 2, 3 . . . Time update: Kalman gain: Measurement update: Judgement: Process noise covariance and measurement noise covariance update:

State-of-Charge Estimation Using the Improved Sage-Husa Algorithm
The comparison of the estimation between the two proposed ISH algorithms and the traditional Sage-Husa (SH) algorithm under different operations is shown in Figure 3. The initial SOC was set to 0.2, and the initial simulation parameters were set to the same value. Figure 3a,b illustrate the SOC estimations on the basis of the three considered SH algorithms under the CCD and FUDS test, respectively. The corresponding errors of the estimation are plotted in Figure 3c,d, where two error reference lines are artificially set at an absolute value of 0.03. In Figure 3a,c, the red dash line fluctuates significantly in the time range of 400-1500 s, indicating that the SH algorithm shows local anomaly under the CCD test. However, the two ISH algorithms quickly track the real SOC, indicating that these two methods achieve the SOC self-correction. According to the estimation error under the CCD test, the convergence speed of the ISH II algorithm is the fastest, while the estimation error of the ISH I algorithm falls completely within the error reference line. Under the FUDS test, the result achieved by the SH algorithm still has local irregularities and deviates from the real SOC. In contrast, the two ISH algorithms converge smoothly to the near-real SOC, as can be noticed from the enlarged diagram. The accuracy of the ISH I is the highest under the FUDS test. The ISH II algorithm maintains the same superiority of the convergence speed, whereas its accuracy is retained, as can be noticed from the SOC error curve distributed in a dotted manner during the end of discharge. Based on Figure 3, it can be concluded that the two improved adaptive algorithms are able to follow the real SOC in case of the initial SOC error and have a good dynamic response during the whole process. Therefore, it is proved that the two improved methods are feasible and reliable.
The convergence time and SOC estimation errors under the CCD and FUDS tests are listed in Table 3, including the maximum error, root-mean-square error (RMSE, defined as the absolute difference between the simulated and measured values), and mean error. It is obvious that the errors under the FUDS condition are lower than those under the CCD condition. This result demonstrates that the two improved algorithms have a good dynamic adaptability in practical applications. The mean errors of the two improved algorithms are below 3% under different operating conditions; however, the SOC estimation error based on the ISH I algorithm is distributed within a small range. While the convergence time of the ISH II algorithm is faster than that of the other algorithms, its impact can be ignored due to the narrow time range. In summary, the estimation error of less than 3% achieved by the improved algorithms further reflect the stability of their underlying filter compared to the traditional SH algorithm under the FUDS test. Considering the balance between the SOC estimation accuracy and the filter stability, it can be concluded that the performance of the ISH I algorithm is better than that of the ISH II algorithm.

Estimation Using the Improved Maximum Likelihood Criterion Algorithm
To analyze the differences between the IIAE algorithm and the traditional IAE algorithm, we carried out simulation verification under the CCD test. The initial SOC was set to 0.2, and the respective initial parameter settings of the two algorithms were set to the same values. Figure 4 shows the SOC estimations of two IAE algorithms. In Figure 4a The SOC estimation based on the IIAE algorithm exhibits the favorable self-correction performance; in particular, it quickly converges to the real SOC. In contrast, the traditional IAE algorithm demonstrates large fluctuations, and the filter cannot converge (Figure 4b). Hence, it can be concluded that the IIAE algorithm is better than the IAE algorithm. When comparing the errors, the two IAE algorithms demonstrate good estimations when M is set to 100; however, the IAE algorithm has some points deviating from the error reference line. According to Figure 4d, the estimation error based on the IAE algorithm is greater than that of the IIAE algorithm, and it gradually increases. In contrast, the error of the IIAE algorithm always keeps within the reference lines, indicating that the estimation ability of the algorithm is relatively stable.
The error statistics of the SOC estimation under the CCD test are presented in Table 4. The maximum error of the IAE algorithm (M = 100) exceeds 4%, whereas the maximum error of the IIAE algorithm (M = 100) is less than 1.4%. When M = 10, the IAE algorithm has a complete divergence of the filter, whereas the IIAE still maintains similar stability and accuracy. When analyzing the convergence time, the convergence speed of the IAE algorithm was found to be lower than that of the IIAE algorithm.  In conclusion, the two types of the improved algorithms exhibit superb precision and stability. The high precision performance and good stability provide the possibility of estimating the battery SOC for EVs in real time. In particular, the mean error, maximum error, and RMSE of the IIAE algorithm are lower than those of the ISH algorithms under the CCD test. Furthermore, the two types of the improved algorithms have a favorable response speed under the initial SOC error.

Effects of the State Variable Error Covariance on the Estimation
To study the effect of the state variable error covariance P 0 on the convergence of the EKF, ISH I, and IIAE algorithms, two different initial SOCs were set under the CCD condition: (1) the same as the real SOC (the auto-covariance value of zero); and (2) different from the real SOC (the auto-covariance value of not zero). Before the verification, the polarization effect of the battery was ignored and the initial U p1 and U p2 were set to zero. P 0 was used as the auto-covariance matrix of the state variable set as a diagonal matrix. To simplify the analysis, the auto-covariance values P SOC , P Up1 , and P Up2 were regarded as identical. Figure 5 demonstrates the impact of P 0 on the SOC estimation errors for the EKF, ISH I, and IIAE algorithms under the CCD test. In particular, Figure 5a-c show the errors at the initial SOC = 1, while Figure 5d-f show the errors at the initial SOC = 0.2. P represents the auto-covariance values P SOC , P Up1 , and P Up2 in the legend. It can be inferred from the figures that the EKF and ISH I algorithms are not sensitive to p values and the error curves at different p values almost coincide. Furthermore, the maximum error of EKF is the largest, while the average error of EKF is larger than 1%. The maximum and average errors of ISH I are about 3% and 1.25%, respectively. In contrast, the maximum error of IIAE is below 1%; thus, the estimation accuracy of this algorithm is optimal. In Figure 5d-f, the set SOC is 0.2 and the real SOC is 1; thus, the auto-covariance P SOC of the SOC is 0.64. It can be concluded from the three enlargement diagrams that the corresponding simulation curves converge slowly due to the initial p values being farther away from the real P SOC . When the simulation error curve touches the reference line, the set P is not sensitive to the estimation error of the three algorithms. The smaller the set P is, the slower the convergence speed is and the larger the estimation error is.  In summary, (1) if the initial SOC is real, the estimation error of the three algorithms is not sensitive to P 0 ; (2) if the initial SOC is not real, P 0 has little effect on the estimation error after the convergence of the three algorithms, while it has an impact on the convergence speed. When the set P 0 value deviates from its real value, especially when P 0 is far less than the real value, the convergence time of the three algorithms becomes longer. In this case, the required convergence time for the IIAE algorithm becomes significantly longer, which is not acceptable in the real usage of the SOC estimation. Therefore, the recommended initial P 0 setting is the unit matrix, even if there is a large error between the actual and simulated SOC. In this way, the impact of the initial P 0 value on the convergence speed and estimation error can be reduced.

Effects of the Noise Covariance on the Estimation
The SOC estimation based on the traditional Kalman filter requires a precise setting of the initial values of Q and R. If the settings of Q and R are too large or too small, the accuracy becomes worse, and the filter diverges. Tan [38] put forward a method of setting Q and R in the Kalman filter by designing a large quantity of stochastic simulation experiments. Wei et al. [33] proposed a recursive formula of Q and concluded that the SH algorithm is not sensitive to the initial values of Q and R. The core of the adaptive algorithm based on the SH and IAE algorithms is to use the variance matching method for the variance matrix and the measurement noise to suppress the filter divergence and improve its accuracy. Consequently, it is assumed that the SOC estimation based on the ISH I and IIAE algorithms is insensitive to the initial values of Q and R. If these values are set as zero matrices, it is necessary to discuss (1) whether the two algorithms can proceed normally if they can converge and (2) whether the convergence time and estimation accuracy can meet the actual requirements.
The SOC estimation and error curves of the ISH I and IIAE algorithms under the CCD test are shown in Figure 6a,b, respectively. The SOC simulation curves of the two algorithms quickly converge to the real SOC. This indicates that the two adaptive algorithms can work well when the initial values of Q and R are set as zero matrices. It can be noticed from Figure 6b that the maximum error of the IIAE algorithm is less than 1.8%, while its average error is below 1%. The accuracy of the IIAE algorithm is higher than that of the ISH I algorithm. To further analyze the sensitivity of the ISH I and IIAE algorithms to the initial SOC value when the initial values of Q and R are set as zero matrices, the initial values of the SOC were adjusted to be 0.2., 0.4, 0.6, and 0.8. The errors of the two algorithms are shown in Figure 7a,b. The enlargement diagrams demonstrate that the simulation curves of the two adaptive algorithms converge faster when the initial value of the SOC is closer to its real value. In general, the SOC simulation curves for the two improved algorithms under different SOC initial values can quickly fall to the error reference line.  Table 5 lists the SOC estimation error statistical results based on the two improved algorithms at different initial values of the SOC. It can be seen from the table that the mean, RMSE, and convergence time of the IIAE algorithm are smaller than those of the ISH I algorithm. In particular, all SOC estimation average errors can be controlled to be within 2%. In this table, the SOC estimation results from the other state-of-the-art improved models [39][40][41] are also listfigureed. Compared with other algorithms, the IIAE algorithm has advantages of lower Max and RMSE, but its mean error is higher. Note that the comparison just has a reference value, since the test conditions, the initial SOC errors, and the employed computers are different. In summary, the IIAE algorithm is less sensitive to the initial value of the SOC and its convergence speed is fast in case of the large initial error.

Conclusions
In this study, we proposed two improved algorithms, named ISH and IIAE, for adaptive noise and simultaneously analyzed the stability and robustness on the estimation. The conclusions are as follows: The DP model with the highest accuracy and strong dynamic adaptability is selected as the research basis of the adaptive Kalman filter algorithm.
The SOC estimation of ISH algorithms under the CCD and the FUDS conditions shows that the ISH I algorithm has better performance in accuracy and filter stability. Under the CCD condition, the maximum error of IIAE algorithm is less than 1.5%, while the maximum error of the traditional IAE algorithm exceeds 3%. It is proved that the IIAE algorithm has good dynamic adaptability and accuracy.
By analyzing the sensitivity of two improved algorithms to the initial parameters, the IIAE algorithm has shown great advantages at improving the convergence speedy (the least convergence time is 6 s), filter stability (the initial SOC error can approach 100%), and accuracy (the least Max, Mean, and RMSE are 1.354%, 1.154%, and 1.302%, respectively). Compared with other state-of-the-art algorithms, the IIAE algorithm has advantages of lower Max and RMSE, but its mean error is higher.

Data Availability Statement:
The data presented in this study are available in this article.

Conflicts of Interest:
The authors declare no conflict of interests.

Abbreviations
The following abbreviations are used in this manuscript:

List of Notations
A list of the notations used in this paper is summarized below: b Forgetting factor C ek Innovation sequence {e k } covariancê C ek Optimal estimate of C ek C N The rated capacity of the battery C p1 Concentration capacitance C p2 Electrochemical capacitancê C sk Optimal estimate of s k covariance d k Adaptive factors K k Kalman gain M Moving average window length P 0 The initial error covariance P SOC The auto-covariance of SOC P Up1 The auto − covariance of U p1 P Up2 The auto − covariance of U p2 q k Mean values of process noise ω k Q Process covariance matrix r k Mean values of measurement noise v k R Measurement covariance matrix R 0 Ohmic internal resistance R p1 Concentration resistance R p2 Electrochemical resistance s k The innovation as a residual sequence U ocv Open circuit voltage U L The terminal voltage of the battery U p1 Concentration polarization voltage U p2 Electrochemical polarization voltage u k System excitation v

Measurement noise x k
State vector x k Filtered value of the state variablê x k/k−1 Predicted value of the state variablê z k Optimal estimated value of the current state variablex k z k/k−1 Predicted value of the measured variable τ 1 The time constant of the parallel circuit R p1 , C p1 τ 2 The time constant of the parallel circuit R p2 , C p2 ω Process noise η The discharge efficiency