An Improved Recursive Total Least Squares Estimation of Capacity for Electric Vehicle Lithium-Iron Phosphate Batteries

A battery’s capacity is an important indicator of its state of health and determines the maximum cruising range of electric vehicles. It is also a crucial piece of information for helping improve state of charge (SOC) estimation, health prognosis, and other related tasks in the battery management system (BMS). In this paper, we propose an improved recursive total least squares approach to online capacity estimation, which is based on the constrained Rayleigh quotient in terms of battery capacity. *is approach accounts for errors in both the SOC and accumulated current measurements not traditionally considered in the battery capacity model to give an unbiased estimation. Moreover, the forgetting factor, updated by minimizing the Rayleigh quotient of the capacity estimation model, is applied to track the changes in the model and get a more precise estimation of the capacity. Finally, the performance of the proposed algorithm is validated via simulation and experimental studies on lithium-iron phosphate batteries. *e estimation results show that the proposed algorithm improves capacity estimation accuracy.


Introduction
To meet the need to reduce fossil fuel dependence and emissions from traditional transportation, electric vehicles (EVs) are being studied and manufactured extensively around the whole world [1]. Li-ion batteries play an important role in the energy storage system of the EV. Among Li-ion batteries, the LiFePO 4 (lithium-iron phosphate) battery has gained a lot of attention owing to its nontoxicity, low cost, inherent safety, and higher energy density [2][3][4]. In order to achieve optimum performance and long life from batteries, their state of health (SOH) is crucial information, in addition to their state of charge (SOC) in the battery management system (BMS) [5,6]. e battery capacity is considered as one important indicator of SOH, which reflects that maximum electrical charge can be stored into the battery and determines the maximum cruising range for EVs [7]. As the battery ages, the loss of battery capacity leads to a reduction in the electric range of the EVs [8]. However, battery capacity cannot be measured by some of the available vehicle sensors. is necessitates the development of viable state estimation algorithms.
Many studies in the literature present estimation approaches for battery capacity. e capacity of the LiFePO 4 battery will change continually according to its age, usage patterns, and temperature [9]. Traditionally, battery capacity could only be measured offline, by depleting a fully charged battery with a low current rate at a specific temperature. Obviously, this method is not suitable for real-time applications. Some approaches [10,11] are based on a degradation model, calibrated under a certain usage pattern, and have limited tracking ability in terms of vehicle working conditions. Incremental capacity analysis (ICA) and differential voltage analysis (DVA) [12][13][14][15][16] are used to describe the internal electrochemical aging mechanism during the battery life and have recently been developed for the onboard application. e drawback of these two approaches is that the battery has to be charged or discharged with a constant current in a wide voltage region since ICA typically requires constant charging or discharging data [7]. Some intelligent algorithms have been applied to build a relationship between capacity and its influencing factors and thereby predict the real capacity of the battery. ese include neural network (NN) methods and machine learning methods, such as RBF NN [16,17], adaptive recurrent NN [18], structured NN (SNN) [19], extreme learning machine [20], adaptive multikernel relevance vector machine [21], ensemble learning with LS_SVM algorithm [22], support vector regression [23], and others. ese methods usually require a large amount of experimental data so that they can train a more precise network for battery capacity estimation [24][25][26]. is is a difficult and time-consuming task.
Least squares or Kalman filters offer the most promising compromise between estimation accuracy and low computational effort [7]. e dual Kalman filter-based methods jointly estimate the capacity and SOC together [27,28]. However, the employment of dual filters brings about an increased computational burden and the multiscale problem may cause algorithm divergence [29]. Some approaches based on coulomb counting have been researched to estimate the capacity in real time [30,31]. In these studies, the SOC estimation error is not considered, which could affect the capacity estimation accuracy. Since the recursive least squares (RLS) do not consider the SOC error, the total least squares (TLS) algorithm is introduced to improve the estimation accuracy by considering the SOC estimation error [32,33]. However, the TLS algorithm is performed by computing the singular value decomposition (SVD) of the model's covariance matrix. Since the multiplication operations of SVD for an N by N matrix have computational complexity of O(N 3 ), it can incur high computational complexity [34][35][36]. In [33], a recursive approximate weighted total least squares algorithm was proposed to improve the TLS performance. In [37], another recursive total least squares algorithm was employed to solve the capacity estimation. In [38], the constrained Rayleigh quotient was developed to find the TLS solution with the reducing computational complexity. In [39], a fast recursive total least square algorithm was proposed to solve the TLS solution by using the adaptation minimization of the constrained Rayleigh quotient. However, the forgetting factor is fixed as a constant in the above studies. It could not handle the tradeoff between robustness and tracking capability, which affects the estimation performance. Specifically, algorithms with smaller forgetting factor weigh more on tracking the time-varying capacity at the expense of more sensitivity to the current measurement and SOC estimation error; on the contrary, large forgetting factor improves robustness but compromises the tracking capability.
Based on the above algorithms, we propose an approach employing an improved recursive total least squares with variable forgetting factor (VFF-RTLS) and a coulomb counting model considering errors in both the estimated SOC and the current measurement. e forgetting factor is controlled by minimizing the constrained Rayleigh quotient through the steepest descent method.
is approach will improve capacity estimation performance. e rest of this paper is constructed as follows: Section 2 describes the capacity estimation model for the battery. Section 3 presents the proposed VFF-RTLS approach for battery capacity estimation. Section 4 presents the simulation and experimental studies using the proposed algorithms, and the conclusions are summarized in Section 5.

