Cloud-Based Optimization of a Battery Model Parameter Identiﬁcation Algorithm for Battery State-of-Health Estimation in Electric Vehicles

: Connectivity and cloud computing are key elements in the future of electric mobility. They allow manufacturers to provide advanced ﬂeet management and predictive diagnostic services. In particular, cloud computing dramatically enhances data availability and enables the use of more complex and accurate state estimation algorithms for electric vehicle lithium-ion batteries. A tuning procedure for a moving window least squares algorithm to estimate the parameters of a 2-RC equivalent circuit battery model is presented in this paper. The tuning procedure uses real data collected from a test vehicle and uploaded to the Stellantis-CRF cloud. The tuned algorithm was applied to eight months of road tests and showed very small estimation errors. The errors are comparable to other literature data, even when the literature results were obtained in laboratory tests. The estimated model parameters are tracked through time and seem accurate enough to show the ﬁrst signs of battery aging.


Introduction
Connectivity together with autonomy and electrification are the three pillars of the automotive revolution that is paving the way to the future of mobility.A connected vehicle is a vehicle able to communicate with other devices (vehicles, smartphones, cloud infrastructure, etc.) over a wireless network.The connection with the vehicle and the possibility of exchanging different types of data allow the carmaker to improve fleet management and provide advanced predictive diagnostic services.Electric vehicles (EVs) represent the natural target for the implementation of innovative connected services [1][2][3].In fact, the potentials of cloud computing, in terms of computational power and vehicle fleet data availability, promise to enable a significant improvement in state-of-charge (SOC), state-of-health (SOH), and remaining useful life estimation of the EV traction battery.
Aging and performance degradation mechanisms of lithium-ion batteries (LIBs) are still a large subject of debate in the scientific community, and a deeper knowledge of them could significantly enhance vehicle battery lifetime, performance, and usability.Degradation is strongly influenced by charging profiles [4,5].The optimized charging profile (OCP) that achieves the best trade-off between charging time and battery aging rate can be identified starting from a battery model [6][7][8][9][10].A commonly used battery model is the electric equivalent model (ECM), which offers a very good trade-off between complexity and accuracy.ECMs use electrical components such as voltage sources, resistors, and capacitors to model the dynamic behavior of the battery.Moreover, its components can be related to the electrochemical parameters of the battery [11].
Unfortunately, the parameters of the battery model evolve with the aging of the battery, and they should be continuously identified during the battery life to maintain good model accuracy.Several algorithms can be used for tracking the evolution of the parameters and the state variables of the battery model.State variables and parameters estimation algorithms are usually classified in model-based and data-driven methods [12,13].Several types of Kalman filters (e.g., extended Kalman filter, unscented Kalman filter, and sigma-point Kalman filter), together with particle filter, slide mode observer, and least squares-based techniques, belong to the model-based methods.Conversely, data-driven methods include artificial neural networks, support vector regression, and fuzzy logic.The application of Kalman and particle filters for SOC estimation is discussed and compared in [14].These algorithms generally need high computational power that is not often compatible with their implementation in a battery management system (BMS).In fact, real-time implementation of ECM parameter identification algorithms in BMSs requires the use of specific hardware accelerators that increase the BMS cost [15].
A very promising scenario for model parameter identification is the use of the high computational power provided by the cloud computing concept.The vehicle uploads the current, voltage, and temperature profiles to the cloud, where the ECM parameter identification algorithm can be executed without computational limitations.The obtained parameters can then be downloaded to the BMS to improve model-based SOC estimation and used by the cloud services to execute advanced battery control algorithms, such as the OCP evaluation.Pioneering works have already started investigating the potential of the cloud computing approach for state variable and model parameter estimation.For example, machine learning and artificial intelligence are used in [16,17] to estimate SOC and SOH.The recursive least squares combined with a Kalman filter is used to estimate SOC and the parameters of a 2-RC ECM in [18].A cloud-based digital twin of the real battery is presented in [19].
The aim of this paper is the optimization of a moving window least squares (MWLS) algorithm used to identify the parameter of a 2-RC ECM that benefits from the cloud computing concept.To the best of our knowledge, this is the first application of the MWLS algorithm to the battery data acquired from an electric vehicle fleet and uploaded to the cloud.The MWLS algorithm was initially developed in [20] for ECM with just 1 RC group.Therefore, the MWLS algorithm equations are changed to include the second RC group contribution, as shown in detail in Section 2.Moreover, the upgraded algorithm is tuned with real automotive data uploaded to the Stellantis-CRF cloud by test cars, in order to identify the best algorithm parameters for this application.The tuning procedure and its results are reported in Section 3, while Section 4 shows the algorithm identification results in a wide experimental test campaign.Finally, a comparison of the obtained results with the literature is described in Section 5, and the main conclusions are summarized in Section 6.

