You are on page 1of 8

Colloquium Postgraduate Studies08, Universiti Sains Malaysia (IPS08)

NEURO-GENETIC CONTROLLERS FOR NONLINEAR


DYNAMICAL
MARWAN, A.ALI, MAT SAKIM, H.A.
School of Electrical and Electronic Engineering
Universiti Sains Malaysia, Engineering Campus
14300 Nibong Tebal, Seberang Perai Selatan, Pulau Pinang, Malaysia
Tel: +604-64747045, E-mail: amylia@eng.usm.my,marwan.l07@student.usm.my
these needs have led to a more general concept
of control. That it is has the ability to
comprehend and learn about plants disturbances,
environment and operating conditions. These
abilities are necessary when is desired to design
a system with acceptable performance
characteristics over a very wide range of
uncertainty. For this purpose, NNs is used as
controller to overcome the difficulties of
designing complex control system. The aim of
this work is to investigate the use of feed
forward neural network as an adaptive controller,
for different linear and nonlinear plants including
SISO and MIMO models utilizing GAs. In many
applications a number of practical difficulties are
faced the control engineers. The development of
computer-aided techniques to design controllers
also aims to reduce interactions from applying
classical theory to the individual loop [2, 3]. The
application of the intelligent control schemes has
attracted the attention of researchers in the field
of control engineering. Practical characteristics
of neural networks (NNs) include the
representation of arbitrary, multidimensional
problem, adaptation through example, and the
ability to combine large amount of data to form
decisions [1, 4].
The base of evaluation of this work is to
examine the behavior of the proposed neurogenetic controller in dealing with different kinds
of control system. The problems of concern are
divided into two; the tracking of the modelreference and the robustness test to output. In
addition, a comparison between the proposed
neuro-controller and classical PID controller will
be carried out based on the MRAC scheme. The
genetic algorithm is attractive for a number of
reasons. It can handle problem constraints by
simply embedding them into chromosome
coding. Multi-objective problem can also be
solved using GA. Since it is a technique
impendent of the error surface, it is ready to
solve multi-model, non-differentiable, noncontinuous problems. Also it is very easy to
understand the technique with very few (or even
none) mathematics [5].

Abstract
This paper proposes a method for learning
multilayer neural network (NN) based on a
genetic
algorithms
(GAs)
technique.
Evolutionary techniques based on the algorithms
are studied and the model-reference adaptive
control (MRAC) scheme for different plants are
employed. The neuro-controller, trains the
network to minimize the error between the
output of the plant and the output of model
reference. Comparison between the proposed
neuro-controller with a classical genetically
tuned proportional, derivative, and integral (PID)
controller is made, where the later is used as
feedback controller based on model- reference.
The comparison is based on the speed of
convergence, tracking ability of the desired
model reference and robustness to output
disturbances. It is concluded based on simulation
results that the proposed neuro-controller is
better than the PID controller in both robustness
and tracking ability.

Keywords:
Nonlinear
System Identification;
Networks;
Model
Reference;
Programming; PID Controller.

Neural
Genetic

1. Introduction
Neural networks have broad applicability in
real world problems such as in pattern
recognition, diagnostic, optimization, system
identification and robotics. They have already
been successfully applied in many industries, as
they are well suited for prediction [1]. Basically
there are three major needs for this work. Firstly,
the need to deal with increasingly complex
systems. Secondly, the need to accomplish
increasingly demanding design requirements.
Lastly, the need to attain these requirements with
less precise advanced knowledge of the plant and
its environment. The increasing emphasis on

Copyrighthttp://ee.eng.usm.my

91

The constant Cmax be chosen as an input


coefficient, or as the largest objective function
value. The other form of objective to fitness
transformation is [6]:

2. The Proposed Algorithm for ModelReference adaptive Neuro-Controller.


The idea of the adaptive model-reference
technique is to adjust the parameters of the
controller dynamically, so that, the output of
plant follows the output of the predefined desired
model. The direct MRAC with parallel modelreference is used here. In this scheme the
learning process and the control action are
implemented off-line with the plant. The
following genetic procedure is introduced for
training the neuro-controller for the plant to track
the reference model trajectory:
Step1: Initialize the genetic operator:
Pc = Crossover probability.
Pm = Mutation probability.
Npop = Population size.
Max Number of generations.
Step2: Generate the initial population randomly.
Each population represents the overall weigh
connections of neural network.
Step3: Compute the objective function for each
individual in the population. Then, calculate the
fitness function as equation (1) for single input
single output (SISO) or equation (2) for multi
input multi output (MIMO). The mean square
error (MSE) is used as an objective function:

FITNESS=