Capacity Estimation Model of the LiFePO 4 Battery
When EVs are running in a real-life environment, the SOC of their lithium-iron phosphate batteries is estimated by the unscented Kalman filter through the measured current and voltage. In order to predict the battery capacity, we use the following coulomb counting equation in terms of the measured current and battery SOC: where Cap is the estimated capacity of the lithium-iron phosphate battery in ampere-hours (Ah) and I(k) is the measured current. η is coulomb efficiency, with the assumption that η � 1. Δ is the sample time. w i (k) is the current measurement error, with standard deviation σ i . v s (k) denotes the SOC estimation error. We convert equation (1) into an iterative form as follows: where L b is the capacity update time period, k � 1, 2, . . . , N, en, equation (2) can be simplified into the following expression: where x � soc(kL b ) − soc(kL b − L b + 1) denotes the difference between the battery SOCs at the beginning and end of the update period, y � η j�kL b j�kL b − L b +1 ΔI(j)/3600 denotes the cumulated measured current within the update time period L b , and w i is the cumulated measured current error,

Improved Recursive Total Least Squares
Algorithm with Variable Forgetting Factor

Recursive Total Least Squares with Variable Forgetting
Factor (VFF-RTLS). From the capacity model in (3), we can see that there are errors in both the model input and output. erefore, this section proposes a constrained Rayleigh quotient-based RTLS algorithm with a variable forgetting factor for the capacity estimation of LiFePO 4 batteries.
To facilitate the presentation of the proposed algorithm, the autocorrelation matrix of the capacity model input x(k) is defined as follows: e augmented input vector is defined as x a � [x(k), y(k)], and its autocorrelation matrix can be represented as follows: 2 Mathematical Problems in Engineering e stochastic quantities R a can be computed via an iteration formula with a forgetting factor μ (0 < μ ≤ 1), as follows: en, R(k), b(k), and c(k) can be expressed as follows [38]: e VFF-RTLS performs the orthogonal regression which minimizes the sum of the squared orthogonal distances from the data points to the fitting line [40]. It makes vertical and horizontal corrections on both dependent and independent variables contain noise. However, the traditional RLS only makes vertical corrections on the dependent variable containing noise. Interested readers are referred to [39][40][41][42] and references therein for details. In other words, the proposed method is to solve the following optimization problem: where ‖ · ‖ F denotes the Frobenius norm. It has been shown in [40] that optimization problem (10) is equivalent to minimizing the Rayleigh quotient F(q): where q is the eigenvector associated with the smallest eigenvalue of the symmetric positive-definite matrix ψ T ψ in the TLS solution and D is a symmetric matrix. For the capacity estimation, a constrained Rayleigh quotient is used as a cost function where q T and ψ T ψ in equation (11) are replaced with [Cap, − 1] and R a , respectively. e capacity estimation problem, therefore, has the following constrained Rayleigh quotient cost function: where Cap represents the estimated capacity of the LiFePO 4 battery and where σ x is the standard deviation of the differential SOC error v s , and σ y is the standard deviation of the cumulated current error w i .
According to reference [42], the estimated capacity of the battery can be updated as follows: where α(k) can be determined by minimizing J(Cap(k)), which can also be rewritten as ) with respect to α(k) be equal to zero. en, we obtain α(k) by solving the following equation: In order to calculate α(k), (14) can be rewritten as e polynomial coefficients of (16) are derived as follows: where us, we can obtain the solution α(k) of equation (15), which is given by the following [38]: en, the variable forgetting factor μ is introduced to improve the estimation performance. In order to adjust μ in the above algorithm, the steepest descent method is applied to minimize the Rayleigh quotient J(Cap(k)), with respect to μ, as follows: where c 1 is a tuning parameter.
Using equations (7) and (9), we can show that equation (12) is equivalent to and its derivative is easily computed as follows: us, we obtain the updating equation for the forgetting factor: Finally, the details of the improved RTLS algorithm are summarized in Algorithm 1. In this paper, λ, R, b, and c are initialized to zero. e tuning parameter c 1 is set to 0.001. e forgetting factor μ is initialized to 0.99.

