Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why...

21
1 Discrete (Digital) Feedback Control: Direct Design and Stability, etc. ELEC 3004: Systems: Signals & Controls Dr. Surya Singh (with material from Dr. Paul Pounds and from Prof. Mark Cannon (Oxford Discrete Systems)) Lecture 21 [email protected] http://robotics.itee.uq.edu.au/~elec3004/ © 2013 School of Information Technology and Electrical Engineering at The University of Queensland May 17, 2013 Next Time in Linear Systems …. ELEC 3004: Systems 17 May 2013 - 2 Week Date Lecture Title 1 27-Feb Introduction 1-Mar Systems Overview 2 6-Mar Signals & Signal Models 8-Mar System Models 3 13-Mar Linear Dynamical Systems 15-Mar Sampling & Data Acquisition 4 20-MarTime Domain Analysis of Continuous Time Systems 22-MarSystem Behaviour & Stability 5 27-Mar Signal Representation 29-Mar Holiday 6 10-Apr Frequency Response 12-Apr z-Transform 7 17-Apr Noise & Filtering 19-Apr Analog Filters 8 24-AprDiscrete-Time Signals 26-Apr Discrete-Time Systems 9 1-May Digital Filters & IIR/FIR Systems 3-May Fourier Transform & DTFT 10 8-May Introduction to Digital Control 10-May Stability of Digital Systems 11 15-MayPID & Computer Control 17-May Applications in Industry 12 22-May State-Space 24-May Controllability & Observability 13 29-MayInformation Theory/Communications & Review 31-MaySummary and Course Review

Transcript of Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why...

Page 1: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

1

Discrete (Digital) Feedback Control:Direct Design and Stability, etc.

ELEC 3004: Systems: Signals & ControlsDr. Surya Singh (with material from Dr. Paul Pounds and from Prof. Mark Cannon (Oxford Discrete Systems))

Lecture 21

[email protected]://robotics.itee.uq.edu.au/~elec3004/

© 2013 School of Information Technology and Electrical Engineering at The University of Queensland

May 17, 2013

Next Time in Linear Systems ….

ELEC 3004: Systems 17 May 2013 - 2

Week Date Lecture Title

127-FebIntroduction1-MarSystems Overview

26-MarSignals & Signal Models8-MarSystem Models

313-MarLinear Dynamical Systems15-MarSampling & Data Acquisition

420-MarTime Domain Analysis of Continuous Time Systems22-MarSystem Behaviour & Stability

527-MarSignal Representation29-MarHoliday

610-AprFrequency Response12-Aprz-Transform

717-AprNoise & Filtering19-AprAnalog Filters

824-AprDiscrete-Time Signals26-AprDiscrete-Time Systems

91-MayDigital Filters & IIR/FIR Systems3-MayFourier Transform & DTFT

108-MayIntroduction to Digital Control

10-MayStability of Digital Systems

11 15-MayPID & Computer Control17-MayApplications in Industry

1222-MayState-Space24-MayControllability & Observability

1329-MayInformation Theory/Communications & Review31-MaySummary and Course Review

Page 2: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

2

• Stability of Digital Systems

• Lead/Lag Compensators

• ZOH and Discretisation

Today:

• Stability

• Design tricks

ELEC 3004: Systems 17 May 2013 - 3

Goals for the Week

(ZOH)=??? : What is it?

• Lathi

• Franklin, Powell, Workman

• Franklin, Powell, Emani-Naeini

• Dorf & Bishop

• Oxford Discrete Systems: (Mark Cannon)

• MIT 6.002 (Russ Tedrake)

• Matlab

Proof!

ELEC 3004: Systems 17 May 2013 - 4

• Wikipedia

Page 3: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

3

• Assume that the signal x(t) is zero for t<0, then the outputh(t) is related to x(t) as follows:

Zero-order-hold (ZOH)x(t) x(kT) h(t)Zero-order

HoldSampler

17 May 2013 -ELEC 3004: Systems 5

• Recall the Laplace Transforms ( ) of:

• Thus the of h(t) becomes:

ELEC 3004: Systems 17 May 2013 - 6

Transfer function of Zero-order-hold (ZOH)

Page 4: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

4

… Continuing the of h(t) …

Thus, giving the transfer function as:

ELEC 3004: Systems 17 May 2013 - 7

Transfer function of Zero-order-hold (ZOH)

Lead/lag compensation• Serve different purposes, but have a similar dynamic structure:

Note:Lead-lag compensators come from the days when control engineers cared about constructing controllers from networks of op amps using frequency-phase methods. These days pretty much everybody uses PID, but you should at least know what the heck they are in case someone asks.

17 May 2013 -ELEC 3004: Systems 8

Page 5: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

5

Lead compensation: a < b

