Implementation of Parameter Observer for Capacitors

This paper describes the implementation of a parameter observer (PO) intended to estimate the capacitance and equivalent serial resistance of a capacitor (ESR). The implemented observer consists of a dynamic second-order discrete-time system. The input signal of the observer is the voltage at the terminals of the capacitor measured during its discharge across a variable resistance in two steps. The implemented observer can be used in quasi-online or offline mode. The theoretical and experimental supporting materials provide a comprehensive picture of the implementation and conditions of use of the PO. The experimental verification was carried out with a microcontroller with Cortex®-M7 core architecture. The sampling time of the PO was 20 μs, and the estimation of the parameters was obtained before the end of the discharge of the capacitor. In the cases described in the paper, this means approximately 25 ms. Due to the PO’s capabilities (estimation speed, reduced computational complexity and precision)—proved by the experiments carried out on three electrolytic capacitors of 100 μF, 220 μF and 440 μF—the implementation is of interest for several applications, primarily in the field of power electronic applications.


Introduction
Electric capacitors are passive electrical devices that are indispensable for electrical circuits in electronic applications, hereinafter referred to as processes. In designing the circuits, depending on the operating regimes to which the capacitors are subjected in the processes, we use several topologies of electrical models, from the simple capacity, or capacity in series with a resistance, to models with more capacities, resistances and inductances. In this context, the parameters of the models are called equivalent parameters of a capacitor.
In many processes, capacitors play key roles in filtering and storing energy, being indispensable elements. As an example, we mention the aluminum electrolytic capacitors used in power electronic converters and in the circuits of photovoltaic panels (solar PV). In general, we must refer to their applications in power electronics [1][2][3]. The use and ageing of the capacitor changes the values of its parameters over time and thereby renders it vulnerable in fulfilling its role. The modification alters the performance of processes, leading to their failure. When referring to the R-C series electrical model of a capacitor, the change manifests as a decrease in the value of the equivalent capacitance and an increase in the ESR. Consequently, these two parameters are considered indicators of the state of the capacitor, and monitoring their values is vital [4]. An ample specialized literature deals with this topic. As the case may be, the approaches are restricted to monitoring or are integrated into applications based on monitoring, e.g., identification, capacitor health monitoring, fault diagnosis, operational safety assurance, parameter variation compensation, etc. [1,[5][6][7][8][9][10].
Various principles are used for monitoring the equivalent parameters of capacitors. One of these is based on the use of observers [11]. Usually, observers are used to dynamically estimate either endogenous or exogenous state variables of processes, combinations thereof, or signals that are functions of state variables. Observers are used for a large range of applications, including in the field of sensors. For instance, the authors of [12] proposed a nonlinear observer for the estimation of the current ripple in a ferrite-core inductor, and the work in [13] introduced a dual-observer to estimate the filter output current and voltage for a sensorless field-oriented control drive. Different from the observers mentioned, the authors of [11] recently proposed a parameter observer for estimating the equivalent values C e and R se of an R-C serial model of a capacitor. This does not estimate the state variables, but rather the time constants of several first-order linear circuits that appear during the two-stage discharge of the capacitor. From a dynamic point of view, the discharge corresponds to the free regime of a first-order linear system, the signal having the dynamic characteristics of the system's impulse response. The parameter observer is a second-order dynamic system in discrete time that has a single input signal, namely, the one for which it calculates the equivalent time constant. The use of a single input signal makes it more reliable and less vulnerable to disturbances.
Often, we investigate the behavior of capacitors using the frequency characteristics of impedance, capacitance and ESR, i.e., Z(f ), C(f ) and R se (f ), respectively [14][15][16]. The fact that C(f ) and R se (f ) are not constant shows that the parameters of the capacitor change during dynamic operating regimes, whereby the voltage across the capacitor terminals varies in time. In this context, the "equivalent" attribute takes on an additional connotation, referring not only to the model associated with the capacitor and to its operating regime.
From the perspective of the evaluation of capacitors in relation to the processes in which they are involved, evaluation methods of capacitor parameters are considered to be of three types: online, off-line and quasi-online [17]. In principle, online methods are those that do not involve interventions to separate the capacitor from the process, offline methods assume the detachment of the capacitor from the process, and quasi-online methods require a short-term interruption of the process without requiring interventions in the process. This last type includes, for example, all processes that do not have a continuous operation.
This paper presents a real-time implementation of the PO proposed in [11]. The implementation concerns the quasi-online type of application. The main contribution of this paper is to design the PO implementation structure and to illustrate its capabilities in real cases. The novelties introduced in this paper compared to [11] are:

•
The implementation of a PO on a microcontroller and its validation on electrolytic capacitors.

•
The real-time estimation of the values C e and R se of the capacitor during the discharge process, which is about 20 ms. • An improvement of the estimation method for the time-equivalent constants used to calculate C e and R se .
The remainder of the article is organized as follows. In Section 2, the underpinning theory of the PO is presented synthetically, and the hardware and software aspects related to the implementation on a microcontroller are analyzed in detail. Section 3 presents the implementation of the PO in the case of three different capacitors and summarizes the experimental results. Section 4 includes discussions on the experimental results, emphasizing some aspects of PO implementation in applications. Section 5 concludes the entire paper by highlighting the PO's expediency. In this section, we summarize under points 1 and 2 the results from [11], which represent the theoretical support of this paper.

1.
The time-varying parameter T(t) of the non-autonomous, first-order, unforced dynamical system (1) with properties (2) can be determined using the discrete-time parameter observer (3).
PO − T : (3) Figure 1 contains the block diagrams associated with these equations. The S and PO-T blocks in Figure 1a correspond to the Equations (1) and (3), respectively, withT being the estimate of T. In (3), y[k] represents the sample of y(t) at the moment t = k·h, h being the constant sampling period of the system, and k ∈ N. The block diagram in Figure 1b shows the structure corresponding to Equation (3) of PO-T. In this section, we summarize under points 1 and 2 the results from [11], which represent the theoretical support of this paper.
( ) > 0,( ) < 0. (3) Figure 1 contains the block diagrams associated with these equations. The S and PO-T blocks in Figure 1a correspond to the Equations (1) and (3), respectively, with ̂ being the estimate of . In (Equation (3)), [ ] represents the sample of ( ) at the moment = • ℎ, ℎ being the constant sampling period of the system, and ∈ . The block diagram in Figure 1b shows the structure corresponding to Equation (3) of PO-T. Since ( ) is unknown, and the value (0) is not fixed, the values ̂ and ̂ are initialized arbitrarily. Consequently, {̂[ ]} ∈ calculated by PO will always contain a transient interval to be omitted. For this reason, only the discrete time signal {̂[ ]} ≥ , ∈ is considered for later use. The value of 0 shall be chosen in such a way that from this moment on, the transient interval is practically finished. [11] is to determine the equivalent capacitance of a capacitor during a discharging process over a resistor, when the variation in the voltage at the capacitor terminals is assimilated to ( ) in Equation (1).

The main application considered in
As shown in [14], the procedure takes into account the capacitance and variations during the discharging processes. The value of is calculated from two equivalent values ̂1 and ̂2 of ( ) corresponding to a two-stage capacitor discharge produced by a stepwise modification of the resistance of the discharge resistor. The "equivalent" attribute refers to the fact that, replacing ( ) from Equation (1) with the values ̂1 and ̂2 , the solutions of Equation (1) on the calculation intervals approximate very well the variations in ( ) over the corresponding time intervals. If the discharge resistance has the values 1 and 2 , respectively, during the two stages, then the capacitor's Since T(t) is unknown, and the value y(0) is not fixed, the valuesẑ o andĉ o are initialized arbitrarily. Consequently, {T[k]} k∈N calculated by PO will always contain a transient interval to be omitted. For this reason, only the discrete time signal {T[k]} k≥k o ,k∈N is considered for later use. The value of k 0 shall be chosen in such a way that from this moment on, the transient interval is practically finished.

2.
The main application considered in [11] is to determine the equivalent capacitance C e of a capacitor during a discharging process over a resistor, when the variation in the voltage at the capacitor terminals is assimilated to y(t) in Equation (1).
As shown in [14], the procedure takes into account the capacitance and ESR variations during the discharging processes. The value of C e is calculated from two equivalent valueŝ T e1 andT e2 of T(t) corresponding to a two-stage capacitor discharge produced by a stepwise modification of the resistance of the discharge resistor. The "equivalent" attribute refers to the fact that, replacing T(t) from Equation (1) with the valuesT e1 andT e2 , the solutions of Equation (1) on the calculation intervals approximate very well the variations in y(t) over the corresponding time intervals. If the discharge resistance has the values R ext1 and R ext2 , respectively, during the two stages, then the capacitor's equivalent capacitanceĈ e and the equivalent resistanceR se (i.e., ESR) are obtained using Equation (4).  Figure 2a,b exemplify, according to [11], the two discharge stages of an electrolytic capacitor of 100 µF over a variable resistor, with R ext1 = 29.89 Ω and R ext2 = 10.35 Ω. The voltage y(t) measured at the capacitor terminals is represented in blue, and its estimated y[k] = exp(ẑ[k]) is represented in red. Figure 2c,d show the observer's response {T[k]} k∈N to these input signals for K p = 2 × 10 4 s −1 , K i = 10 8 s −2 and h = 0.5 µs. We remark that the signal {ŷ[k]} does not instantly follow the measured value y(t). The mentioned transient process occurs. Its extended span, t 0 , can be influenced by the values of K p and K i . The values of t 0 and k 0 are related by the formula k 0 = [ t 0 h ]. For the above example, we considered t 0 = 1 ms. At the same time, we observe that {T[k]} k≥k o ,k∈N displays oscillations. They are caused by measurement and processing noises. To attenuate these oscillations, we complete the output adapter with the averaging operation (5).
Thus, we obtain the variations in Figure 2e,f. equivalent capacitance ̂ and the equivalent resistance ̂ (i.e., ) are obtained using Equation (4).
(4) Figure 2a,b exemplify, according to [11], the two discharge stages of an electrolytic capacitor of 100 μF over a variable resistor, with 1 = 29.89 Ω and 2 = 10.35 Ω. The voltage ( ) measured at the capacitor terminals is represented in blue, and its esti- ]. For the above example, we considered 0 = 1 . At the same time, we observe that {̂[ ]} ≥ , ∈ displays oscillations. They are caused by measurement and processing noises. To attenuate these oscillations, we complete the output adapter with the averaging operation (Equation (5)).
Thus, we obtain the variations in Figure 2e,f. Under the conditions of the experiments performed in [11], we determined the values ofT e1 andT e2 with the "bisector method". This method states thatT e1 andT e2 take the values ofT m from the points marked in red in Figure 2e,f. The application of the bisector method is detailed in Appendix A.
2.1.2. The Influence of the Estimation Accuracy ofT e1 andT e2 on the Calculated Values of the Capacitor Parameters Appendix B presents a study concerning the impact of estimation errors of the values ofT e1 andT e2 on the equivalent values C e and R se calculated in accordance with Equation (4). The conclusions that emerge based on this study are the following:

•
To measure the equivalent parameters of capacitors by the method of discharging capacitors in two stages over external resistors, as presented in [11,18], the values of T e1 andT e2 must be estimated with the best possible accuracy.

•
As the accuracy of calculating the values ofĈ e is much higher than that of calculating the values ofR se , the method is suitable for both measuring the value of C e and for monitoring the values of C e . • Under the assumption that the deviations ∆T e1% and ∆T e2% are kept within constant but restricted limits, the method can also be used for monitoring the variations in R se , the monotony of its variations being maintained over time.
2.2. Implementation of the Parameter Observer 2.2.1. PO−T Implementation Flowchart Figure 3 shows the time diagram of the online calculation method of the C e and R se parameters of a capacitor, corresponding to the method presented in Section 2.1.1. The charging of the capacitor occurs in time interval I, and the first discharge occurs at time intervals II and III. The second discharge stage corresponds to intervals IV and V. The intervals II and IV correspond to the transient regimes of PO-T and are not used for calculating the parameters. The intervals III and V are used to calculate T e1 and T e2 , respectively. At the end of interval V, we proceed with the calculation of the capacitor's parameters.
values of from the points marked in red in Figure 2e,f. The application of the method is detailed in Appendix A.
2.1.2. The Influence of the Estimation Accuracy of ̂1 and ̂2 on the Calculated of the Capacitor Parameters Appendix B presents a study concerning the impact of estimation errors of th of ̂1 and ̂2 on the equivalent values and calculated in accordance wi tion (4). The conclusions that emerge based on this study are the following:

•
To measure the equivalent parameters of capacitors by the method of disc capacitors in two stages over external resistors, as presented in [11,18], the v ̂1 and ̂2 must be estimated with the best possible accuracy.
• As the accuracy of calculating the values of ̂ is much higher than that of ing the values of ̂, the method is suitable for both measuring the value o for monitoring the values of .

•
Under the assumption that the deviations ∆̂1 % and ∆̂2 % are kept within but restricted limits, the method can also be used for monitoring the variation the monotony of its variations being maintained over time. Figure 3 shows the time diagram of the online calculation method of the parameters of a capacitor, corresponding to the method presented in Section 2 charging of the capacitor occurs in time interval I, and the first discharge occur intervals II and III. The second discharge stage corresponds to intervals IV and intervals II and IV correspond to the transient regimes of PO-T and are not used culating the parameters. The intervals III and V are used to calculate 1 and 2 tively. At the end of interval V, we proceed with the calculation of the capacitor' eters. The application of the time diagram is carried out according to the simplified f in Figure 4. The TIME MANAGER block manages the discrete time correspondi continuous time with the sampling period ℎ. As a result, in the time diagram, The application of the time diagram is carried out according to the simplified flowchart in Figure 4. The TIME MANAGER block manages the discrete time k corresponding to the continuous time t with the sampling period h. As a result, in the time diagram, the values 0, t p , t p + t 0 , · · · , t f are multiples of k according to the equation t = k·h. In each sampling period, the input signal y is acquired ("Acquisition of y k " block). In the intervals II-IV,T is calculated using Equation (3). The valuesT e1 andT e2 are calculated in the intervals III and V, respectively, with Equation (5) and the method detailed in Appendix A.

PO−T Implementation Flowchart
nsors 2023, 23, x FOR PEER REVIEW ues 0, , + 0 , ⋯ , are multiples of according to the equation = • ℎ. pling period, the input signal is acquired ("Acquisition of " block). In the IV, ̂ is calculated using Equation (3). The values ̂1 and ̂2 are calculated in th and V, respectively, with Equation (5) and the method detailed in Appendix A.  Figure 5 shows the simplified flowchart for the calculation of ̂1 and ̂2 eter stage is initialized with the value 1, which is maintained during the fir stage. Later, when new variables are initialized in the second stage, it takes The parameter 0 takes the value 0 corresponding to the moment + = 1 and the value 0 corresponding to the moment + 0 when stage = 2, Likewise, the parameter takes the value 0 − corresponding to th when stage = 1 and the value corresponding to the moment when stag tively.
represents an internal variable used to memorize the 's values.   Figure 5 shows the simplified flowchart for the calculation ofT e1 andT e2 . The parameter stage is initialized with the value 1, which is maintained during the first download stage. Later, when new variables are initialized in the second stage, it takes the value 2. The parameter k ps0 takes the value k p0 corresponding to the moment t p + t 0 when stage = 1 and the value k s0 corresponding to the moment t s + t 0 when stage = 2, respectively. Likewise, the parameter k s f takes the value k s0 − k o corresponding to the moment t s when stage = 1 and the value k f corresponding to the moment t f when stage = 2, respectively. T rez represents an internal variable used to memorize the T e 's values. The variable S[k], representing the sum in Equation (5), is initialized as 0 in both stages.

Hardware Support
The schematic used to measure the equivalent capacitance and ESR o represented in Figure 6. It is based on an i.MX RT1062 microcontroller with of NXP core architecture [19], which assures, through the outputs P1 and of the capacitor's discharge process. The control signals and the output sig in Figure 7. The numerical values in this subsection refer to capacitor 1C fr

