Estimation for Battery State of Charge Based on Temperature Effect and Fractional Extended Kalman Filter

: The electric vehicle has become an important development direction of the automobile industry, and the lithium-ion power battery is the main energy source of electric vehicles. The accuracy of state of charge (SOC) estimation directly affects the performance of the vehicle. In this paper, the first order fractional equivalent circuit model of a lithium iron phosphate battery was established. Battery capacity tests with different charging and discharging rates and open circuit voltage tests were carried out under different ambient temperatures. The conversion coefficient of charging and discharging capacity and the simplified open circuit voltage model considering the hysteresis characteristics of the battery were proposed. The parameters of the first order fractional equivalent circuit model were identified by using a particle swarm optimization algorithm with dynamic inertia weight. Finally, the recursive formula of a fractional extended Kalman filter was derived, and the battery SOC was estimated under continuous Dynamic Stress Test ( DST) conditions. The results show that the estimation method has high accuracy and strong robustness.


Introduction
With the decrease in non-renewable energy and the turbulence of the global energy situation, the development of green energy has become an important theme of the global automobile industry [1,2]. In the past decade, electric vehicles have shown a rapid development trend, and ownership has increased year by year. However, electric vehicles still have shortcomings, such as short driving range and long charging time, so research on key technologies of electric vehicles is urgent. The estimation of battery state of charge (SOC) is one of the key technologies of electric vehicles [3]. The accuracy directly affects the whole vehicle energy management control system and regenerative braking control system [4], and then affects the driving range of the vehicle. At the same time, the battery SOC is also an important parameter in the battery management system, which can provide a basis for the battery management and maintenance system to prevent the battery from over charging or discharging, which will lead to the decrease in battery life and potential safety hazards. However, it is inconvenient to measure the battery SOC directly by instruments, so it can only be estimated by relevant parameters. Affected by many factors such as temperature, charging-discharging rate, noise and so on, which makes the estimation quite difficult. Therefore, research on the estimation of SOC has been carried out in the past ten years [5][6][7][8][9][10][11][12][13][14].
At present, the SOC estimation methods which are not based on the battery model are relatively simple, mainly including the ampere hour integration method, the open circuit voltage (OCV) method and the internal resistance method, but those methods generally have low accuracy, poor anti-noise ability and other shortcomings [15,16]. With the development of neural networks, fuzzy algorithms, support vector machines and other intelligent algorithms [9][10][11], SOC estimation methods based on a black-box battery model have emerged [17][18][19][20]. In reference [21], the neural network and unscented Kalman filter (UKF) were used in series to estimate SOC, and the Root Mean Square (RMS) errors of the SOC estimation were within 2.5% and maximum errors were within 3.5% for different temperatures. In reference [22], the voltage, current and temperature of the battery were fuzzed, and then the fuzzy rule base was established according to the experience, so the battery SOC was obtained by defuzzification. In reference [23], a nonlinear fuzzy support vector machine algorithm was proposed by combining a support vector machine and fuzzy algorithm, which improved the accuracy of SOC estimation. However, an SOC estimation method based on a blackbox model usually requires an off-line database, and the process of sample training has a large amount of calculations, which is prone to over fitting and falling into local optimization, so it is difficult to apply in engineering.
The idea of an SOC estimation method based on a state space model is based on the equivalent circuit model, taking the measured current and voltage as the observed input to estimate the current SOC value of the battery [15], which is a more general and in-depth SOC estimation method at present. Therefore, the design of an equivalent circuit model and observer is the key content of this method [12]. The equivalent circuit model of the battery is mainly divided into an integer order model and a fractional order model [24]. The integer order model needs a higher order to simulate the battery terminal voltage characteristics more accurately, which will greatly increase the amount of calculations, while the fractional order model can use less order to achieve higher accuracy, which has been widely investigated. In reference [25], based on the PNGV model, the fractional element was used to replace the capacitance on the main circuit and the capacitance on the (Resistor-Capacitance) RC ring, and the accuracy of the fractional order model in the low frequency region was verified. In reference [26], the equivalent circuit model of fractional order was obtained by connecting the internal resistance and fractional order elements in series, and the voltage characteristics of fractional elements under different orders were studied. In reference [27], the fractional equivalent circuit model was established by using a constant phase element (CPE) and variable order Warburg elements, and compared with the integer model in first order. In reference [28], based on the RC integral model in first order, the equivalent circuit model in fractional order was established by replacing the capacitor with a fractional capacitor element, which verified the accuracy of the model. However, most of the fractional order models usually study the parameters at a single temperature, without considering the change of the parameters of the equivalent circuit model when the ambient temperature changes, so the model usually has low practicability. Moreover, most of the literature has little research on the hysteresis characteristics of open circuit voltage in a power battery, especially the lithium iron phosphate battery. When the battery state changes frequently, if not considering the hysteresis characteristics of the open circuit voltage, the error of the model output voltage will be extended, and the accuracy of the model will decrease. The most widely used observer is the extended Kalman filter (EKF) which has nonlinear estimation ability to estimate the SOC of a battery [25], but, for integer order models, the accuracy is poor. So, an adaptive extended Kalman filter (AEKF) [29][30][31], volume Kalman filtering (CKF) [32], unscented Kalman filter (UKF) [8,33], dual EKF [34] and various improved forms based on the Kalman filter [5,35] are used to estimate SOC. For the fractional order model, using EKF and UKF can achieve ideal results because of high accuracy of terminal voltage and the memory of data.
In this paper, the influence of temperature and hysteresis characteristics of open circuit voltage on the fractional order model was considered, and the SOC estimation of a battery was studied by using the extended Kalman filter. The structure of this paper is as follows. In the second section, based on the definition of Grunwald-Letnikov (G-L) type calculus, the first order fractional equivalent circuit model was established by modifying the first order integer model. In the third section, the characteristics of battery capacity and open circuit voltage at different temperatures were studied, and a simplified open circuit voltage model considering hysteresis characteristics was established. Then, in the fourth section, the particle swarm optimization method was used to identify the parameters of a fractional equivalent circuit model at different temperatures. In the fifth section, SOC was estimated by using a fractional extended Kalman filter, and the validity and reliability of the proposed method were verified. The structure of the article is shown in Figure 1.

