Top Banner
Dr. Pete Nelson Sierra Scientific Solutions, LLC Introduction to Control System Theory For Engineers This talk assumes: No prior background in control systems Working knowledge of Fourier Transforms and frequency-domain analysis Some familiarity with complex numbers (will review) The willingness to ask questions!
33

Introduction to Control System Theory For Engineers

Jan 01, 2016

Download

Documents

Holly Moore

Introduction to Control System Theory For Engineers. This talk assumes: No prior background in control systems Working knowledge of Fourier Transforms and frequency-domain analysis Some familiarity with complex numbers (will review) The willingness to ask questions!. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Introduction to Control System

Theory

For Engineers

This talk assumes:• No prior background in control systems• Working knowledge of Fourier Transforms and

frequency-domain analysis• Some familiarity with complex numbers (will

review)• The willingness to ask questions!

Page 2: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Section 1:

Introduction to Control System Theory:

Page 3: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLCTerminology: dB & the Complex Plane

R

Euler’s Equation:𝑖𝑅𝑠𝑖𝑛(𝜃)

Re

Im

𝑅𝑐𝑜𝑠(𝜃)

i

R

𝑿=𝟏𝟎𝑳𝒐𝒈𝟏𝟎 (𝑿 )

𝐿𝑜𝑔 ( 𝑋 ∗𝑌 )=𝐿𝑜𝑔 ( 𝑋 )+𝐿𝑜𝑔(𝑌 )

𝐿𝑜𝑔 ( 𝑋𝑁 )=𝑁∗𝐿𝑜𝑔(𝑋 )

𝐵𝑒𝑙𝑙=𝐿𝑜𝑔10( 𝑃𝑃0)

𝑑𝑒𝑐𝑖𝐵𝑒𝑙𝑙(𝑑𝐵)=10×𝐿𝑜𝑔10( 𝑃𝑃0)

𝑑𝐵=10× 𝐿𝑜𝑔10( 𝐴2

𝐴0❑2 )=10×𝐿𝑜𝑔10( 𝐴𝐴0

)2

=20×𝐿𝑜𝑔10( 𝐴𝐴0)

Some handy Amplitude ratios expressed in dB:0dB = 1x (often used instead of ‘unity gain’ in controls)

6dB ~= 2x [ -6dB ~= 1/2x ]10dB ~= 3x [ -10dB ~= 1/3x ]12dB ~= 4x [ -12dB ~= 1/4x ]20dB = 10x [ -20dB = 1/10x ]

Lets Practice:16dB = 6dB + 10dB ~= (2x) x (3x) = 6x22dB = 10dB + 12dB ~= (3x) x (4x) = 12x30dB = 10dB + 20dB ~= (3x) x (10x) = 30x80dB = 4 x 20dB ~= (10x) x (10x) x (10x) x (10x) = 104x16 bits ~= 16*6dB = 96dB of dynamic range“20dB/Decade” = f(+/-)1 & “40dB/Decade” = f(+/-)2, etc.

The Complex Plane:

Page 4: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

What is a Control System?

System to control

Means to control it

OutputInput

Example Inputsand Outputs:• Force• Volts• Heat• Light• Pressure

Example Systems:• House • Hard drive head• Clock osc.• Radio PLL• Power supply• Amplifiers

Example Means:(sensors & actuators)• Thermistors• Photodiodes• Strain gauge• Disp. Sensor• Heaters• Voice coils

But what does this box mean?

Input Output

Page 5: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Boxes Represent Transfer Functions:

T.F.()B(A

Re

Im

i

B/A

(phasor diagram)

This already means we have made assumptions:• The magnitude of the transfer function (B/A) is constant independent of the

magnitude of A. Linearity and superposition• A single frequency input () produces only a single frequency output without

any harmonic distortion, etc. Linearity again….• The ratio of B()/A() and the phase () are constant in time. No saturation! • The input is unaffected by the output and the output is unaffected by load. ”The signal diode” assumption & ZERO output impedance!

..where B/A is the “Gain” at

Page 6: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Basic Configuration of a Feedback System:

G(s)

H(s)

OutIn

Transfer function is:

)()(1

)(

)(

)(

sHsG

sG

sIn

sOut

-Becomes large when:

unitysHsG |)()(| 180))()(( sHsG

)()(1 sHsG-The “Characteristic Equation” is:

)()( sHsG-The “Loop Transfer Function” or “Loop Gain” is:

“G(s)” is the “Plant” transfer function“H(s)” is the “Compensation”

M

LKF

Xout

Fin

0

MXout

0

F H)( LKF

L

Fin

Code for “Laplace

transform”

Page 7: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

OutG1

H1

In

H2

G’=OutIn

H2

“Block Math”: Multiple Sensors, Nested Loops, & Noise

211

11

11

11

)1(1

)1(

HHG

HG

HGHG

)1( HG

HGX N

)1( 11

11

HG

HG

F

X_noise

H

++

G

H

OutIn

Xn

G

H

OutXn H

F

H1

FH2

H4

H5

H3-The sensor / actuator with thehighest gain wins (you can’t havetwo loops controlling the same DOFat the same time.)

+

+

Page 8: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Before we Look Under the Hood…

2) The Laplace Transform is used only in continuous-time models;Discretely-sampled (digital) systems require using the Z-Transform.

1) Question: What is on the cover of the Hitchhiker’s Guide to the Galaxy?

