Reliable and Robust Observer for Simultaneously Estimating State-of-Charge and State-of-Health of LiFePO4 Batteries

: Batteries are everywhere, in all forms of transportation, electronics, and constitute a method to store clean energy. Among the diverse types available, the lithium-iron-phosphate (LiFePO 4 ) battery stands out for its common usage in many applications. For the battery’s safe operation, the state of charge (SOC) and state of health (SOH) estimations are essential. Therefore, a reliable and robust observer is proposed in this paper which could estimate the SOC and SOH of LiFePO 4 batteries simultaneously with high accuracy rates. For this purpose, a battery model was developed by establishing an equivalent-circuit model with the ambient temperature and the current as inputs, while the measured output was adopted to be the voltage where current and terminal voltage sensors are utilized. Another vital contribution is formulating a comprehensive model that combines three parts: a thermal model, an electrical model, and an aging model. To ensure high accuracy rates of the proposed observer, we adopt the use of the dual extend Kalman ﬁlter (DEKF) for the SOC and SOH estimation of LiFePO4 batteries. To test the effectiveness of the proposed observer, various simulations and test cases were performed where the construction of the battery system and the simulation were done using MATLAB. The ﬁndings conﬁrm that the best observer was a voltage-temperature (VT) observer, which could observe SOC accurately with great robustness, while an open-loop observer was used to observe the SOH. Furthermore, the robustness of the designed observer was proved by simulating ill-conditions that involve wrong initial estimates and wrong model parameters. The results demonstrate the reliability and robustness of the proposed observer for simultaneously estimating the SOC and SOH of LiFePO4 batteries.


