uq robotics teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/l11-state-space.pdf · • more...

29
1 State-Space © 2014 School of Information Technology and Electrical Engineering at The University of Queensland http://elec3004.com Lecture Schedule: Week Date Lecture Title 1 4-Mar Introduction & Systems Overview 6-Mar [Linear Dynamical Systems] 2 11-Mar Signals as Vectors & Systems as Maps 13-Mar [Signals] 3 18-Mar Sampling & Data Acquisition & Antialiasing Filters 20-Mar [Sampling] 4 25-Mar System Analysis & Convolution 27-Mar [Convolution & FT] 5 1-Apr Frequency Response & Filter Analysis 3-Apr [Filters] 6 8-Apr Discrete Systems & Z-Transforms 10-Apr [Z-Transforms] 7 15-Apr Introduction to Digital Control 17-Apr [Feedback] 8 29-Apr Digital Filters 1-May [Digital Filters] 9 6-May Digital Control Design 8-May [Digitial Control] 10 13-May Stability of Digital Systems 15-May [Stability] 11 20-May State-Space 22-May Controllability & Observability 12 27-May PID Control & System Identification 29-May Digitial Control System Hardware 13 3-Jun Applications in Industry & Information Theory & Communications 5-Jun Summary and Course Review 20 May 2014 - ELEC 3004: Systems 2

Upload: others

Post on 31-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

1

State-Space

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

TexPoint fonts used in EMF.

Read the TexPoint manual before you delete this box.: AAAAA

http://elec3004.com

Lecture Schedule: Week Date Lecture Title

1 4-Mar Introduction & Systems Overview

6-Mar [Linear Dynamical Systems]

2 11-Mar Signals as Vectors & Systems as Maps

13-Mar [Signals]

3 18-Mar Sampling & Data Acquisition & Antialiasing Filters

20-Mar [Sampling]

4 25-Mar System Analysis & Convolution

27-Mar [Convolution & FT]

5 1-Apr Frequency Response & Filter Analysis

3-Apr [Filters]

6 8-Apr Discrete Systems & Z-Transforms

10-Apr [Z-Transforms]

7 15-Apr Introduction to Digital Control

17-Apr [Feedback]

8 29-Apr Digital Filters

1-May [Digital Filters]

9 6-May Digital Control Design

8-May [Digitial Control]

10 13-May Stability of Digital Systems

15-May [Stability]

11 20-May State-Space 22-May Controllability & Observability

12 27-May PID Control & System Identification

29-May Digitial Control System Hardware

13 3-Jun Applications in Industry & Information Theory & Communications

5-Jun Summary and Course Review

20 May 2014 - ELEC 3004: Systems 2

Page 2: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

2

• Final Exam Logistics: – Saturday 21/6/2014 at 4:30pm

– Location: TBA

– Closed-book

– Practice exam will be posted by the end of the week.

Announcements:

!

20 May 2014 - ELEC 3004: Systems 3

Lab 3

20 May 2014 - ELEC 3004: Systems 4

Page 3: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

3

• 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 ! )

20 May 2014 - ELEC 3004: Systems 5

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 = 0 t

start

20 May 2014 - ELEC 3004: Systems 6

Page 4: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

4

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

elements:

𝐻 = 𝑠 + 2

𝑠2 + 7𝑠 + 12=

2

𝑠 + 4+

−1

𝑠 + 3

S 1𝑠

1𝑠 S

−7

1

−12

2

S

u y

20 May 2014 - ELEC 3004: Systems 7

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”

S 1𝑠

1𝑠 S

−7

1

−12

2

S

u y x1 x2

20 May 2014 - ELEC 3004: Systems 8

Page 5: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

5

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

with a linear system:

𝑥1 = −7𝑥1 − 12𝑥2 + 𝑢

𝑥2 = 𝑥1 + 0𝑥2 + 0𝑢

𝑦 = 𝑥1 + 2𝑥2 + 0𝑢

20 May 2014 - ELEC 3004: Systems 9

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

𝒙 =−7 121 0

𝒙 +10𝑢

𝒚 = 1 2 𝒙 + 0𝑢

Or, more generally:

𝒙 = 𝐀𝒙 + 𝐁𝑢

𝑦 = 𝐂𝒙 + 𝐷𝑢

“State-space

equations”

20 May 2014 - ELEC 3004: Systems 10

Page 6: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

6

• u: Input:

• x: State:

• y: Output

State-Space Terminology

20 May 2014 - ELEC 3004: Systems 11

State-Space Terminology

