This is a repository copy of Robust sampled-data implementation of PID controller.

White Rose Research Online URL for this paper: http://eprints.whiterose.ac.uk/153375/

Version: Accepted Version

Proceedings Paper: Selivanov, A. .org/0000-0001-5075-7229 and Fridman, E. (2019) Robust sampled-data implementation of PID controller. In: 2018 IEEE Conference on Decision and Control (CDC). 2018 IEEE Conference on Decision and Control (CDC), 17-19 Dec 2018, Miami Beach, FL, USA. IEEE , pp. 932-936. ISBN 9781538613962 https://doi.org/10.1109/cdc.2018.8619030

© 2018 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other users, including reprinting/ republishing this material for advertising or promotional purposes, creating new collective works for resale or redistribution to servers or lists, or reuse of any copyrighted components of this work in other works. Reproduced in accordance with the publisher's self-archiving policy.

Reuse Items deposited in White Rose Research Online are protected by copyright, with all rights reserved unless indicated otherwise. They may be downloaded and/or printed for private study, or other acts as permitted by national copyright laws. The publisher or other rights holders may allow further reproduction and re-use of the full text version. This is indicated by the licence information on the White Rose Research Online record for the item.

Takedown If you consider content in White Rose Research Online to be in breach of UK law, please notify us by emailing [email protected] including the URL of the record and the reason for the withdrawal request.

[email protected] https://eprints.whiterose.ac.uk/ Robust sampled-data implementation of PID controller

Anton Selivanov and Emilia Fridman

Abstract— We study a sampled-data implementation of the Finally, we develop an event-triggering mechanism that PID controller. Since the derivative is hard to measure directly, allows to reduce the amount of sampled control signals it is approximated using a finite difference giving rise to a used for stabilization [7], [8]. Some of the ideas presented delayed sampled-data controller. We suggest a novel method for the analysis of the resulting closed-loop system that allows to use here have been generalized in [9] to study time-delayed and only the last two measurements, while the existing results used sampled-data implementation of control depending on high- a history of measurements. This method also leads to essentially order output derivatives. larger sampling period. We show that, if the sampling period is The analysis will employ the following inequalities. small enough, then the performance of the closed-loop system Lemma 1 (Exponential Wirtinger’s inequality [10]): Let under the sampled-data PID controller is preserved close to the Rn one under the continuous-time PID controller. The maximum f : [a,b] → be an absolutely continuous function with a sampling period is obtained from LMIs derived using an square integrable first order derivative such that f(a) = 0 appropriate Lyapunov-Krasovskii functional. These LMIs allow or f(b) = 0. Then, for any α ∈ R and 0 ≤ W ∈ Rn×n, to consider systems with uncertain parameters. Finally, we b develop an event-triggering mechanism that allows to reduce 2αt T the amount of sampled control signals used for stabilization. e f (t)Wf(t) dt Za I.INTRODUCTION 4(b − a)2 b ≤ e2|α|(b−a) e2αtf˙T (t)W f˙(t) dt Proportional integral derivative (PID) controllers are ex- π2 Za tremely popular in the control engineering practice. These R controllers depend on the output derivative that can hardly be Lemma 2 (Jensen’s inequality [11]): If f : [a,b] → measured in practice. Instead, the derivative can be approxi- and ρ: [a,b] → [0, ∞) are such that the integration con- mated using the finite difference y˙ ≈ (y(t)−y(t−τ))/τ. This cerned is well-defined, then 2 gives rise to a time-delayed controller, which was studied, b b b e.g., in [1], [2] using the frequency domain approach. ρ(s)f(s) ds ≤ ρ(s) ds ρ(s)f 2(s) ds. In this paper, we study the sampled-data implementation of "Za # Za Za PID. This problem has been recently considered in [3]. One of the ideas (originated in [4], [5]) was to use the Taylor’s II.SAMPLED-DATA PID CONTROL expansion for the delayed term with the remainder in the Consider the scalar system integral form. The remainder is then compensated by an appropriate Lyapunov-Krasovskii term. The data sampling y¨(t)+ a1y˙(t)+ a2y(t)= bu(t) (1) was studied using the time-delay approach [6]. and the PID controller Here, we significantly improve the results of [3]. The key t novelty is that the sampling error is calculated for the deriva- u(t)= k¯py(t)+ k¯i y(s) ds + k¯dy˙(t). (2) tive approximation, while in [3] it was calculated for the Z0 delayed measurement. This idea allows to write the stability The controller (2) depends on the output derivative, which conditions in terms of the controller gains used in the original is hard to measure directly. Instead, the derivative can be continuous PID, while [3] used the sampling-dependent approximated by the finite-difference gains obtained after substituting the approximation into the y(t) − y(t − h) y˙(t) ≈ y (t)= , h> 0. (3) continuous PID (see Remark 3). One of the consequences is 1 h that the sampled-data implementation of PID requires to use This approximation leads to the delay-dependent control only the last two measurements, while [3] used a history of measurement whose length was increasing for a decreasing t u(t)= k¯ y(t)+ k¯ y(s) ds + k¯ y (t) sampling period. Moreover, we obtain significantly larger p i d 1 0 (4) sampling periods compared to [3] (see Example 1). The Z t stability conditions are formulated in terms of LMIs that are = kpy(t)+ ki y(s) ds + kdy(t − h), affine with respect to the system parameters. This allows to Z0 1 use them to study systems with uncertain parameters. where y(t)= y(0) for t< 0 and ¯ ¯ A. Selivanov ([email protected]) is with Royal kd kd kp = k¯p + , ki = k¯i, kd = − . (5) Institute of Technology, , and University, . E. Fridman h h ([email protected]) is with Tel Aviv University, Israel. Supported by Israel Science Foundation (grant No. 1128/14). 1Then y˙(t) with t ∈ [0,h) is approximated by 0 We study the sampled-data implementation of the controller Then the system (1) under the sampled-data PID control (8) (4) that is obtained using the approximations can be presented as

