The lithium-ion battery is the key power source of an electric vehicle. The cornerstone of safe transportation vehicles is reliable real-time state of charge (SOC) information. Since batteries are the primary form of energy storage in electric vehicles (EVs) and the smart grid, estimation of the state of charge is a critical need for batteries. The SOC estimate approach is considered to be precise and simple to apply for such applications. In this paper, After studying a battery model with an appropriate resistor-capacitor (RC) circuit, A lookup table derived from experimental studies describes the nonlinear connection between the Open Circuit Voltage Voc and the the state of charge. However, if temperature or SOC varies, the equivalent circuit model's characteristics will vary, decreasing the accuracy of SOC calculation. The recursive least squares (RLS) and nonlinear Extended Kalman filters are used in this research to offer a charge estimate technique with online parameter identification to handle this problem. RLS dynamically updates the Thevenin model's parameters. In order to improve the precision of SOC prediction under charge and discharge settings, we presented a regression least-squares-extended Kalman filter (RLS- EKF) estimation approach in this study. The objective of this research is to ensure the updating of the battery parameters and to evaluate the influence of this improvement on the convergence of the state of charge towards the real value. The simulation results suggest that the RLS EKF estimation technique, which is based on precise modeling, may greatly increase SOC estimation accuracy.
Keywords: Battery parameter estimation; Parameter identification; Battery management system; State-of-charge; Extended kalman filter; Recursive least square method; Lithium-ion battery
Received: Feb 14, 2023 · Revised: Mar 15, 2023 · Accepted: Mar 30, 2023 · Published: 2023-05-24
Corresponding author: Elmehdi Nasri, [email protected]
This is an open access article under the CC BY 4.0 license.
How to cite: Elmehdi Nasri, Tarik Jarou, Jawad Abdouni, Salma Benchikh, Sofia Elidrissi, "The parameter update of Lithium-ion battery by the RSL algorithm for the SOC estimation under extended kalman filter (EKF-RLS)," International Journal of Engineering and Applied Physics, vol. 3, no. 2, pp. 605–618, 2023.
Electric vehicles are being deployed more frequently and extensively over the world as a result of environmental pollution and the energy crises [1]. One of an electric vehicle's key parts is the battery management system (BMS). State of charge (SOC) estimate, state of health (SOH) estimation, battery balancing control, temperature management are some of the BMS's functionality. The primary purpose of BMS and the foundation for other functions is SOC estimation, which specifies how much capacity the battery can deliver [2]. In electric cars (EVs) or plug-in hybrid electric cars (PHEVs), a battery pack is frequently made up of tens to thousands of battery cells connected in parallel, series, or another more high quality architecture, in the literature, many architectures have been presented [3]. As a result, it is crucial to use a "battery management system" (BMS) to protect, supervise, and regulate the pack to maintain the appropriate performance. Estimating the battery's current states, which typically comprise state of charge and state of health (SOH) [4], is a crucial function for the BMS. The SOC estimation for EV battery packs is the main topic of this research, The most crucial energy storage component in electric vehicles (EVs) and the smart grid is the battery, that’s requires estimation of the state of charge on a regular basis. SOC estimation consists of applying an algorithm, such as the Kalman filter (KF) [8], extended Kalman filter (EKF) [5], [6], H infini [7], [8], or leastsquares based filter [9], to a battery models with varying degrees of complexity in order to link the measurable battery values, such as voltage, current, and temperature, with the state of charge [10], [11]. The reliability of SOC estimation in these methods heavily depends on the model's precision, yet the parameters of the battery model are always prone to change because of working conditions and aging [10]. The foundation of every battery management system is the assessment of state of charge. The equivalent circuit model with fixed parameters is the basis of the majority of closed-loop SOC prediction approaches. However, if temperature or the charge changes, the equivalent circuit model's parameters will vary, decreasing the accuracy of SOC calculation [12]. In order to confront this problem using the nonlinear Kalman filter and recursive least squares. This paper proposes two SOC estimation strategies with real time parameter identification. RLS continuously updates the parameters of a Thevenin model. The nonlinear Kalman filter is used in the recursive process to estimate SOC. This is done to satisfy the BMS criteria for EVs, which had previously disputed. The estimation of SOC and battery model parameters may be accomplished with success using this straightforward yet through technique.
In this paper, based on the first-order RC equivalent circuit model, an online identification parameter model based on EKF is derived under the Recursive least square RLS method. This work Highlight the impact of the online battery parameters update on the state of charge estimation, making a comparison between the offline and the online state under the RLS method to estimate the SOC required to the Lithium-ion battery.the online parameter identification based on RLS is used to obtain the resistance and capacitance parameters of the battery model in real time, what goes next in this study, cause an improvement of the errors associated to the SOC estimation compared to the fixed parameters case. The novelty of the proposed Simulink model required to the improved EKF model is the association between the HPPC test and the RLS algorithm fixed to update the battery parameter in real time.
The structure of this article is as follows: The basics of battery modeling are provided in section 2. The Extended Kalman Filter algorithm is presented in section 3. In order to estimate the needed SOC and model parameters for the battery model, Section 4 describes the traditional RLS estimation in general and the suggested one in detail. Section 5 offers the suggested approach for improving the EKF for SOC estimate. It is based on the identification of battery parameter using the recursive least squares method. The Matlab/Simulink model needed for this suggested strategy is shown in Section 5 along with a discussion of the results, and the conclusion is given in Section 6. The goal of the paper is the modelling of the State of charge estimation of the Lithium –ion battery based on extended kalman filter with the online parameter update with the recursive least square method, in order to improve the error of estimation.
The equivalent circuit model simulates a battery by using conventional circuit elements such as resistors, capacitors, and others. If the analogous circuit model's input parameters are executed properly, a high level of accuracy can be obtained. Equivalent circuit models are used increasingly frequently in the actual application of BMS in electric vehicles. As a result, there is a trade-off between accuracy and complexity when examining the model's parameters [13]. a design that is typically used in literature is the RC-equivalent circuit model or the reduced Thevenin model [14] [15]. The Thevenin model, which is also called first-order resistor-capacitor (RC) equivalent circuit model, is often used for lithium-ion battery modeling and analysis in electric vehicle battery modelling [12], [16]. In this article, the Thevenin model is used as battery model, as shown in Figure 1 

