State of Charge Estimation of Lithium-Ion Batteries Based on an Adaptive Iterative Extended Kalman Filter for AUVs

As a power source for autonomous underwater vehicles (AUVs), lithium-ion batteries play an important role in ensuring AUVs’ electric power propulsion performance. An accurate state of charge (SOC) estimation method is the key to achieving energy optimization for lithium-ion batteries. Due to the complicated ocean environments, traditional filtering methods cannot effectively estimate the SOC of lithium-ion batteries in an AUV. Based on the standard extended Kalman filter (EKF), an adaptive iterative extended Kalman filter (AIEKF) method for the SOC in an AUV is proposed to address the traditional filter’s problems, such as low accuracy and large errors. In this method, the adaptive update is introduced to deal with the uncertain noise from the lithium-ion battery. The iteration is used to improve the convergence speed and to reduce the computational burden. Compared with the EKF, iterative extended Kalman filter (IEKF) and adaptive extended Kalman filter (AEKF), the proposed AIEKF has a higher estimation accuracy and anti-interference capability, which is suitable for the AUV’s SOC estimation. In addition, based on the second-order equivalent circuit model of the lithium-ion battery, a forgetting factor recursive least squares (FFRLS) method is proposed to deal with the multi-variability problem. In the end, four different methods, including EKF, IEKF, AEKF, and the proposed AIEKF, are compared in computational time. The experiment results show that the proposed method has high accuracy and fast estimation speed, meaning that it has good application potential in AUVs.


Introduction
AUVs are multi-functional underwater vehicles capable of autonomous propulsion. A battery provides the power source for an AUV's propulsion, its range, and the development of various technologies. Therefore, it is critical to select a high-performance underwater power battery technology for AUVs. Lithium-ion batteries with a low selfdischarge rates, high energy ratios, and long cycle life are reliable solutions for AUV energy storage. The SOC of lithium-ion batteries reflects the power consumption condition and remaining capacity of the battery, and SOC estimation is an important function of the battery management system (BMS) [1][2][3]. Because SOC cannot be measured directly in practical applications, a high-precision estimation method of SOC is essential to more effectively manage lithium-ion batteries and achieve optimal control of the charging and discharging process [4,5]. Additionally, the state of health (SOH) is another important factor to measure the ability of lithium-ion batteries to safely operate, and the deterioration of the battery will have an impact on the SOC estimation of lithium-ion batteries; therefore, it is crucial to accurately predict the health of the battery [6].
At present, many methods for SOC estimation have been proposed. The amperehour counting method [7] is simple to implement, but the initial value of the SOC and the current measurement noise can affect the estimation accuracy, which can lead to a significant increase in the estimation error after accumulation. The open-circuit voltage (OCV) method [8] is used to estimate SOC by determining the function between OCV and SOC, and then the SOC is estimated from the OCV value, but this method requires the battery to sit for sufficient time to reach internal equilibrium, so it is not suitable for online estimation. In addition, because the OCV-SOC curve of lithium-ion batteries is flat in the middle part, a slight deviation of OCV may lead to a large error in SOC estimation. The datadriven approach enables the direct use of data for battery SOC estimation, such as neural networks [9], support vector machines [10], fuzzy systems [11], and so on. However, datadriven methods require a large amount of data for simulation training and the performance depends on the quality of the training dataset. Poor data allocation can also affect the estimation results. Accurate estimation of battery SOC and parameter identification cannot be achieved without modeling it. Equivalent circuit models have the advantage of being simple and easy to implement online, and have been widely used in battery SOC estimation. An accurate and efficient equivalent circuit model is an important factor for effective SOC estimation. The commonly used equivalent circuit models are the Rint model, Thevenin model, and multi-order dynamic model [12][13][14]. Meng et al. [15] proposed an extended battery equivalent circuit model and performed an observability analysis of the nonlinear extended model, which provides important theoretical support for the battery charging control design and the development of a battery monitoring framework. A commonly used model-based approach is to combine the equivalent circuit model with a filter to estimate the SOC. They generally include the extended Kalman filter [16], unscented Kalman filter [17], cubature Kalman filter [18], H∞ filter [19], particle filter [20], and so on. Misyris et al. proposed a hybrid SOC estimation technique in [21], which combines the advantages of three different SOC estimation methods and can effectively improve the estimation accuracy under different conditions, reducing the computational burden and obtaining more accurate SOC estimates. Before the battery SOC estimation, the parameters of the battery model must be identified, and the parameter accuracy of the battery model affects the estimation performance of the battery equivalent circuit model. The commonly used parameter identification methods are the offline identification method [22], recursive least squares method [23][24][25], genetic algorithm [26,27], and particle swarm optimization method [28].
In order to overcome the shortcomings of the traditional EKF in terms of SOC estimation accuracy, an iterative part is added to the EKF. The IEKF updates the Jacobi matrix of the observation equation by bringing the obtained a posteriori estimates into the observation equation, and in each iteration of the calculation process. The estimated value is continuously kept close to the true value by continuously using the observed value during each iteration of the calculation. The absolute value of the difference between the estimated terminal voltage and the measured terminal voltage is set as the threshold value to determine whether to perform the iteration or not. When the voltage error value is less than the threshold value, this process meets the accuracy requirements, and the iteration process is not required. This avoids unnecessary iterative processes and reduces the computational burden. When the voltage error is greater than the threshold value, an iterative process is required. The uncertainty due to system noise affects the accuracy of SOC estimation. To solve this problem, we incorporated the adaptive update scheme. An improved Sage-Husa estimator was used for adaptive updating of process noise and measurement noise, which overcomes the fluctuation of noise due to the influence of external factors. Based on the above, this paper proposes the adaptive iterative extended Kalman filter.
The rest of the paper is structured as follows. Section 2 describes the structure of the battery model chosen in this paper and the FFRLS parameter identification method. Section 3 presents the principle of SOC estimation based on AIEKF. Section 4 conducts experiments based on LiFePO 4 batteries to verify the reliability of the proposed method. Finally, Section 5 presents the conclusions of this paper.

