Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Engng Applic. Artif. Intell. Vol. 7, No. 5, pp.

479-491, 1994
Copyright © 1994 Elsevier Science Ltd
Pergamon Printed in Great Britain. All rights reserved
0952-1976(94)00030-1 0952-1976/94 $7.00 + 0.00

Contributed Paper

Neuro-Fuzzy Controller for Control and Robotics Applications


D. H. R A O
University of Saskatchewan, Saskatoon, Canada

M. M. G U P T A
University of Saskatchewan, Saskatoon, Canada
(Received March 1994; in revised form May 1994)

The purpose of this paper is to develop a neuro-fuzzy controller (NFC) for adaptive tracking in
unknown nonlinear dynamic systems, and for on-line computation of inverse kinematic transforma-
tions of robot manipulators. The NFC is comprised of a conventional fuzzy logic controller in the
feedback configuration and a recurrent neural network in the inverse mode (feedforward) configu-
ration. It is envisaged that the integration of fuzzy logic and neural-network-based controllers will
encompass the merits of both the techniques, and thus provide a robust controller. The fuzzy logic
controller (FLC), based on fuzzy set theory, provides a means for converting a linguistic control
strategy into control actions and thus offering a high level of computation. On the other hand, a
recurrent neural network provides low-level computations and embodies salient features such as
learning, fault-tolerance, parallelism and generalization. The NFC uses a minimum of fuzzy rules for
a given task. The proposed control scheme is implemented for controlling a class of unknown
nonlinear dynamic systems, and for computing the in verse kinematic transformations of a two-linked
robot.

Keywords: Fuzzy logic controller, neural networks, neuro-fuzzy controller, learning and control,
nonlinear systems, robotics.

1. INTRODUCTION matical models. Instead, they use imprecise and quali-


tative understanding of the processes to be controlled.
The conventional approaches in the design of an auto-
During the recent years, neuro-control aspects
matic control system often involve the construction of a
observed in biological species have motivated system
mathematical model describing the dynamic behavior
scientists to develop intelligent control systems. In this
of the plant to be controlled and the application of
endeavour of understanding and emulating salient
analytical techniques to this plant model to derive an
features of biological control functions, two fields
appropriate control law. Usually, such a mathematical
(namely fuzzy logic and computational neural
model consists of a set of linear or nonlinear differential
networks) have grown into two distinct disciplines with
or difference equations, most of which are derived
the main aim of designing robust "intelligent" systems
using some form of approximation and simplification.
for scientific and engineering applications. The theory
The traditional model-based control techniques break
of fuzzy logic, introduced by Zadeh, 3 provides a mathe-
down, however, when a representative model is diffi-
matical morphology to emulate certain perceptual and
cult to obtain due to uncertainty or sheer complexity,
linguistic attributes associated with human cognition.
or when the model produced violates the underlying
However, the fuzzy logic fails to describe the concepts
assumptions of the control law synthesis techniques. ~'2
of fault-tolerance, parallelism and functional approxi-
Modeling of a physical system for feedback control also
mation which are vital to the development of control
involves a trade-off between the simplicity of the model
schemes for unknown and complex systems.
and its accuracy in matching the behavior of the physi-
While the theory of fuzzy logic provides an inference
cal system. On the other hand, human operators do not
mechanism under cognitive uncertainty, computational
always handle control problems with detailed mathe-
neural networks offer exciting advantages such as
learning, adaptation, fault-tolerance, parallelism and
Correspondence should be sent to: Dr M. M. Gupta, Intelligent
Systems Research Laboratory, College of Engineering, University generalization. Neural networks, comprised of process-
of Saskatchewan, Saskatoon, Canada S7N 0W0. ing elements called neurons, are capable of coping with
479
480 D.H. RAO and M. M. GUPTA: NEURO-FUZZY CONTROIA.t~.P,