▪ Internal resistance R0 : represents the conduction resistance of the battery.
▪ Configuration for an RC loop: equivalent branch capacitors Cp and resistors Rp.
▪ Open-circuit voltage OCV: electromotive forces inside the storage mechanism.
To represent the dynamic properties of the lithium-ion battery, the RC figure's parameters are all not linear and vary dynamically. It also uses a connection between polarization resistor Rp and polarization capacitor Cp and v ary dynamically.
A Li-ion battery's SOC cannot be measured directly, instead, it is calculated based on the battery's operational condition and properties. SOC's value is expressed using the definition of Ah, The following equation (1) illustrates this definition:

Where SOC(t0)is the SOC of the battery at the time, kT is the Li-ion battery's temperature correction factor at temperature T.i (τ) is the battery's current flowing at the moment τ, QN is the battery's valued

The variation in SOC can be calculated using the ampere-time integration approach. While the battery is still on, This technique allows for immediate measurement of its variables. In a short period of time, the results are quite reliable, internal battery adjustments have less of an impact on measurement accuracy, but The correct computation of SOC's initial value is not provided. Model parameter identification tests are commonly used to determine the link between SOC and the cell's open circuit potential. Calculating the battery's open circuit voltage can then be used to predict the original value of SOC. This method's equation for calculating SOC is shown below, where OCV is the open circuit voltage value.

Where ΔT is discrete step size, W k−1 is the actual level of process noise k−1,W k−1 is the quantity of noise detected at time k.
The Kalman filter is a technique for assessing the state of a nonlinear dynamical system, that is used in a range of fields for tracking, navigation, and control [17]. It truly makes use of the system's dynamics, which define its evolution through time. Because Li-ion batteries have nonlinear behavior, For battery monitoring, this estimation technique is often used [18]. Various Kalman filtering approaches were used to predict SOC, including the linear Kalman filter (KF) [18], the extended Kalman filter (EKF) [19], the unscented Kalman filter (UKF) [20]. Unlike the KF, which requires a linear formulation, the EKF requires a local linearization, which entails employing the Jacobian derivation in order to convert the system to the usual state, instead of a fixed matrix with interconnected components. The continuous-time Kalman filter is the limiting case of the discrete-time Kalman filter as the sample time becomes infinitely small, for this reason, the formulating of an extended Kalman Filter Problem require discrete time linear dynamic system description by vector difference equation with additive white noise that models unpredictable disturbances[21].
The EKF can provide the most accurate prediction of the intended recipient state with the least amount of variance, and it's commonly used in lithium- ion battery SOC calculation. For the situation that battery working conditions change rapidly, a recursive calculation method based on the extended Kalman filter is the most adopted strategy to estimate the charge of the battery [22].
The state equation of discrete space for the nonlinear system is as follows:

Where xk denotes the state of the system at time k, xk ∈ Rn uk denotes the control variable, zk denotes the measurement vector, zk ∈ Rn, ωk and vk represent the noise caused by the process and the noise caused by the measurement, respectively, ωk and vk are unrelated and have a Gaussian distribution, Qk and Rk are covariance, f(.) and h(.) are nonlinear functions. Initially, the nonlinear functions f(.) and h(.) are linearized.





Where x0 indicates the initial state value, P0 indicates the initial covariance,
represents the k+1 prior estimate,
represents the k+1 prior covariance, Pk⁄ k represents the k prior covariance, Kk+1 denotes the kalman gain of k+1, x̂k+1 represents the k+1 posterior estimate,
denotes the k+1 covariance. We actually, in fact, adopt a model-based technique for estimating the SOC. The first-order equivalent model serves as the foundation for this method, which possesses a high level of accuracy while requiring the fewest parameters. As described in the preceding part, we used our proposed model as OCV in this model. The extended Kalman filter was then utilized for SOC estimate, which is an adaptive approach according to a state observation.
The prediction of R0 , Rp , Cp is highly required in order to ensure an online state of charge estimation based on EKF.

The least squares estimation is a commonly used technique for estimating the approximate parameters value of a static system by decreasing the sum of the squared errors between the observable values and their simulated results. For real-time application, continuous parameter monitoring and the associated updated estimating method demand a significant computing work. Recursive methods, like RLS estimation, are favored to reduce calculation time since system model parameters are considered to be constant. The model parameters that must be estimated are, however, time-varying in many situations.
The estimate can be taken care of by routinely resetting the computing process in the event of a dramatic but occasional change in the parameters. While a mathematical approach, like the RLS [9][23][24], is necessary in the case of continuously variable parameters. Given the situations indicated above, some writers have suggested using the recursive least-squares (RLS) method to similar electrical models in order to solve these problems [9], [10] [25]. RLS concurrently calculates OCV and the battery model parameters to adjust for their real variations over the course of the battery's lifecycle and under various operating situations[9] [26]. This work also uses recursive least squares with forgetting factors to identify the battery parameters. Online parameter estimation often uses RLS methods[27] [28]. The transfer function of the electrical behavior of the battery model in the equivalent circuit model may be written as follows using the Laplace transform:

Then, this transfer function H(s) is discretized using the fundamental Forward/Euler transformation technique. The discrete-time system H(z) is shown using the z-transform as:

Where a0, a1,b0 and b1 are the corresponding coefficients. Next, the model terminal voltage in Refs [29] [30] can be expressed as in the following equation:

As illustrated in Ref [31], [32], the general model of RLS is shown as:


φ(k): is the Regressor vector composed of the battery source's input current Ib and output voltage Ub. θ̂k: is a vector of unknown parameters or an estimated parameter composed of the coefficients a1, a0 , b0,
: is the prediction error of the terminal voltage.
However, the regression vectors φ(k) and θ̂k are given below:


Moreover, the recursive gain matrix L(K) is described by Eq. 15:

With Fλ is the forgetting factor[33], [34] [35]. Finally, Figure 2 outlines the RLS procedures.

