Online diagnosis of supercapacitors using extended Kalman filter combined with PID corrector

Received Mar 22, 2021 Revised Jun 27, 2021 Accepted Jul 13, 2021 Supercapacitors are electrical energy storage devices with a high specific power density, a long cycle life and a good efficiency, which make them attractive alternative storage devices for various applications. However, supercapacitors are subject to a progressive degradation of their performance because of aging phenomenon. Therefore, it is very important to be able to estimate their State-of-Health during operation. Electrochemical Impedance Spectroscopy (EIS) is a very recog-nized technique to determine supercapacitors’ state-of-health. However, it requires the interrup-tion of system operation and thus cannot be performed in real time (online). In this paper, a new online identification method is proposed based on extended Kalman observer combined with a complementary PID corrector. The proposed method allows to accurately estimating supercapacitor resistance and capacitance, which are the main indicators of supercapacitor state-ofhealth. The new online identification method was applied for two voltage/current profiles using two different supercapacitors. The resistance/capacitance estimated by the new method and the conventional EKF were compared with those obtained by an experimental offline method. In comparison with conventional EKF, the capacitance obtained by the new method is significantly more accurate.


INTRODUCTION
Supercapacitors (SCs), also called ultracapacitors or electric double layer capacitors, are electrical energy storage technologies. Compared to batteries, they have a better specific power density, a longer cycle life (over 104 cycles) and a better efficiency [1]. They are also characterized by lower series resistance and a more significant equivalent capacitance [2], [3]. These strengths make them attractive for several applications such as electric or hybrid vehicles for peak power [4]- [6], wind power generation [7], solar power generation [7], [8], or simply consumer electronics [9]- [12]. They can be used independently, or in combination with other energy storage technology such as lead-acid batteries [13], lithium batteries [5], [14] or hydrogen fuel cells [15], [16].
During their operation, supercapacitors are subject to aging, which causes a progressive degradation of their performances. There exist some factors that can accelerate aging mechanisms such as high voltage, high operating temperature, and voltage imbalances that take place when several supercapacitors are  [17]. The industrial expansion of supercapacitors requires a deep understanding of aging mechanisms and the development of techniques for the estimation of their state-of-health (SoH) during operation. Such techniques are very important to predict and anticipate supercapacitor breakdown.
During SC operation, the online identification of its internal resistance and capacitance is important. SC degradation is characterized by an increase of the internal resistance or a decrease of the equivalent capacitance [17], [18]. Therefore, these two parameters constitute good indicators of SC state-of-health. There identification can facilitate the planification of preventive maintenance tasks and improve system safety.
SC resistance and capacitance can be determined based on the impedance measurements using electrochemical impedance spectroscopy (EIS) technique [19], [20]. However, EIS is an offline measurements technique, which means that the system's operation must be interrupted. The objective of the present paper is to develop an online (real-time) identification technique.
Gualous et al. [21] proposed an identification algorithm based on extended Kalman filter (EKF) to estimate buffered energy of a SC used for a solar application. The SC was modeled by three-branch circuit. They assumed that RC circuit parameters are constants with the aging time. In [22] also proposed an online identification technique based on the EKF to estimate the temperature and the state of charge of a supercapacitor. In [23] proposed two real-time observers for the prediction of supercapacitors' capacitance and the resistance. One is based on EKF and the other is based on interconnected observers. Both observers used RC circuit to model supercapacitor. They assumed that capacitance and resistance remain constant. The results obtained by the two online observers are then compared with an offline characterization.
Nadeau et al. [24] developed a technique for the real-time identification of SC resistance and capacitance for vehicular applications. In order to model SC, they chose RC circuit in which the capacitance is assumed to vary linearly with bias voltage. Sliding mode observer with an adaptation gain was used to identify SC internal resistance and capacitance. Based on a Lyapunov-based adaptation law, developed a real-time resistance/capacitance identification method for supercapacitors [25]. Compared to other methods in literature, the stability and the convergence of their method is guaranteed by Lyapunov's direct method. In [26] proposed an online identification scheme based on particle filter (PF) for the estimation of state-ofcharge, SoH and temperature of SC by combining electrical equivalent circuit model and thermal model. They found that the proposed estimation scheme performs SoH estimation with acceptable accuracy. In [27] propounded a nonlinear state-space model for the online estimation of capacitance and resistance of SC. The proposed model takes the capacitance variation and self-discharge effects into account. The estimation error achieved with the proposed model is approximately 5%. According to [28] suggested a procedure integrating fuzzy logic and artificial neural network (ANN) to estimate supercapacitors' internal resistance and capacitance. ANN can be a powerful technique to provide a robust identification for systems that are subjected to uncertainties [29]. However, this technique usually requires long offline tests to have the enough training data.
The EKF becomes a recognized and a widely used technique for state estimation in several nonlinear dynamic systems. One of the advantages of EKF in our case is that it only requires terminal measurement of voltage and current, which can be done during SC operation. However, the main difficulty using EKF in our case consists in setting initial values of the SC parameters. These values must be close to real values. Otherwise, the EKF is unable to accurately identify the correct values of SC parameters (state vector) [21]- [23]. This limitation was also highlighted in this paper (section 5). Unfortunately, it is not always easy to accurately estimate the initial system state. In order to address this limitation, a complementary PID corrector was integrated to EKF scheme in the present paper. In literature, some authors have already investigated the combination between EKF scheme and PID corrector in order to improve systems control [30]- [32]. This combination allows better stability and better convergence [30]- [32]. The novelty of the present paper is to investigate the use of EKF combined with PID corrector to identify SC parameters.
Section 2 presents the experimental procedure used to characterize SC. In section 3, the equivalent circuit model used in our method is presented. In section 4, SC state vector is determined based of the chosen equivalent circuit model. In section 5 the extended Kalman filter scheme is presented. The complementary PID corrector is then detailed in section 6. In section 7, the obtained results are reported and discussed. Finally, conclusion and some future works are recommended in section 8.

