A survey on the discrete-time differentiators in closed-loop control systems: experiments on electro-pneumatic system and rotary inverted pendulum

This paper is dedicated to the experimental analysis of discrete-time differentiators implemented in closed-loop control systems. To this end, two laboratory setups, namely an electro-pneumatic system and a rotary inverted pendulum have been used to implement 25 different differentiators including the exact differentiators and a linear filter. Since the selected laboratory setups behave differently in the case of dynamic response and noise characteristics, it is expected that the results remain valid for a wide range of control applications. The validity of several theoretical results, which have been already reported in the literature based on the analytical analysis and numerical simulations

While the differentiators have been widely studied using analytical calculations and numerical simulations [1,2,3,4], their practical implementations are barely addressed in the literature.References [5,6] are probably the only ones on this topic, according to our investigation, where the aim was to provide an experimental analysis among a sliding-mode based differentiator, kernelbased method, high-gain differentiator, ALIEN differentiator, extended Kalman filter, and homogeneous differentiator.Since the differentiators are nowadays implemented on digital processors, their time-discretization should be addressed clearly.
The differentiators usually contain discontinuous terms to achieve the exactness.Such terms can be potentially a source of numerical chattering 1 if they are not implemented on digital processors correctly.According to the literature, time-discretization of the differentiators can be divided into two main categories, i.e., explicit and implicit Euler schemes.While the explicit time-discretization has long been used for sliding-mode control (SMC) as the unique discretization method, the implicit method has been developed recently for SMC [12,13,14,15,16,17,18] (see [19] for a survey) and for differentiators [1,2,3,4].
In this context, few experimental validations of implicitly implemented SMC can also be found [20,13,12,15].However, the implicit discretization has not been experimentally studied for the differentiators yet.
Numerical chattering suppression under noise-free conditions is one of the main advantages of using the implicit discretization as reported by [12,13,14,15,19].This is also specifically validated for the differentiators (see Lemma 3 in [1], the numerical simulations in [4], and the conclusions made in Section 6 of [3]).This property is called Theoretical Result 1 (TR1) throughout the manuscript.Note that this result was specifically obtained for the noise-free case.However, in a practical system, the chattering can also be caused by the measurement noise, in addition to the numerical chattering, which affects both explicit and implicit schemes.One of the objectives of this work is to study TR1 using practical experiments.
Another issue corresponding to the implicit discretization is practicability.This topic has been addressed for the differentiators in [1,2] in case of causality and uniqueness 1 Chattering refers to the high-frequency, finite-amplitude oscillations, affecting both the input and the output.While many factors including measurement noise and dynamical uncertainties can lead to the chattering [7], the numerical chattering refers to a specific kind of chattering that only appears due to the time-discretization of the discontinuous terms [8,9,10,11].
of the solutions.Moreover, unlike the explicit schemes, the implicit discretization needs an iterative solver to compute the roots of a polynomial equation at each time step.
The effect of the solver and its parameters on the performances of a specific type of implicit differentiator has been addressed before and it is concluded that the implicit differentiators can also be implemented if enough calculation resources are available (see Sec. 5.8.5 in [2] and [3]).However, the amount of the required calculation resources has not been reported.This is considered as the Theoretical Result 2 (TR2) in this manuscript and will be evaluated on two different laboratory setups.
As reported by [12,13,14,15,19], the implicit discretization of SMC can be insensitive to the gains under noise-free cases and during the sliding phase.This has been specifically validated for the implicit arbitrary-order super-twisting differentiator (I-AO-STD) (see Remark 7 in [1]).This is considered as Theoretical Result 3 (TR3) in this study, and the gain sensitivity of both implicit and explicit schemes will be studied in two applications where measurement noise always exists.
According to Corollary 1 in [1], increasing the order of the I-AO-STD leads to a longer transient time.More clearly, when the state variables of the I-AO-STD are in a specific region, defined by case 2 in [1], the differentiator converges to the exact differentiation after n + 1 time step, where n is the order of the differentiator.Hence, increasing the order of the differentiator leads to a larger transient time.Note that this is proved when the derivative of order n + 1 of the input signal vanishes.This result is named Theoretical Result 4 (TR4) in this study and it will be studied experimentally.Note that the transient response of a differentiator depends on several other factors, including the initial conditions and the parameters.
Following the literature, TR1 and TR3 have been also evaluated experimentally for the SMCs in [12,20,13,15].However, the validity of the mentioned results for the differentiators has not been experimentally addressed yet.
The main contribution of this work is to investigate the above-mentioned theoretical results in the closed-loop systems, based on practical experiments.Moreover, the behavior of the total number of 25 known differentiators will be analyzed in practice, and several remarks will be drawn to allow one to select the most appropriate differentiator in practical control systems.To this end, two laboratory setups, an electro-pneumatic setup (EPS) and a rotary inverted pendulum setup (RIPS) have been used to implement the 25 differentiators which have been studied in [1,2].The main differences between these two setups are: • Measurement noise: an analog sensor is mounted on the EPS which requires an analog-to-digital conversion.This imposes a significant amount of measurement noise.On the other hand, the RIPS uses two digital high-resolution shaft encoders, which makes the feedback path almost noise-free.
• Dynamic response: comparing the outputs of the EPS and the RIPS, one can see that while the EPS shows slow changes on the output, the RIPS exhibits sudden variations.
According to the characteristics of these setups, it can be concluded that the EPS mainly evaluates the robustness of the differentiators against the measurement noise while the RIPS allows to test the differentiators in the presence of fast dynamical variations.Since these setups behave differently in case of dynamic response and noise characteristics, it is expected that the general conclusions remain valid for a wide range of control applications.
The structure of this manuscript is as follows.The continuous-time differentiators and the corresponding discretization schemes are briefly reviewed in Secs. 2 and 3, respectively.The results drawn from the EPS as well as the RIPS are presented in Secs. 4 and 5, respectively.Finally, general conclusions and remarks are provided in Sec. 6.
Note that the colors red black and blue are used in some tables to help showing the worst, moderate and the best results.