The EKF approach is restricted to system tracking and relies on observations for correction. The EKF method will therefore degrade into an information filter with a slower rate of convergence. Additionally, increasing model accuracy or promptly adapting the model to the system has a greater significance for enhancing convergence speed and resilience. [36]
The basic mechanism for adapting the model to actual systems is online parameter identification. The parameters of the frst-order ECM include R0,Rp, Cp. Rpand Cp represents the battery polarization effects, utilized for modeling the system's long-term and dynamic characteristics. As a result, the online identification process has to incorporate the mentioned factors. Interesting aspects of this state space theory abound. First, the state update matrix is a unit matrix with minimal computing cost and good positive definiteness. Additionally, the battery equivalent circuit model and the system's observation equation are identical. Accordingly, both the measured voltage value and the polarization characteristic are impacted. As a result, the ECM's predicting and update mechanism needs to receive feedback from the online parameter identification. The capacity to update parameters that depend on observation will be impacted by the SOC estimate result. Figure 3 depicts the adaptive parameter procedure. The selected parameters are shown in Table 2 while taking the filter algorithms' influential variables into account.

| Item | Value | Description |
|---|---|---|
| P | Identity matrix | The initialisation of co-variance Matrix |
| Q | [0.01;-0,01] | The selected processing noise |
| R | 0,04 | The selected observation noise |
| 𝐗 𝟎 | [0;1] | The initialization of state matrix |
Estimation of online battery parameters: The increased state estimate is based on more than just the OCV- SOC connection, which is updated on a regular basis, but also on the other dynamic characteristics of the energy storage model. Since the RLS performed well in identifying the parameters, it was incorporated into our strategy, specifically in identifying the remaining parameters (R0, Rp, and Cp) so that they could be accurately reflected in the Li-ion battery model.
As illustrated in Figure 4, this combination of the OCV and RLS methods is used to estimate the matrices Ak , Bk, Dk and the correction matrix Ckthat will be employed by the EKF and SOC estimator. EKF is fixed to estimate the voltage and to modulate in due time the noise signal according to the error matrix. Because of their quick convergence and effective ability to reduce the cumulative effect of noise, irrespectively of the Li-ion battery model, process has shown that the EKF and RLS algorithm with forgetting factor are usually applied [37] [38]. In the following section, we will examine the OCV-SOC test the Simulink model related to the improved model fixed in this paper. In the next part, the performance of the fusion technique OCV-RLS for online SOC estimation is examined with the equivalent OCV approach.

The Lithium-ion and the pre-proposed OCV-SOC test are trained for this section. It is advised to begin the test with a fully charged battery equivalent to 100% SOC and the maximum Ubatt voltage. The OCV -SOC characterisation refers to the pulsative discharge process of the storage element, which uses an enforced constant low current and follows the cycle seen in Figure 5 above. Since the fitted OCV should be as similar to the experimental OCV as is practical and the fitting performance is better with a higher order polynomial function, it has been developed to determine OCV values between two data points, using the relationship between OCV and SOC [39] [40]. The mathematical link between SOC and Uoc is identified by the use of the polynomial function of 7th order, and this relationship is required for determining the state of charge:
(16)
SOC(OCV) = k0 + k1 ∗SOC + k2 ∗SOC2 + +k3 ∗SOC3
+ k5 ∗SOC5 + k6 ∗SOC6 + k7 ∗SOC7
+ +435 ∗SOC3 −958.4 ∗SOC4 + 1171 ∗SOC5 −741.7 ∗SOC6 + 190.1
The experimental OCV- SOC values profiles that were found are shown in Figure 5, along with the fitting method that was used. The Curve Fitting Toolbox of Matlab may be used to implement Serval fitting techniques and algorithms.

To investigate the effectiveness of the recommended approach, a simulation model is created in MATLAB/Simulink as shown in figure 6. The parameters associated to the simulated battery are reported in
Table 3. [41]. In addition, the EKF estimate method with fixed parameter is compared to the improved EKF
model. The implementation of the improved model in Matlab/Simulink is shown in figure 6:

| Parameter | Value | Unit |
|---|---|---|
| Capacity | 5 | Ah |
| Voltage | 3.4 | V |
| Continuous discharge maximum | 20 | A |
| Resistance | 1.445 | mΩ |
| Polarization resistance | 3.506 | mΩ |
| Polarization capacitor | 14.6 | kF |
A HPPC test (Hybrid Pulse Power Characterization) discharge was implemented for the lithium-ion battery as current/voltage to gather estimation data for defining model parameters, as seen in the Figure 7/8. HPPC test is a foundation of power battery characteristic test and model parameter identification test, this environnement require a list of parameter to controle the battery state, in our study we use the current and the voltage profil to realize the simulation, The discharge current is 5 A, this test was developed to study dynamic power capability across the device's usable charge and voltage ranges [42].


