Classical Control

Topics covered:

Modeling. ODEs. Linearization. Laplace transform. Transfer functions. Block diagrams. Mason’s Rule. Time response specifications. Effects of zeros and poles. Stability via Routh-Hurwitz. : Disturbance rejection, Sensitivity, Steady-state tracking. PID controllers and Ziegler-Nichols tuning procedure. Actuator saturation and integrator wind -up.

Root locus. Frequency response--Bode and Nyquist diagrams. Stability Margins. Design of dynamic compensators.

Classical Control – Prof. Eugenio Schuster – Lehigh University 1

Classical Control

Text: Feedback Control of Dynamic Systems, 4th Edition, G.F. Franklin, J.D. Powel and A. Emami-Naeini Prentice Hall 2002.

Classical Control – Prof. Eugenio Schuster – Lehigh University 2

1 What is control? For any analysis we need a mathematical MODEL of the system Model → Relation between gas pedal and speed: 10 mph change in speed per each degree rotation of gas pedal Disturbance → Slope of road: 5 mph change in speed per each degree change of slope

Block diagram for the cruise control plant:

w Slope (degrees)

0.5 y =10(u − 0.5w)

Control - Output speed (degrees) (mph) 10 u + y

Classical Control – Prof. Eugenio Schuster – Lehigh University 3

What is control? Open-loop cruise control:

w r u = PLANT 10 0.5

yol =10(u − 0.5w) - r 1/10 10 =10( − 0.5w) r u + yol 10 Reference = r − 5w (mph)

r = 65,w = 0 ⇒ eol = 0 eol = r − yol = 5w r = 65,w =1⇒ eol = 5mph,eol = 7.69% r − yol w eol [%] = = 500 OK when: r r 1- Plant is known exactly 2- There is no disturbance Classical Control – Prof. Eugenio Schuster – Lehigh University 4

2 What is control? Closed-loop cruise control:

w u = 20(r − ycl ) PLANT 0.5 ycl =10(u − 0.5w) 200 5 - + = r − w 10 201 201 1/10 u + r - ycl

1 5 1 ecl = r − ycl = r + w r = 65,w = 0 ⇒ e = % = 0.5% 201 201 cl 201 1 5 5 r − y 1 5 w r = 65,w =1⇒ e = + = 0.69% e [%] = cl = + cl 201 20165 cl r 201 201 r Classical Control – Prof. Eugenio Schuster – Lehigh University 5

What is control?

Feedback control can help:

• reference following (tracking) • disturbance rejection • changing dynamic behavior

LARGE gain is essential but there is a STABILITY limit

“The issue of how to get the gain as large as possible to reduce the errors due to disturbances and uncertainties without making the system become unstable is what much of feedback control design is all about”

First step in this design process: DYNAMIC MODEL

Classical Control – Prof. Eugenio Schuster – Lehigh University 6

3 Dynamic Models

MECHANICAL SYSTEMS: F = ma Newton’s law

m&x& = u − bx& v = x& velocity a = v& = &x& acceleration

b u Vo 1 m Transfer Function v& + v = ⎯⎯→⎯st ⎯⎯⎯st = v=Voe ,u=Uoe d m m Uo s + b m → s dt

Classical Control – Prof. Eugenio Schuster – Lehigh University 7

Dynamic Models

MECHANICAL SYSTEMS: F = Iα Newton’s law

2 ml θ&& = −lmg sinθ + Tc ω = θ& angular velocity α = ω& = θ&& angular acceleration 2 I = ml moment of inertia

g T g T θ&&+ sinθ = c ⎯⎯→⎯ θ&&+ θ = c Linearization l ml 2 sinθ ≈θ l ml 2

Classical Control – Prof. Eugenio Schuster – Lehigh University 8

4 Dynamic Models g T θ&&+ θ = c l ml 2 Reduce to first order equations:

x1 = x2 x1 = θ & g Tc x2 = θ& x = − x + &2 l 1 ml 2

⎡x ⎤ T ⎡ 0 1⎤ ⎡0⎤ x ≡ 1 ,u ≡ c ⇒ x = ⎢ g ⎥x + u State Variable ⎢x ⎥ ml 2 & − 0 ⎢1⎥ Representation ⎣ 2 ⎦ ⎣⎢ l ⎦⎥ ⎣ ⎦

General case: x& = Fx + Gu y = Hx + Ju Classical Control – Prof. Eugenio Schuster – Lehigh University 9

Dynamic Models

ELECTRICAL SYSTEMS: Kirchoff’s Current Law (KCL): The algebraic sum of currents entering a node is zero at every instant Kirchoff’s Voltage Law (KVL) The algebraic sum of voltages around a loop is zero at every instant Resistors:

vR (t) = RiR (t) ⇔ iR (t) = GvR (t) i i R iC L CitCapacitors: + + + t v v dv (t) 1 R vC L i (t) = C C ⇔ v (t) = i (τ )dτ + v (0) C C ∫ C C dt C 0 Inductors: di (t) 1 t v (t) = L L ⇔ i (t) = v (τ )dτ + i (0) L L ∫ L L dt L 0 Classical Control – Prof. Eugenio Schuster – Lehigh University 10

5 Dynamic Models

ELECTRICAL SYSTEMS: OP AMP:

vO = A(vp − vn ), A → ∞ i + p + vp RO iO v vp = vn RI + O + in + i = i = 0 v A(vp-vn) p n n - -

To work in the linear mode we need FEEDBACK!!!

Classical Control – Prof. Eugenio Schuster – Lehigh University 11

Dynamic Models

ELECTRICAL SYSTEMS: KCL: R2

R 1 C dvO 1 1 v vO = vO − vI

1 dt R C R C - 2 1 +

1 t R = ∞ (OC) ⇒ v ()t = v (0 )− v (μ)dμ 2 O O ∫0 I R1C

v v 1 1 K ∫ O K = − RC Inverting integrator

Classical Control – Prof. Eugenio Schuster – Lehigh University 12

6 Dynamic Models

ELECTRO-MECHANICAL SYSTEMS: DC Motor torque armature current

T = Ktia

e = Keθ&m

emf shaft velocity

J mθ&&m = −bθ&m + T di − v + R i + L a + e = 0 a a a dt

Obtain the State Variable Representation

Classical Control – Prof. Eugenio Schuster – Lehigh University 13

Dynamic Models

HEAT-FLOW: Heat Flow Temperature Difference 1 q = ()T −T R 1 2 1 T& = q C Thermal capacitance Thermal resistance

1 ⎛ 1 1 ⎞ T&I = ⎜ + ⎟()To −TI CI ⎝ R1 R2 ⎠

Classical Control – Prof. Eugenio Schuster – Lehigh University 14

7 Dynamic Models

FLUID-FLOW: Mass rate Mass Conservation law

m& = win − wout

Inlet mass flow Outlet mass flow

1 m = ρAh& ⇒ h& = (w − w ) & ρA in out

A: area of the tank ρ: density of fluid h: height of water

Classical Control – Prof. Eugenio Schuster – Lehigh University 15

Linearization

Dynamic System: x& = f (x,u)

0 = f (xo ,uo ) Equilibrium

Denote δx = x − xo ,δu = u − uo

δx& = f ()xo + δx,uo + δu Taylor Expansion ∂f ∂f δx ≈ f ()x ,u + δx + δu & o o ∂x ∂u xo ,uo xo ,uo ∂f ∂f F ≡ ,G ≡ ⇒ δx ≈ Fδx + Gδu ∂x ∂u & xo ,uo xo ,uo Classical Control – Prof. Eugenio Schuster – Lehigh University 16

8 Linearization δx& ≈ Fδx + Gδu

⎡∂f1 ∂f1 ⎤ ⎡ ∂f1 ∂f1 ⎤ ⎢∂x L ∂x ⎥ ⎢∂u L ∂u ⎥ ∂f ⎢ 1 n ⎥ ∂f ⎢ 1 m ⎥ F ≡ = ⎢ M M ⎥ ,G ≡ = ⎢ M M ⎥ ∂x x ,u ∂u x ,u o o ⎢∂fn ∂fn ⎥ o o ⎢∂fn ∂fn ⎥ ⎢ L ⎥ ⎢ L ⎥ ∂x1 ∂xn ∂u1 ∂um ⎣ ⎦ xo ,uo ⎣ ⎦ xo ,uo

k g Example: Pendulum with friction θ&&+ θ& + sinθ = 0 m l ⎡ 0 1 ⎤ x = g k x & ⎢− cos x − ⎥ ⎢ 1 ⎥ ⎣ l m⎦ xo Classical Control – Prof. Eugenio Schuster – Lehigh University 17

Laplace Transform

• Function f(t) of time bt – Piecewise continuous and exponential order f (t) < Ke ∞ α + j∞ −st −1 1 st F(s) = ∫ f (t)e dt L [F(s)]= f (t) = ∫ F(s)e ds π 0- 2 j α − j∞

– 0- limit is used to capture transients and discontinuities at t=0 – s is a complex variable (σ+jω) • There is a need to worry about regions of convergence of the integral – Units of s are sec-1=Hz • A frequency –If f(t) is volts (amps) then F(s) is volt-seconds (amp-seconds)

Classical Control – Prof. Eugenio Schuster – Lehigh University 18

9 Laplace transform examples • Step function – unit Heavyside Function ⎧0, for t < 0 • After Oliver Heavyside (1850-1925) u(t) = ⎨ ⎩1, for t ≥ 0 ∞ ∞ ∞ ∞ e−st e−(σ + jω)t 1 F(s) = ∫u(t)e−stdt = ∫ e−stdt = − = − = if σ > 0 s σ + jω s 0− 0− 0 0 • Exponential function • After Oliver Exponential (1176 BC- 1066 BC) ∞ ∞∞ e−(s+α )t 1 F(s) = ∫∫e−αte−stdt = e−(s+α )tdt = − = if σ > α s +α s +α 0 0 0 • Delta (impulse) function δ(t) ∞ F(s) = ∫δ (t)e−stdt =1 for all s 0−

Classical Control – Prof. Eugenio Schuster – Lehigh University 19

Laplace Transform Pair Tables Signal Waveform Transform impulse δ (t) 1 step u(t) 1 s 1 ramp tu(t) s2 1 exponential e−αtu(t) s+α t 1 damped ramp te−α u(t) (s+α )2 β sine sin(βt)u(t) s2+β 2 s cosine cos(βt)u(t) s2+β 2 damped sine t β e−α sin()βt u(t) (s+α )2+β 2 damped cosine t s+α e−α cos()βt u(t) (s+α )2+β 2

Classical Control – Prof. Eugenio Schuster – Lehigh University 20

10 Laplace Transform Properties

Linearity: (absolutely critical property)

L{}Af1(t) + Bf2(t) = AL{f1 (t)}+ BL{f2 (t)}= AF1(s) + BF2(s) ⎧t ⎫ F(s) Integration property: L⎨∫ f (τ )dτ ⎬ = ⎩0 ⎭ s ⎧df (t)⎫ Differentiation property: L⎨ ⎬ = sF(s) − f (0−) ⎩ dt ⎭ ⎧ 2 ⎫ ⎪d f (t)⎪ 2 L = s F(s) − sf (0−) − f ′(0−) ⎨ 2 ⎬ ⎩⎪ dt ⎭⎪ ⎪⎧d m f (t)⎪⎫ = m F(s) − sm−1 f (0−) − sm−2 f ′(0−) − − f (m) (0−) L⎨ m ⎬ s L ⎩⎪ dt ⎭⎪

Classical Control – Prof. Eugenio Schuster – Lehigh University 21

Laplace Transform Properties

Translation properties:

s-domain translation: L{e−αt f (t)} = F(s +α)

−as t-domain translation: L{f (t − a)u(t − a)}= e F(s) for a > 0

Initial Value Property: lim f (t) = lim sF(s) t→0+ s→∞

Fina l Va lue Proper ty: lim f (t) = lim sF(s) t→∞ s→0

If all poles of F(s) are in the LHP

Classical Control – Prof. Eugenio Schuster – Lehigh University 22

11 Laplace Transform Properties 1 s Time Scaling: L{ f (at)} = F( ) a a dF(s) Multiplication by time: L{tf (t)} = − ds

t Convolution: L{ f (τ )g(t −τ )dτ} = F(s)G(s) ∫0 1 σ + jω Time product: L{ f (t)g(t)} = F(s)G(s − λ)dλ 2πj ∫σ − jω

Classical Control – Prof. Eugenio Schuster – Lehigh University 23

Laplace Transform

