An Optimized Impedance Model for the Estimation of the State-of-Charge of a Li-Ion Cell : The Case of a LiFePO 4 ( ANR 26650 )

This article focused on the estimation of the state of charge (SoC) of a Li-con Cell by carrying out a series of experimental tests at various operating temperatures and SoC. The cell was characterized by electrochemical impedance spectroscopy (EIS) tests, from which the impedance frequency spectrum for different SoC and temperatures was obtained. Indeed, the cell model consisted of a modified Randles circuit type that included a constant phase element so-called Warburg impedance. Each circuit parameter was obtained from the EIS tests. The obtained were been used to develop two numerical models for each parameter, i.e., one based on numerical correlations and the other based on the artificial neural network (ANN) method. A genetic algorithm was used to solve and optimize the numerical models. The accuracy of the models was examined and the results showed that the ANN-based model was more accurate than the correlations-based model. The root mean square relative error (RMSRE) of the parameters Rs, R1, C1 and W for the ANN-based model were: 4.63%, 13.65%, 10.96% and 4.4%, respectively, compared to 7.09%, 27.45%, 34.36% and 7.07% for the correlations-based model, respectively. The SoC was estimated using the extended Kalman filter based on a Randles model, with an estimation RMSRE of about 1.19%.


Introduction
Lithium-ion batteries are currently considered some of the most efficient devices for energy storage in the medium power capacity range, such as that used in electric vehicles and stationary applications.This is due to their favorable advantages, such as its high power density, long lifetimes, and moderate discharge rate [1].Nevertheless, the temperature of lithium-ion batteries varies depending on the context in which they are, either increasing or decreasing, thus affecting the performance of the battery.Indeed, the temperature increases during the battery charging and discharging processes.
From the electrical aspect of the batteries it is important to know the state of the battery, which normally includes the state of charge (SoC), state of health (SoH), state of power (SoP) and state of energy (SoE).In general, these states are not observable (i.e., cannot be measured), but need to be estimated from measurements of physical parameters such as voltage, current, temperature or battery usage time.As future vehicular technologies aim to incorporate high performance batteries, they therefore require an intelligent system to control and monitor the state of the batteries.The current methods used to estimate the states of a battery require a model that represents the physical behavior of the battery.To obtain a good estimate, the model must be accurate, but at the same time simple and cheap.
Electric models vary according to their complexity.In some applications, a simple model that captures the basic electrical behavior of a cell can be used.Electrochemical models are very precise, but are difficult to parametrize and require a high computational capacity [2].In most applications, equivalent electrical circuits (EECs) are used because they offer a balance between precision and simplicity, and are also useful to obtain an idea of how a cell responds to different usage scenarios.The electrochemical impedance spectroscopy (EIS) method [3] is used to determine the parameters of an equivalent circuit of a battery.The method has a reasonable accuracy when compared to a model with the real-time measurements of the charge/discharge of a battery.However, it does not consider a constant phase element (CPE) to represent the Nyquist diagram of the battery at low frequency.
Considerable efforts have been made by researchers to find more accurate and reliable methods to predict the SoC of a battery.One of the most widely used methods has been the Kalman filter (KF) [4].The KF estimates the SoC with very low errors and it is easy to implement in real applications.The purpose of the KF is to estimate the state of a system from measurements that contain errors.The original KF is a linear estimation method.To expand its application in non-linear systems, the extended Kalman filter (EKF) [5][6][7][8] and the unscented Kalman filter (UKF) [9,10] have been developed.Both the EKF and UKF methods can estimate the SOC with great accuracy if the battery model is sufficiently accurate and the system is not highly non-linear.
Other methods combine different types of KF.Andre [11], proposed an advanced mathematical method to estimate the SoC and SoH in a lithium-ion battery by combining a standard Kalman filter (KF) and an unscented Kalman filter (UKF).The first filter estimated the polarization overvoltage, the diffusion overvoltage and the ohmic resistance of the equivalent electrical circuit model of the lithium-ion battery.The outputs of the first filter were the inputs for the second filter, which estimated the SoC and the polarization and diffusion resistance.This method was implemented in a code in MATLAB and the simulations indicated an error in the SoC and SoH estimation below 1%.Fengchun et al., in [12] proposed a method to estimate the SoC by considering different health conditions in lithium-ion batteries.The concentrated parameter model was used to model the battery, and was estimated using the square minimum method.A discretization method of the battery model was also proposed, which had the advantage of calibrating the parameters in real time.Subsequently, the parameters were incorporated into the algorithm of the adaptive extended Kalman filter (FKEA) to estimate the SoC.The simulations indicated that the parameters of the battery model degraded as the battery aged, therefore the parameters have to be updated to achieve an optimal performance in the estimation of the battery voltage and the estimation of the SoC.For different levels of battery aging, the error in the SoC estimation was less than 2.5%.Li et al. [13] developed a comparative study of algorithms to estimate the SoC in a LiFePO 4 (LFP) battery used in an electric vehicle.The algorithms that were investigated included the Luenberger observer, extended Kalman filter (EKF) and the sigma Kalman filters or unscented (UKF), which are designed to estimate the SoC in a lithium-ion LFP battery.To evaluate these algorithms, they were verified with two driving profiles typical of an electric vehicle, the new European driving cycle (NECD) and the Artemis cycle.Based on the results of the experimental tests, they concluded that the accuracy of the Luenberger observer was mainly based on the accuracy of the battery model, since it did not take into account the uncertainty of the model and the noise of the measurement.The EKF is comparatively more accurate than the Luenberger observer.Finally, in terms of tracking accuracy, convergence and the robustness of the estimate against the temperature uncertainty and drift current of the sensor, the UKF provided the best results in the SoC estimation unlike the other algorithms.
In recent years, the particle filter (PF) [14][15][16][17][18] has been used to estimate the SoC.Additionally, the PF algorithm is very useful in applications that are considered a non-Gaussian source of uncertainty.The PF requires a considerable number of initial particles and the calculation capacity is very high.In [19], the dependence of the computational load of the PF was solved using a hybrid method to estimate the SoC of a battery based on an adaptive extended Kalman particle filter (AEKPF).Five experimental tests were carried out to evaluate the performance of the algorithm and showed that the average of the absolute error was less than 1%.
The abovementioned methods to estimate the SoC were developed with the model at room temperature, therefore the operation of the method for different temperature conditions of the batteries has not been disclosed, which is important to identify the model parameters for each temperature.The objective of this research was to identify an EEC whose parameters were dependent on the SoC and temperature.In addition, the EEC identification was used to estimate the SoC of a Li-ion cell.The rest of the article is organized as follows: Section 2 presents the electric model of a Li-ion cell, showing that it is necessary to include a constant phase element in the model in relation to the measured data.Section 3 carries out a parametric identification of the EEC for different values of SoC and temperature.For this, an optimization problem was solved by means of a genetic algorithm.In Section 4 a multivariable model was constructed for each EEC parameter based on the SoC and temperature.Two models were tested; in the first, empirical equations were adjusted, while in the second, an ANN was used.In Section 5, the SoC was estimated using the extended Kalman filter algorithm.Finally in Section 6, the conclusions of this research are presented.

