An Invariant Method for Electric Vehicle Battery State-of-Charge Estimation Under Dynamic Drive Cycles

This paper proposes a novel invariant extended Kalman filter (IEKF), a modified version of the extended Kalman filter (EKF), for state-of-charge (SOC) estimation of lithium-ion (Li-ion) battery cells. Unlike conventional EKF methods where the correction term used to update the state is linearly proportional to the output error, this paper employs the IEKF where the correction term is independent of the output error, resulting in a significant reduction in the estimation error and improving the estimation accuracy. In contrast to classic method like the EKF and more contemporary ones like the square root variant of the Cubature Kalman Filter (SCKF), the IEKF can successfully mimic the nonlinear dynamics and mitigate measurement noise stochasticity. Moreover, even if the measurement model fails to fully capture the cell’s dynamics, the IEKF will still sustain a reasonable performance. Hence, IEKF outperforms the conventional EKF, and even the SCKF, which can diverge if a mismatch between the SOC measurement model and the true SOC measurement occurs. The derivation of the proposed method followed by experimental verification using commercial Li-ion battery cells are presented.


I. INTRODUCTION
The Li-ion battery market continues its rapid growth every year. According to [1], the global market of Li-ion battery reached a value of USD 34.1 billion in 2020, and is expected to reach USD 47 billion by 2023. The primary factor of this steady growth of the Li-ion battery market is the need for high-quality secondary batteries that have long servicelife, high power and energy densities, and maintenancefree nature. These unique characteristics allow this battery technology to stay ahead of other competing technologies.
Despite numerous advantages offered by Li-ion batteries, many challenges need to be addressed for high-efficiency utilization. Among these challenges is the state-of-charge The associate editor coordinating the review of this manuscript and approving it for publication was Min Wang .
(SOC) computation and tracking [2], [3]. Unlike the concept of fuel gauge in a vehicle where the amount of fuel can be easily measured and viewed on the vehicle's dashboard, the SOC of a battery cannot be measured. Nonetheless, the SOC can be estimated if certain inputs, such as battery cell's voltage, current, total capacity, and temperature, are provided. Real-time accurate estimation of the SOC is of utmost importance in many applications since Li-ion batteries, in specific, are extremely sensitive to high temperatures and over (dis)charge. A Li-ion battery may easily catch fire if it is exposed to high temperatures or if it gets over charged. Over discharge may also cause irreversible damage. To avoid such consequence, the battery management system (BMS) may set excessively conservative SOC cutoffs to protect the battery and ensure that the battery is never over (dis)charged. While this procedure protects the battery from damage and VOLUME 11, 2023 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ extends its cycle-life, it does not allow for full utilization of its capacity. If accurate SOC estimates are available, the SOC operating window can be expanded to allow for more efficient utilization of the battery's capacity. The challenge of SOC estimation has been extensively studied in the past two decades. Simple methods that employ a lookup table for the open-circuit voltage (OCV) versus SOC values or those that rely on the terminal voltage measurement may be useful for inexpensive applications or applications where the battery's dynamics are low. However, for highly dynamic applications, these methods are entirely unsuitable. Current integration or coulomb-counting offers a higherperformance method to track the SOC of a battery. The critical limitation of this method is its inevitable failure after several charge-discharge cycles due to its open-loop nature. More advanced methods that overcome the above-discussed shortcomings have been proposed since the early 2000s. These proposed methods can be classified into two main categories, namely, observer-based methods and data-based methods. In the first group, the frequently utilized observer is the extended Kalman filter (EKF) and its variants, [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], while artificial neural network (ANN) based techniques dominate the second group [16], [17], [18], [19], [20], [21], [22], [23], [24], [25]. Both EKFs and ANNs have their own advantages and disadvantages. For example, while EKFs operate in a closed-loop manner, ANNs do not. Data-driven methods in general can be robust and stable due to their massive parallel structure and can therefore provide accurate estimates if they are trained well. They demand massive data for this training, a requirement if not met will sacrifice the credibility of these methods. Consequently, data-driven methods are accurate as long as the operating conditions are similar to the training conditions, a requirement that is hard to meet in practice. Unlike data-driven methods, observer-based methods have a closed-loop structure and can always converge even when the initial state is wrong and/or when the system contains uncertainty.
EKFs, unlike Kalman filters applied to linear systems, are utilized for nonlinear systems and are not optimal. These estimators assume that the noise statistics of the process and measurements are known, which can be guaranteed only in lab settings and simulated environments with known test conditions. In addition, these estimators always assume white, Gaussian with zero-mean, noise. This assumption is unnecessarily true from a practical point of view. Moreover, EKF-based methods such as [26] and [27] are strongly dependent on the dynamic model they employ to predict the internal state of a system. Consequently, the results are only accurate if the dynamic model is accurate -a small mismatch between the actual and model measurements leads to significant estimation error and in many cases divergence. While conventional EKFs are suitable for some applications where the battery dynamics are relatively low, they are guaranteed to fail in other applications where the battery dynamics are high, such as in EVs. In EVs, the mismatch between the filter's model and the actual system's model may result from two main factors, namely, sensor inaccuracy or unmodeled dynamics. Sensor inaccuracy caused by sensor aging or failure leads to system offset or the addition of a non-white noise component. On the other hand, unmodeled dynamics include unmodeled temperature, aging dependency of the model parameters or other dynamics that the cell's model fails to capture such as those correlated with transient charge/discharge, hysteresis, and self-discharge. With an objective of addressing EKF limitations, several filtering techniques have been proposed, such as unscented Kalman filters (UKFs) [28], [29], [30] and particle filters (PFs) [31], [32], [33]. Although the UKF [28] utilizes a group of sigma points to improve the distribution probability, it is computationally more costly than the EKF. Additionally, the selection of the sigma points could complicate the UKF implementation. PFs [31] could outperform EKFs. However, PFs require higher computational cost than the standard UKF limiting their implementation to devices with high computational power [34], [35]. Moreover, the optimality measure of PFs remains unclear [34], [35]. Therefore, there is a need for a novel solution that can produce a good estimate at a low computational cost. A recently proposed invariant extended Kalman filter (IEKF) [36], [37], a modified version of the EKF, has been proven to be 1) computationally cheaper, 2) simpler in implementation, 3) able to capture system nonlinearity, and 4) characterized to produce better tracking performance in comparison with the UKF. The IEKF has been successful in several applications, for example, aerospace dynamics estimation [38], robot localization and mapping [39], autonomous submarine nonlinear model dynamics estimation [40], and feature extraction and image processing [41]. However, the use of the IEKF in battery and SOC applications is still lacking. This paper proposes a novel IEKF for estimating the SOC of Li-ion battery cells in an EV application. The proposed method considerably enhances the accuracy of the SOC estimate as verified experimentally in this paper. Unlike the conventional EKF, the IEKF mimics the system nonlinearity through propagation and measurement update steps significantly enhancing the estimation accuracy. The invariance property allows the IEKF to preserve the model geometry preventing the error from divergence. Moreover, in comparison with the EKF, the IEKF produces better tracking performance. The IEKF is presented in a discrete form to facilitate the implementation process at a low sampling rate. As shown through the experimental verification, the IEKF outperforms the EKF in the presence of a significant mismatch between the SOC model output and the true SOC measurement. The difference between the two filters becomes more apparent when the estimated state is far from the true state, where the linearization carried out by the EKF becomes invalid leading to the estimator's divergence. The proposed method is proven to provide high-accuracy SOC estimation performance despite the highly nonlinear battery dynamics. The organization of this paper is as follows: Section II presents the nonlinear dynamics of the battery cell's SOC estimation problem and gives an overview of the standard EKF in a discrete form. Section III explains the invariance property and introduces the discrete version of the IEKF. Section IV presents the effectiveness and robustness of the proposed approach through experimental validation. Finally, Section V concludes the paper.