Exercise: Find the Laplace transform of the following waveform 4(s + 2) f (t) = []2 + 2sin(2t) − 2cos(2t) u(t) F(s) = s(s2 + 4) Exercise: Find the Laplace transform of the following waveform

3 t s + 36s + 80 f (t) = e−4tu(t) + 5 sin()4x dx F(s) = ∫0 s()s + 4 ()s2 +16 −40t −40t d[]5te 10s + 200 f (t) = 5e u(t) + u()t F(s) = dt (s + 40)2 Exercise: Find the Laplace transform of the following waveform 2 A(1− e−Ts ) f (t) = Au(t) − 2Au(t −T ) + Au(t − 2T ) F(s) = s

Classical Control – Prof. Eugenio Schuster – Lehigh University 24

12 Laplace transforms Linear system Complex frequency domain (s domain)

omain) Differential Laplace Algebraic d

t equation transform L equation

Classical Algebraic techniques techniques Time domain ( domain Time

Response Inverse Laplace Response signal transform L-1 transform

• The diagram commutes – Same answer whichever way you go Classical Control – Prof. Eugenio Schuster – Lehigh University 25

Solving LTI ODE’s via Laplace Transform

(n)()n−1 (m) (m−1) y + an−1 y +L+ a0 y = bmu + bm−1u +L+ b0u

(n−1) (m−1) Initial Conditions: y (0),K, y(0),u (0),K,u(0)

⎧d k f (t)⎫ k−1 Recall k (k−1− j) j L⎨ k ⎬ = s F(s) − ∑ f (0)s ⎩ dt ⎭ j=0

n−1 n−1 i−1 m i−1 n (n−1− j) j ⎡ i (i−1− j) j ⎤ ⎡ i (i−1− j) j ⎤ s Y (s) − ∑ y (0)s +∑ai ⎢s Y (s) − ∑ y (0)s ⎥ = ∑bi ⎢s U (s) − ∑u (0)s ⎥ j=0 i=0 ⎣ j=0 ⎦ i=0 ⎣ j=0 ⎦

n−1 i−1 m i−1 a y(i−1− j) (0)s j − b u(i−1− j) (0)s j m m−1 ∑ i ∑ ∑ i ∑ bms + bm−1s +L+ b1s + b0 i=0 j=0 i=0 j=0 Y (s) = n n−1 U (s) + n n−1 s + an−1s +L+ a1s + a0 s + an−1s +L+ a1s + a0

For a given rational U(s) we get Y(s)=Q(s)/P(s)

Classical Control – Prof. Eugenio Schuster – Lehigh University 26

13 Laplace Transform

Exercise: Find the Laplace transform V(s)

dv(t) 4 3 + 6v(t) = 4u(t) V (s) = − dt s(s + 6) s + 6 v(0−) = −3

Exercise: Find the Laplace transform V(s)

d 2v(t) dv(t) 5 2 + 4 + 3v(t) = 5e−2t V (s) = − dt 2 dt (s +1)(s + 2)(s + 3) s +1 v(0−) = −2,v'(0−) = 2

What about v(t)?

Classical Control – Prof. Eugenio Schuster – Lehigh University 27

Transfer Functions

()n (n−1 ) (m−1) y + an−1 y +L+ a0 y = bm−1u +L+ b0u

Assume all Initial Conditions Zero:

n n−1 m−1 (s + an−1s +L+ a1s + a0 )Y(s) = (bm−1s +L+ b1s + b0 )U (s) Output Input m−1 bm−1s +L+ b1s + b0 B(s) Y (s) = n n−1 U (s) = U (s) s + an−1s +L+ a1s + a0 A(s) m−1 Y (s) bm−1s +L+ b1s + b0 H (s) = = n n−1 U (s) s + an−1s +L+ a1s + a0 (s − z )(s − z ) (s − z ) = K 1 2 L m (s − p1)(s − p2 )L(s − pn )

Classical Control – Prof. Eugenio Schuster – Lehigh University 28

14 Rational Functions

• We shall mostly be dealing with LTs which are rational functions – ratios of polynomials in s m m−1 bms + bm−1s +L+ b1s + b0 F(s) = n n−1 ans + an−1s +L+ a1s + a0 (s − z )(s − z ) (s − z ) = K 1 2 L m (s − p1)(s − p2 )L(s − pn )

• pi are the poles and zi are the zeros of the function • K is the scale factor or (sometimes) gain •A proper rational function has n≥m •A strictly proper rational function has n>m •An improper rational function has n

Classical Control – Prof. Eugenio Schuster – Lehigh University 29

Residues at simple poles Functions of a complex variable with isolated, finite order poles have residues at the poles

(s − z1)(s − z2 )L(s − zm ) k1 k2 kn F(s) = K = + +L+ (s − p1)(s − p2 )L(s − pn ) (s − p1) (s − p2 ) (s − pn )

k1(s − pi ) k2 (s − pi ) kn (s − pi ) ()s − pi F(s) = + +L+ ki +L+ (s − p1) (s − p2 ) (s − pn )

Residue at a simple pole: ki = lim(s − pi )F(s) s→ pi

Classical Control – Prof. Eugenio Schuster – Lehigh University 30

15 Residues at multiple poles Compute residues at poles of order r: (s − z )(s − z ) (s − z ) k k k F(s) = K 1 2 L m = 1 + 2 + + r (s − p )r (s − p ) (s − p )2 L (s − p )r 1 r − j 1 1 1 1 d k = lim ⎡(s − p )r F(s)⎤, j =1 r j (r − j)! r − j ⎣⎢ i ⎦⎥ L s → pi ds 2s2 + 5s 2 1 3 Example: = + − ()s +1 3 s +1 ()s +1 2 ()s +1 3

3 2 ⎡ 3 2 ⎤ 2 ⎡ 3 2 ⎤ (s+1) (2s +5s) d (s+1) (2s +5s) 1 d (s+1) (2s +5s) = lim =−3 lim ⎢ ⎥ =1 lilim 2 ⎢ 3 ⎥ 2 s→−3 (s+1)3 s→−1ds⎣⎢ (s+1)3 ⎦⎥ 2!s→−1ds ⎣⎢ (s+1) ⎥⎦

⎛ 2s2 + 5s ⎞ ⎛ 2 1 3 ⎞ L−1⎜ ⎟ L−1⎜ ⎟ e−t 2 t 3t 2 u(t) ⎜ 3 ⎟ = ⎜ + 2 − 3 ⎟ = ()+ − ⎝ ()s +1 ⎠ ⎝ s +1 ()s +1 ()s +1 ⎠

Classical Control – Prof. Eugenio Schuster – Lehigh University 31

Residues at complex poles

• Compute residues at the poles lim (s − a)F(s) s→a • Bundle complex conjugate pole pairs into second-order terms if you want

• but you will need to be careful (s −α − jβ )(s −α + jβ ) = [s2 − 2αs + (α 2 + β 2 )] • Inverse Laplace Transform is a sum of complex exponentials • The answer will b e rea l

Classical Control – Prof. Eugenio Schuster – Lehigh University 32

16 Inverting Laplace Transforms in Practice

• We have a table of inverse LTs • Write F(s) as a partial fraction expansion

b sm + b sm−1 + + b s + b F(s) = m m−1 L 1 0 n n−1 ans + an−1s +L+ a1s + a0 (s − z )(s − z ) (s − z ) = K 1 2 L m (s − p1)(s − p2)L(s − pn ) α α α α α α = 1 + 2 + 31 + 32 + 33 + ...+ q 2 3 ()s − p1 ()s − p2 (s − p3) ()s − p ()s − p (s − pq) 3 3 • Now appeal to linearity to invert via the table – Surprise! – Nastiness: computing the partial fraction expansion is best done by calculating the residues

Classical Control – Prof. Eugenio Schuster – Lehigh University 33

Example 9-12 20(s + 3) • Find the inverse LT of F(s) = (s +1)(s2 + 2s + 5) k k k* F(s) = 1 + 2 + 2 s +1 s +1− j2 s +1+ j2

20(s + 3) k = lim (s +1)F(s) = =10 1 2 s → −1 s + 2s + 5 s = −1 5 20(s + 3) j π k = lim (s +1− 2 j)F(s) = = −5 − 5 j = 5 2e 4 2 s → −1+ 2 j (s +1)(s +1+ 2 j) s = −1+ 2 j

5 5 ⎡ (−1+ j2)t+ j π (−1− j2)t− j π ⎤ f (t) = ⎢10e−t + 5 2e 4 + 5 2e 4 ⎥u(t) ⎢ ⎥ ⎣ ⎦ ⎡ 5π ⎤ = 10e−t +10 2e−t cos(2t + ) u(t) ⎣⎢ 4 ⎦⎥ Classical Control – Prof. Eugenio Schuster – Lehigh University 34

17 Not Strictly Proper Laplace Transforms s3 + 6s2 +12s + 8 • Find the inverse LT of F(s) = s2 + 4s + 3 – Convert to polynomial plus strictly proper rational function • Use polynomial division s + 2 F(s) = s + 2 + s2 + 4s + 3 0.5 0.5 = s + 2 + + s +1 s + 3

• Invert as normal ⎡dδ (t) ⎤ f (t) = + 2δ (t) + 0.5e−t + 0.5e−3t u(t) ⎣⎢ dt ⎦⎥

Classical Control – Prof. Eugenio Schuster – Lehigh University 35

Block Diagrams

Series: G1 G2

G = G1G2

G1 Parallel: + + G2

G = G1 + G2

Classical Control – Prof. Eugenio Schuster – Lehigh University 36

18 Block Diagrams Negative Feedback: R Reference input R(s) + E(s) C(s) G E = R − B Error signal - C = GE Output B(s) H B = HC Feedback signal

C G C = GR − GHC ⇒ (1+ GH)C = GR ⇒ = R (1+ GH) E 1 E = R − HGE ⇒ (1+ GH )E = R ⇒ = R (1+ GH )

Rule: Transfer Function=Forward Gain/(1+Loop Gain)

Classical Control – Prof. Eugenio Schuster – Lehigh University 37

Block Diagrams Positive Feedback: R Reference input R(s) + E(s) C(s) G E = R + B Error signal + C = GE Output B(s) H B = HC Feedback signal

C G C = GR + GHC ⇒ (1− GH )C = GR ⇒ = R (1− GH ) E 1 E = R + HGE ⇒ (1− GH )E = R ⇒ = R (1− GH )

Rule: Transfer Function=Forward Gain/(1-Loop Gain)

Classical Control – Prof. Eugenio Schuster – Lehigh University 38

19 Block Diagrams

Moving through a branching point:

R(s) C(s) R(s) C(s) G G ≡ B(s) B(s) 1/G

Moving through a summing point:

R(s) C(s) R(s) C(s) + G ≡ G + + +

B(s) G

B(s)

Classical Control – Prof. Eugenio Schuster – Lehigh University 39

Block Diagrams

Example:

H1

- R(s) + + C(s) G1 G2 G3 -

H 2

R(s) G1G2G3 C(s)

1+ H1G2G3 + H 2G1G2

Classical Control – Prof. Eugenio Schuster – Lehigh University 40

20 Mason’s Rule

H 4

H6

+ + U (s) + + + + Y(s) H1 H 2 H3 + +

H5 H7 Signal Flow Graph H nodes 4 branches

H6

1 H 2 H 3 H 4 U (s) 1 2 3 Y(s)

H5 H7 Classical Control – Prof. Eugenio Schuster – Lehigh University 41

Mason’s Rule Path: a sequence of connected branches in the direction of the signal flow without repetition Loop: a closed path that returns to its starting node Forward path: connects input and output Y(s) 1 G(s) = = ∑GiΔi U (s) Δ i

Gi = gain of the ith forward path Δ = the system determinant =1-∑(all loop gg)ains) + ∑(gain products of all possible two loops that do not touch) − ∑(gain products of all possible three loops that do not touch) +L

Δi = value of Δ for the part of the graph that does not touch the ith forward path

Classical Control – Prof. Eugenio Schuster – Lehigh University 42

21 Mason’s Rule

H4

H6

1 H 2 H 3 H 4 U (s) 1 2 3 Y (s)

H5 H7

Y (s) H H H + H − H H H = 1 2 3 4 4 2 6 U (s) 1− H1H5 − H2H6 − H3H7 − H 4H7H6H5 + H1H5H3H7

Classical Control – Prof. Eugenio Schuster – Lehigh University 43

Impulse Response

∞ Dirac’s delta: u(τ )δ (t −τ )dτ = u(t) ∫0

Integration is a limit of a sum ⇓ u(t) is represented as a sum of impulses

By superposition principle, we only need unit impulse response