Fractional Order Theory
The essence of fractional order is the extension from integral order calculus to non-integral order calculus. At present, fractional order calculus is widely used in viscoelastic mechanics, soft matter mechanics and other disciplines, and it also has preliminary application in the estimation of battery SOC for new energy vehicles. The literature [36] shows the rationality of the application of fractional calculus theory used in a battery. The accuracy of the model terminal voltage can be improved by establishing the battery equivalent circuit model based on the fractional calculus theory.
At present, the definition of fractional calculus mainly includes G-L type, Riemann-Liouville (R-L) type, Caputo type and Weyl type. The equivalent circuit model of a battery based on G-L type is most widely used, which is generalized by the difference recurrence formula of an integer order derivative. When the fractional order α > 0, the definition is as follows: In the formula, a is the lower limit of the interval; t is the upper limit of the interval; h is the sampling interval and n = t/h. In the following text,

Fractional Equivalent Circuit Model
At present, the commonly used integer order equivalent circuit models are the Rint model, Thevenin model and PNGV model, while the fractional order equivalent circuit model is mostly obtained by modifying the integral order equivalent circuit model. In this paper, considering that the fractional order has data memory characteristics, resulting in larger amounts of calculations than the integer order, in order to reduce the difficulty of parameter identification, the fractional equivalent circuit model is obtained by replacing the capacitance in Thevenin model with fractional CPE, as shown in Figure 2. CPE is a constant phase component; its order varies from 0-1. It is a fractional order circuit element between resistance and ideal capacitance. When the order is 1, it is equivalent to ideal capacitance, when the order is 0, it is equivalent to ideal resistance. Its mathematical formula depends on the choice of fractional order type and, in this paper, the fractional type of CPE is the G-L type defined above and its value is obtained through a parameter identification test and parameter identification method under different conditions. Uocv is the voltage source, which can be used to simulate the open circuit voltage of the battery. It is one of the important parameters affecting the SOC estimation of the power battery, and also the non-linear part for the equivalent circuit model. It will be obtained from the data measured by the open circuit voltage test; U0 is the terminal voltage of internal resistance; U1 is the terminal voltage of the polarization ring; Ut is the battery terminal voltage, which is the output variable of the whole battery system; I is the total current, which is the input variable of the battery system, the current I is 0 when the battery is in a rest condition. In this paper, it is specified that when the battery is discharged, I is positive, and when charged, it is negative; I1 is the current on CPE; R0 is the internal resistance, which can reflect the voltage characteristics in the charging and discharging process; R1 is the polarization internal resistance; the capacitance of CPE is C1 and the order is α1. The combination of R1 and C1 can reflect the polarization characteristics of the battery during charging, discharging and static processes.
According to the fractional order theory, the current on the CPE is: The voltage on the polarization ring is: According to the Kirchhoff voltage principle, the battery terminal voltage is: The calculation formula of the battery SOC is: where SOC(0) is the initial SOC value; η is the conversion coefficient of charging and discharging capacity; QN is the rated capacity of battery.
When h is a small positive number, Equation (1) can be approximately as follows: , Equation (7) can be rewritten as: By discretizing Equation (4): In combination with the approximate fractional order calculation Equation (8), Equation (9) can further deduce: In summary, we can get: If considering Gaussian white noise, the fractional discrete space state expression of the battery is as follows: is measurement noise, the variance of system noise is Q and the variance of measurement noise is R. M is the historical state including the polarization voltage up to the previous moment. The polarization voltage of the equivalent circuit model of the battery at the current moment is calculated by iteration, and then the battery terminal voltage is calculated by the observation equation.