Review of the continuous-time differentiators
The purpose of this section is to briefly review the known continuous-time differentiators which have been recently analyzed in [1,2].Depending on the structure, differentiators can be categorized into several classes as indicated in Table 1.Some useful vocabulary is introduced: • SMB (sliding-mode-based) differentiator refers to a kind of differentiator where discontinuous or set-valued (SV) terms are used to provide a sliding regime to achieve the exactness.
• Some differentiators can calculate higher-order differentiations (HOD) (second, third,...).Without such an ability, cascade configurations of first-order differentiators may be used to estimate higher-order derivatives.
• Differentiators may have multiple outputs (MO), meaning that an MO differentiator with the order n can calculate derivatives of order 0, . . ., n − 1.
• Depending on the structure, differentiators may have one or more tuning parameters (TP) that should be tuned to ensure proper operation.
• Some differentiators use a kind of adaptation mechanism (AM) to tune their parameters in an online manner.
Arbitrary-order super-twisting differentiator (AO-STD) is another SMB differentiator introduced in [35], that exhibits several useful properties including homogeneity and finite-time convergence [36,37].It is designed as follows: where the notation is as before, L is a tuning parameter, the parameters λ i , i = 0, . . ., n are provided in Table 2 [ 35,21,38,39] (notice that the λ i 's may also be considered as tunable parameters, however this is out of the scope of this study), and ⌈x⌋ n = |x| n sgn(x).For n = 1, AO-STD turns into the super-twisting differentiator (STD) [26].Uniform robust exact differentiator (URED) [24] is a modification of the STD, where the aim is to ensure the uniform convergence of the differentiator by adding extra terms as follows: The notation is similar to the above one, and µ ∈ R > 0.
Note that the original form of the URED was introduced with L = 1 [24].
Quadratic differentiator (QD) is another SMB differentiator where the aim is to improve the transient by modi-fying the sliding surface as follows.
where F > 0 and α > 0 are parameters to be tuned.The sliding variable σ 0 (t) of this differentiator has been further modified [40] to improve its convergence rate.
Some adaptation laws have been developed for the SMB differentiators to tune their parameters automatically.In this context, two different adaptation techniques, namely adaptive coefficients and adaptive exponents, have been introduced.Some studies [27,41,42] dealt with the adaptive laws for the coefficients, while in other studies [43,44,34], the adaptation mechanisms are considered for the exponents.
One of the latest adaptation mechanisms for the coefficients has been developed in [27], where the following adaptive differentiator has been proposed.This differentiator is named super-twisting differentiator with adaptive coefficients (STDAC).It reads as: It can be seen that for γ(t) = √ L, (5) leads to the standard STD.The following adaptation law γ(t) is proposed [27]: where γ(0) = 1, 0 < α < λ 0 , and ϵ is a positive design constant which is selected based on the amplitudes of the chattering and noise.The idea of adaptive exponent comes from the observation that by changing the exponent of an SMB differentiator, a trade-off can be made between the exactness and robustness to noise.The most recent study on the variable gain exponent differentiator (VGED) has where f f (t) corresponds to high-frequency components of the input.In other words, a fourth-order Butterworth high-pass filter with cutoff frequency ω c is used to calculate f f (t) from the input f (t).To decrease the number of parameters, it is assumed that ϵ = 1 µ [34], and λ 0 and λ 1 are presented in Table 2.In this case, the VGED only has four parameters to be tuned, i.e., µ, τ , ω c , q.
The high-gain differentiator (HGD) is a special case of the VGED with α = 1, introduced in [30].The design of this differentiator was further addressed in [45].In this study, a third-order HGD will be considered as follows (see [5,46]).
Obtaining the error band of the HGD in the presence of noise was the topic of [45].
Algebraic continuous-time differentiators are also proposed in the control literature.ALIEN [47] is one of these differentiators, which calculates an arbitrary-order differ-entiation based on annihilators.In fact, it calculates the differentiation using integration to attenuate the noise effect.ALIEN differentiator is given as [48]: , n is the differentiation order, T is called the estimation window, κ and µ are two parameters which are designed according to simulations [48].

Time-discretization of the differentiators
To implement the continuous-time differentiators introduced in Sec. 2 on a digital processor, it is necessary to use a discretization method.Let ẋ = g(x) be an ODE, where g(•) is a function.The Euler discretization of this ODE gives where h is the sampling time, α = 0, α ∈ (0, 1), and α = 1 lead to explicit, semi-implicit and (full) implicit discretizations, respectively.As can be seen, for α ∈ (0, 1], x k+1 appears in the input argument.To obtain this implicit argument (here x k+1 ) at the time-step k, some extra manipulations are required (see [1,2,3,4] for detailed explanation of time-discretization methods applied to the continuous-time differentiators).
Remark 1. Assuming that g(•) in ( 10) is a discontinuous (set-valued) function, the implicit discretization allows to suppress the numerical chattering caused by the discretization effect based on the selection procedure.Moreover implicit discretization can provide several useful properties for discrete-time sliding-mode controllers and differentiators, e.g., finite-time convergence, Lyapunov stability (see [1,3,14,49,50] and [19] for a survey).
There are three other explicit discrete-time differentiators namely, homogeneous differentiator (HD) [28,29], homogeneous discrete-time differentiator (HDD) [23], and generalized homogeneous discrete-time differentiator (GHDD) [22] which can be obtained by special operations on the AO-STD.The purpose of the HDD is to keep the homogeneity of the AO-STD after discretization.
Moreover, GHDD is proposed to attenuate the chattering by cancelling the discontinuous terms in the recursion.
It should also be noted that the explicit discretization of the SHMD is ignored because of too much numerical chattering [2].Moreover, according to [32], for n = 1, the implicit SHMD is named I-FDFF.For n > 1, this differentiator is called I-AO-FDFF, with this difference that an extra filtration is used instead of z i , i = 0, . . ., n as the outputs [31].The I-FDFF has four parameters ω s , ω f , ρ, γ that need to be tuned.On the other hand, the parameters of the I-AO-FDFF are ω s , ω f , ρ, F, ϵ, α 1 .The implicit discretizations of the SHMD, i.e., I-FDFF and I-AO-FDFF, as well as their parameter-tuning procedures, are explained in [1,2].
In addition to the introduced methods, there are still some other differentiators, e.g., Euler method, linear filters, and the Kalman's differentiator.To design the Kalman's differentiator, the differentiation problem is formulated as follows [21]: where The parameters for a third-order Kalman differentiation are as follows (see [51] for the algorithm as well as the preliminary equations of the Kalman filter).
The Kalman filter has one parameter, denoted by R, which is obtained based on the power of the input noise [1,2].
In the simplest case, the LF is a low-pass filter combined with the pure differentiator d/dt which can be implemented using the following formula: where the notation is as before, and c is a design parameter.For c → ∞, LF leads to the Euler differentiator: The prefixes E, I and SI indicate the explicit, implicit and semi-implicit discretizations.However, these prefixes are ignored for some methods (Euler, LF, ALIEN, HD, VGED and Kalman) since the implicit or semi-implicit discretizations of these differentiators have not been introduced yet.In other words, the absence of a prefix indicates that the method is implemented using the explicit discretization scheme (α = 0 in (10)).
Since tuning parameters of differentiators in practical closed-loop systems is difficult and time consuming, the parameters are tuned using open-loop simulations as suggested in [1,2].In this case, the parameters have been tuned based on three different inputs.The first input ing a white noise with SNR=30dB.The second and the third inputs are I 2 : f 2 (t) = 4 × 10 4 (t 2 + 2t + 3) and , respectively, which are polluted by the quantization noise (resolution=0.001) with h = 2ms.Subsequently, a randomized algorithm [52] is used to find the optimal parameters for minimizing the estimation error corresponding to the first-order differentiation.The obtained parameters are listed in Table 3.
While this procedure does not ensure the optimality of the parameters for the closed-loop system, it helps to tune all differentiators in a unified manner leading to fair comparisons.In Table 3, three values are given for each parameter in (P 1 , P 2 , P 3 ) format, where P 1 , P 2 and P 3 denote the tuned parameter for the first (I 1 ), second (I 2 ) and the third (I 3 ) inputs.
Since, the EPS is a noisy and slow process, the low frequency input (I 1 ) contaminated by a significant amount of noise has been selected to tune the parameters.Such a low frequency signal leads to instability when dealing with the RIPS (except for the Euler differentiator which does not have any parameter).Hence high-frequency inputs (I 2 and I 2 ) are used to tune the parameters for the RIPS.These input signals are selected according to trial and error.

Electropneumatic setup
The EPS which is considered in this study is shown in   The corresponding force of the disturbance actuator is controlled by a PID controller developed by the manufacturer, while the controller design for the main actuator will be considered in this section.

Model of the electropneumatic setup
The following model is used for the EPS, as detailed in [53,54,55]: V P and V N are the volumes of the chambers P and N , respectively, which depend on the position of the jack y, S = 0.0045m 2 is the piston section, ϕ x and ψ x (x being N or P ) are both fifth-order polynomials [56] 1 .Eq. ( 15) can be rewritten as ẋ = f (x) + g(x)u with the following uncertain vectors: Because of the uncertainties, the vectors f (x) and g(x) are divided into nominal and uncertain parts as follows: where f (resp.ḡ) and f (resp.g) denote the nominal and uncertain parts of the function f (resp.g).

Sliding-mode controller
As can be seen from ( 17), the EPS contains uncertain terms f (•) and g(•).To handle these uncertainties and disturbances, SMCs have been developed for the EPS [12,13].
Following [12], since the control objective is the position tracking, the following sliding variable is defined: where e 0 (t) ≜ y(t) − y r (t), and y r is the reference trajectory, e 2 (t) = ë0 (t), and e 1 (t) = ė0 (t).The positive parameters λ 0 and λ 1 are designed such that the polynomial equation z 2 + λ 1 z + λ 0 = 0 is Hurwitz.This ensures the exponential convergence during the sliding phase.
A typical SMC operates in two phases, namely, the reaching-phase, and the sliding phase.During the reaching phase, the control signal is designed such that σ(t) → 0.
At the end of the reaching-phase, σ(t) = 0 holds, and 1 The simulation files, containing the exact values of the parameters, are available upon request to the first author: Mohammad Rasool Mojallizadeh (email: mohammad-rasool.mojallizadeh@inria.fr).
according to the stability of the sliding surface, e(t) → 0 is achieved asymptotically.To ensure the persistency of the sliding phase in the presence of uncertainties and disturbances, the control signal is designed such that σ = 0 holds.Hence, From (19), and using ( 16), one can obtain two functions The functions Ψ and Φ are not given here for the sake of briefness.They can be found in [53].Assuming that Ψ = Φ = 0, the required control signal (ū), or so-called equivalent control, for keeping the sliding phase ( σ = 0) can be obtained as follows: To ensure the presence of the reaching and of the sliding phases for the perturbed system, the following discontinuous control signal is considered: where G is the gain of the control which is selected based on the following inequality [12]: with η being a positive constant.
To implement the controller ( 22) on a digital hardware, a discretization method should be utilized.This topic has been studied in [12,15], and it is concluded that the implicit discretization can provide several advantages compared to its explicit counterpart, including numerical chattering suppression, and insensitivity to the gains.The explicit discretization of ( 22) is avoided in this study since it leads to chattering even in the presence of an implicit differentiator [12].On the other hand, the implicit discretization of the set-valued part of (22) gives: where u k is applied on [t k , t k+1 ].Substituting ( 24) into (20), and assuming that Φ = Ψ = 0 gives: Eq. ( 25) can be rewritten as follows: The GE ( 26) can be solved based on the following conditions: The solution of the GE (26) satisfies σ k+1 > 0 which Hence, from (26) one has σ k+1 = σ k − G.
The solution of the GE is σ k+1 = 0. Therefore, (26) gives • Case 3: The solution of the GE (26) satisfies σ k+1 < 0 which Hence, from (26) one has The implicit discretization of the sliding-mode controller is depicted in Fig. 4. As can be seen, the controller needs the sliding variable σ k = e 2,k + λ 1 e k + λ 0 e 0,k as well as vectors Φ and Ψ at each time-step.To this end, it is necessary to build x = [y, ẏ, ÿ] ⊤ .The EPS is equipped with a position sensor.However, the velocity ( ẏ) and the acceleration (ÿ), are not available, and need to be estimated.The differentiators which are analyzed in [1,2] are used to estimate the first and the second-order differentiations.The controller and differentiators are implemented on the EPS as follows: • Some differentiators (STD, VGED, QD, STDAC, FDFF) can only estimate the first-order derivative.
Cascade configurations of these differentiators are used to estimate both the velocity and the acceleration.
• To implement the ALIEN differentiator, two ALIEN blocks are used to calculate both the velocity (n = 1) and the acceleration (n = 2) (see ( 9)) without using the cascade configuration.

Conditions of the experiments
The conditions of the experiments are listed below: • The first-order SMC is implemented implicitly according to Fig. 4 with G = 10 5 .
• The sampling rates correspond to all subsystems (controller, differentiator, sensors, etc), and are always the same.
• The pneumatic system has some initial conditions (initial position of the horizontal jack, the initial value of the disturbance, ...) that take different values in each experiment.Hence, taking into account the transients will lead to unfair results since each differentiator faces different initial conditions.
To solve this problem, the waveforms are recorded and the performances are calculated after a specific amount of time, to ensure zero initial conditions for Case 1: Case 2: Case 3: where t f is the final time, e k = y k − y d,k denotes the output error, y k , and y d,k are the output and its corresponding reference, respectively, at time-step k (see Fig. 1).
• L ∞ norm of the differentiation error: This cost function indicates the maximum deviation of the output from its reference.Hence, it can be used to calculate the overshoots and the accuracy of the control system.This cost can be calculated as follows: • Total variation of the control signal: This criterion can be used to measure the chattering effect on the control signal.It is calculated as follows:

Identifying the impracticable experiments
Before providing the experimental results, it is crucial to identify the impracticable experiments.An impracticable experiment refers to a condition where it is necessary to stop the experiment to avoid any damage to the hardware.For the pneumatic setup, the horizontal jack can only move within y ∈ [−70, +70]mm.Beyond that, the jack will hit the barriers, and the corresponding experiment is called "impracticable" (note that the reference trajectory is y r (t) = 40 sin(0.2πt)mm).Many factors, including instability of the closed-loop control system and overshoots, can potentially lead to an impracticable experiment.
The impracticable experiments with the corresponding conditions are listed in Table 4.As it was reported before (see Fig. 13 in [1]), the E-QD shows too much chattering for large sampling times, which led to impracticability for this closed-loop experiment.The I-URED also leads to impracticability for small sampling times.Another observation is that the ALIEN leads to impracticability when decreasing the sampling time.Note that the parameters   there is not a significant difference between the explicit and the implicit methods.Hence, it can be concluded that even if an implicit SMC is implemented, the use of explicit differentiators may lead to chattering on the control signal for large sampling times.In other words, to reduce the numerical chattering, specifically for large sampling times, it is necessary to implement both the controller and the differentiator implicitly.
From Fig. 5 (D), while ALIEN shows small variations (comparable to the implicit methods) for large sampling times, the values for small sampling times are not provided, since it is not practicable for h < 5ms.Considering the variations of the cascade configurations (STD, STDAC, URED) in Fig. 5, one can see that the cascade combinations of the explicit or semi-implicit differentiators presents more chattering than the implicit counterparts, and should be avoided, since each stage amplifies the chattering of the previous one.As the result, for large enough sampling times h > 10ms, E-STD and SI-STD show the worst variations (Fig. 5 (A) and (D)).
For small sampling times, Euler is the worst differentiator, since according to the Nyquist theorem, by decreasing the sampling time, larger frequency components of the measurement noise can also be recovered (note that Euler is a pure differentiator with unlimited bandwidth).
From Fig. 5 (C), while the VGED shows small variations for large sampling times h > 40ms, it shows relatively large variations for smaller sampling times.The reason is that six parameters of this differentiator are tuned for h = 50ms.Decreasing the sampling time, deteriorates its variation, which indicates its sensitivity to the parameters.
Another interesting observation is that Kalman's differentiator shows one of the best variations, comparable with the implicit methods.However, I-FDFF shows a smaller variation for h = 1ms, compared with that of the Kalman' differentiator.
The variations of the control signal corresponding to some of the SMB differentiators for large sampling times h = 50ms, h = 40ms, and h = 30ms are provided in Fig. 6.
Comparing the results, one can conclude that, in general, the implicit methods show smaller variations than those of their explicit counterparts.This result confirms experimentally TR1 on the chosen setup and control algorithm.
The L2 norms of the methods for different sampling times are provided in Fig. 7.It can be seen that, for all methods, increasing the sampling time highly affects the L2 norm.Concerning Fig. 7, all methods show almost the same evolution, except for the Euler method which shows the worst L2 for h < 5ms.E-STDAC also shows a large L2 for h < 5ms, probably because it is too sensitive to the parameters.
Another observation is that while there is not a noticeable difference between the variation of the implicit differ- The L ∞ norms are presented in Fig. 8. Apart from the Euler and the E-STDAC, all differentiators almost show the same behavior when increasing the sampling time.

Gain sensitivity
The SMB differentiators are studied under over-sized gains and the results are provided in Table 5.It can be seen that for L = 20 (compare with L in Table 3), all SMB differentiators can be implemented.However, comparing the explicit and the implicit methods, it can be seen that the variations related to the explicit methods are much more affected than the implicit counterparts.Another interesting observation is that while the implicit methods remain practicable for L = 10 3 , the explicit ones lead to impracticability.Hence the implicit methods show much better gain-insensitivity than the explicit counterparts as predicted by TR3.

Solver's effect
As it was previously explained in [3,4], some implicit simulations provided in [1,2] (see also [3]), the required accuracy for the solver without affecting the performances is 10 −5 when the input is sin(t).Hence, the Newton's solver with the same accuracy is used, and the maximum number of iterations for the real-time operation is obtained and given in Table 6.
As can be seen from Table 6, for h < 1ms, it is not possible to implement the solver-based implicit methods, i.e., I-AO-STD, I-HDD, I-GHDD, and I-URED.Our investigation shows that for such small sampling time, even non-solver-based methods, e.g., HD and ALIEN cannot be implemented in real-time operation.According to Table 6, for h > 1ms, all the implicit methods can be implemented with the indicated number of iterations.It has been noticed during these experiments that for a larger number of iterations, the implicit methods cannot be implemented in real-time.
It is reported before (see [1] Sec. 5.8) that the Newton's solver can provide the accuracy 10 −5 with the maximum number of 7 iterations.According to Table 6, since the number of iterations for h > 1ms is always higher than 7, one can conclude that the implicit methods can operate in real-time for h > 1ms.Normally, this should not be an obstacle to the implementations, since implicit SMC tolerates larger sampling periods without significant deterioration of the performance [13,12].

Results obtained for the EPS: conclusions
The following results have been drawn based on the practical experiments on the EPS: • In a real system, the chattering is caused by several sources including the measurement noises, some dynamics uncertainties, and the numerical chattering.To validate TR1, several experiments have been made under different sampling times (as shown in Figs. 5 and 6).We noticed that while there is no significant difference between the explicit and implicit methods under small sampling times, the implicit methods show less chattering in large sampling times, compared to the explicit ones.It indicates that the implicit methods can reduce the numerical chattering compared to their explicit counterparts, because by increasing the sampling time, chattering amplitude corresponding to the numerical chat- tering will be increased, and at the same time, the power of the noise will be decreased according to Nyquist-Shannon sampling theorem (since the highfrequency noise components cannot be recovered in the sampled measurements).In other words, by increasing the sampling time, the dominant chattering source would be numerical chattering.This validates TR1 experimentally for the chosen setup and controller.
• According to Sec. 4.7, the solver-based implicit methods (I-AO-STD, I-HDD, I-GHDD, and I-URED) can be implemented in real-time with the desired solver's accuracy on the EPS, which is in accordance with TR2.
• Based on the discussion presented in Sec.4.6, the implicit methods show better insensitivity to the gains, which agrees with TR3.
• According to the results provided in Figs. 5 and 6, higher-order SMB differentiators, e.g., AO-STD show better variation than that of the cascade configurations of the first-order counterparts, e.g.,

STD.
• According to Fig. 7, in general, the implicit methods may provide better results than those of the LF.

Rotary inverted pendulum
A RIPS from QUANSER has been employed in this section as another case-study 1 .

Mathematical modeling of the RIPS
The scheme of the RIPS is shown in Fig. 9.This mechanical system has two links: the rotary link and the pendulum link, which are indicated by the subscripts r and 1 One may validate all the numerical and experimental results using the remote setup which is accessible via http://valse-pendulum.lille.inria.fr:5000/.
p, respectively, m r = 0.095kg and m p = 0.024kg are the weights of the rotary and pendulum links, L r = 0.085m and L p = 0.129m are the lengths of the rotary and the pendulum links, respectively, J r = m r L 2 r /12 and J p = m p L 2 p /12 denote the moment of inertia of the rotary and the pendulum links, respectively, and θ and α are the angles of the rotary and the pendulum links, respectively.
The angle α = 0 indicates that the pendulum is hanging in its upward position.
Equations of motion of the pendulum can be obtained using the Euler-Lagrange framework as explained in [57].

Rm
is the input (the torque), and y = [θ, α] ⊤ is the output. Moreover: To take the dynamics of the actuator (DC motor) into account, (32) is modified as follows:

Controller design for the rotary inverted pendulum
A switching control scheme is used to regulate the pendulum on its unstable equilibrium point as follows: where u is the control signal which is automatically saturated to [−10, +10] V by the laboratory setup to protect the motor, u b is the balancing control and u s is the swingup control.It can be seen from ( 34) that the balancing control is only active within ±20 degrees of the unstable equilibrium point.The closed-loop diagram of the RIPS is shown in Fig. 10, and the controllers u s and u b are obtained in Secs.5.2.1 and 5.2.2, respectively.A PC with an Intel Core i7 7700 processor working on 2.9GHz with 16 GB Memory has been used to implement the controller and the differentiators for the RIPS.

Swing-up control
The following control law is designed to swing the pendulum around its upward position as follows: where µ = 50m/s/J is the control gain, E is the energy of the system, E r = 40mJ is the potential energy of the pendulum on its upward position, and u sm = 10 V is the saturation factor.The term sgn( α cos(α)) is used to switch the sign of the control.Here, the sat function is defined as follows: The energy of the pendulum is the sum of the kinetic (E 1 ) and potential (E 2 ) energies:

Balancing control
An LQR 1 controller (u = G(x − x r )) is designed for (32) for the balancing as follows: Note that the reference trajectory throughout the experiment is x r = 0.3 sin(t) 0 0.3 cos(t) 0 ⊤ .

Differentiator design for the rotary inverted pendulum
Since the variables θ and α are not available, the differentiators which are introduced in the first part of the report, are employed to estimate θ and α by differentiating θ and α.

Experiments
The remote setup which is used in this section is installed at INRIA Lille, France.To perform the experiments it is necessary to implement the controller and the observer in a compatible format and then to upload them on the remote setup.A numerical simulation is conducted after uploading the codes to protect the experimental system by validating the codes.Afterward, the customized controller/observer is implemented on the real system, and both numerical and experimental results are available online within a few minutes.

Conditions of the experiments
The sampling time h = 2 ms is used by default on this setup.Tuning the parameters of the differentiators is one of the most challenging parts of this study (including previous works [1,2]).For the EPS, the parameters obtained in the first part of the research [1] are directly used to 1 Linear quadratic regulator is a well-defined controller (for instance see [58]) to minimize the objective function J = (x ⊤ Qx + u ⊤ Ru)dt, where Q and R are weighting matrices.This controller can be designed using the MATLAB function G=lqr(sys,Q,R), where sys is the state-space representation of the plant and G is the calculated control gain.
implement the differentiators.Those parameters were assumed to be optimal for the input I 1 : f (t) = sin(t) + ñ(t) with ñ(t) being a white noise with SNR=30dB.As it was seen in Sec. 4, almost all differentiators lead to practicability with the obtained parameters on the EPS, which demonstrate the validity of the approach.However, with these parameters, all differentiators (except for the Euler which does not depend on any parameter) lead to impracticability on the RIPS.Hence, another input, i.e., I 2 : f (t) = 4 × 10 4 (t 2 + 2t + 3) with quantization accuracy 0.001, is used to re-tune the parameters specifically for the RIPS (the parameters are listed in Table 3).This input allows an optimization algorithm to select the parameters such that the bandwidths of the differentiators are large enough to track the high-frequency components of the plant's outputs.Unlike the EPS, such a high bandwidth is not problematic for the RIPS since its output is less affected by the measurement noise.In fact, the sensors used in the RIPS (shaft encoders) are almost noisefree, since the measurements are inherently digital without requiring any analog to digital conversion.
Another reason for selecting such large bandwidth is that during each simulation/experiment, if the tracking error for t > 3s is higher than π/4 rad, the experiment/simulation will be immediately stopped for the RIPS to protect it against unexpected behaviors.Hence, the transient response of the closed-loop system must be short enough to make the tracking error converges into the inter- ] rad for t > 3s.Otherwise, a differentiator leads to impracticability.This issue is further addressed in Sec.5.4.2.
In summary, while EPS is a relatively slow system with significant noise, RIPS is a fast system with little noise.
Their behaviors are then quite different, and this has a great influence on differentiators' gains tuning.
It was noticed that unlike the numerical simulations, repeating an experiment leads to different results since each experiment depends on some stochastic variables.For instance, a cable that connects the pendulum's encoder with the QUBE is a sort of spring, which may have different positions after each experiment.This spring may differently impact the pendulum in the upper positions as well.This modifies the system trajectories and stabilization precision.Moreover, the controller is hybrid (discontinuous), since it switches from swing-up to balance feedback law.In this case, a small perturbation of parameters may imply a large variation in trajectories.To tackle this problem, we have conducted each experiment ten times, and the averaged results are provided in Table 7.
The explicit SMB differentiators, i.e., E-STD, SI-STD, E-URED, E-AO-STD, E-QD, E-HDD, E-GHDD lead to impracticability.The reason is that for these large gains, explicit methods show a significant amount of chattering.
So it is very difficult to find a good compromise between chattering reduction and bandwidth for such algorithms.This is also the case for the SI-STD and SI-URED.Note that the SI-AO-STD formed a practicable system mainly because of two reasons.As it was reported in [1], while semi-implicit methods are still affected by numerical chattering, they can attenuate it significantly.The main difference between the SI-AO-STD and other semi-implicit methods, i.e., SI-STD and SI-URED, is that the SI-AO-STD is an arbitrary-order differentiator (n = 2 > 1) which also attenuates the chattering by extra integrations.Consequently, the SI-AO-STD formed a practicable control system.
Another interesting observation is that while other implicit methods are practicable, the I-GHDD leads to impracticability in this case.The reason is that (unlike other arbitrary-order differentiators that are implemented with n = 2) the I-GHDD is a third-order arbitrary-order differentiator (n = 3).As it was concluded in [1], increasing n increases the transient time.Hence, for this case and due to the reason explained above, the I-GHDD led to impracticability as was mentioned in TR4.