Introduction
Monitoring battery operation and measuring battery aging in real life have been a challenging goal that includes a number of complex processes under complicated operating conditions.The state of charge (SOC) and state of health (SOH) of the lithium-ironphosphate (LiFePO 4 ) battery must be estimated with an accurate method [1,2].In addition, batteries work under variable aging and thermal conditions.Therefore, a battery observation system to monitor the aging and the operation needs to be built.This is a multi-control problem that needs to be expressed via mathematical equations and a combined thermal model, electrical model, and an aging model.
It is difficult to predict the behavior of batteries because of their non-linearity.Also, many attempts have been conducted to estimate and model the system's inner state [3][4][5].Recently, battery modeling has been introduced using many approaches to achieve accurate SOC estimation [6].The model introduced in [7] took into consideration the robustness, accuracy, and low-cost hardware requirements.It was based on the online parameter identification of an electrical model using recursive least square (RLS) with the application of an unscented Kalman filter (UKF) to estimate SOC.The model parameters used in the filter were updated by the algorithm.An improved extended Kalman filter (EFK) algorithm was introduced to estimate lithium-iron-phosphate (LiFePO 4 ) battery SOC [8].That model incorporated a second-order RC circuit with a fuzzy controller to adjust the noise variance.The results of that model showed better observable accuracy of the estimation than EKF.A third-order RC circuit model was introduced [9] based on sampling point Kalman joint algorithm in order to SOC estimation error correction.The error was controlled within 2% and that model was better than the second-order RC circuit model.
The temperature effect under dynamic load on the LiFePO 4 battery SOC has been studied experimentally [10].The estimation approach was based on the RLS method, along with a model of an open-circuit voltage to SOC under different ranges of temperature.The results showed a remarkable accuracy with an error below 5.2%.Moreover, the dynamic characteristic of the LiFePO 4 battery under different rates of current was studied [11].The proposed model to estimate the SOC showed reduced error results.It was based on both current rates and direction.The electrochemical-thermal model introduced in [12] was developed to simulate the temperature and voltage distribution three-dimensionally.The comparison between the predicted variables was made to validate the model accuracy.It was found that the main element for electrochemical performance improvement was the self-heating in the large-sized cells.In the recent years, advanced artificial intelligence and machine learning algorithms have been utilized in many worldwide practical applications with superior performance in diverse power system topics, e.g., [13][14][15][16][17][18][19][20] while renewables and storage systems are simulated intensively [21][22][23][24][25].In [26], a single-particle model (SPM) was used to introduce a physical-chemical model of the lithium-ion battery, which governed its performance.The curves of charging and discharging were obtained for different cycle depths and current rates.The effect of the high number of cycles on the aging was introduced, as well as the electrolyte dynamics.The three-parameter method (TPM) was implemented for comparison purposes to validate the proposed model.The paper concluded that the used models had included a method to protect the battery via cutting the current in charge and discharge based on the electrode maximum stoichiometric concentration ranges of lithium.Besides, different values of the r eff parameter were used to study the direct influence on the discharge voltage.
The aging performances of different batteries including LiFePO 4 were tested and compared in [27] through a series of start-stop micro cycles.The model introduced in [28] was used to estimate capacity loss during cyclic aging, based on the values of different current rates using the incremental capacity analysis (ICA).The results showed a capacity reduction with aging, with a prediction error below 3.2%.Moreover, a commercial LiFePO 4 /graphite type aging cycle was tested in [29] via nineteen points, based on combinations of C-rate, temperature, depth of discharge, and SOC.SOH prediction approach was introduced in [30] based on grey Markov chain (GMC), considering the battery internal resistance using a designed monitor device.The results showed that the model is efficient in SOH estimation.Moreover, in [31], a SOH relative evaluation method was proposed based on the ohmic resistance.First, a dual extended Kalman filter (DEKF) was used for the ohmic resistance estimation along with the SOC.Then, the relative SOH was estimated based on the proposed method.The method was verified using a LiFePO 4 battery.An optimization technique using non-dominated sorting genetic algorithm II (NSGA-II) was introduced in [32] to estimate the SOH.The optimizer considered both accuracy and measurement cost.The validation was done using the measurement from two LiFePO 4 /C batteries, providing the grid with the primary frequency regulation (PFR) service.
A combination of SOC and SOH estimation was introduced in [33]; a sequential algorithm to improve estimation performance was proposed.It used frequency-scale separation and estimated parameters/states sequentially by different frequencies of currents injection.The proposed algorithm was verified by experiments at different temperatures for varying battery capacities.As a combination of an electro-thermal model and a semi-empirical cycle-life model, a coupled electro-thermal-aging model was introduced in [34], which demonstrated the system dynamics for LiFePO 4 batteries.It provided an assumption for the behaviors of the battery, which would be discussed in the section of the mathematical model, as well as an open-loop observer for both SOC and SOH.
As stated above, considerable studies have focused on the estimation problem in LiFePO 4 batteries, where various approaches were investigated.Several existing approaches implement assumptions due to the complexity of the problem, such as the simplified linear models, which affect the accuracy rates and produce unreliable estimations for SOC and SOH of LiFePO 4 batteries.To cover the gap in the literature, this paper proposes a reliable and robust observer, which estimates the SOC and SOH of LiFePO 4 batteries in a simultaneous manner with high accuracy.To do so, comprehensive modeling of LiFePO 4 batteries was achieved via an equivalent-circuit model whose input is the ambient temperature and the current, and its output was assumed to be the voltage.Furthermore, a comprehensive model was proposed, which combines three parts: a thermal model, an electrical model, and an aging model.To assure high performance of the proposed observer, the use of the dual extended Kalman filter (DEKF) is adopted for the SOC and SOH estimation of LiFePO 4 batteries with current and terminal voltage sensors.A robust voltage-temperature (VT) observer and an open-loop observer were also built to provide an efficient method to monitor SOC and SOH for the battery.The system was constructed and simulated using MATLAB.Furthermore, the robustness of the proposed observer was verified by assessing its performance against ill-conditions that include wrong initial estimates and wrong model parameters.The intensive results reveal the reliability and robustness of the proposed observer for estimating both SOC and SOH of LiFePO4 batteries simultaneously, thereby ensuring safe operation for them.
The mathematical model is explained in Section 2. The algorithms and implementation are presented in Section 3. Section 4 introduces the results as well as their analysis.Finally, conclusions are provided in Section 5.

