Repetitive Control Professor Eric Rogers Electronics and Computer Science University of Southampton Southampton, SO17 1BJ, UK etar@ecs.soton.ac.uk http://www.ecs.soton.ac.uk/ Professor Eric Rogers ECS, University of Southampton, UK Basics • Many signals in engineering are periodic, or at least they can be accurately approximated by a periodic signal over a large time interval, e.g., engines, electrical motors and generators, converters, or machines performing a repetitive task. • Control problem to try to track a periodic signal with the output of the plant or reject a periodic disturbance acting on a control system. In the former case the period, T, will be known a priori by the nature of the task performed, in the latter it can be identified using established methods. • Repetitive control (RC) uses information from previous periods or trials (also termed cycles in some literature) to modify the control signal so that the overall system ‘learns’ to track perfectly a given T-periodic reference signal. Professor Eric Rogers ECS, University of Southampton, UK Basics • SISO plant with state-space model ẋ(t) = Ax(t) + Bu(t), x(0) = x0 y(t) = Cx(t) + Du(t) (1) • Reference signal r(t) is given, and it is known that r(t) = r(t + T), for a given T (in other words the actual shape of r(t) is not necessarily known). • Control design objective: find a feedback controller that makes the system (1) track the reference signal as accurately as possible (i.e., limt→∞ e(t) = 0, e(t) := r(t) − y(t)), under the assumption that the reference signal r(t) is T-periodic. Professor Eric Rogers ECS, University of Southampton, UK Basics • Solvability condition: the internal model principle must hold, i.e., for controller (2) [Mu](t) = [Ne](t) where M and N are suitable operators, a model of the reference signal must be included in M. • Since r(t) is T-periodic —its internal model is given by the operator (1 − σT ), where [(1 − σT )v](t) = v(t) − v(t − T) for an arbitrary v : R → R where R denotes the field of real numbers. • One simple RC law u(t) = u(t − T) + e(t) (3) (M = (1 − σT )) and also [Nv](t) = v(t) for an arbitrary v : R → R. Professor Eric Rogers ECS, University of Southampton, UK Positive Realness Definition Let G(s) denote the transfer-function of the system (1), i.e., G(s) = C(sI − A)−1 B + D. Then (1) is positive-real if 1) Each entry in G(s) is analytic for Re s > 0 2) G(s) is real for real positive s 3) G(s) + G∗ (s) ≥ 0 for Re s ≥ 0 where the superscript ∗ denotes the complex conjugate and Re denotes the real part. Relaxed algorithm u(t) = αu(t − T) + Ke(t) (4) where α ∈ (0, 1), is a relaxation parameter and K ∈ R, K > 0. Professor Eric Rogers ECS, University of Southampton, UK Positive Realness For x(0) = 0 and G(s) stable U(s) = αe−sT K(s)r(s) U(s) + 1 + G(s)K(s) 1 + G(s)K(s) A sufficient condition (small gain theorem) for stability is α <1 sup ω≥0 1 + G(jω)K(jω) (5) (6) For α = 1, this inequality is never met in when G(s) is strictly proper, because if this holds then limω→∞ G(jω) = 0, and 1 therefore limω→∞ | 1+KG(jω) | = 1. Professor Eric Rogers ECS, University of Southampton, UK Positive Realness • Condition (6) implies that the control law converges to a T-periodic solution, and in the limit (4) becomes u(t) = K e(t) 1−α (7) and y(t) converge to a T-periodic solution given by Y(s) = 1 K 1−α G(s) r(s) K + 1−α G(s) (8) • If α → 1 (giving the original law (3)), it is clear that an infinite feedback gain is required. However, a positive-real system in this case can tolerate such a gain. Therefore stability holds for an arbitrary α ∈ [0, 1], if the original system is positive-real. Professor Eric Rogers ECS, University of Southampton, UK Positive Realness — SISO case Nquist plot for G(s) Nyquist Diagram of a PR system 0.2 0.15 Imaginary Axis 0.1 K ∞ 0.05 0 −0.05 −0.1 −0.15 −0.2 −0.2 −0.1 0 0.1 0.2 0.3 0.4 Real Axis Professor Eric Rogers ECS, University of Southampton, UK Positive Realness — SISO case • The control law (3) will result in convergent learning when the original continuous-time system is positive-real. • Problem: not possible to implement a delay block using analogue components. • Consider the SISO discrete-time system x(t + 1) = Φx(t) + Γu(t), y(t) = Cx(t) + Du(t) x(0) = x0 (9) and corresponding transfer-function G(z) = C(zI − Φ)−1 Γ + D. Professor Eric Rogers ECS, University of Southampton, UK Positive Realness — SISO case Definition Then (9) is said to be positive-real if 1) G(z) is analytic for |z| > 1 2) G(z) is real for real positive z 3) Re[G(ejθ )] ≥ 0 for all θ ∈ [0, 2π] (i.e., the Nyquist plot of G(z) lies in the right-half plane) Lemma Suppose that the system (9) is positive-real and CB 6= 0 (the assumption that CB 6= 0 is almost always true for a continuous-time system sampled with zero-order hold) then D 6= 0. Professor Eric Rogers ECS, University of Southampton, UK Positive Realness — SISO case • If the discrete control law u(t) = u(t − T) + Ke(t) gives convergent learning, then infinite feedback gain results — not implementable without instability. • Hence the only option is the ‘relaxed’ version of the control law (where α is typically replaced with a dynamic causal filter), which does not give perfect tracking for an arbitrary T-periodic reference. • Next a computationally more complex algorithm for the discrete-time case which results in perfect tracking is developed. Professor Eric Rogers ECS, University of Southampton, UK RC Design • Sample the plant model every Ts seconds to give (10) A(z)y(z) = B(z)u(z) where y(z) and u(z) denote the z transforms of the input and output respectively and A(z) and B(z) are polynomials in z−1 . Also it is assumed that (10) is both controllable and observable. • Control objective: track a T-periodic reference, i.e., r(t + T) = r(t). Professor Eric Rogers ECS, University of Southampton, UK RC Design Lemma The tracking problem can be written equivalently in terms of the original process model (10) as Ã(z)e(z) = B(z)ũ(z) Ã(z) = −(1 − z−T )A(z) ũ(z) = (1 − z−T )u(z) (11) where e(z) = r(z) − y(z). Also a control law M(z)ũ(z) = N(z)e(z), where M(z) and N(z) are polynomials in z−1 will drive the tracking error to zero exponentially if it stabilizes the modified system model (11). Professor Eric Rogers ECS, University of Southampton, UK RC Design • The design problem now is to force the output e(z) of (11) to zero. • Many possible solutions, e.g., robust or adaptive based solutions. • Here we use an optimal control based solution. • Write the controlled system description as e(z) = −1 B(z) ũ(z) 1 − z−T A(z) (12) which is a series connection of the polynomial systems S1 and S2 where −1 S1 : up (z) = 1−z −T ũ(z) (13) B(z) S2 : e(z) = A(z) up (z) Professor Eric Rogers ECS, University of Southampton, UK RC Design A state-space model for S1 is ξ(t + 1) = Ξξ(t) + Ωũ(t) up (t) = −Ψξ(t) − ũ(t) (14) where Ξ = 0 0 1 0 0 1 .. . . . . 0 Professor Eric Rogers 0 0 ... 0 ... 0 ... .. .. . . 0 ... 0 1 0 0 0 0 .. .. . . 1 0 (15) ECS, University of Southampton, UK RC Design Ω = 1 0 0 ... 0 0 T Ψ = 0 0 0 ... 0 1 (16) and for S2 xp (t + 1) = Ap xp (t) + Bp up (t) (17) e(t) = Cp x(t) Combining these last two state-space models now yields xm (t + 1) = Φm xm (t) + Γm ũ(t), e(t) = Cm xm (t) xm (0) = xm,o (18) where the dimension of xm (·) is n + T, and n is the order of the original process model (10). Professor Eric Rogers ECS, University of Southampton, UK RC Design Ξ 0 −Bp Ψ Ap 0 Cp = Φm = Cm , Γm = Ω −Bp (19) Cost function J 0 = min J(ũ, xm (0)) (20) P T T J(ũ, xm (0)) = ∞ i=1 e(i) Qe(i) + ũ (i)Rũ(i) P∞ T QC x (i) + ũT (i)Rũ(i) = i=1 xm (i)T Cm m m (21) ũ∈l2 where Q 0, R 0. Professor Eric Rogers ECS, University of Southampton, UK RC Design Solution: u(t) = u(t − T) − Kxm (t) (22) K = (ΓTm SΓm + R)−1 ΓTm SΦm (23) where and S is the solution of the algebraic Riccati equation T S = ΦTm [S − SΓm (ΓTm SΓm + R)−1 ΓTm S]Φm + Cm QCm (24) or with the state estimator x̂m (t + 1) = Φm x̂m (t) + Γm ũ(t) + L(e(t) − Cm x̂m (t)) (25) where L is the observer gain, the control law is u(t) = u(t − T) − Kx̂m (t) Professor Eric Rogers (26) ECS, University of Southampton, UK RC Design Extension to include noise: e xm (t + 1) = Φm xm (t) + Γm ũ(t) + Hw(t) e(t) = Cm xm (t) + v(n), xm (0) = xm,o (27) where w(t) and v(t) are zero mean Gaussian noise signals. • Conceptually w(t) describes uncertainty in the state-space model, whereas v(t) describes uncertainty in the measurement process. • If the covariance matrix Qn of v(t) and the covariance matrix Rn of w(t) are known, it is possible to find an optimal observer gain L that minimizes the variance of the estimation error. Professor Eric Rogers ECS, University of Southampton, UK RC Design • Combining the optimal feedback controller and optimal observer the resulting closed-loop system is stable, and hence the expected value of e(t) will exponentially converge to zero as t → ∞. z Professor Eric Rogers ECS, University of Southampton, UK Experimental Results • The non-minimum phase electro-mechanical system. Reference r(t) Output u(t) Input y(t) 12 Output (rads) / Input (V) 10 8 6 4 2 0 -2 0 5 10 Time (s) 15 20 20 UPM sinewave demand convergence. Professor Eric Rogers ECS, University of Southampton, UK Reference r(t) Output y(t) Input(t) Output (rads) / Input (V) 6 4 2 0 0 5 10 15 20 -2 -4 -6 Time (s) 20 UPM repeating sequence demand convergence. Professor Eric Rogers ECS, University of Southampton, UK 1 0.8 0.5 0.7 0.9 0.98 1 NE 0.6 0.4 0.2 0 0 50 100 150 200 250 300 350 400 Cycle No. Trial error results for sinewave demand with relaxation. Professor Eric Rogers ECS, University of Southampton, UK 1 0.8 0.5 0.7 0.9 0.98 1 NE 0.6 0.4 0.2 0 0 50 100 150 200 250 300 350 400 Cycle No. Trial error results for repeating sequence demand with relaxation. Professor Eric Rogers ECS, University of Southampton, UK 1 Optimal based Contraction mapping Multiple lead Phase-lead 0.8 NE 0.6 0.4 0.2 0 0 50 100 150 200 Cycle No. 250 300 350 400 Comparison of RC schemes for sinewave demand. Professor Eric Rogers ECS, University of Southampton, UK 1 Optimal based Contraction mapping Multiple lead Phase-lead 0.8 NE 0.6 0.4 0.2 0 0 50 100 150 200 Cycle No. 250 300 350 400 Comparison of RC schemes for repeating sequence demand. Professor Eric Rogers ECS, University of Southampton, UK Comparisons • The previous two figures compare the best results produced with this scheme with those of other RC laws applied on the same plant, namely the phase-lead algorithm, a multiple phase-lead algorithm and the contraction mapping law. These methods also require a plant model. • It is clear that the optimality based algorithm has hugely improved convergence when compared to these alternatives, a similar final error bound and little sign of greater instability. • To match its convergence rate, the gain of these other schemes can be increased but this always leads to the rapid onset of instability. Professor Eric Rogers ECS, University of Southampton, UK Comparisons • Successive trial errors are linked through e(z) = γz−T 1−γ e(z) + r(z) 1 + G(z)H(z) 1 + G(z)H(z) (28) where H(z) = K[zI − (Φm − LCm − Γm K)]−1 L (29) • A sufficient condition for convergence of the error sequence is γ 1 + GH < 1 (30) for all |z| = 1. Professor Eric Rogers ECS, University of Southampton, UK Comparisons • Algorithm robustness can be started from that for (30) to hold all roots of 1 − z−T + GH = 0 (31) must have modulus less than unity. • One way of proceeding from here is to plot the Nyquist diagram of point. Professor Eric Rogers GH 1−z−T and check for encirclements of the −1 ECS, University of Southampton, UK Comparisons • A simpler alternative is to work with GH − z−T since GH − z−T = −z−T (Gn Hn + Gd Hd ) Gd Hd (32) where the subscripts n and d denote the numerator and denominator polynomials of G and H. Professor Eric Rogers ECS, University of Southampton, UK References • The results in this section are from the reference below. This is just one method from a well studied and still heavily worked area. • The references in this cited paper lead to some other designs, but again nowhere near an exhaustive list. C. T. Freeman, P. L. Lewin, E. Rogers and D. H. Owens and J. J. Hätönen An optimality-based repetitive control algorithm for discrete-time systems IEEE Transactions on Circutis and Systems-I: Regular Papers, 55(1):412–423, 2008. Professor Eric Rogers ECS, University of Southampton, UK Duality between ILC and RC • It can be shown, under some assumptions, that the structure of RC and ILC differ only in the location of an internal model of the disturbance. • The ability to treat RC and ILC in the same framework is appealing since controllers found to operate well in one area can be synthesized for application to the other. • Firs work in the following paper. D. de Roover, O. H. Bosgra and M. Steinbuch Internal-model-based design of repetitive and iterative learning controllers for linear multivariable systems International Journal of Control, 73(10):914–929, 2000. Professor Eric Rogers ECS, University of Southampton, UK Duality between ILC and RC • More recent work and experimental verification using the gantry robot can be found in the following paper. C. T. Freeman, M. Ali Alsubaie, Z. Cai, E. Rogers and P. L. Lewin A common setting for the design of iterative learning and repetitive controllers with experimental verification International Journal of Adaptive Control and Signal Processing, 2012, In press. Available online from http://www.ecs.soton.ac.uk/ Professor Eric Rogers ECS, University of Southampton, UK