Effect of the parameter tuning on the results
As it was mentioned before, the parameters are tuned based on the input I 2 : f (t) = 4 × 10 4 (t 2 + 2t + 3) to ensure the practicability of the methods.Here, the differentiators are tuned according to another input to see how the parameters affect the results.In this case, the input  3, and the corresponding results are summarized in Table 8.
The most important observation is that the arbitraryorder differentiators, i.e., I-AO-STD, I-HDD, and SI-AO-STD, which were practicable before (see Table 7), are not practicable anymore.The reason is that according to TR4, an arbitrary-order differentiator shows a longer transient response.Since smaller gains L are selected for this case, these differentiators show too long transient, which led to impracticability.
Another observation is that ALIEN and I-FDFF also led to impracticability which indicate their sensitivity to parameter tuning.Also, in this experiment, the LF shows one of the worst performances, since a smaller c is selected for this differentiator compared to the first case (compare Table 3).
In summary, in spite of the fact that we do not propose in this article a systematic choice for the signal f (t) to tune the parameters along the lines of [1,2], we show that such a choice has to be done carefully depending on the closed-loop system dynamical behavior.This may pave the way towards the development of an engineer's guide for differentiator parameters tuning.
Generally speaking, comparing Tables 7 and 8, it is inferred that the differentiators behave as follows: • Euler, I-STD, I-URED, I-QD, I-AO-FDFF: The results corresponding to the simulations and experiments are quite similar except for the values of ||u|| ∞ where the experimental values are much higher than the simulation counterparts.Euler  7 and 8.
I-AO-FDFF also behaves similarly to this group of differentiators.
• LF: This differentiator shows almost the same level of performance for both experiments and simulation as shown in Tables 7 and 8.
• HD: While this differentiator shows one of the best results for the simulations, it led to the worst ex-perimental result.The reason for this observation is not clear.It is probably because of the large timedelay of this differentiator reported in [1,2] which increases the time delay in the control loop.
• I-AO-STD, SI-AO-STD, I-HDD, I-FDFF and ALIEN: While these differentiators are practicable in Table 7, they lead to impracticability when their parameters are tuned based on the input I 3 .Hence, the results corresponding to these differentiators are not provided in Table 8.Considering Table 7, the results for the simulations and experiments are quite consistent for this group of differentiators.