Battery Characteristics under Different Influential Factors
In this paper, an A123 lithium iron phosphate battery was selected as the research object, and the battery capacity characteristics and open circuit voltage characteristics under the influence of different factors were studied. The rated capacity of the battery is 20 Ah, the rated voltage is 3.2 V, the charging cut-off voltage is 3.65 V and the discharging cut-off current is 0.5 A. In order to ensure the battery life, the discharging cut-off voltage is set to 2.5 V. The charging-discharging test bench was composed of a discharging-charging battery tester BT2016, upper computer, environmental chamber and multimeter HP34401A.

Characteristics of Battery Capacity
Battery capacity is the key factor affecting the accuracy of SOC estimation, but it is greatly affected by battery temperature and charging-discharging rate in actual use. Therefore, in order to improve the accuracy of SOC estimation, it is necessary to test the battery charging and discharging capacity under different temperatures and rates to obtain the conversion coefficient of chargingdischarge capacity η and correct the battery SOC. In this paper, based on the Battery Test Manual for Electric Vehicles, η was calculated on the basis of capacity at 30 °C and a 3/C rate, as shown in Equation (13). The test scheme is shown in Figure 3. As an additional explanation, the capacity of the battery will decrease with an increase in the number of cycles. However, because the cycle life of the battery selected in this paper is more than 2000 times, the number of cycles consumed in the experiments of this paper is less than 150. The influence is small, so here is only a brief description, without considering the influence of cycle times on battery performance.
The curves of battery charging and discharging capacity at different temperatures and rates is shown are Figures 4 and 5. The overall trend of charging and discharging capacity is the same. The capacity increases with an increase in the ambient temperature, and decreases with an increase in the current rate. The battery capacity in the cool environment is more sensitive to the ambient temperature and the change of capacity in the same temperature difference is greater than that in the high-temperature environment. The curve of battery discharging capacity tends to be flat or even slightly increased with an increase in the discharging rate, because the test object is a single battery without cooling equipment, which is in the state of natural convection in the environmental chamber, and the heat transfer coefficient is small. When the discharging rate is small, the temperature rise of the battery is small, and its own temperature is slightly higher than the ambient temperature, but with an increase in discharging rate, the temperature of the battery increases gradually. So, the difference of discharging capacity will decrease gradually, or the electric quantity will even rise. However, in the charging test, the maximum charging current is only C, and the temperature rise of the battery is not obvious at all ambient temperatures, so there is no such phenomenon. In the process of using the conversion coefficient of capacity in the later simulation calculation, because there are two independent variables of ambient temperature and rate, the conversion coefficient out of the test condition is obtained by a two-dimensional quadratic spline interpolation method which uses the capacity from the capacity tests as the key point.

