A State of Charge Estimation Method Based on Adaptive Extended Kalman-Particle Filtering for Lithium-ion Batteries

A state of charge (SOC) estimation method is proposed. An Adaptive Extended Kalman Particle filter (AEKPF) based on Particle Filter (PF) and Adaptive Kalman Filter (AKF) is used in order to decrease the error and reduce calculations. The second-order resistor-capacitor (RC) Equivalent Circuit Model (ECM) is used to identify dynamic parameters of the battery. After testing (include Dynamic Stress test (DST), New European Driving Cycle (NEDC), Federal Urban Dynamic Schedule (FUDS), Urban Dynamometer Driving Schedules (UDDS), etc.) at different temperatures and times, it was found that the AEKPF exhibits greater tolerance for high system noise (10% or higher) and provides more accurate estimations under common operating conditions.


Introduction
Lithium-ion batteries have a greater energy density, lower costs, self-discharge rates, and longer life cycles, and the majority of recent studies of BMS (Battery Management System) have focused on this type of battery [1][2][3][4][5][6][7][8].Estimating state of charge (SOC) is important in BMS-related studies and provides information related to the remaining capacity of a battery.Accurate SOC estimation can prevent overcharging/discharging and provide higher deviation tolerance for further control, such as charge/discharge current control.
System noise is unpredictable and therefore SOC estimation is highly complex [9][10][11].Each measured variable associated with SOC estimation has an associated deviation from its true value and the separation of noise or calculation of noise has been the focus of many investigations.A variety of methods have been proposed for SOC estimation and can be divided into different types.The first category includes the Ampere-hour method (known as Coulomb counting method) [12] and open-circuit voltage (OCV) method [13].These methods are considered open-loop, and cannot be self-corrected as error becomes larger.The second category includes Kalman filtering [4,[14][15][16][17], particle filtering [18][19][20][21], sliding mode observer [22,23], non-linear observer [24], and multivariate adaptive regression splines [25].These methods are considered closed-loop methods and are based on specific battery models, including fixed battery models and adaptive battery models.Although fixed models are more regularly used, adaptive models can track changes in the state of batteries [26,27].Adaptive models are becoming mainstream and associated SOC estimation methods are becoming simpler.The third type includes artificial neural networks [28][29][30], support vector machine [31], and radical basis function neural networks.This type of system has self-learning capabilities and does not need to be based on a model, simply requiring a data set of the battery schedule to train.This type requires large amounts of data to support accuracy and robustness estimation.However, if sufficient data is available, this type of approach has a better performance compared to the two previous approaches.The majority of algorithms are now used primarily for theoretical research.This paper proposes a new SOC estimation method based on adaptive extended Kalman particle filter (AEKPF).Considering the Adaptive Kalman Filter (AKF) and Particle Filter (PF), these two filters can compensate for some of each other's shortcomings, and the proposed method might solve issues related to PF accuracy and its dependence on the amount of calculations, as well as the dependence of the AKF on the initial and input values.Besides, this method is a classic closed-loop control method, which means it could be improved with other closed-loop methods in later research.It could also be used in actual BMS (not only theoretical analysis) for the process is simple, not like some self-learning methods (the third type mentioned earlier).In addition, the AEKPF method might handle high noise, flexible noise situations, or synthetic noise.Typical driving cycles, such as the New European Driving Cycle (NEDC), Urban Dynamometer Driving Schedules (UDDS), Dynamic Stress test (DST), New York bus current (NYBC), and Federal Urban Dynamic Schedule (FUDS), were used to assess the performance of the AEKPF method.The results demonstrate that the AEKPF method performs well in terms of accuracy and robustness when compared to previous approaches in a similar environment as in this paper.

Battery Model
The equivalent circuit model (ECM) is used to simulate the voltage and current behavior of a battery and consists of resistors, capacitors, inductors, and voltage/current sources (sometimes) [2,32,33].Unlike electrochemical models, which investigate the inner reaction mechanism of the battery, ECMs are used to investigate electrical behavior and properties during operation.The complexity of the model is combined with its accuracy, so an ECM with a higher accuracy must have a higher complexity.There are a number of popular ECMs which are commonly used, such as the Combined model, resistor-capacitor (RC) model, and Thevenin model.The SOC estimation research is often based on the RC model or Thevenin model [34][35][36].
In this work, the second-order RC equivalent circuit model for the simulation of battery dynamic characteristics was selected.The RC circuit model was used because the Rint model cannot simulate processes with variable charge/discharge [37], and the Thevenin model can have up to a 5% error when simulating voltage according to a schedule.For example, the DST test uses the Thevenin model and can result in a maximum error of 5.8% in voltage.In addition, the second-order RC model has a relatively high accuracy and is not very overly complicated.As presented in Figure 1, the second-order RC ECM consists of an open-circuit with a voltage source (U 0 ) which has a certain relationship with the temperature and SOC, a resistor which represents the inner resistance of the battery (R 0 ), and two parallel RC networks (R 1 C 1 , R 2 C 2 ).Additionally, the resistors and the capacitances depend on the SOC and temperature in general.
The SOC is defined as: Or: where i represents the battery current (similar to I 1 in Figure 1, i is a positive number in the discharging process and a negative number in the charging process), t represents the operation time, and Q 0 is the nominal capacity of the battery.
and can result in a maximum error of 5.8% in voltage.In addition, the second-order RC model has a relatively high accuracy and is not very overly complicated.As presented in Figure 1, the secondorder RC ECM consists of an open-circuit with a voltage source (U0) which has a certain relationship with the temperature and SOC, a resistor which represents the inner resistance of the battery (R0), and two parallel RC networks (R1C1, R2C2).Additionally, the resistors and the capacitances depend on the SOC and temperature in general.Generally, SOC represents the "nominal capacity", whereas the true capacity depends on the state of health (SOH) of the battery and SOC generally becomes less than the true capacity as a battery ages.Therefore, SOC does not represent the true capacity of a battery.To be specific, the SOC in this paper does not consider the aging effect.
According to basic circuit principles, the behavior of a second-order RC ECM (as presented in Figure 1) can be calculated as: . .
where U 1 and U 2 represent the terminal voltage of capacitances C 1 and C 2 , respectively; U t is the terminal voltage of the battery; I t is the current of the battery; and U 0 is the open-circuit voltage (OCV), which has a non-linear function relationship with SOC at a particular temperature.

Parameters Identification
Because all parameters change with temperature, it is necessary to measure or calculate the values of parameters in Figure 1.In addition, calculated U 0 is used to calculate SOC and Q 0 is a constant and provided by the manufacturer.
The SOC-OCV test is used to determine the relationship between OCV and SOC.In this test, an ICR18650-22P Lithium-ion battery which has a nominal voltage of 3.6 V and a nominal capacity of 2.15 Ah was used.First, the battery is discharged to 0% and fully charged after two hours' rest.Next, discharge is started at a constant current of 0.5 C until SOC reaches a desired value (Figure 2, x = 95% 90% 80% 70% 60% 50% 40% 30% 20% 10% 8% 5% 3% 1% 0%).Data is collected each second during the discharging process and the rest of the process is split into three parts: 0 s to 5 s, collect data every 50 ms; 6 s to 10 min, collect data every 1s; 11 min to 2 h, collect data every 1 min.
Following the SOC-OCV test, a capacity test is performed to determine the nominal capacity.For the ICR18650-22P, the test result is 2.15 Ah.
By using the two tests above, the fitted formula and curve are calculated as shown in Figure 3 (T = 25 • C).The maximum absolute error of the fitted curve was 2.4% and average absolute error was 1.1%.Following these tests, a function fitting method was used to identify parameters by using data from the discharge process of the SOC-OCV test Following the SOC-OCV test, a capacity test is performed to determine the nominal capacity.For the ICR18650-22P, the test result is 2.15 Ah.
By using the two tests above, the fitted formula and curve are calculated as shown in Figure 3 (T = 25 °C).The maximum absolute error of the fitted curve was 2.4% and average absolute error was 1.1%.Following these tests, a function fitting method was used to identify parameters by using data from the discharge process of the SOC-OCV test (R0, R1, R2, C1, C2).By use of Equations ( 2)-( 5), the relationship among parameters can be calculated as: And Equation ( 6) can be rewritten as Equation ( 7):  Following the SOC-OCV test, a capacity test is performed to determine the nominal capacity.For the ICR18650-22P, the test result is 2.15 Ah.
By using the two tests above, the fitted formula and curve are calculated as shown in Figure 3 (T = 25 °C).The maximum absolute error of the fitted curve was 2.4% and average absolute error was 1.1%.Following these tests, a function fitting method was used to identify parameters by using data from the discharge process of the SOC-OCV test (R0, R1, R2, C1, C2).By use of Equations ( 2)-( 5), the relationship among parameters can be calculated as: And Equation ( 6) can be rewritten as Equation ( 7):  By use of Equations ( 2)-( 5), the relationship among parameters can be calculated as: And Equation ( 6) can be rewritten as Equation ( 7): Energies 2018, 11, 2755 As defined in Equation ( 7), U t and t are described by data from the SOC-OCV test, and the variables B 1 -B 5 are given by the result of the function fitting tools ("inline" and "nlinfit") in MATLAB.Variables and parameters are related by the following equations: where ∆U represents voltage drop at the end of the discharge process, which is caused by the ohm resistance (R 0 ).Parameter identification was performed by use of the SOC pulse-discharge process (SOC= 95% for 25 • C and 20% for 20 • C and 0 • C, Table 1).
Table 1.Results of parameters identification.

ECM Description
Generally, a normal discrete control system can be modeled as: where x represents the state vector at time i, y represents the measurement vector at time i (U t ), u represents the input vector at time i(I t ), γ i and η i are noise vectors of x and y, and A,B,C,D represents coefficient matrixes at time i (sometimes will be constant matrixes).
The time discrete equation of the ECM can be rewritten in the form of ( 9) and ( 10): Equations ( 11) and (12) show that the ECM has a form of discrete control system, which means measures used for that system can be used to estimate SOC.

Adaptive Extended Kalman-Particle Filtering
The calculation of basic particle filtering is often more extensive than some methods, causing the time cost to be larger, for example, with the limit of 0.1 accuracy, PF causes 5-10 times the time of KF (Kalman filtering).However, it also has the advantage that the whole process has a weaker dependence on the noise distribution, which is a weak point of KF.KF has a relatively simplified process, but cannot easily deal with complex noise.Here, an AEKPF method which absorbs the main advantages of PF and KF is proposed.
AEKPF consists of a total of 11 steps: 1. Particles initialization Suppose the initial value of the x series is x 0 .The particle sequence can be described as • • • , N based on the priori probability of x 0 (this algorithm uses a Gaussian distribution) and particles have the weight 1  N .

Status variables estimation
x i|i+1 where G represents the noise matrix, which is a constant matrix assigned according to the approximate amplitude and frequency of the noise sequence.The subscript i|i + 1 means that it is a process variable between time i and time i + 1.

Covariance estimation
where Q represents variance of the noise sequence {γ} and P i represents the covariance matrix of the sequence {x} (the initial value of it is the variance of {x}).

Kalman gain calculation
The matrix G k in ( 17) is termed the Kalman gain matrix, where R represents variance of the noise sequence {η}.

Covariance update
6. Status variable update Process b-f will affect every particle.

Particle weights update
At time i, the particle sequence is updated according to Equation (17), and the weight of every particle is calculated according to Equation (19): In Equation (19), ∆y k = y 0 i+1 − y k i+1 represents deviations of y in Equation (10) and is calculated at x = x 0 i+1 and x = x k i+1 .Next, the weight of particles is normalized by the use of Equation ( 20):

Effective sampling size calculation
Effective sampling size N eff is defined as: Energies 2018, 11, 2755 where q(i) is the weights of particles (after normalization).If N eff is less than the standard N th , then the importance resampling process is started; otherwise skip and straight output the variables.N th is assigned by the parameters of the environment and initialization of particles.

Importance resampling
First, separate (0, 1] into n intervals with the same length, generate a random value u in (0, 1], and then generate a series: Sequence the weights of N particles and then sequence to N intervals: Copy the particle x k i for n k times, where n k is the number of elements of the series U k which are in the intervals (ω k−1 , ω k ].

Variables output
11. Noise update where G m is given by Equation ( 27): The sequence {d} is given by

Results and Analysis
The results of the AEKPF method are presented below and a typical work bench flow is presented in Figure 5:

Results and Analysis
The results of the AEKPF method are presented below and a typical work bench flow is presented in Figure 5:

Results and Analysis
The results of the AEKPF method are presented below and a typical work bench flow is presented in Figure 5: For the AEKPF method, the forgetting factor b was set as 0.98, the initial value of the matrix Ga was diag [0.001,0.001,0.001],and the parameters of the ECM are presented in Section 2.2.The number of particles in the initialization process was 30 and the variance was 0.1 in SOC and 0.01 in voltage.
To be general, all presented results of this section were averaged from five of the same experiments.For the AEKPF method, the forgetting factor b was set as 0.98, the initial value of the matrix Ga was diag [0.001,0.001,0.001],and the parameters of the ECM are presented in Section 2.2.The number of particles in the initialization process was 30 and the variance was 0.1 in SOC and 0.01 in voltage.

Estimation Results Under NEDC
To be general, all presented results of this section were averaged from five of the same experiments.

Estimation Results Under NEDC
The NEDC test is performed to simulate batteries' status change.NEDC is one of the most widely used tests in battery charging/discharging simulations.The current profile for NEDC is shown in Figure 6 and the data were collected once per second.The noise of this part was 0.0001 in current and voltage and 0.00001 in covariance (Q, R).The initial value of covariance P is [1,1,1].The NEDC test is performed to simulate batteries' status change.NEDC is one of the most widely used tests in battery charging/discharging simulations.The current profile for NEDC is shown in Figure 6 and the data were collected once per second.The noise of this part was 0.0001 in current and voltage and 0.00001 in covariance (Q, R).The initial value of covariance P is [1,1,1].The results are presented in Figures 7 and 8, including the AEKPF, AEKF, and PF methods.The results are presented in Figures 7 and 8, including the AEKPF, AEKF, and PF methods.The results are presented in Figures 7 and 8, including the AEKPF, AEKF, and PF methods.This NEDC test is a basic test, the initial SOC value was 100%, and the noise sequence is only in the algorithm (suppose the measurement is absolutely accurate).The blue line represents the results  The results are presented in Figures 7 and 8, including the AEKPF, AEKF, and PF methods.This NEDC test is a basic test, the initial SOC value was 100%, and the noise sequence is only in the algorithm (suppose the measurement is absolutely accurate).The blue line represents the results This NEDC test is a basic test, the initial SOC value was 100%, and the noise sequence is only in the algorithm (suppose the measurement is absolutely accurate).The blue line represents the results of PF, the pink line represents the results of AEKF, and the red line represents the results of AEKPF.This test uses AEKF as one of the contrasts instead of EKF (extended Kalman filter), because AEKF has been demonstrated to perform better in theoretical research and it is one of the origins of AEKPF; thus, the results are more persuasive.Figures 7 and 8 presented origin data and the error, and the maximum error and average error are presented in Table 2.By the use of data in Table 2 and Figures 7 and 8, it is demonstrated that the AEKPF method has a better accuracy when compared to AEKF and PF.This part of the experiment shows that the AEKPF method performs well with an accurate measurement, and the time cost is acceptable (0.39 ms per 1 output).The AEKPF costs 0.38 ms per 1 output and PF costs 0.62 ms per 1 output.

Estimation Results Under UDDS with Noise
When the robustness of the AEKPF method against noise of variables was assessed, noise was added to the measured currents, and slowly increased.This test used the urban dynamometer driving schedules (UDDS) as the current simulation schedule.To be more specific, this test used AEKPF and AEKF for comparison because the PF method has a large error (10 times that of AEKF or greater).The initial variance of the noise was at a level of 0.1 (noise covariance Q, R and amplitude of the noise of voltage), the amplitude of noise was 1A, an offset of the current of +0.1 A was used, and the initial value of covariance P was [1,1,1].The noisy current is presented Figure 9 and the noisy voltage is displayed in Figure 10.The results are presented in Figure 11, Figure 12, and Table 3.Here, 25 • C is used as the room temperature under laboratory conditions.
As demonstrated above, it is obvious that the AEKPF method performs better when compared to the AEKF method.Furthermore, the AEKPF method costs 3 s for 9000 data (0.33 ms per 1 output), whereas the AEKF method costs 2.6 s for 9000 data.Therefore, the AEKPF method requires 8% more time, but increases the accuracy by more than 50%.As demonstrated in Figure 12, both AEKPF and AEKF maximum errors occurred at the beginning of the algorithm.Furthermore, when count time is adjusted from the beginning to the first 3% error point, this results in a cost of 15 s.Considering that the number of particles in the initialization sequence is 30 and the noise has the same magnitude as the variables, this time costs is acceptable.
has been demonstrated to perform better in theoretical research and it is one of the origins of AEKPF; thus, the results are more persuasive.Figures 7 and 8 presented origin data and the error, and the maximum error and average error are presented in Table 2.  7 and 8, it is demonstrated that the AEKPF method has a better accuracy when compared to AEKF and PF.This part of the experiment shows that the AEKPF method performs well with an accurate measurement, and the time cost is acceptable (0.39 ms per 1 output).The AEKPF costs 0.38 ms per 1 output and PF costs 0.62 ms per 1 output.

Estimation Results Under UDDS with Noise
When the robustness of the AEKPF method against noise of variables was assessed, noise was added to the measured currents, and slowly increased.This test used the urban dynamometer driving schedules (UDDS) as the current simulation schedule.To be more specific, this test used AEKPF and AEKF for comparison because the PF method has a large error (10 times that of AEKF or greater).The initial variance of the noise was at a level of 0.1 (noise covariance Q, R and amplitude of the noise of voltage), the amplitude of noise was 1A, an offset of the current of +0.1 A was used, and the initial value of covariance P was [1,1,1].The noisy current is presented Figure 9 and the noisy voltage is displayed in Figure 10.The results are presented in Figure 11, Figure 12, and Table 3.Here, 25 °C is used as the room temperature under laboratory conditions.As demonstrated above, the AEKPF method performs well.Therefore, it was further assessed by use of the dynamic stress test (DST), New York bus current (NYBC), and federal urban dynamic schedule (FUDS) at 20 • C and 0 • C tested at high noise (the same as test 4.2), as presented in Figure 13.Here, 0, 20 and 25 • C are used as experimental conditions; 20 • C can be used as a low temperature difference control group of 25 • C, and 0 • C can be used as a control group with a higher temperature difference.The operating temperature of most batteries is above 0 • C, so this part will show that this method could work well in regular temperature zones.by use of the dynamic stress test (DST), New York bus current (NYBC), and federal urban dynamic schedule (FUDS) at 20 °C and 0 °C tested at high noise (the same as test 4.2), as presented in Figure 13.Here, 0, 20 and 25 °C are used as experimental conditions; 20 °C can be used as a low temperature difference control group of 25 °C, and 0 °C can be used as a control group with a higher temperature difference.The operating temperature of most batteries is above 0 °C, so this part will show that this method could work well in regular temperature zones.As demonstrated in Figure 13, AEKPF performs under different temperatures.As a matter of fact, the AEKPF performance was largely unaffected by temperature.However, at the beginning of the test, the error was relatively large and is likely caused by the particles initialization process.For a more accurate result, a width large enough to prevent particles from duplicating should be used.

Results of Aged Batteries
Here, aged batteries were used to perform experiments, in order to show that AEKPF allows a certain degree of initial value error.As the battery ages, the parameters (shown in Section 2) will change, and this part uses parameters of SOH = 100% (shown in Table 1) and the experiment is the NEDC test at SOH = 90% (still with noise variance of 0.1).The result is shown in Figure 14.As demonstrated in Figure 13, AEKPF performs under different temperatures.As a matter of fact, the AEKPF performance was largely unaffected by temperature.However, at the beginning of the test, the error was relatively large and is likely caused by the particles initialization process.For a more accurate result, a width large enough to prevent particles from duplicating should be used.

Results of Aged Batteries
Here, aged batteries were used to perform experiments, in order to show that AEKPF allows a certain degree of initial value error.As the battery ages, the parameters (shown in Section 2) will change, and this part uses parameters of SOH = 100% (shown in Table 1) and the experiment is the NEDC test at SOH = 90% (still with noise variance of 0.1).The result is shown in Figure 14.The maximum error is 6.7% in the first 10s and the average error is 1.7%.
The result shows that although the parameters of the ECM will change, the estimate accuracy can still be guaranteed in a relatively acceptable range, which also shows that this method is wildly applicable.

Conclusions
In order to estimate the SOC of a lithium-ion battery, a second-order resistance capacitor model was used.Parameter identification was based on a least-squares method and a sixth-order The maximum error is 6.7% in the first 10s and the average error is 1.7%.The result shows that although the parameters of the ECM will change, the estimate accuracy can still be guaranteed in a relatively acceptable range, which also shows that this method is wildly applicable.

Conclusions
In order to estimate the SOC of a lithium-ion battery, a second-order resistance capacitor model was used.Parameter identification was based on a least-squares method and a sixth-order polynomial was used to describe the relationship between the simulated SOC and OCV.
Based on the second-order RC model, an SOC estimation method using the AEKPF algorithm was proposed.With noise as high as 10%, the results demonstrate that the average absolute error of AEKPF is less than 1% under conditions used in this study and standard deviation was equal to 0.005.The AEKPF method has a better accuracy and robustness when compared to the AEKF and PF methods when tested under similar working conditions.This method could be used on a more complex schedule, for it can deal with large noise and offset; besides, if the error of the first 10-20 s can be solved, this method will surely be a totally improved method compared to KF and PF in terms of accuracy, time cost, and robustness.

Figure 4 .
Figure 4. Estimation process of the Adaptive Extended Kalman Particle filter (AEKPF) method.

Figure 4 .
Figure 4. Estimation process of the Adaptive Extended Kalman Particle filter (AEKPF) method.

Figure 6 .
Figure 6.The current schedule of New European Driving Cycle (NEDC).

Figure 6 .
Figure 6.The current schedule of New European Driving Cycle (NEDC).

Figure 6 .
Figure 6.The current schedule of New European Driving Cycle (NEDC).

Figure 6 .
Figure 6.The current schedule of New European Driving Cycle (NEDC).

Figure 13 .
Figure 13.Results of varying temperature and schedules regimes.

Figure 13 .
Figure 13.Results of varying temperature and schedules regimes.

Figure 14 .
Figure 14.SOC error of the aged NEDC test.

Table 2 .
Maximum error and average error of three tests (T = 25 • C).

Table 2 .
Maximum error and average error of three tests (T = 25 °C).