EXPERIMENTAL STUDY
In this experimental study, two supercapacitors maxwell technologies BCAP1500 and BCAP350 are subjected to charging and discharging cycles under the two current profiles shown in Figure 1. The applied currents correspond to the real currents during SC operation. A schematic of the experimental bench is  Figure 2. Both bias voltages response ( Figure 3) and applied currents are measured during experiment and saved using the acquisition board NI cDAQ 9178 and LabView software. Sampling time used for voltage/current measurements is set to 0.01s. The experimental bench used is presented in Figure 4. In the sections that follow, the proposed identification method is applied to the two supercapacitors. The internal resistance and capacitance of a SC are affected by operating temperature as demonstrated in [24]. It is thus important to conduct the experiment in a constant temperature. For this reason, the two SCs were placed inside a temperature-controlled chamber in which the temperature is set to a constant value of 65° C. The experimental results obtained at this stage will be used to identify SC parameters for the two SCs using the new online identification method proposed in this paper. It is worth noticing that voltage/current measurements can be done in real time and does not require the interruption of SC operation.
In the second part of this experimental study, the same experimental bench described in the present section is used to apply Maxwell characterization test to the two SCs. Maxwell test is an offline identification test that allows the determination of internal resistance and capacitance. Although maxwell test provides accurate and reliable results [33], it requires the interruption of system operation and therefore, cannot be performed in real time. In the present study, the values of resistance and capacitance obtained by maxwell test are used as reference values to compare the results obtained by the proposed real-time identification method and to assess the accuracy of this method.

Figure 5. Maxwell identification test
The maxwell characterization test is based on the assumption that the SC can be modeled by a simple RC equivalent circuit. More details on this model are given in section 3. Based on this model, the voltage measured on the terminals of the SC can be described as the sum of the voltage on the terminal of a resistor and a capacitor, denoted respectively and . The SC is submitted to the current profile shown in Figure 5. According to Maxwell test procedure [30], and based on voltage response ( Figure 5), internal resistance and capacitance are determined using (1) and (2): (2) The different parameters used in (1) and (2) are illustrated in Figure 5. The internal resistances obtained using maxwell characterization test are respectively = 6.67 × 10 −4 ℎ and = 3.32 × 10 −3 ℎ for supercapacitors BCAP1500 and BCAP350. The capacitances obtained using Maxwell