A. NOTATION
In this paper, R and R n×m denote the set of real numbers and an n-by-m real dimensional space, respectively. Z = {0, 1, 2, . . .} denotes the set of non-negative integer numbers, and for any x t ∈ R n , the subscript t ∈ Z denotes a nonnegative integer number which defines the value of x at a sample instant t. I n ∈ R n×n denotes an n-by-n dimensional identity matrix. sign(·), diag(·), exp(·), P(·), and E[·] denote sign, diagonal, exponential, probability, and expected value of a component, respectively.

II. PROBLEM FORMULATION AND EKF
The discrete Enhanced Self Correcting (ESC) dynamics are employed to describe the behavior of the battery cell. This circuit-equivalent model, shown in Fig. 1, is one of the best models proposed to describe a dynamic battery cell [15]. It accounts for diffusion effects, describes hysteresis, and always converges to the terminal voltage under constantcurrent events. The dynamics consist of three states described through the following three state equations (1)- (3): with SOC being the State of Charge, η being the battery health factor which is usually set to 1 assuming that the battery is new, and C denoting the battery capacity in A.h. The second state equation describes the RC circuit dynamics: with i R 1 t being the current in the RC network in Fig. 1, and R 1 and C 1 being the resistance and capacitance values, respectively, describing the RC network. The hysteresis voltage is modeled by an instantaneous term s t and a state h t according to hyst = M 0 s t + Mh t . It has the following state dynamics: where γ is a component tuned in accordance with experimental data, while Note that i t and sign(i t ) denote control input signals. The measured observation is defined by where b t denotes the terminal battery voltage, OCV (SOC t ) denotes an empirical relation in terms of SOC which can either be a lookup table or an analytical function such as a polynomial, R denotes the internal resistance of the battery, and i t denotes the current input. The dynamics and measurements in Eq. (1)-(4) are nonlinear and can be summarized as follows: where x t ∈ R n stands for the current state vector, u t ∈ R m denotes the input vector, ω t ∈ R n denotes unknown Gaussian random noise with covariance matrix represents a nonlinear function which describes the evolution of the system, v t ∈ R q denotes unknown Gaussian random noise with a covariance matrix denotes a nonlinear function which describes the system measured observation, and y t ∈ R q is the system output equal to the measured observation. Mapping the nonlinear system model in Eq. (1)-(4) to Eq. (5) one finds n = 3, m = 2, and q = 1 with The extended Kalman filter (EKF), using a set of observations, evaluates in real time the estimate denoted bŷ x t =x t|t ∈ R n which represents the state estimate. For a linear system, this represents an unbiased estimate of the state. In addition, the EKF determines the accuracy measure P(x t |y 1:t ) of the estimated state, where y 1:t is the sequence of observations y 1 , y 2 , . . ., y t . The filter operates in two stages: propagation and measurement update. In the propagation stage,x t−1 =x t−1|t−1 is defined utilizing the observed y t−1 , and is propagated deterministically mimicking the nonlinearity in Eq. (5) such that Algorithm 1 EKF Implementation Steps Initialization: 1: Setx 0 ∈ R n , and the covarianceP 0 ∈ R n×n loop 2: Define F t , G t , and H t , as in (8). 3: From (5), define Q t = Cov(ω t ) and R t = Cov(v t ). /* Propagation */ 4: Let us define the error between the true and the estimated state as Hence, the covariances associated with the estimation error are defined by . The EKF operates based on the system's model linearization performed using firstorder Taylor series expansion of the nonlinear functions f (·, ·, ·) and h(·, ·, ·) described in (5) where where , and the high order terms have been disregarded, visit [42]. P t−1 is propagated using the linearized system's error dynamics in (8) as: In the measurement update stage, an innovation component is defined as z t = y t − h(x t|t−1 ). The measurement and covariance updates are defined by: Algorithm 1 summarizes the implementation steps of the EKF.

