matlab tutorial for state space analysis and system identification

20
Matlab Tutorial for State Space Analysis and System Identification Vibha Prasad

Upload: lenard-shields

Post on 08-Jan-2018

228 views

Category:

Documents


2 download

DESCRIPTION

CS 851 Feedback Control of Computing Systems Overview Review of Chapter 7 Review of Chapter 10 Examples Followed in the Tutorial Specifying LTI systems with space-state models System response System Analysis Controller Design Tools System identification

TRANSCRIPT

Page 1: Matlab Tutorial for State Space Analysis and System Identification

Matlab Tutorial for State Space Analysisand System Identification

Vibha Prasad

Page 2: Matlab Tutorial for State Space Analysis and System Identification

2

Overview

Review of Chapter 7 Review of Chapter 10 Examples Followed in the Tutorial Specifying LTI systems with space-state models System response System Analysis Controller Design Tools System identification

Page 3: Matlab Tutorial for State Space Analysis and System Identification

3

Chapter 7 Review

State space models: Scalable approach to model MIMO systems

State vector: x(k)

State Model equations:x(k +1) = Ax(k) + Bu(k)

y(k) = Cx(k)

Page 4: Matlab Tutorial for State Space Analysis and System Identification

4

Chapter 7 Review (Contd.)

System Analysis– Characteristic polynomial, det(zI – A)– Poles = eigenvalues of A– Steady-state Gain = C(I - A)-1B

Equivalence: w(k) = Tx(k) w(k + 1) = (TAT-1)w(k) + (TB)u(k)y(k) = (CT-1)w(k)

Page 5: Matlab Tutorial for State Space Analysis and System Identification

5

Chapter 7 Review (Contd.)

Controllability: system can be driven to an arbitrary state by properly choosing a set of inputs.– C = [ An-1B An-2B . . . AB B ] – System controllable if controllability matrix C is

invertible Observability: all the state can be inferred

from its outputs.– O = [ CAn-1 CAn-2 . . . CA C ] – System observable if observability matrix O is

invertible

Page 6: Matlab Tutorial for State Space Analysis and System Identification

6

Chapter 10 Review

State Feedback Architecture– Static state feedback

Similar to proportional control Does not include a reference point

– Static state feedback with precompensation Can track reference points Poor disturbance rejection

– Dynamic state feedback Similar to PI control for SISO systems Can track reference input and reject disturbance

I(k)I(k)

x Ku

(k)P

xK

(k)(k)u Kx

rNu kk )()( Kx

Page 7: Matlab Tutorial for State Space Analysis and System Identification

7

Chapter 10 Review (Contd.)

State feedback controller design– Pole placement

Specify max settling time and overshoot (ks* and Mp*) Obtain desired dominant poles of the closed –loop

system– Ks* = - 4/ log(|r|)– Mp* = eπ/|θ|

Construct the desired characteristic polynomial– Other poles should have magnitude less than 0.25r

Construct the modeled characteristic equation Equate coefficients of the desired and modeled

characteristic polynomial and calculate gains

Page 8: Matlab Tutorial for State Space Analysis and System Identification

8

Chapter 10 Review (Contd.)

State feedback controller design (contd.)– LQR – Linear Quadratic Regulation

Chooses feedback gains to minimize a weighted sum of control error and control effort

J = ½ ∑ [ xT(k)Qx(k) + uT(k)Ru(k)] Select Q and R Compute feedback gains K Predict control system performance or run simulations Choose new Q and R and repeat the above steps if the

performance is not suitable

Page 9: Matlab Tutorial for State Space Analysis and System Identification

9

Examples followed in the tutorial

SISO System Example– Tandem Queue

MIMO System Example– Apache HTTP Server

Page 10: Matlab Tutorial for State Space Analysis and System Identification

10

Tandem Queue

x1(k + 1) = 0.13x1(k) – 0.069u(k)

x2(k + 1) = 0.46x1(k) + 0.63x2(k)

y(k) = x1(k) + x2(k)

22

11

2

1

)()(

)()(

)(RkRRkR

kxkx

kx

KkKku )()(RkRky )()(

110069.0

63.046.0013.0

CBA

Page 11: Matlab Tutorial for State Space Analysis and System Identification

11

Apache HTTP Server

x1(k + 1) = 0.54x1(k) – 0.11x2(k) + 0.0085u1(k) - 0.00044u2(k) x2(k + 1) = -0.026x1(k) + 0.63x2(k) - 0.00025u1(k) + 0.00028u2(k)

y1(k) = x1(k) y2(k) = x2(k)

MEMkMEMky

CPUkCPUky

MCkMCkuKAkKAku

)()(

)()(

)()()()(

2

1

2

1

MeasuredCPU

Controller Apache HTTPServer

KeepAlive

MaxClients

ReferenceCPU

ReferenceMEM

MeasuredMEM

1001

00028.000025.000044.00085.0

63.0026.011.054.0

CBA

Page 12: Matlab Tutorial for State Space Analysis and System Identification

12

System Identification

The system identification task is one of the most time consuming tasks in advanced control implementation projects.

Problems:– System analyst should have extensive background

knowledge about the system, control theory, discrete time systems, optimization, statistics etc.

– Large no. of design variables. Solution:

– Understand the various system identification methods and associated decision variables.

– Effectively use a priori knowledge regarding the system to be identified and the purpose of the intended controller.

Page 13: Matlab Tutorial for State Space Analysis and System Identification

13

System Identification Procedure

1. Design experiment and collect data.2. Examine the data. Preprocess the data.

– Detrending, prefiltering, outlier removal3. Model structure selection

– Depends on the application.4. Compute best model in the model

structure.5. Examine the properties of the model

obtained. 6. Model validation

Page 14: Matlab Tutorial for State Space Analysis and System Identification

14

System Identification Procedure

Experimental design issues – Which signals to measure?– How much data is needed? – Input signal selection– Sampling period selection

Page 15: Matlab Tutorial for State Space Analysis and System Identification

15

System Identification Procedure

Examine the data– Plot the data

Preprocess the data– Filter the data– Remove trends in the data– Reduce noise– Remove outliers– Resample the data

Page 16: Matlab Tutorial for State Space Analysis and System Identification

16

System Identification Procedure

Model Structure Selection – Many standard model structures are available

depending on the approach (how to model the influence of the input and the disturbances).

– Model structure should suit the actual system.

– Finding the best model structure and model order is an iterative procedure.

Page 17: Matlab Tutorial for State Space Analysis and System Identification

17

System Identification Procedure

Compute the best model in the model structure.– Parameter Estimation

Examine the properties of the model– Poles and zeros– Model Output– Transient response

Page 18: Matlab Tutorial for State Space Analysis and System Identification

18

System Identification Procedure

Model validation techniques – Simulation

Plot the measured output time series versus the predicted output from the model

– Crossvalidation Simulate on a data set different from the one used for

parameter estimation. For the number of different model structures, plot the

error and select the minimum.

Page 19: Matlab Tutorial for State Space Analysis and System Identification

19

System Identification Toolbox

System Identification Toolbox provides features to build mathematical models of dynamic systems based on observed system data.

MATLAB Example

Page 20: Matlab Tutorial for State Space Analysis and System Identification

Questions?

Thank You