5
Applications of Artificial Neural Networks in Control Systems SILVIYA KACHULKOVA Department of Electrical Measurements, Faculty of Automatics Technical University of Sofia, 8, Kliment Ohridski St, 1000 Sofia, BULGARIA [email protected] Abstract: That paper describes the usage of Artificial Neural Networks (ANN) which gives us the advantage in control systems to solve and examine the problems with nonlinearities, complex plant modeling and prediction. One of the objectives of the current project is to design an ANN controller of the product concentration in constantly stirred tank reactor using Artificial Neural Networks. Keywords: Constantly Stirred Tank Reactor, Artificial Neural Networks, control nonlinear plant, ANN plant predictor, concentration of product, predict future performance. 1 Introduction The main areas of application of neural networks for control of processes are identification, optimization, cancellation of nonlinearities and adaptive control of complex processes with variable and non-stationary parameters. The advantage of artificial neural networks is the simple realization of complex logic functions and algorithms for control. For easy use of neural networks a language standard for configuration and training of neural networks and a specialized microchip for embedding in the configuration of programmable logic controllers is developed. This paper presents investigation of the process in a catalytic constantly stirred tank reactor (CSTR). Fig.1 Catalytic CSTR The dynamic model of the system is described by the following two differential equations: ( ) () () () t h t w t w dt t dh 2 . 0 2 1 + = (1) ( ) () ( ) ( ) () () ( ) ( ) () ( ) () ( ) 2 2 1 2 2 1 1 1 t C k t C k t h t w t C C t h t w t C C dt t dC b b b b b b b + + = The variables of the plant are the following: h(t) – is the liquid level; C b (t) – is the product concentration at the output of the process; w 1 (t) – is the flow rate of the concentrated feed C b1 ; w 2 (t) – is the flow rate of the diluted feed C b2 ; The input initial concentrations are set to C b1 =24.9 and C b2 =0.1. The constants associated with the rate of consumption are k 1 =1 and k 2 =1. The objective of the controller is to maintain the product concentration by adjusting the flow w 1 . The initial level (initial condition for the integrator h) is 30mm. 2 Design of a Predictive Control System for Tank Reactor Concentration The neural model reference control architecture uses two neural networks: a controller network and a plant model network, as shown below in the following figure. The plant model is identified first, and then the controller is trained so that the plant output follows the reference model output. Recent Researches in Circuits and Systems ISBN: 978-1-61804-108-1 33

Applications of Artificial Neural Networks in Control … of Artificial Neural Networks in Control ... Tank Reactor, Artificial Neural Networks, control ... tank reactor (CSTR). plant

  • Upload
    voxuyen

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Applications of Artificial Neural Networks in Control … of Artificial Neural Networks in Control ... Tank Reactor, Artificial Neural Networks, control ... tank reactor (CSTR). plant

Applications of Artificial Neural Networks in Control Systems

SILVIYA KACHULKOVA

Department of Electrical Measurements, Faculty of Automatics

Technical University of Sofia, 8, Kliment Ohridski St, 1000 Sofia,

BULGARIA

[email protected]

Abstract: That paper describes the usage of Artificial Neural Networks (ANN) which gives us the advantage in

control systems to solve and examine the problems with nonlinearities, complex plant modeling and prediction.

One of the objectives of the current project is to design an ANN controller of the product concentration in

constantly stirred tank reactor using Artificial Neural Networks.

Keywords: Constantly Stirred Tank Reactor, Artificial Neural Networks, control nonlinear plant, ANN plant

predictor, concentration of product, predict future performance.

1 Introduction The main areas of application of neural networks for

control of processes are identification, optimization,

cancellation of nonlinearities and adaptive control of

complex processes with variable and non-stationary

parameters. The advantage of artificial neural

networks is the simple realization of complex logic

functions and algorithms for control. For easy use of

neural networks a language standard for

configuration and training of neural networks and a

specialized microchip for embedding in the

configuration of programmable logic controllers is