SUPERCAPACITOR MODELING
In order to model the electrical behavior of a SC, several equivalent electrical circuit models have been proposed in literature. The most common are simple RC model [24], [34], Zubieta model [35], simple pore model [10], CPE model [36], multi-pore model [37], and fractional-Order Model [38]. Increasing circuit sophistication always leads to a more complex formulation and generally requires high computational resources, making it more difficult to identify SC parameters in real time [39], [40]. Zubieta model [35], presented in Figure 6, is a simple model that evaluates the overall real behavior of the supercapacitor. It is composed of a series combination of a resistor and a capacitor which is characterized by variable capacity over time . The capacitor represents the canonical capacitance effect of SCs. The resistor basically represents the electrolyte and electrodes resistances.
It has been proven that the capacitance ( ) varies linearly with the voltage (t) [35], [41], [42]. Therefore, the capacitance ( ) is expressed as a function of voltage (t) using the following linear expression: C 0 is the capacitance value when the voltage U c (t) is null and α is the proportional coefficient. In the rest of this paper, C 0 and α are assumed to be constant.

EXPRESSION OF SC STATE VECTOR
Extended Kalman filter (EKF) allows state estimation of nonlinear dynamic systems during each time period. In our study, the state vector chosen in our work is given in (5).
EKF is used to estimate, at each time period, the state variables of a continuous nonlinear system defined by (6) 1526 Y(t) is the system output, which corresponds to the bias voltage U s (t) in our study. t is the time index, X(t) is the state vector, w(t) is the state noise and v(t) is the measurement noise. The determination of w(t) and v(t) are detailed in section 5. In this section, the determination of A and G is detailed.
We assume that, during a cycle of several charges/discharges, the variation in resistance is negligible. We also consider that the capacitance increases with an almost constant rising slope as a function of the voltage, with a proportional coefficient α. We can thus assume that the variations of resistance R as well as of the proportionality factor α are zero as a function of time: = 0 = 0 The derivative of the voltage at the terminals of capacitor is described as shown in (9): Based on the expression given in (4) and (9), capacitance derivate can be described as shown in (10): Finally, based on previous equations, the derivate of state vector can be expressed as shown in (11): Where: The estimated system output, which corresponds to the voltage at the terminals of the SC, is denoted ( ). It can be expressed as a function of state vector as shown in (13):