Hardware Support
The schematic used to measure the equivalent capacitance and ESR of a capacitor is represented in Figure 6. It is based on an i.MX RT1062 microcontroller with a Cortex ® -M7 of NXP core architecture [19], which assures, through the outputs P1 and P2, the control of the capacitor's discharge process. The control signals and the output signal are shown in Figure 7. The numerical values in this subsection refer to capacitor 1C from Section 3.

Hardware Support
The schematic used to measure the equivalent capacitance and ESR of a capacitor is represented in Figure 6. It is based on an i.MX RT1062 microcontroller with a Cortex ® -M7 of NXP core architecture [19], which assures, through the outputs P1 and P2, the control of the capacitor's discharge process. The control signals and the output signal are shown in Figure 7. The numerical values in this subsection refer to capacitor 1C from Section 3.   The input signal = is acquired and converted into digital format. Then, the microcontroller, according to the PO-T algorithm, processes it. To reduce the influence of the input impedance of the microcontroller's sampling circuit over the discharge process, we inserted the operational amplifier IC1 as a voltage repeater with high input impedance and low output impedance. The IC1 is powered from +5 V supply, assuring the expected linearity in the computed range (0.6 ÷ 3.3 V). The microcontroller includes a single-and a double-precision floating-point calculation architecture corresponding to the VFPv5 generation, ensuring a fast execution time for the most complex mathematical operations corresponding to PO-T. For example, for calculating a logarithm of a real simple precision number (float), the execution time is about 1 μs.
Before the beginning of the discharge, the signal P1 ensures the saturation of the bipolar transistor T1 that keeps the P-MOS transistor T2 open, and thus, the capacitor C is charged through the resistor R3 until time p . Simultaneously, the P2 signal keeps the transistor T3 saturated and the N-MOS transistor T4 consequently blocked, disconnecting the resistor from parallel connection with capacitor C. In this way, the charging of the capacitor, up to the moment p , is achieved with the electric current provided by the Power Supply 2 voltage source (+3.3 V) passing through T2 and R3.
At the moment , the microcontroller blocks the transistor T1 through the signal P1, and the transistor T2 stops the charging of the capacitor C followed by its discharging through the load resistor resulting in the first discharge stage. Within this, the discharging process is characterized by the time constant 1 determined by the capacitance , serial resistance of the capacitor C and the resistance = 100 Ω. At the moment s , the microcontroller blocks the transistor T3 through the signal P2 and consequently opens the transistor T4 that connects the additional resistor = 100 Ω in parallel with the load resistor . Thus, starting with moment s , the process continues with the second discharge stage with a lower time constant 2 determined by a lower equivalent resistance ( in parallel with ). The Power Supply 1 (+5 V) is used to ensure a higher voltage level on the gate of the transistor T4, to determine a minimum resistance in its conduction state, negligible in relation to the additional resistance that modifies the time constant of discharge (from 1 to 2 ).
Note that, from the viewpoint of Equation (4), represents 1 , and  = 50 Ω represents 2 . For the first stage, we chose the discharging time interval s − ≅ 10 ms, approximately equal to the time constant of the circuit corresponding to the nominal capacitance and to 1 . Analogically, the time interval of the second stage was chosen f − ≅ 5 ms. To establish the value of the sampling period, we performed, using the MATLAB environment, a Fourier analysis on the signal ( ) corresponding to an entire discharge The input signal y = v C is acquired and converted into digital format. Then, the microcontroller, according to the PO-T algorithm, processes it. To reduce the influence of the input impedance of the microcontroller's sampling circuit over the discharge process, we inserted the operational amplifier IC1 as a voltage repeater with high input impedance and low output impedance. The IC1 is powered from +5 V supply, assuring the expected linearity in the computed range (0.6 ÷ 3.3 V). The microcontroller includes a single-and a double-precision floating-point calculation architecture corresponding to the VFPv5 generation, ensuring a fast execution time for the most complex mathematical operations corresponding to PO-T. For example, for calculating a logarithm of a real simple precision number (float), the execution time is about 1 µs.
Before the beginning of the discharge, the signal P1 ensures the saturation of the bipolar transistor T1 that keeps the P-MOS transistor T2 open, and thus, the capacitor C is charged through the resistor R3 until time t p . Simultaneously, the P2 signal keeps the transistor T3 saturated and the N-MOS transistor T4 consequently blocked, disconnecting the resistor R A from parallel connection with capacitor C. In this way, the charging of the capacitor, up to the moment t p , is achieved with the electric current provided by the Power Supply 2 voltage source (+3.3 V) passing through T2 and R3.
At the moment t p , the microcontroller blocks the transistor T1 through the signal P1, and the transistor T2 stops the charging of the capacitor C followed by its discharging through the load resistor R L resulting in the first discharge stage. Within this, the discharging process is characterized by the time constant T e1 determined by the capacitance C e , serial resistance R se of the capacitor C and the resistance R L = 100 Ω.
At the moment t s , the microcontroller blocks the transistor T3 through the signal P2 and consequently opens the transistor T4 that connects the additional resistor R A = 100 Ω in parallel with the load resistor R L . Thus, starting with moment t s , the process continues with the second discharge stage with a lower time constant T e2 determined by a lower equivalent resistance (R L in parallel with R A ). The Power Supply 1 (+5 V) is used to ensure a higher voltage level on the gate of the transistor T4, to determine a minimum resistance in its conduction state, negligible in relation to the additional resistance R A that modifies the time constant of discharge (from T e1 to T e2 ).
Note that, from the viewpoint of Equation (4), R L represents R ext1 , and R L R A = 50 Ω represents R ext2 .
For the first stage, we chose the discharging time interval t s − t p ∼ = 10 ms, approximately equal to the time constant of the circuit corresponding to the nominal capacitance and to R ext1 . Analogically, the time interval of the second stage was chosen t f − t s ∼ = 5 ms.
To establish the value of the sampling period, we performed, using the MATLAB environment, a Fourier analysis on the signal y(t) corresponding to an entire discharge in only one stage. The result revealed a spectrum with significant components up to 25 kHz. For this reason, the processing of the signal y(t) according to Shannon's theorem requires a minimum sampling frequency of 50kHz and a sampling period of 20 µs, respectively. For this frequency, considering the range of the microcontroller conversion time 0.7 µs ÷ 1.25 µs, it follows that the time left for digital processing is 20 − 1.25 = 18.75 µs. According to the microcontroller data sheet, the conversion error of the microcontroller is 3.4 LSB for 12 bits and 1.2 LSB for 8 bits [19]. The maximum sampling frequency is 420 kHz for 12-bit resolution. Due to these data, the maximum oversampling factor is (420/50) = 8 samples/processing period. Taking into consideration these aspects, we performed comparative experiments for 8-, 10-and 12-bit sampling resolutions in parallel with simple sampling technique and oversampling with averaging techniques [20]. Finally, we adopted 8× oversampling with a 12-bit resolution. That means an oversampling frequency of 400 kHz with 2.5 µs period.
The timing of these operations is illustrated in Figure 8. The discharge voltage curve is depicted with the samples taken by the analog-to-digital converter. For every 8 samples in only one stage. The result revealed a spectrum with significant com to 25 kHz. For this reason, the processing of the signal ( ) according to Sh rem requires a minimum sampling frequency of 50 kHz and a sampling pe respectively. For this frequency, considering the range of the microcontroll time 0.7 μs ÷ 1.25 μs , it follows that the time left for digital processing i 18.75 μs. According to the microcontroller data sheet, the conversion error controller is 3.4 LSB for 12 bits and 1.2 LSB for 8 bits [19]. The maximum quency is 420 kHz for 12-bit resolution. Due to these data, the maximum factor is (420/50) = 8 samples/processing period. Taking into consideration we performed comparative experiments for 8-, 10-and 12-bit sampling resol allel with simple sampling technique and oversampling with averaging tec Finally, we adopted 8× oversampling with a 12-bit resolution. That me sampling frequency of 400 kHz with 2.5 μs period.
The timing of these operations is illustrated in Figure 8. The discharge is depicted with the samples taken by the analog-to-digital converter. For ev averaged, a value [ ] is used to calculate ̂[ ]. To perform the necessary sampling and processing operations, we use library included in the Teensyduino add-in [21]. Calling these parameters i object corresponding to the abovementioned values. The reading of the sa formed in an interrupt service routine (ISR) triggered by an internal timer a The circuit in Figure 6 was implemented on a test module, as shown in As a result, we developed an application program running with an oversampling period of 2.5 µs and an equivalent sampling period h = 20 µs. Mainly, a processing cycle contains the acquisition by oversampling, computing the average value v[k] and computinĝ T m [k].
To perform the necessary sampling and processing operations, we used the ADC.h library included in the Teensyduino add-in [21]. Calling these parameters instantiates an object corresponding to the abovementioned values. The reading of the samples is performed in an interrupt service routine (ISR) triggered by an internal timer at 20 µs.
The circuit in Figure 6 was implemented on a test module, as shown in Figure 9. Sensors 2023, 23, x FOR PEER REVIEW 10 of 18 Figure 9. The test module for implementing PO.