developed. This paper presents investigation of the

process in a catalytic constantly stirred tank reactor

(CSTR).

Fig.1 Catalytic CSTR

The dynamic model of the system is described by

the following two differential equations:

( ) ( ) ( ) ( )thtwtwdt

tdh2.021 −+= (1)

( ) ( )( ) ( )( )

( )( ) ( )( )

( )( )( )22

122

11

1 tCk

tCk

th

twtCC

th

twtCC

dt

tdC

b

b

bbbb

b

+−−+−=

The variables of the plant are the following:

h(t) – is the liquid level;

Cb(t) – is the product concentration at the output of

the process;

w1(t) – is the flow rate of the concentrated feed Cb1;

w2(t) – is the flow rate of the diluted feed Cb2;

The input initial concentrations are set to Cb1=24.9

and Cb2=0.1. The constants associated with the rate

of consumption are k1=1 and k2=1. The objective of

the controller is to maintain the product

concentration by adjusting the flow w1. The initial

level (initial condition for the integrator h) is 30mm.

2 Design of a Predictive Control

System for Tank Reactor

Concentration The neural model reference control architecture uses

two neural networks: a controller network and a

plant model network, as shown below in the

following figure. The plant model is identified first,

and then the controller is trained so that the plant

output follows the reference model output.

Recent Researches in Circuits and Systems

ISBN: 978-1-61804-108-1 33

Page 2: Applications of Artificial Neural Networks in Control … of Artificial Neural Networks in Control ... Tank Reactor, Artificial Neural Networks, control ... tank reactor (CSTR). plant

Fig.2 Predictive controller basic diagram

The predictive controller has the block-diagram

shown in Fig. 3, where:

T=2s – prediction period or T=2∆t=1s

Cb (tk) = Cb (k)

Cb (tk+∆t) = Cb (k+1) (2)

Cbref. – desired output concentration which the

controller ensures,

k – is moment of time,

t = tk → tk = t0 + k∆t, tk = tk + ∆t (3)

w1 – is the flow rate of the concentrated feed (output

of the control)

Fig. 3 Predictive controller block diagram

The PID controller compares the measured process

value Cb with a reference set point value Cbref.. [2].

The difference or error e is then processed to

calculate a new process input u. This input will try

to return the output process variable back to the

desired set point. The PID controller is capable of

manipulating the process inputs using advanced

information for the controlled variable from the

predictor.

The transfer function of the PID controller is

defined by the following equation:

( ) ( ) sTksTkksTsTksC dpippdipPID ++=++= //11 (4)

where:

Kp – is proportion of the gain;

Ti – is integral action time;

Td – is differentiating time constant;

In Simulink the PID block parameters are P=kp,

I= kp/Ti and D = kpTd = 0.

Here is used PI controller, because it is widely

spread in engineering practice, simple and reliable

and noise insensitive (the differentiating term is

omitted as noise sensitive, so Td = 0) [3]. The PI

controller has the following transfer function:

( )

+=

sTKsC

i

pPI

11 (5)

The transfer function of the plant is obtained after

Ziegler-Nichols approximation of the transient

response in the form:

( )( )1

1

+=

sT

ksP (6)

The PI controller is tuned for a given operating point

of the plant (W10, Cb

0) from its static characteristics-

in (W10, Cb

0) the plant gain is:

23231

max =∆

∆===

∞→t

b

w

CKK (7)

In this steady state point the plant time-constant is

t=43s. The tuning criterion is to ensure critical

response of the overall closed loop system. So the

characteristic equation

( ) ( ) KKsTKKsTTKKsTKKsTsTTsH pipipipii +++=+++= 122

of the closed loop system should have two real equal

roots, equal to -1 that s1 = s2 = -1 or the discriminant

∆ of the characteristic equation should be equal to 0.

( ) 02122 =−+ KKTTKKT pipi (8)

Hence ( )21

2

KK

KTKT

p

p

i+

= (9)