Equivalent Circuit Model
The second-order equivalent circuit model is more accurate than the first-order equivalent circuit model because increasing the number of RC networks can improve the accuracy of the model. The second-order equivalent circuit model has less computational complexity than other higher-order circuit models and better reflects its polarization characteristics [29]. Therefore, in the case of low system excitation [21], the second-order equivalent circuit model was chosen for the SOC estimation of lithium batteries. The structure of the secondorder RC equivalent circuit model is shown in Figure 1.

Equivalent Circuit Model
The second-order equivalent circuit model is more accurate than th equivalent circuit model because increasing the number of RC networks can accuracy of the model. The second-order equivalent circuit model has less co complexity than other higher-order circuit models and better reflects its polar acteristics [29]. Therefore, in the case of low system excitation [21], the second alent circuit model was chosen for the SOC estimation of lithium batteries. T of the second-order RC equivalent circuit model is shown in Figure 1. is the battery's concentration polarization voltage; is voltage of the battery; is the operating current of the battery; is the ba resistance; and are the battery's electrochemical polarization resistan ization capacitance, respectively, characterizing the slow electrode reaction in tery; and and are the battery's concentration polarization resistance tion capacitance, respectively, characterizing the fast electrode reaction insid The second-order equivalent circuit model equation can be derived from  is the battery's electrochemical polarization voltage; U 2 is the battery's concentration polarization voltage; U t is the terminal voltage of the battery; I t is the operating current of the battery; R 0 is the battery's ohmic resistance; R 1 and C 1 are the battery's electrochemical polarization resistance and polarization capacitance, respectively, characterizing the slow electrode reaction inside the battery; and R 2 and C 2 are the battery's concentration polarization resistance and polarization capacitance, respectively, characterizing the fast electrode reaction inside the battery.
The second-order equivalent circuit model equation can be derived from Figure 1: SOC reflects the remaining capacity of the battery and is defined as the ratio of the remaining capacity of the battery to the total capacity with the following formula: where SOC t denotes the SOC at time t, SOC t 0 denotes the SOC at time t, η is the Coulomb efficiency coefficient, and Q c is the nominal capacity of the battery. According to the second-order RC equivalent circuit model of the lithium-ion battery, the current is taken as the model input, and the voltage U t is taken as the model output.
Select [U 1 , U 2 , SOC] T as the state variable to establish the state space equation of the battery: where k , the observation variable is y k = U t,k , and the system noise is w k = [w 1,k , w 2,k , w 3,k ] T , whose covariance is Q, and the observation noise is v k , whose covariance is R.