EXTENDED KALMAN FILTER SCHEME
One of the advantages of using extended Kalman filter (EKF) is its ability to deal with nonlinear systems, as it is the case capacitance and the bias voltage behavior of SCs. It has been used with success in order to estimate systems states in many applications [16], [18], [19], [29]. Its recursive structure and low computational cost make it suitable for real-time identification of system state parameters. EKF allows the estimation of system state, represented by the state vector in our case, at each time step (in real-time). In addition, EKF only requires terminal measurement of voltage and current, which can be done in real-time. A functional diagram of EKF is presented in Figure 7.
The EKF is used to estimate the state vector X of a system described by (6). In this equation, Y(t) is the system output (voltage at the terminals of the SC). X(t) is the state vector presented in (5). is the time variable. The time increment used for our simulation is set to 0.01s. That corresponds to sampling time used for experimental voltage/current measurements. w(t) and v(t) represent respectively state and measurement noise. In our study, it is assumed that state and measurement noises are white, gaussian, uncorrelated and 1527 centered with zero expectation. It is also assumed that the noises w(t) and v(t) are known respectively by covariance matrices W and V. The accurate determination of W and V terms is difficult since these noises are related to unmodeled dynamics and uncontrolled variability in parameters. In [24] conducted an empirical study using offline datasets to estimate the variance terms, which allows the estimation the terms of covariance matrix W and V. The same procedure is used in the present study to determine W and V. Therefore, the covariance matrix of noise condition is as shown in (14) and (15) = 0.01 The EKF is based on two important steps: prediction and estimation. The first step consists on predicting the state vector X and the covariance matrix of the estimation error P(t), which satisfies as shown in (16): Where, X is the predicted state vector. From (16), a Riccati differential equation is derived to compute P(t): The transition and observation matrices used in the extended kalman filter are defined as the following Jacobians (the first order partial derivative of vector functions): The second step of the extended Kalman observer is the correction step, where the Kalman filter gain K is calculated based on the covariance matrix of the estimation error P(t). Using this gain, the predicted state vector X(t) and the covariance matrix of the predicted measurement error P(t) are updated, which leads to the estimated state X(t) and P(t). Figure 7 shows the functional diagram of the extended Kalman filter. Before using the proposed EKF scheme, it is important to verify the observability of the system. Because of the non-linearity of our system, a linearization around an operation point is required [43], [44]. The observability is then verified around an equilibrium point using the Jacobian matrix ( ) as defined in [45]. After the calculation of ( ), we found that ( ( )) = 4, which correspond to the order of our system. Therefore, our system is observable around its equilibrium point [45]. In the rest of this section, the results obtained using simulation are presented, the limitation of using EKF is explained to highlight the need for complementary correction. then, the proposed PID corrector is presented in the next section. First, simulations have been conducted using conventional EKF scheme explained in the present section (without any correction) for the two supercapacitors and using the cyclic current profiles described in Figure 3. In order to estimate the resistance and capacitance using conventional EKF algorithm, experimental bias voltage is also used (Figure 4) with the same time increment (0.01s). The obtained resistance and capacitance values using conventional EKF algorithm were compared with those obtained using Maxwell test, considered as the reference values. Figure 8 and Figure 9 show the obtained results. As shown in these figures, simulations have been performed using different initial values of capacitance and resistance.  Figure 8 (b) shows that, regardless of the initial value chosen, the resistance converges toward values close to experimental resistance (Maxwell test). The absolute errors between simulated resistance and Maxwell test resistance are respectively 3.71% and 4.02% for BCAP1500 and BCAP350. However, as shown in Figure 9 (a) and Figure 9 (b), the capacitance profile is highly dependent on the initial value. When this later is far from the real value of capacitance, EKF is unable to converge to this real value. As the capacitance is one of the key parameters to diagnosis supercapacitors state-of-health [17], [18], it is very important to accurately identify this parameter during SC functioning. In the rest of this section, the EKF scheme is analyzed to understand why the obtained capacitance is far from the correct value. As explained in section 5, the EKF determines SC state parameters by two important steps: prediction and correction. During prediction step, state parameters are predicted recursively as shown in equation (6). At each time increment t n , the derivate Ẋn of state parameters is first calculated using equation (6). Then, using Euler's method as shown in (20), the state vector X n at time step t n is predicted using the derivate Ẋn and the state vector X n-1 determined at time step t n-1 : Where ∆t is the time span. Since state vector is calculated recursively, the predicted state values at each increment are very dependent on the initial values. Therefore, the slightest error in initial state vector X 0 will be propagated to the other state vectors X 1 ,…,X n . Unfortunately, it is not always easy to accurately estimate the initial system state. Most of the time, the correction step proposed in EKF scheme (section 5) allows to correct the prediction errors associated to misestimation of initial state vector. This is one of the benefits of correction step, proposed in EKF scheme. Using the gain K, the state vector X P predicted at the first step of EKF scheme can be corrected as shown in (21). This includes the prediction errors associated to misestimation of initial state vector.
Where X C is the corrected state vector and Err is the error between simulated bias voltage U s and experimental bias voltage Y. The error Err is determined as shown in (22): In our case, the simulated bias voltage U s is obtained by: As can be seen in (23), among the four state parameters U c , R, C and α, only supercapacitor voltage U c and equivalent resistance R are used to estimate bias voltage U s . The other parameters C and α are not used. Consequently, the correction term K × Err depends only on U c and R. Once the two parameters U c and R are corrected, the error Err tends towards zero. Therefore, the correction term K × Err also tends towards zero. As a consequence, the parameters C and α are no longer corrected. This explains why any error in initial value is propagated to all the other values.

COMPLEMENTARY PID CORRECTOR
For an effective capacitance correction, the bias voltage simulated during correction step must be determined considering the value of capacitance. Based on Zubieta model (Figure 6), the voltage on the terminals of SC can be expressed by: Where U 0 is the voltage on the terminals of the capacitor when t = 0s. Considering time discretization, the bias voltage can be approximated by: Unlike the bias voltage expressed in (23), as shown in (25) takes into account the capacitance. Therefore, the bias voltage expressed in (25) will be used in the complementary correction of capacitance. A proportional-integral-derivative corrector (PID corrector) is a control loop that use feedback results to correct system output. Because of its high efficiency, PID is a widely used corrector in industrial area. It is very appropriate to system requiring continuous correction, which corresponds to the present case. At each time increment, the error value, expressed in (26), is calculated as the difference between simulated bias voltage U sc (t n ) and experimental bias voltage Y(t n ). It is worth noticing that bias voltage U sc (t n ) is estimated in this case using (25). Therefore, the capacitance is considered in the estimation of bias voltage. Based on this error, a correction is applied to the capacitance at each time increment based on proportional (P), integral (I) and derivate (D) as expressed in (27).
C predicted represents the capacitance obtained in prediction step of EKF. C corrected represents the corrected capacitance. K P , K I and K D denote the coefficients for the proportional, integral, and derivative correction terms respectively. Figure 10 represents the functional diagram of extended Kalman filter combined to PID corrector.