Mathematical Modelling
A coupled electro-thermal-aging model is the base of the analysis for LiFePO 4 batteries [34].The model consists of a two-state thermal model, a two RC pair electrical model, and a semi-empirical aging model.The electrical model of LiFePO 4 batteries contains an open-circuit voltage (OCV, V OC ), an ohmic resistor (R 0 ), and two resistor-capacitor (RC) The state-space model is given by: where I(t) is the current (positive for charging), C bat is the battery nominal capacity, and V t (t) is the terminal voltage.Three state variables are SOC and voltages across the two RC pairs The identification of the electrical parameters is in [35].For this model, the listed equations in Appendix A would be followed for the derivation of these parameters based on the SOC (I < 0) or discharge (I ≥ 0).As the core temperature could be greater than the surface one under high current rates [35], a two-state thermal system was hereby introduced to capture both core and surface temperature dynamics.The model of the radial heat transfer dynamics of a cylindrical battery could be as follows: C c , C s , R c , and R u represent the core heat capacity, surface heat capacity, heat conduction resistance, and convection resistance, respectively.Table 1 shows their values.The ambient temperature T f is treated as uncontrollable input; the two-state variables are surface temperature T s and core temperature T c .
1.94 3.08 62.7 4.5 | is heat generation including energy dissipated by electrode over- potentials and joule heating.
Based on Equations ( 3) and ( 4), this could be rewritten as: The aging model is based upon a matrix of cycling tests from [34].Results of the experiment suggest that capacity fade depends strongly on temperature and C-rate in the cell at low charge/discharge rates while neglecting the sensitivity to depth-of-discharge.The semi-empirical life model adopted the next equation, which describes the correlation between the capacity loss (∆Q b , in%) and the discharged ampere-hour (Ah) throughput (A, the discharge current, depends on the rated capacity (C-rate)): where M(c) is the pre-exponential factor as a function of the rated capacity, which is denoted by c, and E a is the activation energy.R is the gas constant, which equals 8.3145 J mol −1 K −1 .
Table 2 shows the C-rate and M(c) relation.The power-law factor z and the activation energy E a are given by: This model considers a capacity loss of 20% for an automotive battery as the end-of-life (EOL).The corresponding Ah throughput A tol and the number of cycles N are, therefore, computed as: Each cycle corresponds to 2 ×C bat charge throughput, and since A tol is discharged Ah throughput, the total throughput including both charged and discharged Ah should be 2 × A tol .Based on this, the battery SOH is defined as follows: where the initial time is t 0 .SOH varies among [0, 1], SOH = 1 denotes a new battery and SOH = 0 means 20% capacity loss (EOL).The SOH derivative produces the aging model of the battery: Figure 1 shows the combination of the three models.The dynamics of the model are that the inputs include the controllable current I(t), and the uncontrollable ambient temperature T f (t).

Algorithms and Implementation
The Kalman filter (KF) is the broad name given to a class of stochastic estimation algorithms.However, in the strict sense, a KF refers to an estimation scheme for linear systems under the assumption of additive white noise, which follows a Gaussian distribution.Assuming that the system is stochastic in nature is truer to reality than assuming a purely deterministic process.This means that the computation is performed in a KF is accounting for variability and uncertainty within the system and attempts to supply an estimate of the optimal value, given this extra information.This stands in contrast to the deterministic observer, which uses a constant observation error gain, and does not dynamically evolve [36][37][38][39][40][41].
The assumptions made within the formulation of the KF are linear dynamics and additive Gaussian noises.Under these assumptions, properties of linear stochastic systems could be applied and neatly manipulated into an exact closed-form algorithm.As with many variants of Bayesian estimators, the algorithm for the KF is divided into two stages.The first stage is termed the model prediction/time update, where it uses a linear model with additive Gaussian process and measurement statistics to predict the next state in the time evolution of the system.Meanwhile, the second one is the measurement update that utilizes sensor measurements of the system and statistically updated "Kalman" gain to correct the model prediction estimate of the next state to the most likely value.The algorithm for the KF is shown below [42,43].
Stochastic State-Space Model: The need to apply the EKF is the expected non-linearity of a true physical system.Often, in engineering practice, the knee-jerk reaction to nonlinear systems is to linearize them and hope that the resulting linearization errors prove to be insignificant.If this approach is applied to KF, the result is linearized KF (LKF).Unfortunately, the KF typically demonstrates very poor performance since it linearizes both the dynamics of the system and covariance of the system, compounding the error due to linearization.The solution is the EKF, which is an extremely important variant of the regular KF.Actually, the EKF is adapted to work with nonlinear systems while requiring a minimal change to the fundamental algorithm/processes [43].
The computing of a deterministic nonlinear equation is not easy for most users implementing state observers.In addition, the nonlinear computations are preserved and reducing linearization errors.On the other hand, nonlinear covariance and stochastic properties must be linearized since closed-form transformations of nonlinear systems are extremely challenging to solve or may not even exist.Consequently, linearization of these stochastic quantities is necessary to attempt to preserve the Gaussian of the filter, even if only an approximation.Therefore, the EKF is not an optimal observer since no guarantees of performance could be made due to the need to linearize.Finally, there exist other more advanced estimators, such as Bayesian estimator and particle filter, that could give more accurate estimation results but at a trade-off of computational expensiveness [43][44][45].
Space Model: where w k and v k are independent, zero-mean, Gaussian of covariance matrices, respectively.Considering: Measurements Update:

State and Parameter Estimation
In the case of parameter estimation, the desired quantity to estimate is not a state of the system but some other parameter that is related to the system.In the general sense, to incorporate the desired parameter into the structure of whatever filter is being used, the parameter must be included (augmented) into the state-space model, as shown in the following form [44,45]: where p is an unknown parameter vector, and by applying the following augmentation.
The system state space could be derived with parameter estimation: or: Additionally: The same algorithm used for state estimation could be implemented as estimate system parameters.It should be noted that the equation in the form given above treats the parameter as a constant value, only adding a small fictitious noise w pk , to allow the small changes to be applied to the initial parameter value [46].

Dual Extended Kalman Filter (DEKF)
In the domain of parameter estimation with EKF, there are several approaches to achieve the same overall objective.Joint EKF runs a single filter that directly implements the augmented state-space shown above.The DEKF performs two coupled and simultaneous filters for state and parameters estimation.In general, there seems to a consensus that dual EKF demonstrates a computational advantage, while joint EKF demonstrates an accuracy advantage.For the purposes of this paper, the DEKF is implemented as the easiest solution to code and debug, where its process map has been clarified as follows [46][47][48][49][50].
State-Space Model: where w k , v k , r k and e k are independent zero-mean Gaussian noise processes of covariance matrices ∑ w , ∑ v , ∑ r , ∑ e , respectively.Definitions: Computation: For k = +1, 2, . . .compute: Weight filter time update: State filter time update: State filter measurement update: Weight filter measurement update:

Sensor Estimator
The estimators utilize the measurable physical quantities, i.e., current and terminals voltage, of the cell in order to estimate its internal state.In a real application, the measurement is achieved by an acquisition unit collected by voltage and current sensors as well as single or multiple analog-to-digital converters (ADC).This ADC converts the attained analog signals into digital values.Typically, this procedure introduces a measurement noise.The estimators must be able to execute a correct estimation even in the presence of these perturbations.In order to develop reliable algorithms and to test their capability to work in an actual system, a model of the sensors has been developed.This specified model uses the current I as input during the cell voltages V i produced by the model of the battery and delivers as output.The measured current Î and voltages Vi .Both current and voltage sensors are modeled in the same way, as shown in Figures 2 and 3.They introduce measurement noise as well as offset errors.Note that the mean and variance of the noise that was injected into the system were computed upon ±10%.The value of these errors is settable to simulate systems with different specifications.Furthermore, the acquisition system block can model the quantization error, i.e., the difference between the input signal value and its quantized value.This error depends on the number of bits of the ADC and its input range.These are editable parameters of the acquisition system.In particular, the current sensor input range is different from the voltage one.In fact, in this application, the voltage is a quantity included in the cell operating voltage range, which is always greater than zero.On the contrary, the current ADC has a large bipolar range.