Characteristics of Open Circuit Voltage
The open circuit voltage has a great influence on the output voltage of the battery model, and for the lithium iron phosphate battery, the change of the open circuit voltage with SOC has strong nonlinear and hysteresis characteristics. The open circuit voltage test scheme, considering the influence of different temperatures and charging-discharging state of the battery, is shown in Figure 6, and the test results are shown in Figure 7. The open circuit voltage in the charging and discharging states are almost the same at different temperatures, except there is a large difference between an SOC of less than 0.1 and an SOC greater than 0.95. When SOC = 1, the open circuit voltage increases with the ambient temperature, while, when SOC = 0, the open circuit voltage increases with a decrease in the ambient temperature. However, in order to ensure the safety and cycle life of the battery in the actual use process, the battery may not be fully charged and discharged. Most of the time, the battery works in the state of 0.1 < SOC < 0.9, so the open circuit voltage of the battery could not consider the influence of temperature. However, the open circuit voltage also has a strong hysteresis characteristic, which shows that the SOC-OCV relationship curve in the charging state does not coincide with that in the discharging state, and when the battery is changing state frequently, the OCV needs SOC increases or decreases by a value (which is about 0.1) to change to the corresponding state [37]. Therefore, in the process of open circuit voltage fitting, we need to consider the influence of battery hysteresis on the equivalent circuit terminal voltage. When a battery works in a purely electric vehicle, it is in the discharging state most of the time. Therefore, in order to simplify the algorithm and consider the open circuit voltage hysteresis characteristic, the open circuit voltage test data were processed as follows: *  In this paper, a polynomial was used to fit the open circuit voltage, and when using sixth order polynomials, the root mean squared error (RMSE) was 0.0093. The RMSE was 0.0054 when using the seventh order polynomial, and the RMSE was 0.0049 when using the eighth order polynomials. It can be seen that the fitting error decreases with an increase in the polynomial order. However, if the polynomial order is too high, the nonlinearity will increase and the calculation is complex. Therefore, this paper uses the eighth order polynomial to fit the battery open circuit voltage. The fitting results are shown in Table  1

Identification with PSO Algorithm
Compared with the integral model, the fractional model is related to the historical state. The data has a memory effect, which leads to the slow calculation process. As an evolutionary algorithm, particle swarm optimization (PSO) has been widely investigated and applied in recent years due to its advantages of high calculation speed, fewer call parameters and simple programming. In order to further improve the searching ability and convergence speed of the particle swarm optimization algorithm, and to improve its weakness of easily falling into local optimum, the particle swarm optimization algorithm with dynamic inertia weight was used to identify a fractional equivalent circuit model, which can have more weight in the early stage of calculation to expand the searching range and improve the global searching ability and have less weight in the later stage of calculation to carry out local accurate calculation and improve the convergence speed and accuracy of the results. The specific methods are as follows: 1. Initialization The particle velocity vmax、vmin and the position limit θmax、θmin were defined to avoid ignoring the optimal value and result overflow. The velocity vl,j and the position θl,j of random particles were defined, l is the sequence of particles, where l = 1.2.3…N1, N1 is the number of particles. In this paper, N1 = 200. j is the number of iterations. At the beginning, j = 0, the particle position θl,j represents the identification parameter set [R0, R1, C1, α1].

Calculation of fitness function
The fitness function is the most important part of the particle swarm optimization algorithm. The fitness function of each particle under the current iteration is is the terminal voltage of the fractional order model at particle position of θl,j and its calculation method is as follows: The transfer function of the differential equation of the fractional capacitor is as follows: (17) Then the terminal voltage at the polarizing ring is:

U s I s C s
If the voltage at both ends of the polarizing ring and internal resistance is U, then Formula (20) is transformed into a fractional order differential equation and combined with the definition of the G-L type, so we can get: (22) where h is the sampling interval, which is 0.2 s in this paper; Nc is the quantity of historical data participating in the calculation, which should be the number of all data points before k time in theory, but the quantity of calculations will increase sharply with the iteration time [30]. Therefore, this paper comprehensively considered the calculation quantity of particle swarm optimization and the precision of output voltage of the fractional order model, and set the calculation truncation quantity Ne = 800, when k > Ne, Nc = Ne, k ≤ Ne, Nc = k.