B. OVERVIEW OF CUBATURE KALMAN FILTER (SCKF)
In addition to the EKF presented in the previous section, one more version of the Kalman Filter is presented. Namely, the more recent SCKF [43] for its use of cubature pointsbased sampling which approximated the nonlinear propagation associated with the battery measurement model. The details behind the SCKF are omitted for brevity. However, Algorithm 2 SCKF Implementation Steps Initialization:

III. DYNAMICS REFORMULATION AND IEKF
Let us recall the nonlinear dynamics in (5) where The fact that the above equation (12) follows Gaussian process allows to reformulate the state equation in Gaussian process terms as follows [34], [35], [44], [45]: where F(·, ·) : R n × R m → R n is a nonlinear function which expresses the evolution of the system, ψ ∼ N (0, Q), ψ ∈ R n denotes unknown Gaussian random noise, and the output equation can be reformulated as follows: where µ ∼ N (0, R), µ ∈ R q denotes unknown Gaussian random noise, H(·, ·) : R n ×R m → R q is a nonlinear function which describes the system measured observation, and y t ∈ R q refers to the system output which is equal to the measured observation. µ, ψ satisfy Remark 1 (EquivalencyofExpectation [34], [35], [44]): From (13), (14), and (15), it becomes apparent that (H(x t , u t ))) diag(µ t ))] | t=1:N = I q which leaves the system dynamics unaffected in the absence of noise. Thereby, one has Accordingly, in view of (13), (14), (15), and Remark 1, the nonlinear dynamics in (5) can be reformulated and summarized as follows:

A. IEKF DERIVATION FOR DISCRETE SYSTEMS
The widely used IEKF is modeled on the Lie Group and has been proposed in a geometric matrix form [37]. However, the IEKF [37] framework has not been presented for linear or nonlinear systems in a vector form. Unlike EKF, the IEKF presented in this Section mimics the system dynamics presented in (17). Analogous to EKF, IEKF consists of two stages, namely propagation and measurement update. Note that for the deterministic part of (5) and (13) one has Hence, the IEKF propagates a priori state estimate utilizing the deterministic part of (13) such that The error in estimation is defined by Thereby, the covariances associated with the error in (19) are given by . Similar to (8), using first-order Taylor series expansion of the nonlinear functions f (·, ·, ·) and h(·, ·, ·) described in (5), one finds where , and the high order terms have been overlooked. P t−1 is propagated as follows: The a priori state estimate in (18) mimics the deterministic part of the true nonlinear dynamics in (5). To accommodate for the noise in (13) and mimic the nonlinear dynamics in (13), let us define z t = y t − h(x t|t−1 ) and obtain the a posteriori state estimate as follows: Note that the addition of K t z t compensate for uncertainties introduced by measurement uncertainities. The covariance update is defined by Algorithm 3 summarizes the implementation steps of the IEKF.

IV. EXPERIMENTAL RESULTS
The proposed approach is experimentally evaluated in this section using a publicly available drive cycle dataset [46]. The dataset describes a 2.9 Ah Panasonic cell (18650PF) undergoing tests that include US06, HWFET, UDDS, and LA92 drive cycles. Additionally, 4 synthetic cycles composed of random mixtures of US06, HWFET, UDDS, LA92, and VOLUME 11, 2023  ANN drive cycles are available in the dataset. The ANN drive cycle is a combination of portions of US06 and LA92 drive cycles, and it is designed to represent more aggressive dynamics to properly verify the accuracy of the SOC estimation algorithms. For all the tests, the battery cell is placed in an 8ft 3 thermal chamber with a 25A, 18V Digatron Firing Circuits Universal Battery Tester channel. It is worth noting that the power profile of the drive cycle is calculated for an electric Ford F150 truck with a 35 kWh battery pack scaled for a single cell. These nine drive cycle tests are intended to emulate a highly dynamic application environment that serves to thoroughly investigate the performance of the adopted algorithm. Two test cases are investigated in this section. The effect of varying the initial conditions on the performance of the filters is investigated in the first test case. For a single drive cycle, the filters are fed different initial conditions to observe the capacity of each algorithm to recover and converge to the true SOC. In the second test case, the filters are fed experimental data pertaining to nine drive cycles to quantitatively describe and evaluate the performance of the proposed IEKF compared to the more traditional EKF.

A. TEST CASE 1: EFFECT OF INITIAL CONDITIONS ON ESTIMATION ACCURACY
The initial SOC in a battery cell is not always known accurately. A good estimation algorithm should be able to recover from bad initialization and not ''lock out'' or prioritize the dynamics model prediction over the measurement and vice versa. Here, the ability of the proposed IEKF to recover from bad initialization and estimate the SOC of a battery cell is compared against the traditional EKF. The algorithms are evaluated under an array of initial conditions for the SOC; the filters are run once with correct state initialization and four times with erroneous initialization. The test uses the US06 drive cycle dataset. The initial state and initial covariance are set according to Table 1 in all the test cases. Additionally, noise covariance magnitudes of Q = diag( 1 × 10 −12 1 × 10 −3 1 × 10 −3 ) and R = 1 × 10 −3 are used in all the tests. Fig. 2 presents the experimental results of the US06 drive cycle for all the tested cases for both the EKF, the SCKF, and the IEKF. The proposed IEKF is evidently very capable at estimating the SOC of a battery cell even when the initial conditions are incorrectly initialized. In every test shown, the IEKF shows the best SOC estimation performance followed by the SCKF and finally the traditional EKF. This order is not surprising as the battery measurements model is very nonlinear. Hence, the IEKF and the SCKF should outperform the EKF as they are shown to approximate or mimic the nonlinear model much better. It is noteworthy to mention that the quality of the SOC estimate depends on the chosen initial covarianceP 0 corresponding to the certainty of the initial condition being tested. The initial covariance has to be set properly.
As shown in [36] and [37], the IEKF is immune to the losses in linearization associated with the classical EKF. This leads to the decrease in estimation error with time in the IEKF case, while it might lead to divergence of the EKF. It is evident the nonlinear structure of the IEKF is proving advantageous to the SOC estimation problem due to the nonlinearities present in the system.