Parameter Identification of the Battery Model
In order to establish an accurate battery model, multiple unknown parameters in the model need to be identified. In this study, an online parameter identification method based on the FFRLS algorithm was used to reduce the influence of historical data on new data during the recursive process by setting the forgetting factor and continuously updating the model parameters to obtain more accurate battery parameters.
The Laplace equation of the battery model is obtained from Equation (1).
The above equation is discretized using a bilinear variation, so that s = 2 1+z −1 , and the discretized transfer function can be expressed as: where z is the discrete operator, T is the sampling time, and b 1 , b 2 , b 3 , b 4 , b 5 are the coefficients to be determined. Equation (1) can be rewritten as a difference equation. Let and the sensor sampling error at moment k is e(k), U(k) can be expressed as: The recursive least squares formula with the forgetting factor is as follows: where ψ is the error covariance matrix of FFRLS, K is the gain of FFRLS, and λ is the forgetting factor, generally 0 < λ < 1, where λ = 0.95 is taken. The relationship between the battery model parameters and coefficients is: The hybrid pulse power characterization (HPPC) experimental data are used for parameter identification, and the parameter identification results are shown in Figure 2.
The hybrid pulse power characterization (HPPC) experimental data are used for parameter identification, and the parameter identification results are shown in Figure 2.

SOC Estimation Based on AIEKF
In this paper, an AIEKF based on the Sage-Husa maximum a posteriori estimator is proposed for battery SOC estimation. The EKF linearizes the nonlinear system by truncating the higher-order terms through Taylor series expansion. Although the EKF improves the algorithm's ability to handle nonlinear systems and simplifies the computational process, the resulting higher-order loss errors lead to a decrease in estimation accuracy. In order to solve the above problems in EKF, some optimization improvements are made to the EKF algorithm to reduce the influence of the above factors. The iterative idea is introduced in which the posterior estimate is substituted into the observation equation and the Jacobi matrix of the observation equation is updated by means of a multiple iterative measurement update process. By repeatedly using the observations, the estimates are continuously approximated to the true values during each iteration of the calculation. The absolute value of the difference between the measured end voltage and the estimated end voltage is used as the threshold value, and when the voltage error value is less than the threshold value, the iterative process is not required to reduce the computational burden. When the voltage error is greater than the threshold value, an iterative process is required. Because the system in the implementation of the estimation process will be affected by interference and random parameters, the process noise covariance and measurement noise covariance are constantly changing, which usually produces large estimation errors and affects the accuracy and robustness of SOC estimation. Incorporating the Sage-Husa maximum posteriori estimator and adaptively updating the process noise covariance

SOC Estimation Based on AIEKF
In this paper, an AIEKF based on the Sage-Husa maximum a posteriori estimator is proposed for battery SOC estimation. The EKF linearizes the nonlinear system by truncating the higher-order terms through Taylor series expansion. Although the EKF improves the algorithm's ability to handle nonlinear systems and simplifies the computational process, the resulting higher-order loss errors lead to a decrease in estimation accuracy. In order to solve the above problems in EKF, some optimization improvements are made to the EKF algorithm to reduce the influence of the above factors. The iterative idea is introduced in which the posterior estimate is substituted into the observation equation and the Jacobi matrix of the observation equation is updated by means of a multiple iterative measurement update process. By repeatedly using the observations, the estimates are continuously approximated to the true values during each iteration of the calculation. The absolute value of the difference between the measured end voltage and the estimated end voltage is used as the threshold value, and when the voltage error value is less than the threshold value, the iterative process is not required to reduce the computational burden. When the voltage error is greater than the threshold value, an iterative process is required. Because the system in the implementation of the estimation process will be affected by interference and random parameters, the process noise covariance and measurement noise covariance are constantly changing, which usually produces large estimation errors and affects the accuracy and robustness of SOC estimation. Incorporating the Sage-Husa maximum posteriori estimator and adaptively updating the process noise covariance matrix and measurement noise covariance matrix in real-time can improve the estimation accuracy and convergence speed of the algorithm under unknown system noise conditions, and further improve the filtering effect of the algorithm.
The nonlinear system model can be described as: Initialization: wherex 0 is the initial estimate and P 0 is the initial covariance matrix. Time to update:x where Measurement update: Let the number of iterations be N, the estimated value of the ith iteration be x i k|k , and the estimated covariance be P i where The absolute value of the difference between the measured terminal voltage and the estimated terminal voltage is used as the threshold value, and the threshold value is set to σ. When ∆ k = |y k −ŷ k | < σ, no iterative process is required. When ∆ k = |y k −ŷ k | > σ, the iterative process is performed.
Adaptive update: Adaptive correction for process noise and measurement noise using an improved Sage-Husa estimator.
where d k = 1−b 1−b k+1 , and b is the forgetting factor. The method uses the measurement data for recursive filtering while estimating and correcting the statistical characteristics of the system process noise and measurement noise in real-time, thus achieving the purpose of adaptive filtering.