Results obtained for the pendulum system
The following results are drawn according to the experiments conducted in Sec. 5.
• Unlike the implicit methods, the explicit SMB differentiators show too much chattering which led to  • As it can be seen from Table 8, while the implicit first-order differentiators (I-STD, I-URED, I-QD) led to appropriate responses, the arbitrary-order counterparts (I-AO-STD, I-HDD, and I-GHDD) sometimes lead to impracticability.The reason is that a higher-order differentiator generally shows a larger transient time (TR4).
• According to Table 7, a higher-order differentiator may present better response (in case of ||e α || ∞ and ||u|| ∞ ) than a first-order one (compare I-STD and I-AO-STD in Table 7).

General conclusions
Two laboratory setups, i.e., an electro-pneumatic system and a rotary-inverted pendulum, are used in this study to implement 25 known differentiators on practical closed-loop control systems.These setups are representative enough and behave differently in the case of dynamic response and noise characteristics.Hence, it is expected that the results remain valid for a wide range of control applications.The general conclusions are summarized as follows: • Euler differentiator has the simplest structure without any tunable parameter.This is basically a pure differentiator that differentiates both the base signal as well as the measurement noise without any filtration.Surprisingly, this differentiator is practicable with comparable performances to other sophisticated methods for almost all conditions.However, this observation should not be misleading since, on any laboratory setup like the ones used in this work, there are some filtration stages implemented on the hardware or the software by the manufacturer (espe-cially on analog to digital conversion blocks) which are not controlled by the user.Hence, the Euler differentiator should always be implemented with special attention.
• The LF shows one of the best results despite its simple structure and easy parameter tuning.The main difference between the LF and the slidingmode-based (SMB) differentiators is that while the SMB differentiators can converge to the exact differentiation in noise-free case (see [1,2]), the LF always shows a phase-lag for finite gains because of its linear structure.However, in practice, converging to the exact differentiation of the polluted signal should be avoided to vanish the noise differentiation.
In such a condition, all methods including LF and the SMB differentiators exhibit phase-lag.• The implicit methods present better gain insensitivity, especially in low noise conditions.In other words, one may select a larger sampling gain for the implicit differentiators compared to the explicit counterparts.This follows TR3.
• While all differentiators are tuned in identical conditions, the higher-order differentiators (I-AO-STD, I-HDD, GHDD) may lead to impracticability for the RIPS since, compared to the first-order counterparts (I-STD, I-URED, I-QD), they present longer transient time.This is in accordance with TR4.
• Comparing the results, higher-order SMB differentiators, e.g., AO-STD, I-HDD, and I-GHDD show better variation than the cascade configurations of the first-order counterparts, e.g., STD.
• For the EPS, the implicit SMB differentiators provide a better output tracking than the LF.
In this work, 25 differentiators with different structures are implemented experimentally and their results have been compared.These differentiators have different structures containing nonlinear and discontinuous (setvalued) terms which make the parameter tuning difficult.
Moreover, the uncertainties and measurement noise on the laboratory setup cannot be taken into account while tuning the parameters.Hence, it is not clear how to find the optimal parameters of all differentiators.An optimization algorithm (proposed in [1,2]) has been employed to find the optimal parameters in specified intervals.In fact, all differentiators are uniformly optimized based on some selected input signals, i.e., I 1 , I 2 , and I 3 in open-loop configuration.These inputs are selected by trial and error to observe satisfactory responses from all differentiators.
However, the way that the optimization algorithm has been used is still questionable since it is not clear whether or not this procedure will lead to the optimal parameters for the closed-loop systems.Hence, the selection of these inputs should be addressed more clearly in the future.
In other words, an appropriate input used for the parameter tuning should be selected based on the noise characteristics and the closed-loop dynamics rather than trial and error.However the design of a suitable optimization algorithm to achieve such a goal, is thought to be a non-trivial work which is left for the future.Nevertheless the results obtained in this paper are encouraging (since they show that modifying the base function can indeed strongly improve the results) and may pave the way towards an automatic and optimal selection of base functions.Moreover, the parameters of the controllers should also be tuned alongside the differentiators' parameters, and this increases the complexity of the problem.This can be considered as the topic of future works to develop more efficient tuning algorithms in closed-loop systems.
To this end, multi-criteria optimization methods may be used to improve the optimality of the parameters.As a future study, the differentiators may also be implemented on other laboratory setups such as robotic systems [59] and flexible manipulators [60].Furthermore, more controllers can be implemented alongside the differentiators to make the conclusions more comprehensive.

