Novel Feedback-Bayesian BP Neural Network Combined with Extended Kalman Filtering for the Battery State-of-Charge Estimation

The state of charge estimation of lithium-ion batteries plays an important role in real-time monitoring and safety. To solve the problem that high non-linearity during real-time estimation of lithium-ion batteries who cause that it is difficult to estimate accurately. Taking lithium-ion battery as the research object, the working characteristics of lithium-ion ion battery are studied under various working conditions. To reduce the error caused by the nonlinearity of the lithium battery system, the BP neural network with the high approximation of nonlinearity is combined with the extended Kalman filtering. At the same time, to eliminate the overfitting of training, Bayesian regularization is used to optimize the neural network. Taking into account the real-time requirements of lithium-ion batteries, a feedback network is adopted to carry out real-time algorithm integration on lithium-ion batteries. A simulation model is established, and the results are analyzed in combination with various working conditions. Experimental results show that the algorithm has the characteristics of fast convergence and good tracking effect, and the estimation error is within 1.10%. It is verified that the Feedback-Bayesian BP neural network combined with the extended Kalman filtering algorithm can improve the accuracy of lithium-ion battery state-of-charge estimation.


INTRODUCTION
Energy planning and environmental protection play an important role in the development of the world [1][2][3]. Seeking new energy to replace traditional fuels has become a hot topic in the world [4]. Lithium-ion batteries are widely used in industry and life because of their high energy density, strong portability, and high-cost performance [5,6]. For the rapid development of lithium-ion batteries, people pay more and more attention to their safety and reusability [7][8][9][10][11]. Therefore, an accurate estimation of the state of charge (SOC) of the lithium-ion battery is of great significance for extending the life of the lithium-ion battery, maximizing its performance, and realizing the real-time monitoring and safety control of the lithium-ion battery [12,13].
Lithium-ion batteries have complex internal chemical reactions and are easily affected by the environment, especially under complex working conditions, accompanied by polarization effects and ohmic effects [14][15][16]. These factors make it difficult to estimate SOC, so traditional algorithms are difficult to estimate SOC accurately and in real-time [17,18].
At present, common methods for estimating SOC include the open-circuit voltage (OCV) method [19], Ampere-hour (Ah) integration method [20], neural network method, Kalman filtering (KF) method [21,22], etc. The open-circuit voltage method takes a lot of time to stand the battery, which is not suitable for real-time estimation. The ampere-hour integral method is to estimate the SOC of the current integral. Because the algorithm is simple, the anti-interference ability is weak. If there is a deviation, the error will become bigger and bigger with time [23]. BP neural network has high approximation nonlinear ability, and can also be used for SOC estimation, but the disadvantage is that this method requires a large amount of battery charge and discharge test data as a basis [24]. If the voltage and current detection error are too large, it will often affect the estimation accuracy of the SOC. Kalman filtering has strong antiinterference and is suitable for estimating SOC, but it will inevitably cause errors in nonlinear processing and rely on accurate battery models [25,26].
This paper takes lithium-ion battery as the research object, analyzes the characteristics of the lithium-ion battery, and proposes a feedback type algorithm based on Bayesian regularization BP neural network and extended Kalman filtering (FBP-EKF). This algorithm can avoid the shortcomings of the EKF algorithm relying on accurate battery model and BP neural network training a large amount of data slowly, but also retains the characteristics of high robustness of EKF algorithm and strong nonlinear characteristics of BP neural network, and through the testing of Hybrid Pulse Power Characterization test (HPPC), Capacity test, Dynamic stress test (DST), Beijing Bus Dynamic Stress Test (BBDST) and other complex working conditions.

MATHEMATICAL ANALYSIS
The state of charge estimation of Li-ion batteries has high requirements for the real-time performance and reliability of the algorithm, so it is very important to simulate the battery characteristics by using a reasonable model and a suitable algorithm.