h()t −τ Response at t to an impulse applied at τ

System Response: u(t) h y(t)

∞ y(t) = u(τ )h(t −τ )dτ ∫0

Classical Control – Prof. Eugenio Schuster – Lehigh University 44

22 Impulse Response

t-domain: u(t) h y(t) Impulse response ∞ y(t) = u(τ )h(t −τ )dτ u(t) = δ (t) ⇒ y(t) = h(t) ∫0 The system response is obtained by convolving the input with the impulse response of the system.

∞ Convolution: L{ u(τ )h(t −τ )dτ} = H (s)U (s) ∫0

s-domain: U (s) H Y(s) Impulse response Y (s) = H (s)U (s) u(t) = δ (t) ⇒U (s) =1⇒ Y (s) = H (s) The system response is obtained by multiplying the transfer function and the Laplace transform of the input.

Classical Control – Prof. Eugenio Schuster – Lehigh University 45

Time Response vs. Poles 1 Real pole: H (s) = ⇒ h(t) = e−σt Impulse s +σ Response

σ > 0 Stable σ < 0 Unstable

1 τ = Time Constant σ

Classical Control – Prof. Eugenio Schuster – Lehigh University 46

23 Time Response vs. Poles

Real pole:

σ H (s) = ⇒ h(t) = σe−σt Impulse s +σ Response 1 τ = Time Constant σ σ 1 Y (s) = ⇒ y(t) =1− e−σt Step s +σ s Response

Classical Control – Prof. Eugenio Schuster – Lehigh University 47

Time Response vs. Poles 2 ωn Impulse Complex poles: H (s) = 2 2 s + 2ζωns + ωn Response 2 ωn = 2 2 2 (s + ζωn ) +ωn (1−ζ )

ωn : Undamped natural frequency ζ : ratio ω 2 H (s) = n (s +σ + jωd )(s +σ − jωd ) 2 ωn = 2 2 ()s +σ + ωd 2 σ = ζωn ,ωd = ωn 1−ζ Classical Control – Prof. Eugenio Schuster – Lehigh University 48

24 Time Response vs. Poles Complex poles: ω 2 ω H (s) = n → h(t) = n e−σt sin()ω t 2 2 2 2 d ()s +ζωn + ωn ()1−ζ 1−ζ IlImpulse Response

σ > 0 Stable σ < 0 Unstable

Classical Control – Prof. Eugenio Schuster – Lehigh University 49

Time Response vs. Poles Complex poles: ω 2 ω H (s) = n → h(t) = n e−σt sin()ω t 2 2 2 2 d ()s +ζωn + ωn ()1−ζ 1−ζ Impulse Response

Classical Control – Prof. Eugenio Schuster – Lehigh University 50

25 Time Response vs. Poles Complex poles: ω 2 1 ⎡ σ ⎤ Y (s) n y(t) 1 e−σt cos t sin t = 2 2 2 → = − ⎢ ()ωd + ()ωd ⎥ ()s + ζωn + ωn ()1−ζ s ⎣ ωd ⎦

Step Response

Classical Control – Prof. Eugenio Schuster – Lehigh University 51

Time Response vs. Poles 2 ωn Complex poles: H (s) = 2 2 s + 2ζωns + ωn 2 ωn = 2 2 2 (s + ζωn ) +ωn (1−ζ ) CASES:

2 2 ζ = 0: s + ωn Undamped 2 2 2 ζ <1:()s + ζωn + ωn ()1−ζ Underdamped 2 Critically damped ζ =1:()s + ωn 2 2 Overdamped ζ >1:[]s + (ζ + ζ −1)ωn [s + (ζ − ζ −1)ωn ]

Classical Control – Prof. Eugenio Schuster – Lehigh University 52

26 Time Response vs. Poles

Classical Control – Prof. Eugenio Schuster – Lehigh University 53

Time Domain Specifications

Classical Control – Prof. Eugenio Schuster – Lehigh University 54

27 Time Domain Specifications

1- The rise time tr is the time it takes the system to reach the vicinity of its new set point

2- The settling time ts is the time it takes the system transients to decay

3- The overshoot Mp is the maximum amount the system overshoot its final value divided by its final value

4- The peak time tp is the time it takes the system to reach the maximum overshoot point π 1.8 t = t ≅ p 2 r ωn 1−ζ ωn ζ −π 1−ζ 2 4.6 M p = e ts = ζωn Classical Control – Prof. Eugenio Schuster – Lehigh University 55

Time Domain Specifications

Design specification are given in terms of

tr ,t p ,M p ,ts

These specifications give the position of the poles

ωn ,ζ ⇒ σ ,ωd

Example: Find the pole positions that guarantee

tr ≤ 0.6sec,M p <10%,ts ≤ 3sec

Classical Control – Prof. Eugenio Schuster – Lehigh University 56

28 Effect of Zeros and Additional poles

Additional poles: 1- can be neglected if they are sufficiently to the left of the dominant ones. 2- can increase the rise time if the extra pole is within a factor of 4 of the real part of the complex poles.

Zeros: 1- a zero near a pole reduces the effect of that pole in the time response. 2- a zero in the LHP will increase the overshoot if the zero is within a factor of 4 of the real part of the complex poles (due to differentiation). 3- a zero in the RHP (nonminimum phase zero) will depress the overshoot and may cause the step response to start out in the wrong direction.

Classical Control – Prof. Eugenio Schuster – Lehigh University 57

Stability

m m−1 Y (s) bms + bm−1s +L+ b1s + b0 = n n−1 R(s) s + an−1s +L+ a1s + a0 Y(s) (s − z )(s − z ) (s − z ) = K 1 2 L m R(s) (s − p1)(s − p2 )L(s − pn )

Y(s) k1 k2 kn = + +L+ R(s) (s − p1) (s − p2 ) (s − pn )

Impulse response:

k1 k2 kn R(s) =1⇒ Y(s) = + +L+ (s − p1) (s − p2 ) (s − pn )

p1t p2t pnt y(t) = k1e + k2e +L+ kne

Classical Control – Prof. Eugenio Schuster – Lehigh University 58

29 Stability

p1t p2t pnt y(t) = k1e + k2e +L+ kne

We want: pit e ⎯t⎯→→⎯∞ 0 ∀i =1Kn

Definition: A system is asymptotically stable (a.s.) if

Re{pi} < 0 ∀i

n n−1 Characteristic polynomial: a(s) = s + an−1s +L+ a1s + a0

Characteristic equation: a(s) = 0

Classical Control – Prof. Eugenio Schuster – Lehigh University 59

Stability

Necessary condition for asymptotical stability (a.s.):

ai > 0 ∀i

Use this as the first test!

If any ai<0, the the system is UNSTABLE!

Example: s2 + s − 2 = 0 (s + 2)(s −1) = 0

Classical Control – Prof. Eugenio Schuster – Lehigh University 60

30 Routh’s Criterion

Necessary and sufficient condition

Do not have to find the roots pi!

Routh’s Array:

n s 1 a2 a4 L Depends on whether an n−1 n is even or odd s a1 a3 a5 L n−2 s b1 b2 b3 a a − a a a − a a a − a n−3 b = 1 2 3 , b = 1 4 5 , b = 1 6 7 s c1 c2 c3 1 2 3 L a1 a1 a1 n−4 b a − a b b a − a b s d1 d2 1 3 1 2 1 5 1 3 c1 = , c2 = , L b1 b1 M c b − b c c b − b c d = 1 2 1 2 , d = 1 3 1 3 , 0 1 c 2 c L s an 1 1 M M Classical Control – Prof. Eugenio Schuster – Lehigh University 61

Routh’s Criterion

How to remember this?

Routh’s Array:

n m = a , s m11 m12 m13 L 1, j 2 j−2 n−1 s m21 m22 m23 L m2, j = a2 j−1, sn−2 m m m 31 32 33 L mi−2,1 mi−2, j+1 sn−3 m m m 41 42 43 L mi−1,1 mi−1, j+1 mi, j = − ,∀i ≥ 3 M M M M mi−1,1

Classical Control – Prof. Eugenio Schuster – Lehigh University 62

31 Routh’s Criterion

The criterion:

• The system is asymptotically stable if and only if all the elements in the first column of the Routh’s array are positive

• The number of roots with positive real parts is equal to the number of sign changes in the first column of the Routh array

Classical Control – Prof. Eugenio Schuster – Lehigh University 63

Routh’s Criterion - Examples

Example 1: 2 s + a1s + a2 = 0

3 2 Example 2: s + a1s + a2s + a3 = 0

Example 3: s6 + 4s5 + 3s4 + 2s3 + s2 + 4s + 4 = 0

Example 4: s3 + 5s2 + (k − 6)s + k = 0

Classical Control – Prof. Eugenio Schuster – Lehigh University 64

32 Routh’s Criterion - Examples

Example: Determine the range of K over which the system is stable

s 1 R(s) + K + Y (s) - s()()s −1 s + 6

Classical Control – Prof. Eugenio Schuster – Lehigh University 65

Routh’s Criterion

Special Case I: Zero in the first column We replace the zero with a small positive constant ε>0 and ppppyroceed as before. We then apply the stability criterion by taking the limit as ε→0

Example: s4 + 2s3 + 4s2 + 8s +10 = 0

Classical Control – Prof. Eugenio Schuster – Lehigh University 66

33 Routh’s Criterion

Special Case II: Entire row is zero This indicates that there are complex conjugate pairs. If the ith row is zero,,yq we form an auxiliary equation from the previous nonzero row:

i+1 i−1 i−3 a1(s) = β1s + β2s + β3s +L

Where βi are the coefficients of the (i+1)th row in the array. We then replace the ith row by the coefficients of the derivative of the auxiliary polynomial.

Example: s5 + 2s4 + 4s3 + 8s2 +10s + 20 = 0

Classical Control – Prof. Eugenio Schuster – Lehigh University 67

Properties of feedback

Disturbance Rejection: Open loop w

+ r + y Ko A

y = Ko Ar + w Closed loop w

+ r + + y Kc A - K A 1 y = c r + w 1+ Kc A 1+ Kc A

Classical Control – Prof. Eugenio Schuster – Lehigh University 68

34 Properties of feedback

Disturbance Rejection:

Choose control s.t. for w=0,y≈r 1 Open loop: K = ⇒ y = r + w o A 1 Closed loop: K >> ⇒ y ≈ r + 0w = r c A

Feedb ack allows attenuati on of diditsturb ance with out having access to it (without measuring it)!!!

IMPORTANT: High gain is dangerous for dynamic response!!!

Classical Control – Prof. Eugenio Schuster – Lehigh University 69

Properties of feedback

Sensitivity to Gain Plant Changes Open loop w

+ r + y Ko A ⎛ y ⎞ To = ⎜ ⎟ = AKo ⎝ r ⎠o Closed loop w

+ r + + y Kc A - ⎛ y ⎞ AKc Tc = ⎜ ⎟ = ⎝ r ⎠c 1+ AKc

Classical Control – Prof. Eugenio Schuster – Lehigh University 70

35 Properties of feedback

Sensitivity to Gain Plant Changes Let the plant gain be A + δA δT δA Open loop: o = To A δT δA 1 δA δT Closed loop: c = << = o Tc A 1+ AKc A To

Feedback reduces sensitivityyp to plant variations!!! dT /T A dT Sensitivity: S T = = A dA/ A T dA 1 Example: Tc To SA = ,S A =1 1+ AKc Classical Control – Prof. Eugenio Schuster – Lehigh University 71

PID Controller PID: Proportional – Integral – Derivative P Controller:

Y (s) C(s)G(s) R(s) + E(s) U (s) Y (s) = , C(s) = K p G(s) R(s) 1+ C(s)G(s) - E(s) 1 = . R(s) 1+ C(s)G(s)

u(t) = K pe(t), U (s) = K p E(s) Step Reference: 1 1 1 1 R(s) = ⇒ ess = lim sE(s) = lims = s→0 s→0 s 1+ K pG(s) s 1+ K pG(0) •Proportional gain is high e = 0 ⇔ K G(0) → ∞ True when: ss p •Plant has a pole at the origin

High gain proportional feedback (needed for good tracking) results in underdamped (or even unstable) transients.

Classical Control – Prof. Eugenio Schuster – Lehigh University 72

36 PID Controller

P Controller: Example (lecture06_a.m)

R(s) + E(s) U (s) A Y(s) K p 2 - s + s +1

Y (s) K pG(s) K p A = = 2 R(s) 1+ K pG(s) s + s + (1+ K p A)

