Lecture 25: Tue Nov 27, 2018 Reminder: Lab 3 moved to Tuesday Dec 4 Lecture: review time-domain characteristics of 2nd-order systems intro to control: feedback open-loop vs closed-loop control intro to PID control 0
Quiz 2 Results 20 20 30 3 40 50 60 70 80 90 100 min = 66 5 mean = 91 median = 94 100 100 100 99 99 98 97 97 97 96 96 95 95 95 93 93 91 90 90 90 89 88 86 84 83 69 68 66 1
Q2 vs Q1 100 80 QUIZ 2 60 40 20 20 40 60 80 100 QUIZ 1 2
Q1 + Q2 12 8 5 1 2 80 100 120 140 160 180 200 min = 92 mean = 166 max = 197 median = 171.5 3 197 194 194 191 187 186 183 180 179 178 176 175 172 172 171 170 164 164 163 161 159 157 157 153 141 117 108 92
Time Domain Properties of 2nd Order Systems 4
Underdamped LPF Step Response Can t measure n and directly, but can derive them from measurements of: steady-state value (determines H 0 ) percentage overshoot (determines ) peak time (given, determines n ) settling time (1 + )H 0 y( t ) STEP RESPONSE 1.02H 0 H 0 0.98H 0 0 t pk t settle t 5
Start with LPF: 2 H( s ) = ------------------------------------------- H 0 n s 2 2 + 2 n s + n Start with Impulse Response: h( t ) 8 = 0.2 6 = 0.4 4 = 0.6 2 2/ n t -2 1/ n -4 (Later Find Step Response) 6
Underdamped Impulse Response? = d n 1 2 n If poles were on j axis, h( t ) = Ksin( d t)u( t ). By mod property, shifting poles to left introduces an exponential envelope: h( t ) = Ke nt sin( d t)u( t ): h( t ) ENVELOPE t 7
To Find the Constant K H( s ) = 2 H 0 -------------------------------------------- n s 2 2 + 2 n s + n 2 H 0 -------------------------------------------------------------- n s + 2 + 1 2 2 n = (complete the square) H 0 n n d = -----------------.------------------------------------------ (use table 2 and modulation property) 1 2 s + 2 2 + d H 0 n 1 2 n h( t ) = -----------------.e nt sin( d t)u( t ). K = H 0 ----------------- n 1 2 oscillates with frequency d t 8
Three Different Frequencies natural frequency n damped frequency d resonant frequency r 9
Three Different Frequencies natural frequency n : were there no damping (no friction or resistance) + L C n = 1 ------------ LC m y k n = k m ---- my + ky = 0 damped frequency d = n (accounts for friction or resistance) 1 2 this is the frequency of oscillations in the time domain resonant frequency r = n 1 2 2 (where frequency response peaks) 10
Underdamped LPF Step Response Write Laplace transform of step response as: 2 1 Y( s ) = -- 1.H( s ) =. H -- 0 -------------------------------------------------------------- n s s s + 2 + 1 2 2 n H 0 ------ s As + a + B -------------------------------------- d s + a 2 2 + d n = (where a = n ) PFE: s 2 : H 0 A = 0 A = H 0 s 1 : 2H 0 a Aa B d = 0 B = H 0 -----------------. 1 2 y( t ) = H 0 u( t ) e n t u( t )[Acos( d t) + Bsin( d t)] = H 0 u( t )(1 e n t [cos( d t) + ----------------- sin( d t)]). 1 2 11
Phasor Addition, or Trig Identity sin 1 2 cos cos( d t) + ----------------- sin( d t) = ----------------- 1 (sin cos( d t) + cos sin( d t)) 1 2 1 2 1 = ----------------- sin( d t + ) 1 2 12
3 Equiv ways to Write Step Response Underdamped step response for a 2nd-order LPF system can be written as: y( t ) = H 0 u( t )(1 e n t [cos( d t) + ----------------- sin( d t)]) 1 2 1 = H 0 u( t )(1 ----------------- e n t sin( d t + )) 1 2 = H 0 u( t )(1 ----------------- 1 e n t cos( d t )): 1 2 sin 1 2 cos 13
y( t ) Time of Peak STEP RESPONSE 0 t t pk To find t p : Set ---- d y( t ) to zero and solve for t. dt IOW set h( t ) = 0! H 0 n 1 2 But h( t ) = -----------------.e nt sin( d t)u( t ). h( t ) IMPULSE RESPONSE t pk t Zero when sin(. ) argument is equal to the time of the first step-response peak is t pk = ----- = -------------------------. d n 1 2 14
Overshoot (1 + )H 0 STEP RESPONSE H 0 0 t pk t Peak overshoot can be found by evaluating step response at t p = / d : y( t p ) = H 0 (1 + e / 1 2 ) overshoot is = e / 1 2. Example: =0.707 = 0.043, or 4.3% of overshoot. 1 From measured overshoot, we can estimate via = -------------------------------. 1 + --------------- 2 15 log
Step response: y( t ) = H 0 u( t )(1 LPF Settling Time When does the envelope decay to 0.02? 1 ----------------- e n t = 0.02 1 2 1 ----------------- e n t sin( d t + )) 1 2 t s t s = ln 0.02 1 2 ------------------------------------------ 4 ---------- n n 20 n 15 n 10 n (EXACT) (APPROX) 5 n 0.2 0.3 0.4 0.5 0.6 0.7 0.8 16
LPF Step Response (1 + )H 0 = e / 1 2 1 = ------------------------------- 1 + --------------- 2 log H 0 0 t t pk = ------------------------- n 1 2 t s 4 ---------- n 17
Relationship to Pole Locations What stays the same: d, = e / 1 2, or t s ---------- n 4 18
Relationship to Pole Locations What stays the same: d, = e / 1 2, or t s ---------- n 4 SAME SETTLING TIME SAME ENVELOPE SAME OSCILLATION FREQ SAME OVERSHOOT 19
Impact of Pole Movement 20
Circuit Example R L + v in ( t ) + 0.25 F v out ( t ) Design R and L so that its step response settles in 2 seconds (to ±2% of its steady-state value), with 20% overshoot. 21
Solution 1/LC 4/L H( s ) = ---------------------------------------- = ------------------------------------ s 2 R + --- s + 1/LC s 2 R + --- s + 4/L L L 1 ---------------------------------- 1 + ------------------- 2 20% overshoot = = 0.456 4 --------- log 0.2 2 L ---------- 0.21 H 2-sec settling time t s = L = 2 = n R --- L 8 --- = 2 n = = 4 R = 4L = t s 0.83 22
Pop Quiz A 2nd-order LPF system has the following step response: 6 4 2 0 10 20 30 40 50 (a) Find H 0 (b) (c) Find Find n 23
Pop Quiz A 2nd-order LPF system has the following step response: 6 5.78 4 2 3.25 0 10 20 30 40 50 (a) Find H 0 (b) (c) Find Find n 24
HPF Step Response? 1 Y( s ) = -- 1 H( s ) = --.-------------------------------------------- s 2 s s s 2 2 + 2 n s + n = = s -------------------------------------------- + + s 2 2 n s n 2 s + n n + n + ------------------------------------------ s 2 2 d 1 y( t ) = -----------------.e nt sin( d t + )u( t ) 1 2 s 2 ------------------------------------------- s 2 2 + 2 n s + n R C + L v v in out 3 2 r = n / 1 2 2 = 0.2 0.3 sin 1 2 cos (Except for phase change, this is proportional to LPF impulse response!) 1 0 0.7 n 2 n 25
Coming Next: Controls 26
Reading 27
Connecting Systems Series x( t ) y( t ) H 1 ( s ) H 2 ( s ) Parallel H 1 ( s ) x( t ) y( t ) + H 2 ( s ) Feedback x( t ) y( t ) H 1 ( s ) + H 2 ( s ) 28
Overall Transfer Functions Easy: Series H 1 ( s )H 2 ( s ) Parallel H 1 ( s ) + H 2 ( s ) Feedback: Not as easy! Chicken & egg. x( t ) e( t ) y( t ) H 1 ( s ) + H 2 ( s ) E( s ) = X( s ) Y( s )H 2 ( s ) Y( s ) = E( s )H 1 ( s ) E( s ) = Y( s )/H 1 ( s ) Ys H Equate H overall ( s ) = ------------ = ------------------------------------------ 1 ( s ) Xs 1+H 1 ( s )H 2 ( s ) 29
Control Components REFERENCE r( t ) CONTROLLER G c ( s ) x( t ) y( t ) ACTUATOR G p ( s ) PLANT Reference Desired output y( t ). Plant system we re trying to control. We re stuck with it. Controller Produces input to plant in attempt to produce desired output Examples: cruise control temperature control steering control robotic control rocket guidance 30
Two Types of Control OPEN LOOP G p ( s ) REFERENCE r( t ) CONTROLLER ACTUATOR PLANT SENSOR y( t ) G c ( s ) CLOSED LOOP G p ( s ) REFERENCE ERROR CONTROLLER x( t ) ACTUATOR PLANT SENSOR y( t ) 31
Two Types of Control OPEN LOOP G p ( s ) REFERENCE r( t ) CONTROLLER ACTUATOR PLANT SENSOR y( t ) G c ( s ) CLOSED LOOP G p ( s ) REFERENCE + ERROR CONTROLLER x( t ) ACTUATOR PLANT SENSOR y( t ) 32
Control Components: Heating a House REFERENCE 68 + ERROR CONTROLLER ACTUATOR PLANT SENSOR 33
Control Components: Cruise Control REFERENCE 55 MPH + ERROR CONTROLLER AMOUNT OF FUEL ACTUATOR PLANT SENSOR 34
Segway REFERENCE + ERROR CONTROLLER ACTUATOR PLANT SENSOR 35
Tracking Control Set a speed, temperature, position, angle, etc. and have plant track it. We are given or specify a reference signal r( t ), to be tracked. We want y( t ) = r( t ) How to choose x( t )? 36
Option 1: Open Loop Control R( s ) G c ( s ) G p ( s ) Y( s ) Y( s ) = R( s )G c ( s )G p ( s ) Example: G p ( s ) = ------------ b, how to choose open-loop controller? s + a 1 G c ( s ) = -------------- = G p s s + a ------------ b Two Problems: For a unit-step reference, differentiator yields impulse In practice we cannot know G p ( s ) exactly. 37
Steady-State Tracking When reference is r( t ) = r 0 u( t ): instantaneous tracking: y( t ) = r( t ) for all t, often impractical steady state tracking: y( ) = lim t y( t ) = r 0 Example: r 0 REFERENCE r( t ) y( t ) STEADY-STATE TRACKS DOESN T TRACK 0 t 38
Continue example... Proportional Control Does proportional controller G c ( s ) = K perfectly track in steady state? Y( s ) = R( s )G c ( s )G p ( s ) = solve for y( t ): ------------------- Kbr 0 ss + a 0 t Is y( ) = r 0? What choice for controller gain K yields perfect steady-state tracking? 39
Pop Quiz Can an open-loop controller stabilize an unstable plant? 1 R( s ) G c ( s ) ----------- s 2 Y( s ) What open-loop controller G c ( s ) results in perfect tracking of a unit step? How robust is this controller to plant changes, e.g. if G p = 1/(s 2.1)? 40
Open Loop Drawbacks requires perfect knowledge of plant model not robust 41
Feedback: When output impacts input Advantages: robust to external disturbances robust to model knowledge can linearize system made of nonlinear components Disadvantages: can lead to oscillations can lead to instability 42
Closed Loop Control R( s ) E( s ) Y( s ) + G c ( s ) G p ( s ) Derive the closed-loop transfer function (relating r( t ) to y( t )): H( s ) = = Y( s ) R( s ) 43
Closed Loop Control R( s ) E( s ) Y( s ) + G c ( s ) G p ( s ) Derive the closed-loop transfer function (relating r( t ) to y( t )): Y( s ) H( s ) = = R( s ) G c ( s )G p ( s ) 1 + G c ( s )G p ( s ) 44
Examples of Controllers P PI PD PID K p G c ( s ) K p + K i /s K p + K d s K p +K i /s + K d s R( s ) E( s ) Y( s ) + G c ( s ) G p ( s ) 45