Electric Model
In this section, an electric model of a Li-ion cell that allowed for the estimation of the electrical behavior is presented.The electrical dynamics are represented by an electric circuit consisting of a voltage source, resistance and a network composed of a capacitor in parallel with a resistor in series with a constant phase element (CPE).

Equivalent Electric Circuit of a Li-ion Cell
The electrical behavior of a battery can be represented by an EEC as shown in Figure 1 [20].This circuit incorporates a CPE called the Warburg element which accurately reflects the behavior of the cell.The Warburg impedance is a component that produces a partially capacitive and resistive behavior with a phase of 45 • at low frequency [21].
uncertainty.The PF requires a considerable number of initial particles and the calculation capacity is very high.In [19], the dependence of the computational load of the PF was solved using a hybrid method to estimate the SoC of a battery based on an adaptive extended Kalman particle filter (AEKPF).Five experimental tests were carried out to evaluate the performance of the algorithm and showed that the average of the absolute error was less than 1%.
The abovementioned methods to estimate the SoC were developed with the model at room temperature, therefore the operation of the method for different temperature conditions of the batteries has not been disclosed, which is important to identify the model parameters for each temperature.The objective of this research was to identify an EEC whose parameters were dependent on the SoC and temperature.In addition, the EEC identification was used to estimate the SoC of a Li-ion cell.The rest of the article is organized as follows: Section 2 presents the electric model of a Li-ion cell, showing that it is necessary to include a constant phase element in the model in relation to the measured data.Section 3 carries out a parametric identification of the EEC for different values of SoC and temperature.For this, an optimization problem was solved by means of a genetic algorithm.In Section 4 a multivariable model was constructed for each EEC parameter based on the SoC and temperature.Two models were tested; in the first, empirical equations were adjusted, while in the second, an ANN was used.In Section 5, the SoC was estimated using the extended Kalman filter algorithm.Finally in Section 6, the conclusions of this research are presented.

Electric Model
In this section, an electric model of a Li-ion cell that allowed for the estimation of the electrical behavior is presented.The electrical dynamics are represented by an electric circuit consisting of a voltage source, resistance and a network composed of a capacitor in parallel with a resistor in series with a constant phase element (CPE).

