State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3....

32
1 State-Space ELEC 3004: Systems: Signals & Controls Dr. Surya Singh (with material from Dr. Paul Pounds) Lecture 22 [email protected] http://robotics.itee.uq.edu.au/~elec3004/ © 2013 School of Information Technology and Electrical Engineering at The University of Queensland May 22, 2013 Today in Linear Systems… ELEC 3004: Systems 22 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-May PID & Computer Control 17-May Applications in Industry 12 22-MayState-Space 24-May Controllability & Observability 13 29-MayInformation Theory/Communications & Review 31-MaySummary and Course Review

Transcript of State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3....

Page 1: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

1

State-Space

ELEC 3004: Systems: Signals & ControlsDr. Surya Singh (with material from Dr. Paul Pounds)

Lecture 22

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

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

May 22, 2013

Today in Linear Systems…

ELEC 3004: Systems 22 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

1115-MayPID & Computer Control17-MayApplications in Industry

12 22-MayState-Space24-MayControllability & Observability

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

Page 2: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

2

Today:• State-Space

• Compensator Design

Friday:• Controllability

• Observability

ELEC 3004: Systems 22 May 2013 - 3

Goals for the Week

• More general mathematical model – MIMO, time-varying, nonlinear

• Matrix notation (think LAPACK MATLAB)• Good for discrete systems• More design tools!

Or more aptly…

Welcome to

State-Space!( It be stated -- Hallelujah ! )

22 May 2013 -ELEC 3004: Systems 4

Page 3: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

3

Affairs of state• Introductory brain-teaser:

– If you have a dynamic system model with history (ie. integration) how do you represent the instantaneous state of the plant?

Eg. how would you setup a simulation of a step response, mid-step?

t = 0t

start

22 May 2013 -ELEC 3004: Systems 5

Introduction to state-space• Linear systems can be written as networks of simple dynamic

elements:

2

7 1224

13

7

1

12

2

u y

22 May 2013 -ELEC 3004: Systems 6

Page 4: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

4

Introduction to state-space• We can identify the nodes in the system

– These nodes contain the integrated time-history values of the system response

– We call them “states”

7

1

12

2

u yx1 x2

22 May 2013 -ELEC 3004: Systems 7

Linear system equations• We can represent the dynamic relationship between the states

with a linear system:

7 12 0 0

2 0

22 May 2013 -ELEC 3004: Systems 8

Page 5: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

5

State-space representation• We can write linear systems in matrix form:

7 121 0

10

1 2 0

Or, more generally:

“State-space equations”

22 May 2013 -ELEC 3004: Systems 9

1. Choose all independent capacitor voltages and inductor currents to be the state variables.

2. Choose a set of loop currents; express the state variables and their first derivatives in terms of these loop currents.

3. Write loop equations, and eliminate all variables other than state variables (and their first derivatives) from the equations derived in steps 2 and 3.

ELEC 3004: Systems 22 May 2013 - 10

A Procedure for Determining State Equationsin Electrical Circuits

Page 6: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

6

1. The inductor current q1 and the capacitor voltage q2 as the state variables.

2.

3.

ELEC 3004: Systems 22 May 2013 - 11

A Quick Example

ELEC 3004: Systems 22 May 2013 - 12

Another Example

Page 7: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

7

ELEC 3004: Systems 22 May 2013 - 13

Another Example

• N1(t)=N1(0)exp(-λ1t)

ELEC 3004: Systems 22 May 2013 - 14

Another Example

Page 8: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

8

State-space representation• State-space matrices are not necessarily a unique

representation of a system– There are two common forms

• Control canonical form– Each node – each entry in x – represents a state of the system

(each order of s maps to a state)

• Modal form– Diagonals of the state matrix A are the poles (“modes”) of the

transfer function

22 May 2013 -ELEC 3004: Systems 15

Control canonical form

• CCF matrix representations have the following structure:

⋯1 0 0 0 00 1⋮ ⋱ ⋮

1 0 00 0 ⋯ 0 1 0

Pretty diagonal!

