Lithium-Ion Battery Parameters and State of Charge Joint Estimation Using Bias Compensation Least Squares and the Alternate Algorithm

For safe and efficient operation of electric vehicles (EVs), battery management system is essential. Nevertheless, a challenge lying in battery management systems is how to obtain an algorithm for state of charge (SOC) estimation that has both high accuracy and low computational cost. For this purpose, the battery parameters and SOC joint estimation algorithm based on bias compensation least squares and alternate (BCLS-ALT) algorithm are proposed in this paper. ,e battery model parameters are identified online using the bias compensation least squares (BCLS), while the SOC is estimated applying the alternate (ALT) algorithm, which can switch the computational logic between H-infinity filter (HIF) and ampere-hour integral (AHI) to improve the computational efficiency and accuracy. ,e experimental results show that the accuracy of the SOC estimated by the BCLS-ALTalgorithm is the highest, and the computational efficiency is also high, with the switching threshold SOCALT being set to 25%. Despite the 20% initial error and the 10% current drift, the proposed BCLS-ALT algorithm can obtain high accuracy and robustness of SOC estimation under different ambient temperatures and dynamic load profiles.


Introduction
As energy storage systems, lithium-ion batteries have significant advantages in terms of power density [1], self-discharge rate [2], energy density [3,4], and cycle life compared to other types of batteries [5,6]. For these reasons, they are widely used in EVs [7,8]. For users, the safety and reliability of battery energy storage systems of the EVs are crucial [9,10]. One of the preconditions to ensure the safety of the battery energy storage system is to effectively and accurately estimate the SOC of the batteries [11,12]. To this end, researchers have made immense efforts to develop many valuable SOC estimation methods [13], such as the lookingup table-based methods [14], ampere-hour integral methods [15], model-based estimation methods [16], and data-driven estimation methods [17,18]. e looking-up table-based method is the simplest algorithm to obtain the SOC. e AHI method is the widely used method to estimate the SOC in battery management systems (BMS). However, the former has strict requirements for measuring open circuit voltage (OCV), so it is difficult to achieve effective SOC estimation, while the latter is affected by the initial SOC value and current measurement error, so it is hard to guarantee the accuracy of SOC estimation. e data-driven methods require large datasets to train algorithms, but the enough training datasets are difficult to obtain. Compared with other methods, the model-based method is the most popular one for SOC estimation, and it is more robust and accurate with regard to the estimation. Among the model-based methods, it cannot be ignored that the HIF algorithm and its improved forms are excellent robustness and adaptability. Currently, it can be found that scholars have carried out a lot of research on the HIF algorithm. In the study by Xia et. al. [19], experiments show that the strong tracking H-infinity filter can deal well with the adverse effects of measuring noises and initial error in the SOC estimation results. Dual H-infinity filters can converge to the reference value within 2% [20]. e H-infinity extended Kalman filter can estimate the SOC more accurately over a large range [21,22]. In the studies by Sun et. al and Charkhgard and Zarif [23,24], the adaptive H-infinite filter can also perform well when solving battery model parameters. In the study by Yu et. al. [25], the combination of H-infinity and unscented Kalman filters for SOC estimation combines the advantages of the two algorithms. Although the above SOC estimation algorithms possess high accuracy, fast convergence, excellent robustness, and adaptability, yet they consume a large amount of computing resources. e on-board BMS is usually limited in computing power, so it is hard to apply in the on-board BMS [19]. As a result, the most challenging problem in the development of the SOC estimation algorithm is how to obtain an algorithm that have both high accuracy and low computational cost. Considering the resource optimization and the computational load balance, in [26][27][28], a multimodel switching SOC estimation method for Li-ion batteries is proposed. e experimental results indicate that accurate estimation results and reasonable program execution time can be obtained by the multimodel switching SOC estimation method.
is is because the external electronic behaviors, aging, and temperature of the lithium-ion batteries can be well approximated by the battery model [29][30][31], and the highprecision SOC estimation can be obtained. ough there are many model types in the multimodel switching SOC estimation method, the practical application conditions are changeable. If the types of the battery model are not enough, it is hard to obtain good application results. In the study by Tang et. al. [32], a multigain-switching approach to estimation of SOC is proposed. e common problems, such as local model inaccuracy, current sensor drifting, and data saturation, could be overcome. However, in practical applications, the battery operating conditions are complex, and the limited gains are difficult to adapt to the uncertain operating conditions. In the study by Liu et. al. [11], an alternate algorithm combining adaptive extended Kalman filter and the ampere-hour counting method is proposed to improve the accuracy and reduce the computational cost. However, Kalman filtering operates under the assumption of zero-mean noise [33][34][35], which is difficult to satisfy in reality [19].
e H-infinity filter has relatively excellent robustness and high accuracy in SOC estimation under unknown characteristics of noise measurement [25]. erefore, in order to improve the accuracy of SOC estimation and reduce its computational cost, the alternate algorithm combining the HIF and the AHI method is selected to estimate the SOC in this work. For parameters identification of the equivalent circuit model (ECM), the commonly used methods include the genetic algorithm (GA), particle swarm optimization (PSO), and recursive least square (RLS) [13]. Among the above methods, the RLS is widely used owing to simple, stable, and low computational cost. But with the increase of data in the recursive process, the accuracy of identification will be affected by the old data, which will lead to large errors [36]. In addition, the RLS is very effective in dealing with white noise, but if it is colored noise, the estimation by the RLS will be inaccurate [37]. In order to solve the above problems, the bias compensation least squares (BCLS) appears, which can use compensation terms to reduce errors and to maintain high computational efficiency [38,39]. In the study by Chen [38], the results of the BCLS algorithm and the RLS algorithm are compared. In the case of the same initial parameters, for colored noise, the BCLS algorithm has a significant advantage in estimation accuracy. is is due to the BCLS algorithm can apply compensation terms to reduce the bias caused by the RLS algorithm. In the study by Li et. al. [40], the model identified by RLS is biased and is adequately verified. To improve the identification accuracy, the BCLS is used. e BCLS can compensate the model identification biases caused by the noises imposed on both voltage and current measurements. e simulation and experimental results show that the BCLS algorithm is effective [40,41]. In practical application, colored noise is common [42,43]. Avoiding the interference of noise on model parameter identification can improve the accuracy of SOC estimation. In this article, the BCLS is chose to identify the parameters of the battery model. Unlike the GA algorithm and the PSO algorithm with high computational cost, the BCLS shows an efficient online parameter estimation performance, which is suitable for on-board BMS with limited computing power. As a result, the BCLS-ALT SOC joint estimation algorithm is proposed in this article where the BCLS and ALT algorithm will be applied to identify battery model parameters and SOC, respectively. To verify its performance, the proposed BCLS-ALT algorithm is compared with the recursive least squares and the alternate (RLS-ALT) algorithm under different dynamic tests and ambient temperatures. e experimental results show that the proposed BCLS-ALT SOC joint estimation algorithm can provide excellent performance under different operation conditions. e remainder of this paper is organized as follows. Section 2 describes the BCLS-ALTbased SOC joint estimation algorithm. e experimental verifications are shown in Section 3. Section 4 presents the discussions. Section 5 makes the conclusions.