Equivalent Electric Circuit of a Li-ion Cell
The electrical behavior of a battery can be represented by an EEC as shown in Figure 1 [20].This circuit incorporates a CPE called the Warburg element which accurately reflects the behavior of the cell.The Warburg impedance is a component that produces a partially capacitive and resistive behavior with a phase of 45° at low frequency [21].Figure 2 shows a Nyquist diagram of a Li-ion cell obtained in the laboratory, where a 45° phase was observed at low frequency.This type of response can be well represented through the circuit shown in Figure 1.A Warburg element can be expressed in the plane of the frequency in terms of a fractional element as shown in Equation ( 1): where β∈ R, is an arbitrary number 0 ≤ β ≤ 1 [20]; and W∈ R is the Warburg coefficient.The phase of the Warburg element in general is βπ/4 [21].As the phase measured in the laboratory was 45° (π/4), the parameter β was equal to ½.The input impedance of the electrical circuit in Figure 1 can be defined by Equation (2): The Warburg impedance, defined in Equation (1), indicates that the system has fractional properties, therefore it is necessary to introduce the Fractional Order Calculation (FOC) in the model.The fractional calculation involves derivatives and integrals of a non-integer order, which in the particular case of the Warburg impedance, is determined by the parameter β.The latter is a fractional number [22].Equation (3) shows the expression of the Warburg impedance voltage in the plane time, which corresponds to a fractional differential equation: By way of simplification in this paper, we used the notation defined in Equation ( 4), to express a fractional derivative [21]: where r∈ R, is an arbitrary number.
Considering the circuit of Figure 1, the notation defined in Equation ( 4), and the laws associated with the electric circuits, we can obtain the equations that represent the electric model of the battery, which are explained in Equations ( 6)- (8).
The current flowing through the circuit of Figure 1 is represented by Equation ( 5): A Warburg element can be expressed in the plane of the frequency in terms of a fractional element as shown in Equation ( 1): where β ∈ R, is an arbitrary number 0 ≤ β ≤ 1 [20]; and W ∈ R is the Warburg coefficient.The phase of the Warburg element in general is βπ/4 [21].As the phase measured in the laboratory was 45 • (π/4), the parameter β was equal to 1 2 .The input impedance of the electrical circuit in Figure 1 can be defined by Equation ( 2): The Warburg impedance, defined in Equation ( 1), indicates that the system has fractional properties, therefore it is necessary to introduce the Fractional Order Calculation (FOC) in the model.The fractional calculation involves derivatives and integrals of a non-integer order, which in the particular case of the Warburg impedance, is determined by the parameter β.The latter is a fractional number [22].Equation (3) shows the expression of the Warburg impedance voltage in the plane time, which corresponds to a fractional differential equation: By way of simplification in this paper, we used the notation defined in Equation ( 4), to express a fractional derivative [21]: where r ∈ R, is an arbitrary number.
Considering the circuit of Figure 1, the notation defined in Equation ( 4), and the laws associated with the electric circuits, we can obtain the equations that represent the electric model of the battery, which are explained in Equations ( 6)- (8).
The current flowing through the circuit of Figure 1 is represented by Equation ( 5): So: v 1 is the voltage in the capacitor C 1 , I(t) is the current of the circuit in a clockwise direction and v W is the voltage in the Warburg element.In addition, Equation (7) shows the output voltage ratio of the circuit of Figure 1: On the other hand, it is known that the current flowing through resistance R 1 is equal to the current flowing in the Warburg impedance and that in combination with Equations ( 3) and ( 4), one can obtain the voltage in the Warburg impedance expressed in Equation ( 8):

Parametric Identification of the Equivalent Electric Circuit
The EIS is a method commonly used to characterize an electrochemical system [21].In the following sections the application of the EIS in a Li-ion cell is shown, and then how the EEC parameters can be estimated from this technique is described.

Electrochemical Impedance Spectroscopy
Electrochemical impedance spectroscopy is a technique that allows the characterization of electrochemical systems, such as batteries, supercapacitors, etc. [23,24].During the measurements of an EIS, variable frequency voltage sine wave signals are applied and the current response in the cell is recorded for the different frequencies.Impedance is defined as the quotient between the voltage and current.The EIS provides an accurate impedance measurement over a wide range of frequencies, thus providing a unique tool for analyzing the dynamic behavior of batteries [21].
The EIS tests were performed with the AUTOLAB (Santiago, Chile) instrument model PGSTAT302N for the frequency range from 10 mHz to 1 kHz and a cylindrical LiFePO 4 cell type ANR26650 manufactured by A123 Systems (Livonia, MI, USA) was used.The characteristics of the cell were: Voc = 3.35 V, 2.5 Ah. Figure 3 shows the impedance spectrum of the Li-ion cell for different surface temperatures and a SoC of 80%.
Energies 2018, 11, x FOR PEER REVIEW 5 of 16 v1 is the voltage in the capacitor C1, I(t) is the current of the circuit in a clockwise direction and vW is the voltage in the Warburg element.In addition, Equation (7) shows the output voltage ratio of the circuit of Figure 1: On the other hand, it is known that the current flowing through resistance R1 is equal to the current flowing in the Warburg impedance and that in combination with Equations ( 3) and ( 4), one can obtain the voltage in the Warburg impedance expressed in Equation ( 8):

Parametric Identification of the Equivalent Electric Circuit
The EIS is a method commonly used to characterize an electrochemical system [21].In the following sections the application of the EIS in a Li-ion cell is shown, and then how the EEC parameters can be estimated from this technique is described.

