A Novel Adaptive State of Charge Iterative Calculation Method by Using the Improved Unscented Kalman Filtering Algorithm for the Lithium Ion Battery Packs

The state of charge estimation is an important part of the battery management system, the estimation accuracy of which seriously affects the working performance of the lithium ion battery pack. The unscented Kalman filter algorithm has been developed and applied to the iterative calculation process. When it is used to estimate the SOC value, there is a rounding error in the numerical calculation. When the sigma point is sampled in the next round, an imaginary number appears, resulting in the estimation failure. In order to improve the estimation accuracy, an improved adaptive square root unscented Kalman filter method is introduced which combines the QR decomposition in the calculation process. Meanwhile, an adaptive noise covariance matching method is implied. Experiments show that the proposed method can guarantee the semi-positive and numerical stability of the state covariance, and the estimation accuracy can reach the third-order precision. The error remains about 1.60% under the condition of drastic voltage and current changes. The conclusion of this experiment can provide a theoretical basis of the state of charge estimation in the battery management of the lithium ion battery pack.


Introduction
Lithium ion batteries (LIBs) have been widely used in the power supply applications, which play an important role in promoting these technologies.In order to determine the remaining battery life prediction, real-time battery management and extending its useful life, more accurate monitoring of the battery available energy and state-of-charge (SOC) should be required.In recent years, dozens of schemes have been proposed to improve the SOC estimation accuracy.
The time integral to the battery current is regarded as the most direct SOC estimation method.However, this method easily causes a cumulative error and has a strong dependence on the initial value, which may result in the large SOC error in practical applications (Xiong, Cao, Yu, He, & Sun, 2018).The Open Circuit Voltage (OCV) method uses the measured voltage signals for the periodic correction of the integral SOC estimation process.However, the OCV value needs to wait for a long time before the measurement (Shen, 2018b), making this strategy to be not desirable in practice.The Extended Kalman filter (EKF) algorithm (Cacciato, Nobile, Scarcella, & Scelba, 2017) has become the most common algorithm, which linearizes the nonlinear system, ignoring the Taylor-type higher-order terms and computing Jacobi matrices for each filter cycle.Adaptive EKF based SOC determination was conducted for lithium-ion batteries (Shen, 2018a).The SOC inconsistency estimation was investigated for the LIB pack using mean-difference model and EKF (Y.J. Zheng, W. K. Gao, et al., 2018).Adaptive EKF based SOC determination is realized for LIBs (Shen, 2018a).A temperature compensated SOC estimation model was proposed for LIBs by using EKF for an implantable charger (Lee, Dai, & Chuang, 2018).Robustness EKF evaluation was investigated for the battery SOC estimation (Huang et al., 2018).Online LIB internal resistance measurement application of SOC estimation was realized by using the EKF algorithm (D.Wang, Bao, & Shi, 2017).EKF is used for the accurate SOC estimation of lithium-based batteries together with a comparative analysis (Ramadan, Becherif, & Claude, 2017).The SOC estimation of LIBs was realized by using a grey EKF algorithm and a novel OCV modelling method (Pan, Lu, Lin, Li, & Chen, 2017), and an EKF-based SOC estimation algorithm was proposed to realize the safety protection for the Unmanned Aerial Vehicle (UAV) LIB packs.
If the SOC estimation is complicated, the computational cost will be very large and the EKF method is sub-optimal (Y.J. Zheng, Ouyang, Han, Lu, & Li, 2018).If the given initial state is inappropriate, it is easy to cause the filter to diverge (L.F. Zheng, Zhu, Lu, Wang, & He, 2018).The Unscented Kalman Filtering (UKF) algorithm was proposed as a derived estimation algorithm (W.Z. Zhao, Kong, & Wang, 2018), which consistently outperformed EKF in terms of prediction and estimation error.Both EKF and UKF use the system state covariance matrix.Due to the existence of the rounding error, the error covariance matrix tends to lose its positive definiteness and symmetry (Zeng, Tian, Li, & Tian, 2018), causing the system to become ill-conditioned and thus cause the filter to fail.Many scholars studied the dual Kalman filter and consider it for SOC estimation (Ye, Guo, Xiong, & Yu, 2018).An adaptive method was proposed to realize the SOC estimation of an aeronautical LIB pack based on a reduced particle-UKF algorithm (S.L. Wang, C. M. Yu, et al., 2018).A wavelet transform-adaptive UKF approach was proposed to realize the SOC estimation of LIB (Li, Wang, & Gong, 2018).The LIB parameters and SOC joint estimation was investigated based on H-Infinity and UKFs (Yu, Xiong, Lin, Shen, & Deng, 2017).The SOC estimation of battery energy storage systems was constructed by using the adaptive UKF with a noise statistics estimator (Peng, Chen, Shi, & Yao, 2017).An adaptive square root UKF approach was conducted for the SOC estimation of LIBs (Liu, Cui, & Zhang, 2017).A new SOC estimation algorithm was investigated for LIBs by using the fractional UKF (Chen et al., 2017).Lithium polymer battery SOC estimation was conducted by using the adaptive UKF and Support Vector Machine (SVM) (Meng, Luo, & Gao, 2016).Real-time estimation of battery SOC with UKF and RTOS mu COS-II platform was also investigated (He, Xiong, & Peng, 2016).
The SOC estimation was realized for LIBs by using optimized Levenberg-Marquardt wavelet Neural Network (NN) (Xia et al., 2018).
The SOC estimation of LIBs over wide temperature ranges using the UKF algorithm (Wu, Li, & Du, 2018).Power capability evaluation was conducted for LIBs based on multi-parameter constraints estimation (Y.J. Wang, Pan, Liu, Chen, & Ling, 2018).The Open Circuit Voltage (OCV) and SOC relationship functional optimization was conducted for the working state monitoring of the aerial LIB pack (S.L. Wang, C. Fernandez, C. Y. Zou, et al., 2018).An adaptive SOC estimation approach was introduced into the lithium-ion series-connected battery system (Peng et al., 2018).An overview and comparison of online implemented SOC estimation methods were conducted for the LIB (Meng et al., 2018).A wavelet transform-adaptive UKF approach was proposed to realize the SOC estimation of LIB (Li et al., 2018).The SOC estimation was realized by using a new dual-polarization-resistance model for electric vehicles (X.W. Zhao, Cai, Yang, Deng, & Qiang, 2017).A novel remaining energy prediction approach was conducted for large format LIB packs (Zhang, Wang, Liu, & Chen, 2017).
In this paper, an improved square root UKF algorithm is introduced into the SOC estimation of the LIB pack to ensure the stability of the data and the semi -positivity of the matrix.Since it sets the noise covariance to a fixed value, its accuracy will be greatly reduced.As a result, an adaptive algorithm based on the proposed algorithm is added in order to match the error covariance matrix adaptively, so as to update the noise in real time and improve the SOC estimation accuracy.