22 May 2013 -ELEC 3004: Systems 16

Page 9: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

9

State variable transformation• Important note!

– The states of a control canonical form system are not the same as the modal states

– They represent the same dynamics, and give the same output, but the vector values are different!

• However we can convert between them:– Consider state representations, x and q where

x = Tq

T is a “transformation matrix”

22 May 2013 -ELEC 3004: Systems 17

State variable transformation• Two homologous representations:

and

We can write:

Therefore, and

Similarly, and

22 May 2013 -ELEC 3004: Systems 18

Page 10: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

10

Controllability matrix

• To convert an arbitrary state representation in F, G, H and J to control canonical form A, B, C and D, the “controllability matrix”

⋯must be nonsingular.

Why is it called the “controllability” matrix?

22 May 2013 -ELEC 3004: Systems 19

Controllability matrix

• If you can write it in CCF, then the system equations must be linearly independent.

• Transformation by any nonsingular matrix preserves the controllability of the system.

• Thus, a nonsingular controllability matrix means x can be driven to any value.

22 May 2013 -ELEC 3004: Systems 20

Page 11: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

11

Why is this “Kind of awesome”?• The controllability of a system depends on the particular set of

states you chose

• You can’t tell just from a transfer function whether all the states of x are controllable

• The poles of the system are the Eigenvalues of F, ( ).

22 May 2013 -ELEC 3004: Systems 21

State evolution• Consider the system matrix relation:

The time solution of this system is:

If you didn’t know, the matrix exponential is:12!

13!

22 May 2013 -ELEC 3004: Systems 22

Page 12: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

12

Stability• We can solve for the natural response to initial conditions :

Clearly, a system will be stable provided eig 0

22 May 2013 -ELEC 3004: Systems 23

Characteristic polynomial

• From this, we can see or, I 0

which is true only when det I 0Aka. the characteristic equation!

• We can reconstruct the CP in s by writing:det I 0

22 May 2013 -ELEC 3004: Systems 24

Page 13: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

13

Great, so how about control?• Given , if we know and , we can design a

controller such thateig 0

• In fact, if we have full measurement and control of the states of , we can position the poles of the system in arbitrary locations!

(Of course, that never happens in reality.)

22 May 2013 -ELEC 3004: Systems 25

Example: PID control• Consider a system parameterised by three states:

– , ,– where and

=1

12

0 1 0 0

is the output state of the system; is the value of the integral;

is the velocity.

22 May 2013 -ELEC 3004: Systems 26

Page 14: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

14

• We can choose to move the eigenvalues of the system as desired:

det1

12

All of these eigenvalues must be positive.

It’s straightforward to see how adding derivative gain can stabilise the system.

22 May 2013 -ELEC 3004: Systems 27

Just scratching the surface

• There is a lot of stuff to state-space control

• One lecture (or even two) can’t possibly cover it all in depth

Go play with Matlab and check it out!

22 May 2013 -ELEC 3004: Systems 28

Page 15: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

15

Discretisation FTW!• We can use the time-domain representation to produce

difference equations!

Notice is not based on a discrete ZOH input, but rather an integrated time-series.We can structure this by using the form:

,

22 May 2013 -ELEC 3004: Systems 29

Discretisation FTW!• Put this in the form of a new variable:

Then:

Let’s rename and

22 May 2013 -ELEC 3004: Systems 30

Page 16: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

16

Discrete state matricesSo,

1

Again, 1 is shorthand for

Note that we can also write as:

where

2! 3!⋯

22 May 2013 -ELEC 3004: Systems 31

Simplifying calculation• We can also use to calculate

– Note that:

Γ1 !

itself can be evaluated with the series:

≅2 3

⋯1

22 May 2013 -ELEC 3004: Systems 32

Page 17: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

17

State-space z-transformWe can apply the z-transform to our system:

which yields the transfer function:

22 May 2013 -ELEC 3004: Systems 33

State-space control design

• Design for discrete state-space systems is just like the continuous case.– Apply linear state-variable feedback:

such that detwhere is the desired control characteristic equation