2 ωn =1+ K p A 1 1 ⇒ ζ = = ⎯⎯⎯→0 K p →∞ 2ζωn =1 2ωn 2 1+ K p A

9 Underdamped transient for large proportional gain 9 Steady state error for small proportional gain

Classical Control – Prof. Eugenio Schuster – Lehigh University 73

PID Controller PI Controller:

Y(s) C(s)G(s) R(s) + E(s) KI U (s) Y(s) = , C(s) = K p + G(s) R(s) 1+ C(s)G(s) - s E(s) 1 = . R(s) 1+ C(s)G(s) t ⎛ KI ⎞ u(t) = K pe(t) + KI e(τ )dτ , U (s) = ⎜ K p + ⎟E(s) ∫ ⎝ s ⎠ Step Reference: 0 1 1 1 1 R(s) = ⇒ ess = limsE(s) = lim s = lim = 0 s s→0 s→0 ⎛ K ⎞ s s→0 ⎛ K ⎞ 1+ ⎜ K + I ⎟G(s) 1+ ⎜ K + I ⎟G(s) ⎝ p s ⎠ ⎝ p s ⎠

• It does not matter the value of the proportional gain • Plant does not need to have a pole at the origin. The controller has it!

Integral control achieves perfect steady state reference tracking!!!

Note that this is valid even for Kp=0 as long as Ki≠0

Classical Control – Prof. Eugenio Schuster – Lehigh University 74

37 PID Controller

PI Controller: Example (lecture06_b.m)

R(s) + E(s) K I U (s) A Y(s) K p + 2 - s s + s +1

⎛ KI ⎞ ⎜ K p + ⎟G(s) Y (s) s ()K ps + KI A = ⎝ ⎠ = R(s) ⎛ K ⎞ s3 + s2 + (1+ K A)s + K A 1+ ⎜ K + I ⎟G(s) p I ⎝ p s ⎠

DANGER: for large Ki the characteristic equation has roots in the RHP 3 2 s + s + (1+ K p A)s + KI A = 0 Analysis by Routh’s Criterion Classical Control – Prof. Eugenio Schuster – Lehigh University 75

PID Controller

PI Controller: Example (lecture06_b.m)

3 2 s + s + (1+ K p A)s + KI A = 0

Necessary Conditions: 1+ K p A > 0, KI A > 0

This is satisfied because A > 0, K p > 0, KI > 0

Routh’s Conditions:

3 s 1 1+ K p A 1+ K p A − KI A > 0 2 s 1 KI A ⇓ s1 1+ K A − K A 1 p I K < K + 0 I P A s KI A

Classical Control – Prof. Eugenio Schuster – Lehigh University 76

38 PID Controller PD Controller:

Y(s) C(s)G(s) R(s) + E(s) U (s) Y(s) = , C(s) = K p + KDs G(s) R(s) 1+ C(s)G(s) - E(s) 1 = . R(s) 1+ C(s)G(s) de(t) u(t) = K e(t) + K , U (s) = (K + K s)E(s) p D dt p D Step Reference: 1 1 1 1 R(s) = ⇒ ess = limsE(s) = lims = s→0 s→0 s 1+ ()K p + KDs G(s) s 1+ K pG(0)

•Proportional gain is high e = 0 ⇔ K G(0) → ∞ True when: ss p •Plant has a pole at the origin

PD controller fixes problems with stability and damping by adding “anticipative” action

Classical Control – Prof. Eugenio Schuster – Lehigh University 77

PID Controller

PD Controller: Example (lecture06_c.m)

R(s) A Y(s) + E(s) C(s) = K + K s U (s) p D 2 - s + s +1

Y (s) (K p + KDs)G(s) A(K p + KDs) = = 2 R(s) 1+ ()K p + KDs G(s) s + ()1+ KD A s + (1+ K p A)

2 ωn =1+ K p A 1+ K A 1+ K A ⇒ ζ = D = D 2ζωn =1+ KD A 2ωn 2 1+ K p A

9 The damping can be increased now independently of Kp 9 The steady state error can be minimized by a large Kp

Classical Control – Prof. Eugenio Schuster – Lehigh University 78

39 PID Controller PD Controller:

Y(s) C(s)G(s) R(s) + E(s) U (s) Y(s) = , C(s) = K p + KDs G(s) R(s) 1+ C(s)G(s) - E(s) 1 = . R(s) 1+ C(s)G(s) de(t) u(t) = K e(t) + K , U (s) = (K + K s)E(s) p D dt p D

NOTE: cannot apply pure differentiation. In practice,

KDs is implemented as KDs

τ Ds +1

Classical Control – Prof. Eugenio Schuster – Lehigh University 79

PID Controller

PID: Proportional – Integral – Derivative

R(s) + E(s) ⎛ 1 ⎞ U (s) Y(s) K p ⎜1+ + TDs⎟ G(s) - ⎝ TI s ⎠

⎡ 1 d de(t)⎤ K u(t) = K e(t) + e(τ )dτ + T K = p , K = K T p ⎢ ∫ D ⎥ I D p D ⎣ TI 0 dt ⎦ TI U (s) ⎛ 1 ⎞ = K p ⎜1+ + TDs⎟ E(s) ⎝ TI s ⎠

PID Controller: Example (lecture06_d.m)

Classical Control – Prof. Eugenio Schuster – Lehigh University 80

40 PID Controller: Ziegler-Nichols Tuning

• Empirical method (no proof that it works well but it works well for simple systems) • Only for stable plants • You do not need a model to apply the method

Class of plants:

Y (s) Ke−td s = U (s) τs +1

Classical Control – Prof. Eugenio Schuster – Lehigh University 81

PID Controller: Ziegler-Nichols Tuning

METHOD 1: Based on step response, tuning to decay ratio of 0.25.

TiTuning TblTable: τ P : K p = td τ td PD : K p = 0.9 ,TI = td 0.3 τ PID : K p =1.2 ,TI = 2td ,TD = 0.5td td

Classical Control – Prof. Eugenio Schuster – Lehigh University 82

41 PID Controller: Ziegler-Nichols Tuning

METHOD 2: Based on limit of stability, ultimate sensitivity method.

R(s) + E(s) U (s) Y(s) Ku G(s) -

• Increase the constant gain Ku until the response becomes purely oscillatory (no decay – marginally stable – pure imaginary poles)

• Measure the period of oscillation Pu

Classical Control – Prof. Eugenio Schuster – Lehigh University 83

PID Controller: Ziegler-Nichols Tuning

METHOD 2: Based on limit of stability, ultimate sensitivity method.

TiTuning TblTable:

P : K p = 0.5Ku P PD : K = 0.45K ,T = u p u I 1.2 P P PID : K = 0.6K ,T = u ,T = u p u I 2 D 8

The Tuning Tables are the same if you make: τ Ku = 2 , Pu = 4td td

Classical Control – Prof. Eugenio Schuster – Lehigh University 84

42 PID Controller: Integrator Windup

Actuator Saturates: - valve (fully open) - aircraft rudder (fully deflected)

u (Input of the plant)

uc (Out put of the cont roll er)

Classical Control – Prof. Eugenio Schuster – Lehigh University 85

PID Controller: Integrator Windup

R(s) + E(s) K I Uc (s) U (s) Y(s) K p + G(s) - s

What happens? - large step input in r -large e

-large uc → u saturates - eventually e bllbecomes small

- uc still large because the integrator is “charged” - u still at maximum - y overshoots for a long time

Classical Control – Prof. Eugenio Schuster – Lehigh University 86

43 PID Controller: Anti-Windup Plant without Anti-Windup:

Plant with Anti-Windup:

Classical Control – Prof. Eugenio Schuster – Lehigh University 87

PID Controller: Anti-Windup In saturation, the plant behaves as:

For large Ka, this is a system with very low gain and very fast decay rate, i.e., the integration is turned off.

Classical Control – Prof. Eugenio Schuster – Lehigh University 88

44 Steady State Tracking

The Unity Feedback Case

R(s) E(s) U (s) Y(s) + C(s) G(s) -

E(s) 1 = R(s) 1+ C(s)G(s)

t k Test Inputs: r(t) = 1(t) k=0: step (position) k! k=1: ramp (velocity) 1 R(s) = sk +1 k=2: parabola (acceleration)

Classical Control – Prof. Eugenio Schuster – Lehigh University 89

Steady State Tracking

Type n The Unity Feedback Case System

R(s) E(s) GU((ss)) Y(s) + C(s) o G(s) n - s

Go (s) 1 1 C(s)G(s) = n , E(s) = R(s), R(s) = k+1 s Go (s) s 1+ n Steady State Erro r: s Final Value Theorem 1 1 sn 1 sn−k ess = lime(t) = lim sE(s) = lim s = lim = lim t→∞ s→0 s→0 G (s) sk +1 s→0 sn + G (s) sk s→0 sn + G (0) 1+ o o o sn Classical Control – Prof. Eugenio Schuster – Lehigh University 90

45 Steady State Tracking Type n The Unity Feedback Case System

R(s) + E(s) Go (s) Y(s) n n−k - s s ess = lim s→0 n s + Go (0)

Steady State Error: Input (k) Type (n) Step (k=0) Ramp (k=1) Parabola (k=2) 1 1 1 Type 0 = = ∞ ∞ 1+ Go (0) 1+ limC(s)G(s) 1+ K p s→0 1 1 1 Type 1 0 = = ∞ Go (0) limsC(s)G(s) Kv s→0 1 1 1 Type 2 0 0 = 2 = Go (0) lims C(s)G(s) Ka s→0

Classical Control – Prof. Eugenio Schuster – Lehigh University 91

Steady State Tracking

Position Constant K p = limC(s)G(s) n = 0 s→0 Velocity Constant Kv = limsC(s)G(s) n =1 s→0 2 Acceleration Constant Ka = lims C(s)G(s) n = 2 s→0 n: Degree of the poles of CG(s) at the origin (the number of integrators in the loop with unity gain feedback)

• Applying integral control to a plant with no zeros at the origin makes the system type ≥ I • All this is true ONLY for unity feedback systems

• Since in Type I systems ess=0 for any CG(s), we say that the system type is a robust property.

Classical Control – Prof. Eugenio Schuster – Lehigh University 92

46 Steady State Tracking t k w(t) = 1(t) The Unity Feedback Case k! 1 W (s) W (s) = sk+1

R(s) E(s) U (s) + Y(s) + G(s) C(s) + - Set r=0. Want Y(s)/W(s)=0.

Y (s) G(s) = = T (s) = snT (s) W (s) 1+ C(s)G(s) o

Steady State Error: e=r-y=-y Final Value Theorem 1 sn − ess = yss = lim y(t) = limsY (s) = lim sT (s) = limTo (s) t→∞ s→0 s→0 sk+1 s→0 sk

Classical Control – Prof. Eugenio Schuster – Lehigh University 93

Steady State Tracking

The Unity Feedback Case W (s)

R(s) E(s) U (s) + Y(s) + G(s) C(s) + -

Steady State Output: Disturbance (k) Type (n) Step (k=0) Ramp (k=1) Parabola (k=2)

Type 0 * ∞ ∞

Type 1 0 * ∞

Type 2 0 0 * 0 < * < ∞ Classical Control – Prof. Eugenio Schuster – Lehigh University 94

47 Steady State Tracking

Example:

W (s)

+ A R(s) + E(s) K I U (s) Y(s) K p + + - s s()τs +1

KI ≠ 0 ⇒ type 1 to w

KP ≠ 0, KI = 0 ⇒ type 0 to w

Classical Control – Prof. Eugenio Schuster – Lehigh University 95

Root Locus

Controller Plant

R(s) E(s) U (s) Y (s) + C(s) G(s) -

H (s)

Sensor Y (s) C(s)G(s) C(s)G(s) C(s) = KD(s) ⇒ = = R(s) 1+ C(s)G(s)H (s) 1+ KL(s)

Writing the loop gain as KL(s) we are interested in tracking the closed-loop poles as “gain” K varies

Classical Control – Prof. Eugenio Schuster – Lehigh University 96

48 Root Locus

Characteristic Equation: 1+ KL(s) = 0

The roots (()zeros) of the characteristic e quation are the closed-loop poles of the feedback system!!!

The closed-loop poles are a function of the “gain” K

Writing the loop gain as

m m−1 b(s) s + b1s +L+ bm−1s + bm L(s) = = n n−1 a(s) s + a1s +L+ an−1s + an The closed loop poles are given indistinctly by the solution of:

b(s) 1 1+ KL(s) = 0, 1+ K = 0, a(s) + Kb(s) = 0, L(s) = − a(s) K