3) You will get into trouble if you try to use CT techniques in discrete-time(DT) systems. Discrete sampling effects such as aliasing becomevery significant and compensation filters need special techniques to design.

4) Sorry, but I won’t cover DT and Z-Transforms here. Understanding CTtechniques is critical to DT and they will get you “90%” of the way there.

Don’t PanicThe Laplace Transform IS the engine, but you can drive the car without itand you will never need to actually calculate one.

Page 9: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLCWhy Use the Laplace Transform?

)())((

)())(()(

21

21

N

N

PSPSPS

ZSZSZSKsTF

||||||

|||||||)(|

21

21

N

N

PSPSPS

ZSZSZSKsTF

1) The real frequency response is just theLaplace transform evaluated along the positiveimaginary axis in the S-plane: L(s) =F(ω) = L(iω)

Unstable!!!

)()()()()()())(( 2121 NN PSPSPSZSZSZSsTF

Pole-Zero representation:The factorized transfer function takes the form:

Then the magnitude of the frequency response is:

And the phase angle of the frequency response is:

iAeZ

Think:

S

2) The S-plane provides a simple and absolutestability criterion: if any right-half-plane (RHP) polesexist, the system is unstable!!! X

X

X

X

0

0

0

0

0

X

X

Re

Im

S

X

0

0

.(S-P1)

S = iω

1

Re

Im

Page 10: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Figuring Out Transfer FunctionsMag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

M

LKF

Xin

Xout

0

0

Minimal-Phase (θ=90*slope exponent):

(plus damping)

f -2

f 0

θ = -2 x 90

θ = 0 x 90

S

X

X

Re

Im

Non-Minimal-Phase (RHP zeros or poles):

Examples:

All-pass filters Time delays (DT) “Zero-order hold” (DT) FIR filters (DT)

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

Non-minimal phaseis always bad in control systems!

f 0

S

X 0Re

Im

Page 11: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

The Nyquist Stability Criterion:Recall:

)()(1

)(

)(

)(

sHsG

sG

sIn

sOut

)()(1 sHsGIf the Characteristic Equation:

Has any RHP zeros, the closed-loop transferfunction will be unstable.

S-plane1+G(s)H(s)

X0 Re

ImPolar plot of Loop Transfer Function GH:

0

Real frequency response

-0 freq.

Conjugate frequency response

Contour enclosingall RHP poles and zeros

+0 freq.

+∞ freq.

-∞ freq.

A B

D

C

0

A

B

CD

UNSTABLE!

Gain=1

-1 point!

)()()()()()())(( 2121 NN PSPSPSZSZSZSsTF

Page 12: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

A Simple Example…..

Gain=1

STABLE!

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

0dBf -1

f -2

-0 freq.+0 freq.

Gain=1

UNSTABLE!

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

0dB

f -1

f -3

-0 freq.

+0 freq.

Page 13: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Phase is Enemy #1 – Time Delays

Gain=1

UNSTABLE!

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

0dB

f -1

phase w/o delay

-0 freq.

+0 freq.Time delays cause rapidly dropping phase with higherfrequency

Alternate Bode-based stability requirement:The phase must be less than ±180 degreesat unity gain.

Page 14: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLCSources of Non-Minimal Phase:

The Zero-Order Hold (ZOH) and Transport Delays

100

101

102

103

-60

-50

-40

-30

-20

-10

0Phase lag vs oversampling factor for ZOH

Oversampling factor (fsamp/f)

Pha

se la

g, d

egre

es

Based on 4th order Pade approximation

10-3

10-2

10-1

-40

-35

-30

-25

-20

-15

-10

-5

0Phase lag vs time delay

Time delay (1/f)

Pha

se la

g, d

egre

es

Based on 4th order Pade approximation

∆t

ADC In DAC out

t

Cts.

Sampling at 10x unity gaingives ~18 degrees of extraphase!

A time delay of 10ms gives ~36 degrees of extra phase at 10Hz!

Both effects exist in all digital control systems!

Page 15: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Summary of Section 1: Theory

• Plants with RHP zeros or poles. These are unusual, but can occur, often deliberately! This requires the ‘full version’ of the Nyquist criteria…. (yes, I have lied to you….)

• “MIMO” systems: Multiple Input, Multiple Output. This talk only covers “SISO”.• Digital systems require use of the “Z-Transform”. We don’t cover, but its important to

learn when you are ready.

Things we didn’t cover:

• Pick your Plant (G) to represent the inputs and outputs you care about.

• System Magnitude and Phase responses are represented by complex numbers. In the S-Plane (Laplace Transform Space) by complex poles and zeros.

• Systems with Right Half Plane (RHP) poles are unstable.

• Introduced a working form of the Nyquist Stability Criterion: || < 180• → Phase is the enemy. Beware time delays and ZOH!

The “God Equation”)()(1

)(

)(

)(

sHsG

sG

sIn

sOut

• Introduced Minimal Phase Networks: = n*90, n=power of slope.

• Non-minimal phase networks are useless as compensation (exercise for reader).

Page 16: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Section 2:

Performance

Page 17: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Dynamic Response: Phase and Gain Margins

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

0dB

Phase Margin

Gain MarginGain=1

(STABLE)

Phase Margin

Gain Margin

• Phase Margin usually dominates the closed-loop response

• All the information required for dynamic response is in the Bode diagram

)()(1

)(

sHsG

sG

Page 18: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLCA Simple Phase-Margin Calculation:

0 10 20 30 40 50 60 70 80 9010

-1

100

101

102

103

Phase Margin, Deg.

Am

plifi

catio

n at

Uni

ty G

ain

Amplification of Control System Responseat the Unity Gain Frequency vs Phase Margin

)(2222 COScbcba

Phasor diagram for 1+GH:

The Law of Cosines:

1+GH

GH at |GH|=1

The vector (1)

θ

Gives the amplification:

when |GH|=1 (at unity gain)

Phase Margin

))cos(1(2

1

1

1

GH

But the real situation is a bit more complex…..

Page 19: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLCDynamic Response: The Nichols Chart

G

H

OutIn

The Nichols chart plots:

)()(1

)()(

sHsG

sHsG

which is also called the control

signal

Page 20: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

The Designer’s Choice – No Right Answer…

10-1

100

101

-40

-20

0

20

40Loop Transfer Function (GH) of System

Frequency, Hz

Mag

nitu

de,

dB

10-1

100

101

-200

-150

-100

-50

0

Frequency, Hz

Pha

se,

Deg

.

Phase margins of: 10, 30, 50, 70 and 90 Degrees

10-1

100

101

-40

-30

-20

-10

0

10

20System Response vs Phase Margin

Frequency, Hz

Res

pons

e, d

B

Phase margins of: 10, 30, 50, 70 and 90 Degrees

0 0.5 1 1.5 2 2.5 3-6

-5

-4

-3

-2

-1

0

1

2

3

4Impulse Response vs Phase Margin

Time, sec

Impu

lse

Res

pons

e

Phase margins of: 10, 30, 50, 70 and 90 Degrees

Page 21: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

1/f^2 : The Optimal Servo?

- saturation

+ saturation

No gain(or negative!)

Nom. gain

Reduced gain

sensor out

sensor in

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

0dB

f -3

f -<2

f -3

Sensor (or actuator) Saturation:NEW 0dB

UNSTABLE!

Solution: Keep the slope above unity gain to less than 2 powers of frequency.

This is called a “Conditionally Stable” servo

Page 22: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLCHigh Bandwidth & Sensor Co-Location:

F …

H

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

0dB

Gain=1

+0 freq.

180 degreesfor each resonance

4 New unity-gain points!~10x

• Eliminate resonances between sensing and actuation• Damp resonances if possible• Increase resonant frequencies (hard!)• Can use filters for isolated resonances

OK

Page 23: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Sensors Lie #1: Representation

Filt & Amp

Consider a temperature-control servo:

Outer housing

Thermistor

Inner housing

Heater windings

Insulation

Heater ground

~60C set pt.

~30C outside

Conclusion:Thermal performance is limited by the balancing ofheat loss and heat input to ~10% (?!?!). This means servo gains higher than ~20-30dB are a waste!!

Page 24: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Sensors Lie #2: Sensor Noise

MXout

0

F H

+

Xn

M1

X2

0

F

M2

+

Xn

H

X1

0

(Sensor Out)X1

Log(f)

f 2f 0

0 dB

Conclusions:1. Mass tracks sensor noise2. Sensor output (noise) suppressed

by the loop gain

Conclusions:1. Sensor noise is amplified by 1/f2 below the

M2 resonance!!!!!2. With ‘1/f’ noise in sensor, mass motion

grows by 1,000x each decade (down) to unity gain.

3. Sensor output (noise) suppressed by gain.

Servo wants to minimizethe signal here...

Page 25: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Summary of Section 2: Performance

• Integrators can reduce errors to zero, and the more integrators the better this works. However ‘integrator wind-up’ is a difficult problem.

• The importance of modeling systems. Straight-line approximations only go so far…• PID controllers are horribly non-parametric and only work well for free-mass systems

(i.e.: moving stage & motion control). Otherwise they mostly suck. You can do better!• Issues with actually closing the loop on high gain servos – dynamic range and noise!

Things we didn’t cover:

• Showed Phase and Gain Margins are useful parameters to describe performance. There is ALWAYS a Phase Margin, but not always a gain margin.

• Overshoot (~Q) is ~3x at 20pm, ~2x at 30pm, and critically damped at ~60pm.

• Demonstrated there is no ‘right answer’ when it comes to choosing a phase margin.

• Proved that a transfer function slope of 1/f2 is the best performing system possible without introducing conditional stability.

• Showed mechanical resonances always limit bandwidths and that sensor co-location can mitigate that.

• Used the Nichols Plot to show that feedback systems rarely look like simple second-order systems. Will demonstrate in Section 3.

• Sensors are lying bastards. If you need to verify performance, use an independent sensor.

Page 26: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Section 3:

Practical Servo Design

Page 27: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLCHow I Design a Servo:

Step 1:Model, then measure the planttransfer function (G):

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

f -2

f 0

θ = -2 x 90

θ = 0 x 90

Step 3:Measure loop transfer function(GH) to confirm.

G

Step 4:

Close the loop!

Step 2:Design a compensation (H) which pulls the phase down to -180º with enough phase lead at unity gain to give me the desired stability & impulse response.

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

f -2

f 0

H

phase lead

Page 28: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLCNow With Some More Detail:

M

Fin

Xout

0

F H

L

Remember from start of talk:

Requirements for our servo:• Have a spring-like restoring force• Provide damping• Always bring the sensor to null • Filter noise

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

0dB

Compensation

f -1

f 1

f -2

Null sensor Damping(phase lead)

Filter HF noise

H

Always start with physics: F=ma

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

0dB

Plant

f -2Units:X/F !

θ = -2 x 90 = -180

G

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

0dB

Loop Transfer Function

GH

f -2

f -1f -2

f -4

f -3

Page 29: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLCBut is it stable?

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

0dB

Loop Transfer Function

GH

f -2

f -1f -2

f -4

f -3

Gain=1

UNSTABLE?CCW encirclement?

-0 freq.

+0 freq.

Gain=1

STABLE

-0 freq.

+0 freq.

S

X0 Re

Im

0

Real frequency response

-0 freq.

Conjugate frequency response Contour enclosingall RHP poles and zeros

+0 freq.

+∞ freq.

-∞ freq.

0

We have THREE poles at the origin!

Recall:

Page 30: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

The Magic Disappearing Resonance:

Consider a mass on a spring:

MXout

Fin

0

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

f -2

f 0

θ = -2 x 90

θ = 0 x 90

G

ω0

Recall:)()(1

)(

)(

)(

sHsG

sG

sIn

sOut

Plant:

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

f -2

f 0

θ = -2 x 90

θ = 0 x 90

GH

ω0

LoopT.F.:

0dB

Closed-loopresponse:

Mag.(dB)

+180

+90

0

-90

-180

Phase

Bode Diagram:

Log(f)

Log(f)

ω0

Original resonance is GONE!

F G

Page 31: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

The “Super Spring” Servo

10-1

100

101

102

103

-400

-200

0

200Plant Transfer Function

Frequency, HzM

agni

tude

, dB

10-1

100

101

102

103

-200

-100

0

100

200

Pha

se,

Deg

Frequency, Hz

M

Xout

Sensor

0

F G

M

Mref

Xin

0

Optical Corner Cube

InjectTestSignal

Meas.Output

200Hz

Page 32: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Summary of Section 3: Practical Design

• Did I already mention modeling? Good. I needed to at least twice!• Sensor noise can also limit bandwidth. In the Super Spring, it grows like 1/f3!!• So many other things. I hope this is just a start!

Things we didn’t cover:

• Start design with a simple, linear, minimal-phase approximation to get 1/f2.

• Work backwards from the Plant (G) and the desired LTF (GH) to get H.

• Closed-loop systems often show no sign of open-loop resonances.

• You can add 360 to the phase and get the same plot. Phase works on a circle! High-Freq. resonances can sometimes be tamed by ADDING phase!!!

• Use the alternate version of the Nyquist Stability criteria because polar plots make your head hurt too much.

Page 33: Introduction to Control System Theory For  Engineers

Dr. Pete NelsonSierra Scientific Solutions, LLC

Thank You