For ( )

T

KK

TT

KKTss

p

i

pi

2

1

2

1121

+−=

+−=−== (10)

So finally it is obtained 7.369.312

≅=−

=K

TKp

and Ti=2 (11)

3 ANN Linearising Controller The first step in model predictive control is to

determine the neural network plant model (system

identification). Next, the plant model is used by the

controller to predict future performance. This is

followed by a description of the optimization

process. Finally, the model predictive controller

block is embedded in Simulink. The Dynamic

model of the system is described by the following

two differential equations:

Neural

Network

Controller

Neural

Network

Plant Model

Inpu Output

Recent Researches in Circuits and Systems

ISBN: 978-1-61804-108-1 34

Page 3: Applications of Artificial Neural Networks in Control … of Artificial Neural Networks in Control ... Tank Reactor, Artificial Neural Networks, control ... tank reactor (CSTR). plant

From (1) the idea of feedback linearization is to

cancel the nonlinearities in the system so that the

closed loop dynamics will be linear. Since in our

case linearizing control is depend on w1 = u then it

could be represented as w1 = f(Cb,w2,r) and w2 is

fixed. As a Linear Reference Model (LRM) -9X1-

6X2+9r is chosen. But since w2 is fixed, the model

becomes -9X1+9r and X1 represents Cb. Suppose that

we would like the closed loop system to respond

with the dynamics diven by the Linear Reference

Model, then

Cb = -9Cb+9r where r is the reference.

Now let us train a neural network to help perform

this control model. The source code of the program

is:

% P defines 2-element input vectors (column

vectors):

h=30;Cb0=20:0.1:24;r0=20:0.1:24;w20=0.04;

P=combvec(Cb0,r0);[m,n]=size(P);

For i=1:n

T(i)=((-1*P(1,i)+1*P(2,i))*h-(0.1-

P(1,i)).*w20+P(1,i)*h./(1+P(1,i))^2)./(24.9-P(1,i));

% T defines the associated targets (column vectors)

end

Max(T),min(T),pause

% Checking the values of max(T) and min(T) before

training

X1=Cb0/24;x2=r0/24;T1=T/max(max(T),abs(min(T

)));

% Cb0 and r0 normalized for the new targets

% P1 defines 2-element normalized input vectors

(column vectors)

P1=combvec(x1,x2);

% net initialization for P1 in the range PR, with 7

hidden layer

% and 1 output layer neurons and ‘tansig’ activation

functions in the hidden layer

% and linear activation function in the output layer

% random values for the weights and the biases are

generated

PR=[0.51;0.51]

net = newff(PR,[7 1],{‘tansig’ ‘purelin’});

% net training parameters are assigned for number

of epochs and accuracy goal

net.trainParam.epochs = 20000;

net.trainParam.goal = 1.e-10;

% training starts: default network training function

TRAINLM that updates

% weight and bias values according to Levenberg-

Marquardt optimization

% (a modification for speeding up the steepest

descent method);

% default criterion MSE

net=train(net,P1,T1);

% generation of the net Simulink block for the

trained net (sample time=1)

Gensim(net,1)

4 Training results For the predictive control the error is shown in Fig.

4

Fig. 4. Training error of the predictive controller

Fig. 5 Neural network predictive controller Simulink block

As a result is generated the Simulink block, as

shown in Fig.5. The two layers of the network are

presented in Fig. 6.

Fig.6. Basic ANN Structure for Predictor with have

2 layers and 7 hidden neurons

The first layer has a tansig transfer function and it is

shown in Fig.7

Recent Researches in Circuits and Systems

ISBN: 978-1-61804-108-1 35

Page 4: Applications of Artificial Neural Networks in Control … of Artificial Neural Networks in Control ... Tank Reactor, Artificial Neural Networks, control ... tank reactor (CSTR). plant

Fig. 7.First layer of NN controller

This layer has seven neurons, revealed in Fig.8

Fig. 8 Weights and biases of the hidden layer of NN