Classical Control – Prof. Eugenio Schuster – Lehigh University 97

Root Locus

RL = zeros{}1+ KL(s) = roots{den(L) + Knum(L)} when K varies from 0 to ∞ (positive Root Locus) or from 0 to -∞ (negative Root Locus)

⎧ 1 1 ⎪ L(s) = Magnitude condition K > 0: L(s) = − ⇔ ⎨ K K ⎩⎪∠L(s) =180o Phase condition

⎧ 1 1 ⎪ L(s) = − Magnitude condition K < 0: L(s) = − ⇔ ⎨ K K ⎩⎪∠L(s) = 0o Phase condition

Classical Control – Prof. Eugenio Schuster – Lehigh University 98

49 Root Locus by Characteristic Equation Solution

R(s) E(s) U (s) 1 Y (s) Example: + K - ()()s +10 s +1

Y (s) K = R(s) s2 +11s + (10 + K)

2 Closed-loop poles: 1+ L(s) = 0 ⇔ s +11s + (10 + K) = 0

s = −1,−10 K=0 81− 4K 81− 4K s = −5.5 ± 81−4K>0 s = −5.5 ± 2 2 s = −5.5 81−4K=0 4K − 81 s = −5.5 ± i 81−4K<0 Classical Control – Prof. Eugenio Schuster – Lehigh University 2 99

Root Locus by Characteristic Equation Solution

We need a systematic approach to plot the closed-loop poles as function of the gain K → ROOT LOCUS

Classical Control – Prof. Eugenio Schuster – Lehigh University 100

50 Root Locus by Phase Condition

Example: R(s) + E(s) U (s) s +1 Y (s) K 2 - s()s + 5 (s + 4s + 8)

s +1 L(s) = s()s + 5 ()s2 + 4s + 8 s +1 = s()()()s + 5 s + 2 + 2i s + 2 − 2i

so = −1+ 3i belongs to the locus?

Classical Control – Prof. Eugenio Schuster – Lehigh University 101

Root Locus by Phase Condition

45o o 90 108.43o 36.87o

78.70o

90o − 108.43o + 36.87o + 45o + 78.70o ≈ −180o [ ] ⇒ so = −1+ 3i belongs to the locus! Note: Check code lecture09_a.m

Classical Control – Prof. Eugenio Schuster – Lehigh University 102

51 Root Locus by Phase Condition

so = −1+ 3i

We need a systematic approach to plot the closed-loop poles as function of the gain K → ROOT LOCUS

Classical Control – Prof. Eugenio Schuster – Lehigh University 103

Root Locus RL = zeros{}1+ KL(s) = roots{den(L) + Knum(L)} when K varies from 0 to ∞ (positive Root Locus) or from 0 to -∞ (negative Root Locus) 1 1+ KL(s) = 0 ⇔ L(s) = − ⇔ a(s) + Kb(s) = 0 K Basic Properties:

• Number of branches = number of open-loop poles • RL begins at open-loop poles K = 0 ⇒ a(s) = 0 • RL ends at open-loop zeros or asymptotes ⎧ b(s) = 0 K = ∞ ⇒ L(s) = 0 ⇔ ⎨ ⎩s → ∞ (n − m > 0) • RL symmetrical about Re-axis

Classical Control – Prof. Eugenio Schuster – Lehigh University 104

52 Root Locus

Rule 1: The n branches of the locus start at the poles of L(s) and m of these branches end on the zeros of L(s). n: order of the denominator of L(s) m: order of the numerator of L(s)

Rule 2: The locus is on the real axis to the left of and odd number of poles and zeros. In other words, an interval on the real axis belongs to the root locus if the total number of poles and zeros to the right is odd. This rule comes from the phase condition!!!

Classical Control – Prof. Eugenio Schuster – Lehigh University 105

Root Locus

Rule 3: As K→∞, m of the closed-loop poles approach the open-loop zeros, and n-m of them approach n-m asymptotes with angles π φ = (2l +1) , l = 0,1, ,n − m −1 l n − m K

and centered at

b − a poles − zeros α = 1 1 = ∑ ∑ , l = 0,1, ,n − m −1 n − m n − m K

Classical Control – Prof. Eugenio Schuster – Lehigh University 106

53 Root Locus

Rule 4: The locus crosses the jω axis (looses stability) where the Routh criterion shows a transition from roots in the left half-plane to roots in the right-half plane.

Example:

s + 5 G(s) = s(s2 + 4s + 5)

K = 20,s = ± j5

Classical Control – Prof. Eugenio Schuster – Lehigh University 107

Root Locus s +1 Example: G(s) = s4 + 3s3 + 7s2 + 6s + 4

Classical Control – Prof. Eugenio Schuster – Lehigh University 108

54 Root Locus

Design dangers revealed by the Root Locus:

• High relative degree: For n-m≥3 we have closed loop instability due to asymptotes.

s +1 G(s) = s4 + 3s3 + 7s2 + 6s + 4

• Nonminimum phase zeros: They attract closed loop poles into the RHP

s −1 G(s) = s2 + s +1

Note: Check code lecture09_b.m

Classical Control – Prof. Eugenio Schuster – Lehigh University 109

Root Locus

Viete’s formula:

When the relative degree n-m≥2, the sum of the closed loop poles is constant

a1 = −∑closed loop poles

m m−1 b(s) s + b1s +L+ bm−1s + bm L(s) = = n n−1 a(s) s + a1s +L+ an−1s + an

Classical Control – Prof. Eugenio Schuster – Lehigh University 110

55 Phase and Magnitude of a Transfer Function

m m−1 bms + bm−1s +L+ b1s + b0 G(s) = n n−1 s + an−1s +L+ a1s + a0 (s − z )(s − z ) (s − z ) G(s) = K 1 2 L m (s − p1)(s − p2 )L(s − pn )

The factors K, (s-zj) and (s-pk) are complex numbers:

z z iφ j (s − z j ) = rj e , j =1Km p p iφk (s − pk ) = rk e , k =1L p K K = K eiφ

z iφ z z iφ z z iφ z K 1 2 m iφ r1 e r2 e Lrme G(s) = K e p p p p iφ1 p iφ2 p iφn r1 e r2 e Lrn e Classical Control – Prof. Eugenio Schuster – Lehigh University 111

Phase and Magnitude of a Transfer Function z iφ z z iφ z z iφ z K 1 2 m iφ r1 e r2 e Lrme G(s) = K e p p p p iφ1 p iφ2 p iφn r1 e r2 e Lrn e z z z i φ z +φ z + +φ z K ( 1 2 L m ) iφ r1 r2 Lrme = K e p p p p p p i()φ1 +φ2 +L+φn r1 r2 Lrn e z z z r r r K z z z p p p 1 2 L m i[]φ +()φ1 +φ2 +L+φm −()φ1 +φ2 +L+φn = K p p p e r1 r2 Lrn Now it is easyyg to give the p hase and mag nitude of the transfer function: z z z r1 r2 Lrm G(s) = K p p p , r1 r2 Lrn K z z z p p p ∠G(s) = φ + ()()φ1 +φ2 +L+φm − φ1 +φ2 +L+φn Classical Control – Prof. Eugenio Schuster – Lehigh University 112

56 Phase and Magnitude of a Transfer Function (s + 6.735) Example: G(s) = ()()s +1 s + 5 (s + 20)

s = so = −7 + 5i z r1 G(s) = p p p r1 r2 r3 p z p p r3 r1 r2 r1 z p p p ∠G(s) = φ1 − ()φ1 +φ2 +φ3 p z p p φ3 φ1 φ2 φ1

Classical Control – Prof. Eugenio Schuster – Lehigh University 113

Root Locus- Magnitude and Phase Conditions

RL = zeros{}1+ KL(s) = roots{den(L) + Knum(L)} when K varies from 0 to ∞ (positive Root Locus) or from 0 to -∞ (negative Root Locus)

z z z (s − z )(s − z ) (s − z ) r r r K p z z z p p p 1 2 L m 1 2 L m i[φ +()φ1 +φ2 +L+φm −()φ1 +φ2 +L+φn ] L(s) = K p = K p p p p e (s − p1)(s − p2 )L(s − pn ) r1 r2 Lrn

z z z r1 r2 Lrm 1 1 L(s) = K p p p p = K > 0: L(s) = − ⇔ r1 r2 Lrn K K K p z z z p p p o ∠L(s) = φ + (φ1 +φ2 +L+φm )− (φ1 +φ2 +L+φn )=180

r zr z r z 1 L(s) = K 1 2 L m = − 1 p p p p K < 0: L(s) = − ⇔ r1 r2 Lrn K K K p z z z p p p o ∠L(s) = φ + ()()φ1 +φ2 +L+φm − φ1 +φ2 +L+φn = 0

Classical Control – Prof. Eugenio Schuster – Lehigh University 114

57 Root Locus

Selecting K for desired closed loop poles on Root Locus:

If so belongs to the root locus, it must satisfies the characteristic equation for some value of K

1 L(s ) = − o K Then we can obtain K as

1 K = − L(so ) 1 K = L(so )

Classical Control – Prof. Eugenio Schuster – Lehigh University 115

Root Locus

1 Example: L(s) = G(s) = ()()s +1 s + 5

1 so = −3 + i4 ⇒ K = = so +1 so + 5 = − 3 + i4 +1 − 3 + i4 + 5 L(so ) = ()− 2 2 + 42 ()2 2 + 42 = 20

Using MATLAB:

sys=tf(1,poly([-1 -5])) so=-3+4i [K,POLES]=rlocfind(sys,so)

Classical Control – Prof. Eugenio Schuster – Lehigh University 116

58 Root Locus 1 Example: L(s) = G(s) = s = −3 + i4 ()()s +1 s + 5 o

so = −7 + i5 ⇓ 1 K = = 42.06 L(so )

so = −7 + i5

When we use the absolute value formula we are assuming that the point belongs to the Root Locus! Classical Control – Prof. Eugenio Schuster – Lehigh University 117

Root Locus - Compensators 1 Example: L(s) = G(s) = ()()s +1 s + 5

Can we place the closed loop pole at so=-7+i5 only varying K? NO. We need a COMPENSATOR. 1 1 L(s) = G(s) = L(s) = D(s)G(s) = ()s +10 ()()s +1 s + 5 ()()s +1 s + 5

The zero attracts the locus!!! Classical Control – Prof. Eugenio Schuster – Lehigh University 118

59 Root Locus – Phase lead compensator

Pure derivative control is not normally practical because of the amplification of the noise due to the differentiation and must be approximated: s + z D(s) = , p > z Phase lead s + p COMPENSATOR When we study frequency response we will understand why we call “Phase Lead” to this compensator.

s + z 1 L(s) = D(s)G(s) = , p > z s + p (s +1)(s + 5)

How do we choose z and p to place the closed loop pole

at so=-7+i5?

Classical Control – Prof. Eugenio Schuster – Lehigh University 119

Root Locus – Phase lead compensator s + z 1 Example: L(s) = D(s)G(s) = , p < z s + p ()()s +1 s + 5

Phase lead COMPENSATOR

o o 21.04o 111.80 140.19

z φ1 ?

K p z z z p p p o ∠L(s) = φ + ()φ1 +φ2 +L+φm − (φ1 +φ2 +L+φn )=180 z o o o o o o φ1 =180 +140.19 +111.80 + 21.04 = 453.03 = 93.03 ⇒ z = −6.735 Classical Control – Prof. Eugenio Schuster – Lehigh University 120

60 Root Locus – Phase lead compensator s + 6.735 1 Example: L(s) = D(s)G(s) = s + 20 ()()s +1 s + 5

Phase lead COMPENSATOR

so = −7 + i5 K =117

Classical Control – Prof. Eugenio Schuster – Lehigh University 121

Root Locus – Phase lead compensator

Selecting z and p is a trial an error procedure. In general: • The zero is placed in the neighborhood of the closed- looppqy,y natural frequency, as determined by rise-time or settling time requirements. • The poles is placed at a distance 5 to 20 times the value of the zero location. The pole is fast enough to avoid modifying the dominant pole behavior. The exact position of the pole p is a compromise between:

• Noise suppression (we want a small value for p) • Compensation effectiveness (we want large value for p)

Classical Control – Prof. Eugenio Schuster – Lehigh University 122

61 Root Locus – Phase lag compensator s + 6.735 1 Example: L(s) = D(s)G(s) = s + 20 ()()s +1 s + 5

s + 6.735 1 −2 K p = lim L(s) = lim D(s)G(s) = lim = 6.735×10 s→0 s→0 s→0 s + 20 ()()s +1 s + 5