Equivalent circuit modeling
The LIB model is divided into neural network (NN) model, electrochemical model, Equivalent Circuit Model (ECM) and so on.NN model requires a large number of samples, and it is relatively difficult to establish the NN equivalent model.Electrochemical model is based on the battery internal chemical reaction, which estimates the SOC with high accuracy but requires large amount of calculation, making it only adapted to the theoretical analysis.ECMs are the most common application models, including R int , RC, Thevenin, PNGV and GNL models.Thevenin and PNGV models are most commonly used, but the Thevenin models cannot reflect the steady-state voltage changes in a time period of the LIB pack.GNL is the most complicated model, because its structure is complex.In addition, its parameters are very difficult to be identified, which is conducted by using the experimental results.Also, its accuracy is not much improved compared with the PNGV model.As a result, the PNGV model is more suitable to describe the battery status in dynamic environment, which is selected to realize the state-space characterization of the LIB pack.
In the PNGV model, the discharge direction is set as positive and E is the ideal voltage source  According to the ECM of LIB pack, this paper selects only the parameter SOC as the system state variable and battery terminal voltage U L as the observed variable.The state variable dimension is reduced which greatly cuts down the computational complexity, compared with other methods that selected [SOC U P U b ] T as the system stated variables.By taking the discharge direction as positive, the established battery statespace equation can be established that is shown in Equation 2.
Wherein, Q N denotes the battery rated capacity and T S for the sampling time.