Battery Model.
Compared with the existing battery models and considering the calculation's complexity, the first-order ECM is recognized as a better option for modeling lithium-ion batteries [44][45][46]. It is widely used in related research of lithium-ion batteries [47]. In order to ensure accuracy and simplicity, the first-order ECM has been selected in this article as shown in Figure 1. e first-order ECM can be represented as , where U OC is the voltage source, R P is the polarization resistance, C P is the polarization capacitance, R 0 is the ohmic impedance, U OC is the open circuit voltage, U T is the terminal voltage, I L is the current, C n is the nominal capacity, and η is Coulombic efficiency. Equation (1) can be discretized, and the discrete system equation can be expressed as follows: On the basis of known knowledge, OCV is the function of the SOC and temperature, which can be expressed as the following equation: where K 1,T (i � 0, . . . , 6) are the coefficients, which can be fit based on an experimental database. In addition, T is the temperature of the battery working environment.

BCLS-Based Parameter Identification Algorithm.
e model-based SOC estimation method is highly dependent on the model parameters. In this section, the online-identified parameters of the battery model using the BCLS are introduced. is method uses the square norm of the discrete function as a metric to get the identification parameters. When the system error is considered, the discrete expression of the system is to be identified from equation (1). According to equations (1) and (2), the Laplace equation of the battery model can be obtained as Equation (5) can be discretized by bilinear transformation [48]. Substituting s � ((2/T)(1 − Z − 1 /1 + Z −1 )) into equation (5), G(s) can be described as where a 1 , a 2 , and a 3 are the system coefficients. Equation (4) can be transformed into the following difference equation: where I(k) is the system input; U Δ (k) is the system output, and U Δ (k) can be represented as where e(k) is the systematic error. φ(k) and θ can be written as Extending φ(k) to N-dimensional, Φ(k), U Δ , and e can be written as Defining the function J(θ) [40], J(θ) can be described as e extreme value of J(θ) can be got as Least squares estimation result can be obtained as However, the least square method is only effective for white noise. If the noise is not white noise, the parameter estimation by the least square method is not unbiased and consistent estimation. To solve the above problems, online estimation of noise variance and real-time bias compensation are applied. e noise variance σ 2 [39] can be described as where θ BCLS (k − 1) is the result of the bias compensation least squares at time k − 1, Λ is the correlation matrix, and F(k) is the error criterion function. Λ and F(k) [42] can be represented as   Mathematical Problems in Engineering where Q is the covariance matrix, and E(k) is the error of least squares estimation. Q(k) and E(k) [41] can be written as where K c is the gain matrix. K c [43] can be calculated as e bias compensation least squares [40] estimation of θ is obtained by With the computational formula of the BCLS, we can estimate the parameters of the battery model online, and the general process of the identification is listed in Table 1.