Battery Test Platform
In order to obtain the experimental data of battery current, voltage and capacity, we set up an experimental platform consisting of the host computer and the NEWARE BTS-4000 battery charge/discharge test system for experimental verification, whose structural configuration is shown in Figure 3. The host computer was connected to the battery test equipment for online control and data collection, and the NEWARE BTS-4000H was used to load the battery voltage and current. In this paper, a LiFePO 4 battery with a nominal capacity of 6 Ah was selected as the experimental test object. to load the battery voltage and current. In this paper, a LiFePO4 battery with a nominal capacity of 6 Ah was selected as the experimental test object.

SOC-OCV-T Test
The discharge characteristics of the battery were experimented with by the HPPC test method [30,31]. The terminal voltage OCV of the battery in the operating state depends on the charge state SOC, so the open-circuit voltage at different SOCs needs to be collected in real-time. Because the SOC-OCV relationship is affected by temperature, the tests were performed in different temperature conditions. The effects of different temperatures on the SOC-OCV curves are shown in Figure 4. The HPPC operating current and cell terminal voltage at 25 °C are shown in Figure 5.

SOC-OCV-T Test
The discharge characteristics of the battery were experimented with by the HPPC test method [30,31]. The terminal voltage OCV of the battery in the operating state depends on the charge state SOC, so the open-circuit voltage at different SOCs needs to be collected in real-time. Because the SOC-OCV relationship is affected by temperature, the tests were performed in different temperature conditions. The effects of different temperatures on the SOC-OCV curves are shown in Figure 4. The HPPC operating current and cell terminal voltage at 25 • C are shown in Figure 5.

Analysis of Simulation and Experimental Results
In order to verify the effectiveness and superiority of the proposed method in terms of estimation accuracy, the proposed AIEKF is compared with the AEKF, IEKF, and EKF in this paper. The SOC estimation of the lithium-ion battery was performed under HPPC operating conditions and dynamic stress test (DST) operating conditions, and the estimated results are shown in Figures 6 and 7. The actual SOC of the lithium-ion battery is obtained from Equation (2). ensors 2022, 22, x FOR PEER REVIEW 7 to load the battery voltage and current. In this paper, a LiFePO4 battery with a nom capacity of 6 Ah was selected as the experimental test object.

SOC-OCV-T Test
The discharge characteristics of the battery were experimented with by the HPPC method [30,31]. The terminal voltage OCV of the battery in the operating state dep on the charge state SOC, so the open-circuit voltage at different SOCs needs to be coll in real-time. Because the SOC-OCV relationship is affected by temperature, the tests performed in different temperature conditions. The effects of different temperatur the SOC-OCV curves are shown in Figure 4. The HPPC operating current and cell t nal voltage at 25 °C are shown in Figure 5.

Analysis of Simulation and Experimental Results
In order to verify the effectiveness and superiority of the proposed method in terms of estimation accuracy, the proposed AIEKF is compared with the AEKF, IEKF, and EKF in this paper. The SOC estimation of the lithium-ion battery was performed under HPPC operating conditions and dynamic stress test (DST) operating conditions, and the esti mated results are shown in Figures 6 and 7. The actual SOC of the lithium-ion battery is obtained from Equation 2.

