Control Systems Lab - SC4070 Control techniques Dr. Manuel Mazo Jr. Delft Center for Systems and Control (TU Delft) m.mazo@tudelft.nl Tel.:015-2788131 TU Delft, February 16, 2015 (slides modified from the original drafted by Robert Babuška) M. Mazo Jr. (DCSC/TUD) Dynamics 1 / 36
Outline 1 Overview of control design methods 2 Continuous vs. discrete time design 3 State-feedback control, observers 4 Control architectures, nonlinear control 5 PID controllers M. Mazo Jr. (DCSC/TUD) Dynamics 2 / 36
Outline 1 Overview of control design methods 2 Continuous vs. discrete time design 3 State-feedback control, observers 4 Control architectures, nonlinear control 5 PID controllers M. Mazo Jr. (DCSC/TUD) Dynamics 3 / 36
Linear control design methods P, PD, PI, PID, lead-lag control (classical, in frequency) state feedback, output feedback (modern, in state-space) LQR, linear quadratic control (optimal) model predictive control (optimal, finite-horizon, constrained) robust control (H, µ synthesis) M. Mazo Jr. (DCSC/TUD) Dynamics 4 / 36
Nonlinear control techniques feedback linearization sliding-mode control nonlinear model predictive control passivity-based control knowledge-based control adaptive control hybrid control M. Mazo Jr. (DCSC/TUD) Dynamics 5 / 36
Outline 1 Overview of control design methods 2 Continuous vs. discrete time design 3 State-feedback control, observers 4 Control architectures, nonlinear control 5 PID controllers M. Mazo Jr. (DCSC/TUD) Dynamics 6 / 36
Computer-controlled systems: approach 1 Clock u(t) A-D Algorithm D-A System y(t) 1 Design a continuous-time controller, 2 then make sure that the (digital) computer implementation approximates the continuous-time controller as precisely as possible. M. Mazo Jr. (DCSC/TUD) Dynamics 7 / 36
Computer-controlled systems: approach 2 Clock u(t) A-D Algorithm D-A System y(t) 1 Describe the system from the computer s (digital) viewpoint, 2 and design directly a discrete-time controller. M. Mazo Jr. (DCSC/TUD) Dynamics 8 / 36
System from the computer s viewpoint Clock { u( t k )} D-A u( t) System y( t) A-D { y( t k )} Describe system (including converters) only over discrete sampling instants. M. Mazo Jr. (DCSC/TUD) Dynamics 9 / 36
A-D Converter: Zero-Order Hold t t t t t t 0 1 2 3 4 5 Time u(t) = u(t k ), t k t < t k+1 Usually (but not necessarily) t k+1 t k = const = h. Higher-order converters are also possible. M. Mazo Jr. (DCSC/TUD) Dynamics 10 / 36
Zero-order hold sampling of systems Continuous-time system: dx(t) dt = Ax(t) + Bu(t) y(t) = Cx(t) + Du(t) Discrete-time system: x(k + 1) = Φx(k) + Γu(k) y(k) = Cx(k) + Du(k) with (recall solution of non-autonomous ODE): Φ = e Ah, Γ = h 0 e As dsb, Effect on eigenvalues placement. where h is the sampling period M. Mazo Jr. (DCSC/TUD) Dynamics 11 / 36
Useful basic MATLAB commands G = ss(a,b,c,d); % LTI continuous-time state-space model h = 0.1; H = c2d(g,h); % sampling period [s] % convert to discrete time (ZOH) H = c2d(g,h,method); % method = foh, matched,... G = d2c(h); % convert to continuous time (ZOH) M. Mazo Jr. (DCSC/TUD) Dynamics 12 / 36
Selection of sampling period (1st order) Number of samples per rise time: N r = Tr h 4 10 (a) 1 0 1 0 5 (b) 1 (c) 0 1 0 5 1 0 1 0 5 (d) 1 0 1 0 5 Time 1 0 0 5 1 0 0 5 1 0 0 5 1 0 0 5 Time (a) N r = 1 (b) N r = 2 (c) N r = 4 (d) N r = 8 M. Mazo Jr. (DCSC/TUD) Dynamics 13 / 36
Selection of sampling period (2nd order) N r = Tr h 4 10 corresponds to ω0h 0.2 0.5 (a) (c) 1 0 0 5 1 0 0 5 Time (b) (d) 1 0 0 5 1 0 0 5 Time (a) h = 0.125 (ω 0h = 0.23) (b) h = 0.250 (ω 0h = 0.46) (c) h = 0.500 (ω 0h = 0.92) (d) h = 1.000 (ω 0h = 1.83) M. Mazo Jr. (DCSC/TUD) Dynamics 14 / 36
State feedback in DT: problem formulation Discretize LTI model choosing a sampling interval Model : x(k + 1) = Φx(k) + Γu(k) Linear controller : u(k) = Lx(k) Design parameters: closed-loop poles Evaluation: compare x(k) and u(k) with specifications (trade-off between control magnitude and speed of response) M. Mazo Jr. (DCSC/TUD) Dynamics 15 / 36
Poles placement: Ackermann s formula Compute L such that (Φ ΓL) has a desired characteristic polynomial P(z). Ackermann s formula: where: L = (0... 0 1) C 1 P(Φ) P(Φ) is the desired characteristic polynomial in Φ; C is the controllability matrix of the pair (Φ, Γ). Place poles inside unit ball. In Matlab: L = acker(phi,gamma,p) (SISO, numerical problems?) L = place(phi,gamma,p) (MISO, more robust) M. Mazo Jr. (DCSC/TUD) Dynamics 16 / 36
Alternatively, choose the desired poles in Continuous-Time Use the continuous-time 2nd order model, study its (continuous-time) characteristic polynomial: which (with zoh sampling) leads to: s 2 + 2ζωs + ω 2, z 2 + p 1z + p 2 where: p 1 = 2e ζωh cos (ωh ) 1 ζ 2 p 2 = e 2ζωh In Matlab use c2d to get the discrete time model (Φ, Γ). M. Mazo Jr. (DCSC/TUD) Dynamics 17 / 36
Linear quadratic control: LQR J = N x(k) T Qx(k) + u(k) T Ru(k), k=1 where (matrices, weights) Q, R are design parameters. A state feedback matrix L that gives a minimal J can be found by solving an associated algebraic Riccati equation. Similar to pole placement, but no need to define poles! In Matlab: dlqr(phi,gamma,q,r) In Matlab: dlqry(phi,gamma,c,d,q,r) % state weighting % output weighting M. Mazo Jr. (DCSC/TUD) Dynamics 18 / 36
Outline 1 Overview of control design methods 2 Continuous vs. discrete time design 3 State-feedback control, observers 4 Control architectures, nonlinear control 5 PID controllers M. Mazo Jr. (DCSC/TUD) Dynamics 19 / 36
State estimation: observers x(k + 1) = Φx(k) + Γu(k) y(k) = Cx(k) Assume input and output are available, reconstruct the state: Direct calculation; Luenberger observer (model-based); Kalman filter (optimal in presence of Gaussian noise). Note: the terms observer, estimator, filter are in this context used synonymously. M. Mazo Jr. (DCSC/TUD) Dynamics 20 / 36
Model-based estimation 1 Consider the model: ˆx(k + 1) = Φˆx(k) + Γu(k) 2 Introduce feedback from measured y(k) ˆx(k + 1) = Φˆx(k) + Γu(k) + K[y(k) C ˆx(k)] 3 Define the estimation error e = x ˆx e(k + 1) = Φe(k) KCe(k) = [Φ KC]e(k) M. Mazo Jr. (DCSC/TUD) Dynamics 21 / 36
Observer block diagram y( k) K ^ u( k) x( k+ 1) 1 z ^ x( k) C ^ y( k) ^ x( k) M. Mazo Jr. (DCSC/TUD) Dynamics 22 / 36
Output feedback (observer + state feedback) ( ) ˆx(k + 1) = Φˆx(k) + Γu(k) + K y(k) C ˆx(k) u(k) = Lˆx(k) M. Mazo Jr. (DCSC/TUD) Dynamics 23 / 36
Poles of the closed-loop system x(k + 1) = Φx(k) + Γu(k) e(k + 1) = (Φ KC)e(k) u(k) = L(x(k) e(k)) ( x(k + 1) e(k + 1) ) = ( Φ ΓL ΓL 0 Φ KC ) ( x(k) e(k) ) Separation principle: (Closed-loop) Process poles: A r (z) = det(zi Φ + ΓL) Observer poles: A o(z) = det(zi Φ + KC) M. Mazo Jr. (DCSC/TUD) Dynamics 24 / 36
Outline 1 Overview of control design methods 2 Continuous vs. discrete time design 3 State-feedback control, observers 4 Control architectures, nonlinear control 5 PID controllers M. Mazo Jr. (DCSC/TUD) Dynamics 25 / 36
Feed-forward (two-degree-of-freedom) Goal: respond to a reference signal with desired specs. Approach: Replace u(k) = Lˆx(k) by: u(k) = Lˆx(k) + L cu c(k) u c L c x^ -L u Process y Observer M. Mazo Jr. (DCSC/TUD) Dynamics 26 / 36
Feed-forward (two-degree-of-freedom) Closed-loop system: x(k + 1) = (Φ ΓL)x(k) + ΓLe(k) + ΓL cu c(k) e(k + 1) = (Φ KC)e(k) y(k) = Cx(k) Transfer function from u c to y (for impulse response): H cl (z) = C(zI Φ + ΓL) 1 ΓL c = L c B(z) A r (z) M. Mazo Jr. (DCSC/TUD) Dynamics 27 / 36
Application to a nonlinear system y 0 u 0 y 0 Reference Feedforward controller Nonlinear system δy δ Feedback controller M. Mazo Jr. (DCSC/TUD) Dynamics 28 / 36
Control by local linear controller u u 0 Nonlinear system Linearized model δ y 0 y Linear controller δ M. Mazo Jr. (DCSC/TUD) Dynamics 29 / 36
Model-based adaptive control u y r Controller Process Design parameters Linear model y m - Adaptation M. Mazo Jr. (DCSC/TUD) Dynamics 30 / 36
Outline 1 Overview of control design methods 2 Continuous vs. discrete time design 3 State-feedback control, observers 4 Control architectures, nonlinear control 5 PID controllers M. Mazo Jr. (DCSC/TUD) Dynamics 31 / 36
Continuous-time PID controller The textbook version of a PID controller: ( u(t) = K e(t) + 1 t ) de(t) e(s)ds + T d T i dt A more realistic PID controller: ( U(s) = K (U c(s) Y (s)) + 1 ) st d (U c(s) Y (s)) st i 1 + st d /N Y (s) Note: u c(t) is the reference that we want the output to follow. M. Mazo Jr. (DCSC/TUD) Dynamics 32 / 36
Discrete-time PID controller P-term: P(k) = K(u c(k) y(k)) I-term: I (k + 1) = I (k) + K T i e(k) D-term: D(k) = T d D(k 1) KT d N T d +Nh T d (y(k) y(k 1)) +Nh u(k) = P(k) + I (k) + D(k) Note: Backward-difference used to approximate the D-term, i.e. s z 1 hz M. Mazo Jr. (DCSC/TUD) Dynamics 33 / 36
PID tuning Pole placement Root locus Bode diagram (Heuristic) Tuning rules (Ziegler-Nichols, λ tuning) K p G(s) = e t 0s (τs + 1) K c = τ K p(λ + t 0), T i = τ, T d = t0 2 M. Mazo Jr. (DCSC/TUD) Dynamics 34 / 36
Example of a complete controller: Cascaded control on an Inverted Pendulum Reference Position controller Angle controller Inverted pendulum M. Mazo Jr. (DCSC/TUD) Dynamics 35 / 36
The End Thanks for your attention! Questions? M. Mazo Jr. (DCSC/TUD) Dynamics 36 / 36