Electrochemical Impedance Spectroscopy
Electrochemical impedance spectroscopy is a technique that allows the characterization of electrochemical systems, such as batteries, supercapacitors, etc. [23,24].During the measurements of an EIS, variable frequency voltage sine wave signals are applied and the current response in the cell is recorded for the different frequencies.Impedance is defined as the quotient between the voltage and current.The EIS provides an accurate impedance measurement over a wide range of frequencies, thus providing a unique tool for analyzing the dynamic behavior of batteries [21].
The EIS tests were performed with the AUTOLAB (Santiago, Chile) instrument model PGSTAT302N for the frequency range from 10 mHz to 1 kHz and a cylindrical LiFePO4 cell type ANR26650 manufactured by A123 Systems (Livonia, MI, USA) was used.The characteristics of the cell were: Voc = 3.35 V, 2.5 Ah. Figure 3 shows the impedance spectrum of the Li-ion cell for different surface temperatures and a SoC of 80%.From Figure 3 it can be seen that the impedance spectrum was displaced for different temperatures, which was most likely due to variations in the diffusive behavior, electron transfer effect and electrochemical reactions, such as the, reduction of oxide reaction, magnetic hysteresis of the materials, polarization of the electrodes, and electronic conductivity, among others [25,26].From Figure 3 it can be seen that the impedance spectrum was displaced for different temperatures, which was most likely due to variations in the diffusive behavior, electron transfer effect and electrochemical reactions, such as the, reduction of oxide reaction, magnetic hysteresis of the materials, Energies 2019, 12, 681 6 of 16 polarization of the electrodes, and electronic conductivity, among others [25,26].Therefore, in the parametrization of the electric circuit, the effect of the SoC and the temperature in each parameter must be considered.

Parametric Identification
In order to determine a model for the cell, EIS tests were performed on a Li-ion cell for different values of surface temperature and SoC.The trials ranged between temperatures of 25 • C to 60 • C and from 5% to 100% for the SoC.
The experimental procedure started at 100% of the SoC.The Li-ion cell was subjected to heat through an incandescent halogen lamp inside a chamber with an external temperature controller.Then, the temperature controller was programmed to 20 • C, which corresponded to the initial temperature of the experiment.In order to have a uniform temperature in the cell, the cell was maintained at said temperature for 75 min.By the end of this period, the EIS test was carried out.
The above procedure was repeated every 5 • C until the temperature reached 60 • C. Subsequently, the cell was discharged until the SoC decreased by 10% with respect to the previous SoC and each of the steps above-mentioned was conducted to perform the EIS test.The experimental procedure ended when the SoC was 5%.Therefore, with this experimental procedure, it was possible to obtain the impedance spectrum for different SoC and temperatures, with a total of 88 experiments carried out.
From the experimental data, the parametric identification of a battery EEC was made.This model must provide an estimate as accurate as possible of the behavior of the variables in the cell.In many applications, different algorithms have been implemented to optimize non-linear process models [27][28][29].Considering the high non-linearity presented by this type of adjustment, the evolutionary technique genetic algorithm (GA) [30] was selected among the different methodologies, since it produced the smallest adjustment error.
The optimization problem that was solved consists of minimizing the mean square error between the impedance measured in the EIS and the impedance of the EEC defined in Equation (2).Equation ( 9) presents the optimization model, where the design variables were v = [Rs, R 1 , C 1 , W]: where Z k med is the sample k of the magnitude of the measured impedance in the experiment and, Z k cal is the calculated impedance for the sample k.The EEC parameters obtained through (9) were calculated for the different values of SoC and surface temperature.In this way, 88 sets of parameters were available.
The root mean square relative error (RMSRE) of the impedance spectrum adjustment can be obtained in the following way: First, the root mean square error (RMSE) can be calculated as follows: where n d is the number of experimental data.Then the root mean square of the experimental data (RMSmed) can be calculated as follows: Energies 2019, 12, 681 7 of 16 From the analysis shown above the RMSRE was obtained as follows: Figure 4 shows a comparison in the impedance spectrum setting for SoC = 40% and a temperature of 25 Figure 4 shows a comparison in the impedance spectrum setting for SoC = 40% and a temperature of 25 °C.The RMSRE obtained was 4%.As seen in Figure 4, the adjustment of the impedance spectrum using the set of estimated parameters was reasonable with respect to the experimental data of the Li-ion cell, given that the RMSRE was low.For the set of adjustments made, 88, the average error was around 4%.
Figure 5 shows the results obtained from the parameters of the Li-ion cell for different SoC.The values obtained at different temperatures were superimposed on the same graph.It can be seen that Rs had a high dependence on temperature and SoC.Regarding R1, it tended to decrease when the SoC increased.For C1, it was observed that it tended to increase for a SoC higher than 90% and temperature higher than 45 °C.Finally, W increased up to a SoC equal to 40%, staying almost constant until the SoC was equal 90%, and then it decreased.

Multivariable Model of the Cell
In this section, a multivariable model of each EEC parameter was constructed where the independent variables were the surface temperature of the cell and the SoC.Two methodologies As seen in Figure 4, the adjustment of the impedance spectrum using the set of estimated parameters was reasonable with respect to the experimental data of the Li-ion cell, given that the RMSRE was low.For the set of adjustments made, 88, the average error was around 4%.
Figure 5 shows the results obtained from the parameters of the Li-ion cell for different SoC.The values obtained at different temperatures were superimposed on the same graph.It can be seen that R s had a high dependence on temperature and SoC.Regarding R 1 , it tended to decrease when the SoC increased.For C 1 , it was observed that it tended to increase for a SoC higher than 90% and temperature higher than 45 • C. Finally, W increased up to a SoC equal to 40%, staying almost constant until the SoC was equal 90%, and then it decreased.
Energies 2018, 11, x FOR PEER REVIEW 7 of 16 Figure 4 shows a comparison in the impedance spectrum setting for SoC = 40% and a temperature of 25 °C.The RMSRE obtained was 4%.As seen in Figure 4, the adjustment of the impedance spectrum using the set of estimated parameters was reasonable with respect to the experimental data of the Li-ion cell, given that the RMSRE was low.For the set of adjustments made, 88, the average error was around 4%.
Figure 5 shows the results obtained from the parameters of the Li-ion cell for different SoC.The values obtained at different temperatures were superimposed on the same graph.It can be seen that Rs had a high dependence on temperature and SoC.Regarding R1, it tended to decrease when the SoC increased.For C1, it was observed that it tended to increase for a SoC higher than 90% and temperature higher than 45 °C.Finally, W increased up to a SoC equal to 40%, staying almost constant until the SoC was equal 90%, and then it decreased.