computational complexity, nonlinearity and uncer- Table 1. A comparativc study bctwecn fuzzy systems and neural
nctworks
tainty. In view of this versatility of neural networks, it is
believed that they hold great potential as building Skills Fuzzy systems Neural networks
blocks for a variety of types of behavior associated with
Knowledge Inputs Human experts Sample sets
human cognition. However, the subjective phenomena acquisition Tools Interaction Algorithms
such as reasoning and perceptions are often regarded
Information Quantitative and Quantitative
beyond the domain of conventional neural-network Uncertainty qualitative
theory. Cognition Decision making Perception
It is interesting to note that fuzzy logic and neural Mechanism Heuristic search Parallel
networks complement each other, and their unification Reasoning computations
Speed Low High
provides the benefits of both the technologies. 4s
Neural networks can deal with imprecise data and ill- Fault-tolerance Low Very high
Adaptation Learning Induction Adjusting synaptic
defined activities; thus they offer low-level computatio- weights
nal features. On the other hand, fuzzy logic provides
Natural Implementation Explicit Implicit
higher-level cognitive features as it can deal with issues language Flexibility High Low
such as approximate reasoning and natural-language
processing. A brief comparison between fuzzy logic and
neural networks from the point of knowledge acqui- are the scaling factors for error (e), change in error (c)
sition, uncertainty, reasoning, adaptation and natural- and the process control (input) change (Au) respecti-
language processing is shown in Table 1.4 The merging vely. The other notations are obvious from the figure.
of these two fields results in an emerging paradigm The dynamics of the overall system shown in Fig. 1 are
called "fuzzy neural networks" or "fuzzy-neural described by the following set of equations:
systems". Fuzzy neural networks are believed to have
Error: e(k) =s(k) - y(k),
considerable potential in the areas of expert systems,
Rate of change of error: c(k) = e(k) - e ( k - 1),
medical diagnosis, control systems, pattern recognition
and system modeling.
Fuzzy control: F[e(k)c(k)=-UF(k),
Neural control: u..(k) = (k)],
This paper describes a neuro-fuzzy controller (NFC)
NFC (total) control: u(k) = UF(k) "b Unn(k), and
that combines a fuzzy logic controller (FLC) and a
Plant output: y(k + 1) =f(q(k), u(k)) (1)
recurrent neural network (RNN) for control and robo-
tics applications. The FLC provides a mechanism to where W[.] represents the nonlinear mapping of the
incorporate human-like control and decision-making neural network, q(k) = [y(k) . . . . , y ( k - n), u ( k - 1),
abilities, while the RNN takes care of the problem of . . . . u ( k - m ) ] x is a state vector, and f(.) is an
functional approximation which is very vital for the unknown nonlinear function representing the dynamics
control of nonlinear systems. With this objective in of the plant and is bounded away from zero; i.e.
mind, the proposed fuzzy neural learning scheme is Of(q, u)/Ou--is O. The details of the FLC and the RNN
described in Section 2. The stability of the proposed are presented in the following subsections.
fuzzy neural scheme is briefly addressed in Section 3.
Computer simulation studies as applied to the control 2.1. Fuzzy logic controller (FLC)
of unknown nonlinear dynamic systems are presented The concepts of fuzzy theory were first introduced by
in Section 4. The application of NFC for computing Zadeh a in 1965 and are used to describe dynamic
inverse kinematic transformations of a two-linked systems that are too complex and/or too ill-defined to
robot is presented in Section 5, followed by conclusions synthesize controllers using conventional mathematical
in the last section. modeling techniques. Mamdani ~1"12 applied the fuzzy
set theory for developing FLCs. Since then, many
researchers have developed FLCs for various appli-
2. NEURO-FUZZY CONTROLLER (NFC)
cations. In general, an FLC consists of a set of linguistic
The NFC proposed in this paper consists of an FLC conditional statements which are derived from human
in the feedback configuration and an RNN as a feedfor- operators, and represents the experts' knowledge about
ward inverse controller, as is schematically shown in the system being controlled. These statements define a
Fig. 1. The FLC ensures adequate performance prior to set of control protocols relating the control conditions
convergence of the neural network weights, and to control actions by "If-Then" rules. The FLC can be
reduces the steady-state output errors. The neural considered as a fuzzy reasoning process; it attempts to
network, once trained, will represent an inverse- utilize expert knowledge in emulating human control
dynamic model of the system under control. This form capabilities. This manifests in the form of qualitative
of learning scheme has been referred to as the information about the process, and this information is
"feedback-error learning technique". 9"~° In Fig. 1, articulated in "If-Then" rules. For example, one of the
F[e(k), c(k)]-=ur(k) is a fuzzy relation of the error, control rules may process the error (e) and the change
e(k), and the change of error, c(k). GE, GC and GU in error (c) to synthesize a change in control for
D. H. RAO and M. M. GUPTA: NEURO-FUZZYCONTROLLER 481


~ Recurrent Neural
Network ]
/
Learningandadaptive~
algorithm J