(4)
objective function
is a constant chosen to avoid division by zero.
Step4: Place in descending order, all
chromosomes in the current population (the first
one is fittest).
Step5: Select individuals using hybrid selection
method (Roulette Wheel plus deterministic
selection), the real coded genetic operators of
mutation and crossover (single point).
Step6: Stop if a maximum number of
generations of GAs are achieved, otherwise
increment the generations by one and go to
Step3.
The following flowchart illustrates the proposed
genetic learning scheme.

2
NP
MSE = [ y p ( k ) ym ( k )] (for SISO plants)
K 1

Np

(1)
2

N [ y ( k ) y ( k )] [ y ( k ) y ( k )]
m1
p2
m2
MSE= P p1
K 1

NP

(2)
y p (k): is the output of the plant at sample k .
y m (k): is the output of the model reference at
sample k.
N P : is the number of the training patterns.
Since GA maximizes its fitness function, it is
necessary therefore to map the objective function
(MSE) to a fitness function. The most commonly
used objective-to-fitness transformation is of the
form [6]:

Fig 1. Flowchart of the Genetic Learning


Scheme for the proposed.

FTNESS=

3. Simulation Results

C max objective function[objective function C max]


0

[otherwise]

In this section, different examples are selected


that include different types of linear and
nonlinear plants. The structure of NN controller

(3)

Copyrighthttp://ee.eng.usm.my

92

(including three layers) is chosen in such a way


to help it track the model reference trajectory. In
all simulation results, the real coding GAs is set
to the following parameters:

(a)

Population size (Npop):40


Pc (crossover probability):0.58
Pm (mutation probability):0.05
Max. Number of generations: 3000
(b)

The hybrid selection method is used with


elitism strategy, where the best 7 individuals are
maintained through the successive generations.
To improve performance, the training pattern
(Np) used for the MSE was taken as:
NP= 100 for NNs controller while NP=1000 for
PID controller.

(c)

Example 1: [7].
A stable nonlinear single input single output
plant has the following difference equation:
y p (k )
(5)
y p ( k 1)
u (k )
2
1 y p (k )
It is controlled using NN to follow the modelreference which is described by the difference
equation:

y m (k 1) 0.6 * y m (k ) u (k )

(d)
Fig 2: The MRAC of Example 1 :(a) Modelreference and Plant Output (b) Control Signal (c)
Output Error (d) Best MSE.

(6)

Example2: [8].

The reference input used in this example is


described by the following equation:
2k

0.2 * sin( 50 )

r ( k ) 0.2
0.2

0 k 50
50 k 75

Another stable nonlinear plant is described by


the following difference equation:

(7)
y p ( k 1)

75 k 100

(8)

The plant is controlled to follow the modelreference described by equation (6). It is


different from that of example 1 but it uses the
same model reference and input described by the
equations (6) and (7) respectively. The aim of
using this plant is for comparison. The
simulation results for this plant are shown in Fig
3. Fig 3(a) shows how the plant output follows
the model-reference while Fig 3(b) shows the
behavior of NN controller. The output error is
appoximately zero as shown in Fig 3(c). Fig 3(d)
shows the best objective function MSE.

The simulation results for this plant are shown


in Fig 2. Fig 2(a) shows how the plant output
follows a model-reference while Fig 2.(b) shows
the behavior of NN controller. The output error
is approximately zero as shown in Fig 2(c). Fig
2(d) shows the best objective function. The
modeling error between the model-reference and
the controlled plant (by NN) is an indication of
accuracy of the neuro-controller.

Copyrighthttp://ee.eng.usm.my

0.9 * y p ( k ) u ( k )
2
1 y p (k )

94

(a)

(a)

(b)

(b)

(c)

(c)
Fig 4: The MRAC of Example 1 when applied
with 20% external disturbance (a) ModelReference and Plant Output (b) Control Signal
(c) Output Error.
The robustness has been tested by applying
bounded external disturbances. The disturbance
is 20% of the selected testing input. This is a
changing step through the first step and for the
20-30 k samples interval. An external bounded
disturbance of 20% is applied to the output of
controlled plant. The same value of disturbance
is applied to the plant output through the second
step change and for the interval of 7080 k
samples. Fig 4(a) and Fig 5(a) show the response
of plant and model reference output for Example
1 and Example 2 respectively. From Fig 4(b) and
Fig 5(b), it is shown that neuro-controllers are
robust and have the ability to deal with the
unexpected environment changes with very good
accuracy. The modeling error is approximately
zero as shown in Fig 4(c) and 5(c).