Parameter identification
The battery internal resistance was measured by using the Hybrid Pulse Power Characteristics (HPPC) test method, and the principle is described as follows.The current pulses are imposed on the two poles of the LIB, and then the internal parameters of the battery can be calculated by detecting the voltage change at each time moment of the charging and discharging maintenance.In this paper, LIBs produced by AVIC LIB Co., Ltd is taken as the research object, and the experimental test equipment is manufactured by Shenzhen Yakeyuan Technology Co., Ltd.In order to adjust the ambient temperature, the incubator SETH-Z-040L was used for the test.Due to the large variation on the battery SOC and internal resistance along with temperature (Cheng, Lv, Liu, & Yan, 2014) According to Ohm law, the ohm internal of the battery can be calculated by using the formula for R o =Δu / i , in which Δu is the voltage drop of the discharging time moment.The relationship can also be obtained similarly when the battery is charged.In the HPPC test, the ohm resistance of the battery disappears instantaneously at the instant of discharge, leaving only the polarization resistor and the polarization capacitor, which can be solved in accordance with Equation 3 and Equation 4.
In the PNGV model, C b is the storage capacitor, which is the energy storage parameter that affects the OCV value, which is obtained by initializing the SOC value and the relationship that is shown in Equation 4. U oc represents the corresponding OCV value of the battery along with different SOC states.Simplified mathematical expression can be used to obtain the C b value of different SOC states, which is shown in Equation 5.
A series of HPPC tests can be used to calculate the battery internal parameters under different SOC states.Taking the OCV value U oc as an example, the SOC is reduced by 0.05 for every discharging time period and a corresponding U oc can be obtained, with 21 discrete data points.
Polynomial least squares fitting method is adopted in this paper that is shown in Fig. 2  As it can be known from the above figure, it is difficult to guarantee the fitting accuracy by low-order fitting, and it may lead to over-fitting with too high-order fitting method.Considering both of the accuracies and computational complexity, the seventh-order fitting method is selected finally.Similarly, the other parameters can be obtained with different SOC conditions.In order to simplify the model, the polarization resistance and capacitance can be considered as fixed values.However, it reduces the estimation accuracy undoubtedly.

SOC iterative calculation algorithm
The battery voltage shows a strong non-linear change in the charging and discharging process.The discrete state space equation is shown in Equation 6, in which f and h respectively represent the nonlinear state equation and observation equation.x k is the state variable, y k is the observation variable, u k is the input variable, ω k is the system noise, the variance is Q k , ν k is the measurement noise, and the variance is R k .
EKF expands the nonlinear function by Taylor expansion and discards higher-order terms, which leads to an estimation error increase.
Meanwhile, the derivation of Jacobi matrix greatly increases the computational complexity.Instead of linearizing the nonlinear function, the UKF approximates the probability density of the nonlinear function.The estimation accuracy of the UKF is better than EKF, but its value is unstable when the model parameter changes.The square root UKF solves this problem with the same estimation accuracy as UKF, and guarantees the semi-positive and the numerical stability of the covariance matrix.Wang et al. put forward an improved strong tracking square root UKF algorithm when studying the satellite attitude determination system (S.L. Wang, Fernandez, Shang, Li, & Yuan, 2018), which makes the system have better stability, robustness and tracking abrupt state.
The most computationally expensive operation in the UKF is the recalculation of new sigma points in each update step.The difference between square root UKF and UKF lies in that square root UKF uses the square root of the variable error covariance instead of the initial values, and directly transmits the square root of the covariance without calculating each time.When S is the square root of the covariance matrix P, that is SS T = P, P can be guaranteed to be nonnegative as long as S ≠ 0. Three powerful linear algebra techniques used by square root UKF include QR decomposition, Cholesky factor update, and efficient least squares.The square root UKF algorithm mainly includes four parts: initialization, sigma point sampling, time update and status update, which are described in detail as follows.
(1) Initialization According to the actual situation, the initial value of state variable 0 x and the initial value of error covariance P 0 can be obtained accordingly.S 0 is the cholesky factor of covariance, S 0 =chol(P 0 ).The initial values of these parameters can be determined as follows: (2) Sigma point sampling Unscented transform (UT) is the core treatment step of the UKF algorithm, and the most critical steps of the UT transform to contain two parts, namely the sampling strategy selection and the weight coefficient calculation.Herein, the symmetric sampling strategy is adopted to transform n-dimensional stated variables into 2*n+1 n-dimensional variables and ensure that the expected and variance of the reference points are unchanged.
And the weight ω c of the sampling points can be obtained according to Equation 10.Wherein, n is the dimension of the state variables.α is the walking degree factor, which is chosen to determine the degree of closeness between the sampling point and the mean, usually taking a positive number between 10 -6 and 1. β means the pre-distribution factor, β = 2 is optimal for Gaussian distribution.k is auxiliary scale factor, which should satisfy the formula for k + n ≠ 0. λ is scaling parameter, which is initialized as λ = α 2 (n + k) -n.Reasonable adjustment of α and k can improve the SOC estimation accuracy of the proposed algorithm.
(3) Time update According to the state at k-1 time moment, the state variables are further predicted by the Equations of 11 and 12.
| 1 1| 1 1 ( , ) The QR decomposition of the state variable error covariance is performed according to the one-step prediction of sampling points, which is shown in Equation 13.
Taking into account the different values of α and k may lead ω c 0 become negative.Therefore, Equation 14 should be used to guarantee the semi-positive of the matrix.
According to the result of the one-step prediction in Equation 11, one-step prediction of the observed variables is derived from the observation equation, as shown in the following equations.
The covariance variance between the state variables and the observed variables can be given by Equation 19, whose value directly affects the Kalman gain magnitude.
The Kalman gain is calculated by using the formula that is shown in Equation 20.