• Acts to decrease rise-time and overshoot– Zero draws poles to the left; adds phase-lead– Pole decreases noise

• Set a near desired ; set b at ~3 to 20x a

Img(s)

Re(s)

Faster than system dynamics

Slow open-loop plant dynamics

-a-b

17 May 2013 -ELEC 3004: Systems 9

Lag compensation: a > b

• Improves steady-state tracking– Near pole-zero cancellation; adds phase-lag– Doesn’t break dynamic response (too much)

• Set b near origin; set a at ~3 to 10x b

Img(s)

Re(s)

Very slow

plant dynamics

-a -b

Close to pole

17 May 2013 -ELEC 3004: Systems 10

Page 6: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

6

1. Derive the dynamic system model ODE2. Convert it to a continuous transfer function3. Design a continuous controller4. Convert the controller to the z-domain5. Implement difference equations in software

Emulation design process

Img(s)

Re(s)

Img(s)

Re(s)

Img(z)

Re(z)

17 May 2013 -ELEC 3004: Systems 11

Recap: Emulation Design Method 1: Tustin’s method• Tustin uses a trapezoidal integration approximation (compare

Euler’s rectangles)• Integral between two samples treated as a straight line:

1Taking the derivative, then z-transform yields:

which can be substituted into continuous models

1

x(tk)

x(tk+1)

17 May 2013 -ELEC 3004: Systems 12

Page 7: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

7

Recap: Emulation Design Method 2: Matched pole-zero• If , why can’t we just make a direct substitution and go

home?

• Kind of!– Still an approximation– Produces quasi-causal system (hard to compute)– Fortunately, also very easy to calculate.

17 May 2013 -ELEC 3004: Systems 13

Matched pole-zeroThe process:

1. Replace continuous poles and zeros with discrete equivalents:

2. Scale the discrete system DC gain to match the continuous system DC gain

3. If the order of the denominator is higher than the enumerator, multiply the numerator by 1 until they are of equal order*

* This introduces an averaging effect like Tustin’s method

17 May 2013 -ELEC 3004: Systems 14

Page 8: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

8

Modified matched pole-zero• We’re prefer it if we didn’t require instant calculations to

produce timely outputs• Modify step 2 to leave the dynamic order of the numerator one

less than the denominator– Can work with slower sample times, and at higher frequencies

17 May 2013 -ELEC 3004: Systems 15

• Handy rules of thumb:– Sample rates can be as low as twice the system bandwidth

• but 5 to 10× for “stability”• 20 to 30 × for better performance

– A zero at 1 makes the discrete root locus pole behaviour more closely match the s-plane

– Beware “dirty derivatives”• ⁄ terms derived from sequential digital values are called ‘dirty

derivatives’ – these are especially sensitive to noise!• Employ actual velocity measurements when possible

Discrete design process

17 May 2013 -ELEC 3004: Systems 16

Page 9: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

9

ELEC 3004: Systems 17 May 2013 - 17

Designing in the Purely Discrete…

ELEC 3004: Systems 17 May 2013 - 18

Direct Design:Second Order Digital Systems

Page 10: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

10

ELEC 3004: Systems 17 May 2013 - 19

Response of 2nd order system [1/3]

ELEC 3004: Systems 17 May 2013 - 20

Response of 2nd order system [2/3]

Page 11: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

11

ELEC 3004: Systems 17 May 2013 - 21

Response of 2nd order system [3/3]

• Response of a 2nd order system to increasing levels of damping:

ELEC 3004: Systems 17 May 2013 - 22

2nd Order System Response

Page 12: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

12

Damping and natural frequency

[Adapted from Franklin, Powell and Emami-Naeini]-1.0 -0.8 -0.6 -0.4 0-0.2 0.2 0.4 0.6 0.8 1.00

0.2

0.4

0.6

0.8

1.0

Re(z)

Img(z)

where 1

0.1

0.2

0.3

0.4

0.50.6

0.7

0.8

0.9

235

710

910

25

1

25

0

310

5

10

20

17 May 2013 -ELEC 3004: Systems 23

• Poles inside the unit circleare stable

• Poles outside the unit circleunstable

• Poles on the unit circleare oscillatory

• Real poles at 0 < z < 1give exponential response

• Higher frequency ofoscillation for larger

• Lower apparent dampingfor larer and r

ELEC 3004: Systems 17 May 2013 - 24

Pole positions in the z-plane

Page 13: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

13

Characterizing the step response:

ELEC 3004: Systems 17 May 2013 - 25

2nd Order System Specifications

• Rise time (10% 90%):

• Overshoot:

• Settling time (to 1%):

• Steady state error to unit step: ess

• Phase margin:

Characterizing the step response:

ELEC 3004: Systems 17 May 2013 - 26

2nd Order System Specifications