BCLS-ALT-Based SOC Joint Estimation.
In order to achieve accurate SOC estimation and low computational cost, a BCLS-ALT algorithm for SOC estimation is proposed in this paper. With the parameters identified online by the BCLS, the ALT algorithm is then applied to estimate the SOC. e ALTalgorithm is consisted of the AHI method and the HIF. e flowchart of the ALT algorithm is shown in Figure 2. e HIF is used to obtain accurate initial values of the AHI method, and it is also applied to correct the errors produced by the AHI method. e SOC estimation can be switched between the AHI method and the HIF in the proposed BCLS-ALT algorithm.

AHI Method and the H-Infinity Filter Algorithm.
e AHI method is widely used in most EVs [11] and is the most efficient method. However, the estimation accuracy of this method is affected by the initial error and cumulative error produced by measurement errors of battery current. e AHI method [7] is formulated as where SOC(0) represents the SOC at the initial time 0, C n is the nominal capacity, η denotes the coulombic efficiency, and i L is the battery working current. e HIF is popular due to high robustness and accuracy. Similar to other modelbased SOC estimation methods, the computational efficiency of the HIF is much lower than that of the AHI method. is can be known through its process of calculation. To implement the HIF to estimate the SOC, the discrete-time system equation can be derived as where w k is the process noise of u k . v k is the measurement noise of observation y k . x k is the system state at time k. From equation (2), A, B, and D can be written as Step 1: HIF algorithm Determine S k � L T k S k L k (35) Step 2: linearize C k via (25) Step 3: calculate gain matrix Step 4: calculate estimation of y k y k � Uoc(x k,1 ) − x k,2 − Du k (37) Step 5: state estimation at time k + 1 Step 7: output SOC estimation at time k + 1 SOC k+1 � Lx k+1 (40) If the amplitude of the SOC < 1% Step Step 8 End End Step 9: update time Since the relationship between the SOC and OCV is nonlinear, this results in equation (23) exhibiting nonlinear behavior. However, this problem can be solved according to the related theory of Burgos et al. [49] as shown in equation (25). en, the cost function J can be constructed using game theory as in equation (26) [50].
where z k is denoted for the SOC, and z k is defined for the z k 's estimated value; x 0 denotes the initial SOC, and x 0 represents the x 0 's estimation value. S k , P 0 , W k , and V k are the weighting matrices in equation (26). ey are selected based on the specific situation [24].
For simplicity, S k , W k , and V k were set as the identity matrices, and their dimensions were determined using equation (26). P 0 was determined by the initial error. e cost function J can be regarded as a contest between nature and engineers. Nature always tries to maximize the estimation error by introducing errors (current error w k , voltage noise v k , and the initial error in the denominator) [19]. However, appropriate methods can be applied to minimize the estimation error, so that the value of the function J is as small as possible to obtain an accurate SOC. However, it is difficult to minimize J directly; thus, a bound value θ that can be easily satisfied was determined. at is, a value for z k should be the satisfied condition [19].     (3).  (26) and (28) can be integrated and expressed as From equation (23), the following can be derived: where S k is defined as Applying these results, J 1 can be written as equation (32). us, the discrete H-infinity filter can be considered as a minimax problem as shown in equation (33). To solve this problem, Dan et al. derived the equations and analyzed related theories [51]. eir findings demonstrated that when the function J has a maximum or a minimum, x 0 , w k , y k , and x k are determined. Satisfying equation (34) can guarantee that there is a solution for the estimator [19].