, ( )
The update of system stated variables and their error covariance update can be expressed by Equation 21, in which y k is the measurement

Error correction strategy improvement
In the standard UKF algorithm, the actual noise variance is often difficult to obtain.In order to simplify the calculation, the noise covariance can be usually regarded as fixed values of the system state and measurement.However, inaccurate noise statistics can reduce the estimation accuracy of and even disperse its calculation process (Y.J. Zheng, W. K. Gao, et al., 2018).In response to this problem, the adaptive noise covariance matching is introduced to this interrelate calculation process, which updates and delivers the noise covariance matrix in real time so that it is closer to the real situation.In the system noise update, the error expression of observational variables at k time point can be described in Equation 22.
The variance in the first M time errors can be weighted averagely to get the covariance function of H k , the expression of which can be described in Equation 23.
In order to improve the estimation accuracy while reducing the computational complexity as much as possible, the first three updates are taken in to realize the calculation process, that is, M = 3.The updating process of system noise and observation noise is shown in Equation 24.
Since P k decreases gradually with time and finally approaches 0, the P k part is negligible.

Relevant BMS device design
In order to realize the condition monitoring target of a series of single-unit LIB packs of 4, 6, and 8 models on the UAV, the BMS equipment was designed.It is modularized by microprocessor + integrated chip sampling, the size of which is 82*52*15mm.And it supports digital communication networking extension such as SPI and CAN.It realizes high-precision real-time detection and display of each cell voltage and total voltage that is accurate to 1mV, and combines the two-division iterative calculation to realize SOC estimation, featuring low power consumption, high integration and small size.The relevant BMS device is designed and realized that is shown in Fig. 3. Through the working condition characteristic analysis of the LIB pack of the UAV, the composite ECM can be constructed.The UKF estimation algorithm is improved and the recursive operation of the SOC value is realized.The method of correcting the equilibrium state influence on the internal connected monomers of the grouping SOC estimation is studied to improve the calculation accuracy.The proposed algorithm is embedded in the BMS system, and the voltage change rate combined to improve the endurance monitoring accuracy, which provides a basis of the energy controlling adjustment and safety management.

Equivalent model parameter verification
Taking the battery parameters into the ECM model, the output voltage waveform measurement model can be obtained.The waveform shows that the battery terminal voltage error does not exceed 10mV in this model, that is, the maximum error are not exceeding 0.4%.The accuracy and reliability can be used in the following research.The comparison curve obtained in the experiments can be described that is shown in Fig. 4.

SOC estimation performance with simple working conditions
In the constant current discharge test, the LIB was fully discharged with a constant current of 1 C 5 A. The experimental temperature is 25 ℃, and different temperatures correspond to different SOC values, and the model is still applicable to different temperatures.In order to verify the improvement on the algorithm, the traditional UKF and adaptive square root UKF algorithm were respectively used to simulate the simulation waveform.After local amplification, it can be seen that due to the large discrepancy between the given initial noise covariance and the actual noise covariance at the initial stage of discharge, the UKF algorithm is more turbulent and the square root UKF algorithm is relatively better.The square root UKF algorithm quickly converges near the real value and it estimates almost to coincide with the theoretical value, and the estimation value can well follow the theoretical SOC until the end of the discharge process.The estimated results of Square root UKF algorithm is far better than the UKF algorithm that is shown in Fig. 5.As can be seen from the SOC error curve, the improved algorithm has obvious effect and the error is greatly reduced compared with the error obtained by the UKF algorithm.The maximum error reaches 2.5% due to the internal polarization effect of the battery of the initial discharge and the last discharge.The error of square root algorithm was also increased, but the maximum error still did not exceed 1.4%.During the discharge platform period, the error is far below 0.5%.