Results
To investigate the possibilities of experimentally determining the values of the parameters and of a capacitor using the PO, experiments were carried out with three capacitors as follows: The study was conducted on the basis of the following scenario: for each of the three capacitors, 5 series of 20 experiments were carried out with the schematic in Figure 6, consisting of repeating the scenario in Figure 3 at intervals of approximately 2  3 min between two successive experiments. During all series of experiments, the temperature was approximately 22 ℃.
The main goal pursued in each individual series was the precision of the values obtained with the PO for ̂1 , ̂2 , and . Table 1 refers to the results obtained. All values in this table are truncated. We have written in blue, black and, respectively, dark red the values obtained experimentally with the PO for the capacitors 1C, 2C and 3C. The columns written on a white background contain four average values ̂1 , ̂2 , and , as well as four sample standard deviations related to the average values, expressed as a percentage according to Equation (6): The last four columns, written on a light-blue background, refer to the last experi-

Results
To investigate the possibilities of experimentally determining the values of the parameters C and R s of a capacitor using the PO, experiments were carried out with three capacitors as follows: The study was conducted on the basis of the following scenario: for each of the three capacitors, 5 series of 20 experiments were carried out with the schematic in Figure 6, consisting of repeating the scenario in Figure 3 at intervals of approximately 2 ÷ 3 min between two successive experiments. During all series of experiments, the temperature was approximately 22°C.
The main goal pursued in each individual series was the precision of the values obtained with the PO forT e1 ,T e2 , C e and R se . Table 1 refers to the results obtained. All values in this table are truncated. We have written in blue, black and, respectively, dark red the values obtained experimentally with the PO for the capacitors 1C, 2C and 3C. The columns written on a white background contain four average valuesT e1 ,T e2 , C e and R se , as well as four sample standard deviations related to the average values, expressed as a percentage according to Equation (6): The last four columns, written on a light-blue background, refer to the last experiment in each series of 20 experiments. The valuesT e1,20 ,T e2,20 were provided experimentally by the PO, and the valuesT e1,20 ,T e2,20 were calculated using off-line processing of the measured voltage v[k]. The off-line processing consisted of the regression generation for exponentials of shape a 1 ·e −t T e1 + b 1 and a 2 ·e −t T e2 + b 2 ,. respectively, of values to approximate, on a least-squares basis, the experimental discharge curves in intervals III and V in Figure 3. We must note the very good correspondence, on the one hand, between the values ofT e1,20 andT e1,20 , and on the other hand, between the values ofT e2,20 andT e2,20 . Table 1. Experimental results for the capacitors 1C (R L = R a = 98.9 Ω), 2C (R L = R a = 49.5 Ω), 3C (R L = 44.8 Ω, R a = 24.8 Ω). The following settings were used: t p = 14 ms, (k p = 700), t o = 1 ms, (k o = 50), t f = 40 ms, (k f = 2000), α = 2.5. The charging/discharging characteristics {v[k]} k≥0,k∈N used for the last four columns of Table 1 are represented in Figure 10a. Figure 10b-  The charging/discharging characteristics { [ ]} ≥0, ∈ used for the last four columns of Table 1 are represented in Figure 10a.   To qualitatively validate the accuracy of the results in Table 1, we used the frequency characteristics of the capacitors (Figure 11) determined by a BK Precision RLC-bridge ( [14], Figure 7). To qualitatively validate the accuracy of the results in Table 1, we used the frequency characteristics of the capacitors (Figure 11) determined by a BK Precision RLC-bridge ( [14], Figure 7). The main observations on the data in Table 1 and Figure 11 are shown in Table 2. In the table, we associated frequency intervals, sometimes restricted to a point, to the intervals in which ̅ and ̅ take the values in Table 1. For example, in the case of the 3C capacitor, the frequency interval ∈ (36.3  37.5) Hz in Figure 11c (bottom) corresponds to the interval ̅ ∈ (0.682  0.706) Ω in Table 1. Table 2. The association of frequency intervals in Figure 11 with intervals in which ̅ și ̅ in Table 1