ALT Algorithm.
To develop an SOC estimation algorithm with both high accuracy and low computational cost that can be applied in on-board BMS, the alternate algorithm combining the AHI method and HIF is proposed. When the BMS is started, the initial value of the SOC will be set by the HIF. Once the SOC converges to the true value, the ALT algorithm will switch the computational logic to the AHI method to improve the computational efficiency. e algorithm-switch condition is that the amplitude of the SOC is less than 1%, which means Mathematical Problems in Engineering that the HIF has found the true value and ended the convergence process. e cumulative errors of the SOC estimation using the AHI method will be produced by measurement errors of battery current. erefore, in order to ensure an accurate estimation of the SOC, the proposed algorithm switches back to the HIF algorithm to correct the SOC. is algorithm-switch condition is the increment of the SOC, which is written by the △SOC. From the start of the AHI method, if the △SOC is more than the SOC ALT , the ALT algorithm will switch back to the HIF. e SOC ALT is the switching threshold set by the on-board BMS. e specific calculation steps of the ALT algorithm are shown in Table 2.
Considering the principle of the HIF, to get a more accurate algorithm, (1/ε) should be set lower. However, if (1/ε) is set too low, the HIF algorithm will fail to converge. erefore, ε is set to 0.01 in this work. Generally, the initial estimation error and the measured noise statistics cannot be known and set in advance in the application of the algorithm. In order to make the calculation simple, the initial state of all matrices is set as the identity matrices. e dimensions of the matrices, such as S k , W k , and V k , were determined by equation (15), and P 0 was determined by the initial error [19].