Analysis of Simulation and Experimental Results
In order to verify the effectiveness and superiority of the proposed method in terms of estimation accuracy, the proposed AIEKF is compared with the AEKF, IEKF, and EKF in this paper. The SOC estimation of the lithium-ion battery was performed under HPPC operating conditions and dynamic stress test (DST) operating conditions, and the estimated results are shown in Figures 6 and 7. The actual SOC of the lithium-ion battery is obtained from Equation 2.   In this paper, the maximum estimation error (MAE) and the root mean square error (RMSE) are used as performance indicators to evaluate SOC estimation. The MAE and RMSE are calculated using Equations (21) and (22). The results of the MAE and RMSE calculations for the two operating conditions are shown in Table 1.
where SOC(t) is the measured value at moment t, SÔC(t) is the estimated value at moment t, and n is the number of data points in the sequence. The performance of the lithium-ion battery under operating conditions is analyzed under HPPC operating conditions. Figure 6 shows the comparison results of SOC estimation for AIEKF, IEKF and EKF under HPPC operating condition. Figure 7 shows the comparison results of SOC estimation for AIEKF, AEKF and EKF. From Figures 6 and 7, it can be seen that the SOC estimation results of AIEKF are closer to the real value, which is better than the other algorithms compared in this paper and has better estimation accuracy.
In order to further verify the reliability of the proposed method, a more complex DST condition was used to experiment with and analyze the lithium-ion battery. The DST current condition is shown in Figure 8a. The model-predicted voltage and the measured voltage are shown in Figure 8b. Figure 8c compares the SOC estimation results of AIEKF, IEKF, and EKF. Figure 8d compares the SOC estimation errors of the AIEKF, IEKF, and EKF. It can be seen from Figure 8 that the SOC estimation result of AIEKF is closer to the true value, and its estimated value continuously follows the true value. Additionally, the estimation error of AIEKF is smaller. Figure 9 shows the SOC estimation results of AIEKF, AEKF, and EKF. In Figure 9, we can see that the SOC estimation result of AIEKF is closer to the true value and the estimation results are better than AEKF, and then, we can verify that the SOC estimation accuracy can be further improved by introducing the iterative idea in the adaptive case.
The results show that the AIEKF-based SOC estimation method proposed in this paper can maintain lower SOC estimation error, higher tracking accuracy and lower fluctuation under two current conditions compared with the AEKF, IEKF and EKF. The MAE and RMSE of AIEKF were calculated as being less than 1%, and the data verify that the estimation accuracy of AIEKF was better than that of AEKF, IEKF and EKF, so AIEKF can effectively improve the SOC estimation accuracy.
Three temperatures of -20, 0, and 30 • C were selected to verify the estimation effect of the proposed method at different temperatures under DST operating conditions. The SOC estimation was performed at the three temperatures with and without considering the temperature effect, and the results are shown in Figure 10. In Figure 10, the SOC1 is the SOC estimation result with considering the temperature effect and the SOC2 is the SOC estimation result without considering the temperature effect. From Figure 10, it can be seen that the proposed AIEKF can efficiently perform SOC estimation at different temperatures in this paper.  Figure 9 shows the SOC estimation results of AIEKF, AEKF, and EKF. In Figure 9, we can see that the SOC estimation result of AIEKF is closer to the true value and the estimation results are better than AEKF, and then, we can verify that the SOC estimation accuracy can be further improved by introducing the iterative idea in the adaptive case.   Figure 9 shows the SOC estimation results of AIEKF, AEKF, and EKF. In Figure 9, we can see that the SOC estimation result of AIEKF is closer to the true value and the estimation results are better than AEKF, and then, we can verify that the SOC estimation accuracy can be further improved by introducing the iterative idea in the adaptive case.  SOC estimation was performed at the three temperatures with and without considering the temperature effect, and the results are shown in Figure 10. In Figure 10, the SOC1 is the SOC estimation result with considering the temperature effect and the SOC2 is the SOC estimation result without considering the temperature effect. From Figure 10, it can be seen that the proposed AIEKF can efficiently perform SOC estimation at different temperatures in this paper.  By evaluating the SOC estimation performance of different KF family algorithms using model-based algorithms in previous studies with the proposed algorithm in this paper, the comparison results are shown in Table 2. The MAE < 1% of AIEKF is smaller among the results listed in Table 2, so the AIEKF proposed in this paper has a better estimation accuracy. Although the AIEKF proposed in this paper can improve the accuracy of SOC estimation for lithium-ion batteries, the computational burden is still affected to some extent. The discrete-time model with a sampling period of 1 s was simulated using MATLAB/Simulink R2020b on a desktop with an Intel (R) Core (TM) i7-6500 CPU and 8 GB RAM. The computation times of the three estimation algorithms are listed in Table 3, and the evaluation demonstrates that the AIEKF proposed in this paper is able to reduce the unnecessary computational burden.

Conclusions
The SOC is a valuable parameter for the AUV's control system to distribute electric energy to the propulsion system. In order to quickly obtain an accurate SOC, an improved AIEKF SOC estimation method for lithium-ion batteries was proposed in this paper. In addition, the FFRLS method was applied to update the parameters of the second-order RC equivalent circuit model of lithium-ion battery online to obtain an accurate model parameter. The computational accuracy was improved, and the unnecessary computational burden was reduced by setting a threshold value. An improved Sage-Husa estimator was used for an adaptive update optimization of process noise and measurement noise to eliminate the effect of noise. The validity of the AIEKF and its good estimation performance were demonstrated by experimental verification analysis with different currents and temperatures. The experimental results show that the RMSE of the SOC estimation results can reach 0.25%.
Further research would focus on the battery aging effect on SOC estimation and the prediction of the SOH of lithium-ion batteries in AUVs so that a more intelligent battery energy management system for AUVs can be established to adopt to a long-term voyage in the ocean environment.

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