W ---I---- ~ I GU ,
Dynamic~(,.~
r , [Fuzzif cation ] [ [Defuz:ificationIi__~--.~ ~ Plant
Reference- ~ I ' ~ ¢ I An uF(k)
signal GC I L . . . . ~ ~ / I

t.- l
FuzzyLogic Controller (FLC),
F[e(k), c(k)]

Fig• 1. The proposed neuro-fuzzycontroller (NFC) for control applications.

improving the system performance. A section of the The fuzzy subsets, El, Ci, Ui, are defined by a set of
control rules can be qualitatively described as follows: ordered pairs; i.e.

Rule I: if error (e) is large and the change in error (c) is Ei = {e,/~Ei(e)} • E,
small, then the change in process input (A u) is
medium:
= {c, • c,
Rule 2: else, if error (e) is small and the change in error U,= {Au, Au)} • U (5)
(c) is zero, then the change in process input
(Au) is small: where e, c and Au are elements of the discrete
universes E, C and U, and ~e,(e),,Uc,(C) and/lv,(A u) are
their membership values which provide the degree to
• . . which the element is a member of the subset. Thus, a
Rule n: else, i f . . . coupled ith rule can be described by a fuzzy relation Ri
on a universe of discourse E x C × U with its member-
In this control structure, e, c, Au are linguistic ship function
variables and their values are fuzzy sets expressed using
qualitative terms, such as L A R G E , SMALL, Z E R O , /~R,(e, c, Au) = E(,uE,(e),l~c,(C),,uv,(Au)) (6)
etc. which are denoted by Ei, Ci, Ui over the universes where E(.,., .) is a general representation of the impli-
of discourses E, C, U respectively• Here, these (E, C, cation functions and e • E, c • C and A u • U. The impli-
U) are assumed to be discrete and finite so that each cation function E( . . . . . ) can be described by
universe is a set of elements; i.e. T-operators) 3 For a given task, the choice of an impli-
cation function is a matter of preference and is context
E = {e}, C = {c}, and U = {u}. (2) dependent• In general, all the control rules are put
together and described by a single fuzzy relation R. The
In each control rule, the fuzzy variables are given
function of the controller is to infer the change in
fuzzy values which represent their linguistic signifi-
process input (control signal) from the error and the
cance. These fuzzy values are expressed as fuzzy sub-
rate of change in error based on the fuzzy relation R.
sets of the corresponding universe of discourse. Thus, a
The error and the rate of change in error are obtained
control rule can be abbreviated as
from the actual process and are scaled by the constants
GE and GC before being quantified to the closest
"IfEisEiandCisCithenAuisUi". (3)
element of the universe of discourse• This process of
Suppose the FLC is comprised of N such rules; an obtaining fuzzy values from non-fuzzy inputs is referred
ensemble of these rules may be expressed as to as fuzzification. If these fuzzy subsets of error (e) and
change in error (c) are represented by E-, C- respecti-
N vely, then the process control input U z is given by
U if e is Ei and c is Ci then Au is U~. (4)
n=l U z = E ~-• C z • R (7)
482 D . H . R A O a n d M. M. G U P T A : NEURO-FUZZYCONTROLLER

where • is a compositional operator and R is a fuzzy Rule 4: If e is positive and c is positive, then A u is
relation. The result in (7) is a fuzzy subset; however in positive.
reality a deterministic control decision is required. One
The following fuzzy sets are used to represent the
solution is to choose the element of the universe corres-
fuzzy concepts involved in the above control rules. The
ponding to the maximum membership value of the
membership functions for these fuzzy sets are defined
calculated fuzzy subset U--. In the case where this value
in Fig. 2.
is not unique, the mean value of these elements is
chosen. ~3 The result is then multiplied by a scaling NE: negative error,
factor G U in order to calculate the non-fuzzy change in PE: positive error,
process input. This process of arriving at a non-fuzzy NC: negative change in error,
output is referred to as defuzzification. The three scal- PC: positive change in error,
ing factors GE, G C and G U are chosen by the user and NU: negative change in process input,
are akin to the gain settings of a PID controller. Both ZU: zero change in process input, and
the G E and G C factors affect the performance measure PU: positive change in process input.
and the controller part, while the parameter G U affects
In Fig. 2, the constant L > 0 used in the definition of the
only the output of the controller.13
membership functions is chosen by the designer accord-
In brief, the design of an FLC involves four steps: ~4
ing to the ranges of error, rate of change in error and
(i) a fuzzification interface, (ii) a rule (knowledge)
process control input.
base, (iii) a decision-making logic and (iv) a defuzzifica-
tion interface. These components are interconnected as 2.2. Recurrent neural networks (RNNs)
depicted in the dotted square in Fig. 1.
In this paper, the following four simple basic rules The incredible learning and adaptive capabilities of
have been employed for the FLC, based on common biological neuronal mechanisms have inspired the
sense:
system scientists to base control methodologies on their
biological counterparts. In this effort to understand
Rule 1: I f e is negative and c is negative, then A u is biological control aspects, neural structures and the
negative; brain, the field of artificial neural networks has offered
Rule 2: Ire is negative and c is positive, then A u is zero; the most exciting avenues for new techniques in the
Rule 3: I f e is positive and c is negative, then A u is zero; control paradigm.

L~E
NE I PE

NE: Negative error


PE: Positive error

-L 0 +L e

~C
NC

NC: Negative change in error


PE: Positive change in error

-L
f 0 +L
v

L~u
NU 1 PU
NU: Negative change in process input
ZU: Zero change in process input
PU: Positive change in process input

-L 0 +L Au
Fig. 2. Membership functionsof fuzzysets.
D. H. RAO and M. M. GUPTA: NEURO-FUZZY CONTROLLER 483

Yi(k+l)

Y2(k+I )

y(k+l)

Fig. 3. Single-layerrecurrent neural netowrk with no self-feedbackconnections.

An artificial (computational) neural network consists The linear portion of the recurrent neural network can
of many interconnected nonlinear processing elements be described in matrix form as
called neurons• The conventionally assumed structure
U = Wy + X - wo (10)
of an individual neuron sums its weighted inputs and

iul [Xl] EWwll


yields an output through a nonlinear activation function where
if the weighted sum exceeds an internal threshold.
Using this static model, multi-layered neural networks
are being used for control and other various appli- U A u2 x2 w02
= , X _A and w0 ~
cations. For more details on these aspects, readers are •u
referred to Ref. 15.
As an extension of static neural networks, dynamic
(feedback) neural networks using static neurons with The matrix W in equation (10), called the c o n n e c t i v i t y
feedback were first introduced by Hopfield 16 as a dyna- m a t r i x , is an (n x n) matrix and may be written as
mic model of the biological neural structure. A single- 0 14,'12 14,'13 . . . Win
layer R N N that consists of a static neural network with
W21 0 W23 . • . W2n
feedback connections between the neurons is shown in
W31 W32 0 . . . W3n
Fig. 3. In this figure, the feedback input to the ith W-- (11)
neuron is equal to the weighted sum of neural outputs
yj, where j = 1, 2 . . . . . n. If w~j is the weight which
connects the output of the jth neuron to the input of the Wnl Wn2 Wn3 . . . 0
ith neuron, the total input u~ of the ith neuron can be
e x p r e s s e d as t7
This matrix is symmetrical, wit= w/~, and with the
n
diagonal terms equal to zero, wi~= 0, indicating that no
ui = E woY/+ xi- w0i, i = 1, 2 . . . . , n. (8) connection exists from any neuron back to itself. This
j=l
jv~i condition implies that there is no self-feedback in the
neural structure shown in Fig. 3. The weights of the
In vector form, equation (8) can be rewritten as
RNN can be updated during the learning process using
Ui = wTy + Xi -- Woi, i = 1, 2, . . . , n . (9) the following rule:
where OJ
wil 1 W(k + 1) = W(k) + y 0W(k) (12)
A Wi2 I
Wi , and y & where W(k) is the estimation of the weight vector at
time k, W(k + 1) is the weight vector at time (k + 1), y is
Win .J a step size parameter, that affects the rate of conver-
484 I). H. R A O a n d M. M. G U P T A : NEURO-FUZZYCONTROI.LER

gence of the weights during learning, and J is the FLC are established, based on the definition of the
performance index, usually defined as a square function characteristic energy function of a fuzzy relation R as
of the error. The control signal ug of the neural network
AEc(R, k) = E ( R ~1 - E ( R k- '), k = 1,2, .3 . . . . (15)
at time k may be obtained using only the state and input
of the network at past time (k - 1). For a multi-layered Rule 1: The FLC is said to be stable if
neural network, equation (12) leads to what is known
as the "back-propagation" learning algorithm. AE¢(R, k) <-0, for k---, ~ . (16a)
Rule 2: The FLC is said to be unstable if
AEc(R, k) > 0, for k--+ ~ . (16b)
3. STABILITY CONSIDERATIONS OF THE
NEURO-FUZZY CONTROLLER Rule 3: The FLC is said to be oscillatory with a period
of oscillation r if
As for all dynamic systems, the stability of the NFC
shown in Fig. 1 is an important property that has to be ]AEc(R, k)l = IAEc(R, k + r)l, for k--+ ~ , (16c)
addressed. The control signal to the plant under control
where 1.1 stands for the absolute value, For more
is made up of two components (Fig. 1); one contributed
details on the implementation of the fuzzy rules of
by the FLC denoted as UF(k) and the second by the
stability, readers are referred to Ref. 18.
RNN represented as u,,(k). The stability of the overall
Similarly, the stability of the RNN can be studied by
control system is governed by the stability characteris-
considering the following Lyapunov function
tics of the FLC and the RNN. By using an energy
function of the individual controllers, the stability of E ~ - lyTWy -- xTy + wTy
the overall fuzzy neural system can be established. ~ ~l tl n /t
It is known that a dynamic system is stable if its total
energy decreases monotonically until an equilibrium
i=1 j=l i-I i-I
state is reached. This section presents a brief descrip- j~-I
tion of the stability conditions of a fuzzy dynamic
system developed in Ref. 18. The energy of a fuzzy The energy gradient vector VE of E with respect to y
relation R is can be calculated (17) and is given by:
v E = - ½ ( w F + w ) y - ,,7 + w L (18)

For a symmetrical connectivity matrix of the RNN,


E(R) - - - Z 9(x,, Yi)'f(l~R(x,, Yi)) (13) W T= W, equation (18) may be simplified to
- - t / " rr/
i=1 j=l

VE = - W y - Xr+ Wo
~. (19)

where (p(xi,yj) is the function responsible for the The energy increment may then be written as
position of the fuzzy relation in the Cartesian product;
A E = (VE)TAy = ( - wTy + x • - wo,)Ay, (20)
f ~ R ( x i , Yj)) is the function responsible for the shape
and the spread of the fuzzy relation, and n and m are where Ay ~ [0, 0 . . . . . kyi . . . . . 0] x because only the
cardinals of the Cartesian product. A general expres- ith neural output is updated. Equation (20) may be
sion for the energy of a fuzzy relation R can now be written as
defined as
A E = - wijy j + x i - woi A y i

E. X x F(R)--> !)t (14)

= - uiAyi. (21)
where Xt x X2 x . . . x Xm is a Cartesian product of m
universes of discourses XI, )(2 . . . . . X,, and F(R) is the The product term u~Ay~ is always nonnegative and,
family of the fuzzy relations defined on X. It is shown in therefore, the corresponding energy changes A E in
Ref. 18 that it is possible to "measure" the energy of a equation (21) are nonpositive. It implies that the
fuzzy relation by considering its important physical energy E in the RNN during the learning process will
properties such as the position on the support set, either remain the same or decrease as a result of each
maxima of the membership function, shape, contrast, individual weight update. It is shown a6'~v that the
degree of fuzziness, cardinality, etc. The FLC is said to energy gradient vector VE is nonpositive (negative
be unstable if the energy of the fuzzy relation increases semi-definite) for the conditions w e = w # and w , = 0 .
with time until it finally assumes an "infinite value". These conditions imply that the connectivity matrix,
The F L C is said to be oscillatory if the energy of the equation (11), is symmetrical, with diagonal entries
relation fluctuates with some period of repeatability equal to zero.
with increasing time. The following stability rules of the From the above descriptions it can be shown that
D. H. RAO and M. M. GUPTA: NEURO-FUZZY CONTROLLER 485

asymptotic stability of the NFC consisting of an FLC Six simulation examples will now be presented in this
and a RNN can be achieved by satisfying the stability section, each demonstrating a particular aspect of the
conditions of each controller. control problem.

Example 4.1: This example typifies a general nonlinear


4. C O N T R O L OF U N K N O W N N O N L I N E A R plant represented by the following equation
D Y N A M I C SYSTEMS: S I M U L A T I O N E X A M P L E S
0 . 6 y ( k - 1) + 0.2y(k)
Computer simulations of the proposed NFC as yk+l)=u(k)+ l+u3(k ) (25)
applied to the control of unknown nonlinear dynamic
systems are discussed in this section. It is assumed that The input signal and the output response are shown in
a single-input-single-output (SISO) nonlinear discrete Fig. 4. For convenience, simulation results are plotted
system is of the form: for 800 time steps. The convergence time in terms of
learning iterations required to achieve the desired error
q(k + 1)=f([q(k), u(k)]: State equation tolerance limits was about 1500 learning steps. As can
be observed from the error and output responses, the
y(k)=g(q(k)] : Output equation (22) NFC could drive this unknown nonlinear plant to
follow the desired signal.
where q e 3i" is the state vector, u(k) e 9i ~is the control To compare the performance of the FLC with the
input, f[.] and g[.] are the nonlinear maps on ,qt", f[.] is proposed NFC, the simulation example described
bounded away from zero, and y(k)• ~1 is the plant above was carried out with only the FLC. The output
output. The problem to be addressed in control systems response obtained is shown in Fig. 5. From Figs 4 and
is to find a control signal u(k) that will force the output 5, it is clear that the performance of the NFC was much
y(k) to track asymptotically the desired output yd(k); better than that of an FLC. The desired response was
i.e. obtained from the latter after about 2200 iterations.
However, the performance of the FLC can be
lim [yd(k) -- y(k)] = 0. (23) improved by using finer fuzzy partitioned subspaces.14
k ~ oo

In order to achieve the above objective, the following lnp~ signal Output signal
assumptions about the nonlinear plant are made:

Assumption 1: The plant is of relative degree one (i.e. -- ~ 0.5


the input at k affects the output at k + 1)
Assumption 2: For any k e [0, ~ ) the desired output _ ~ 0.0
y d ( k ) a n d its n - d e r i v a t i v e s y~l)(k), y~2)(k) . . . . . y~")(k),
are uniformly bounded; i.e. m ~ A -0.5