Experimental Verifications
In order to verify the efficiency and accuracy of the proposed SOC estimator, the low-current OCV test and dynamic cycles test were conducted at 0°C, 25°C, and 40°C, respectively. e schematic of the test bench is shown in Figure 3. It consists of Bitrode MCV12-100 for the battery test, a thermal chamber for environment control, and a host computer for operation control and data display/ storage. e test sample is the A123 lithium-ion cell with remaining capacity 1.1 Ah. e battery tester can charge/ discharge a battery according to the designed program on the host computer. e acquired data are used to determine model parameters and verify the proposed SOC estimator.
In the low-current OCV test, the cell was charged and discharged at a constant rate of C/20. e cut-off voltage for charging was 3.6 V, and the cut-off current was 0.01 C. e cut-off voltage for discharge was 2 V. e OCV-SOC curve  Mathematical Problems in Engineering can be obtained by using the average value of the chargedischarge equilibrium potential [52,53] as shown in Figure 4. e coefficients of equation (3) are presented in Table 3 for obtaining the OCV. In the dynamic cycles test, the dynamic stress test (DST) and federal urban driving schedule (FUDS) are used to simulate the actual driving cycles of EVs. e DST and FUDS load profiles are used to verify the performance of parameter identification and SOC estimation of the proposed algorithm. e BCLS is applied to identify the parameters of the ECM under DST condition at 25°C. e results of the R 0 , R P , and C P are shown in Figures 5(a)-5(c), respectively. e ohmic resistance R 0 and polarization resistance R P are stable at the beginning of the discharge and increases at the end of the discharge.
e polarization capacitance C P decreases slightly with the depth of the discharge. e BCLS algorithm applies online estimation of noise variance and performs bias compensation in real time to have a better estimation effect when there is colored noise.
To verify that the BCLS algorithm has better performance, we compare the accuracy of the RLS algorithm and the BCLS algorithm in model parameter identification. As shown in Figure 5, under DST condition, the model parameters are identified by the RLS algorithm. e results show that the R 0 and R P do not track the change of the DST current and is constant during most of the discharge time.
e C P is gradually increasing. e curve of C P is smooth and does not seem to be affected by the changes of current. Comparing the measured terminal voltage of the battery with the simulated terminal voltage of the battery model, the model error caused by the two parameter identification algorithms is obvious, as shown in Figure 5(d). Using the parameters identified by the BCLS algorithm, the error of the battery model terminal voltage is smaller. Figure 6 shows the results of the states by using the BCLS-ALT algorithm under the DST test at 25°C. Figures 6(a) and 6(c) show the observed terminal voltage, the reference voltage, and the voltage error where the error is less than 0.03 V except at the end of discharge. Figure 6(b) compares the estimated SOC by using the BCLS-ALT algorithm and the AHI method with the reference SOC. It shows that despite the fluctuations at the start of using HIF, the estimated SOC by applying the proposed algorithm can quickly converge to the reference SOC with a 20% initial SOC error and a 10% current drift. However, with a 10% current drift, the error of the estimated SOC by using the AHI method increases with the depth of the discharge as shown in Figure 6(d). From Figure 6, it can be seen that the proposed algorithm can estimate the SOC under the DST test at 25°C effectively.

Discussions
In the following, the accuracy and efficiency of the proposed BCLS-ALT algorithm are discussed. Section 4.1 analyzes the influence of different switching thresholds on the accuracy and efficiency of the BCLS-ALT algorithm and gives the optimal switching threshold. Section 4.2 discusses the performances of the proposed BCLS-ALT algorithm under different dynamic load profiles. Section 4.2 evaluates the adaptability of the proposed algorithm at different ambient temperatures. ALT . Due to that the measurement error of current cannot be eliminated, the errors of the SOC estimation by using the AHI method will increase with the depth of the discharge. e proposed BCLS-ALT algorithm can deal with the above issue by switching the computational logic to the HIF algorithm to correct errors caused by the AHI method. e SOC ALT is the switching threshold for switching the AHI method to the HIF. From the start of the AHI method, if the increment of the SOC (△SOC) is more than the SOC ALT , the ALT algorithm will switch to the HIF. To ensure the accuracy and efficiency of the proposed BCLS-ALT algorithm, we compare the accuracy of SOC estimation using different SOC ALT as shown in and efficiency of SOC estimation under DST and FUDS conditions, respectively. e computational efficiency increases with the increase of the switching threshold SOC ALT . e RMSE, which represents the accuracy of the calculation, increases first and then decreases with the increase of the switching threshold SOC ALT . If the SOC ALT is small, the HIF algorithm cannot converge to the true value when correcting the SOC; and if the SOC ALT is large, the mean absolute error of SOC estimation will increase. In the above two cases, the accuracy of the SOC estimation will decrease. When the switching threshold SOC ALT is 25%, the RMSE reaches the minimum value, which means that the accuracy of the SOC estimation is the highest. When the switching threshold SOC ALT is set to 25%, the comparison of computational time under different dynamic load profiles is shown in Figure 7(c), which reveals that the proposed BCLS-ALT algorithm can greatly reduce the computational time of the model-based SOC estimation method. is algorithm is very suitable for the on-board BMS with limited computing power. In addition, the computational time is obtained by MATLAB R2014b software on a Lenovo E40 PC with Intel Core i5-4210U CPU produced by Intel at1.70 GHz and 8.0 GB RAM.