Results and Discussion
In this paper, the used parameters are based on A123 LiFePO 4 battery parameters.In the 1-h of simulation, the controllable input was the charging rate (=0.9 C-constant value).The uncontrollable one, ambient temperature, was assumed as a half-sine wave.Figure 4 presents the system inputs.For the outputs of the simulation, after 1-h charging, the SOC reached 90%.As the SOC increased, the terminal voltage increased.As time passed, SOH decreased.Surface and core temperatures of the LiFePO 4 battery changed as they are affected by the ambient temperature and the current.Figure 5 presents these outputs.With adding white noises to both surface temperature and terminal voltage data with SNR = 60, the generated synthetic data produced surface temperature and terminal voltage measurements.Figure 6 introduces these synthetic measurements.Both terminal voltage and SOC were estimated well for the voltage-measured observer.After 1000 s, the estimated core and surface temperatures converged with their true values.However, that did not happen to the estimated SOH.That result indicated that the SOH was unobservable.The reason for that was that the observability matrix of the voltage-measured observer was not full rank.Span ([0, 0, 0, 1, 0, 0] T , [0, 0, 0, 0, 1, 0] T , [0, 0, 0, 0, 1] T ) is the observability matrix null space.That indicates that the T c , T s states, and SOH were unobservable.Nevertheless, when the model of the observer is accurate, the convergence of the temperatures to their true values would occur, although temperatures are unobservable for the voltage-measured observer.The reason for that is the core and surface temperatures would only reach their equilibrium states after a long time as the thermal system is asymptotically stable.Figures 9 and 10 present temperature-measured observer estimation tests using wrong initial estimates and wrong parameter values, respectively.For that observer, the core and surface temperatures are estimated well.The estimated SOC and SOH did not converge to their true values.The result of that test indicated that SOC and SOH were unobservable for that observer.The observability matrix rank of that observer was 4, which was not a full rank.Span ([1, 0, 0, 0, 0, 0] T , [0, 0, 0, 0, 0, 1] T ) is the observability matrix null space, which indicates the unobservability of SOC and SOH for the observer as well.
Figures 11 and 12 present the results of the estimation test for the VT-measured observer using wrong initial estimates and wrong parameter values, respectively.
For the VT-measured observer, V T , T C , T S , and SOC were well estimated, except for the SOH.The observability matrix rank of that observer was 5. Span ([0, 0, 0, 0, 0, 1] T ) was the observability matrix null space, which indicated the SOH unobservability as well.For the three observers' performance evaluation, six battery states' observability of the observers are shown in Tables 4-6, which present these three observers' root-mean-squared error (RMSE) and two tests.Analyzing the previous results, SOC and SOH are unobservable for temperature observers, while T C , T S , and SOH are unobservable for voltage observers.Nevertheless, the resistance of the circuit could affect the temperature.On the other hand, the temperature would affect the resistance as well.Therefore, T C and T S could be observed by an indirect approach with the voltage observer since the convergence of the temperature after a long time.That could lead to the idea that both voltage and temperature observers might be combined together as a VT-observer.Based on the results, there is an advantage for the VT-measured observer as most of the states could be estimated because it combines the two observers.It should be indicated that the SOH could not be estimated by any observer.However, the SOH values could be estimated well by an open-loop observer, provided that the model of the battery and the initial values are accurate.Additionally, based on the results, a positive linear relationship between SOC and the charging time could be noticed, while SOH has a negative one.It requires about two hours for the SOC to replenish from 0% to 90% in the simulation, with an associated SOH decay of 0.005%.The reason for running the simulation with an upper limit of 90% is to keep the health of the battery because this test will be applied many times.The lowest SOH is 99.995%, and the highest SOC is 87.4% compared to the original status.That indicates that the battery health and charging time is a tradeoff.This led to a rise in the balance between efficiency and safety.For higher efficiency, the charging time should be minimized; For the highest safety, the aging condition should be minimized.Through comparing these results with the proposed model in [29], in real-life cases, a balanced point should be found in different scenarios, which leads to a new topic-optimal control for battery charging.Since the importance of batteries as an energy storage device, the proposed observer would definitely advance sustainability.Therefore, the importance of the estimation of the states in energy systems could be noticed.

Conclusions
In this paper, electric, thermal, and aging models have been built, and the state estimation using DEKF and open-loop simulation has been implemented to construct an observing system for the LiFePO 4 battery.The constructive feature of the proposed observing system is that its reliable and robust performance for estimating both SOC and SOH of LiFePO 4 batteries, and so, yielding secure operation and extending their lifetime.Interestingly, the proposed open-loop observer monitors the SOC and SOH with curves' trend as expected due to the accurate model parameters and initial values.Unlike these existing observers, the proposed VT-observer could observe the SOC, and the proposed open-loop observer could observe the SOH using correct parameters and initial estimates.The results of 1-h duration with 1-s resolutions demonstrate the reliability and robustness of the proposed observer for simultaneously monitoring the SOC and SOH of LiFePO 4 batteries.

Figure 2 .
Figure 2. Current sensor model; (a) the Matlab/Simulink block, and (b) current sensors with and without noises.

Table 1 .
The thermal parameters.

Table 2 .
M(c) and C-rate relation.

Table 5 .
RMSE of EKF using wrong initial values.

Table 6 .
RMSE of EKF using wrong parameters.