Multivariable Model of the Cell
In this section, a multivariable model of each EEC parameter was constructed where the independent variables were the surface temperature of the cell and the SoC.Two methodologies

Multivariable Model of the Cell
In this section, a multivariable model of each EEC parameter was constructed where the independent variables were the surface temperature of the cell and the SoC.Two methodologies were tested.In the first, empirical equations are used [31], while the second used an Artificial Neural Network (ANN).

Adjustment with Empirical Equations
In the literature different equations have been reported to model the parameters of a battery [31].In this section, we tried to find the empirical equations that best fit the parameters obtained in Section 3.2 of Section 3. The mathematical models chosen were based on polynomial and exponential functions, in terms of SoC and temperature variables.
As can be seen in Figure 5, each parameter was strongly dependent on the SoC and to a lesser degree on the temperature.In this way, it was necessary to analyze each parameter separately.To estimate the coefficients of the equations that represented each parameter, the GA was used.In this case, the optimization model to solve this is shown in Equation ( 13): where X k est is the sample k of one of the parameters (R s , R 1 , C 1 , W) estimated in the impedance spectrum adjustment, while X k cal (u) is the parameter obtained by the empirical equation for the sample k, where u is the design variable, which in our case corresponded to the SoC and surface temperature of the cell.An adjustment was made for each parameter.Finding an equation for the R s parameter is very difficult due to the high variations it has for different SoC and temperature.Equation (14) shows the best equation we found to model parameter R s : R s = (a 1 SOC 4 + a 2 SOC 3 + a 3 SOC 2 + a 4 SOC + a 5 ) • a 6 e ( a 7 T−a 8 ) , (14) For this parameter, all of the coefficient limits were defined between −10 and 10 as shown in Table 1.Like parameter R 1 , in this case, there was less difficulty in finding the equation that represented it.Equation (15) shows the best equation found to model parameter R 1 : For this parameter, all of the coefficient limits were established between −1 and 1, with the exception of parameter b 3 whose upper limit was 30 shown in Table 2. the exponential function began at a low SoC.Furthermore, there was the additional complexity that at high temperature (>50 • C) the behavior of the capacitor changed with respect to other temperatures, which can be seen in Figure 5.The best equation found to model parameter C 1 is defined in Equation ( 16): For this parameter, the coefficient limits were as follows:  3.
For this parameter, the coefficient limits were as follows: −50 ≤ g 1 ≤ 10; −10 ≤ g 2 ≤ 60; −1 ≤ g 3 ≤ 1; −30 ≤ g 4 ≤ 10; −10 ≤ g 5 ≤ 50; −20 ≤ g 6 ≤ 10; −1 ≤ g 7 ≤ 700; and −1 ≤ g 8 ≤ 1, thus obtaining the values that are shown in Table 4. Finally, for the different adjusted models, it was determined that the RMSRE varied in a range between 7% and 34%, which was high for the purposes of this study.Considering this fact, it was decided to try other methodologies in the hope of reducing the adjustment error.For this, the use of an Artificial Neural Network (ANN) was proposed.Section 4.2 details this type of models and the results obtained.

Adjustment with Artificial Neuronal Networks
Consider a problem where, after an experiment has been carried out, information is available that relates a variable to other n v independent variables, that is: y = f(x), where f(x) is a function that relations n v input variables x with an output variable y.
Let the ANN be that as shown in Figure 6, with inputs x 1 , x 2 ; output y, and two hidden layers with three neurons each.w ij is the weighting factors that connect the neuron i with the j [32]: For this parameter, the coefficient limits were as follows: thus obtaining the values shown in Table 3. g T W = (g SOC + g SOC + g SOC + g SOC + g SOC + g ) g e , For this parameter, the coefficient limits were as follows: −50 ≤ g1 ≤ 10; −10 ≤ g2 ≤ 60; −1 ≤ g3 ≤ 1; −30 ≤ g4 ≤ 10; −10 ≤ g5 ≤ 50; −20 ≤ g6 ≤ 10; −1 ≤ g7 ≤ 700; and −1 ≤ g8 ≤ 1, thus obtaining the values that are shown in Table 4. Finally, for the different adjusted models, it was determined that the RMSRE varied in a range between 7% and 34%, which was high for the purposes of this study.Considering this fact, it was decided to try other methodologies in the hope of reducing the adjustment error.For this, the use of an Artificial Neural Network (ANN) was proposed.Section 4.2 details this type of models and the results obtained.