controller

The second layer has one neuron and purelin

transfer function.

Fig. 9 Second (output) layer with purelin transfer

function

Figure 10 shows the weights for this second layer.

Fig. 10 Second output layer weights and biases

The values for the weights and the biases for the two

layers of the predictor are given below[4].

Weight and Bias Matrix of First Layer of ANN:

=1W

20.072.7

39.020.13

13.044.4

67.006.40

07.050.1

74.093.35

27.016.10

−−

−−

b1= [10.08, 39.25, -1.24, -41.77, 3.51, -14.40, 8.53]

Weight and Bias Matrix of Second Layer of ANN:

W

2 =[-5.13, -48.66, 24.80, -24.91, 7.53, 6.54, 40.69]

b2 = [-4.05]

5 Simulation Investigations on

Ordinary Closed Loop System and a

System with Predictive Controller The aim is to control our nonlinear plant using ANN

Predictor with PI controller.

Fig. 11 Simulink block diagram with PI controller

and ANN predictive controller

We see that in Fig.11 the Simulink block diagram of

the two control systems. The step input for Cb is

from 20 to 23, and the sample time is 1. The two

PID controller’s parameters are Kp = 3.7 and Ti = 2.

The plant outputs are the behavior of the PI

controller with the step response in Fig.12 and the

Recent Researches in Circuits and Systems

ISBN: 978-1-61804-108-1 36

Page 5: Applications of Artificial Neural Networks in Control … of Artificial Neural Networks in Control ... Tank Reactor, Artificial Neural Networks, control ... tank reactor (CSTR). plant

behavior of the ANN predictor with step response in

Fig.13.

Fig.12 The plant output response with PI controller

Fig.13 The plant output response with ANN

predictive controller

The output of the PID controllers is the flow rate

that is connected to the plant and in turn the output

of the plant is concentration. Additionally clocks are

connected to see that the graph synchronizes the

output of the plant and the reference signal

generated from step.

6 Conclusions and future research Our new aim is to control the nonlinear plant using

the feedback linearising controller. With the help of

linearising controller all the nonlinearities are

canceled in the plant. Thus the closed loop system becomes linear. We can conclude that as we can see

from Fig.12 and Fig.13 that the closed loop system

with linearising gives one of the best results and it's

more settled and doesn't give overshoot. Next best

response is obtained from improved PI controller

and ANN predictive controller. Matlab, Simulink

and NN Toolbox in Matlab proved to be effective

means by design, training and testing of NNs used

in the prediction and control of the output product

concentration in CSTR. The results obtained show

the possibility to use more sophisticated techniques

to improve the modeling and control of the

nonlinear plants such in our example of CSTR.

References: [1] Lee, B.W., and Shaun, B.J., “Design and

Analysis of VLSI Neural Network,” in Neural

Networks for Signal Processing, Bart Kosko

(ed.), Prentice Hall, Englewood Cliffs, NJ,

1992; chap. 8

[2] “Applications of Artificial Neural Networks.”,

20 March 2007 http://www.gm.fh-

koeln.de/~west/ANN_app.htm

[3] “Neural Networks in Control Systems” March

2007

http://www.nd/edu/pantsakl/editorialcsm2.htm.

[4] Snejana Yordanova, Tasho Tashev, Fuzzy

Internal Model Control of Nonlinear Plants

with Time Delay based on Parallel Distributed

Compensation, WSEAS TRANSACTIONS on

CIRCUITS and SYSTEMS, Issue 2, Volume

11, February 2012, pp 56-65

[5] Chen Hao, Ilhami Colak Gorbounov Yassen,

Pavlitov Constantin, Tashev Tasho. Sensorless

Control of SRM by the Aid of Artificial Neural

Network Adaptive Reference Model. EPE 2011

– The 14 European Conference of Power

Electric and Applications. Birmingham, UK,

2011

Recent Researches in Circuits and Systems

ISBN: 978-1-61804-108-1 37