An Overview of Control Theory and Digital Signal Processing Luca Matone Columbia Experimental Gravity group (GECo) LHO Jul 18-22, 2011 LLO Aug 8-12, 2011 LIGO-G1100863 Syllabus (tentative) Day Topic Textbooks 1 Control theory: Physical systems, models, linear systems, block diagrams, differential equations, feedback loops, cruise control example, MATLAB implementation. 2 Control theory: Laplace transform and its inverse , transfer functions, partial fraction expansion, first-order and secondorder systems, dynamic response, bode plots, stability criteria, MATLAB implementation. 3 Control theory: robustness, typical compensators, noise suppression, one arm cavity lock example, MATLAB implementation and time-domain simulations with SIMULINK. 4 DSP: Discrete-time signals and systems, impulse response, system stability, convolution and correlation, differential to difference equations, the Z transform, the Discrete-time Fourier Transform (DTFT), the Discrete Fourier Transform (DFT), MATLAB implementation. 5 DSP: The Fast-Fourier Transform (FFT), power spectral density, sampling theorem, aliasing, analog-to-digital transformations, digital filtering, FIR filters, IIR filters, moving average filter, filter design, ADC and DACs, MATLAB implementation. LIGO-G1100863 Chau, Pao C. Process Control: A First Course with MATLAB®. Cambridge University Press, 2002. ISBN 0-521-00255-9. Ingle, Vinay K. and John G. Proakis. Digital Signal Processing using Matlab®. Brooks/Cole 2000. ISBN 0534-37174-4. Smith, Steven W. The Scientist and Engineer’s Guide to Digital Signal Processing. California Technical Publishing 1999. http://www.dspguide.com/ Matone: An Overview of Control Theory and Digital Signal Processing (1) 2 Objective Control System • Manages and regulates a set of variables in a system – SISO – single-input-singleoutput – MIMO – multiple-inputmultiple-output • A quantity is measured then controlled • Requirements – – – – – LIGO-G1100863 Bandwidth Rise time Overshoot Steady state error … Matone: An Overview of Control Theory and Digital Signal Processing (1) 3 Objective Digital Signal Processing • Measure and filter an analog signal • Digital signal – Created by sampling an analog signal – Can be stored • Analog filters – Cheap, fast and have a large dynamic range in both amplitude and frequency • Digital filters – Can be designed and implemented “onthe-fly” – Superior level of performance. • Example: a low pass digital filter can have a gain of 1 ± 0.0002, a frequency cutoff at 1000 Hz, and a gain of less than 0.0002 for frequencies above 1001 Hz. A transition of 1 Hz! LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 4 Control Theory 1 • Given a physical system – Objective: sense and control a variable in the system • Examples – As basic as • a car’s cruise control (SISO) or – Not so basic as • Locking the full LIGO interferometer (MIMO) LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 5 Example: Cruise Control Direction of motion Normal force (n) Friction force (ffr) • Objective Force from engine (f) – Car needs to maintain a given speed • Physical system includes Weight (mg) – car’s inertia – friction Force or free body diagram: allows to analyze the forces at play LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 6 Physical model Direction of motion Normal force (n) Friction force (ffr) Weight (mg) LIGO-G1100863 • Physical system described by the following equation of motion Force from π = π − πππ = ππ engine (f) β₯ π‘π ππππ • Simplifying and assuming friction force πππ is proportional to speed πππ = ππ£ ππ£ ππ = π = π − ππ£ ππ‘ Matone: An Overview of Control Theory and Digital Signal Processing (1) 7 First-order differential equation Direction of motion • Solving for first-order differential equation (assuming π is a constant) Engine Friction force (ffr) force (f) Time constant π = π/π LIGO-G1100863 Speed at regime π£π = π/π ππ£ π = π − ππ£ ππ‘ yields the solution π£ = π£π 1 − π −π‘/π Matone: An Overview of Control Theory and Digital Signal Processing (1) 8 MATLAB implementation Direction of motion Friction force (ffr) The linear differential equation describing the dynamics of the system ππ£ π = π − ππ£ ππ‘ Engine force (f) Using MATLAB’s Symbolic Math Toolbox >> dsolve('m*Dy=f-b*y','y(0)=0') ans = (f - f/exp((b*t)/m))/b LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 9 π = 1000 ππ π = 50 ππ π π = 500 π Results: π£ = π£π β 1 − π −π‘/π π£ τ = 63% β π£π cruise_timedomain.m π π π£π = = 10 π π π τ = = 20 π π LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 10 Block diagram: representing the physical system • To illustrate a cause-and-effect relationship • A single block represents a physical system • Blocks are connected by lines – Lines represent how signals flow in the system • In general, a physical system G has signal x(t) as input and signal y(t) as output • G is the transfer function of the system x(t) LIGO-G1100863 G y(t) Matone: An Overview of Control Theory and Digital Signal Processing (1) 11 Car’s body Transfer function G represents the car’s body – G converts the force from the engine π (input signal, π) to the car’s actual speed π£ (output signal, π/π ) π£ =πΊβπ with G = 1 (1 π – Units: π ππ LIGO-G1100863 π −π −ππ‘ ) f(t) G Matone: An Overview of Control Theory and Digital Signal Processing (1) v(t) 12 Setting the desired speed • Second transfer function H (the controller) – Converts the desired speed (or reference) π£π to a required force π – Sets the throttle – For simplicity, H is set to a constant π = π» β π£π → π£ = πΊ β π» β π£π π£ =πΊβπ – πΊ β π» must be dimensionless vr f H G LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) v 13 Plotting results Generated force by controller H Resulting speed v cruisefeedback_timedomain.m • With π» = π the actual speed is the reference: π£ = π£π • Simulate: setting desired speed to 25 m/s (55 mph) Desired speed vr LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 14 Introducing a disturbance – a hill • In the presence of a hill the equation of motion needs to be re-visited Force from engine (f) • Assuming a small angle θ ππ£ π = π − ππ£ − ππ β θ ππ‘ Direction of motion Friction force (ffr) LIGO-G1100863 θ Weight (mg) Added term Matone: An Overview of Control Theory and Digital Signal Processing (1) 15 Introducing a disturbance – a hill Assuming π and π are constants ππ£ π = π − ππ£ − ππ β θ ππ‘ Direction of motion Force from engine (f) π£ = πΊ β π − ππ β θ Friction force (ffr) LIGO-G1100863 ϑ Weight (mg) Added term Matone: An Overview of Control Theory and Digital Signal Processing (1) 16 Modifying the block diagram π£ =πΊβπ θ π£ =πΊβ π−πΎβπ K vr H f + πΎ = ππ G v Summation junction LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 17 Modifying the block diagram π£ =πΊβπ θ π£ =πΊβ π−πΎβπ K vr H f + πΎ = ππ G v Summation junction LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 18 Plotting results Setting desired speed to 25 m/s and slope of π = 5° Resulting speed v cruisefeedback_timedomain.m Generated force by controller H Desired speed LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 19 Negative Feedback 1. Let’s measure the car’s speed and 2. Correct for it by feeding back into the system a measure of the actual speed π£ θ K Error signal vre + - H f + G v c Correction signal LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 20 Negative Feedback 1. Let’s measure the car’s speed and 2. Correct for it by feeding back into the system a measure of the actual speed π£ θ Error signal e: the difference between the desired speed and K the measured speed. If null, then π = ππ f + + e H vr - G v c LIGO-G1100863 Correction signal c: in this case it is just a measure of the actual speed Matone: An Overview of Control Theory and Digital Signal Processing (1) 21 Negative feedback – Faster response with feedback (compare blue against red curves) – Speed at regime: 23 π/π (error of ~10%) LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) cruisefeedback_timedomain2.m • Plot of force vs. time and speed vs. time with negative feedback • Setting π» = 103 ππ/π • Result: 22 Negative feedback • Increasing the controller’s gain (H) • Setting π» = 104 ππ/π • Result: – Even faster response – Speed at regime: 24.8 π/π (error of ~1%) LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) cruisefeedback_timedomain3.m – decreases the rise time – while decreasing the steady state error 23 Signal flow and block diagrams π = π£π − π π£ = πΊ β (π − πΎ β π) π =π»βπ θ K vr + - e H f + G v c LIGO-G1100863 π = π£Matone: An Overview of Control Theory and Digital Signal Processing (1) 24 π = π£π − π = π£π − π£ System’s open loop gain (dimensionless) = π£π − πΊ β π − πΎ β π = π£π − πΊ β π» β π − πΎ β π θ 1 πΎβπΊ π= β π£π + βπ 1+πΊβπ» 1+πΊβπ» vr + e H - LIGO-G1100863 K f + c - Matone: An Overview of Control Theory and Digital Signal Processing (1) G v 25 1 πΎβπΊ π= β π£π + βπ 1+πΊβπ» 1+πΊβπ» ππ πΊ β π» β« 1 (high gain, closed loop, with feedback) πΎβπΊ πΎ π ≈ 0 β π£π + βπ ≈ π ππ πΊ β π» βͺ 1(low πΊβπ» π» gain, open loop, or no θ Error signal in closed loop: close to feedback) zero, proportional to angle π K π ≈ 1 β π£π + πΎ β πΊ β π vr + - LIGO-G1100863 e H f + c πΎ π π» The higher the controller’s gain, the lower e π= - G v Matone: An Overview of Control Theory and Digital Signal Processing (1) 26 π£ =πΊβπ»βπ−πΎβπΊβπ = πΊ β π» β (π£π − π£) − πΎ β G β π = πΊ β π» β π£π − πΊ β π» β π£ − πΎ β πΊ β π With no feedback π£ = πΊ β π» β π£π − πΎ β πΊ β π θ πΊβπ» πΎβπΊ π£= β π£π − ( )βπ 1+πΊβπ» 1+πΊβπ» K vr + - LIGO-G1100863 e H f + c - Matone: An Overview of Control Theory and Digital Signal Processing (1) G v 27 πΊβπ» πΎβπΊ π£= π£π − π 1+πΊβπ» 1+πΊβπ» ππ πΊ β π» βͺ 1 (low gain, ππ πΊ β π» β« 1 (high gain, closed loop, with feedback) open loop or no πΎβπΊ πΎ feedback) π£ ≈ 1 β π£π − β π ≈ π£π − π π£ ≈ πΊ β π» β π£π − πΎ β πΊ β π πΊβπ» π» θ Actual speed π£: close to π£π with an error proportional to π when in closed loop. The higher the controller’s gain, the lower the speed error. vr + - LIGO-G1100863 e H K f + c - Matone: An Overview of Control Theory and Digital Signal Processing (1) G v 28 π =π»βπ 1 πΎβπΊ =π»β( π£π + π) 1+πΊβπ» 1+πΊβπ» θ π» πΎβπΊβπ» π= β π£π + βπ 1+πΊβπ» 1+πΊβπ» vr + - LIGO-G1100863 e H K f + c - Matone: An Overview of Control Theory and Digital Signal Processing (1) G v 29 π» πΎβπΊβπ» π= β π£π + βπ 1+πΊβπ» 1+πΊβπ» ππ πΊ β π» β« 1 (high gain, ππ πΊ β π» βͺ 1 (low gain, closed loop, with feedback) open loop, or no feedback) 1 π ≈ π» β π£π + πΎ β πΊ β π» β π π ≈ π£π + πΎ β π πΊ θ Force π: at regime, it does not depend on the gain in π» while proportional to angle π vr + - LIGO-G1100863 e K H f + c - Matone: An Overview of Control Theory and Digital Signal Processing (1) G v 30 Plotting πΊπ» and πΊπ» 1 + πΊπ» LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) cruisefeedback_timedomain2.m • Open loop π£ = πΊ β π» β π£π • Closed loop πΊβπ» π£= β π£π 1+πΊβπ» • Setting π» = 103 ππ/π • Plotting the open loop transfer function vs. time and the closed loop transfer function vs. time • Notice the rapid rise time for the closed loop case 31 The error signal e LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) cruisefeedback_timedomain2.m • Plot of error signal e vs time • Error signal decreases to 3 m/s. • Notice a ~10% steady state error 32 Open and closed loop TF with π» = 104 ππ/π LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 33 Error signal e with π» = 104 ππ/π LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 34 Cruise control example • First-order differential equation • Simplest controller: simply a gain with no time constants involved • How to handle more complicated problems? LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 35 Block diagram reduction x x y P2 P1 P1 + ± x P1P2 y x P1 ±P2 y x π1 1 ± π1 π2 y P2 x + β P1 y y P2 LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 36 Practice Determine the output C in terms of inputs U and R. U R + - LIGO-G1100863 πΊ1 + + πΊ2 Matone: An Overview of Control Theory and Digital Signal Processing (1) C 37 Practice Determine the output πΆ in terms of inputs π1 , π2 and π . U1 R + + πΊ1 π»1 + + + + πΊ2 C π»2 U2 LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 38 More practice Determine C/R for the following systems. (c) πΊ1 π»1 LIGO-G1100863 R+ + +C + πΊ2 πΊ1 + + C π»1 (b) πΊ2 + R + (a) R+ + πΊ2 πΊ1 + + C π»1 Matone: An Overview of Control Theory and Digital Signal Processing (1) 39 How do we MEASURE the OL TF of a system when the loop is closed? 1. Add an injection point in a closed loop system 2. Inject signal π₯ and read signal π¦1 (just before the injection) and π¦2 (right after the injection) π¦1 π₯ 3. Solve for the ratio π¦2 + + π¦1 LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) π¦2 40 So far… • Control theory builds on differential equations • Block diagrams help visualize the signal flow in a physical system • The cause-and-effect relationship between variables is referred to as a transfer function (TF) • The system’s open-loop TF is the product of transfer functions – cruise control example: πΊ β π» – Two cases: πΊ β π» βͺ 1 and πΊ β π» β« 1 • MATLAB implementation – Functions used: dsolve LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 41 Laplace Transforms • The technique of Laplace transform (and its inverse) facilitates the solution of ordinary differential equations (ODE). • Transformation from the time-domain to the frequency-domain. • Functions are complex, often described in terms of magnitude and phase LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 42 Linear systems • To map a model to frequency space – System must be linear – Output proportional to input • Given system P x – Input signals: π₯1 and π₯2 – Output signals (response): π¦1 and π¦2 P y • System P is linear – If input signal: π π₯1 + π π₯2 – Then output signal: π π¦1 + π π¦2 – Superposition principle LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 43 Example • Is π¦ = ππ₯ ππ‘ a linear system? οKnowing that π¦1 = ππ₯1 ππ‘ and π¦2 = ππ₯2 ππ‘ οIf input is π1 π₯1 + π2 π₯2 , output is π π1 π₯1 + π2 π₯2 = ππ‘ π π π1 π₯1 + π2 π₯2 = ππ‘ ππ‘ π1 π¦1 + π2 π¦2 οSystem is linear LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 44 Example • Is π¦ = π₯ 2 a linear system? οKnowing that π¦1 = π₯1 2 andπ¦2 = π₯2 οIf input is π1 π₯1 + π2 π₯2 , output is π1 π₯1 + π2 π₯2 2 2 ≠ π1 π¦1 + π2 π¦2 οSystem is not linear LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 45 In general Output ππ π¦ π π−1 π¦ ππ π + ππ−1 π−1 + β― + π0 π¦ ππ‘ ππ‘ ππ π₯ π π−1 π₯ = ππ π + ππ−1 π−1 + β― + π0 π₯ ππ‘ ππ‘ Input π π ππ π· π π¦ π‘ = π=0 LIGO-G1100863 ππ π· π π₯ π‘ π=0 Matone: An Overview of Control Theory and Digital Signal Processing (1) π≥π For a stable system 46 Laplace Transform L • Transforms a linear differential equation into an algebraic equation • Tool in solving differential equations • Laplace transform of function f πΉ π = L π(π‘) • Laplace inverse transform of function F −1 π(π‘) = L πΉ(π ) where π = ππ is the transform variable Imaginary unit LIGO-G1100863 2ππ Matone: An Overview of Control Theory and Digital Signal Processing (1) 47 Time domain ↔ Laplace domain π= ππ¦ f(π‘) ππ‘ Input Output y(π‘) π(π ) LIGO-G1100863 πΊ(π ) F(π ) Matone: An Overview of Control Theory and Digital Signal Processing (1) 48 Laplace Transform L ∞ π(π‘)π −π π‘ ππ‘ πΉ π = L π(π‘) = 0 π π‘ =L LIGO-G1100863 −1 1 πΉ(π ) = 2ππ +ππ πΉ(π )π π π‘ ππ −ππ Matone: An Overview of Control Theory and Digital Signal Processing (1) 49 (Some) Laplace transform pairs π(π) π(π) Unit step π’(π‘) 1 Unit ramp π‘ 1 sin(π0 π‘) Sinusoid 1/π 1 − π −ππ‘ SHO π0 π −πΏπ0 π‘ × 1 − πΏ2 × sin( 1 − πΏ 2 π0 π‘) LIGO-G1100863 1 π ππ‘ Exponential π 1 π π 2 π −π π 2 + π0 2 π π +π π0 2 π 2 + 2πΏπ0 π + π0 2 Matone: An Overview of Control Theory and Digital Signal Processing (1) 50 Laplace transform properties • Linearity L π1 π1 π‘ + π2 π2 π‘ • Derivatives – First-order: L ππ(π‘) ππ‘ – Second-order: L • Integral = π1 πΉ1 π + π2 πΉ2 π = π πΉ(π ) π 2 π(π‘) ππ‘ 2 = π 2 πΉ(π ) π‘ 1 L π π‘ ππ‘ = πΉ(π ) π 0 LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 51 Solution to ODEs 1. Laplace transform the system’s ODE 2. Solve the algebraic equation in s 3. Inverse transform back to the time domain LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 52 Transfer Function πΊ π π π ππ π· π π¦ π‘ = π=0 π ππ π· π π₯ π‘ π=0 π ππ π π π π = π=0 π(π ) πΊ π = = π(π ) ππ π π π π Using derivative property π=0 Algebraic equation π π in s, the ratio of 2 π=0 ππ π polynomials in s π π π π π=0 π Transfer function πΊ π relates input π π to output π π .53 LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) Transfer Function πΊ π The roots of the numerator are referred to as zeros. Transfer function πΊ π can π(π ) be defined by πΊ π = = • The coefficients of s or π(π ) • Its poles and zeros π π π π π=0 π π π π π π=0 π The roots of the denominator are referred to as poles. 54 LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) Let’s apply it to the cruise control example: transfer function πΊ (the car’s body) Direction of motion Engine force (f) Friction force (ffr) f(t) F(s) LIGO-G1100863 G(t) v(t) ππ£(π‘) π = π(π‘) − ππ£(π‘) ππ‘ π π π π = πΉ π − π π(π ) π π V(s) = πΊ π πΉ π where πΊ π G(s) 1 π = at − π π Pole π +Signal π/π Matone: An Overview of Control Theory and Digital Processing (1) 55 Dynamic response: using lookup tables to inverse transform Laplace inverse transform using lookup tables 1 π π +π 1 1 − π −ππ‘ π LIGO-G1100863 Input: step function, amplitude πΉ0 π π‘ = πΉ0 π’(π‘) πΉ πΉ π = L π(π‘) = 0 π The response (in frequency space) is 1/π πΉ0 π π =πΊ π βπΉ π = β π + π/π π The time-domain response is π£ π‘ = L−1 π(π ) = 1 −1 πΉ0 =L β π π (π + π π) Matone: An Overview of Control Theory and Digital Signal Processing (1) 56 Dynamic response: using lookup tables to inverse transform Laplace inverse transform using lookup tables 1 π π +π 1 1 − π −ππ‘ π LIGO-G1100863 πΉ0 1 π£ π‘ =L β π π (π + π π) πΉ0 −1 1 = βL π π (π + π π) −1 π πΉ0 −π π‘ π£ π‘ = 1−π π 1 Pole π = π Matone: An Overview of Control Theory and Digital Signal Processing (1) 57 First-order system step response 63 % π πΊ π = π +π firstorder.m π = 5 πππ/π , π = 0.2 π LIGO-G1100863 Pole p Matone: An Overview of Control Theory and Digital Signal Processing (1) 58 MATLAB implementation The step response of transfer function 5 πΊ π = π +5 >> G=tf(5, [1 5]); >> step(G); LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 59 Partial fraction expansion 1. Reduce a complex function to a collection of simpler ones 2. Then use lookup table Order m π(π ) πΌπ π≤π πΉ π = = π(π ) π + ππ Order n π πΌ1 πΌπ −1 π π‘ =L + β―+ L π + π1 π + ππ = πΌ1 π −π1 π‘ + β― + πΌπ π −ππ π‘ π π π‘ = πΌπ π −πππ‘ π=0 −1 LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 60 Comments πΉ π = π πΌπ π + ππ π πΌπ π −πππ‘ π π‘ = π=0 1. Poles of F(s) determine the time evolution of f(t) 2. Zeros of F(s) affect coefficients 3. Poles closer to origin → larger time constants LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 61 Example Find π(π‘) of the Laplace transform 6π 2 − 12 πΉ π = 3 π + π 2 − 4π − 4 Sol: Using MATLAB >> [R,P,K]=residue([6 0 -12],[1 1 -4 -4]) R = 3.0000 3 1 2 1.0000 πΉ π = + + π +2 π −2 π +1 2.0000 P = -2.0000 2.0000 -1.0000 K = π π‘ = 3 π −2π‘ + π 2π‘ + 2 π −π‘ [] LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 62 Example: LRC circuit πΏ π£ππ (π‘) π πΆ π£ππ π‘ = π£πΏ π‘ + π£π π‘ + π£πΆ π‘ π£ππ’π‘ (π‘) π‘ π 1 = πΏ π(π‘) + π π(π‘) + π π ππ ππ‘ πΆ 0 11 =πΏπ·π π‘ +π π π‘ + π(π‘) πΆπ· LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 63 Example: LRC circuit πΏ π£ππ (π‘) π πΆ π£ππ’π‘ (π‘) 11 π£ππ (π‘) = πΏ π· π π‘ + π π π‘ + π(π‘) πΆπ· π π π‘ = πΆ π£ππ’π‘ π‘ = πΆ π· π£ππ’π‘ π‘ ππ‘ π£ππ π‘ = πΏ πΆ π·2 + π πΆ π· + 1 π£ππ’π‘ (π‘) LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 64 Example: LRC circuit πΏ π£ππ (π‘) π πΆ π£ππ’π‘ (π‘) π£ππ π‘ = πΏ πΆ π·2 + π πΆ π· + 1 π£ππ’π‘ (π‘) L πππ π = πΏ πΆ π 2 + π πΆ π + 1 πππ’π‘ (π ) LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 65 LRC circuit: transfer function πππ’π‘ 1 π = β πππ π 2 πΏπΆπ +π πΆπ +1 Setting L = 1 H, C = 1 F and R = 1 β¦ πππ’π‘ LIGO-G1100863 1 π = 2 β πππ π π + π +1 Matone: An Overview of Control Theory and Digital Signal Processing (1) 66 LRC circuit: dynamic response to step Setting the input to a step of amplitude 1 V 1 πππ π = π The unit step response is 1 1 1 πππ’π‘ π = 2 β = 3 π + π + 1 π π + π 2 + π LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 67 LRC circuit: dynamic response to step 1 πππ’π‘ (π ) = 3 = 2 π +π +π π πΌπ π + ππ Using MATLAB for the solution Coefficient vector for polynomial at numerator Coefficient vector for >> n = [1]; polynomial at denominator >> d = [1 1 1 0]; >> [α, a, k] = residue(n, d); π£ππ’π‘ π‘ = πΌ1 π π1π‘ + πΌ2 π π2π‘ + πΌ3 π π3π‘ LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 68 Plotting results of two methods >> y=α.'*exp(a*t); >> plot(t, y, 'bo'); >> y2=step(1,[1 1 1],t); >> plot(t, y2, ‘r.’); LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 69 Second-order system step response secondorder.m Overshoot LIGO-G1100863 Period of oscillation Settling time: time to settle to ±5% of final value (determined by the π −πΏππ‘ term) Note: often the response of a highorder system is similar to the second-order one Matone: An Overview of Control Theory and Digital Signal Processing (1) 70 Verify the following 6π 2 − 12 πΉ π = 3 π + π 2 − 4π − 4 π π‘ = 2π −π‘ + 3π −2π‘ + π 2π‘ 6π πΉ π = 3 π + π 2 − 4π − 4 π π‘ = 3π −π‘ − 6π −2π‘ + 3π −3π‘ π +5 πΉ π = 2 π + 4π + 13 π π‘ = 2π −π‘ − 3π −2π‘ + π 2π‘ LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 71 Back to cruise control: system’s step response πΊβπ» π(π ) = β ππ (π ) 1+πΊβπ» 1 π where πΊ π = and π» π = πΎππππ π + π/π θ K e + vr - H f + - G v c LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 72 Step response πΊβπ» 1 π π = β = 1+πΊβπ» π πΎππππ π (π + πΎ ) ππππ π 2 + π π πΎππππ π −π‘/π π£ π‘ = 1−π with τ = πΎππππ + π π + πΎππππ LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 73 Back to cruise control >> >> >> >> >> LIGO-G1100863 n = [k/m]; d = [1 (b+k)/m 0]; [α, a, k] = residue(n, d); y=α.'*exp(a*t); plot(t, y, 'bo'); Matone: An Overview of Control Theory and Digital Signal Processing (1) 74 Back to cruise control >> >> >> >> >> LIGO-G1100863 G = tf([1/m],[1 b/m]); H = k; CL = G * H / (1 + G * H); [y, t] = step(CL); plot(t, y, 'b.'); Matone: An Overview of Control Theory and Digital Signal Processing (1) 75 Transfer function, poles and zeros • It is convenient to express a transfer function G(s) in terms of its poles and zeros: π(π ) πΊ π = π(π ) π − π§1 β π − π§2 … π − π§π =πβ π − π1 β π − π2 … π − ππ • k is the gain of the transfer function LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 76 Summary of pole characteristics • Real distinct poles (often negative) ππ ↔ ππ π ππ π‘ π − ππ • Real poles, repeated m times (often negative) ππ,1 ππ,2 + π − ππ,1 π − ππ,2 2 + β―+ ππ,3 π − ππ,3 3 + ππ,π π − ππ,π π β 1 ππ,π 2 ππ,1 + ππ,2 π‘ + ππ,3 π‘ + β― + π‘ π−1 β π ππ π‘ 2! π−1 ! LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 77 Summary of pole characteristics • Complex-conjugate poles ππ ππ ∗ ππ π‘ ∗ ππ + ↔ π π + π π π π ∗ π − ππ π − ππ often re-written as a second-order term π2 πΌπ‘ ↔ ~ π β sin π½π‘ + π 2 2 π + 2πΏπ π + π • Poles on imaginary axis ∗π‘ – Sinusoid – Pole at zero: step function • Poles with a positive real part – Unstable time-domain solution LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 78 Summary • The Laplace transform is a tool to facilitate solving for ODEs. • Systems need to be linear • No need to do the transform (integral) – Use transform pairs, transform tables – Laplace transform properties: linearity, derivatives and integrals. • Once in the Laplace domain, a TF is simply the ratio of two polynomials in s. Carry out algebra to solve the problem. • No need to do the inverse transform – Use transform pairs, transform tables – For high-order TFs, use the partial-fraction expansion to reduce the problem to simpler parts • IMPORTANT: – Poles of a transfer function determine the time evolution of the system – Poles with a real positive part correspond to unstable and unphysical systems – The system TF needs to have poles with a negative real part • MATLAB implementation – Functions used: step, residue, tf LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 79 Solutions LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 80 Practice Determine the output C in terms of inputs U and R. Sol: πΊ2 πΆ= β πΊ1 π + π 1 + πΊ1 πΊ2 U R + - LIGO-G1100863 πΊ1 + + πΊ2 Matone: An Overview of Control Theory and Digital Signal Processing (1) C 81 Practice Determine the output πΆ in terms of inputs π1 , π2 and π . Sol: 1 πΆ= β πΊ1 πΊ2 π + πΊ2 π1 + πΊ1 πΊ2 π»1 π2 1 − πΊ1 πΊ2 π»1 π»2 U 1 R + + πΊ1 π»1 LIGO-G1100863 + + + + U2 πΊ2 C π»2 Matone: An Overview of Control Theory and Digital Signal Processing (1) 82 More practice Determine C/R for the following systems. Sol: a) πΆ π = πΊ1 +πΊ2 1−πΊ1 π»1 −πΊ2 π»2 b) πΆ π = πΊ1 +πΊ2 1−πΊ1 π»1 c) πΆ π = πΊ1 +πΊ2 1−πΊ1 π»1 1−πΊ1 π»1 πΊ1 (b) πΊ2 πΊ1 π»1 LIGO-G1100863 R+ + πΊ2 + + C π»1 (c) + R + (a) +C + R+ + πΊ2 πΊ1 + + C π»1 Matone: An Overview of Control Theory and Digital Signal Processing (1) 83 How do we MEASURE the OL TF of a system when the loop is closed? 1. Add an injection point in a closed loop system 2. Inject signal π₯ and read signal π¦1 (just before the injection) and π¦2 (right after the injection) π¦1 π₯ 3. Solve for the ratio π¦2 Sol: LIGO-G1100863 π¦1 π¦2 = −πΊππΏ + + π¦1 Matone: An Overview of Control Theory and Digital Signal Processing (1) π¦2 84 Partial-fraction examples • Denominator: has distinct, real roots – Example 2.4, 2.5, 2.6 • Denominator: complex roots – Example 2.7, 2.8 • Denominator: repeated roots – Example 2.9 LIGO-G1100863 Matone: An Overview of Control Theory and Digital Signal Processing (1) 85 Practice: verify the following 6 πΉ π = (π + 1)(π + 2)(π + 3) π π‘ = 3π −π‘ − 6π −2π‘ + 3π −3π‘ π +5 πΉ π = 2 π + 4π + 13 π −2π‘ π π‘ = 2π sin(3π‘ + ) 4 πΉ π = π π‘ =2 LIGO-G1100863 2 π +1 3 π +2 π‘ 2 −π‘ 1−π‘+ π − π −2π‘ 2 Matone: An Overview of Control Theory and Digital Signal Processing (1) 86