[y~)(k)l ~<m;, i = 0, 1, 2 . . . . , n. (24a) N Z -l.O


200 40( 6O0 800
Assumption 3: There exist optimal neural weights W* Time Steps, k
such that f[.] and g[.] are the approximations of the Fig. 4. Response from the neuro-fuzzy controller (NFC),
nonlinear functions f[.] and g[.] respectively with an Example 4.1.
accuracy e on D, a compact subset of ~", i.e.

max [f[-I I ~, (24b)


1.5.
"~ • [Input sigh'all
maxlg[.]-g[.]l<~e, Vqe onD. (24c) 3 l.O, ."

The fuzzy rules shown in Fig. 2 and described in o ~ 06.


Section 2.1 were implemented for the FLC. The scaling o.o
I" "-"
factors GE, GC and GU were set arbitrarily to 0.5, 0.5
' "-
k.--
- 1 _
and 2.0 respectively. The limit L in Fig. 2 was assigned
a value of 2.5. The weights of the RNN were adjusted
~. ~ -l.0
based on the learning algorithm derived from equation -=& !
(12). The tolerance limits of the error signal were set to -1.5
+0.05 in the simulation studies. As depicted in Fig. 1, 0 200 400 600 800
the reference input s(k) is considered to be the target k
(desired) output yd(k) for nonlinear systems to track. Fig. 5. Response from the fuzzy logic controller (FLC), Example 4.1.
486 D.H. RAO and M. M. GUPTA: NEURO-FUZZY CONTROIA.ER

Example 4.2: This example considers an unknown non- Example 4.3: In this example a nonlinear plant repre-
linear plant governed by the difference equation sented by equation (28) was considered, where the
relation between y(k+ 1) and the past values of the
control input u(k-j) was assumed to be linear, while
y(k+ 1) was a nonlinear function of its past values,
y(k-i). This plant model can be described by the
For simulation purposes, the nonlinear function used is following equation

g[.] = u3(k) + 0.3 sin(2~ru(k- 1))


y(k+l)=f a,y(k-i) + fl~u(k-j) . (28)
+0.1 sin(5xu(k-2)),j=O, 1, 2 (27)

and the plant parameters were ft, = [1.2, 1, 0.08] ~ and The plant parameters and the input signal were the
aeo = [1, 0.9, 0.7] T. The nonlinear function and the plant same as in Example 2. The desired trajectory was a
parameters are assumed unknown. The input to the square input in the interval [ - 0 . 6 , 0.6]. The nonlinear
system was a unit step input. The error and output function used in this simulation example was
responses are shown in Fig. 6(a) for 1000 iterations.
From this figure it can be seen that the error was [0.5y(k)l
initially large, but decreased very quickly to the toler- f['] =~/[1 +yZ(k- 1)+y2(k-2)l j=O' 1, 2. (29)
ance limit. The control signals generated from the FLC
and the R N N are shown in Fig. 6(b). It can be observed The error and output responses obtained for this simu-
from this figure that the control signal from the FLC lation are shown in Fig. 7(a) for 1000 iterations. The
was more significant than that from the RNN during the control signals generated by the FLC and the RNN are
initial learning period. As the learning continued, the shown in Fig. 7(b). From these simulation results it is
control signal from the R N N was more significant than observed that the NFC could make the nonlinear plant
from the FLC, indicating that the former represents an represented by equations (28) and (29) to follow the
inverse model of the plant under control. The learning desired trajectory. The required accuracy was obtained
time required to achieve the desired performance for after about 1500 iterations.
the NFC was about 1800 iterations.

(a)
l.O' | I'
1.2 (a) I
Input signal I
*" Q,) . I Output signal [
,0 I,nput i ° l-
OZ "~Z 0.5. ri

0.8
r(~utput sigaal [ -- o 0.0.
m ~0 0 . 6 " ~ /
..~ ~ -
0.4 ~ / I I r.~ ¢"
,._ ~ Errorsignal I .~ 0-0.5 r
r.,o
0.2
-I.0
.= 0,0 . j .
0 200 400 600 800 1000
0 20o 40O 600 800 1000 k
k

(b) (b) Neural Networki


1.0 1.0- t FLC Output H Output ,
rj
~-~ .. ^
0.8

06
f ~ NeuralNetwork[
Output I
. -

t~l .-i ~ 0.0 - _L-_ --__,


. ~ Z 0.4
./I
IFEeOutputI .,~Z t t
•fi -0.5 " "-'J ~
~ •
0.0 L) -1.0
0 200 400 600 800 10O0 0 200 600 400 800 1000
k k
Fig. 6. Simulation results, Example 4.2. Fig. 7. Simulation results, Example 4.3.
D. H. RAO and M. M. GUPTA: NEURO-FUZZY CONTROLLER 487

Example 4.4: In this example, a nonlinear plant repre- (a)


sented by the equation 1.2 | r

y(k+ 1)=f a~y(k-i) +g fl/u(k-j) (30)


o., ? y ~," 'i ~"
8z
with the following nonlinear functions o
0.4

0.0
I/'\ i
/' /
[2 + cos{7:r (y2(k - 1) + y2(k 2))}1 + exp[-y(k)l -

•r,,o-~ ~O -0.4
f[.] = 1 + y 2 ( k - 1) + y 2 ( k - 2)
(31a)
.-.i o
l~ -o.8 J
and -1.2
0 2~ 400 6~ 8~ 1000
+ u 2 ( k - 1) + u 2 ( k - 2)}l
g[.l - [1 + u3(k)] (31b) k

was considered. The input to the system was a unit step (b)
I NeuralNetw°rkl ~
input. The plant parameters were the same as in 0.6 ~i ut°utl II.l-~J°utput
I I ,,~ ]
Example 4.2. The simulation results, depicted in Fig. 8,
~-~ o.4
show that the plant was able to follow the desired
response very accurately within a short time of about 0.2
I/IT I/ 1
500 iterations.
~ o.o K he, ',,
..~Z
o-0.2
!1"1-11 "11- I I
(a)
"~ 1.2'
~eO
8 ~ l.O.
,~

~-~ o.8~
.
i "~ -0.4
-0.6
0
V
200
k
400 600
VI
800 1000
~e -

itr~putsignal [ Fig. 9. Simulationresults, Example 4.5.


m ~o 0.6 ~
~o4- ~ / Error signal j
~ go.2-
0.0'
"--~L_._
0 100 200 300 400 500 with an arbitrary unknown function of the form
k
[sin{n(y2(k- 1) + 0.5)}]+ X/l{u2(k)+ u2(k - 1) + u2(k - 2)}1
(b) A.]- [1 + y2(k - 1) + y2(k - 2)]
r..) o,, I 1 (33)
/ NeuralNetworkl
0.6 ~,~ / Output ] In equation (32) tiff and aeb represent the feedforward
and feedback parameters of the plant. In this simula-
tion example, the values of these parameters are
0.4- "-'~"""- ] ,,
assumed to be: fife= [1.2, 1, 0.8] T and afb = [1, 0.9, 0.7] T.
,.~Z
t.,"l

"6~
O

o=~/\
• oo,p= I The input to the system (the desired response) was
s(k) = sin(2~rk/250) in the interval [ - 1 , 1]. The input
and output signals are shown in Fig. 9(a) for 1000
8~ 0.0' iterations. The control signals generated from the FLC
0 100 200 k 300 400 500 and the RNN are shown in Fig. 9(b). The learning time
required to achieve the desired performance from the
Fig. 8, Simulationresults, Example 4.4. NFC was about 1800 iterations. The FLC, without the
RNN, with minimum rules could not control the plant
described in equations (32) and (33) to follow the
Example 4.5: This example considers a nonlinear plant desired signal.
governed by the difference equation E x a m p l e 4.6: The purpose of this simulation example is
to demonstrate the adaptive capability of the proposed
y ( k + 1) = f a , y ( k - i) + flju(k-j) (32) fuzzy neural system for variation in the nonlinear char-
/=0 acteristics of the plant under control. The nonlinear
488 D. It. RA() and M. M. GUPTA: NEURO-FUZZYCONTROLLER

Change in nonlinearity] 5. COMPUTATION OF INVERSE


KINEMATIC TRANSFORMATIONS
1.2
/~ /~ 1 A robot manipulator (or arm) is comprised of "links"
// \ / / / /!
0.8
_
8z
0.,
/A
'&\ [ ' ' ' / fill ~ ' I /f
connected by "joints" in the form of an open chain with
one end fixed while the other end is free. The free end
is also referred to as the "end-effector". The joints are
-0.4 rotary (revolute) and/or prismatic (linear). A revolute
.......
joint allows relative rotation, while a prismatic joint
• ~ e-.

allows a linear motion between the two links. The


-i Output signal I
number of joints determines the degrees of freedom
~l~t~ -1.6
i L ;,,tsig° i
• I I ,
(DOF) for the manipulator. The work (task)-space of a
-2.0 robot arm is the total volume swept out by the end-
0 200 400 600 800 1000 effector as the arm executes all possible motions. ~ Of
k course, not all the points in the work plane are reach-
Fig. 10. Simulation results, Example 4.6. able by the arm because of the constraints imposed by
its geometry.
The forward kinematics problem is concerned with
the determination of the configuration (position and
orientation) of the end-effector for a given set of the
plant to be controlled was the same as in Example 4.2, joint variables such as angles and lengths. The joint
with the following nonlinearity variables are the angles in the case of rotational joints,
and the link extension in the case of prismatic or sliding
f[.] = exp[(y2(k- 1) + y 2 ( k - 2))] joints. Thus, the forward kinematics problem uniquely
+ ~v/[{u2(k)+ U2(k - 1) + uZ(k - 2)}[, relates the given set of joint variable (the angles
between the links 0, and the link lengths L) vector, r/,
for k<500. (34)
to a set of task-space coordinate vector, X, by a relation
At a time step of k = 500, the nonlinear characteristic of
the plant was changed to: X--- c#[r/] (36)

f[.] = sin{Jr(y2(k - 1) +yZ(k - 2))} where cp is a continuously differentiable nonlinear func-


tion and q = [0, L] v. Equation (1) has a unique solution
+ ~/[{u2(k) q- u2(k - 1)+ u2(k--2)}l, in the sense that for a given set of joint angles 0 and link
for k/> 500. (35) lengths L, the configuration of the end-effector within
the task-space can be uniquely determined. The more
The input to the system was s(k) = sin (2Jrk/250). The difficult problem, which is of primary practical import-
input and output signals are shown in Fig. 10. From this ance in robot manipulation and is the subject of this
figure it can be observed that the fuzzy neural system section, is the inverse kinematics transformation
was able to adapt to the change in nonlinear character-
istics and coerce the plant to follow the desired trajec- r/= q~-'[X]. (37)
tory. In other words, the inverse kinematics problem may be

~ Recurrent Neural I 1
~---] Network I
Actual End-Effector
Coordinates

DesiredEnd-Effector Y
Coordinates
q PositionErrors EstimatedJoint
Angles

Fig. 11. The neuro-fuzzy controller scheme for computing inverse kinematic transformations.
D. H. RAO and M. M. GUPTA: NEURO-FUZZYCONTROLLER 489

Y Specifically, the coordinates x and y are defined as


End-Effector x = LI cos(00 + L2 cos(01 ÷ 02),
and
~x,y) Link Lengths y = L1 sin(01) + L2 sin(01 + 02). (38)
LL2 / / , / 2 L I = 0.5 mt The above equations in x and y are the "forward"
L2= 0.5 mt kinematic equations of the robot. For the lengths (L1,
Angle Constraints L2), the point coordinates (x, y) of the end-effector are
°
0 < 0 1< 180 °
uniquely determined by the two variable joint angles
(0~, 02). The task at hand is to compute the joint angles
J " Motors 0°< 0 2 < 180° (01, 02) for a given end-effector Cartesian position
without analytically solving equation (38). In the simu-
~X
lation examples discussed below, the lengths of the two
links were 0.5 m.
Fig. 12. A two-linkedrobot manipulator.
Example 5.1: In this example, the desired position of
the end-effector was chosen randomly at Xd= --0.85
and Yd= 0.5. These coordinates served as inputs to the
neural network. The weights of the neural networks
stated as follows: 19 given a desired position and orien- were adjusted until the output error decreased to a pre-
tation of the end-effector, determine a set of joint set tolerance limit of +0.05. The initial position of the
variables that achieve the desired position and orien- end-effector was arbitrarily set at x = 0.2, y = 0.4. The
tation. The accuracy of a robot manipulator pertains to desired and the obtained x - y coordinates of the end-
its ability to move in a given particular task space to effector and the position error trajectories ex and er are
specific Cartesian positions that are not necessarily shown in Fig. 13(a) and (b) respectively.
pretaught. As a consequence, the inverse kinematics In sequel to this, different desired Cartesian
problem can become quite important, as it must be locations were presented to the NFC. The targeted and
solved in order to position the end-effector at an the actual positions of the end-effector are shown in
appropriate Cartesian location. In the discussion which Fig. 14. As can be observed from this figure, the NFC
follows, rigid robot structures are assumed, which could learn the different desired patterns in the robot
means that the link lengths are constant. task-space.
This section presents computer simulation studies
E x a m p l e 5 . 2 : In this simulation example a scenario is
that demonstrate the effectiveness of the proposed
considered where the desired end-effector positions
NFC as applied to inverse kinematic transformations.
were changed during the learning process. Initially, the
The computational scheme employed for this task is
desired end-effector locations were: xd = - 0 . 4 and y0 =
shown in Fig. 11. The desired end-effector x - y
0.5. At time instant k=150, these positions were
positions served as inputs to the first two neurons of the
changed to: XO= 0.7 and Yd--0.9. The simulation results
neural network. The assumption made here is that the
obtained for this example are shown in Fig. 15. This
torque (joint angles) fed to the robot manipulator is the
example demonstrates that the NFC scheme exhibits
sum of the feedback torque generated by the FLC and
learning and adaptive capabilities.
the feedforward torque generated by the RNN. As
Extensive simulation studies were conducted to study
shown in Fig. 11, the feedback torque is calculated
the effectiveness of the proposed neuro-fuzzy con-
from the error generated as a result of the mis-match
troller scheme. It was observed that the NFC could
between the desired and the actual end-effector
learn the new target patterns and adapt to the changing
positions. Two sets of fuzzy rules are implemented for
patterns. By slightly modifying the knowledge-base of
X and Y Cartesian coordinates of the end-effector. This
the fuzzy logic controller, the proposed scheme can be
section discusses the computer simulation results for a
extended to multi-linked robot manipulators.
2-1inked robot.
Consider a 2-1inked robot shown in Fig. 12. The
point (x, y), the free tip of the second link, also called 6. CONCLUSIONS
the "end point", describes the trajectories based on a A new NFC consisting of an FLC and an RNN is
Cartesian coordinate system. The origin of the coordi- proposed in this paper. The proposed scheme has been
nate system is the first joint, which is assumed to be implemented to control unknown nonlinear dynamic
fixed in space, while the end-point coordinates (x, y) systems. It is shown that the integration of fuzzy con-
are located with respect to the two perpendicular axes, troller and neural networks could combine the advan-
X, Y. The relationship between these two angles, tages of both the disciplines. The uniqueness of the
defined as 01, 02 and the end-point coordinates, x and y, proposed scheme is that it avoids building an extensive
form the kinematic equations of the 2-1inked robot. knowledge-base comprised of fuzzy rules; in other
490 D.H. RAOandM. M. GUPTA: NEURO-FUZZYCONTROLLER

(a) Changed Final


0.6 (a) position
1.0
0.5 00000 a ~ l k (0.7, 0.9) [] t:~o
0.8 an ~ []
0.4
Final position
0.3 (-0.85, 0.5) ha/
O
O [] Final position
r,.) 0.2
Initial position "-"lP'n [] I
0.4
rn (-0.4.0.5) r n ~ " 4, 0.2)
(0.4, 0.2) [] []
0.1 I-i 02 [] o ° \
t~ rt Initial position
0.0 ! ! I
0.0 . . . . . . . . .
-1.0 -0.5 0.0 0.5 1.0 -l.0 -0.5 0.0 0.5 1.0
X- Coordinate X- Coordinate
(b)
t.0. (b) Change in Desired Position
i/ey 1.0.
'o= 05 ~
.~ .
•~ 0.0~ T

~-05. /
,0 \/; rex
....
t.., 0.0.

~" -0.5
o
~ -2.0. e I
X
O
0 25 50 75 100 125 150 ~ -1.0 I

Learning Iterations 0 50 100 150 200 250 300


Fig. 13. Simulation results, Example 5.1. Learning Iterations
Fig. 15. Simulation results, Example 5.2.

1.0 n e t w o r k . W i t h t h e initial findings r e p o r t e d in this


p a p e r , it is d e m o n s t r a t e d t h a t the N F C with a m i n i m u m
0.9"
n u m b e r o f fuzzy rules c o u l d m a k e u n k n o w n n o n l i n e a r
00.8" d y n a m i c s y s t e m s t r a c k the d e s i r e d t r a j e c t o r i e s a d a p t i -
vely, a n d c o m p u t e the i n v e r s e k i n e m a t i c t r a n s f o r m a -
._~0.7
tions o f r o b o t m a n i p u l a t o r s to d r i v e the e n d - e f f e c t o r to
reach the target positions. However, more research
0.5 efforts a r e n e c e s s a r y in d e v e l o p i n g a unified t h e o r y o f
fuzzy logic a n d n e u r a l n e t w o r k s .
0.4 i i i i i
-0.6 - 0 . 4 -0.2 0.0 0.2 0.4 0.6
X Amplitude REFERENCES
Fig. 14. Illustration of the actual and the learned positions of differ- 1. Handelman A. D., Stephen H. L. and Gelfand J. J. Integrating
ent trajectories, Example 5.1. neural networks and knowledge-based systems for intelligent
robotic control. 1EEE Control Syst. Mag. 77-87 (1990).
2. Shin K. G. and Cui X. Design of a knowledge-based controller
w o r d s , t h e N F C r e q u i r e s a m i n i m u m set o f fuzzy rules. for intelligent control systems. IEEE Trans. Syst. Man Cybernet.
Therefore, the NFC circumvents the problem of form- 21,368-375 (1991).
3. Zadeh L A. Fuzzy sets. Information and Control 8, 338-353
ing a k n o w l e d g e - b a s e b a s e d o n t h e h u m a n e x p e r t ' s (1965).
k n o w l e d g e , which is always s u b j e c t i v e a n d lacks a 4. Gupta M. M. and Rao D. H. On the principles of fuzzy neural
s t a n d a r d m e t h o d o l o g y . 7 W i t h n e u r a l n e t w o r k s func- networks. Fuzzy Sets Syst. 61, 1-18 (1994).
5. Gupta M. M. and Knopf G. K. Fuzzy neural network approach
t i o n i n g in the s a m e p a r a d i g m , t h e n o n l i n e a r i t i e s a n d to control systems. Proceedings of ISUMA, MD, pp. 483-488
u n c e r t a i n t i e s can b e c o m p e n s a t e d for by t h e salient (1990),
f e a t u r e s o f n e u r a l n e t w o r k s . It is e n v i s a g e d t h a t fuzzy 6. Buckley J. J. and Hayashi Y. Can fuzzy neural nets approximate
continuous fuzzy functions. Fuzzy Sets Syst. 61, 43-51 (1994).
n e u r a l s y s t e m s for c o n t r o l a p p l i c a t i o n s will h a v e the 7. de Silva C. W., Gosine R. G., Wu Q. M., Wickramarachchi N.
f o l l o w i n g f e a t u r e s : (i) it will b e e a s y to i m p l e m e n t t h e and Beatty A. Flexible automation of fish processing. Engng
natural language that embodies human knowledge, and Applic, Artif. lntell. 6, 165-178 (1993).
8. Rao D. H. and Gupta M. M. Fuzzy neural system for control
(ii) a n y c h a n g e s in t a s k a n d t h e e n v i r o n m e n t can easily applications. IFAC Symposium on Intelligent Components and
be t a k e n c a r e o f by a d a p t i n g t h e weights o f t h e n e u r a l Instruments for Control Applications, Budapest, Hungary (1994).
D. H. RAO and M. M. GUPTA: NEURO-FUZZY CONTROLLER 491

9. Miyamoto H., Kawato M., Setoyama T. and Suzuki R. 15. Gupta M. M. and Rao D. H. Neuro-control systems: a tutorial.
Feedback-error-learning neural network for trajectory control of In Neuro-Control Systems: Theory and Applications, pp. 1-43.
a robotic manipulator. Neural Networks 1,251-265 (1988). IEEE Press (1994).
10. Rao D. H. and Gupta M. M. Dynamic neural adaptive control 16. Hopfield J. J. Neural networks and physical systems with emer-
schemes. In Proceedings of American Control Conference, San gent collective computational abilities. Proc. Natn. Acad. Sci. 79,
Francisco, pp. 1450-1454 (1993). 2554-2558 (1982).
11. Mamdani E. H. Application of fuzzy algorithms for control of 17. Zurada J. M. Introduction to Artificial Neural Systems. West
simple dynamic plant. Proc. IEE 121, 1585-1588 (1974). Publishing Co., St Paul, Minn. (1992).
12. Procyk T. J. and Mamdani E. H. A linguistic self-organizing 18. Kiszka J. B., Gupta M. M. and Nikiforuk P. N. Energetistic
process controller. Automatica 15, 15-30 (1978). stability of fuzzy dynamic systems. IEEE Trans. SMC 15, 783-
13. Gupta M. M. and Qi J. Design of fuzzy logic controllers based on 792 (1985).
generalized T-operators. Fuzzy Sets Syst. 40, 473-489 (1991). 19. Spong M. W. and Vidyasagar M. Robot Dynamics and Control.
14. Lee C. C. Fuzzy logic in control systems: fuzzy logic controller-- Wiley, New York (1989).
Part I and II. IEEE Trans, SMC 20, 404-435 (1990).

AUTHORS' BIOGRAPHIES
Madan M. Gupta received the B. Eng. (Hons.) and the M.Sc. in Electronics-Communications Engineering, from the Birla
Engineering College (now the BITS), Pilani, India, in 1961 and 1962, respectively. He received the Ph.D. degree from the
University of Warwick, England, in 1967 in adaptive control systems. Dr Gupta is currently Professor of Engineering and the
Director of the Intelligent Systems Research Laboratory and the Centre of Excellence on Neuro-Vision Research at the
University of Saskatchewan, Canada. He was elected Fellow of I E E E and Fellow of SPIE. Dr Gupta has served societies such
as I E E E , IFSA, I F A C , SPIE, N A F I P , UN, CANSFINS, and ISUMA. He has been elected as a visiting professor and a special
advisor to the European Centre for Peace and Development (ECPD), University for Peace. In addition to over 400 research
papers, Dr Gupta has co-authored two books on fuzzy logic, and has edited fourteen volumes. Dr Gupta's present research
interests have expanded to the areas of neuro-vision, neuro-control and integration of fuzzy-neural systems, neuronal
morphology of biological vision systems, intelligent and cognitive robotic systems, cognitive information, new paradigms in
information processing, and chaos in neural systems. He is also developing new architectures of computational neural
networks, and computational fuzzy neural networks for applications to advanced robotic systems.
Dandina H, Rao was born in India. He received his B.E. degree in Electronic Engineering from B.M.S. College of
Engineering, Bangalore University, India in 1976. After working for a year in industry, he obtained his M.E. degree in control
systems from P.S.G. Institute of Technology, Coimbatore, University of Madras, India in 1979. From April 1979 to October
1982, he worked as a lecturer at M. S. Ramaiah Institute of Technology, Bangalore, India. From November 1982 to September
1988, he was an Assistant Professor at Gogte Institute of Technology, Belgaum, India, where he was also the head of the
Department of Electronics and Communication Engineering from 1984 to 1988. In 1988, he joined the University of
Saskatchewan, Canada, where he obtained the Master of Science degree in 1990, and Ph.D. in 1994 in the field of neuro-
control systems. He has coauthored over 40 technical papers and some of his work has appeared in edited books. His research
areas of interest are adaptive control, neural networks, and fuzzy logic.

You might also like