Discussion
1. The aim of our paper was to illustrate that the PO proposed in [11] can be implemented in real time. Implementation has several important attributes that are relevant for a wide range of processes. For example, from the point of view of power electronic applications, we highlight the following key advantages: a good speed of estimation, a reduced computational complexity and a good estimation accuracy [1]. Considering these aspects, we appreciate that the monitoring of capacitors using PO, being a quasi-online method, can be implemented on the same processor that already serves the process. We consider that our objective has been achieved, and we acknowledge this through the explanations below. 2. In Section 2.1, we summarized the procedure for determining the values of equivalent parameters of a capacitor using the PO proposed in [11], and we deepen the procedure regarding two aspects: (i) emphasizing the influence of the deviations of ̂1 and ̂2 in the result of calculating the equivalent values and ; (ii) extending the bisector's method by rotating it, expressed by a coefficient explained in Appendix A. Through (i), we highlight the very high sensitivity of the results obtained for in relation The main observations on the data in Table 1 and Figure 11 are shown in Table 2. In the table, we associated frequency intervals, sometimes restricted to a point, to the intervals in which C e and R se take the values in Table 1. For example, in the case of the 3C capacitor, the frequency interval f ∈ (36.337.5)Hz in Figure 11c (bottom) corresponds to the interval R se ∈ (0.6820.706) Ω in Table 1. Table 2. The association of frequency intervals in Figure 11 with intervals in which C e s , i R se in Table 1

1.
The aim of our paper was to illustrate that the PO proposed in [11] can be implemented in real time. Implementation has several important attributes that are relevant for a wide range of processes. For example, from the point of view of power electronic applications, we highlight the following key advantages: a good speed of estimation, a reduced computational complexity and a good estimation accuracy [1]. Considering these aspects, we appreciate that the monitoring of capacitors using PO, being a quasi-online method, can be implemented on the same processor that already serves the process. We consider that our objective has been achieved, and we acknowledge this through the explanations below.

2.
In Section 2.1, we summarized the procedure for determining the values of equivalent parameters of a capacitor using the PO proposed in [11], and we deepen the procedure regarding two aspects: (i) emphasizing the influence of the deviations ofT e1 andT e2 in the result of calculating the equivalent values C e and R se ; (ii) extending the bisector's method by rotating it, expressed by a coefficient α explained in Appendix A. Through (i), we highlight the very high sensitivity of the results obtained for R se in relation to deviations inT e1 andT e2 , and we empirically argue for the use of a coefficient α = 2.5.

