Extended Kalman Filter-Based SOC Estimation for Lithium Battery Packs

. With the continuous reduction of energy and aggravation of environmental damage, the wind and solar complementary power generation system has received wide attention, among which the lithium battery pack is one of the most concerned components of the whole system. Accurate and effective estimation of the state of charge (SOC) of lithium battery pack not only can ensure the rational use of resources and reduce costs, but also ensure the safe and reliable operation of the system. Since the normal operation of Li-ion battery pack has strong nonlinearity, a general nonlinear equivalent circuit model is selected, the charge/discharge multiplier and ambient temperature are fully considered, the Fourier function is used to effectively fit the model parameters, and the extended Kalman filter algorithm (EKF) is used to dynamically estimate the SOC of Li-ion battery pack in combination with the traditional ampere-time integration method, and the simulation is verified by MATLAB software. The results show that the extended Kalman filter algorithm selected in the paper can effectively track the SOC of the lithium battery pack and control the tracking error below 1%.


Introduction
The battery state of charge (SOC) is an important parameter for the normal operation of a lithium battery pack, expressed as the ratio of the remaining charge to the rated capacity of the lithium battery pack [1]. There are many factors that affect the battery SOC estimation, among which the internal resistance of the battery itself, the current and voltage flowing through the battery, and external factors such as the ambient temperature have a great influence. Therefore, the selection of a suitable equivalent circuit model and estimation method is important for the accuracy of SOC estimation [2].
The common methods used today to study the SOC estimation of lithium battery packs are: the ampere-time integration method, the open-circuit voltage method, the internal resistance detection method, the neural network algorithm, and the Kalman filter algorithm [3]. Among them, the ampere-time integration method is simple and easy to implement, but the error will gradually accumulate and is greatly affected by the accuracy of current measurement [4]; the open-circuit voltage method cannot be measured online, and the battery must be put offline, which will affect the normal operation of the battery pack and cannot dynamically measure the SOC of the battery [5]; in the estimation of SOC by the internal resistance detection method, because the internal resistance of the lithium battery pack is particularly small, the normal operation of the lithium battery pack There is almost no change during normal operation of the Li-ion battery pack, which is prone to error [6] In using neural network algorithm, a large amount of training data needs to be prepared, which is more suitable for mature products [7] In this paper, we use a general nonlinear equivalent circuit model, use Fourier function to effectively fit the model parameters, combine the traditional ampere-time integration method, and apply the extended Kalman filter algorithm to dynamically estimate the state of charge (SOC) of the Li-ion battery pack, and The results prove the effectiveness of the algorithm by MATLAB software simulation for verification.

Extended Kalman filter algorithm
The standard Kalman filter algorithm is undoubtedly the best state estimation method in a linear system. However, in the scenery complementary power generation system, the lithium battery pack itself is a nonlinear dynamic system, so the standard Kalman filter algorithm needs to be improved to obtain the improved extended Kalman filter method to realize the dynamic estimation of SOC of the lithium battery pack. Compared with the standard Kalman filter algorithm, the extended Kalman filter algorithm first linearizes the nonlinear system of the lithium battery pack on the basis of the system state space model, and then uses the circular iteration of the standard Kalman filter algorithm to achieve algorithmic optimal estimation of the state variables [8].

Standard Kalman filter algorithm
The standard Kalman filtering algorithm describes a linear relationship between states and states, hence the name best linear filtering algorithm [9]. It is simple to implement and at the same time is a pure time domain algorithm that does not require frequency domain transformations and has many applications in engineering [10].
The state prediction equation: In the equation (1) x  for the estimate of k x  ; k for the estimate of x based on the speculation of the previous moment.
After getting the estimated value of x , it needs to be corrected with the observed quantity to get the best estimate. The state prediction formula is used to speculate the state of x at the current moment, but this speculation contains noise, and the greater the noise, the greater the uncertainty of the speculation. In this case, the covariance matrix P needs to be defined.
The current state covariance is calculated as： (2) In the standard Kalman filter algorithm, according to the nature of the covariance matrix, the covariance matrix P is multiplied by the state transfer matrix A and its transpose A T to obtain the current state covariance calculation equation. The system covariance matrix, Q represents the noise introduced by the prediction model itself. Observations: In the equation (3); H is the observation matrix, V is the observation noise, and the covariance matrix of this noise is denoted by R .
Combining the predicted and measured values, the optimal estimate of the current state is obtained  (6). at this point the algorithm can proceed iteratively in a loop and eventually obtain the optimal estimate.

Extended Kalman filtering algorithm (EKF)
The extended Kalman filter algorithm (EKF) is a modified standard Kalman filter algorithm with many similarities in nature [11], and both algorithms consist of initialization, prediction estimation, and optimal estimation intercept components [12].
The state space equations of the nonlinear system are as follows: k k g x u is the measurement function; k w is the system noise, whose covariance matrix is k Q ; and k V represents the observation noise, whose covariance matrix is k R . The nonlinear discretetime state space model is described in Fig. 1. Initial conditions: (9) State variable prediction estimation:

Simulation Verification
In order to verify that the extended Kalman filter algorithm can effectively and accurately estimate the SOC of the battery pack dynamically, as well as its strong correction capability, which can solve the error accumulation problem generated by the ampere-time integration method, this paper uses pulse charging and discharging to simulate the working state of the battery, and chooses a 10Ah/3.2V LiFePO4 battery as the research object, in which Set the state error w to 0.5 and the measurement error v to 1, as shown in Fig. 2.
In the simulation, pulse charging and discharging is used to simulate the actual working state of the battery, and the SOC of the battery is estimated dynamically in different states of discharging, resting, and charging, taking discharging as positive, discharging at 2/3C for constant current each time, and charging at 1/2C. The true SOC value in the figure is the output value based on the accuracy of the model, and the EKF estimate is the value estimated using the extended Kalman filter algorithm in combination with the ansatz integration method, and the EKF estimate converges to the true value at approximately 4.5s. The EKF estimates are compared with the true SOC values to obtain the error diagram of the SOC estimation results.
The EKF estimated value converges to the true value stably and the control error is below 1%, which proves the validity and accuracy of the EKF estimation. The figure shows the comparison of the EKF and the SOC estimation by the ampere-time integration method. Where the estimated value of the ampere-time integration method is the calculated value based on the current magnitude and the charging efficiency at the corresponding current. As can be seen from the figure, the SOC estimated based on the EKF overcomes the shortcomings of the error accumulation of the traditional ampere-time integration method, and its estimation is more accurate, stable, and fast.

Conclusion
In this paper, the extended Kalman filter algorithm is proposed to estimate the SOC of the battery pack and simulate the actual working condition of the battery by using pulse charging and discharging. The extended Kalman filter algorithm can accurately estimate the SOC of the battery under different operating conditions, and the algorithm is stable with the control error below 1%, which lays a good foundation for the balanced management of the battery pack. However, this paper does not consider the battery life and self-discharge factors in the establishment of the battery mathematical model, in which the battery life has a very important impact on the actual operation of the wind-solar hybrid power system.