20 May 2014 - ELEC 3004: Systems 12

Page 7: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

7

• If the system is linear and time invariant,

then A,B,C,D are constant coefficient

LTI State-Space

20 May 2014 - ELEC 3004: Systems 13

• If the system is discrete,

then x and u are given by difference equations

Discrete Time State-Space

20 May 2014 - ELEC 3004: Systems 14

Page 8: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

8

• Series:

Block Diagram Algebra in State Space

20 May 2014 - ELEC 3004: Systems 15

• Parallel:

Block Diagram Algebra in State Space

20 May 2014 - ELEC 3004: Systems 16

Page 9: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

9

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

20 May 2014 - ELEC 3004: Systems 17

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.

A Procedure for Determining State Equations in Electrical Circuits

20 May 2014 - ELEC 3004: Systems 18

Page 10: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

10

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

2.

3.

A Quick Example

20 May 2014 - ELEC 3004: Systems 19

Another Example

20 May 2014 - ELEC 3004: Systems 20

Page 11: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

11

Another Example

20 May 2014 - ELEC 3004: Systems 21

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

Another Example

20 May 2014 - ELEC 3004: Systems 22

Page 12: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

12

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

20 May 2014 - ELEC 3004: Systems 23

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”

𝓒 = 𝐆 𝐅𝐆 𝐅2𝐆 ⋯ 𝐅𝑛−1𝐆

must be nonsingular.

Why is it called the “controllability” matrix?

20 May 2014 - ELEC 3004: Systems 26

Page 13: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

13

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.

20 May 2014 - ELEC 3004: Systems 27

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, (𝑝𝑖).

20 May 2014 - ELEC 3004: Systems 28

Page 14: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

14

State evolution • Consider the system matrix relation:

𝒙 = 𝐅𝒙 + 𝐆𝑢

𝑦 = 𝐇𝒙 + 𝐽𝑢

The time solution of this system is:

𝒙 𝑡 = 𝑒𝐅 𝑡−𝑡0 𝒙 𝑡0 + = 𝑒𝐅 𝑡−𝜏 𝐆𝑢 𝜏 𝑑𝜏𝑡

𝑡0

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

𝑒𝐊𝑡 = 𝐈 + 𝐊𝑡 +1

2!𝐊2𝑡2 +

1

3!𝐊3𝑡3 +⋯

20 May 2014 - ELEC 3004: Systems 29

Great, so how about control? • Given 𝒙 = 𝐅𝒙 + 𝐆𝑢, if we know 𝐅 and 𝐆, we can design a

controller 𝑢 = −𝐊𝒙 such that

eig 𝐅 − 𝐆𝐊 < 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.)

20 May 2014 - ELEC 3004: Systems 30

Page 15: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

15

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

– 𝑥1, 𝑥2, 𝑥3

– where 𝑥2 = 𝑥 1 and 𝑥3 = 𝑥 2

𝒙 =1

1−2

𝒙 − 𝐊𝑢

𝑦 = 0 1 0 𝒙 + 0𝑢

𝑥2is the output state of the system;

𝑥1is the value of the integral;

𝑥3 is the velocity.

20 May 2014 - ELEC 3004: Systems 31

• We can choose 𝐊 to move the eigenvalues of the system

as desired:

det

1 − 𝐾11 −𝐾2

−2 − 𝐾3

= 𝟎

All of these eigenvalues must be positive.

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

20 May 2014 - ELEC 3004: Systems 32

Page 16: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

16

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!

20 May 2014 - ELEC 3004: Systems 33

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:

𝑢 𝜏 = 𝑢 𝑘𝑇 , 𝑘𝑇 ≤ 𝜏 ≤ 𝑘𝑇 + 𝑇

20 May 2014 - ELEC 3004: Systems 34

Page 17: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

17

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

𝜂 = 𝑘𝑇 + 𝑇 − 𝜏

Then:

𝒙 𝑘𝑇 + 𝑇 = 𝑒𝑭𝑇𝒙 𝑘𝑇 + 𝑒𝑭𝜂𝑑𝜂𝑘𝑇+𝑇

𝑘𝑇

𝑮𝑢 𝑘𝑇

Let’s rename 𝚽 = 𝑒𝑭𝑇 and 𝚪 = 𝑒𝑭𝜂𝑑𝜂𝑘𝑇+𝑇

𝑘𝑇𝑮

20 May 2014 - ELEC 3004: Systems 35

Discrete state matrices So,