Figures 9 and 10 show a comparison between the estimated SOC produced using our suggested strategy and the real value of SOC, it’s the comparison of SOC calculated by EKF method without parameter update with the real SOC. The novelty of the proposed Simulink model required to the improved EKF model is applying the HPPC test with the parameter update in the real time during the battery discharge.
The improved EKF method is considered to be a benchmark because, the accumulative error is negligible. We can see in Figure 9 that the estimation error does not exceed 4.67%. In this case we can see that the identification of the battery parameter’s can minimize the error of SOC estimation with the EKF method compared with this method by fixed parameters.


In order to contrast the characteristics of the algorithms above, the 3 indicators MSE, RMSE, and MAE are listed in Table 4. The SOC estimation results were actually linked to evaluate the prediction results of these algorithms, by Root Mean Square Error (RMSE), Mean Squaere Error (MSE), and Mean Absolute Error (MAE). As illustrated in Tables 4, based on the definition equation (17), (18), (19).



| Method (%) | MAE | MSE | RMSE |
|---|---|---|---|
| EKF (%) | 0.65 | 5.88 | 7.24 |
| Improved EKF (%) | 0.09 | 2.22 | 4.67 |
Table 4 demonstrates that the MSE, RMSE, and MAE values of EKF in the HPPC environment are half as reduced as EKF with fixed parameter, the proposed model predicts MAE of 0.09 %, RMSE of 7,24 % and MSE of 5,88 % in case of RLS- EKF estimation. In this case, it can be inferred that the RLS-EKF approach performs better in terms of estimation. As a result, the EKF approach performs better under HPPC settings than the EKF with fixed parameter, as well as the SOC estimation based on EKF is more accurate than the Ah counting method which is considered as the method of reference value (reel SOC estimation).
In the application on lithium-ion batteries, we can say that these error level express a similarity with the error that can be obtained with the method multiple adaptive forgetting method factors recursive least-squares which is applied to identify the parameters of the LiFePO4 battery, which does not exceed a level of error of 5% [43]. The simulation results show that the proposed strategy based on the recursive least square algorithm successfully improve the error of estimation associated to the SOC estimation with the EKF algorithm compared with the EKF algorithm applied to a battery with fixed parameters. The recursive least square method was able to make the update of R0,Rp and Cp regarding the discharge of the battery under the HPPC test. These results confirm the effectiveness of the proposed strategy in improving the SOC estimation under the Extended kalman filter method.
Lithium-ion battery data were used to generate a correct SOC for the battery using online parameter identification and state estimation techniques. A nonlinear OCV-SOC relationship derived from experimental tests was taken into consideration while developing an RC equivalent model for the battery. A generic parameter identification method was used to identify SOC functions. RLS continually updates the Thevenin model's parameters. The recursive technique to estimate SOC is performed out with the nonlinear Extended Kalman filter. In order to enhance the precision of SOC estimation under changing battery charge and discharge circumstances, we presented a regression least-squares-extended Kalman filter (RLS-EKF) to estimate SOC in this paper. The algorithms were designed in Matlab/Simulink, and the results were again compared to ensure the accuracy. The simulation results demonstrated that the RLS-SOC EKF's estimation strategy, which is based on precise modeling, may significantly increase SOC estimate accuracy, this study shows the indispensability of the online monitoring of the battery parameters during the discharge, in order to give an accurate estimation of the state of charge. This research's key findings include the SOC estimate of lithium-ion batteries operating in an HPPC environment, as well as the impact of updating battery parameters on the error of estimation. In order to satisfy the requirements of genuine electric vehicles as specified by automobile manufacturers, batteries with improved performance at various temperatures and aging effects will be employed as the experimental objects in our future work.
I am grateful to all of those with whom I have had the pleasure to work during this and other related projects, I would like to acknowledge and give my warmest thanks to my phd project director M.Tarik Jarou and all the members of the advanced systems engineering laboratory.