• Rise time (10% 90%) & Overshoot: tr, Mp ζ, ω0 : Locations of dominant poles

• Settling time (to 1%): ts radius of poles:

• Steady state error to unit step: ess final value theorem

Page 14: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

14

Design a controller for a system with:• A continuous transfer function:• A discrete ZOH sampler • Sampling time (Ts): Ts= 1s• Controller:

The closed loop system is required to have:• Mp < 16%• ts < 10 s• ess < 1

ELEC 3004: Systems 17 May 2013 - 27

Ex: System Specifications Control Design [1/4]

ELEC 3004: Systems 17 May 2013 - 28

Ex: System Specifications Control Design [2/4]

Page 15: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

15

ELEC 3004: Systems 17 May 2013 - 29

Ex: System Specifications Control Design [3/4]

ELEC 3004: Systems 17 May 2013 - 30

Ex: System Specifications Control Design [4/4]

Page 16: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

16

ELEC 3004: Systems 17 May 2013 - 31

LTID Stability

ELEC 3004: Systems 17 May 2013 - 32

Characteristic roots location and the corresponding characteristic modes [1/2]

Page 17: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

17

ELEC 3004: Systems 17 May 2013 - 33

Characteristic roots location and the corresponding characteristic modes [2/2]

ELEC 3004: Systems 17 May 2013 - 34

S-Plane to z-Plane [1/2]

Page 18: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

18

ELEC 3004: Systems 17 May 2013 - 35

S-Plane to z-Plane [2/2]

ELEC 3004: Systems 17 May 2013 - 36

Relationship with s-plane poles and z-plane transforms

Page 19: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

19

• For small T:

• Hence, the unit circle under the map from z to s-plane becomes:

ELEC 3004: Systems 17 May 2013 - 37

Fast sampling revisited

Specification bounds• Recall in the continuous domain, response performance

metrics map to the s-plane:

Img(s)

Re(s)

4.6

Img(s)

Re(s)

sin

Img(s)

Re(s)

1.8

17 May 2013 -ELEC 3004: Systems 38

Page 20: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

20

• These map to the discrete domain:

In practice, you’d use Matlab to plot these, and check that the spec is satisfied

Discrete bounds

Img(z)

Re(z)

Img(z)

Re(z)

Img(z)

Re(z)

17 May 2013 -ELEC 3004: Systems 39

• This code was shown “by accident” in class during a MATLAB demo. No promises are made for it. It alone is not a solution to Question 7.

%% Input System Model G

numg=5; deng=[1 20 0]; sysg=tf(numg, deng);

%% Approximate the ZOH (1-e^-sT)/(s)

[nd, dd]=pade(1,2); %pade gives us the "hold" or -e^-sT of a ZOH

sysp=tf(nd, dd); sysi=tf([1],[1,0]); %Now we need the "1/s" portion

sys1=series(1-sysp, sysi); % Approximation as a series

%% Open loop response

syso=series(sys1, sysg); % computer the open loop G with the ZOH

sys=feedback(syso,1); % Computer the unity feedback response

step(sys) % Display the step response

ELEC 3004: Systems 17 May 2013 - 40

Example Code:

Page 21: Next Time in Linear Systemsrobotics.itee.uq.edu.au/~elec3004/2013/lectures/... · L A æ Í, why can’t we just make a direct substitution and go home? Ò : æ ; Ñ : æ ; L æ >

21

• Final Exam:– 15 Questions (60% Short Answer, 40% Regular Problems)– 3 Hours– Closed-book– Took tutor ~90min to complete– Equation sheet will be provided (in addition to your own)

[See Prac Final – Coming out next week]– Yes, it has an unexpected twist at the end, but you’ll like it.

Saturday, June 15 at 9:30 AM (sorry!)

ELEC 3004: Systems 17 May 2013 - 41

Announcements:

!

Next Time in Linear Systems ….

ELEC 3004: Systems 17 May 2013 - 42

Week Date Lecture Title

127-FebIntroduction1-MarSystems Overview

26-MarSignals & Signal Models8-MarSystem Models

313-MarLinear Dynamical Systems15-MarSampling & Data Acquisition

420-MarTime Domain Analysis of Continuous Time Systems22-MarSystem Behaviour & Stability

527-MarSignal Representation29-MarHoliday

610-AprFrequency Response12-Aprz-Transform

717-AprNoise & Filtering19-AprAnalog Filters

824-AprDiscrete-Time Signals26-AprDiscrete-Time Systems

91-MayDigital Filters & IIR/FIR Systems3-MayFourier Transform & DTFT

108-MayIntroduction to Digital Control

10-MayStability of Digital Systems

1115-MayPID & Computer Control17-MayApplications in Industry

12 22-MayState-Space24-MayControllability & Observability

1329-MayInformation Theory/Communications & Review31-MaySummary and Course Review