(d)
Fig 3: The MRAC of Example 2. (a) ModelReference and Plant Output; (b) Control Signal.
(c) Output Error (d) Best MSE.

4. The Robustness of the Proposed


Controller to Output Disturbance
In adaptive control, it is common to consider
only the stability of the controller. In addition,
adaptive controllers are usually designed to be
able to cope with uncertainty [9]. It is important
to investigate the plant behavior in the presence
of external bounded disturbances, which can
affect the input or the output of plant. In this
work, the external disturbances are generated
randomly within a percentage value of the
reference input r (k).

Copyrighthttp://ee.eng.usm.my

95

Equation (11) takes the form of Equation (12) if


z-transform is used. That is:
u (k )
e f (k )

a 0 a1 z

1 z

a2 z

(12)

where
(a)

a 0= k p+ k d
a 1=k p 2 k d + k
a2=kdki

k p = proportional gain
T i = integral time
T d = derivative time
K i = integral gain and kd = derivative gain
(b)

It is an important point to test and judge the


effectiveness of using NNs as an adaptive
controller. The comparison includes the
observation of tracking ability, speed of
convergence and the robustness of neurocontroller compared to a PID controller
described by Equation (12).

(c)
Fig 5: The MRAC of Example 2 with 20%
External Disturbance (a) Model-Reference and
Plant Output (b) Control Signal (c) Output Error.

6.1 PID as an Adaptive Controller for


Some Nonlinear Plant
PID controller was applied to control
Example 1 and Example 2 for the same
requirements that had been used when these
plants were controlled by NNs. The simulation
results of these examples are shown in Fig 6(a)
and 7(a). The figures show the output of the
model- reference and the plant with PID
controller. Figures 6(b) and 7(b) show the
adaptive control action, while Figures 6(c) and
7(c) show the modeling error. Figures 6(d) and
7(d) show the best MSE against the generations
respectively for a change step input. Table 1
represents the different example responses by
PID Controller.

5. PID Controller
The general form of discrete PID controller is
given by.
u.( k ) k p (e f ( k )

T
TS k 1
e f d (e f ( k ) e f ( k 1))) (9)
Ti m 0
Ti

u (k) = control signal at sampling instant .


ef (k) = feedback error signal at sampling instant .

Ts (k) = sampling time.


For a computer control, it is necessary to use the
recursive form, because the information of past
error e(k), does not need to be stored. Now, since

u (k 1) k p e f (k 1)

Ts

k 1

Td

Ti

m0

Ti

e f (m 1)