𝒙 𝑘 + 1 = 𝚽𝒙 𝑘 + 𝚪𝑢 𝑘 𝑦 𝑘 = 𝐇𝒙 𝑘 + 𝐉𝒖 𝑘

Again, 𝒙 𝑘 + 1 is shorthand for 𝒙 𝑘𝑇 + 𝑇

Note that we can also write 𝚽 as:

𝚽 = 𝐈 + 𝐅𝑇𝚿

where

𝚿 = 𝐈 +𝐅𝑇

2!+𝐅2𝑇2

3!+⋯

20 May 2014 - ELEC 3004: Systems 36

Page 18: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

18

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

𝑧𝐈 − 𝚽 𝑿 𝑧 = 𝚪𝑈 𝑘 𝑌 𝑧 = 𝐇𝑿 𝑧

which yields the transfer function: 𝑌 𝑧

𝑿(𝑧)= 𝐺 𝑧 = 𝐇 𝑧𝐈 −𝚽 −𝟏𝚪

20 May 2014 - ELEC 3004: Systems 37

State-space control design ¿¿¿Que pasa????

• Design for discrete state-space systems is just like the

continuous case. – Apply linear state-variable feedback:

𝑢 = −𝐊𝒙

such that det(𝑧𝐈 − 𝚽 + 𝚪𝐊) = 𝛼𝑐(𝑧) where 𝛼𝑐(𝑧) is the desired control characteristic equation

Predictably, this requires the system controllability matrix

𝓒 = 𝚪 𝚽𝚪 𝚽2𝚪 ⋯ 𝚽𝑛−1𝚪 to be full-rank.

20 May 2014 - ELEC 3004: Systems 38

Page 19: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

19

• Recall:

• For Linear Systems:

• For LTI:

Solving State Space…

20 May 2014 - ELEC 3004: Systems 39

• In the conventional, frequency-domain approach the

differential equations are converted to transfer functions as

soon as possible – The dynamics of a system comprising several subsystems is

obtained by combining the transfer functions!

• With the state-space methods, on the other hand, the

description of the system dynamics in the form of differential

equations is retained throughout the analysis and design.

Solving State Space

20 May 2014 - ELEC 3004: Systems 40

Page 20: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

20

• Describes how the state x(t) of the system at some time t

evolves into (or from) the state x(τ) at some other time T.

State-transition matrix Φ(t)

20 May 2014 - ELEC 3004: Systems 41

Solving State Space…

20 May 2014 - ELEC 3004: Systems 42

Page 21: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

21

Solving State Space

20 May 2014 - ELEC 3004: Systems 43

Solving State Space

20 May 2014 - ELEC 3004: Systems 44

Page 22: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

22

Solving State Space

20 May 2014 - ELEC 3004: Systems 45

Solving State Space

20 May 2014 - ELEC 3004: Systems 46

Page 23: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

23

Solving State Space

20 May 2014 - ELEC 3004: Systems 47

• Difference equations in state-space form:

• Where: – u[n], y[n]: input & output (scalars)

– x[n]: state vector

Digital State Space: Recall from the Last Episode …

20 May 2014 - ELEC 3004: Systems 48

Page 24: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

24

Digital Control Law Design

20 May 2014 - ELEC 3004: Systems 49

•Yes Can you use this for more than Control?

20 May 2014 - ELEC 3004: Systems 50

Page 25: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

25

The Approach:

• Formulate the goal of control as an optimization (e.g. minimal impulse response,

minimal effort, ...).

• You’ve already seen some examples of optimization-based design: – Used least-squares to obtain an FIR system which matched (in the least-squares sense)

the desired frequency response.

– Poles/zeros lecture: Butterworth filter

Frequency Response in State Space

20 May 2014 - ELEC 3004: Systems 51

Discrete Time Butterworth Filters

20 May 2014 - ELEC 3004: Systems 52

Page 26: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

26

20 May 2014 - ELEC 3004: Systems 53

20 May 2014 - ELEC 3004: Systems 54

Page 27: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

27

20 May 2014 - ELEC 3004: Systems 55

20 May 2014 - ELEC 3004: Systems 56

Page 28: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

28

20 May 2014 - ELEC 3004: Systems 57

20 May 2014 - ELEC 3004: Systems 58

Page 29: UQ Robotics Teachingrobotics.itee.uq.edu.au/~elec3004/2014/lectures/L11-State-Space.pdf · • More design tools! Or more aptly… Welcome to State-Space! ( It be stated -- Hallelujah

29

• Constrained Least-Squares …

How?

20 May 2014 - ELEC 3004: Systems 59