Vous êtes sur la page 1sur 16

CY4A2 Advanced System Identification

Lecture 5

SELF-TUNING REGULATORS The development of a control system involves many tasks such as modelling, design of the control law, implementation and validation. The self-tuning regulator (STR) attempts to automate several of these tasks.

Specifications

Controller design

Process parameters

Self-tuning regulator

Controller parameters Command signal uc

Estimation

Control signal u

Output y

Controller

Process

Dr. V.M. Becerra

CY4A2 Advanced System Identification

Lecture 5

The Self Tuning Regulator is composed of two loops The inner loop, which contains the process and an ordinary feedback controller. The outer loop, which is composed by a recursive parameter estimator and design calculations. This loop adjusts the controller parameters Indirect adaptive algorithm: two steps: (1) estimate process model parameters; (2) update controller parameters as if estimates were correct (The Certainty Equivalence Principle)

Out of the several possible parameter estimation techniques we will use the Recursive Least Squares algorithm. Out of several possible controller design methods we will study LQ tracking optimal control, using state space models.

Dr. V.M. Becerra

CY4A2 Advanced System Identification

Lecture 5

LQ tracking optimal control design System model:

x(k +1) = Ax(k) + Bu(k) y(k) = Cx(k)


where x is the state vector, u is the input vector , k is an integer discrete time index , A, B and C are matrices. Performance Index:

J = (( y(k) u )T Q( y(k) u ) +u(k)T Ru(k)) c c


1 2 k=0

where J is a scalar performance index, Q is a positive semi-definite matrix, R is a positive definite matrix, and the command signal uc is assumed to be constant. The optimal control sequence that minimises J is:

u(k) = K f x(k) + K ruc

Dr. V.M. Becerra

CY4A2 Advanced System Identification

Lecture 5

where the feedback gain matrix Kf is given by

K f = ( BT S B + R)1 BT S A
where S is the solution to the algebraic Riccati equation

S = A T [ S S B( B T S B + R) 1 B T S ] A +Q
The feed-forward gain matrix Kr is given by:

K r = ( BT SB + R)1 BT[ I ( A BK f )T ]1C TQ


Questions: When is there a bounded solution S to the algebraic Riccatti Equation? When is the closed loop plant asymptotically stable?

Dr. V.M. Becerra

CY4A2 Advanced System Identification

Lecture 5

Answer: (A,B) should be stabilizable under linear state feedback and A, Q should be observable. The ARE can be solved by different methods, such as the iteration method, the eigenvalue method, etc. In Matlab, the following command can be used to obtain Kf and S

[Kf, S] = dlqry( A, B, C, D, Q, R)

Dr. V.M. Becerra

CY4A2 Advanced System Identification

Lecture 5

Finding the state space model

We intend to use the Recursive Least Squares algorithm for our self tuning controller. Assume, for simplicity, that the system is single-input single-output Assume that the following ARX model structure is used by the Recursive Least Squares algorithm:

A *(q1 )y(k) = B*(q1 )u(k) + (k)


where

A *(q1 ) =1 + a1q1 + +ana qna B*(q1 ) = b1q1 + b2q2 + +bnb qnb

Dr. V.M. Becerra

CY4A2 Advanced System Identification

Lecture 5

An equivalent non-minimal state space realization of the above ARX model is given below.

x(k +1) = Ax(k) + Bu(k) y(k) = Cx(k) + (k)

where the state vector is defined as:

x(k) =[ y(k) y(k 1) y(k na +1)

u(k 1) u(k nb +1)]T

dim x =n +n 1
a b

Note that the state vector at time k is simply formed using past values of the input and output variables. No state observer is required. In contrast, if minimal state space realizations are used, then a state observer is usually required.

Dr. V.M. Becerra

CY4A2 Advanced System Identification

Lecture 5

LMa MM 1 M A=M 0 MM 0 MM N0
1

a 0 0 0 0

0 1 0 0 0

na

0 0 0 0

OP 0P PP 0P 0P PP 0P Qn n
nb

LMb OP MM 0 PP MP B = M0P MM 1 PP MM PP N 0 Qn 1
C= 1 0 0 0 0 1n

Dr. V.M. Becerra

CY4A2 Advanced System Identification

Lecture 5

The self tuning controller

Design parameters Q, R

LQ tracking optimal controller design

a1... an a b1... bn b

Self-tuning regulator