Fig. 2 .
Fig. 2. The system is composed of two actuators, namely, the main and disturbance actuators.These actuators are coupled through a horizontal jack with the total mass M .The aim of the main actuator is to provide the required force to control the position of the jack, while the other one is to emulate disturbances which appear during real conditions.

Figure 3 :
Figure 3: Closed-loop diagram of the EPS where P p and P n are the pressures in the P and N chambers respectively, y and v denote the position and the velocity of the jack.The force F is the disturbance that takes into account both the external disturbance and the friction, u p and u n are the control signals applied to the servo distributor corresponding to the chambers P and N , respectively, and it will be assumed that u = u p = −u n .Moreover, k = 1.2 is the polytropic constant, T = 293.15Kdenotes the temperature, r = 287.0365J/kg/K is the ideal gas constant, and b v = 50 N sec/m is the viscous friction coefficient.

2 and 4 )
under different sampling times is presented in Fig. 5. Comparing the explicit and the implicit methods in Fig. 5 (A) and (B), one can see that for large sampling times h > 20ms, the implicit methods show smaller variations, which indicate smaller chattering on the control signal.For smaller sampling times (h < 20ms)

Figure 5 :Figure 6 :
Figure 5: Variation of the control signal u(t) under different sampling times differentiators I-AO-STD, I-HDD, and I-GHDD need an iterative solver to solve a polynomial equation at each time-step.The required calculation resources should be small enough to ensure the real-time operation of the system.A set of experiments has been conducted to address this issue and obtain the maximum tolerable iterations for the real-time implementation.According to the open-loop

