6

Click here to load reader

Adaptive pi based on direct synthesis nishant

Embed Size (px)

Citation preview

Page 1: Adaptive pi based on direct synthesis nishant

National Conference on Recent Advances in Electrical Machines and Energy Systems (IEEE Gujarat Section) September 12-13, 2008

1

Abstract— This paper describes the application of an adaptive Proportional-Integral (PI) controller for a simple laboratory based level control system. In nature, system may changes its characteristics gradually, due to wear & tear, changes in the environmental conditions, leakages etc. To cope with time-variations in process dynamics, the concept of adaptive control is very useful. The changes in the plant dynamics are captured by identifying plant model parameters at regular intervals through recursive least square estimation method (RLSM). The RLSM only requires plant input signals and measured plant output signals to identify unknown parameters of the plant on-line. From the estimated plant parameters, PI controller parameters are calculated using direct synthesis approach such that it achieves the desired closed-loop response. The National Instruments field point module has been used here for data acquisition. The PI controller does not require any kind of adjustment or calibration from the operator. Experimental results are presented and discussed. Offset-free results have been obtained even after plant dynamics changes.

Index Terms— Adaptive control, Proportional-Integral

controller, Direct Synthesis, recursive least square estimation

I. INTRODUCTION

HE two-tank apparatus as shown in fig. 1, is actually an interacting CSTR (control stirred tank reactors) assembly

which can be used to generate different kind of experimental setups considering limited components acting at a time.

Fig. 1. Two tank setup

Ref. Automation Lab, IIT-Bombay

Manuscript submitted May 15, 2008. N.N. Parikh is with the Systems & Control Department, Indian Institute of

Technology, Bombay-400 076, India (e-mail: [email protected] ). T.V.Vishnuvardhana rao, is with the Systems & Control Department,

Indian Institute of Technology, Bombay-400 076, India (e-mail: [email protected]).

A.T. Markana is with the Systems & Control Department, Indian Institute of Technology, Bombay-400 076, India (e-mail: [email protected]).

We have considered only a first order system with level of tank2 as our controlled variable. The flow from tank1 to tank2 is assumed as a constant disturbance. All other arrangements are assumed to be inactive. The schematic diagram as shown in fig. 2 will give more insight about the actual considered setup.

Fig. 2. Schematic diagram

Here, we have chosen very simple first order system to demonstrate the adaptive PI concept which can be further extended to higher order complex system. The control task is to regulate the level of tank2 by manipulating the inflow of tank2 in the presence of disturbance. The control input restriction is in between 4 to 20 mA. RLSM (Recursive Least Square Method) provides reasonable model parameters for controller design. Proportional-Integral controller ensures set point tracking and stability of closed loop system.

Section II of the paper presents the concept of adaptive control and Section III describes the actual implementation of the adaptive controller on a laboratory based experimental setup.

II. CONCEPT OF ADAPTIVE CONTROL

In everyday language, “to adapt” means to change a behavior to conform to new circumstances. Intuitively, an adaptive controller is thus a controller that can modify its behavior in response to changes in the dynamics of the process & the character of the disturbances. In practice, this implies that an adaptive controller is a controller with adjustable parameters, which is tuned on-line according to some mechanism in order to cope with time-variations in process dynamics & changes in the environment. The way the parameter estimator, also refereed as adaptive law, is combined with a control law gives rise to two different approaches. In the first approach, referred to as indirect

Adaptive PI Controller based on Direct Synthesis N.N.Parikh, T.V.Vishnuvardhana rao, A.T.Markana, Students, IIT-Bombay, India

T

Page 2: Adaptive pi based on direct synthesis nishant

National Conference on Recent Advances in Electrical Machines and Energy Systems (IEEE Gujarat Section) September 12-13, 2008

2

adaptive control, the plant parameters are estimated on-line & used to calculate controller parameters. This approach has also been referred to as explicit adaptive control, because the design is based on an explicit plant model. In the second approach, referred to as direct adaptive control, the plant model is parameterized in terms of the controller parameters that are estimated directly without intermediate calculations involving plant parameter estimates. This approach has also been referred to as implicit adaptive control because the design is based on the estimation of an implicit plant model.

In an adaptive control, as shown in fig.3, the plant model

( )P θ ∗ is parameterized with respect to some unknown

parameter vector θ ∗.

Fig.3. Indirect Adaptive Control For the Linear time invariant (LTI), single-input-single-