Estimation effect with different initial values
In order to verify the robustness of the square root UKF algorithm to the initial value, we select the initial SOC of 0.95,0.83,0.53 and 0.1 for simulation.Run the simulation model, the waveform is shown in Fig. 6.Under different initial SOC states, a constant current discharge of 1 C is performed on the LIB pack.The adaptive square rooted UKF algorithm can quickly converge the initial value of the theoretical value vicinity.The closer to the true value, the faster the convergence.Even if the initial value is set at 0.1 which can be quite different from the true value, the real value can be gradually approximated after a period of correction that is about 80s.

Segmented constant current case analysis
In order to analyze the effect of the algorithm on the current sudden change, a constant current test was designed.The initial discharging current is 1 C, after a period of time it changes into 0.5 C, then turn to 0.3 C in a period of time, and then changes in 0.2 C. The effect is shown in Fig. 7.As can be seen from the experimental results, both the square root UKF algorithm and the UKF algorithm have good tracking performance when the current is abruptly changed.And the estimation accuracy of the square root UKF algorithm is improved, the estimation error can be reduced by about 1% at most working conditions, compared with the UKF algorithm.

The SOC estimation result in HPPC test
In order to verify the effect of square root UKF algorithm under variable current conditions, the strengths and weaknesses for the square root UKF and traditional UKF algorithms were verified by using the HPPC test data.The test procedure is as follows.Firstly, a series of pulse tests were carried out at with SOC equaling to 1, and then discharged at a current of 1C to reduce the SOC to 0.95.After one more hour of rest, a pulse test was performed again.The SOC was reduced by 0.05 in sequence to conduct a pulse test, the voltage waveform is shown in Fig. 8.The square root UKF and UKF algorithms are applied to the above SOC estimation test, and the SOC estimation results are shown in the error waveform.As can be seen from the figure, the square root UKF algorithm can still follow the theoretical SOC value of the drastic voltage and current changing conditions.The square root UKF reduces the error by about 1.4% compared with the maximum 3.2% error reached by UKF.The maximum error can only reach to be 1.8%, in the case of drastic voltage and current changes.

Conclusion
The UKF algorithm has a slow convergence rate in the SOC estimation process of the LIB pack, due to the rounding error in the numerical calculation.Aiming at this problem, QR decomposition is combined with UKF, introducing an adaptive square root UKF algorithm.In order to improve the SOC estimation accuracy, a noise adaptive covariance matching module is added.Based on the PNGV model, SOC is used as a state variable, the feasibility of the algorithm is verified under four different battery states: constant current discharge, different initial values of SOC, piecewise constant current and HPPC pulses.Under the condition of constant current discharge, the estimated error of square root UKF is far below 0.5%.Under different initial SOC values, the square root UKF algorithm can quickly converge the initial point near the theoretical value.Under the condition of piecewise constant current, the square root UKF algorithm can reduce the error by about 1% compared with the UKF algorithm.Under the HPPC test conditions, the maximum error of the square root UKF algorithm can be only about 1.8%.In the case of drastic voltage and current changes, the error remained at about 1.6%.Experiments show that the square root UKF algorithm can not only avoid the problems of negative matrix and unsteady values in the UKF algorithm, but also greatly improve the accuracy of SOC estimation.
. The model adds a new capacitor C b based on the Thevenin model, which describes the voltage change along with the time accumulation of the load current.E and C b together represent the OCV characteristic of U oc .R o is the ohm resistance of the battery.R p and C p are the polarization resistance and polarization capacitance of the battery respectively, which represent the battery charge and discharge polarization characteristics.The battery charge and discharge current is characterized by the parameter of i. U L is the battery terminal voltage.The time integral to the battery current is regarded as the most direct SOC estimation method, the calculation process of which is shown in Equation 1.
0 ) represents the initial SOC value.C N represents the battery rated capacity which is realized by using the Ah method.The instantaneous current is represented by the parameter of I.And the discharge direction is positive.η represents the Coulomb coefficient.

Fig. 2 .
Fig. 2. Fitting effect analysis under different orders i-th column of the covariance Cholesky factor of state variables at k time point, and calculate the mean weight ω m

Fig. 5 .
Fig. 5. SOC estimation comparative of 1C-rate constant current Fig. 6.The SOC estimation effect under different initial values

Fig. 7 .
Fig. 7. SOC estimation comparison in the segment constant current