Predictably, this requires the system controllability matrix ⋯ to be full-rank.

22 May 2013 -ELEC 3004: Systems 34

Page 18: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

18

2nd Order System Response

22 May 2013 -ELEC 3004: Systems 35

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

ELEC 3004: Systems 22 May 2013 - 36

2nd Order System Response

Page 19: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

19

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

22 May 2013 -ELEC 3004: Systems 37

• 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 22 May 2013 - 38

Pole positions in the z-plane

Page 20: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

20

Characterizing the step response:

ELEC 3004: Systems 22 May 2013 - 39

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 22 May 2013 - 40

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 21: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

21

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 22 May 2013 - 41

Ex: System Specifications Control Design [1/4]

ELEC 3004: Systems 22 May 2013 - 42

Ex: System Specifications Control Design [2/4]

Page 22: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

22

ELEC 3004: Systems 22 May 2013 - 43

Ex: System Specifications Control Design [3/4]

ELEC 3004: Systems 22 May 2013 - 44

Ex: System Specifications Control Design [4/4]

Page 23: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

23

Approximation Methods

22 May 2013 -ELEC 3004: Systems 45

Euler’s method*• Dynamic systems can be approximated† by recognising that:

≅1

T

x(tk)

x(tk+1)

*Also known as the forward rectangle rule†Just an approximation – more on this later

• As → 0, approximation error approaches 0

22 May 2013 -ELEC 3004: Systems 46

Page 24: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

24

Euler’s method• Euler approximation can produce a system z-transform directly• Use the substitution:

1

22 May 2013 -ELEC 3004: Systems 47

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)

22 May 2013 -ELEC 3004: Systems 48

Page 25: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

25

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.

22 May 2013 -ELEC 3004: Systems 49

Matched pole-zero• The 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

22 May 2013 -ELEC 3004: Systems 50

Page 26: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

26

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

22 May 2013 -ELEC 3004: Systems 51

Approximation comparison• We’ve been making a lot of approximations

– Just how goods are these approximations?– As you might expect, it depends on how closely T matches the

bandwidth of the system– Also varies by order of the approximation

Let’s consider the system

sampled at 10 Hz

22 May 2013 -ELEC 3004: Systems 52

Page 27: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

27

Approximation comparison

• .

. .

•. .

. .

•. . .

. .

•.

. .

• .

. .

*FOH: First Order Hold ‘triangle approximation’

22 May 2013 -ELEC 3004: Systems 53

Approximation comparison

All approximations give good results for /4

22 May 2013 -ELEC 3004: Systems 54

Page 28: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

28

∴ Effect of ZOH delay• Recall the intrinsic time-delay associated with ZOH? What

about that?• This is the discrete domain; we can model the delay exactly:

1

This can be thought of a as a step input, followed by an immediate negative step one sample time later

22 May 2013 -ELEC 3004: Systems 55

LTID Stability

22 May 2013 -ELEC 3004: Systems 56

Page 29: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

29

ELEC 3004: Systems 22 May 2013 - 57

LTID Stability

ELEC 3004: Systems 22 May 2013 - 58

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

Page 30: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

30

ELEC 3004: Systems 22 May 2013 - 59

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

ELEC 3004: Systems 22 May 2013 - 60

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

Page 31: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

31

ELEC 3004: Systems 22 May 2013 - 61

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

ELEC 3004: Systems 22 May 2013 - 62

Relationship with s-plane poles and z-plane transforms

Page 32: State-Space...1. The inductor current q1 and the capacitor voltage q2 as the state variables. 2. 3. ELEC 3004: Systems 22 May 2013 - 11 A Quick Example • • • • ELEC 3004: Systems

32

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

• Problem Set 2 is due this Friday!

ELEC 3004: Systems 22 May 2013 - 63

Announcements:

!

• AKA: I can see that. Yes, I can control that!

ELEC 3004: Systems 22 May 2013 - 64

Next Time in Linear Systems ….1

27-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

1222-MayState-Space

24-MayControllability & Observability13

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