B. TEST CASE 2: DRIVE CYCLE PERFORMANCE
Not only is a good estimator able to recover from bad initialization, but it should also perform well in different conditions and environments. The proposed IEKF is further evaluated here on a total of 9 drive cycles that serve to emulate a wide array of possible conditions an EV battery pack can experience. In Fig. 3, the experimental performance of the EKF and the IEKF is shown for two initial conditions similar to Test Case 1 in section IV-A. That is, SOC 0 = 1 and SOC 0 = 0.75. Only two cases are shown in Fig. 3 for brevity and clarity of the figure. However, the performance of both filters has been evacuated for all the test cases and drive cycles and is shown in this section in a tabular format. The use of a high fidelity dynamic model that is able to capture the dynamics of the battery cell well leads to good performance of both filters even in the presence of incorrect initialization. Nonetheless, the IEKF reportedly performs better than the EKF on the long run across all the tests even though the EKF is sometimes initially quicker to approach the true SOC. The IEKF also seems to result in less MAE spread across all the tests when compared with the EKF. On average, the EKF achieved MAE values ranging between 2.61% and 12.87% throughout the tested scenarios. The IEKF, on the other hand, outperformed the EKF achieving MAE values ranging between 0.70% and 0.79%. An identical trend is also noticed looking at the RMSE values, which is a measure that penalizes larger deviations from the true SOC state. Table 2 summarizes the MAE results calculated from the responses in Fig. 3, and Table 3 summarizes the RMSE results calculated from the responses in Fig. 3. Also, Fig. 4 presents a graphical representation of the data in Table 2. It is obvious that the IEKF consistently outperforms 8670 VOLUME 11, 2023   the traditional EKF in all the tested scenarios. The better performance of IEKF is not surprising as it does not rely on linearizing dynamics of the battery cell model. Instead, it makes use of the nonlinear dynamics directly in propagating the predicted a priori state to realize the updated a posteriori estimate. The high nonlinearity involved in the battery cell model does benefit immensely from this new tool, which does not loose accuracy due to lineralization like the EKF.
One final note to consider is that it is common practice to significantly inflate the noise covariance magnitudes when applying the EKF [36], [37] in a highly nonlinear setting. This is sometimes referred to as robust tuning. While this works from a practical point of view, it does present detrimental consequences on the interpretation of the state covariance P as it will no longer be deemed accurate. The physical interpretation of these matrices will be lost with robust tuning. Use of the IEKF will preserve the physical meaning behind these matrices.

V. CONCLUSION
In this paper, a novel IEKF has been proposed to address the nonlinear battery cell SOC estimation problem. The IEKF is characterized by an invariance property which allows the filter to preserve geometry preventing error divergence. The filter has been shown to mimic the nonlinear system dynamics in terms of propagation and measurement update.
The IEKF was tested using a publicly available realworld EV dataset scaled to suit a 18650PF 2.9 Ah Panasonic cell. The cell dynamics were described using the Enhanced Self Correcting three-state model that accounts for both hysteresis as well as diffusion effects. Extensive experimental verification of the algorithm established its superiority over the traditional EKF approach, especially when the initial conditions fed to the algorithm are incorrect. Fig. 5 shows a simplified block diagram that demonstrates the implementation of the proposed SOC estimation method in a battery charging system as an example. A buck converter is used to regulate the charging power of the battery. The terminal current and voltage of the battery at instant k (i k and v k ) are sensed and converted to digital signals using analog-to-digital conversion (ADC) units. The proposed IEKF algorithm uses these measurements to update the SOC, and based on the estimated SOC value, a signal (f k ) is generated to control the pulse-width-modulation (PWM) unit, which in turns generates the proper duty cycle (d k ) that allows the converter to deliver the proper charging power that meets the battery charging requirements.