Adaptive Piecewise Equivalent Circuit Model With SOC/SOH Estimation Based on Extended Kalman Filter

Battery modelling plays a critical role in battery management tasks. A model that provides accurate estimations of state of charge and state of heath in varying operating conditions could significantly improve the performance of battery management systems. Departing from existing literature, this paper presents a self-adaptive Piecewise Equivalent Circuit Model (PECM) based on Extended Kalman Filter (EKF). While traditional Equivalent Circuit Models (ECM) are typically parameterized and validated for a specific range of working conditions (temperature, current and etc.), PECM is able to adapt itself to any working condition in real time. Established in the form of a combination of linear and nonlinear piecewise functions, the model parameters are continuously adjusted based on the measurement of voltage, current, and temperature. Another advantage of PECM is it does not require any prior tests in the lab, for example the Open Circuit Voltage (OCV) test which is time consuming and needs to be calibrated when aged. PECM is accurate, flexible and efficient. It has been validated for different battery chemistries, duty cycles, and temperatures. Furthermore, PECM comes with the State of Charge (SOC) and State of Health (SOH) estimation, which is shown in the model validation process and the degradation study. The results demonstrate that the piecewise parameter adaptation proposed in this paper can be applied to a range of different battery chemistries and at different aged states.

Index Terms-Self-adaptive battery modelling, online parameter estimation, SOC/SOH estimation. B ATTERY technologies have been developing at a remarkable pace over recent years, driven by the global demand for energy storage systems. The past decade has seen an unprecedented increase of applications, e.g. electric vehicles (EVs). Over the course of many years, various electricity sources have been developed to provide power to EVs, such as Lead Acid batteries, hydrogen fuel cells, Lithium-ion batteries, Molten Salt, Nickel Metal Hydride, and Lithium Sulfur batteries [1]. Li-ion batteries have become one of the most widely used energy storage systems due to their high energy density and long cycle life. Li-ion batteries have achieved significant performance improvements and cost reductions thanks to the development of EVs [2], [3].

NOMENCLATURE
An effective and dependable Battery Management System (BMS) plays a vital role in a battery's operation. To derive the maximum capability from a Li-ion battery whilst maintaining safety and durability, a robust BMS is indispensable to the battery system. Battery management systems usually have multiple tasks such as battery state monitoring, charge/discharge regulation, cell balancing, fault diagnosis, and thermal control [4]. Some of the tasks can be achieved using model-based algorithms for example the SOC/SOH estimation. Recently, there has been some effort in researching and developing cloud-based smart BMS that boosts its computational capacity and data storage [5]. However, it is still a challenging task to develop a simple and accurate model that can be used in any working conditions.

A. Review of Battery Models
Existing battery models can be broadly classified into three categories: data-driven models, electrochemical models, and electrical models. A comparative study on the three different modelling approaches are conducted by Liang et al. [6]. Datadriven models are typically black-box models, such as neural network models. They can be used to predict system level behaviours thanks to their strong nonlinear mapping capabilities. Kang et al. developed a battery model based on Radial Basis Function Neural Networks, which improves the accuracy of SOC estimation in the process of aging [7]; a big-data based temperature-dependent battery model is developed by Li et al. using deep learning algorithms [8]. Despite the significant progress in these mathematical models, they come with a range of drawbacks such as the lack of interpretability and heavy dependence on data quality.
Whilst black-box models are mainly concerned with a battery's voltage and current response, physics based electrochemical models simulate the reactions and particle movement within a cell. The models are typically described by a system of coupled time-variant partial differential equations. Solving the equations can be computationally intractable for real-time applications. A reduced order electrochemical model was established by Xia et al. using numerical techniques such as orthogonal decomposition and discrete empirical interpolation [9]. Using a variety of numerical techniques, electrochemical models have been significantly improved with minimal sacrifice of precision and physical interpretation. These models, however, cannot be scaled up to the super-cell (a string of parallel connected cells), module or pack level, hence not suitable for automotive or aerospace applications.
The aforementioned two types of battery model represent the end points of a spectrum. A scheme in between is electrical models that approximate internal battery dynamics based on equivalent circuits. There are a variety of equivalent circuit models (ECMs), such as internal resistance models, hysteresis models, Randles' models, and resistor-capacitor (RC) network models [10]. In one of the most basic forms, a first-order RC model consists of an open circuit voltage (OCV), a series resistor and a parallel RC network. These components are nonlinearly dependent on SOC, temperature, and current. In traditional ECMs, a number of 2D or 3D lookup tables are used to store the estimated parameters under each working condition, as presented in [11]. The construction of the lookup tables requires extensive battery testing in the lab such as the OCV test and pulse power test. Alternatively, in Chen's model [12], these electrical components are parameterized by a combination of exponential functions and polynomial functions with respect to SOC. These functions of SOC lead to more parameters to be estimated and more data required.

