Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a...

22
EE392m - Spring 2005 Gorinevsky Control Engineering 4-1 Lecture 4 – PID Control Continuous Time 90% (or more) of control loops in industry are PID PI PD PID Robustness

Transcript of Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a...

Page 1: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-1

Lecture 4 – PID Control Continuous Time

90% (or more) of control loops in industry are PID

• PI• PD• PID• Robustness

Page 2: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-2

ekvkuev

yye

PI

d

−−==

−=&

;

duyy ++−=&τ

PI control• First-order system:

• P control + integrator for cancelling steady state error

Example: • WDM laser-diode temperature control

• Other applications• ATE• EDFA optical amplifiers• Fiber optic laser modules• Fiber optic network equipment

duyy ++−=&τ

heat loss to environment

heat capacity

y(t) = temperature - ambient temperature pumped

heatproduced

heat

Temperature Controller

Peltier Heatpump

Page 3: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-3

Cascaded loop interpretation:

PI control• P Control • + Integrator for canceling

steady state error

∫−−=

−=

edtkeku

yye

IP

d

Inner loop

Plant

kP

e(t)u(t)

ki∫

y-

yd

PiI kkk ⋅=dteke

eeku

id

dP

∫=

−= )(

Page 4: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-4

PI control• Closed-loop dynamics

• Steady state (s = 0): . No steady-state error!

• Transient dynamics: look at the characteristic equation

• Disturbance rejection

dSS yy =

0)1(2 =+++ IP kk λτλ

)(ˆ)()(ˆ ωωω idiHiy d ⋅=

dkskss

sykskss

kskyIP

dIP

IP

++++

++++=

)1()1( ττ

0

0.2

0.4y(t)

Frequency (rad/sec)

DISTURBANCE REJECTION

MA

GN

ITU

DE

(dB

)10-2 100 102-40

-30

-20

-10

0

)( ωiHd

)(1

1 dus

y ++

)(1dIP yyk

sku −⎟

⎠⎞

⎜⎝⎛ +−=

Page 5: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-5

Processor thermal control example• Thermal control

– present in most new generation microprocessors: Intel, AMD,…

• Linear control of fan speed• Minimize acoustic emission

and fan power expenditure• Keep processor cool enough

• Model– heat pipe time constant – heat exchanger time constant

Picture from Samson et al, Intel Technology Journal, February 2005

dusHy += )(

)1)(1()(

21 ++=

ssgsHττ

Analysis model:

2

1

ττ

Page 6: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-6

Processor thermal control cont’d• Simplified design model

– fit step response – integrator

• P-control

• I-control – Designed as cascaded to P

dus

y +=50

4.00 20 40 60 80 100 120 140

-0.4

-0.3

-0.2

-0.1

0COOLING STEP RESPONSE (DEG / FAN POWER PERCENTAGE)

0 20 40 60 80 100 120 1400

0.5

1

P-CONTROL

0 20 40 60 80 100 120 1400

0.5

1

TIME (SEC)

PI-CONTROL

)150)(15(4.0)(

++=

sssH

)( vyku P −−=8=Pk 6.15)4.0/(50 == PP kT

)( di yykv −−=&2.0;025.0 === PiIi kkkk

50/1 == iI kT

dtyykyyku dIdP )()( ∫ −−−−=

)( dP yyku −−=

Page 7: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-7

Phase Locked Loop (PLL) Example

• Phase-locked loop is arguably a most prolific feedback system

PLL

Voltage Controlled Oscillator

Hi-freq LPF

Loop Filter (controller)

reference signal

signal phase-locked to reference

uK

AKe

ooo

o

odom

=∆=

−=∆−+∆≈

ωθωωω

θθω

&

)sin(

e

u

vrKe m ⋅= LPF2

44444 344444 210

])sin[(LPF

])sin[(LPF

)cos()sin(2LPF

+++−

−+−=

+⋅+

odo

odo

ood

t

t

tt

θθωωθθωω

θωθω

)cos( ootv θω +=

)sin( dtAr θω +=

Page 8: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-8

PLL Model• Small-signal model:

PLL

VCO

Kd C(s)

reference error

phase

{o

uK

KKe

o

d

do

dd

θ

θωωθθθ

−+−=

≈=

43421&&

)sin(e

u

1<<−+−= odott θθωωθ

odott θθωωθ −+−=

sKo−

∫ ⋅+=

=−=

dtekeku

KeuKd

IP

d

o

θθ&

d

dkskKKs

s

IPdo ++= 2θ

• Loop dynamics:

Page 9: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-9

PD control• 2-nd order dynamics

• PD control

• Closed-loop dynamics

• Optimal gains (critical damping)

Example: • Disk read-write head control

duy +=&&

ekekuyye

PD

d

−−=−=&

DISTURBVCM TTJ +=ϕ&&

VoiceCoilMotor

dekeke PD =++ &&&

dksks

ePD ++

= 21

2;2 ττ == PD kk

Page 10: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-10

es

eesse

DDDD 1111

1 +⋅−=

+≈

ττττ&

PD control• Derivative (rate of e) can be obtained

– speed sensor (tachometer)– low-level estimation logic

• Signal differentiation, see Lecture 3– is noncausal– amplifies high-frequency noise

• Causal (low-pass filtered) estimate of the derivative

• Modified PD controller, with estimated derivative:eke

ssku P

DD −

+−=

Page 11: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-11

PD control performance• The performance seems to be infinitely improving for

• This was a simple design model, remember?• Performance is limited by

– system being different from the model • flexible modes, friction, VCM inductance

– sampling in a digital controller– rate estimation would amplify noise if too aggressive– actuator saturation– you might really find after you have tried to push the performance

• If high performance is really that important, careful application of more advanced control approaches might help

∞→== τττ ;;2 2PD kk

Page 12: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-12

Plant Type

• Constant gain - I control• Integrator - P control • Integrator+disturbance – PI control• Double integrator - PD control• Generic second order dynamics - PID control

Page 13: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-13

PID Control• Generalization of P, PI, PD• Early motivation: control of first

order processes with deadtime

Example:•

us

geyTs

1+=

τ

Paper machine control

DT

τ

g

Page 14: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-14

PID Control

• PID: three-term control

• Rate of change in D-term can come from an independent sensor or an estimate (differentiating filter, see Lecture 3)

∫ ⋅−−−=

−=

dtekekeku

yye

IPD

d

&

esse

D 1+≈

τ&

Page 15: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-15

sim

Tuning PID Control• Trial and error tuning

– Design a PI controller– Add D term and find a good D gain– Tinker with P and I gains

• Model-based tuning• Formulate performance index• Numerical optimization

– For given parameters run a sim, compute performance parameters and a performance index

– Optimize the performance index over the three PID gains using grid search or Nelder method.

eskksku I

PD ⎟⎠⎞

⎜⎝⎛ ++−=

Plant model

Optimizer

IPD kkk ,, Performance

Page 16: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-16

Zeigler-Nichols tuning rule

• Explore the plant: – set the plant under P control and start increasing the gain till the

loop oscillates– note the critical gain kC and oscillation period TC

• Tune the controller:

• Z and N used a Monte Carlo method to develop the rule• Z-N rule enables tuning if a model and a computer are both

unavailable, only the controller and the plant are.

kP kI kDP 0.5kC

______ ______

PI 0.45kC 1.2kP/TC______

PID 0.5kC 2kP/TC kPTC/8

Page 17: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-17

Integrator anti wind-up• In practice, control authority is

always limited: – uMIN ≤ u(t) ≤ uMAX

• Wind up of the integrator:– if the integral v

will keep growing while the control is constant. This results in a heavy overshoot later

• Anti wind-up:– switch the integrator off if the

control has saturated

⎪⎩

⎪⎨

<≤≤

>=

−−==

MINcMIN

MAXcMINc

MAXcMAX

PIc

uuuuuuu

uuuu

ekvkuev

,,

,

&

MAXc uu >

⎩⎨⎧

<>≤≤

=MINcMAXc

MAXcMIN

uuuuuuue

vor if0,

for ,&

Anti wind-up

No anti wind-up

Page 18: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-18

Robustness

• Ok, we have a controller that works for a nominal model. • Why would it ever would work for real system?

– Will know for sure only when we try - V&V - similar to debugging process in software

• Can check that controller works for a range of different models and hope that the real system is covered by this range– This is called robustness analysis, robust design– Was an implicit part of the classical control design - Nyquist, Bode– Multivariable robust control - Honeywell: G.Stein, G.Hartmann, ‘81– Doyle, Zames, Glover - robust control theory

Page 19: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-19

Modeling uncertainty• Modeling uncertainty:

– unknown signals– model errors

• Controllers work with real systems:– Signal processing: data → algorithm → data– Control: algorithms in a loop with a real system– It can blow up! (and sometimes it does)

• BIG question: Why controller designed for a model would ever work with a real system? – Robustness, gain and phase margins, – Control design model, vs. control analysis model – Monte-Carlo analysis

Page 20: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-20

Control loop analysis

• Why control might work if the process differs from the model?• Key factors

– modeling error (uncertainty) characterization– time scale (bandwidth) of the control loop

Plant

Feedback controller

y(t)u(t)

Plant

Feedback controller

y(t)u(t)

)( dI yykuguy

−−==

&0)( =−+ dI yygky&

0

Actual step response

Step response for the design model:

y(t)=gu(t)

Modeling error

Uncertainty

Page 21: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-21

Robustness - Small gain theorem• Nonlinear uncertainty!

• Operator gain

– G can be a nonlinear operator

• L2 norm

• L2 gain of a linear operator

u(t) G y(t)

uGGu ⋅≤

1<∆⋅G

The loop is guaranteed stable if

∫∫ == ωωπ

diudttuu 222 )(~21)(

( )44 344 214434421

22

2222 )(~21)(sup)(~)(

21

uG

diuiGdiuiGGu ∫∫ ⋅≤= ωωπ

ωωωωπ

(Open-loop stability assumed)

Desoer and Vidyasagar, Feedback Systems: Input-Output Properties, 1975

G.Zames

Page 22: Lecture 4 – PID Control Continuous Time · – Design a PI controller – Add D term and find a good D gain – Tinker with P and I gains • Model-based tuning • Formulate performance

EE392m - Spring 2005Gorinevsky

Control Engineering 4-22

Robustness• Additive uncertainty

T (s)

P(s)

C(s)

y(t)u(t)

1)()()(1

)()( <∆⋅+

∆321

44 344 21

ωωω

ωω iiCiP

iCiP

T

Condition of robust stability

Su(s)

P(s)

C(s)

y(t)u(t)

1)()()(1

)( <∆⋅+

∆321

44 344 21

ωωω

ω iiCiP

iC

uS

Condition of robust stability

• Multiplicative uncertainty