What can we do to increase Kp? Suppose we want Kp=10.

s + z s + 6.735 1 L(s) = D(s)G(s) = , p < z s + p s + 20 (s +1)(s + 5) Phase lag COMPENSATOR z 1 We choose: = ×103 =148.48 p 6.735

Classical Control – Prof. Eugenio Schuster – Lehigh University 123

Root Locus – Phase lag compensator s + 0.14848 s + 6.735 1 Example: L(s) = D(s)G(s) = s + 0.001 s + 20 ()()s +1 s + 5

so = −6.94 + i5.03 K =18.31

Classical Control – Prof. Eugenio Schuster – Lehigh University 124

62 Root Locus – Phase lag compensator

Selecting z and p is a trial an error procedure. In general: • The ratio zero/pole is chosen based on the error constant specification. • We pick z and p small to avoid affecting the dominant dynamic of the system (to avoid modifying the part of the locus representing the dominant dynamics) • Slow transient due to the small p is almost cancelled by an small z. The ratio zero/pole cannot be very big.

The exact position of z and p is a compromise between:

• Steady state error (we want a large value for z/p) • The transient response (we want the pole p placed far from the origin)

Classical Control – Prof. Eugenio Schuster – Lehigh University 125

Root Locus - Compensators

s + z Phase lead compensator: D(s) = , z < p s + p s + z Phase lag compensator: D(s) = , z > p s + p

We will see why we call “phase lead” and “phase lag” to these compensators when we study frequency response

Classical Control – Prof. Eugenio Schuster – Lehigh University 126

63 Frequency Response

• We now know how to analyze and design systems via s-domain methods which yield dynamical information • The responses are described by the exponential modes – The mod es are d etermi ned b y th e pol es of th e response L apl ace Transform

• We next will look at describing cct performance via frequency response methods – This guides us in specifying the system pole and zero posiiitions

Classical Control – Prof. Eugenio Schuster – Lehigh University 127

Sinusoidal Steady-State Response Consider a stable transfer function with a sinusoidal input: Aω u(t) = Acos(ωt) ⇔ U (s) = s2 + ω 2 The Laplace Transform of the response has poles • Where the natural modes lie –These are in the open left half plane Re(s)<0

• At the input modes s=+jω and s=-jω

(s − z1)(s − z2 )L(s − zm ) Aω Y (s) = G(s)U (s) = K 2 2 (s − p1)(s − p2 )L(s − pn ) ()s + ω Only the response due to the poles on the imaginary axis remains after a sufficiently long time This is the sinusoidal steady-state response Classical Control – Prof. Eugenio Schuster – Lehigh University 128

64 Sinusoidal Steady-State Response

• Input u(t) = Acos(ωt +φ) = Acosωt sinφ − Asinωt cosφ

s ω • Transform U (s) = −Acosφ + Asinφ s2 + ω 2 s2 + ω 2

• Response Transform * k k k1 k2 kN Y (s) = G(s)U (s) = + + + +L+ s − jω s + jω s − p1 s − p2 s − pN • Response Signal forced response natural response jωt * − jωt p1t p2t pNt y(t) = ke + k e + k1e + k2e +L+ kN e 1424 434 1424444 434444 forced response natural response • Sinusoidal Steady State Response t → ∞ jωt * − jωt ySS (t) = ke + k e 0 Classical Control – Prof. Eugenio Schuster – Lehigh University 129

Sinusoidal Steady-State Response

• Calculating the SSS response to u(t) = Acos(ω+t φ) • Residue calculation k = lim[(s − jω)Y(s)]= lim[(s − jω)G(s)U(s)] s→ jω s→ jω ⎡ scosφ −ωsinφ ⎤ ⎡−jωcosφ ωsinφ ⎤ = lim ⎢G(s)(s − jω)A ⎥ = G( jω)A⎢ ⎥ s→ jω⎣ (s − jω)(s + jω)⎦ ⎣ 2 jω ⎦ 1 1 = AG( jω) e jφ = AG( jω)e j(φ+∠G( jω)) 2 2 • Signal calculation

* −1⎧ k k ⎫ yss (t) = L ⎨ + ⎬ ⎩s − jω s + jω⎭ = k e j∠Ke jωt + k e− j∠Ke− jωt = 2k cos()ωt + ∠K

yss (t) = AG( jω) cos(ωt +φ + ∠G( jω))

Classical Control – Prof. Eugenio Schuster – Lehigh University 130

65 Sinusoidal Steady-State Response

• Response to u(t) = Acos(ωt +φ)

•is yss = G( jω) Acos(ωt +φ + ∠G( jω))

– Output frequency = input frequency – Output amplitude = input amplitude × |G(jω)| – Output phase = input phase +∠ G(jω)

• The Frequency Response of the transfer function G(s) is given by its evaluation as a function of a complex variable at s=jω • We speak of the amplitude response and of the phase response – They cannot independently be varied » Bode’s relations of analytic function theory

Classical Control – Prof. Eugenio Schuster – Lehigh University 131

Frequency Response

• Find the steady state output for v1(t)=Acos(ωt+φ) + sL + R V (s) V1(s) _ 2 - • Compute the s-domain transfer function T(s) R – Voltage divider T(s) = sL + R • Compute the frequency response R −1⎛ωL ⎞ T ( jω) = , ∠T ( jω) = − tan ⎜ ⎟ R2 + (ωL)2 ⎝ R ⎠

• Compute the steady state output AR −1 v2SS (t) = cos[ωt +φ − tan ()ωL / R ] R2 + (ωL)2

Classical Control – Prof. Eugenio Schuster – Lehigh University 132

66 Bode Diagrams • Log-log plot of mag(T), log-linear plot of arg(T) versus ω Bode Diagram 0