Battery State of Charge (SOC) Estimation. Battery SOC
for the capacity estimation model in this paper is obtained by using an unscented Kalman based filter. A second-order equivalent circuit model is employed to estimate SOC. e state-space equation for the model is defined as follows: where R 0 is the internal resistance, R p1 and R p2 are the polarization resistance, C p1 and C p2 are the polarization capacitance, Cap is the estimated capacity, I is the loading current (positive for discharging and negative for charging), and U ocv , U p1 , U p2 , and V denote the open circuit voltage (OCV), polarization voltage, and terminal voltage, respectively. Also, Δ is the sampling time, η is the coulomb efficiency, with the assumption that η � 1, α p1 � exp(− (Δ/R p1 C p1 )), and α p2 � exp(− (Δ/R p2 C p2 )). U ocv can be described as a function of estimated SOC. e relationship between U ocv and SOC is defined as follows: − l 2 soc(t) + l 3 ln(soc(t)) + l 4 ln(1 − soc(t)). e detailed estimation process can be explained as follows: (1) Initialization: where x + 0 is the initial state estimation, and S + 0 is the square root of the error covariance matrix. e weight vector W is defined as follows: e sigma vector is initialized as follows: with j � 2, . . . , n, and the sigma vector is iteratively calculated as follows: en, the sigma points are given by (2) Time update: where qr denotes the QR decomposition of the compound matrix in (36), cholupdate denotes the Cholesky update of (36). (3) Measurement update: x t � x t|t− 1 + G t y t − y t ,

Coestimation Scheme with VFF-RTLS and SOC
Estimation. e VFF-RTLS capacity identification method was combined with an SR-SUKF SOC estimator to calculate the battery capacity. e coestimation scheme is shown in Figure 1.
As shown in Figure 1, the variables in VFF-RTLS and SR-SUKF are initialized. Each time the battery current and voltage are measured, the SR-SUKF can be conducted and battery SOC will be updated. e measured current is added up during the capacity estimation update period. e difference SOC is obtained at the beginning and end of the capacity estimation update period. en, the VFF-RTLS can be conducted to identify the battery capacity. e recently updated capacity will be transferred to the SR-SUKF section to replace the previous capacity. e SOC is then estimated through SR-SUKF with the updated capacity, measured current, and voltage. en, the algorithm moves to the next iteration.