(e f (k 1) e f (k 2)

(10)
Subtracting Equation (10) from Equation (9)
produce the recursive form. This gives:
u (k)-u (k-1) =a0 ef (k)+a1 ef (k-1)+a2 ef (k-2) (11)

Copyrighthttp://ee.eng.usm.my

96

(a)

(c)

(b)

(d)
Fig 7. The MRAC of Example 2 (a) ModelReference and Plant Output (b) Control Signal
(c) Output Error (d) Best MSE.

Example
NO.

(c)

(d)
Fig 6. The MRAC of Example 1 (a) ModelReference and Plant Output (b) Control Signal
(c) Output Error (d) Best MSE.

Output
of
The
Plant/
Output
of The
ModelReferen
ce

Control
Signal

Output
Error

Final
value of
MSE
After
3000
generati
ons

Referen
ce
Input

Example
1

Fig(6a)

Fig(6b)

Fig(6c)

9.20E-02

Change
Step

Example
2

Fig(7a)

Fig(7b)

Fig(7c)

1.60E-01

Change
Step

Genetica
lly
Tuned
Kp
Ki
Kd

5.32
-2.88
-0.125

- 1.19
0.8
-0.125

Table 1. Summary of results from PID controller


for Example 1 and Example 2.

6.2 Robustness of PID Controller


To investigate the robustness of the PID
controller, 20% external disturbance was applied
to the plant output. Table 2. summaries the
simulation results for example1 and example2
when the plants are affected by a disturbance.

(a)

From the simulation results, the following


notes are observed: slow convergence to the
steady state and the existence of steady state
error.

(b)

Copyrighthttp://ee.eng.usm.my

97

Fig 9. the MRAC of Example 2 with 20%


external disturbance: (a) Model-Reference and
Plant Output (b) Control Signal (c) Output
Error.
Example No.
and%
Disturbance

Output The
Plant/
Output of
The Model
Reference

Example
1

Example
2

(a)

(b)

Referen
ce
Input

Genetically
Tuned
Kp
Ki
Kd

Control
Signal

Output
Error

Fig(8a)

Fig(8b)

Fig(8c)

Chang
Step

5.44
-2.76
- 3.82

Fig(9 a)

Fig(9b)

Fig(9c)

Chang
Step

1.43
0.78
-0.133

Table 2. Response of Example 1 and Example 2


Controlled by PID [-10, 10] with 20%
Disturbance.
The simulation results are used to evaluate
this NNs controller, which has been found to be
superior to PID controller, concerning the figure
of merits obtained by the designer which are
speed of convergence, the tracking ability and
robustness.

(c)
Fig 8. The MRAC of Example 1 with 20%
external disturbance: (a) Model-Reference and
plant Output (b) Control Signal (c) Output Error.

(a)

Performan
ce
Control
Scheme

Steady
state
Error

NNs
Controller

Steady
State
Error
Approxima
tely
Zero

PID
Controller

Existence
of
Error

MSE After
3000
Generation

Robustness
To Output
Disturbanc
e

Speed of
Convergen
ce

Less

Better

Faster

Higher

worse

Slower

Table 3: A general comparison between NNs and


PID controller.
It should be noted that using PID controller
requires a mathematical description of the
unknown plant, while NNs does not need any
mathematical description. This makes the NNs
more suitable to act as controller for different
types of unknown plants.

(b)

7. Conclusion
The comparative study has been made
between NNs and classical PID by applying both
to control different plants. The simulation results
are used to evaluate these controllers. Neural

(c)

Copyrighthttp://ee.eng.usm.my

98

network has act effectively as feedback


controller utilizing the genetic learning. This
controller stores the dynamic behavior of the
selected plant under control and forces it to
follow the model reference. The neuro-genetic
controller has been tested to be powerful with
small number of generation for obtaining the
best parameter and architecture. It performed
well when applied to different plants based on
minimization of error between output of the plant
and output of model-reference. The ability of
NNs to control nonlinear plants was found more
efficient then the PID controller, in terms of the
speed of convergence, tracking ability and
robustness.

References
[1] G.Lightbody, Prof. G.W. Irwin, January
1995 Direct neural Model reference adaptive
control, in: IEE Proc.-Control Theory Appl.,
Vol. 142, No. I
[2] Stephen Yurkovich, Kevin M. Passino,
1999.A aboratory Course on Fuzzy Control,
in: IEEE Transactions on ucation.Vol.42,
NO.1.
[3] Melanie Mitchell, 1998. An Introduction to
Genetic Algorithms, MIT Press.
[4] Kumpati S. Narendra, Cheng Xiang, 2000.
Adaptive Control of Discrete-Time Systems
Using Multiple Models, in: IEEE
Transactions on Automatic Control, Vol. 45,
NO. 9.

[8] M.S. Ahmed, 2000, Neural net based MRAC


for a class of nonlinear plants, in: Neural
Networks 13, 111124.
[9] Butter H.; 1992, Model Reference Adaptive
Control; Prentice Hall International (UK)
Ltd;
Harsa Amylia Mat Makim was
born in Kuala Lumpur, Malaysia,
in November 1971. She received
her B.Eng degree from Liverpool
University United Kingdom in
July, and 1994. She subsequently
undertook Research at Newcastle
University,
United
Kingdom
whom honored her with an M.Sc
degree in 1996. She later pursed
her Ph.D degree until February 1998. Subsequently, she
pursued her research at Universiti Sains Malaysia, whom
then honored her with Ph.D degree. She has published a
number of journal and conference paper and is currently a
lecturer at School of Electrical & Electronic Engineering,
Universiti Sains Malaysia

Marwan. A. Ali was born in


Baghdad, Iraq,in May 1983. He
received his B.Eng degree from
Technology
University
Baghdad, in 2005 in Control and
System Engineering. He is a
Member in Iraqi Engineers Union,
System Engineer in ministry of
Electricity Dora power Station
Baghdad. Currently, he is a master
research student at School of Electrical & Electronic
Engineering, Universiti Sains Malaysia.

[5] M.S. Ahmed, LA. Tasadduq, 1994, Neuralnet Controller for nonlinear plants: design
approach through linearization, in: IEE
Proc.-Control Theory Appl., Vol. 141, No.
5. September
[6] D.T. Pham and D.Karaboga, 1994, Intelligent
Systems Research Laboratory University of
Wales College of Cardiff Cardiff CF2 1XH
United Kingdom, Design of an Adaptive
Fuzzy Logic Controller, in: IEEE.
[7] Jose I. Canelon, Leang S. Shieh *, Nicolaos
B. Karayiannis, 2005, a new approach for
neural control of nonlinear discrete dynamic
systems, in: sciences direct Information
Sciences 174177196.

Copyrighthttp://ee.eng.usm.my

99

You might also like