-5 dB) ) ( -10

-15

-20 Magnitude

-25

0 g) ) Magnitude (dB e

-45 Phase (deg Phase (d Phase

-90 4 5 6 10 10 10 Frequency (rad/sec)

Classical Control – Prof. Eugenio Schuster – Lehigh University 133

Frequency Response

u(t) = Acos(ωt +φ) G(s) yss = G( jω) Acos(ωt +φ + ∠G( jω))

Stable Transfer Function

• After a transient, the output settles to a sinusoid with an amplitude magnified by G ( j ω ) and phase shifted by ∠ G ( j ω ) .

• Since all signals can be represented by sinusoids (Fourier series and transf orm) , the quantiti es G ( j ω ) and ∠ G ( j ω ) are extremely important.

• Bode developed methods for quickly finding G ( j ω ) and ∠ G ( j ω ) for a given G ( s ) and for using them in control design.

Classical Control – Prof. Eugenio Schuster – Lehigh University 134

67 Frequency Response

• Find the steady state output for v1(t)=Acos(ωt+φ) + sL + R V (s) V1(s) _ 2 - • Compute the s-domain transfer function T(s) R – Voltage divider T(s) = sL + R • Compute the frequency response R −1⎛ωL ⎞ T ( jω) = , ∠T ( jω) = − tan ⎜ ⎟ R2 + (ωL)2 ⎝ R ⎠

• Compute the steady state output AR −1 v2SS (t) = cos[ωt +φ − tan ()ωL / R ] R2 + (ωL)2

Classical Control – Prof. Eugenio Schuster – Lehigh University 135

Frequency Response - Bode Diagrams • Log-log plot of mag(T), log-linear plot of arg(T) versus ω Bode Diagram 0

-5 dB) ) ( -10

-15

-20 Magnitude

-25

0 g) ) (dB Magnitude e

-45 Phase (deg Phase (d Phase

-90 4 5 6 10 10 10 Frequency (rad/sec) [ω]= rad /sec, ω = 2πf , [ f ]= Hz Classical Control – Prof. Eugenio Schuster – Lehigh University 136

68 Bode Diagrams (s − z )(s − z ) (s − z ) G(s) = K 1 2 L m (s − p1)(s − p2 )L(s − pn )

z z z r r r K z z z p p p 1 2 L m i[]φ +()φ1 +φ2 +L+φm −()φ1 +φ2 +L+φn G(s) = K p p p e r1 r2 Lrn The magnitude and phase of G(s) when s=jω is given by:

Nonlinear in the magnitudes z z z r1 r2 Lrm G( jω) = K p p p , r1 r2 Lrn K z z z p p p ∠G( jω) = φ + ()()φ1 +φ2 +L+φm − φ1 +φ2 +L+φn Linear in the phases

Classical Control – Prof. Eugenio Schuster – Lehigh University 137

Bode Diagrams Why do we express G ( j ω ) in decibels?

G( jω) dB = 20log G( jω) z z z r1 r2 Lrm G( jω) = K p p p ⇒ G( jω) dB = ? r1 r2 Lrn By properties of the logarithm we can write:

z z z p p p 20logG(s) = 20log K + (20logr1 + 20logrm +L+ 20logrm )− (20logr1 + 20logr2 +L+ 20logrn ) The magnitude and phase of G(s) when s=jω is given by: Linear in the magnitudes (dB)

G(s) = K + r z + r z + + r z − r p + r p + + r p dB dB ( 1 dB 2 dB L m dB ) ( 1 dB 2 dB L n dB ) K z z z p p p ∠G(s) = φ + ()()φ1 +φ2 +L+φm − φ1 +φ2 +L+φn Linear in the phases Classical Control – Prof. Eugenio Schuster – Lehigh University 138

69 Bode Diagrams Why do we use a logarithmic scale? Let’s have a look at our example:

R R 1 T (s) = ⇒ T ( jω) = = 2 2 2 sL + R R + (ωL) ⎛ωL ⎞ 1+ ⎜ ⎟ ⎝ R ⎠ Expressing the magnitude in dB:

2 2 ⎛ωL ⎞ ⎡ ⎛ωL ⎞ ⎤ T ( jω) dB = 20log1− 20log 1+ ⎜ ⎟ = −10log⎢1+ ⎜ ⎟ ⎥ ⎝ R ⎠ ⎣ ⎝ R ⎠ ⎦ Asymptotic behavior:

ω → 0 : T( jω) dB → 0 ⎛ ω ⎞ R ω → ∞ : T ( jω) dB → −20log⎜ ⎟ = 20log()R / L − 20logω = − 20logω ⎝ R / L ⎠ L dB LINEAR FUNCTION in logω!!! We plot as a function of logω. G( jω) dB

Classical Control – Prof. Eugenio Schuster – Lehigh University 139

Bode Diagrams

Decade: Any frequency range whose end points have a 10:1 ratio

A cutoff frequency occurs when the gain is reduced from its maximum passband value by a factor 1 / 2 :

⎛ 1 ⎞ 20log⎜ T ⎟ = 20logT − 20log 2 ≈ 20logT − 3dB ⎝ 2 MAX ⎠ MAX MAX

Bandwith: frequency range spanned by the gain passband Let’s have a look at our example:

1 ⎧ω = 0 T ( jω) =1 T ( jω) = ⇒ 2 ⎨ ⎛ωL ⎞ ⎩ω = R / L T ( jω) =1/ 2 1+ ⎜ ⎟ ⎝ R ⎠ This is a low-pass filter!!! Passband gain=1, Cutoff frequency=R/L The Bandwith is R/L! Classical Control – Prof. Eugenio Schuster – Lehigh University 140

70 General Transfer Function (Bode Form) 2 q ⎡⎛ jω ⎞ jω ⎤ G()jω = K ()(jω m jωτ +1 )n ⎢⎜ ⎟ + 2ζ +1⎥ o ⎜ ω ⎟ ω ⎣⎢⎝ n ⎠ n ⎦⎥ The magg()nitude (dB) (phase ) is the sum of the magg()nitudes (dB) (phases) of each one of the terms. We learn how to plot each term, we learn how to plot the whole magnitude and phase .

Classes of terms:

1- G()jω = Ko 2- G( jω) = ( jω)m 3- n G()(jω = jωτ +1 ) 2 q 4- ⎡⎛ jω ⎞ jω ⎤ G()jω = ⎢⎜ ⎟ + 2ζ +1⎥ ⎜ ω ⎟ ω ⎣⎢⎝ n ⎠ n ⎦⎥ Classical Control – Prof. Eugenio Schuster – Lehigh University 141

General Transfer Function: DC gain

G( jω) = Ko

Magnitude and Phase: G( jω) dB = 20log Ko

⎧ 0 if Ko > 0 ∠G()jω = ⎨ G()s = −10 ⎩± π if Ko < 0 40 200

180 35 160 30 140 25 g)

(dB) 120 e 20 100

Phase (d Phase 80 15 Magnitude 60 10 40 5 20

0 0 -1 0 1 2 -1 0 1 2 10 10 10 10 10 10 10 10 Frequency (rad/sec) Frequency (rad/sec) Classical Control – Prof. Eugenio Schuster – Lehigh University 142

71 General Transfer Function: Poles/zeros at origin G( jω) = ( jω)m

Magnitude and Phase: G( jω) dB = m⋅ 20logω 1 π m = −1,G()s = ∠G()jω = m s 2 20 0

10 -20 G()1 dB = 0

0 -40 eg) (dB) d e -10 -60 Phase ( Magnitud -20 dB -80 m ⋅ 20 -30 dec -100

-40 -120 -1 0 1 2 -1 0 1 2 10 10 10 10 10 10 10 10 Frequency (rad/sec) Frequency (rad/sec) Classical Control – Prof. Eugenio Schuster – Lehigh University 143

General Transfer Function: Real poles/zeros

G( jω) = ( jωτ +1)n

Magnitude and Phase:

2 2 G()jω dB = n⋅10log(ω τ +1) ∠G()jω = ntan−1 ()ωτ

Asymptotic behavior:

∠G( jω) ⎯⎯→⎯ 0o G( jω) dB ⎯ω⎯<<1⎯/τ →0 ω<<1/τ ∠G( jω) ⎯⎯→⎯ n ⋅90o G( jω) dB ⎯ω⎯→>>1⎯/τ n ⋅τ dB + n ⋅ 20logω ω>>1/τ

Classical Control – Prof. Eugenio Schuster – Lehigh University 144

72 General Transfer Function: Real poles/zeros

10 n = −1,τ =1/10 5 0 1 dB G(s) = -5 n ⋅ 20 s n ⋅3dB dec +1 -10 10 -15

-20 Magnitude (dB) -25 G( j0) dB = 0dB -30 G( j1/τ ) dB = n ⋅3dB -35 G(∞) = sgn(n)∞dB -40 dB -1 0 1 2 3 10 10 10 10 10 Frequency (rad/sec)

Classical Control – Prof. Eugenio Schuster – Lehigh University 145

General Transfer Function: Real poles/zeros

10 n = −1,τ =1/10 0 -10 1 G(s) = -20 s +1 -30 10 -40

-50 o

Phase (deg) -60 n ⋅ 45 -70 ∠G( j0) = 0o -80 o -90 ∠G( j1/τ ) = n ⋅ 45 -100 o -1 0 1 2 3 ∠G( j∞) = n ⋅90 10 10 10 10 10 Frequency (rad/sec)

Classical Control – Prof. Eugenio Schuster – Lehigh University 146

73 General Transfer Function: Complex poles/zeros 2 q ⎡⎛ jω ⎞ jω ⎤ G()jω = ⎢⎜ ⎟ + 2ζ +1⎥ ⎜ ω ⎟ ω ⎣⎢⎝ n ⎠ n ⎦⎥ Magnitude and Phase: 2 2 ⎡⎛ ω 2 ⎞ ⎛ ω ⎞ ⎤ G()jω = q ⋅10log⎢⎜1− ⎟ + ⎜2ζ ⎟ ⎥ dB ⎜ ω 2 ⎟ ⎜ ω ⎟ ⎣⎢⎝ n ⎠ ⎝ n ⎠ ⎦⎥ ⎛ 2ζω /ω ⎞ −1⎜ n ⎟ ∠G()jω = q ⋅ tan ⎜ 2 2 ⎟ ⎝1−ω /ωn ⎠ Asyypmptotic behavior:

G( jω) ⎯⎯⎯→0 ∠G( jω) ⎯⎯→⎯ 0o dB ω<<ωn ω<<ωn o G( jω) ⎯ω⎯→>>⎯ω −2q ⋅ωn + q ⋅ 40logω ∠G( jω) ⎯⎯→⎯ q ⋅180 dB n dB ω>>ωn

Classical Control – Prof. Eugenio Schuster – Lehigh University 147

General Transfer Function: Complex poles/zeros

20 q = −1,ωn =1,ζ = 0.05 q ⋅ 2ζ 0 dB 1 -20 dB G(s) = 2 q ⋅ 40 s + 0.1s +1 dec -40

-60 Magnitude (dB) Magnitude

-80 G( j0) dB = 0dB G( jω ) = q ⋅(3dB + ζ ) -100 n dB dB

G( j∞) dB = sgn(q)∞dB -120 -1 0 1 2 3 10 10 10 10 10 Frequency (rad/sec)

MAX 2 ωn G( jω) = G( jωr ) = q ⋅(2ζ 1−ζ ) ⇔ ω = ωr = dB dB dB 1−ζ 2 Classical Control – Prof. Eugenio Schuster – Lehigh University 148

74 General Transfer Function: Complex poles/zeros

q = −1,ω =1,ζ = 0.05 20 n 0

-20 1 G(s) = 2 -40 s + 0.1s +1 -60

-80 o -100 ∠G( j0) = 0 q ⋅90o Phase (deg) Phase -120 ∠G( j1/τ ) = q ⋅90o -140 ∠G( j∞) = q ⋅180o -160

-180 -200 -2 -1 0 1 2 10 10 10 10 10 Frequency (rad/sec)

Classical Control – Prof. Eugenio Schuster – Lehigh University 149

Frequency Response

2000(s + 0.5) Example: G()s = s(s +10)(s + 50)

Classical Control – Prof. Eugenio Schuster – Lehigh University 150

75 Frequency Response: Poles/Zeros in the RHP

• Same G ( jω ) .

• The effect on ∠ G ( j ω ) is opposite than the stable case.

An unstable pole behaves like a stable zero An “unstable” zero behaves like a “stable” pole

1 Example: G()s = s − 2

This frequency response cannot be found experimentally but can be computed and used for control design.

Classical Control – Prof. Eugenio Schuster – Lehigh University 151

First order LOW PASS K T (s) = s +α ⇓ K T ( jω) = jω +α

Gain and Phase: K T ( jω) = ω 2 +α 2 θ (ω) = ∠K − tan−1()ω /α

⎧ 0 K > 0 ∠K = ⎨ ⎩−180o K < 0

Classical Control – Prof. Eugenio Schuster – Lehigh University 152

76 First order LOW PASS K T ( jω) = ω 2 +α 2 θ (ω) = ∠K − tan−1()ω /α K T (0) = ,T (∞) = 0 α K K α T (0) T ( jα) = = = ⇒ ωc = α Cutoff frequency α 2 +α 2 2 2 K T ( jω) ⎯⎯⎯→ ω<<α α K K = ⇔ ω = ω = α Cutoff frequency K α ω c T ( jω) ⎯⎯→⎯ ω>>α ω

B = ωc Bandwith

Classical Control – Prof. Eugenio Schuster – Lehigh University 153

First order LOW PASS K T ( jω) = ω 2 +α 2 θ (ω) = ∠K − tan−1()ω /α

θ (0) = ∠K θ (α) = ∠K − tan−1(1) = ∠K − 45o

θ (ω) ⎯ω⎯<<⎯α →∠K o θ (ω) ⎯ω⎯→>>⎯α ∠K − 90

Classical Control – Prof. Eugenio Schuster – Lehigh University 154

77 First Order HIGH PASS Ks T (s) = s +α ⇓ Kjω T ( jω) = jω +α

Gain and Phase: K ω T ( jω) = ω 2 +α 2 θ (ω) = ∠K + 90o − tan−1()ω /α

⎧ 0 K > 0 ∠K = ⎨ ⎩−180o K < 0

Classical Control – Prof. Eugenio Schuster – Lehigh University 155

First order HIGH PASS K ω T ( jω) = ω 2 +α 2 θ (ω) = ∠K + 90o − tan−1()ω /α

T (0) = 0, T (∞) = K

K α K T (∞) T ( jα) = = = ⇒ ωc = α Cutoff frequency α 2 +α 2 2 2

T ( jω) ⎯⎯⎯→ K ω /α ω<<α K ω = K ⇔ ω = ωc = α Cutoff frequency T ( jω) ⎯ω⎯→>>⎯α K α

B = ∞ Bandwith

Classical Control – Prof. Eugenio Schuster – Lehigh University 156

78 First order HIGH PASS K ω T ( jω) = ω 2 +α 2 θ (ω) = ∠K + 90o − tan−1()ω /α

θ (0) = ∠K + 90o θ (α) = ∠K + 90o − tan−1(1) = ∠K + 45o

o θ (ω) ⎯ω⎯<<⎯α →∠K + 90 o −1 θ (ω) ⎯ω⎯→>>⎯α ∠K + 90 − tan (∞) = ∠K

Classical Control – Prof. Eugenio Schuster – Lehigh University 157

First Order BANDPASS

⎛ K1s ⎞⎛ K2 ⎞ T (s) = T1(s)×T2 (s) = ⎜ ⎟⎜ ⎟ ⎝ s +α1 ⎠⎝ s +α2 ⎠ ⇓

⎛ K1 jω ⎞⎛ K2 ⎞ T ( jω) = ⎜ ⎟⎜ ⎟ ⎝ jω +α1 ⎠⎝ jω +α2 ⎠

⎛ K ω ⎞⎛ K ⎞ T ( jω) = ⎜ 1 ⎟⎜ 2 ⎟ ⎜ 2 2 ⎟⎜ 2 2 ⎟ ⎝ ω +α1 ⎠⎝ ω +α2 ⎠ K K ω T ( jω) ⎯⎯⎯⎯⎯→ 1 2 ω<<α1<<α2 K K ω K K α1α2 1 2 1 2 H = ⇒ ω = ωc = α1 K K α1α2 α2 T ( jω) ⎯⎯→⎯⎯⎯ 1 2 α1<<ω<<α2 K K K K α2 1 2 1 2 L = ⇒ ω = ωc = α2 α2 ω K1 K2 T ( jω) ⎯⎯→⎯⎯⎯ L H α1<<α2 <<ω ω B = ωc −ωc = α2 −α2 Passband Classical Control – Prof. Eugenio Schuster – Lehigh University 158

79 First Order BANDSTOP

⎛ K ω ⎞ ⎛ K ⎞ T ( jω) = ⎜ 1 ⎟ + ⎜ 2 ⎟ ⎜ 2 2 ⎟ ⎜ 2 2 ⎟ ⎝ ω +α1 ⎠ ⎝ ω +α2 ⎠ K T ( jω) ⎯⎯⎯⎯⎯→ 2 ω<<α2 <<α1 α2

T ( jω) ⎯⎯→⎯⎯⎯ K1 α2 <<α1<<ω

K2 = K1 α2

K2 T ( jω) ⎯α⎯→⎯<ω 2 ω K2 K1 ω α1 K2 ⇒ = ⇒ ω = = α1α2 K ω ω α K T ( jω) ⎯⎯→⎯ 1 1 1 ω<α1 α1 B = α1 −α2 Bandstop

Classical Control – Prof. Eugenio Schuster – Lehigh University 159

Second Order BANDPASS

Ks Kjω T (s) = 2 2 ⇒ T ( jω) = 2 2 s + 2ζωos + ωo −ω + 2ζωo jω + ωo

ωo : Natural Frequency ζ : Damping Ratio Classical Control – Prof. Eugenio Schuster – Lehigh University 160

80 Second Order BANDPASS

Ks Kjω T (s) = 2 2 ⇒ T ( jω) = 2 2 s + 2ζωos + ωo −ω + 2ζωo jω + ωo

K ω T ( jω) ⎯⎯→⎯ = ω<<ωo 2 ωo K ω K 2 = ⇒ ω = ωo K ωo ω T ( jω) ⎯⎯→⎯ = ω>>ωo ω

K /ω K /ω T ( jω) = o ⎯⎯→⎯ T ( jω) = o ω=ωo MAX ⎛ ω ωo ⎞ 2ζ 2ζ + j⎜ − ⎟ ⎝ωo ω ⎠

Classical Control – Prof. Eugenio Schuster – Lehigh University 161

Second Order BANDPASS

K /ω K /ω T ( jω) = o ⎯⎯→⎯ T ( jω) = o ω=ωo MAX ⎛ ω ωo ⎞ 2ζ 2ζ + j⎜ − ⎟ ⎝ωo ω ⎠

K /ωo

K /ωo 2ζ T ( jω) MAX ω ω T ( jω) − o =±2ζ = ⇒ T ( jω) = = ωo ω 2ζ + j2ζ 2 2

ω ω The roots of − o = ±2ζ are the cutoff frequencies!!! ωo ω

2 2 ωC1 = ωo (−ζ + 1+ ζ ) ω = ω ω Center Frequency ⇒ o C1 C 2 2 Bandwith ωC 2 = ωo (+ ζ + 1+ ζ ) B = ωC 2 −ωC1 = 2ζ

Classical Control – Prof. Eugenio Schuster – Lehigh University 162

81 Second Order LOWPASS

K K T (s) = 2 2 ⇒ T ( jω) = 2 2 s + 2ζωos + ωo −ω + 2ζωo jω + ωo

ωo : Natural Frequency ζ : Damping Ratio Classical Control – Prof. Eugenio Schuster – Lehigh University 163

Second Order LOWPASS

K K T (s) = 2 2 ⇒ T ( jω) = 2 2 s + 2ζωos + ωo −ω + 2ζωo jω + ωo

K T ( jω) ⎯⎯→⎯ = T (0) ω<<ωo 2 ωo K K 2 = 2 ⇒ ω = ωo K ωo ω T ( jω) ⎯⎯→⎯ = 2 ω>>ωo ω

K /ω T (0) T ( jω ) = o = o 2ζ 2ζ

T (0) 2 T ( jω) = ⇔ ω = ωMAX = ωo 1−ζ MAX 2ζ 1−ζ 2

Classical Control – Prof. Eugenio Schuster – Lehigh University 164

82 Second Order HIGHPASS

Ks2 − Kω 2 T (s) = 2 2 ⇒ T ( jω) = 2 2 s + 2ζωos + ωo −ω + 2ζωo jω + ωo

ωo : Natural Frequency ζ : Damping Ratio Classical Control – Prof. Eugenio Schuster – Lehigh University 165

Second Order HIGHPASS

Ks2 − Kω 2 T (s) = 2 2 ⇒ T ( jω) = 2 2 s + 2ζωos + ωo −ω + 2ζωo jω + ωo

K ω 2 T ( jω) ⎯⎯→⎯ − 2 ω<<ωo 2 K ω ωo = K ⇒ ω = ω ω 2 o T ( jω) ⎯⎯→⎯ = K = T (∞) o ω>>ωo

K T (∞) T ( jω ) = = o 2ζ 2ζ

T (∞) ωo T ( jω) = ⇔ ω = ωMAX = MAX 2ζ 1−ζ 2 1−ζ 2

Classical Control – Prof. Eugenio Schuster – Lehigh University 166

83 Frequency Response

u(t) = Acos(ωt +φ) G(s) yss = G( jω) Acos(ωt +φ + ∠G( jω))

Stable Transfer Function

j∠G( jω) G( jω) = G( jω) e BODE plots

G( jω) = Re{G( jω)}+ j IIm{G( jω)} NYQUIST plot s

Classical Control – Prof. Eugenio Schuster – Lehigh University 167

Frequency Response

G( jω) = Re{}G( jω) + j Im{G( jω)}= G( jω) e j∠G( jω)

How are the Bode and Nyquist plots related? They are two way to represent the same information

j Im{G( jω)}

G( jω) ∠G( jω)

Re{G( jω)}

Classical Control – Prof. Eugenio Schuster – Lehigh University 168

84 Frequency Response

• Find the steady state output for v1(t)=Acos(ωt+φ) + sL + R V (s) V1(s) _ 2 - • Compute the s-domain transfer function T(s) R – Voltage dividerT(s) = sL + R • Compute the frequency response R −1⎛ωL ⎞ T ( jω) = , ∠T ( jω) = − tan ⎜ ⎟ R2 + (ωL)2 ⎝ R ⎠

• Compute the steady state output AR −1 v2SS (t) = cos[ωt +φ − tan ()ωL / R ] R2 + (ωL)2

Classical Control – Prof. Eugenio Schuster – Lehigh University 169

Frequency Response - Bode Plots • Log-log plot of mag(T), log-linear plot of arg(T) versus ω Bode Diagram 0

-5 10 dB) )

( G(s) = -10 s +10 -15 R / L =10 -20 Magnitude

-25

0 g) ) (dB Magnitude e

-45 Phase (deg Phase (d Phase

-90 4 5 6 10 10 10 Frequency (rad/sec) [ω]= rad /sec, ω = 2πf , [ f ]= Hz Classical Control – Prof. Eugenio Schuster – Lehigh University 170

85 Frequency Response – Nyquist Plots R R R − jωL R2 − jωRL T ( jω) = = = R + jωL R + jωL R − jωL R2 + ω 2L2

R −1⎛ωL ⎞ T ( jω) = , ∠T ( jω) = −tan ⎜ ⎟ R2 + (ωL)2 ⎝ R ⎠ R2 ωRL Re{}T ( jω) = , Im{}T ( jω) = − R2 + ω 2L2 R2 + ω 2L2

1- ω → 0 : T ( jω) →1, ∠T ( jω) → 0 T ( jω) =1

R 2- ω → ∞ : T ( jω) → 0, ∠T( jω) → −90o T ( jω) ⎯⎯⎯→− j ⎯⎯⎯→0 ω→∞ ωL ω→∞ 3- Re{}T ( jω) = 0 ⇔ ω = ∞

4- Im{}T ( jω) = 0 ⇔ ω = 0,ω = ∞

Classical Control – Prof. Eugenio Schuster – Lehigh University 171

Frequency Response - Nyquist Plots Im{}G( jω) vs. Re{G( jω)}

10 G(s) = s +10 R / L =10

Classical Control – Prof. Eugenio Schuster – Lehigh University 172

86 Nyquist Diagrams

General procedure for sketching Nyquist Diagrams:

•Find G(j0)

•Find G(j∞)

•Find ω* such that Re{G(jω*)}=0; Im{G(jω*)} is the intersection with the imaginary axis.

•Find ω* such that Im{G(jω*)}=0; Re{G(jω*)} is the intersection with the real axis.

• Connect the points

Classical Control – Prof. Eugenio Schuster – Lehigh University 173

Frequency Response - Nyquist Plots 1 Example: G(s) = s()s +1 2

1 1 (− jω)(1− jω)2 − 2ω + j(ω 2 −1) G( jω) = 2 = 2 2 = 2 jω()jω +1 jω()jω +1 ()()− jω 1− jω ω()ω 2 +1

1- ω → 0:G( jω) = −2 − j∞

1 2- ω → ∞ :G( jω) ⎯⎯⎯→ j ⎯⎯⎯→0 ω→∞ ω3 ω→∞ 3- Re{}G( jω) = 0 ⇔ ω = ∞

1 Im{}G( jω) = 0 ⇔ ω =1,ω = ∞ Re{}G( j1) = − 4- 2

Classical Control – Prof. Eugenio Schuster – Lehigh University 174

87 Frequency Response - Nyquist Plots 1 Example: G(s) = s()s +1 2

Classical Control – Prof. Eugenio Schuster – Lehigh University 175

Nyquist Plots based on Bode Plots 1 G(s) = s()s +1 2

dB − 20 dec dB − 60 dec

− 90o −180o

− 270o = 90o

Classical Control – Prof. Eugenio Schuster – Lehigh University 176

88 Nyquist Stability Criterion

U (s) + G(s) Y(s) -

When is this transfer function Stable?

NYQUIST: The closed loop is asymptotically stable if the number of counterclockwise encirclements of the point (-1+j0) that the Nyquist curve of G(jω) is equal to the number of poles of G(s) with positive real parts (unstable poles)

Corollary: If the open-loop system G(s) is stable, then the closed-loop system is also stable provided G(s) makes no encirclement of the point (-1+j0).

Classical Control – Prof. Eugenio Schuster – Lehigh University 177

Nyquist Stability Criterion 1 1 G(s) = G(s) = s4 + 2s3 + 3s2 + 3s +1 s4 + 5s3 + 3s2 + 3s +1

Classical Control – Prof. Eugenio Schuster – Lehigh University 178

89 Nyquist Stability Criterion

U (s) + G(s) Y(s) -

K When is this transfer function Stable?

NYQUIST: The closed loop is asymptotically stable if the number of counterclockwise encirclements of the point (-1/K+j0) that the Nyquist curve of G(jω) is equal to the number of poles of G(s) with positive real parts (unstable poles)

Classical Control – Prof. Eugenio Schuster – Lehigh University 179

Neutral Stability U (s) + KG(s) Y(s) - 1 G(s) = s()s +1 2

Root locus condition:

KG(s) =1, ∠G(s) = −180o

At points of neutral stability RL condition hold for s=jω

KG( jω) =1, ∠G( jω) = −180o

Stability: At ∠G( jω) = −180o KG( jω) <1 If ↑K leads to instability KG( jω) >1 If ↓K leads to instability

Classical Control – Prof. Eugenio Schuster – Lehigh University 180

90 Stability Margins

The GAIN MARGIN (GM) is the factor by which the gain can be raised before instability results.

UNSTABLE SYSTEM GM <1(GM dB < 0)⇒

GM is equal to at the frequency 1/ KG( jω) (− KG( jω) dB ) where ∠ G ( j ω ) = − 180 o .

The PHASE MARGIN (PM) is the value by which the phase can be raised before instability results.

PM < 0 ⇒ UNSTABLE SYSTEM PM is the amount by which the phase of G ( j ω ) exceeds

-180° when KG( jω) =1 (KG( jω) dB = 0)

Classical Control – Prof. Eugenio Schuster – Lehigh University 181

Stability Margins 1 G(s) = s()s +1 2 1/GM

PM

Classical Control – Prof. Eugenio Schuster – Lehigh University 182

91 Stability Margins 1 G(s) = s()s +1 2 GM

PM

Classical Control – Prof. Eugenio Schuster – Lehigh University 183

Specifications in the Frequency Domain

1. The crossover frequency ωc, which determines bandwith ωBW, rise time tr and settling time ts.

2. The phase margin PM, which determines the

damping coefficient ζ and the overshoot Mp.

3. The low-frequency gain, which determines the steady-state error characteristics.

Classical Control – Prof. Eugenio Schuster – Lehigh University 184

92 Specifications in the Frequency Domain

The phase and the magnitude are NOT independent!

Bode’s Gain-Phase relationship:

1 +∞dM ∠G()jω = W ()u du o π ∫−∞ du

M = ln G( jω)

u = ln(ω /ωo ) W (u) = ln()coth u / 2

Classical Control – Prof. Eugenio Schuster – Lehigh University 185

Specifications in the Frequency Domain

The crossover frequency: ωc ≤ ωBW ≤ 2ωc

Classical Control – Prof. Eugenio Schuster – Lehigh University 186

93 Specifications in the Frequency Domain

The Phase Margin: PM vs. Mp

Classical Control – Prof. Eugenio Schuster – Lehigh University 187

Specifications in the Frequency Domain

PM The Phase Margin: PM vs. ζ ζ ≅ 100

Classical Control – Prof. Eugenio Schuster – Lehigh University 188

94 Frequency Response – Phase Lead Compensators

Ts +1 D(s) = , α <1 αTs +1

1− sinφ α = MAX 1+ sinφMAX 1 ⎡ ⎛ 1 ⎞ ⎛ 1 ⎞⎤ logωMAX = ⎢log⎜ ⎟ + log⎜ ⎟⎥ 2 ⎣ ⎝T ⎠ ⎝αT ⎠⎦

Classical Control – Prof. Eugenio Schuster – Lehigh University 189

Frequency Response – Phase Lead Compensators

1. Determine the open-loop gain K to satisfy error or bandwidth requirements: - To meet error requirement, pick K to satisfy error

constants (Kp, Kv, Ka) so that ess specification is met. - To meet bandwidth requirement, pick K so that the open-loop crossover frequency is a factor of two below the desired closed-loop bandwidth.

2. Determine the needed phase lead →αbased on the PM specification.

3. Pick ωMAX to be at the crossover freqqyuency.

4. Determine the zero and pole of the compensator.

5. Draw the compensated frequency response and check PM.

6. Iterate on the design

Classical Control – Prof. Eugenio Schuster – Lehigh University 190

95 Frequency Response – Phase Lag Compensators

Ts +1 D(s) = α , α >1 αTs +1

Classical Control – Prof. Eugenio Schuster – Lehigh University 191

Frequency Response – Phase Lag Compensators

1. Determine the open-loop gain K that will meet the PM requirement without compensation.

2. Draw the Bode plot of the uncompensated system with crossover frequency from step 1 and evaluate the low- frequency gain.

3. Determine α to meet the low frequency gain error requirement.

4. Choose the corner frequency ω=1/T (the zero of the compp)ensator) to be one decade below the new crossover

frequency ωc.

5. The other corner frequency (the pole of the compensator) is then ω=1/ α T.

6. Iterate on the design

Classical Control – Prof. Eugenio Schuster – Lehigh University 192

96