Simulation and Experimental Studies
Simulation and experimental studies are executed to validate the proposed capacity estimation algorithm for a LiFePO 4 battery subject to different driving conditions. e proposed estimation algorithms show an advantage in terms of estimation accuracy. All of these tests are programmed and performed in MATLAB software on a computer with 2.4 GHz Intel(R) Core (TM) i3 CPU M370 and 32-bit OS.

Simulation Study: Dynamic Stress Test (DST)
Condition. In this scenario, the simulation study assumes that the battery has a constant capacity without any degradation and that the battery is subject to a current profile that is proportional to the power profile in the standard DST condition. e DST condition is a battery testing program designed to mimic the current of an electric car when driven on a real road. e DST current profile is shown in Figure 2 Mathematical Problems in Engineering 5 according to a real application. In EVs, the current through the battery is always measured by a Hall current sensor with certain high precision. In the capacity identification model, the current is obtained at a frequency of 1 second and the output y is calculated by summing the measured current during the estimation update time period of 100 seconds. e model input x is obtained by taking the difference between the two SOCs at the beginning and end of each estimation update period. e initial parameters and noise properties of the proposed algorithms are set as follows.
Noise in the current measurement is assumed to be a random white noise with standard deviation σ i � 0.001 A.
en, the noise in the model output y is obtained by summing the cumulated current noise over 100 seconds, which is expressed as σ y � ��� 100 √ * Δ * σ i /3600. Noise in the SOC is assumed to be random white noise with standard deviation σ s � 0.01. en, noise in the model input x is derived as σ x � � 2 √ * σ s . e tuning parameter c 1 is set to 0.001, and the initial forgetting factor is set to μ � 0.99. e actual capacity of the battery is set to be 12.5 Ah. e simulation results under the DST condition are presented in Figure 2. Specifically, Figure 2(a) plots the DST current profile for one cycle, Figure 2(b) plots the whole current profile during the entire running time, Figure 2(c) gives the battery SOC, Figure 2(d) shows the estimated capacity computed by the estimation algorithms and the actual capacity of the battery, and Figure 2(e) shows the estimation error as a percentage. From the estimation results, we can see that the proposed VFF-RTLS algorithm outperforms the other three algorithms with an estimation error below 1%. Of the other three algorithms, the traditional RTLS is best, with an estimation error below 4%. Since the traditional RLS only consider the error on the current measurement without the SOC estimation error, the result shows that RLS converges to a biased value and has the worst performance with a large estimation error. Owing to the errors in SOC estimation, RLS converges to a steady state with a lower speed. e SVD based TLS algorithm converges to a steady value with the increasing data input, and it is worse than the RTLS. e RTLS with an appropriate initial state can converge faster than the SVD based TLS. Our proposed method has the best performance due to the variable forgetting factor.