Adjustment with Artificial Neuronal Networks
Consider a problem where, after an experiment has been carried out, information is available that relates a variable to other nv independent variables, that is: y = f(x), where f(x) is a function that relations nv input variables x with an output variable y.
Let the ANN be that as shown in Figure 6, with inputs x1, x2; output y, and two hidden layers with three neurons each.wij is the weighting factors that connect the neuron i with the j [32]: The output of the first layer is given by Equation ( 18):  The output of the first layer is given by Equation ( 18): The output of each neuron can be affected by an activation function, so that y C1 = f (H C1 ), where f(x) can be any function, for example f(x) = x, f(x) = x 2 , f(x) = 1/(1 + e −x ) (sigmoid), etc.
By analogy, the output of layer 2 is expressed in Equation ( 19): w 36 w 37 w 38 w 46 w 47 w 48 w 56 w 57 w 58 Finally, the output in the last layer is given by Equation ( 20): From Equation ( 20) it can be observed that the output of a neural network is numerically speaking a sequential product of vectors by matrices.The network is completely characterized when the values of the input variables and the weighting coefficients are known.For the above-mentioned network there is the n coeff = n v × n C1 + n C1 × n C2 + n C2 coefficient, where n v is the number of input variables, n C1 and n C2 are the number of neurons in layers 1 and 2, these parameters being the unknowns of the problem.The structure defined in Equations ( 18)-( 20) can be used to find a model for the parameters of the Li-ion cell.For this, it is necessary to formulate the optimization problem.In this sense, the objective function can be defined as the mean square error between the parameters obtained in the frequency spectrum adjustment defined in Section 3 and the output delivered by the ANN.The optimization problem that needs to be solved is as shown in Equation ( 21  In Equation ( 21) the design variables are the w ij weighting factors of the network and y i tag corresponds to some of the parameters (Rs, R 1 , C 1 , W) that were estimated in Section 3, where training is required for each of them.It should be remembered that the n d = 88 values are available for each parameter, each of which is linked to a SoC and temperature value.y i train is obtained by the network defined in Equations ( 18)- (20).Equations ( 18)-( 20) were programmed in MATLAB (R2014a, The MatWorks Inc., Torrance, CA, USA), obtaining an algorithm that allowed us to train a network under the supervised learning scheme.The genetic algorithm was used as an optimization technique as delivered the best results in the simulations.The program allows for the use of up to two layers of a neural network and an arbitrary number of neurons per layer.It can be used as an activation function, that can be; linear, quadratic or sigmoid, the latter being the one that delivered the best results.
Table 5 shows a summary of the structure of the neural network used for the estimation of each parameter (R s , R 1 , C 1 , W) by using the sigmoid as an activation function.

Results
Table 6 shows the values of the modeled parameters at SoC = 90% and 25 • C room temperature.Table 7 shows the results of the RMSRE for each parameter estimated using the empirical equation methodology and the ANN.As seen in Table 7, the estimation model with neural networks presented a better performance with respect to the estimation model using empirical equations, since it reduced the estimation error by almost half.
For example, Figure 7 show the estimated data of Rs in the parametric identification in Section 3, in the modeling with equations and in the modeling with the ANN as a function of temperature and SoC, respectively.Table 7 shows the results of the RMSRE for each parameter estimated using the empirical equation methodology and the ANN.As seen in Table 7, the estimation model with neural networks presented a better performance with respect to the estimation model using empirical equations, since it reduced the estimation error by almost half.
For example, Figures 7 show the estimated data of Rs in the parametric identification in Section 3, in the modeling with equations and in the modeling with the ANN as a function of temperature and SoC, respectively.Up until now, great effort has been made to obtain a model as accurate as possible of the cell.The reason for this is that the SoC estimation algorithms of Li-ion cells require models as accurate as possible, as this allow for good quality estimations of SoC to be made.Section 5 explains the methodology chosen to estimate the SoC, known as the extended Kalman filter.Up until now, great effort has been made to obtain a model as accurate as possible of the cell.The reason for this is that the SoC estimation algorithms of Li-ion cells require models as accurate as possible, as this allow for good quality estimations of SoC to be made.Section 5 explains the methodology chosen to estimate the SoC, known as the extended Kalman filter.

Estimation of the SoC
In this section, the extended Kalman filter (EKF) algorithm was used to estimate the SoC of a Li-ion cell.The EKF algorithm has been widely used for SoC estimation [21].This algorithm deals with the general problem of estimating a state x ∈ R n of a process controlled in discrete time that is modeled by a non-linear stochastic difference equation.The EKF is a recursive prediction filter that is based on the use of state-space techniques and recursive algorithms.The non-linear dynamic system is disturbed, and by some noise, mostly corresponds to white noise.To improve the state estimated by the EKF, measurements that relate to the state are used.Therefore, the EKF is divided into a prediction stage and a correction stage [33].
Based on the general model of a non-linear discrete stochastic system in state-space, which is shown in Equation ( 22), the stages and the equations of the EKF algorithm are shown in Figure 8: where Q = E[ww T ] and R = E[rr T ]. prediction filter that is based on the use of state-space techniques and recursive algorithms.The non-linear dynamic system is disturbed, and by some noise, mostly corresponds to white noise.
To improve the state estimated by the EKF, measurements that relate to the state are used.Therefore, the EKF is divided into a prediction stage and a correction stage [33].
Based on the general model of a non-linear discrete stochastic system in state-space, which is shown in Equation ( 22), the stages and the equations of the EKF algorithm are shown in Figure 8: where Q = E[ww T ] and R = E[rr T ].In discrete time, if we consider that the current is constant in the interval ∆t, the SoC can be expressed by Equation (28): In the SoC estimation a Randles model is considered to be as that of Figure 1 but considers β = 1, that is, the constant phase element is considered as a capacitance capacitor C2.
The ratio of the open circuit voltage (VOCV) to the SoC is non-linear.Using the VOCV measured in the laboratory, the VOCV and SoC ratio can be represented by Equation (29).This model was adjusted using the methodology presented in Section 4.
The expressions in Equations ( 6) and ( 8) can be written in the form of state-space in continuous time, which is shown in Equation ( 30): In discrete time, if we consider that the current is constant in the interval ∆t, the SoC can be expressed by Equation ( 23): In the SoC estimation a Randles model is considered to be as that of Figure 1 but considers β = 1, that is, the constant phase element is considered as a capacitance capacitor C 2 .
The ratio of the open circuit voltage (V OCV ) to the SoC is non-linear.Using the V OCV measured in the laboratory, the V OCV and SoC ratio can be represented by Equation (24).This model was adjusted using the methodology presented in Section 4.1: Energies The expressions in Equations ( 6) and ( 8) can be written in the form of state-space in continuous time, which is shown in Equation ( 25 The discrete-time solution of a continuous-state state space model is given by Equation ( 26): x Taking the V OCV expressed by Equation ( 24) in combination with Equation ( 26) and in addition to Equation (7), which corresponds to the output voltage ratio of the circuit of Figure 1, will produce a discrete model in state-space to estimate the SoC using the EKF algorithm.This model is shown in Equation (27): where The state variable is defined as x = [V 1 V 2 SOC] T , the input is u k = i k , and the output is y k = V 0 − 2.0659.The values of P 0 , Qk and R k are difficult to determine, therefore, these parameters were selected by trial and error.The following values were obtained: the initial covariance was P 0 = 2 × 10 −8 , noise process covariance and measurements are Q k = 5 × 10 −8 and R k = 2, respectively.
To adjust the algorithm, experimental data from the Li-ion cell discharge process were used.In this process, a pulse of current is applied to the cell every 45 min until the cell is completely discharged.The experiment starts with the cell fully charged, then the voltage and the current are measured at the terminals of the cell, and the current integration method is used to calculate the SoC as a reference.In this way, the initial SoC in the experiment is known and in this investigation the reference obtained by the Coulomb-counting method was considered as the true SoC.
To estimate the SoC, the discharge current and voltage data of the experimental procedure described above were used.To avoid the temperature of the cell increasing due to the current, the cell discharged with current pulses at a rate of 0.13 C. The temperature of the cell is kept constant at 25 • C and the initial SoC was 100%.Figure 9 shows the results obtained in the estimation of the SoC.The RMSRE obtained was 1.19%, which is similar or less than those found in the literature [4][5][6][7][8][9][10][11][12][13]21].This error is acceptable and it was observed that the prediction of the SoC using EKF, in each instant managed to follow the reference SoC.In each iteration the EKF obtained the output voltage of the model based on the measured current and the state variables.This allowed us to compare the response of the model to the dynamics of voltage measured experimentally.Figure 10 shows the comparison of the output voltage estimated by the algorithm and the experimental voltage.The voltage behavior was due to the discharge current profile, where the current was greater than zero for 45 min and was zero for 75 min.When the current was zero the cell voltage increased until the open circuit voltage was reached, as seen in more detail near the cutoff voltage.Then when the current was greater than zero the cell voltage decreased [14].In Figure 10, it can be seen that the estimated voltage followed the dynamics of the voltage measured in the laboratory.This is due to the fact that an accurate model was used to represent the relationship between VOCV and SoC.

Conclusions
In this research, a method was developed to identify an equivalent electrical circuit of a Li-ion cell.The results obtained showed that the behavior of the cell depends on its SoC and temperature.From the impedance spectrum, a model of a Li-ion cell was derived, where it was verified that the cell had fractional properties.The adjustment by the genetic algorithm allowed the accurate identification of an electrical model of the cell.The uncertainty of the adjustment was 4%, therefore the adjustment provided good accuracy to predict the dynamic effects of the battery.With regard to modeling the parameters based on the SoC and the temperature, the models with neural networks provided better results with a RMSRE of 5% for both the Rs and W. The RMSRE for the parameters R1 and C1 were to be 13% and 10%, respectively.Therefore, the characterization of the cell was carried out under different conditions allowing us to understand the behavior of a Li-ion cylindrical  Figure 10 shows the comparison of the output voltage estimated by the algorithm and the experimental voltage.The voltage behavior was due to the discharge current profile, where the current was greater than zero for 45 min and was zero for 75 min.When the current was zero the cell voltage increased until the open circuit voltage was reached, as seen in more detail near the cutoff voltage.Then when the current was greater than zero the cell voltage decreased [14].In Figure 10, it can be seen that the estimated voltage followed the dynamics of the voltage measured in the laboratory.This is due to the fact that an accurate model was used to represent the relationship between VOCV and SoC.

Conclusions
In this research, a method was developed to identify an equivalent electrical circuit of a Li-ion cell.The results obtained showed that the behavior of the cell depends on its SoC and temperature.From the impedance spectrum, a model of a Li-ion cell was derived, where it was verified that the cell had fractional properties.The adjustment by the genetic algorithm allowed the accurate identification of an electrical model of the cell.The uncertainty of the adjustment was 4%, therefore the adjustment provided good accuracy to predict the dynamic effects of the battery.With regard to modeling the parameters based on the SoC and the temperature, the models with neural networks provided better results with a RMSRE of 5% for both the Rs and W. The RMSRE for the parameters R1 and C1 were to be 13% and 10%, respectively.Therefore, the characterization of the cell was carried out under different conditions allowing us to understand the behavior of a Li-ion cylindrical In Figure 10, it can be seen that the estimated voltage followed the dynamics of the voltage measured in the laboratory.This is due to the fact that an accurate model was used to represent the relationship between V OCV and SoC.

Conclusions
In this research, a method was developed to identify an equivalent electrical circuit of a Li-ion cell.The results obtained showed that the behavior of the cell depends on its SoC and temperature.From the impedance spectrum, a model of a Li-ion cell was derived, where it was verified that the cell had fractional properties.The adjustment by the genetic algorithm allowed the accurate identification of an electrical model of the cell.The uncertainty of the adjustment was 4%, therefore the adjustment provided good accuracy to predict the dynamic effects of the battery.With regard to modeling the parameters based on the SoC and the temperature, the models with neural networks provided better results with a RMSRE of 5% for both the Rs and W. The RMSRE for the parameters R 1 and C 1 were to be 13% and 10%, respectively.Therefore, the characterization of the cell was carried out under different conditions allowing us to understand the behavior of a Li-ion cylindrical cell more precisely.This is

Figure 1 .
Figure 1.The EEC model of the Li-ion cell.

Figure 1 .
Figure 1.The EEC model of the Li-ion cell.

Figure 2
Figure 2 shows a Nyquist diagram of a Li-ion cell obtained in the laboratory, where a 45 • phase was observed at low frequency.This type of response can be well represented through the circuit shown in Figure 1.

Figure 2 .
Figure 2. Nyquist diagram of an experimentally obtained Li-ion cell.

Figure 2 .
Figure 2. Nyquist diagram of an experimentally obtained Li-ion cell.

Figure 3 .
Figure 3. Nyquist diagram of an experimentally obtained Li-ion cell.

Figure 3 .
Figure 3. Nyquist diagram of an experimentally obtained Li-ion cell.

Figure 4 .
Figure 4. Comparison of the experimental and estimated impedance spectrum at SoC = 40% and 25 °C.

Figure 5 .
Figure 5.The EEC parameters for different temperatures.

Figure 4 .
Figure 4. Comparison of the experimental and estimated impedance spectrum at SoC = 40% and 25 • C.

Figure 4 .
Figure 4. Comparison of the experimental and estimated impedance spectrum at SoC = 40% and 25 °C.

Figure 5 .
Figure 5.The EEC parameters for different temperatures.

Figure 5 .
Figure 5.The EEC parameters for different temperatures.

Table 2 .
Coefficient of parameter equation R 1 .shows an exponential type pattern of temperature dependence throughout the measurements.The slope of the exponential function decreased slowly with the SoC, while the rise of Energies 2019, 12, 681 9 of 16

Figure 6 .
Figure 6.Artificial Neural Network with two inputs, two layers and one output.

Figure 6 .
Figure 6.Artificial Neural Network with two inputs, two layers and one output.
. w min ≤ w ≤ w max

Figure 7 .
Figure 7.Estimated Rs with: (a) Parametric identification of the electric model of the cell; (b) the empirical equation; and (c) the ANN, for different SoC and temperatures.

Figure 7 .
Figure 7.Estimated Rs with: (a) Parametric identification of the electric model of the cell; (b) the empirical equation; and (c) the ANN, for different SoC and temperatures.

Figure 10 .
Figure 10.Comparison of the experimental and estimated voltage of the cell.

Figure 9 .
Figure 9. Result of the SoC estimation with EKF.

Figure 10 16 Figure 9 .
Figure10shows the comparison of the output voltage estimated by the algorithm and the experimental voltage.The voltage behavior was due to the discharge current profile, where the current was greater than zero for 45 min and was zero for 75 min.When the current was zero the cell voltage increased until the open circuit voltage was reached, as seen in more detail near the cutoff voltage.Then when the current was greater than zero the cell voltage decreased[14].

Figure 10 .
Figure 10.Comparison of the experimental and estimated voltage of the cell.

Figure 10 .
Figure 10.Comparison of the experimental and estimated voltage of the cell.

Table 1 .
Coefficient of parameter equation R s .

Table 3 .
Coefficient of parameter equation C 1 .

Table 4 .
Coefficient of parameter equation W.

Table 4 .
Coefficient of parameter equation W.

Table 5 .
Structure of the neural network for each parameter.

Table 6 .
Values of each parameter obtained for the models.

Table 7 .
Summary of performance of the models for each parameter.

Table 7 .
Summary of performance of the models for each parameter.