3.
The implementation of the PO is described in Section 2.2. The hardware support was an i.MX RT1062 microcontroller with Cortex ® -M7 architecture. The necessary sampling and processing operations were performed using the ADC.h software component included in the Teensyduino add-in library. We must mention that in this paper, we present the main elements necessary for the reproduction of the application. Note that the cost of hardware support is low. In this context for the PO, we used a h = 20 µs sampling period, anticipated in [11], and the acquisition process was performed with a 12-bit resolution and 8× oversampling technique. 4.
The actual behavior of the implemented PO is illustrated in Section 3 for three capacitors with 100 µF, 220 µF and 470 µF nominal values. For each capacitor, we presented the results of 5 series of 20 experiments. First, the results show a low dispersion of the values of the equivalent time constantsT e1 andT e2 . Thus, the sample standard deviations related to the average values ofT e1 andT e2 were in the ranges of 0.0482% ÷ 0.0921% and 0.0759% ÷ 0.1871%, respectively. This led, according to the discussion in Section 2.1.2, to limited intervals for sample standard deviations (0.1422% ÷ 0.2120 and 3.6594% ÷ 10.660%, respectively) of the average values of C e and R se . Second, the calculated average values of C e and R se are found at frequencies below 180Hz in the measured frequency characteristics of the capacitors. Finally, we note that the off-line regression calculations for 15 two-stage discharge processes showed the same results as the results obtained in real time with PO.

5.
The low dispersion highlights the potential of the PO for providing precise results, i.e., values of C e and R se with a low scattering. Simultaneously, considering C e and R se values in relation to their frequency characteristics suggests the potential of the method for obtaining accurate results. The scattering of results is due both to the fact that the discharge processes obey statistical laws and the fact that the errors appear in the sampling of the measured values of the voltage at the capacitor terminals. We consider that by using better hardware and software resources in applications, both precision and accuracy can be improved. 6.
The experiments described in this paper were performed on independent capacitors. This approach may also be found in other research, for instance, the work in [22]. The use of PO in real applications involves ensuring the quasi-online estimation framework used in this paper [23]. On the one hand, this requires delimitating a very short time for charging/discharging the capacitor, and on the other hand, it is necessary to provide the resistances over which the capacitor is discharged in the two stages in the electrical circuit of the application and to accurately determine its values. The first requirement is met by processes that are not in a continuous operating regime, for example, in the motor driver converter during the stop of the motor driver, solar PV or in processes with intermittent operation. The second requirement is achievable using suitable switching circuits. 7.
It should also be noted that the experiments reported in this article correspond to some discharges of capacitors during which the voltage spectrum on the capacitor is predominantly at relatively low frequencies. The frequency ranges in Table 2 corroborate this.

Conclusions
For reasons of safety in operation and maintenance, numerous systems require the monitoring of capacitors placed in key positions in their electrical diagrams. The parameter observer whose implementation is the subject of this paper can serve the mentioned requirement in real time. It requires ensuring the possibility of discharging the monitored capacitor over a well-known variable resistor in each of the two stages.
The implementation carried out on a common microcontroller illustrates that the method has good precision and fairly good accuracy in terms of determining the param-eters of some electrolytic capacitors subjected to signals with not very high frequency spectra. The sampling time with which the voltage signal was acquired from the capacitor terminals and with which the parameter observer worked was 20 µs, and the estimation of the capacitor parameters was fulfilled within the time allocated to the discharge of the capacitors. The PO-estimated values of C and ESR are consistent with the frequency characteristics measured with an LCR bridge.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
ESR equivalent serial resistance PO parameter observer

Appendix A
To discuss the application of the bisector method, we consider Figure A1. The figure shows two cases of processing a discharge in one step using the structure in Figure 1b. Cases are denoted by (a) and (b). In both cases, the signal y(t) is the same, namely, a purely exponential signal. This does not happen with a real signal, so y(t) can be interpreted in case (b) as an exponential signal equivalent to the real signal. The signal {T m [k]} k≥k o is obtained by averaging the PO output according to Equation (5). The implementation carried out on a common microcontroller illustrates that the method has good precision and fairly good accuracy in terms of determining the parameters of some electrolytic capacitors subjected to signals with not very high frequency spectra. The sampling time with which the voltage signal was acquired from the capacitor terminals and with which the parameter observer worked was 20 μs, and the estimation of the capacitor parameters was fulfilled within the time allocated to the discharge of the capacitors. The PO-estimated values of C and ESR are consistent with the frequency characteristics measured with an LCR bridge.

Conflicts of Interest:
The authors declare no conflicts of interest.

ESR equivalent serial resistance PO
parameter observer

Appendix A
To discuss the application of the bisector method, we consider Figure A1. The figure shows two cases of processing a discharge in one step using the structure in Figure 1b. Cases are denoted by (a) and (b). In both cases, the signal ( ) is the same, namely, a purely exponential signal. This does not happen with a real signal, so y(t) can be interpreted in case (b) as an exponential signal equivalent to the real signal. The signal {̂[ ]} ≥ is obtained by averaging the PO output according to Equation (5).  presents an increasing tendency during the discharging process. This is due to the deviation in the real signal from the exponential and the disturbances that appear in the measuring and the processing chain of y(t), starting with the acquisition process and ending with the application of Equation (5).
The bisector method serves to estimate T e in real time from the calculated values {T m [k]} k≥k o . The name of the method is given by the case (a), and the method boils down to calculating the estimateT e .T e = k e ·h, where k e is the solution of the equation Since h represents the discretization step of the PO, the inequality (A3) has a unique solution k e , so the last value used in checking the condition (A2),T m (k e ·h), is considered the value ofT e .
In case (b), the application of relation (A1) for α = 1 leads to an erroneous result, since the point B corresponds to a segment CD of length greater than T, and so aT e of a value greater than the expected one results. A better approximation of T can be obtained either by translating the bisector CB to the left, as in Figure 2f, or by rotating it anticlockwise to the CB position, as in Figure A1b. The rotation means adopting a coefficient α > 1 in Equation (A1).
The value of α depends both on the signal y(t) and on the hardware and software on which the PO is implemented. As a result, the adoption of the value α can only be achieved empirically, per the type of application, without having the certainty thatT m k o + k e = T.
In the experiments, we adopted α = 2.5. The choice was made based on the observation of the dispersion of the characteristics {T m [k]} obtained on the set of whole discharges in two stages of the capacitors. This idea is exemplified in Figure A2, which refers to a sample of 15 two-stage discharges of capacitor 3C. In the upper part of the figure, the characteristics {T m [k]} are illustrated. The characteristic obtained for the average value is drawn in black. Notations I−V have the same meaning as for Figure 3. A dispersion of characteristics is suggested in medallions. The lower part of Figure A2