Controller Parameters K, Kr, x Command signal uc


Control signal u

RLS estimator

Output y

u = K f x + K r uc

Process

Recall the RLS algorithm:

K (k)= P(k 1)(k) I + (k)T P(k 1)(k)


(k) = y(k) (k)T (k 1)
(k) = (k 1) + K (k)(k)

P(k) = I K (k)(k)T

P(k 1)

Note: this type of controller may be thought of as an infinite horizon adaptive predictive controller. This type of controller, with minor modifications, is well suited for multivariable systems.

Dr. V.M. Becerra

CY4A2 Advanced System Identification

Lecture 5

Example 5.1 Consider the plant:

G(s) =

. 05 s 2 + s +1

The z- transform equivalent of this plant under zero order hold is:

. . G( z ) = 000935z + 000875 . . z 2 17826z + 08187

The plant is to be controlled by a self-tuning LQ controller, using the least squares parameter estimation algorithm.

Dr. V.M. Becerra

10

CY4A2 Advanced System Identification

Lecture 5

RLS model: The RLS model has the following ARX structure:

y(k) =a y(k 1) a y(k 2) +b u(k 1) +b u(k 2) + (k)


1 2 1 2

The parameter and regression vectors are

=[ a1 a2 b1 b2 ]T

(k) =[ y(k 1) y(k 2) u(k 1) u(k 2)]T

The forgetting factor used was 0.98, the sampling time was 0.2 s, the initial parameter vector was =[ 01010101 ]T and the initial covariance matrix . . . . was P =100 I .
4

Dr. V.M. Becerra

11

CY4A2 Advanced System Identification

Lecture 5

The non-minimal state space realization used was given by:

x(k) = y(k) y(k 1) u(k 1)

LMa A= 1 MM 0 N

a 2 0 0

OP 0 PP 0Q
2

LMb OP B= 0 MM1 PP NQ
1

C= 1 0 0

Controller: The control law was:

u(k) = K f x(k) + K ruc


The following tuning parameters were used: Q = 1.0, R = 0.03

The command signal uc was a square wave with amplitude [+1, -1] and period 50 s. A small random signal was added to the controller output in order to enhance input excitation, which is important for identification.

Dr. V.M. Becerra

12

CY4A2 Advanced System Identification

Lecture 5

Simulink diagram, Example 5.1


Mux Mux y and uc SQUARE WAVE uc Noise LQ Controller Controller + + Sum x(k) State Generator phi RLS Estimator KfKr lqsfun To Workspace3LQ control design Recursive least squares Parameter Estimator Regression vector Generator u[n] 0.00935z+0.00875 z21.7826z+0.8187 Plant y[n] y To Workspace1

theta To Workspace2

t Clock To Workspace

Dr. V.M. Becerra

13

CY4A2 Advanced System Identification

Lecture 5

Simulation Results, Example 5.1

y and uc

1 0 1

50

100

150

theta

0 1 2 0 20

50

100

150

controller gains

20 0

50 time (s)

100

150

Notice that the controller does not have integral action, since the steady state error is non-zero.

Dr. V.M. Becerra

14

CY4A2 Advanced System Identification

Lecture 5

Integral Action There are several ways of introducing integral action to a controller, and so eliminate steady state error. A simple way of doing it is to add a term proportional to the accumulated error to the controller output, so that the new controller output is given by:

u(k) = K x(k) + K u(k) + K d(k)


f r i

where Kf and Kr are obtained using the LQ design procedure, Ki is a constant chosen by the designer and d(k) is given by the recursive formula:

d(k) =d(k 1) +(u (k) y(k))


c

Care must be taken to stop updating d(k) when the controller or associated actuator saturate at their higher or lower limits. Otherwise an undesirable phenomenon called integrator windup may occur. Note that is is also possible to compute Ki optimally by using a model of the system with an extra state, where the extra state is d(k).

Dr. V.M. Becerra

15

CY4A2 Advanced System Identification

Lecture 5

Example 4.2 This example is identical to Example 6.1, except that the control law has been modified to:

u(k) = K x(k) + K u(k) + K d(k)


f r i

d(k) =d(k 1) +(u (k) y(k))


c

where Ki = 0.1. This introduces integral action into the controller.


2

y and uc

2 0 1

50

100

150

theta

0 1 2 0 20

50

100

150

controller gains

20 0

50 time (s)

100

150

Dr. V.M. Becerra

16