RESULTS AND DISCUSSION
Using the new algorithm described in Figure 10 (EKF scheme combined to the complementary PID) and the cyclic current/voltage profiles presented above, simulations have been executed for the two different supercapacitors BCAP1500 and BCAP350. As the first simulations, different initial values of capacitance/resistance are tested. The results are presented and discussed in the present section. In Figure 11 (a) and Figure 11 (b), a comparison is made between the simulated bias voltage obtained by the new algorithm and the experimental bias voltage. We can clearly see that the two profiles remain very close throughout the simulation for the two SC. The maximum errors between simulated and experimental bias voltage for BCAP1500 and BCAP350 are respectively 0.007V (0.3%) and 0.01V (0.4%). These results clearly demonstrate the ability of the new algorithm to accurately simulate the bias voltage.
The real-time evolution of capacitance obtained using the new algorithm is depicted in Figure 12. In this figure, the capacitance obtained by simulation is compared to the capacitance obtained using Maxwell test, considered as the reference value. As can be seen in this figure, the simulation was performed using different initial values of capacitance in order to assess the ability of the new algorithm to deal with errors associated to misestimation of initial capacitance. From Figure 12 (a) and Figure 12  that, regardless of the initial value used, the capacitance converges towards the value obtained by Maxwell test, contrary to the same simulations carried out without PID corrector (Figure 9). This convergence is the result of the PID corrector integrated to the EKF scheme. At the end of simulation, the errors between capacitance obtained by the proposed method and obtained by Maxwell test are respectively 1.02% and 2.87% for BCAP1500 and BCAP350. By comparing the two Figures 9 and 12 the same initial values are used for both simulations. The capacitance results obtained using EKF show a divergence from the Maxwell value which depends perfectly on the initial value proposed however, by analyzing the results of the simulation using EKF with PID corrector; we see that the capacitance converges towards the optimal value (Maxwell capacitance) and does not depend on the initial value. We note from results obtained in sections 5 and 7 that the use of the PID corrector has a great influence on the convergence of the capacity whatever its initial value. This new method (EKF combined with PID corrector) characterized by a maximum reliability and minimum response time. Regarding the resistance, the results obtained with the new algorithm are the same of those obtained with EKF without PID corrector (presented in Figure 8). In the case of resistance, the correction step integrated in EKF is enough (Figure 7). The PID corrector proposed in this paper act only on capacitance.

CONCLUSION
In this paper, a new online identification method applied to supercapacitor is proposed and tested on two different supercapacitors. The proposed method is based on extend Kalman filter combined with a PID corrector. The supercapacitor was modeled using the equivalent electrical circuit of Zubieta. The proposed method allows the online identification of SC capacitance and internal resistance, which are the main indicators of SC state-of-health. Unlike other identification method, such as electrochemical impedance 1532 spectroscopy or Maxwell test, the proposed method doesn't require the interruption of system operation. The proposed method only requires current and bias voltage measurement, which can be performed online and with only two sensors. It has been found that, when the initial capacitance value is far from the real value, the extended Kalman filter is unable to accurately determine the correct value of capacitance. For this reason, a complementary PID corrector was integrated to EKF in this paper. The capacitance value obtained using the new algorithm is very closed to the capacitance obtained using Maxwell test, even when the initial value of capacitance is far from the correct value. The absolute errors found are 1.02% and 2.87% for BCAP1500 and fBCAP350. Regarding the resistance, the values obtained by the proposed method are also very closed to those obtained with EKF. The absolute errors found are 3,71% and 4.02% respectively for BCAP1500 and BCAP350. In the case of resistance, the correction step integrated in EKF is enough. In future contributions, the identification method proposed in this paper will be applied to other equivalent electrical circuits such as multi pore model and simple pore model. The obtained results will be compared to select the most accurate model. Then, SC ageing phenomena will be investigated in the goal to evaluate EDLC state of health and predict the remaining lifetime using the estimated resistance and capacitance of the SC.