B. Review of Parameter Estimation
The parameters of ECMs can be affected by a number of factors such as temperature, degradation, duty cycle and etc. The model parameterization and validation process requires a large amount of test data that cover a range of working conditions. However, it is unrealistic to cover all the working conditions in the lab. Therefore, it is beneficial for the model to be generic, flexible and self-adaptive such that the parameters can be constantly updated using onboard data.
The existing methods for parameter estimation can be divided into three categories: experiment-based analysis, electrochemical impedance spectroscopy (EIS), and data-based analysis. In experiment-based methods, the battery's dynamics can be exposed by charge/discharge tests. For example, transient voltage responses to constant or pulse currents can be used to estimate the internal resistance and RC-based time constants [13]. Alternatively, in EIS-based methods, the resistance and RC parameters can be extracted from the impedance [14]. The two methods are not suitable for real-time applications due to the need of offline tests and additional diagnostic equipment. In contrast, data-based methods seek to determine the unknown parameters using the onboard current/voltage measurement from a system identification perspective.
To realise online parameter estimation, a number of approaches can be exploited, for example, Recursive Least Squares (RLS) and Kalman Filter (KF). G.L. Plett has reviewed the extended Kalman filter methods for battery modelling, identification, and state estimation [15], [16], [17]. In a more recent study, Peng et al. have proposed an improved SOC estimation method based on Thevenin model and cubature Kalman filter [18]. Guo et al. presented a parameter estimation approach based on Least Square Method and Kalman Filter [19]. A recursive least squares method with fuzzy adaptive forgetting factor is used to estimate parameters by Li et al. [20]. The least square method was also studied by Liu for parameter estimation combined with the extended fractional Kalman filter for SOC estimation [21]. In this work, EKF is used for the estimation of parameters. The use of EKF for parameter tracking and identification is not in itself novel, but the efficient application here in tandem with a piecewise linear model structure enables easily interpreted parameters of a nonlinear model, so it has strong advantages.

C. Contribution of the Paper
In this paper, an adaptive Piecewise Equivalent Circuit Model(PECM) based on Kalman filter is proposed. Unlike traditional ECMs that are parameterised using lookup tables, PECM is parameterised in the form of a combination of piecewise polynomial functions with respect to SOC. The proposed model is generic and flexible; the choice of polynomials can be adjusted for different battery chemistries or working conditions. The coefficients of the polynomials are continuously updated based on EKF and voltage-current data, therefore no prior tests are needed. The model has been validated against online and offline test data. A comprehensive experimental study has been carried out on three types of Li-ion cells (NCA, LFP, LTO), using two different duty cycles (WLTP, DST), and within a wide range of temperatures from −20 • C to 40 • C. The model can also be used to estimate SOC and SOH, and it has been verified against degradation test data.

II. MODEL DESCRIPTION
The proposed electro-thermal battery model PECM is composed of an equivalent circuit model and a lumped thermal model, interacting in a one-way coupling manner, as depicted in Fig. 1. The estimation of thermal parameters is based on the temperature measurement and estimated heat generation, but the estimation of electrical parameters is only based on the voltage measurement. The proposed model has minimal complexity by getting rid of explicit temperature dependence of the ECM parameters; the parameters are automatically adjusted by Kalman filter at different temperatures. Each sub-model is coupled with an Identifying Extended Kalman Filter (IEKF). In the Dual EKF setup, two IEKFs are used to estimate the electrical and thermal parameters separately. Piecewise polynomial functions are used to capture the nonlinear relationships between parameters and SOC. The entire SOC range (0-100%) is divided into sections; in each section, the parameters are defined by either a first order or second order function with respect to SOC.