Update of individual optimal fitness
The fitness value Fit(l,j) corresponding to the position θl,j under the current iteration time of each particle is compared with the fitness value Fbest(l) corresponding to the historical best position of the particle θ best l . If Fit(l,j) < Fbest(l), the historical best position of the particle is updated with the current particle position θ b e s t l .

Update of the best group fitness
The fitness value Fit(l,j) corresponding to the position θl,j under the current iteration time of each particle is compared with the fitness value Fbest corresponding to the global optimal position θ best . If Fit(l,j) < Fbest, the global optimal position is updated with the current particle position θ best . 5. Update particle position and speed Update the speed of each particle: Where ω1, ω2 are weights to adjust the search range. In this paper, ω1 = 0.4，ω2 = 0.9; M is the maximum number of iterations, M = 200; c1, c2 are acceleration constants, c1 = c2 = 2; r1, r2 are random parameters, taking the range [0,1] to increase the randomness of the particle.
Update particle position: 6. Judge whether the program is over If the number of large iterations or the fitness value is less than the default value, then the algorithm ends, and the global optimal position θ best is the optimal solution, otherwise, to the number of iterations add 1 and return to step 2.

Identification Test and Results
The change of battery state is complex when the battery is in the working process, and its equivalent circuit model parameters will change with its own factors and external state. In order to obtain accurate parameters of the fractional equivalent circuit model, a double pulse test was carried out under different charging and discharging states, SOC and ambient temperatures to excite the battery characteristics. The pulse current is ±20 A, the duration is 10 s and the rest time is 40 s. The test scheme is shown in Figure 8.   As can be seen from the figure above, the terminal voltage of the fractional model is in good agreement with the measured voltage when current is loading or unloading, and it can better fit the resistance and capacitance characteristics of the battery at the charging-discharging state and static state. Although the integer model can roughly fit the measured voltage, it has a big error with the measured voltage at the moment of current loading and unloading due to the model order and characteristics of the integer model. The fitting error of the fractional order model is smaller than that of the integral order model in the same model order, and it can better simulate the battery characteristics of resistance and capacitance.
The identification results of fractional equivalent circuit model parameters in chargingdischarging states, different ambient temperatures and SOC are shown in Figures 11-14.    The internal resistance R0 at different ambient temperatures fluctuates in a certain range, but the change of SOC in a low-temperature environment is more drastic than that in a high-temperature environment. The difference of internal resistance in charging and discharging states is small, and the resistance value increases with a decrease in temperature in most cases. The polarization internal resistance R1 fluctuates more drastically at low temperatures than R0, but it has less impact at high temperatures in most cases. The value of R1 decreases with an increase in the ambient temperature. The fluctuation degree of the polarization capacitance C1 in the fractional model has little correlation with the ambient temperature, and its value increases with the ambient temperature in charging and discharging states, and the capacitance value varies greatly in different ambient temperatures; the trend of the fractional order α1 is consistent with polarization capacitance C1, and increases with the temperature in most cases. According to the four parameter identification results, the internal resistance, polarization resistance, capacitance and order of CPE elements in the first order fractional equivalent circuit model are the temperature-sensitive elements, as they all change with the ambient temperature, but the sensitivity is different.
In the following calculation process, the parameters identified in this paper were used as key points to fit the parameters under other conditions using the two-dimensional quadratic spline interpolation method, so as to meet all environmental temperatures and SOC conditions.

Verification of Identification Results
The dynamic stress test (DST) is simplified from the Federal Urban Driving Schedule (FUDS), which consists of 10 discharging stages, five charging stages and five static stages. The duration of each cycle is 360 s. The DST can simulate the actual operation condition of the battery well, so it is a common simulated condition to verify the accuracy of battery equivalent circuit models and the validity of SOC estimation methods. In this paper, 26 continuous DST cycles were used to test the battery. The ambient temperature is 28 °C. The conditions of one DST are shown in Table 2. The comparisons of terminal voltage with the fractional order model, terminal voltage with the integer order model and measured voltage are shown in Figure 15. The error between measured voltage and model terminal voltage is shown in Figure 16.

Estimation for SOC Based on Fractional Extended Kalman Filter (FEKF)
A Kalman filter is an optimal estimation method based on minimum variance estimation [38], but it is only applicable to linear systems. However, the vehicle power battery has strong nonlinear characteristics in the actual operation process. As an improved form of the Kalman filter, the extended Kalman filter can solve this problem well, and has a wide application in SOC estimation.