Battery Model Parameter Identification
Each cell of the battery pack is modeled using the 2-RC ECM shown in Figure 1.
The model consists of two parts: the left-hand side tracks the cell SOC, while the righthand one estimates the cell voltage.The cell SOC is obtained as a voltage difference across a capacitor, the value of which is equal to the cell capacity Q n expressed in Coulomb and divided by 1 V.The evaluated SOC is the input signal of the controlled voltage generator V OC that implements the relationship between the open circuit voltage (OCV) and the SOC.V OC is series-connected with a resistance R 0 that models the internal ohmic resistance and two RC groups.The voltage drops generated by R 1 and C 1 and by R 2 and C 2 mimic the fast and the slow cell voltage relaxations, respectively.The state space equations of the model are reported in (1), where In general, the cell model parameters vary with the operating conditions (namely SOC and temperature) and aging of the battery.The aim is to identify the parameters inside a time window, the optimal length of which will be discussed later.Here, we just point out that the OCV-SOC relationship is linearized, while the model parameters are assumed constant inside the identification window.The latter is moved over time to track the parameter variations when the operating conditions and aging of the battery change.
The first step in deriving the identification algorithm is to transform the cell voltage V M in the Laplace domain as: in which the OCV-SOC relationship is linearized by: where α 0 and α 1 are additional linearization parameters that change with the identification window.Equation ( 2) can be rewritten in the discrete-time domain using the bilinear transform (4), thus obtaining Equation ( 5), where T is the sampling time, Y is the cell voltage, and U is the cell current.
The detailed equations of b 0 , b 1 , b 2 , b 3 , a 1 , a 2 , and a 3 are reported in Appendix A. It can be seen that the coefficients a 1 , a 2 , and a 3 only depend on τ 1 and τ 2 and that 1 + a 1 + a 2 + a 3 is equal to zero.Therefore, the coefficient a 3 can be substituted with −(1 + a 1 + a 2 ) in Equation ( 5), yielding the third-order autoregressive exogenous (ARX) model shown below.
The ARX model in Equation ( 6) is evaluated at M sampling points (k ∈ [k 0 , k 0 + M − 1], which correspond to the identification window starting at the sampling time k 0 .The M equations obtained form a linear system b = Ax, where b ∈ R M holds the M values of y(k) − y(k − 3), x is the vector of the variables [a 1 , a 2 , b 0 , b 1 , b 2 , b 3 ] T , and A ∈ R Mx6 is the coefficient matrix filled with the voltage and current values sampled at discrete times from k 0 − 3 to k 0 + M − 1.As M is chosen to be greater than 6, the system is overdetermined and is solved using the least squares method (LS).The variables a 1 , a 2 , b 0 , b 1 , b 2 , and b 3 thus obtained are used to retrieve the ECM parameters by inverting the equations in Appendix A. The identification window is shifted at each estimation step, i.e., k 0 .This approach is usually known as MWLS, and its block diagram is shown in Figure 2.

Low-pass
Filter and Decimation Matrix construction & LS solver Back substitution The MWLS accuracy depends on the time window length L w = MT [21].In fact, L w should be long enough to track the voltage dynamics of the RC groups so that R 1 , C 1 , R 2 , and C 2 are observable.A longer L w can be obtained by increasing M.However, larger values of M lead to bigger A matrices and consequently to higher computational costs of the MWLS algorithm.A good trade trade-off between complexity and accuracy has been found for M equal to 30, as shown in [15].Therefore, a sufficiently long value of L w can be obtained by increasing the sampling time T in the moving window, which is usually longer than the sampling time used in BMSs to acquire the cell voltage v cell and the battery current i bat .Thus, the inputs of the MWLS are obtained by decimating the signals acquired by the BMS.This process imposes a preventive low-pass filtering of the acquired voltage and current signals to limit their bandwidth before decimation, according to the Shannon's sampling theorem.

Tuning Procedure of the MWLS Identification Algorithm
The MWLS algorithm requires the appropriate tuning of its parameters to obtain an accurate estimation of the cell model parameters [21].L w , the low-pass filter cut-off frequency f c , and order N f are the MWLS parameters that are optimized with the tuning procedure proposed in [21], which consists of the following steps: 1.
Define a reasonable range for each MWLS parameter; 2.
Choose, for each parameter, a reasonable number of possible values in the range previously defined; 3.
Run the MWLS algorithm on the measured voltage and current of a battery cell in a test with a load current profile typical of the target application with each possible parameter value combination; 4.
Simulate the cell model with the ECM parameters identified in each MWLS execution using the same load current profile; 5.
Calculate the RMS error between the measured and simulated cell voltages for each MWLS execution; 6.
Select the best combination of L w , f c , and N f as the triplet of values that minimizes the RMS error.

Tuning of the MWLS Algorithm for an Electric Vehicle Battery
Real data from an electric vehicle with a battery composed of 108 series-connected cells with 60 Ah capacity are used to tune and validate the MWLS algorithm.The application of the previously described tuning procedure is shown in Figure 3, where the tuning test consists of the current and voltage profiles of cell #1 acquired during a test drive.As shown in Figure 4, the battery is discharged from the initial SOC value of around 90% to 13% in about 4 h, with a rest time of about 30 min when the battery SOC reaches 50%.The average discharge current, excluding the rest period, is around 13 A. Tuning test The reasonable ranges of the MWLS parameters have been obtained from both theoretical and empirical considerations.In particular, L w is upper-bounded by the assumption that the ECM parameters are considered constant within the identification window.SOC is the cause of the fastest ECM parameter variations.Limiting the SOC variation in the identification window to below 10% allows this assumption to hold with good approximation [22].Moreover, the linearization of the OCV-SOC relationship in each identification window is also a good approximation if the SOC variation is limited to 10% [20].Thus, the maximum value of L w is set to 20 min, which corresponds to a SOC variation of about 7% at the mean discharge current value.Moreover, the f c parameter should be chosen low enough to satisfy the Shannon theorem ( f c ≤ 1/(2T)), thus f c ≤ M/(2L w ), but not too low in order not to cancel out the battery voltage dynamics that are captured by the 2-RC groups.However, the ranges chosen for L w , f c , and N f are kept larger than the minimum ones because the tuning procedure is performed offline in the cloud and then its execution time is not a limiting factor.For this reason, the L w range runs from 60 to 1200 s with steps of 60 s, f c goes from 10 −4 to 1 Hz following a logarithmic scale with 25 points per decade, and the order of the low-pass N f is set to either 1 or 2.
The MWLS algorithm is executed on the cell current and voltage profiles reported in Figure 4 for each possible combination of the parameter values.The obtained ECM parameters are then used to calculate the predicted cell voltage.The RMS error between the measured and the predicted cell voltage is used to quantify the quality of the identified ECM parameters.
Figure 5a,b show the RMS errors obtained with the explored combinations of L w and f c for N f equal to 1 and 2, respectively.First, we observe that the minimum value of the RMS error is very similar in the two cases, i.e., 4.9 mV (at f min ] and L w ∈ [0.5L min w , 2L min w ]), the mean value of the RMS error is 5.4 mV and 9.7 mV for the first-and second-order filter, respectively.This aspect supports the choice of the first-order filter, as it is more robust against variation in the MWLS operating conditions, and its implementation is inherently simpler.Finally, we note that both the RMS error and the MWLS parameters obtained for the first-order filter are in line with the ones reported in [21], where a minimum RMS error of 15 mV is achieved with f min The MWLS parameters obtained from the first cell are then used to identify the model parameters of the other 107 battery cells by running the algorithm on the individual voltage and current profiles.The RMS error found for each cell model varies in a range from 4.6 to 4.9 mV.Moreover, Figure 6 shows the mean value and the span between the minimum and maximum of the model resistances as a function of the SOC for the 108 battery cells.Figure 7 shows the distribution of the identified model resistances R 0 and for all the battery cells at 50% of SOC.The resistance distributions are fitted with a normal function as suggested by the literature [23], obtaining the mean µ and standard deviation σ values.A relative coefficient of variation, k = σ/µ, is usually calculated to represent the spread of the resistance values around their mean value.The k coefficients of R 0 and R t resistances at 50% of SOC are 1.83% and 1.79%, respectively.These values are in accordance with the literature values for nickel manganese cobalt oxide (NMC) cells [24].
of all battery cells estimated by the MWLS algorithm at 50% of SOC and their fitting with a normal distribution function.