A. Equivalent Circuit Model
In this work, a Thevenin-based ECM is used to capture the voltage response. As depicted in Fig. 2, it is comprised of a voltage source (OCV), a series resistor, and a RC network. A first order RC model has a good balance between complexity and accuracy. The voltage output of the model can potentially achieve a high level of accuracy. The model is represented as state-space model, which has two state variables. One state variable is the voltage across the RC network V RCV where I Batt is the input of the model, the total current load. The other is SOC, which is modelled by the coulomb counting methodṠ where η is the coulombic efficiency, and Q is the capacity. The output of the model is the the terminal voltage V Batt Thus, there are four time-variant parameters to be estimated, i.e. the open circuit voltage V OC , the series resistor R srs , R 1 and C 1 . The parameters' SOC dependencies are normally nonlinear functions of SOC. For most of the time during a charge/discharge cycle, the parameters are in a linear relationship with SOC, whilst at low SOC this relationship becomes nonlinear. A piecewise structure is used to simplify the model and its parameterization. Specifically, SOC is divided into "linear" and "nonlinear" sections; in the "linear" sections, the parameters are defined by first order polynomial (linear) functions of SOC, while in the "nonlinear" sections the parameters are defined by second order polynomial functions of SOC. The variation in ECM parameters as a function of SOC agrees with trends observed in other studies, e.g. [12]. For Li-ion batteries, nonlinear SOC dependency typically can be seen below 20% SOC. The SOC breakpoints can be different for different battery chemistries. For example, V OC can be adjusted according to the actual OCV-SOC curve. For SOC above the breakpoint SOC b , the parameters are represented by linear functions of SOC where P ar is a vector of the parameters For SOC below the breakpoint SOC b , SOC dependencies are modelled as second order polynomials To keep the piecewise functions continuous and smooth at the SOC breakpoint, the parameter vector B and C should satisfy Thus, (7) can be rewritten as Therefore, the only parameter that needs to be identified for the quadratic functions is the matrix A.

B. Lumped Thermal Model
Temperature can significantly affect a battery's performance and reliability. In a large battery pack, however, it is difficult to obtain the temperature of each individual cell. In view of this, a lumped thermal model is combined with the ECM to provide the temperature estimation. Assuming longitudinal homogeneity, a single-state thermal model can be used to capture a cell's temperature dynamics. The governing equation is derived based on heat generation inside the battery and heat transfer between the battery to the environment [22] where T s is the cell surface temperature and T f is the ambient temperature. We assume the heat capacity C s and convection resistance R u are constant. The heat Q gen is generated by the chemical reactions taking place in the electrode assembly. The entropic contribution caused by phase change in the active material is relatively small, so it is not considered in this work. Heat generation can therefore be estimated as [22] Q The ECM and the lumped thermal model interact in a one-way coupling manner. Whilst the ECM provides the input of the thermal model, i.e. the estimated heat generation, but output of the thermal model, i.e. the estimated temperature, does not have any impact on the ECM. That is to say there is no explicit temperature dependency of the model. However, the variation of the ECM parameters could reflect how the model adapts itself to different temperatures. This is effectively a partial decoupling of the sub-models, from which the model can benefit from improved stability and efficiency.

C. Identifying EKF
Extended Kalman Filter (EKF) is a standard state estimation approach that operates on nonlinear systems and sensors. It can be used to estimate system states x and parameters θ that are subject to imperfect models and/or sensorṡ where ω represents state propagation and modelling error, and ν represents the output error which in this case is assumed uncorrelated with ω. An optimal filter, i.e. EKF, can be derived using estimates or expectations of the error covariance matrices: The EKF performs linearizations of the model f and h at every time step, by evaluating Jacobian matrices Taking advantage of the fact that f and h are general nonlinear functions of x and θ, the IEKF defines an extended state vector z with extended state derivatives set zero for the parameterṡ A time-varying estimate of state error covariance P k and Kalman gain K k is then obtained by recursively computing the following sequence of equations at each time step of the recorded time histories where T is the time step of Euler integration. The state and parameter estimation is driven by the output error, i.e. the innovation sequence (y k − h k ). For further details of the full EKF, please refer to [23].
In the study, two EKFs are used to estimate the parameters of the equivalent circuit model and the thermal model separately. The EKF implementation is slightly different for the two models. For the equivalent circuit model, the extended state vector consists of the voltage cross the RC network, SOC, and the parameters to be estimated Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply.