Iterative Formula of FEKF
The linearization method of the extended Kalman filterbased on the fractional order model is the same as the integer order extended Kalman filter, and the nonlinear part is replaced by a Jacobian matrix: Combined with Formulas (11) and (12), the one-step prediction of state is: The one-step prediction of covariance is: The gain matrix of the Kalman filter is: H is a Jacobian matrix to replace the nonlinear function h in Equation (12): The error of observation is: U SOC k k U k k R I k y (32) Y(k + 1) is the measured voltage at k + 1.

Verification of Estimation Results
The environmental temperature is set at 28 °C and the working condition is 26 continuous DST conditions. The FEKF was verified and compared with the integer order EKF. The initial SOC of the FEKF and EKF was the same as the initial value of the operating condition. The comparison results of SOC estimation in two filters are shown in Figure 17, and the errors between test value and SOC estimation are shown in Figure 18. The comparison between the measured voltage and the output voltage of the two filters is shown in Figure 19, and the error of terminal voltage is shown in Figure  20.    The error of the FEKF and EKF is relatively large in the early stage of estimation, but after a period of time, the FEKF can quickly keep up with the true SOC value and make the error fluctuate around 0. The average error and relative error of SOC estimated by the FEKF and EKF is shown in Table 3. Because the accuracy of the fractional order model is higher than that of the integer order model, the output voltage of the FEKF can follow the measured voltage better than the EKF. Moreover, due to the effect of covariance, compared with the output voltage error of the equivalent circuit model without a filter effect in Section 4.3, the terminal voltage error can fluctuate around 0, thus achieving a good balance between model reliability and measurement reliability. In this paper, when the noise covariance and initial covariance are the same as above, the initial SOC is set as 0.85, 0.8, 0.7 and 0.6 to verify the robustness of the FEKF. The estimation results and errors of SOC are shown in Figures 21 and 22, and the output voltage and error are shown in Figures  23 and 24.    In the case of different initial errors, the SOC and the output voltage estimated by the FEKF can achieve a good convergence effect after a period of time. When the initial error is large, the FEKF can make the error decrease rapidly in the early stage and ensure a good convergence speed. At the beginning of the simulation, the error of output voltage increases with the initial SOC error, and this is due to the existence of an initial SOC error, which leads to a decrease in model open circuit voltage and terminal voltage. However, with the feedback of the measured voltage, the estimated state will gradually converge to the test value.
In conclusion, the proposed FEKF can estimate the battery SOC more accurately than the EKF and has strong robustness.

Conclusions
In this paper, the equivalent circuit model based on fractional order theory was established. The characteristics of battery capacity and open circuit voltage at different temperatures were studied. A simplified modeling method considering hysteresis characteristics of open circuit voltage was proposed. Based on the PSO method, the parameters of the fractional order model were identified at different temperatures. Finally, the fractional extended Kalman filter was established. The advantages of the proposed estimation method are as follows: 1. In the same order, compared with the integer order equivalent circuit model, the fractional order model can accurately simulate the characteristics of resistance and capacitance when the battery is charging, discharging or static; 2. It can ensure the accuracy of the output voltage of the fractional order model when the battery is in a wide range of temperatures and the battery state changes frequently. Compared with measured voltage in continuous DST conditions, the average error of voltage in the integral order model is 0.0086 V, and the relative error is 0.269%, but the average error of voltage in the fractional order model is 0.0034 V and the relative error is 0.107%, which can provide a more accurate model of output voltage for fractional estimators; 3. In the same conditions of initial SOC and temperature, compared with the integer extended Kalman filter, the fractional extended Kalman filter can estimate battery SOC more accurately in continuous DSTs, and the average error of SOC estimated by the FEKF is 0.0036 and the relative error is 0.52% when average error and relative error by the EKF are 0.0224 and 3.2%. The FEKF also has strong robustness when the initial error is large, and it can make the error of SOC decrease rapidly in the early stage and ensure a good convergence speed.
Author Contributions: C.C. operated the battery test and wrote this paper. Y.Z. revised the paper and made some suggestions. Y.Y. gave assistance with experiments. All authors have read and agreed to the published version of the manuscript.

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