SOC Estimations under Different Dynamic Tests.
In the study by Liu et. al. [11], the adaptability of the alternate algorithm is only verified under DST condition, and it is not enough to prove the pros and cons of the algorithm. In this paper, to verify that the proposed algorithm can adapt to different dynamic conditions, the BCLS-ALT algorithm and the SOC estimation method based on the recursive least squares and the alternate (RLS-ALT) algorithm are, respectively, applied to estimate the SOC under the DST test and the FUDS test at 25°C. To make the simulation closer to the EVs operation conditions, we set the initial error of the SOC to 20% and the drift of the current to 10%. Using the optimal switching threshold, the SOC results are shown in Figures 8 and 9. Despite the fluctuations at the algorithm switching, the two methods are robust and can converge to  the reference SOC with an initial SOC error. Nevertheless, the BCLS-ALT algorithm converges more quickly than the RLS-ALT algorithm. Due to the current drift, the error of the SOC estimated by the AHI method increases with the depth of the discharge and even close to 10% at the end of discharge. While the BCLS-ALT algorithm and the RLS-ALT algorithm can correct the error of the SOC estimation, the accuracy of the SOC estimation by the BCLS-ALT algorithm is higher after the error-correction. Figure 10 further analyzes the errors of the two algorithms. At 25°C, the RMSE of the proposed algorithm is smaller, which indicates that the BCLS-ALT algorithm can obtain accurate battery model parameters and is more robust and adaptable under different dynamic load profiles than the RLS-ALT algorithm.

SOC Estimations at Different Temperatures.
e BCLS-ALT algorithm can update model parameters online with the ambient temperature changes and maintain accurate SOC estimation. In order to verify this, the DST tests were also performed at 40°C and 0°C, respectively. To study the influence of model parameters on SOC estimation at different temperatures, case 1 and case 2 are defined for the RLS-ALT algorithm. Case 1: SOC estimation through the ALT algorithm with offline parameters identified by the RLS algorithm at 25°C. Case 2: SOC estimation through the ALT algorithm with offline parameters identified by the RLS algorithm at 40°C and 0°C, respectively. At different ambient temperatures, the two algorithms also can converge quickly to the reference SOC with 20% initial error and 10% current drift as shown in Figures 11 and 12. e error analysis of the SOC is shown in Figure 10. Figure 10 shows that smaller RMSE and MAE can be provided by the BCLS-ALT algorithm; due to that, it can update the model parameters in real time with the ambient temperature changes, nevertheless, the RLS-ALT algorithm cannot respond to changing operation conditions. e RMSE of case 1 at 40°C is smaller than that at 0°C, compared the error analysis as shown in Figure 10. At the same time, it also reveals that the parameter change caused by the temperature rise from 25°C to 40°C is smaller than that caused by the temperature drop from 25°C to 0°C. At 40°C and 0°C, the RMSE of two algorithms are  almost the same.
is shows that although the ambient temperature changes of the EVs are inevitable, the algorithm with real-time updating of battery parameters can provide a highly accurate SOC estimation. us, the proposed BCLS-ALT algorithm can provide accurate and efficient estimation of the SOC, which is more suitable for EVs.

Conclusions
In this paper, the BCLS-ALT-based SOC joint estimation algorithm with high accuracy and low computational cost is proposed.
e robustness and accuracy of the proposed algorithm were verified under the DST test and FUDS test at different ambient temperatures of 40°C, 25°C, and 0°C, respectively. e experimental results show that the accuracy and the computational efficiency of the BCLS-ALT algorithm are high, using the optimal switching threshold. e proposed algorithm converges faster with 20% initial error and 10% current drift compared with the RLS-ALT algorithm. Despite the current drift, due to updating model parameters in real-time, the BCLS-ALT algorithm is more robust under different dynamic load profiles and different ambient temperatures. erefore, the proposed BCLS-ALT algorithm is more suitable for on-board BMS with limited computing power but requiring high estimation accuracy.

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 no conflicts of interest.