Experimental Test Campaign
The MWLS algorithm tuned according to the procedure described in the previous section is applied to 10 road test profiles, the characteristics of which are summarized in Table 1.The investigated profiles were extracted from the experimental daily data collected in the cloud during eight months of electric vehicle driving tests.The test profiles were selected to have large SOC ranges and different current profiles in order to obtain a broader validation of the algorithm.The model estimation error is calculated by comparing the real acquired voltage to the simulated one with the battery model, whose parameters are identified and tracked by the MWLS This test procedure is summarized in Figure 8. Figure 9a shows the minimum, mean, and maximum values of the RMS and MAE errors of the 108 battery cells for each test.The MAE error is calculated as the average value of the absolute difference between the model and the measured cell voltages.The mean RMS errors obtained by these tests are obviously higher than those found during the tuning procedure.Nevertheless, they are still rather low, being around 0.3% of the nominal cell voltage of 3.6 V, i.e., 11 mV.In addition, the voltage errors seem not to depend on either the driving profile or the season, nor do they increase with time, showing the ability of the MWLS algorithm to accurately track the cell model parameters.The last statement is supported by the evolution of the total cell resistance reported in Figure 9b, as tracked by the MWLS algorithm.Even if the time of operation of the test vehicle is too short to show appreciable aging of the battery, the slightly increasing trend of the total resistance visible in the figure has been caught by the parameter tracking algorithm.In particular, the total resistance goes from about 1.3 to 1.8 mΩ in about 140 cycles (1 cycle for working day in 28 weeks), showing a mean resistance increase of about 0.27% for each cycle.This value is comparable with the literature, in which a cycle SOC ranges from about 90% down to 15%, as shown in [25].Furthermore, the cell model parameters tracked by the algorithm could be loaded back to the battery, relieving the BMS of the heavy computational load due to parameter identification and allowing a more accurate local estimation of the battery state.