Appendix B
Equation (4) presents sensitivities of different orders of magnitude in relation to the values calculated for ̂1 and ̂2 . To discuss this aspect, we assume that ̂1 0 and ̂2 0 are the values of the two equivalent time constants corresponding to ideal conditions for measurement and subsequent processing of the voltage values at the capacitor terminals. In the following, we call "ideal values" all values that have the subscript "0". Let 0 and 0 be the ideal values obtained by substituting ̂1 0 and ̂2 0 in (Equation (4)), respectively, and ∆̂1 and ∆̂2 are the deviations of the measured values from the ideal values, i.e., ̂1 =̂1 0 + ∆̂1 and ̂2 =̂2 0 + ∆̂2. We introduce the quantities (Equation (A4)) with the meaning of percentage deviations of ̂1 , ̂2 , and from the ideal ones and the ratios in (Equation (A5)): (A5) With these notations, we obtain the equalities: Considering that: the second Equation (A6) becomes: Figure A2. Regarding the dispersion of experimental results' processing.

Appendix B
Equation (4) presents sensitivities of different orders of magnitude in relation to the values calculated forT e1 andT e2 . To discuss this aspect, we assume thatT e10 andT e20 are the values of the two equivalent time constants corresponding to ideal conditions for measurement and subsequent processing of the voltage values at the capacitor terminals. In the following, we call "ideal values" all values that have the subscript "0". Let C e0 and R se0 be the ideal values obtained by substitutingT e10 andT e20 in (4), respectively, and ∆T e1 and ∆T e2 are the deviations of the measured values from the ideal values, i.e.,T e1 =T e10 + ∆T e1 andT e2 =T e20 + ∆T e2 . We introduce the quantities (A4) with the meaning of percentage deviations ofT e1 ,T e2 , C e and R se from the ideal ones and the ratios in (A5): With these notations, we obtain the equalities: Considering that: the second Equation (A6) becomes: As the value of the first fraction (A8) is very large, and the second one is comparable to the value of the fraction in the expression ofĈ e% , it follows thatR se% Ĉ e% . This is evidenced by the example in Figure A3. Let us observe that for variations ∆T e1% ∈ [−2%, 2%] and ∆T e2% ∈ [−2%, 2%], maximum deviations of +6.72442% occur for C e , and +249.709% for R se . (1 + 0.01 • ∆̂1 % ) − 1 + 0.01 • ∆̂2 % .
As the value of the first fraction (Equation (A8)) is very large, and the second comparable to the value of the fraction in the expression of ̂% , it follows that ̂ ̂% . This is evidenced by the example in Figure A3. Let us observe that for vari ∆̂1 % ∈ [−2%, 2%] and ∆̂2 % ∈ [−2%, 2%], maximum deviations of +6.72442% for , and +249.709% for .
(a) (b) Figure A3. The percentage deviations of and from the ideal ones for a capacitor with 100 μF, 0 = 1.8 Ω , ̂1 0 = 0.01018 ,̂2 0 = 0.00518 , 1 = 100 Ω, 2 = 50 Ω ; (a) tion ̂% ; (b) deviation ̂% . Table A1 shows the hypothetical monitoring situation of an ageing process capacitor in Figure A3 over 11 equidistant moments, during which the value 0 from 100 μF to 8 0 μF , and the value 0 rises from 1.8 Ω to 4.3 Ω . The ∆̂1 % and ∆̂2 % show moderate variations during the monitoring moments. Figu represents the results graphically. We observe that the monotony of the variation two parameters is maintained even in the presence of errors ∆̂1 % and ∆̂2 % .  Figure A3. The percentage deviations of C e and R se from the ideal ones for a capacitor witĥ C e0 = 100 µF, R se0 = 1.8 Ω,T e10 = 0.01018 s,T e20 = 0.00518 s, R ext1 = 100 Ω, R ext2 = 50 Ω; (a) deviationĈ e% ; (b) deviationR se% . Table A1 shows the hypothetical monitoring situation of an ageing process of the capacitor in Figure A3 over 11 equidistant moments, during which the value C e0 falls from 100 µF to 8 0 µF, and the value R se0 rises from 1.8 Ω to 4.3 Ω. The errors ∆T e1% and ∆T e2% show moderate variations during the monitoring moments. Figure A4 represents the results graphically. We observe that the monotony of the variation of the two parameters is maintained even in the presence of errors ∆T e1% and ∆T e2% .  Figure A4. Concerning the conservation of the monotony of the variations of C e and R se during the monitoring processes affected by the calculation errors ofT e1 andT e2 in line with Table A1: (a) variationsĈ e0 (t) andĈ e (t); (b) variationsR se0 (t) andR se (t).