TABLE I TECHNICAL SPECIFICATION OF EACH CELL USED IN THE TEST
The input u is the total current, the output y is the terminal voltage given by (3). For the thermal model, the state vector is comprised of the cell surface temperature and the parameters to be estimated The input u is the heat generation given by (12), the output y is the cell temperature.

III. EXPERIMENTAL STUDY
The proposed model PECM has been validated against various working conditions, with different duty cycles at different temperatures. The experiment setup is shown in Fig. 1. The Keithley 2461 source meter unit (SMU) is used to measure cell voltage, and provide current to the cell according to the specific duty cycle. A thermocouple data logger is used to measure the environment temperature and the cell's surface temperature. K-type thermocouples with a 0.3 mm diameter head were connected to the cells surface using Kapton tape at two separate locations. The model is validated against three different types of Li-ion cells: a 3.0Ah Sony VTC6 18650 cell, a 1.1Ah A123 18650 cell, and a 1.3Ah GWL 1865-13 cell with a Li 4 Ti 5 O 12 (LTO) negative electrode. The technical specification of each cell is provided in Table I.
Brand new cells need to go through formation cycles before they can be tested. Battery formation is the process of performing initial charge/discharge operation on the cell until its capacity is stabilised. During this stage, solid electrolyte interphase (SEI) will be formed on the electrodes, mainly the anode. After the formation cycles, the cells are tested with two different current load profiles extracted from Worldwide Harmonised Light Vehicle Test Procedure (WLTP) and Dynamic Stress Test (DST) respectively. WLTP is a homologation procedure for light duty vehicles, used to determine the official range of fully electric vehicles. It covers a wide range of speed, drive power, and driving conditions (urban, suburban, main road, highway). In contrast, DST is a simplified variable power discharge cycle that uses a 360-second sequence of power steps with 7 discrete levels. In this work, the WLTP cycle is used to represent normal driving behaviour, however the proposed methodology can identify battery parameters online for any driving input.

