Lab
Neural Networks based control of nonlinear systems
1
Identification of dynamic systems with Artificial Neural Networks
))(,),1(),(,),((
))
)(
)1()(
)(
((()( 211122
ntytymtutufnty
tymtu
tu
WFWFty
nn ---=
=Q+Q+
úúúúúúúú
û
ù
êêêêêêêê
ë
é
-
--
××××=
!!
"
"
Dynamic/ feedback network:
Feedforward Neural Network
Identification with Artificial Neural Networks
U
sY
mY
is theinput of the system and the model
is the output of the system
is the output of the model
ms YYE -=
0®ESystem
Model
Identification with Artificial Neural Networks
System
NN
Calculation of new parameters
Inverse model
Calculation of new parameters
NN
System
)1()(:1 -®- tUtYf
))(,),2(),(,),(()1( 1 rtUtUqtYtYftU ---=- - !!
Inverse model
Consider a system:
))2(),2(),1(),(()1( 1 ---=- - tutytytyftu
))2(),1(),2(),1(()( ----= tututytyfty
Inverse model based control
))2(),2(),1(),(()1( 1 ---=- - tutytytyftu
Here )()( twty =
Inverse model Plant
Inverse model based adaptive control
Plant Inverse model
Example: Jacketed CSTR (Continuous Stirred Tank Reactor)
Input-Output equation:
)1()(5611.0)1()1(592.0)1(3921.0)1()(014.1
)1(6407.0)1(4801.0)(231.0)1(7653.0)2(
2
2
+-+++++-++
++-++
+-+=+
tutytutytytyty
tytutytyty
9
Collecting input-output data
To Workspace 1
output
To Workspace
input
Scope
Jacketed CSTR
In1 Out1
Input : Uniform RandomNumber
10
td=1N=size(output,1)P=[output(3:N)';output(2:N-1)';output(1:N-2)']T=input(2:N-1)'global net_c
net_c=newff([0 1; 0 1; 0 1],[5 1],{'tansig','purelin'})net_c.trainParam.show=1;net_c.trainFcn='traingd';net_c.trainParam.epochs=3000;net_c=train(net_c,P,T)
Training of inverse model
11
function control=controller(u)global net_ccontrol=sim(net_c,u);
Implementation of the controller in MATLAB (m-file controller.m)
12
dynamic _controller
In1 Out1
Step
Scope
Jacket
In1 Out1
Constant
0.6
Control scheme
13
“dynamic_controller” block
Out 11
Unit Delay 3
z
1
Unit Delay 2
z
1
MATLAB Fcn
MATLABFunction
In11
14
adaptive _dynamic _controller
In1
In2Out1
Step
Scope
Jacket
In1 Out1Constant
0.6
Adaptive control scheme
15
Out 11
Unit Delay 3
z
1
Unit Delay 2
z
1
MATLAB Fcn
MATLABFunction
Clock
In22
In11
“adaptive_dynamic_controller” block
16
Adaptive controller = function “controller_adaptive” (m-file controller_adaptive.m)
function control=controller_adaptive(u)global net_cinp=u(1:3);error=u(4);time=u(5);control=sim(net_c,inp);if time>10net_c=adapt(net_c,inp,control+error);end
17