Equivalent modeling
Considering the actual application of the battery, it has a polarization effect and an ohmic effect [27]. Comprehensive industrial needs, using Thevenin model. Thevenin has the characteristics of easy identification, simple structure, and accurate accuracy. Its structure is shown in Figure 1. In Figure 1, UOC represents the open-circuit voltage, and UL is the terminal voltage. R0 represents the ohmic internal resistance, which is used to represent the voltage change effect at the moment of battery charging and discharging. RP and CP form an RC loop to represent the polarization effect of the Li-ion battery. According to Kirchhoff's law and analyzing the model [28], the following equations can be obtained Eq. (1).

 
According to Eq.(1), using the knowledge of modern control theory, the state space variables, input variables, and output variables are selected and discretized to obtain the discrete equation, as shown in Eq. (2).
In Eq. (2), SOC is the state of charge of the lithium-ion battery, UP is the polarization voltage.
QN is the rated capacity of the battery, and Ik is the current at the current time, △t is the sampling time interval, and τ is the time constant, τ = RPCP.

Extended Kalman filtering
The extended Kalman filtering is an excellent prediction algorithm in modern times. Its basic idea is to linearize the nonlinear system by Taylor series expansion, and then use the Kalman filtering framework to filter the signal, so it is a sub-optimal filter [29]. The algorithm is as follows Eq. (3).
The extended Kalman filtering algorithm is used for initial state estimation to solve the convergence problem. Because only the Jacobian matrix of the previous time needs to be calculated, it is also used for real-time online estimation to reduce the computational complexity.

Bayesian BP neural network
Using Bayes' rule method, the traditional BP network algorithm is optimized to minimize the linear combination of square error and weight. The network obtained at the end of training will have good generalization ability.
Where jX is the Jacobian matrix of the performance of the deviation variable, E is all errors, I is the identity matrix, and mu is the adaptive value. The adaptive value will be adjusted to the best with the iteration of the network.  Fig. 2, The adaptive value mu is increased by mu_inc until the change shown above results in a reduced performance value. The change is then made to the network, and mu is decreased by mu_dec.

Algorithm Structure
The extended Kalman filtering uses Taylor's class number to transform the nonlinear problem into a linear problem, so the existence of linearity will inevitably lead to errors in estimation. The Bayesian BP neural network has high approximation linear ability [30], so the two algorithms are combined, and its structure is as shown in Predictive value Accurate value mu_inc mu_dec adjust Figure 3. The left side of Figure 3 is the beginning of the algorithm, which operates in an offline state. In offline conditions, the BP network is trained by using relevant parameters of EKF, and a well-trained NET will be obtained. Using the EKF algorithm, its gain and state vectors are recorded in each iteration. Their calculation process is Eq. (3). These parameters and current and voltage at the current moment are taken as the input, and the output is set to the accurate SOC, and then the regularized BP network is used for training. At the same time, the right side of Figure 3 shows the structure of the real-time algorithm. The Bayesian BP neural network at this time is the net trained in the offline state. Therefore, the trained NET is called and the gain, state vector, voltage, current, and other parameters under real-time conditions are input to obtain the estimated SOC value. By using the relevant calculation of weights, the weights of EKF and BP are adjusted and added together, and then returned to the optimal estimation in EKF to continue the next iteration.

Test platform construction
The schematic diagram of the lithium-ion battery charge and discharge test system is shown in 0. It mainly includes three parts, the first part is the Li-ion battery, the object of this experiment. The second part is the hardware part of the Li-ion battery charge and discharge test system, which is mainly composed of a signal acquisition unit, a regulated power supply, a charge, and discharge instrument, and a current transformer. The third part is the control system for information interaction. In the following experiments, the original experimental data set is obtained from the above Li-ion battery test system. At the same time, all simulations were implemented on laptops equipped with Intel(R) i5-8300H CPU.