A. Parameterisation and Validation
Since the model parameters can be affected by temperature, the cells have been tested at different temperatures to investigate how parameters vary with temperature. The dynamic load on the cell level is extracted from the WLTP power profile, as   Fig. 3. The power profile is converted to current profile according to the terminal voltage, and then passed to the SMU. Positive power is due to regenerative braking, which will be cut off below 0 • C to avoid lithium plating on cells utilising graphite negative electrodes. In this section, the NCA cell is tested for the study of parameter variation. Among all the electrical parameters, the open circuit voltage V oc is the most important one that will significantly affect the model's accuracy. The SOC breakpoints should be carefully chosen and tuned for different types of cells. Particularly, for the NCA cell, the  Fig. 4.
In the environment chamber, the ambient temperature is kept constant. the fully charged cells are discharged using the given load profile until the cut-off voltage is reached. The cell's terminal voltage and surface temperature are sampled at 10 Hz. The model's parameters are then estimated based on the test data. The result in Fig. 5 shows that the model fits the measurement well in a wide range of temperature; both the ECM and the thermal model are able to capture the voltage and temperature responses accurately. The piecewise functions provide not only a high degree of accuracy for linear and nonlinear SOC sections, but also a strong self-adaptability to varying temperatures. The model switches between linear and nonlinear sections based on instantaneous SOC. Since the model will be operating within the linear section most of the time, the proposed model can be highly efficient and hence suitable for real-time applications.
Parameter estimation is conducted in an iterative way, by 'rinsing' the data repeatedly through EKF, until a low bias and a low variance have been achieved. Starting with an initial, nominal parameter set, EKF requires covariance estimates here, Q = ρI, where ρ is a fixed tuning parameter that controls the variation rate of the parameters; in this study, it is set to 1 × 10 −8 . For any given estimate of the parameter setθ, R can be obtained numerically by calculating the covariance of the output error ν; here R is updated after each iteration. Finally, P 0 = Q. The accuracy of the model is quantified by percentage explanation of any model time historyŷ estimating measurement y: In this study, the stopping criteria for the iterative identification process is a 99% explanation with the variance of error lower than 1 × 10 −3 .
In this case the parameters converged after 100 iterations, and the estimated parameters are plotted as functions of SOC in Fig. 6. The capacitor C is set to 1000F . As the time constant of the parallel resistor capacitor is 1/RC, using a fixed capacitance prevents overfitting whilst allowing the dynamic response to be controlled. The resistors R and R srs are represented by a linear function for SOC above 20% and a quadratic function for SOC below 20%. It is assumed that they have similar nonlinearities with respect to SOC dependency at different temperatures; they remain relatively constant between 100% and 20% SOC, but increase dramatically when SOC drops below 20%.
One advantage of the parameter estimation process is that it doesn't require any prior characterisation test in the lab, such as the OCV test. The Kalman filter will find the optimal parameters as long as a reasonable initial guess is provided. Additionally, it provides useful insight into physically-relevant parameter variations. The estimated internal resistance turns out to be higher at the beginning and end of discharge. This characteristic is in good agreement with other studies on SOC dependency of internal resistance in the literature [24]. This can be understood from the perspective of polarisation; activation polarisation dominates at the beginning of discharge, and concentration polarization becomes dominant at the latter stages of discharge [25]. Additionally, a significant increase in the resistance can be seen as ambient temperature decreases, especially below 0 • C. This is due to reduced rate of reaction that is caused by higher electrolyte viscosity, higher electrodes surface impedance, and lower lithium diffusivity [26].
In terms of the OCV-SOC relationship at different temperatures, they are nearly identical when the cell is operating within a normal temperature range, i.e. 0 • C-40 • C. As can be seen from Fig. 6, the identified parameter V oc is in line with the actual OCV-SOC profiles as shown in Fig. 4. The thermal parameters are illustrated in the bottom plots. The convection resistance R u changes with temperature, subject to the fluid properties, viscosity, density, etc. The heat capacity C s is a physical property of matter that varies very little with temperature. It can be seen that the estimated heat capacity remains within a narrow range around 49 J/K. To validate the model, a different experimental data set is needed. Therefore, Dynamic Stress Testing (DST) is considered here for the models' validation. DST is an alternative variable power discharge regime, which can be scaled to a percentage of the maximum rated power. It requires higher levels of discharge and regeneration power than WLTP. Since batteries have different maximum charge/discharge current, a modified DST current load profile, as shown in Fig. 7, is used for the test. Fig. 8 compares the NCA battery model identified earlier with experimental results from DST. It can be seen that the models' predictions at all temperatures are in good agreement with the new data. The errors and explanations of both the electrical and thermal model's output are depicted in Fig. 9, which shows minimal model errors and a high percentage explanation has been achieved.

B. Real-Time Capability
The proposed battery model in conjunction with EKF can be used to continuously monitor the model parameters and the battery's state in real time. The real-time implementation has a very high computational efficiency in terms of the computing  power and memory required for a real-time application. While the cell's voltage and temperature are measured every 0.1 s, EKF provides an estimation of the parameters based on the newly obtained measurement during each sampling interval. The online parameter estimation is tested on a Windows 10 laptop PC equipped with a Core i7 2.2 GHz processor. A 20-minute real-time model identification test using WLTP cycle is conducted on the A123 LFP cell from 90% SOC at 20 • C. The identification result is shown in Fig. 10. Starting with a nominal parameter set, EKF adapts the parameters toward the correct model. Fig. 10 shows that at the beginning of the identification, the model converges gradually, driven by the estimation error; after about three minutes, the model closely fits the data with a near 100% explanation. The identification process exhibits strong real-time capability as every single estimation typically takes less than 50 μs.
Further validation of the online identification process has been carried out on the two types of Li-ion cells, LFP and LTO, using the WLTP load profile. Based on the prior knowledge of Voc-SOC profile plotted in Fig. 4 Fig. 11. It can be seen that the online model achieves a comparable level of accuracy to the offline model. Whilst the batteries' thermal characteristics are quite similar, their voltage variation are markedly different. The voltage of the LFP cell drops dramatically during the first and last 5% of a discharge cycle, while it is flat in between due to the single phase transition from LiFePO 4 to FePO 4 in the positive electrode. The LTO battery, by contrast, has a more linear voltage variations across the full range of SOC. This is consistent with its actual Voc-SOC profiles. In terms of performance at lower temperatures, the LTO battery has the most significant capacity loss compared to the NCA and LFP cell; as indicated by the length of the discharge cycle, it loses over 60% of the capacity at 0 • C and over 80% at −20 • C.