t tk k−1 x˙ = Ax + Avv + B (κ + δ) , (9) y(s) ds ≈ y(s) ds ≈ h y(tj), y = Cx, 0 0 Z Z j=0 t ∈ [tk,tk+1), X where y(t ) − y(t ) y˙(t) ≈ y˙(t ) ≈ y (t )= k k−1 , k 1 k h 0 1 0 A = −a + bk¯ −a + bk¯ bk¯ , where h > 0 is the sampling period, t = kh, k ∈ N , 2 p 1 d i k 0  1 0 0  are the sampling instants, and y(t ) = y(t ). Substituting (10) −1 0  0 0 0 0  these approximations into (2), we obtain the sampled-data A = bk¯ 0 bk¯ , B = bk¯ , C = 1 0 0 . controller v p i d  1 0 0   0    k−1     u(t)= k¯py(tk)+ k¯ih y(tj)+ k¯dy1(tk) Theorem 1: Consider the system (1). j=0 ¯ X (i) For given sampling period h > 0, controller gains kp, k−1 (6) k¯i, k¯d, and decay rate α > 0, let there exist positive- = kpy(tk)+ kih y(tj)+ kdy(tk−1), definite matrices P,S ∈ R3×3 and nonnegative scalars j=0 2 X W , R such that Ψ ≤ 0, where Ψ = {Ψij} is the t ∈ [tk,tk+1), k ∈ N0 symmetric matrix composed from T with kp, ki, and kd defined in (5). Ψ11 = PA + A P + 2αP, Ψ12 = PAv, 2 T π We will show that the sampled-data controller (6) stabi- Ψ13 =Ψ14 = PB, Ψ15 = A G, Ψ22 = − 4 S, T T lizes the system (1) if (2) stabilizes (1) and the sampling Ψ25 = Av G, Ψ35 =Ψ45 = B G, 2 period h > 0 is small enough. Moreover, we will derive π −2αh −2αh Ψ33 = −W 4 e , Ψ44 = −Re , Ψ55 = −G, LMIs that allow to find appropriate h. αh 000 1 αh 2 2 2 010 2 G = h e S + h ( 4 R + e W ) First, we present the estimation error y˙(t) − y1(t) in a 000 h i convenient integral form. with A, Av, B, and C given in (10). Then, the sampled- Lemma 3: If y ∈ C1 and y˙ is absolutely continuous, then data PID controller (6) exponentially stabilizes the sys- y1 defined in (3) satisfies tem (1) with the decay rate α. (ii) Let there exist k¯ , k¯ , k¯ such that the PID controller (2) t t − h − s p i d y1(t)=y ˙(t)+ κ(t), κ = y¨(s) ds. (7) exponentially stabilizes the system (1) with a decay rate t−h h α′. Then, the sampled-data PID controller (6) with k , Proof: Taylor’s expansionZ with the remainder in the p k , k given by (5) exponentially stabilizes the system integral form gives i d (1) with any given decay rate α<α′ if the sampling t period h> 0 is small enough. y(t − h)= y(t) − y˙(t)h − (t − h − s)¨y(s) ds. Proof: (i) Consider the functional Zt−h Reorganizing the terms, we obtain V = V0 + Vv + Vδ + Vy + Vκ (11) y(t) − y(t − h) t t − h − s with y1(t)= =y ˙(t)+ y¨(s)ds. T h t−h h V0 = x Px, Z t 2 2αh −2α(t−s) T Vv = h e e x˙ (s)Sx˙(s) ds To study the stability of (1) under the sampled-data PID Ztk 2 t control (6), we rewrite the closed-loop system in the state π −2α(t−s) T space. Let − e v (s)Sv(s) ds, 4 tk Z t x1(t) y(t) 2 −2α(t−s) 2 Vδ = Wh e y˙1(s) ds x(t)= x2(t) = y˙(t) tk    k−1  Z t x3(t) (t − tk)y(tk)+ h y(tj) 2 j=0 π −2αh −2α(t−s) 2     − W e e δ (s)ds, 4 tk for t ∈ [tk,tk+1). Introduce the errors dueP to sampling t Z 2 2αh −2α(t−s) s − t + h 2 v(t)= x(tk) − x(t), Vy = Wh e e y¨ (s) ds, t ∈ [tk,tk+1), k ∈ N0. t−h h δ(t)= y1(tk) − y1(t), Z t (s − t + h)2 V = R e−2α(t−s) y¨2(s) ds. Using these representations and (7) in (6), we obtain κ 4 Zt−h u(t)= k¯px1(tk)+ k¯ix3(tk)+ k¯dy1(tk) (8) 2MATLAB codes for solving the LMIs are available at =[k¯p, k¯d, k¯i]x +[k¯p, 0, k¯i]v + k¯d (κ + δ) . https://github.com/AntonSelivanov/CDC18a Wirtinger’s inequality (Lemma 1) implies Vv ≥ 0 and Remark 2: Using the ideas of [3], the results of this paper Vδ ≥ 0. Using the representation (9), we obtain can be easily extended to the vector systems V˙ + 2αV = 2xT P [Ax + A v + B(κ + δ)]+2αxT Px, 0 0 v y¨(t)+ A1y˙(t)+ A2y(t)= Bu(t) π2 V˙ + 2αV = h2e2αhx˙ T Sx˙ − vT Sv, v v 4 under the sampled-data PID control 2 ˙ 2 2 π −2αh 2 k−1 Vδ + 2αVδ = Wh y˙1 − W e δ . 4 u(t)= K¯py(tk)+ K¯ih y(tj)+ K¯dy1(tk),t ∈ [tk,tk+1), j=0 Using Jensen’s inequality (Lemma 2) with ρ ≡ 1, we get X t where y ∈ Rl, u ∈ Rm and A , A , B, K¯ , K¯ , K¯ are V˙ + 2αV = Wh2e2αhy¨2 −Whe2αh e−2α(t−s)y¨2(s) ds 1 2 p i d y y matrices of appropriate dimensions. Zt−h t 2 Remark 3: In [3], the system (1) was studied under the ≤ Wh2e2αhy¨2 − W y¨(s) ds . sampled-data feedback (cf. (6)) Zt−h  Differentiating (7), we obtain k−1 t u(t)= kpy(tk)+ kih y(tj)+ kdy(tk−q), y¨(s) j=0 y˙1 = ds. X t h h N Z − t ∈ [tk,tk+1), k ∈ 0, (12) Therefore, where q is an integer delay. In the analysis, the errors due to ˙ 2 2αh 2 2 2 Vy + 2αVy ≤ Wh e y¨ − Wh y˙1. sampling y(tk)−y(t) and y(tk−q)−y(t−qh) were multiplied by k = k¯ + k¯ /(qh) and k = −k¯ /(qh) that grow when Using Jensen’s inequality (Lemma 2) with ρ(s)= s − t + h, p p d d d qh → 0. Consequently, one had to increase the discrete delay we obtain q while reducing the sampling period h to maintain kp and 2 t h 2 −2α(t−s) s − t + h 2 kd bounded. Here, the errors due to sampling are multiplied V˙κ + 2αVκ = R y¨ − R e y¨ (s) ds 4 2 by k¯ and k¯ that do not depend on h (see v and δ in (8)). Zt−h p d h2 This allows to use q = 1 and, therefore, smaller memory is ≤ R y¨2 − Re−2αhκ2. 4 required to implement (6) (see Example 1). Summing up, we have III.EVENT-TRIGGERED PID CONTROL V˙ + 2αV ≤ ψT Ψ¯ ψ +x ˙ T Gx,˙ We introduce the event-triggering mechanism to reduce where ψ = col{x,v,δ,κ} and Ψ¯ is obtained from Ψ by the amount of transmitted control signals [7], [8]. Namely, removing the last two block-columns and block-rows. Substi- we consider the system tuting (9) for x˙ and applying the Schur complement, we find ˙ − y¨(t)+ a1y˙(t)+ a2y(t)= buˆk, t ∈ [tk,tk+1), k ∈ N0, that Ψ ≤ 0 guarantees V ≤ −2αV . Since V (tk) ≤ V (tk ), the latter implies exponential stability of the system (9) and, (13) therefore, of (1), (6). where uˆk is the event-triggered control: uˆ0 = u(t0), (ii) The closed-loop system (1), (2) is equivalent to x˙ = u(tk), if (15) is true, Ax. Since (1), (2) is exponentially stable with the decay rate uˆk = (14) uˆk−1, if (15) is false α′, there exists P > 0 such that PA + AT P + 2αP < 0  ′ 1 1 1 for any α<α . Choose S = h I2, R = h , and W = h . with u(t) from (6) and the event-triggering condition Applying the Schur complement to Ψ ≤ 0, we obtain 2 2 (u(tk) − uˆk−1) > σu (tk). (15) PA + AT P + 2αP + hF (e−2αh) < 0. Here, σ ∈ [0, 1) is the event-triggering threshold. The latter holds for small h> 0. Thus, (i) guarantees (ii). Remark 4: We consider the event-triggering mechanism Remark 1: Since the LMIs of Theorem 1 are affine in a , 1 with respect to the control signal, since the event-triggering a , and b, they can be used to study uncertain systems of 2 with respect to the measurements yˆ = y(t )+ e leads to the form (1) with a ∈ [a , a¯ ], a ∈ [a , a¯ ], and b ∈ [b, ¯b]. k k k 1 1 1 2 2 2 an accumulating error in the integral term: In this case, one needs to solve the LMIs of Theorem 1 for k−1 k−1 k−1 each combination of (a1,a2,b) with a1 ∈ {a1, a¯1}, a2 ∈ tk ¯ {a2, a¯2}, b ∈ {b, b} applying the same decision variables. y(s) ds ≈ h yˆj = h y(tj)+ h ej. Using the descriptor approach [6], the LMIs of Theorem 1 0 j=0 j=0 j=0 Z X X X can be modified to cope with system uncertainties better. Theorem 2: Consider the system (13). In Example 2 considered below this leads to insignificant (i) For given sampling period h > 0, controller gains k¯p, improvements (h = 0.023 using Theorem 1 as it is and h = k¯i, k¯d, event-triggering threshold σ ∈ [0, 1), and decay 0.024 using Theorem 1 with a descriptor). rate α > 0, let there exist positive-definite matrices P,S ∈ R3×3 and nonnegative scalars W , R, ω such that3 Φ ≤ 0, where ¯−1 PBkd Φ17 0 Φ27   Ψ 0 σωk¯d Φ=  0 σωk¯d  ,    GBk¯−1 0   d   ∗∗∗∗∗ −ω 0    Fig. 1. Example 1: system (1) under continuous-time control (2) (black  ∗ ∗ ∗ ∗ ∗ 0 −σω    solid line), sampled-data control (6) (blue dashed line), event-triggered  k¯p k¯p control (14) (red dotted line). Φ = σω k¯d , Φ = σω 0 17   27   k¯i k¯i     with A, Av, B, and C given in (10). Then, the event- triggered PID controller (6), (14), (15) exponentially stabilizes the system (13) with the decay rate α. (ii) Let there exist k¯p, k¯i, k¯d such that the PID controller (2) exponentially stabilizes the system (1) with a decay rate α′. Then, the event-triggered PID controller (6), (14), (15) exponentially stabilizes the system (13) with any given decay rate α<α′ if the sampling period h > 0 and the event-triggering threshold σ are small enough. Proof: Introduce the event-triggering error e =u ˆk − u(tk) for t ∈ [tk,tk+1). Then (13) under the event-triggered PID control (6), (14), (15) can be presented as x˙ = Ax + A v + B(κ + δ + k¯−1e), v d (16) y = Cx, Fig. 2. Example 2: system (1) under continuous-time control (2) (black N solid line), sampled-data control (6) (blue dashed line), event-triggered for t ∈ [tk,tk+1), k ∈ 0, with A, Av, B, and C defined control (14) (red dotted line). in (10). Consider the functional (11). For ω ≥ 0, the event- triggering rule (14), (15) guarantees considered (12) with q = 7. In our case, q = 1, which leads 0 ≤ ωσu2(t ) − ωe2. k to a smaller memory used in the implementation. Thus, we have Consider now the system (13) with the same parameters. The LMIs of Theorem 2 are feasible for h = 0.016, σ = V˙ + 2αV ≤ V˙ + 2αV +[ωσu2(t ) − ωe2] k 0.02, implying that the event-triggered PID controller (6), ≤ ϕT Φ¯ϕ +x ˙ T Gx˙ + ωσu2(t ), k (14), (15) stabilizes the system (13). Sampled-data control where ϕ = col{x,v,δ,κ,e} and Φ¯ is obtained from Φ by (6) requires to transmit ⌊10/h⌋ + 1 = 527 control signals removing the blocks Φij with i ∈ {5, 7} or j ∈ {5, 7}. during 10 seconds of simulations. The event-triggered control Substituting (16) for x˙ and (8) for u(tk) and applying the requires to transmit on average 325.9 control signals. This Schur complement lemma, we find that Φ ≤ 0 guarantees value was found performing numerical simulations for 10 ˙ V ≤−2αV . The remainer of the proof is similar to that of randomly chosen initial conditions satisfying kx(0)k∞ ≤ 1. Theorem 1. Thus, the even-triggering mechanism reduces the amount of Remark 5: The results of Theorem 2 can be applied to transmitted control signals by almost 40%. However, due uncertain systems in a manner similar to Remark 1. to a smaller sampling period, it requires to transmit more measurements. Nevertheless, the total amount of transmitted IV. NUMERICALEXAMPLES signals is reduced by almost 10%. Fig. 1 shows y(t) for Example 1: Following [2], [3], we consider (1) with a1 = various types of control. 8.4, a2 = 0, b = 35.71. The system is not asymptotically Example 2: Following [12], we consider (1) with stable if u = 0. The PID controller (2) with k¯p = −10, k¯i = a ∈ [0.01248, 9.251], a ∈ [5.862, 22.19], −40, k¯d = −0.65 exponentially stabilizes (1). Let α = 5 be 1 2 the desired decay rate. The LMIs of Theorem 1 are feasible b ∈ [0.03707, 0.04612]. 3 for h = 0.019, which is larger than h = 4.7×10− obtained The PID controller (2) with in [3]. This leads to the controller gains kp ≈−44.21, ki = ¯ ¯ ¯ −40, and kd ≈ 34.21 calculated using (5). Moreover, [3] kp = −516.6, ki = −143.8, kd = −765.5