Figure 10 :
Figure 10: Closed-loop diagram of the RIPS

I 3 :
f (t) = 1000 sin(200t + π/4) with quantization (resolu-tion=0.001) is considered for parameter tuning.The tuned parameters are provided in Table The following differentiators lead to impracticable experiments: VGED, I-FDFF, HGD, Kalman, ALIEN, I-GHDD, E-GHDD, I-HDD, E-HDD, E-QD, SI-AO-STD, E-AO-STD, I-AO-STD, SI-URED, E-URED, SI-STD, E-STD Performance: red<black<blue impracticability on the RIPS.This is in accordance with TR1.• Solver-based implicit SMB differentiators (I-AO-STD, I-HDD, and I-URED) can also be implemented in real-time since they led to practicability in Table 7.It indicates that enough calculation resources, required by TR2, are available on the RIPS.

•
The implicit differentiators can supersede the explicit ones in terms of chattering.Comparing the results, it can be concluded that the implicit methods always present smaller variations for large sampling times, which imply a better implementation in case of actuator degradation and efficiency.The explicit methods even may lead to impracticability mainly because of too much chattering.This validates TR1.It should be noted that this conclusion has been drawn with the parameters listen in Table 3. • The solver-based implicit differentiators (I-AO-STD, I-HDD, I-GHDD, I-URED) could be implemented on both selected laboratory setups in real-time.It indicates that calculation resources in typical laboratory setups are sufficient enough to implement the solverbased methods.This validates TR2.

Table 2 :
Constant parameters used for the SMB differentiators

Table 3 :
Parameters of the differentiators obtained from the tuning

Table 5 :
Results for h=20ms under oversized gain

Table 6 :
Maximum number of iteration for real-time operation

Table 7 :
Average results based on 10 experiments when the parameters are tuned for I 2 (parameters are shown in