Parameter identification
According to the experimental procedure, the Li-ion battery is tested by HPPC. The HPPC test should be performed under SOC=0.9,0.8,0.7... etc. Figure 5 is a pulse experiment performed when SOC=100%. The U1-U2 segment is caused by the ohmic internal resistance R0, which shows that the voltage of the Li-ion battery drops rapidly at the moment of discharge. The same true for U3-U4. Eq.(5) can be obtained. 1 2 The polarization capacitor Cp is discharged through the polarization resistance Rp to form a zeroinput response, so the voltage rises slowly, we can calculate the relevant value, as shown in the following Eq. (6).  Table 1. Using Matlab/Simulink to verify, the real voltage and current data under the cycle discharge are imported in the Thevenin model. The model is verified by combining it with the parameter identification results. The estimation value is compared with the real value in Figure 6.  In Figure 6, the Thevenin model has a good tracking effect, with an average estimation deviation of 0.03V, which can characterize the terminal voltage of the battery in operation.

Capacity test analysis
The first step is to train the network first. To collect more data to improve the BP neural network, the lithium-ion battery with SOC=100% is discharged at a discharge rate of 0.1C. Voltage and current data at this time are collected. Using the extended Kalman algorithm to simulate the process of this 0.1C discharge, the computer collect data about Kalman gain and space state vector. This experiment collects 686,654 sets of data, and the collected data are trained to obtain the net framework.
The lithium-ion battery is put into the real-time system to discharge at the rate of 0.2C, and the voltage and current data at the same time are recorded. The extended Kalman filtering is used to combine voltage and current data to import the BP net, and the feedback is carried out according to the weight. The results are shown in   Figure 7 (a), the S1 curve is the SOC estimated by the Ampere-hour integration method, the S2 curve is the SOC estimated by EKF, and the S3 curve is the SOC estimated by FBP-EKF. Taking Ampere-hour integral method as the accurate SOC, Figure 7 (b) is made. Err1 is the error of extended Kalman filtering and err2 is the error of FBP-EKF. In the figure, the two algorithms show good prediction results, in which the EKF error is 1.57%, and the FBP-EKF is 1.10%. Compared with the method in literature [31], the BP neural network is also improved by input in literature [31], but it does not construct a structure like the FBP-EKF feedback type. As a result, only the current data affects the accuracy of each estimation so the accuracy cannot be significantly improved. Since FBP-EKF has a feedback mechanism, the past data will be integrated into each iteration, which improves the accuracy of estimating SOC.

Complex condition analysis
To further verify the SOC estimation of the lithium-ion battery through the estimation model under more complex application conditions, the BBDST and customized DST test data are used to simulate and verify the structure. BBDST condition is complex, which can reflect and better train data. There are 221488 groups of current and voltage, as shown in Figure 8 below. In practical applications, the real-time current of lithium batteries is complex and changeable. In different working conditions, it is often accompanied by the sudden switch and stop of the current, which puts forward strict requirements for the dynamic performance of the battery, so DST is used as the test data. the results are shown in Figure 9. In Figure 9(a), the curve S1 represents the SOC estimated by the Ampere-hour integral method, the curve S2 represents the SOC estimated by EKF, and the curve S3 represents the SOC estimated by FBP-EKF. In (b), the SOC estimated by the hour integral is used as the accurate SOC. The curve Err1 represents the estimation error of the EKF and Ampere-hour integration method, and the curve Err2 represents the estimation error of the FBP-EKF and the Ampere-hour integration method. The maximum error of the FBP-EKF algorithm is 0.74% and EKF is 0.77%. Compared with the literature [32], this literature uses the Ampere-hour integration method and BP neural network to estimate the SOC, but it brings the instability of the Ampere-hour integration method and too simple training data. The improved BP neural network has a maximum error of -1.72% in its literature. However, the maximum error of FBP-EKF is 2.46% smaller than the maximum error mentioned in the literature, and the average error is stable at 0.02%. So FBP-EKF combined with the BP neural network's ability to approach nonlinearity and EKF's flexibility makes the overall estimation effect better.

CONCLUSIONS
It is very important and difficult to predict the state of charge of the lithium-ion battery. In this paper, the data-driven BP neural network and the model-driven extended Kalman filtering are used to combine the improved high approximation linear ability of BP with the flexibility of EKF to form a complete feedback system. The experimental results show that the improved joint algorithm of feedback BP neural network and EKF has excellent convergence and flexibility, and its estimation error is less than 1.10%. This proves that the improved FBP-EKF has high accuracy in the estimation of the lithiumion battery.