
Lecture 5 –Sampled Time Control • Sampled time vs. continuous time: implementation, aliasing • Linear sampled systems modeling refresher, DSP • Sampled-time frequency analysis • Sampled-time implementation of the basic controllers – I, PI, PD, PID – 80% (or more) of control loops in industry are digital PID EE392m - Spring 2005 Control Engineering 5-1 Gorinevsky Sampled Time Models • Time is often sampled because of the digital computer use – digital (sampled time) control system x(t + d) = f (x,u,t) y = g(x,u,t) • Numerical integration of continuous-time ODE x()t + d ≈ x(t) + d ⋅ f (x,u,t), t = kd • Time can be sampled because this is how a system works • Example: bank account balance x(t +1) = x(t) + u(t) – x(t) - balance in the end of day t – u(t) - total of deposits and withdrawals that day y = x – y(t) - displayed in a daily statement EE392m - Spring 2005 Control Engineering 5-2 Gorinevsky Sampling: continuous time view • Sampled and continuous time together • Continuous time physical system + digital controller – ZOH = Zero Order Hold A/D, Sample Control D/A, ZOH computing Sensors Physical Actuators system EE392m - Spring 2005 Control Engineering 5-3 Gorinevsky Signal sampling, aliasing • Nyquist frequency: ω ω ω π N= ½ S; S= 2 /T ω ω ω • Frequency folding: k S± map to the same frequency • Sampling Theorem: sampling is Ok if there are no frequency ω components above N • Practical approach to anti-aliasing: low pass filter (LPF) • Sampled→continuous: impostoring Low A/D, Sample Digital D/A, ZOH Low Pass computing Pass Filter Filter EE392m - Spring 2005 Control Engineering 5-4 Gorinevsky Linear state space model • Generic state space model: x(t +1) = f (x,u,t) = y g(x,u,t) x(t + 1) = Ax(t) + Bu(t) • LTI state space model y(t) = Cx(t) – Physics-based linear system model – Obtained by sampling a continuous time model – Zero-order hold (ZOH) T + = AcT + ⎛ Act ⎞ = + x(t T ) e x(t) ⎜ e Bcdt⎟u(t) x&(t) Ac x(t) Bcu(t) 14243 ⎝ ∫0 ⎠ A 1424 434 y(t) = C x(t) B c = y(t) Cc x(t) • Matlab commands for model conversion: help ltimodels EE392m - Spring 2005 Control Engineering 5-5 Gorinevsky Disk read-write head example • Sampled time model for T=0.0001 Read-write head control (use Matlab ss and c2d) ⎡0.998 0⎤ ⎡ 10−3 ⎤ x(k + 1) = ⋅ x(k) + ⋅ u(k) ⎢ −4 ⎥ ⎢ −8 ⎥ ⎣ 10 0⎦ ⎣5⋅10 ⎦ 142 43 142 43 A B y(k) = []0 1 ⋅ x(k) 123 y + by = gu b = 20, g = 10 C && & 10 y = u s(s + 20) x(k + 1) = Ax(k ) + Bu(t) − 20 0 10 dx = ⎡ ⎤ ⋅ + ⎡ ⎤ ⋅ y(k ) = Cx(k ) ⎢ ⎥ x ⎢ ⎥ u dt ⎣ 1 0⎦ ⎣ 0 ⎦ 142 43 { A B y = []0 1 ⋅ x 123 C EE392m - Spring 2005 Control Engineering 5-6 Gorinevsky Sampled-time system stability + = = x(k 1) Ax(k ), x(0) x0 Example: % Take A, B, C • Initial condition response % from the R-W head example >> eig(A) = k >> ans = x(k ) A x0 1.0000 0.9980 • Exponential stability condition >> >> K = 10 λ = >> Ak = A - K*B*C; { j } eig( A) >> eig(Ak) λ < >> ans = j 1 0.9990 0.9990 >> 0.04 >> N = 2000; 0.03 >> x(:,1) = [1; 0]; >> for t=2:N, 0.02 >> x(:,t) = Ak*x(:,t-1); 0.01 >> end >> 0 0 200 400 600 800 1000 1200 1400 1600 1800 2000 >> plot(1:N,x(2,:)) EE392m - Spring 2005 Control Engineering 5-7 Gorinevsky Impulse response • Response to an input impulse u y δ (⋅) ⎯⎯→P h(⋅) t t • Sampled time: t = 1, 2, ... • Control history = linear combination of the impulses ⇒ system response = linear combination of the impulse responses ∞ u(t) = ∑δ (t − k)u(k) k=0 ∞ y(t) = ∑h(t − k)u(k) = ()h *u (t) k=0 EE392m - Spring 2005 Control Engineering 5-8 Gorinevsky Convolution representation of a sampled-time system • Convolution signal t processing y = h * u y(t) = ∑h(t − k)u(k) k=−∞ notation • Impulse response u(t) = δ (t) ⇒ y(t) = h(t) • Step response: u = 1 for t > 0 t t g(t) = ∑h(t − k) = ∑h( j) h(t) = g(t) − g(t −1) k=0 j=0 Matlab commands: g = cumsum(h); h = diff(g); EE392m - Spring 2005 Control Engineering 5-9 Gorinevsky z-transform vs. Laplace transform ∞ • Discrete (z-transform) transfer function: H (z) = ∑h(k)z−k = – function of complex variable z Imag z k 0 – z forward shift operator i – analytical outside the circle |z|≥r 1 – all poles are inside the circle Re z – for a stable system r ≤ 1 ∞ • Laplace transform transfer function: H (s) = ∫ h(t)estdt −∞ – function of complex variable s Imag s – s differentiation operator – analytical in a half plane Re s ≤ a Re s – for a stable system a ≤ 1 EE392m - Spring 2005 Control Engineering 5-10 Gorinevsky Sampled time vs. continuous time • Continuous time analysis (digital implementation of a continuous time controller) 1 – Tustin’s method = trapezoidal rule of integration for H(s) = s ⎛ 2 1− z−1 ⎞ H (s) → H (z) = H ⎜ s = ⋅ ⎟ s ⎜ −1 ⎟ ⎝ T 1+ z ⎠ – Matched Zero Pole: map each zero and a pole in accordance with s = e zT • Sampled time analysis (Sampling of continuous signals and system) • Systems analysis is often performed continuous time - this is where the controlled plant is. EE392m - Spring 2005 Control Engineering 5-11 Gorinevsky FIR model N h = − = () y(t) ∑hFIR (t k)u(k) hFIR *u (t) k=0 t • FIR = Finite Impulse Response • Cut off the trailing part of the impulse response to obtain FIR • FIR filter state x is the shift register content u(t) y(t) z-1 h0 x1=u(t-1) x(t + 1) = Ax(t) + Bu(t) -1 z h1 y(t) = Cx(t) x2=u(t-2) -1 z h2 x3=u(t-3) EE392m - Spring 2005 Control Engineeringh3 5-12 Gorinevsky IIR model na nb = − − + − • IIR model: y(t) ∑ak y(t k) ∑bku(t k) k=1 k=0 • Filter states: y(t-1), …, y(t-na ), u(t-1), …, u(t-nb ) u(t) b y(t) z-1 0 z-1 u(t-1) y(t-1) -a z-1 b1 1 z-1 u(t-2) y(t-2) -1 -a2 -1 z b2 z u(t-3) y(t-3) -a b3 3 EE392m - Spring 2005 Control Engineering 5-13 Gorinevsky IIR model • Matlab implementation of an IIR model: filter • Transfer function realization: unit delay operator z-1 y(t) = H (z)u(t) B(z) b z N + b z N −1 + ... + b H (z) = = 0 1 N Control convention N + N −1 + + Matlab tf, step etc A(z) z a1 z ... a N + −1 + + −N = b0 b1 z ... bN z Signal processing convention + −1 + + −N 1 a1 z ... a N z Matlab filter etc ()()1 + a z −1 + ... + a z − N y(t) = b + b z −1 + ... + b z − N u(t) 14241 44 434N44 104241 44 4344N 4 A( z ) B( z ) • FIR model is a special case of an IIR with A(z) =1 (or zN ) EE392m - Spring 2005 Control Engineering 5-14 Gorinevsky IIR approximation example • Low order IIR approximation of impulse response: (prony in Matlab Signal Processing Toolbox) • Fewer parameters than a FIR model • Example: sideways heat transfer – impulse response h(t) – approximation with IIR filter a = [a1 a2 ], b=[b0 b1 b2 b3 b4 ] IMPULSE RESPONSE −1 −2 −3 −4 0.06 b + b z + b z + b z + b z H (z) = 0 1 2 3 4 + −1 + −2 1 a1z a2 z 0.04 0.02 0 0 20 40 60 80 100 TIME EE392m - Spring 2005 Control Engineering 5-15 Gorinevsky Linear state space model • LTI state space model x(t + 1) = Ax(t) + Bu(t) y(t) = Cx(t) + Du(t) • Unit delay operator z-1: z-1 x(t) = x(t-1) • Transfer function of an LTI model – defines an IIR representation − y = [()Iz − A 1 B + D]⋅ u − H (z) = C()Iz − A 1 B + D • Stability: the poles are inside the unit circle EE392m - Spring 2005 Control Engineering 5-16 Gorinevsky Stability analysis • Transfer function poles tell you everything about stability • Model-based analysis for a simple feedback example: y = H (z)u H(z)K y = y = L(z) y = − − + d d u K( y yd ) 1 H(z)K • If H(z) is a rational transfer function describing an IIR model • Then L(z) also is a rational transfer function describing an IIR model EE392m - Spring 2005 Control Engineering 5-17 Gorinevsky State space realization of IIR filter u(t) b4 b3 b2 b1 b0 y(t) = H (z)u(t) −1 −N -1 -1 -1 -1 B(z) b + b z + ... + b z z z z z H (z) = = 0 1 N + −1 + + −N A(z) 1 a1z ... aN z a4 a3 a2 a1 y(t) + − − − − ⎡ x1(t 1)⎤ ⎡ a1 a2 a3 a3 ⎤ ⎡ x1(t)⎤ ⎡1⎤ ⎢x (t + 1)⎥ ⎢ 1 0 0 0 ⎥ ⎢x (t)⎥ ⎢0⎥ ⎢ 2 ⎥ = ⎢ ⎥ ⋅ ⎢ 2 ⎥ + ⎢ ⎥u(t) + ⎢x3 (t 1)⎥ ⎢ 0 1 0 0 ⎥ ⎢x3 (t)⎥ ⎢0⎥ ⎢ + ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣x4 (t 1)⎦ ⎣ 0 0 1 0 ⎦ ⎣x4 (t)⎦ ⎣0⎦ ⎡ x1(t)⎤ ⎢x (t)⎥ = []− − − − ⋅ ⎢ 2 ⎥ + y(t) b1 a1b0 b2 a2b0 b3 a3b0 b4 a4b0 b0u(t) ⎢x3 (t)⎥ ⎢ ⎥ ⎣x4 (t)⎦ EE392m - Spring 2005 Control Engineering 5-18 Gorinevsky Poles and Zeros System Impulse Response 1 •…not quite so! 0.8 • Example: 0.6 0.4 z Amplitude y = H (z)u = 0.2 − z 0.7 0 0 5 10 15 20 25 • FIR model - truncated IIR Ti me (sec) 19 + 18 + 17 + + + = = z 0.7z 0.49z ..
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages36 Page
-
File Size-