Test campaign
of the 108 battery cells for each test reported in Table 1.

Comparison with Literature Data
The results obtained in this work are compared with the literature data in Table 2.The table reports literature studies that address the problem of model parameter identification for different battery models applying different approaches.For example, an adaptive dual unscented Kalman filter (ADUKF) is used to develop an identification algorithm to estimate the parameters of a 1-RC ECM in [26].The algorithm is applied to the dynamic stress test (DST) and the Federal Urban Driving Schedule (FUDS), obtaining an RMS error of 10.3 mV and 9.4 mV, respectively.The forgetting factor recursive least squares (FFRLS) technique is instead adopted in [27] to design an estimation parameter algorithm for 1-RC ECM.The authors use the New European Driving Cycle (NEDC) to test the algorithm, obtaining an RMS error of 12.2 mV.Time domain parameter extraction is combined with a decoupled recursive least squares (TD-DRLS) algorithm to estimate the parameters of a 2-RC ECM model in [29].The DST and FUDS driving cycles are used to assess the TD-DRLS algorithm, achieving RMS errors of 9.1 mV and 9.7 mV, respectively.The SOC and the parameters of a 2-RC ECM with hysteresis are estimated using fixed memory recursive least squares combined with a sigma-point Kalman filter (FMRLS-SPKF) in [30].The FMRLS-SPKF algorithm is assessed using the DST and FUDS driving cycles, obtaining RMS errors of 8.7 mV and 12.7 mV, respectively.The errors reported in [26][27][28][29][30] are in line with those achieved by our algorithm.However, the load test profiles are applied in controlled environments, and the cell current and voltage are measured with laboratory instruments in the literature.Instead, the current and voltage quantities of our work are directly acquired by the real BMS of the vehicle during road driving tests with lower accuracy and higher noise.

Figure 2 .
Figure 2. Block diagram of moving window least squares approach.

Figure 3 .Figure 4 .
Figure 3. Block diagram of the tuning procedure of the MWLS algorithm.

c = 4 .
6 mHz and L min w = 240 s) and 5 mV (at f min c = 31.6mHz and L min w = 180 s) for the first-and second-order filter, respectively.However, as shown in Figure 5, the surface plot related to the first-order filter shows a larger flat zone around the minimum point compared to what happens to the second-order filter.In fact, considering an octave variation of the f c and L w before and after the minimum point coordinates (i.e., f c ∈ [0.5 f min c , 2 f min c

Figure 5 .
Figure 5. RMS error of the voltage predicted by the ECM, as a function of the identification window length L w , the cut-off frequency f c of the filter, and its order.(a) Low-pass filter order N f = 1.(b) Low-pass filter order N f = 2.

Figure 6 .
Figure 6.Values of ECM resistances identified by applying the tuned MWLS to all the battery cells.Mean value is depicted as a solid line, while minimum and maximum values are reported as vertical bars.

FrequencyFigure 7 .
Figure 7. Distribution of the resistances R 0 (a) andR t = R 0 + R 1 + R 2 (b)of all battery cells estimated by the MWLS algorithm at 50% of SOC and their fitting with a normal distribution function.

Figure 8 .
Figure 8. Block diagram of the MWLS algorithm test procedure.

Figure 9 .
Figure 9. Maximum, mean, and minimum RMS and MAE errors (a) andR t = R 0 + R 1 + R 2 (b)of the 108 battery cells for each test reported in Table 1.

Table 1 .
Tests selected from about eight months of driving tests to characterize the MWLS algorithm.

Table 2 .
Comparison of the obtained results with the literature.