output (SISO) plant model, θ ∗ represents the unknown

coefficients of numerator and denominator of the plant model transfer function. An on-line parameter estimator generates

an estimate ( )tθ of θ ∗at each time t by processing the plant

input u and plant output y. The parameter estimate ( )tθ

specifies an estimated plant model characterized by ˆ ( ( ))P tθ

that for control design purposes treated as the “true” plant model and is used to calculate the controller parameter or gain

vector ( )c

tθ by solving a certain algebraic equation

( ) ( ( ))c

t F tθ θ= at each time t. The form of the control law

( )c

C θ and algebraic equation ( )c

Fθ θ= is chosen to be the

same as that of the control law ( )c

C θ ∗ and equation

( )c

Fθ θ∗ ∗= that could be used to meet the performance

requirements for the plant model ( )P θ ∗ if θ ∗

was known. It

is therefore, clear that with this approach, ( ( ))c

C tθ is

designed at each time t to satisfy the performance

requirements for the estimated plant model ˆ ( ( ))P tθ , which

may be different from the unknown plant model ( )P θ ∗.

Therefore, the principal problem in indirect adaptive control is

to choose the class of control laws ( )c

C θ and the class of

parameter estimators that generate ( )tθ as well as the

algebraic equation ( ) ( ( ))c

t F tθ θ= so that ( ( ))c

C tθ meets

the performance requirements for the plant model ( )P θ ∗ with

unknownθ ∗.

A. Model Parameter estimation

For the Proportional-Integral controller to be effective, it is necessary to have an accurate model at hand. In adaptive controllers measurements are obtained periodically in time. It is desirable to make the calculations recursively to save

computation time. The parameter estimate ( )kθ may be

obtained as a function of the previous estimate ( 1)kθ − and

of the new measurements. Recursive estimators are aimed at tracking time-varying parameters.

The recursive least square method [1],[2],[3],[4] is used to obtain model parameters on-line. The method is based on the minimization of the sum of the squares of the modeling errors. In general, the regression model is given by:

1 1( ) ( ) ..... ( ) ( )Tn nY k k k kϕ θ ϕ θ ϕ θ= + + =

(1) Where,

Y = Observed data, iθ = unknown parameters, iϕ = known

regression variables, k = integer variable,

[ ]1 2( ) ( ) ( ) .... ( )T

nk k k kϕ ϕ ϕ ϕ= ,

[ ]1 2 ....T

nθ θ θ θ=

Assume that N measurements { } { }( ) , ( )Y k kϕ are

available and define the equation error as

( ) ( ) ( )Tk Y k kε ϕ θ= −

(2)

For all the measurements 1....k N= a linear set of

equations can be obtained:

E Y φθ= −

(3)

Page 3: Adaptive pi based on direct synthesis nishant

National Conference on Recent Advances in Electrical Machines and Energy Systems (IEEE Gujarat Section) September 12-13, 2008

3

Where,

[ ]

[ ]

[ ]

(1) (2) .... ( )

(1) (2) .... ( )

(1) (2) .... ( )

T

T

T

Y Y Y Y N

N

E N

φ ϕ ϕ ϕ

ε ε ε

=

=

=

The dimensions of these matrices and vectors are:

dimθ = 1n× , dim 1,nϕ = × dim 1,Y N= ×

dim N nφ = × , dim 1E N= ×

The least squares estimate of θ is the vector θ which

minimizes:

2

1

1 1( ) ( )

2 2

NT

k

J k E Eθ ε=

= =∑

(4)

We take the derivative of J w.r.t. θ and set it to zero,

[ ] [ ]

( )

( )

0

TT

T T T

J EE Y

Y

θφθ φ

θ θ

φ θ φ φ

∂ ∂= = − −

∂ ∂

= − + =

(5) Which can be written as

( )T TYφ φ θ φ=

(6)

If matrix ( )Tφ φ is non-singular,

1( )T TYθ φ φ φ−=

(7)

If sequence of { }1,...., t observations are given than eq.7

can be written as:

$1

1 1

( ) ( ) ( ) ( ) ( )t t

T

k k

t k k k Y kθ ϕ ϕ ϕ

= =

=

∑ ∑

(8)

In eq. 8, matrix Tφ φ needs to be invertible. This is called

an excitation condition. The input signal { }( )u t needs to be

such that the observed data is sufficiently reach in information to enable us to estimate the model parameters.

Define ( )P t as:

1

1

( ) ( ) ( )t

T

k

P t k kϕ ϕ

=

=

(9) Then

1

1

1

1

1

( ) ( ) ( )

( ) ( ) ( ) ( )

( 1) ( ) ( )

tT

k

tT T

k

T

P t k k

k k t t

P t t t

ϕ ϕ

ϕ ϕ ϕ ϕ

ϕ ϕ

=

=

=

= +

= − +

(10) Eq. 9 may be rewritten as

1

1

1

ˆ( ) ( ) ( ) ( )

( ) ( ) ( ) ( ) ( )

t

k

t

k

t P t k Y k

P t k Y k t Y t

θ ϕ

ϕ ϕ

=

=

= =

+

(11) But we have the following:

11

1

ˆ( ) ( ) ( 1) ( 1)t

k

k Y k P t tϕ θ−

=

= − −∑

1 ˆ( ) ( ) ( ) ( 1)TP t t t tϕ ϕ θ− = − −

(12) Substituting in eq. (11),

1

ˆ( )

ˆ ˆ( ) ( ) ( 1) ( ) ( ) ( 1) ( ) ( )T

t

P t P t t t t t t Y t

θ

θ ϕ ϕ θ ϕ−

=

− − − +

(13)

ˆ( )

ˆ ˆ( 1) ( ) ( ) ( ) ( 1) ( ) ( ) ( )T

t

t P t t t t P t t Y t

θ

θ ϕ ϕ θ ϕ

=

− − − +

(14) We can write eq. (14) as follows:

ˆ ˆ ˆ( ) ( 1) ( ) ( ) ( ) ( ) ( 1)

ˆ( 1) ( ) ( )

Tt t P t t Y t t t

t K t t

θ θ ϕ ϕ θ

θ ε

= − + − −

= − +

(15) Where,

( ) ( ) ( )K t P t tϕ= and ˆ( ) ( ) ( ) ( 1)Tt Y t t tε ϕ θ= − −

From eq. (10) we have,

1 1( ) ( 1) ( ) ( )TP t P t t tϕ ϕ− − = − +

(16) From matrix inversion Lemma:

( )1 1 1 1 1 1 1( )A BCD A A B C DA B DA

− − − − − − −+ = − +

(17) Using above lemma on the right hand side of eq. (16), with

1( 1) , ( ),A P t B t C Iϕ−= − = = and ( )TD tϕ=

We obtain

Page 4: Adaptive pi based on direct synthesis nishant

National Conference on Recent Advances in Electrical Machines and Energy Systems (IEEE Gujarat Section) September 12-13, 2008

4

1

( ) ( 1)

( 1) ( ) ( ) ( 1) ( ) ( ) ( 1)T T

P t P t

P t t I t P t t t P tϕ ϕ ϕ ϕ−

= − −

− + − −

(18) Which gives, after substituting eq. (18) in the equation for

( )K t and simplifying,

1

( ) ( ) ( )

( 1) ( ) ( ) ( 1) ( )T

K t P t t

P t t I t P t t

ϕ

ϕ ϕ ϕ−

= =

− + −

(19) The entire algorithm can be now summarized as follows:

ˆ ˆ( ) ( 1) ( ) ( )t t K t tθ θ ε= − +

ˆ( ) ( ) ( ) ( 1)Tt Y t t tε ϕ θ= − −

1( ) ( 1) ( ) ( ) ( 1) ( )TK t P t t I t P t tϕ ϕ ϕ

− = − + −

( ) ( ) ( ) ( 1)TP t I K t t P tϕ = − −

(20) The equations above have a strong intuitive appeal. The

current parameter estimate ˆ( )tθ is obtained by adding a

correction to the previous estimate ˆ( 1)tθ − . The correction is

proportional to the one-step ahead prediction error ( )tε ,

which is based on the previous parameter estimate. The matrix

( )P t may be interpreted as the covariance of the parameter

vector. Its magnitude gives a measure of the uncertainty of the parameter values.

In the part B of this section, model based (state-space) Proportional-Integral controller is designed. The input-output data from the plant has been generated by giving Pseudo Random Binary Signal (PRBS) signal of suitable amplitude and frequency. Using identification toolbox of a MATLAB, the first order plant model is generated though curve fitting. The following OE (output error) structure which is obtained from the system identification technique[2] (curve fitting) has been chosen as a base structure for the above recursive least square method:

1 0( ) ( 1) ( )Y k a Y k b u k= − − +

(21) Eq. (21) can be written as

( ) ( )TY k kϕ θ=

(24)

Where, [ ]( ) ( 1) ( )T

k Y k U kϕ = −

[ ]1 0

Ta bθ = −

From these parameters we can identify discrete transfer function model and can be further converted into continuous transfer function model for the controller design.

B. PI Controller Design by Direct Synthesis

For controller design purpose, continuous model of the plant is considered which is as follows:

( )( )

( ) 1

Y s KG s

U s sτ= =

+

(25)

Where, K = Process Gain, τ = Process time constant

The closed-loop transfer function relating the setpoint and measured output is given as follows:

( ) ( )( )

( ) 1 ( ) ( )cG s G sY s

r s Gc s G s=

+

(26) By direct synthesis approach[5],[6], the designer is required

to specify the desired closed-loop behavior, say ( )V s ,

between output and the setpoint. The controller that realizes the desired closed-loop behavior can be computed as follows:

1 ( )( )

( ) 1 ( )c

V sG s

G s V s

= −

(27) This is also called a pole-placement scheme as the controller is designed such that the closed-loop poles at the desired location. The transfer function obtained from the recursive lease square method is of the form eq. (25). Let the desired transfer function will be of the form:

1( )

1cl

V sτ

=+

(28)

Where, clτ is typically chosen as 2

τ or

3

τ.

Substituting eq. (25) and eq. (28) into eq. (27), we obtain a PI controller

11c c

I

G Ksτ

= +

(29)

Where, 1

c

cl

KK

τ

τ

=

and iτ τ=

III. RESULTS & DISCUSSION

Adaptive PI algorithm is coded in Labview and implemented on a two tank setup. Data Acquisition is done through National Instruments field point module FP-2010. It

Page 5: Adaptive pi based on direct synthesis nishant

National Conference on Recent Advances in Electrical Machines and Energy Systems (IEEE Gujarat Section) September 12-13, 2008

5

Fig.3.1. Output and Setpoint

Fig.3.2. Control Effort

Fig.3.3 a

Fig. 3.3 b

Fig. 3.3 controller parameter variations

a). Proportional gain, b). Integral gain

Fig.3.4 a

Fig.3.4 b

Fig. 3.4 Model parameter variations a). Process gain, b). Process time constant

Page 6: Adaptive pi based on direct synthesis nishant

National Conference on Recent Advances in Electrical Machines and Energy Systems (IEEE Gujarat Section) September 12-13, 2008

6

consist analog input (AI) module FPAI-110 and analog output (AO) module FPAO-200. Channel-4 of AI module is used to measure the level in tank2 and channel-3 & 4 of AO module are used for inflow1 and inflow2. Fig 3.1 and fig. 3.2 shows the experimental results when the controller is placed in a loop. The red line in Fig. 3.1 is of the setpoint and blue line is of the output. Controller is able to track the setpoint well. From fig. 3.2, it is clear that control effort remains within the acceptable limit which is in between 4 to 18 mA. Fig 3.3 shows the variations in controller parameters. Adaptation starts at 212 sampling instant by pressing the adaptation switch. The controller parameter remains constant before adaptation. After that it varies according to variations in model (plant) parameters. The model parameter variations are shown in fig. 3.4. Positive and negative step changes in set point are given around operating point. The output reaches to the setpoint with the settling time of approximately one third of the open-loop settling time.

REFERENCES

[1] Vladimir Bobal, Martin Sysel, Petr Dostal, “Self tuning PID controller using δ model identification”, International Journal of Adaptive Control and Signal Processing, 2002, 16: 455-471.

[2] Kannan Moudgalya, “Digital Control”, Wiley Intersciene, 2007. [3] Victor M. Becerra, “CY4A2-Advance System Identification-Lecture

Notes”, School of Systems Eng., University of Reading, U.K. [4] Jose M. Fernandes, Carlos E. De Souza, Graham C. Goodwin,

“Adaptive Control of a coupled tank apparatus”, International Journal of Adaptive Control and Signal Processing, 1987-1995, Vol. 3, Issure-4, pp. 319-331.

[5] S.Patwardhan,” CL 692-Lecture notes on Advance Process Control” IIT Bombay. India. [6] Dale E. Seborg, Thomas F. Edgar, Duncan A. Mellichamp, “Process Dynamics and Control, John Wiley & Sons, Inc, 2004.