Simulation Study: Highway Cycles.
In this scenario, the simulation study assumes that the battery has a constant capacity without any degradation and that the battery is subject to a current profile proportional to the speed profile in the highway cycles. e highway cycles are designed to test EVs driven on highways at a high speed. In a highway driving environment, the vehicle always runs at a relatively high speed. e highway cycle profile is shown in Figure 3(a) and repeated end-to-end until the battery SOC reaches 0. e RLS, TLS, RTLS, and VFF-RTLS run over a period of 100 seconds. In the capacity identification model, the current is obtained at a frequency of 1 second. e model input x and output y are obtained in the same way as for the DST driving condition. e initial parameters and noise properties of the model input/output are set to be the same as for the DST condition. e initial forgetting factor is set to μ � 0.99. In this section, we use a battery with an actual capacity of 100 Ah. e simulation results under the highway cycles are presented in Figure 3. Particularly, Figure 3(a) plots the current profile for one highway cycle, Figure 3 SR-SUKF for SOC estimation   In this section, a simulation study is carried out to verify that the proposed capacity estimation algorithm can effectively track a variable battery capacity. e battery is assumed to have a variable capacity to mimic degradation behavior, and the battery SOC is in a range from 90%-10%. e capacity decreases from 100 Ah to 90 Ah. e model input x is simulated by a uniform random value from [− 0.8, +0.8], and then the model output y is simulated by multiplying the actual capacity by the model input x. e initial parameters and the noise properties for the model input/output are set to be the same as for the highway cycles. e initial forgetting factor is set to μ � 0.99. e simulation results are presented in Figure 4. Specifically, Figure 4(a) shows the estimated capacity computed by the proposed algorithms and the actual capacity of the battery, and Figure 4(b) shows the estimation error of the algorithms as a percentage. From the estimation results, we can see that the proposed VFF-RTLS algorithm outperforms the other three algorithms, with an estimation error below 0.5%. Of the other three algorithms, the RTLS algorithm is the best with an estimation error below 1%. Both the RLS and TLS perform poorly with large estimation errors. Without considering the error in SOC estimation, the RLS algorithm does not track the varying battery capacity. And the SVD based TLS can not track the capacity precisely, and the error grows with the increasing data input. e proposed method (VFF-RTLS) in this paper can track the varying battery capacity better than the RTLS because of the variable forgetting factor, which improves the traditional RTLS performance.

Experimental Study.
To validate the proposed algorithm against experimental data, an experiment was conducted on a test bench where a lithium-iron phosphate battery of 28 Ah was kept in a temperature-controlled box with ambient temperature 25.2°C. BTS-5 V-200 A battery test equipment was used to charge/discharge the battery with a maximum voltage of 5 V and maximum charge/discharge current of 200 A. It has high accuracy in voltage and current measurement, with ±0.1% of FS. A BTS 7.5.X test software system was installed on a laptop computer which generated the test current profile for the battery. en, the experiment began with the battery fully charged. e current and voltage data were measured with a frequency of 1 second. e true battery capacity was extracted offline from a full discharge test with a small current. e battery parameters were identified offline using constant-current pulse charge-discharge experiments. e SOC estimation model parameters obtained were as follows: R 0 � 1.1 mΩ, R p1 � 1.9 mΩ, R p2 � 3.6 mΩ, C p1 � 58.605 KF, and C p2 � 91.42 KF. e OCV parameters identified offline were as follows: u 0 � 3.38, l 1 � − 3.03e − 5, l 2 � 0.1327, l 3 � 0.0778, and l 4 � − 0.00284 e capacity estimation is performed as in Section 3.3. e initial forgetting factor is set to μ � 0.99. e experiment results are presented in Figure 5. Specifically, Figure 5(a) plots the current profile for one cycle, Figure 5(b) plots the whole current profile over the whole running time, Figure 5(c) gives the estimated battery SOC, Figure 5(d) shows the estimated capacity computed by the estimation algorithms and the actual capacity of the battery, and Figure 5(e) shows the estimation error as a percentage.
In the experimental studies, we find a similar phenomenon as in the simulation studies. From the estimation results, we can see that the proposed VFF-RTLS algorithm outperforms the other three algorithms with an estimation error below 0.1%. Owing to the variable forgetting factor, the VFF-RTLS has a better performance than the conventional RTLS. Of the other three algorithms, the RTLS algorithm is best, with an estimation error below 0.3%. e RLS has the worst performance with a large estimation error.

Conclusion
In order to obtain a capacity estimation with high accuracy, the improved RTLS algorithm with a variable forgetting factor (VFF-RTLS) is adopted in this paper. It is based on constrained Rayleigh quotient to consider the errors in the capacity model input/output. e variable forgetting factor is developed to further improve the estimation accuracy. Compared with other algorithms through the simulation and experimental studies, the results have shown that the proposed VFF-RTLS has better estimation performance in real time. In future work, the thermal effects on the capacity estimation will be studied, and more realistic experiments will be designed to validate the proposed algorithm.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.