3MATLAB codes for solving the LMIs are available at stabilizes the system (1). The LMIs of Theorem 1 are feasible https://github.com/AntonSelivanov/CDC18a for α = 0.1, h = 0.023 implying that the sampled-data 4 controller (6) with kp ≈ −3.38 × 10 , ki = −143.8, REFERENCES 4 kd ≈ 3.33 × 10 exponentially stabilizes the system (1) [1] Y. Okuyama, “Discretized PID Control and Robust Stabilization for with the decay rate α = 0.1. The LMIs of Theorem 2 Continuous Plants,” IFAC Proceedings Volumes, vol. 41, no. 2, pp. are feasible for α = 0.1, h = 0.016, σ = 0.1. Thus, 14 192–14 198, 2008. [2] A. Ram´ırez, S. Mondie,´ R. Garrido, and R. Sipahi, “Design of the system (13) is exponentially stable under the event- Proportional-Integral-Retarded (PIR) Controllers for Second-Order triggered control (6), (14), (15). Sampled-data control (6) LTI Systems,” IEEE Transactions on Automatic Control, vol. 61, no. 6, requires to transmit ⌊20/h⌋ + 1 = 870 control signals pp. 1688–1693, 2016. [3] A. Selivanov and E. Fridman, “Sampled-Data Implementation of during 20 seconds of simulations. The event-triggered control Derivative-Dependent Control Using Artificial Delays,” IEEE Trans- requires to transmit on average 103.1 control signals. This actions on Automatic Control, 2018, in press. value was found performing numerical simulations for a = [4] E. Fridman and L. Shaikhet, “Delay-induced stability of vector second- 1 order systems via simple Lyapunov functionals,” Automatica, vol. 74, 2.674, a2 = 10.97, b = 0.04107 and 10 randomly chosen pp. 288–296, 2016. initial conditions satisfying kx(0)k∞ ≤ 1. Thus, the even- [5] ——, “Stabilization by using artificial delays: An LMI approach,” triggering mechanism reduces the amount of transmitted Automatica, vol. 81, pp. 429–437, 2017. [6] E. Fridman, Introduction to Time-Delay Systems: Analysis and Con- control signals by more than 88%. The total amount of trol. Birkhauser¨ Basel, 2014. transmitted signals is reduced by more than 20%. Fig. 2 [7] P. Tabuada, “Event-Triggered Real-Time Scheduling of Stabilizing shows y(t) for various types of control. Control Tasks,” IEEE Transactions on Automatic Control, vol. 52, no. 9, pp. 1680–1685, 2007. [8] W. P. M. H. Heemels, K. H. Johansson, and P. Tabuada, “An introduc- tion to event-triggered and self-triggered control,” in IEEE Conference on Decision and Control, 2012, pp. 3270–3285. V. CONCLUSION [9] A. Selivanov and E. Fridman, “An improved time-delay implementa- tion of derivative-dependent feedback,” Automatica, 2018, in press. [10] ——, “Observer-based input-to-state stabilization of networked control systems with large uncertain delays,” Automatica, vol. 74, pp. 63–70, PID controllers are widely used in the industry. For 2016. practical application, their sampled-data implementation is [11] O. Solomon and E. Fridman, “New stability conditions for systems important. This paper provides an efficient method for such with distributed delays,” Automatica, vol. 49, no. 11, pp. 3467–3475, 2013. implementation. The results are formulated in terms of [12] M. Ge, M.-S. Chiu, and Q.-G. Wang, “Robust PID controller design simple LMIs and are applicable to uncertain systems. via LMI approach,” Journal of Process Control, vol. 12, no. 1, pp. 3–13, 2002.