C. SOC and SOH Estimation
The proposed battery model enables the joint estimation of SOC and SOH, by including them in the extended state vector in 16. The estimation results at various temperatures are depicted in Fig. 12, which shows the effectiveness of the joint estimation. The reference SOC and capacity are predetermined by the coulomb counting method; the estimation is achieved via the identification process. Subject to the nonlinear relationships between SOC and electrical parameters, the convergence of SOC and capacity is driven by the difference between the estimated and measured voltage. In the process of parameter estimation, the estimated SOC converges to the right level, so as to achieve the prescribed breakpoints exactly when the shift of output dynamics occurs. Furthermore, the estimation of SOC is dependent on the usable capacity, which in turn affects the actual timing of breakpoints. Therefore, with the SOC breakpoints tuned offline for different types of cell and assumed invariant in different operating conditions, the capacity can be identified based on the voltage measurement. To achieve an accurate estimation of capacity, the data need to cover as many nonlinear sections as possible. It is also worth noting that a sensible initial guess of SOC is required for the joint estimation. For electric vehicles that are plugged in regularly, an initial condition of SOC can be determined at the point of charge or discharge to the voltage limit. For hybrid vehicles that are not plugged in, however, an additional method would be needed to periodically check the SOC estimation. Such an application is beyond the scope of this work.
The maximum amount of electrical charge that a battery can store and deliver decreases over time, which is the result of various degradation mechanisms, such as chemical side reactions or loss of conductivity [27]. Therefore, state of health (SOH) monitoring is critical for safe and efficient operation of a battery. One of the most commonly used SOH indicators is the capacity, which can be estimated through the online parameter estimation process. Based on the test cases that have been discussed above, the usable capacity is estimated along with the other parameters, for different cells at different temperatures as shown in Fig. 13. In the figure, the capacity is expressed as a percentage of the nominal capacity, which is obtained from the conditioning cycles. It shows that LTO has the most significant capacity loss as temperature drops, while NCA has the best performance at low temperatures, particularly at −20 • C. As the capacity is accurately identified by the model, the health condition of a cell can be monitored in real time.
To further verify the method's effectiveness in terms of state of health monitoring, the SOH estimation algorithm is tested with a fast degradation test on Sony VTC6 cells. In the degradation test brand new cells are cycled at 1 C and 50 • C until 20% capacity loss is achieved. The capacity was recorded every 20 charge/discharge cycles, and the results are presented in Fig. 14. The estimation appears to be very accurate with the error being less than 2%. Moreover, it provides insight into the degradation rate in different stages of the aging process. Specifically, for the NCA cell, it degrades faster when new, and the aging rate decreases over the duration of the test.

IV. CONCLUSION
In this paper, we have presented the adaptive Piecewise Equivalent Circuit Model (PECM) and a demonstration of SOC/SOH estimation using the model. The model is able to adapt itself to any working condition in real time, with parameter updated continuously using EKF. The model proves to be in good agreement with the test data at the model training stage, and able to provide accurate predictions of voltage and temperature when tested against validation data. In all test cases, the model achieves an explanation value above 95%. The proposed model and identification process were found to be highly computationally efficient, without any requirement of prior test in the lab. Moreover, the model comes with a joint estimation of SOC and capacity, which enables an online state of health monitoring system using this model. The estimation of SOC and capacity were found to be highly accurate. High quality results were seen over a range of validation tests. Although the current work has demonstrated the efficacy of a piecewise equivalent circuit model for real-time battery identification, future work could compare the performance of this approach with alternative identification methods to quantify the benefits of various approaches for a range of potential applications.