and the following layer, the actuation level found
acts on the consequent MFs.
• Layer 2: Layer 2 is responsible for defuzzifica-
tion. The algorithm proposed by (Nrnberger et al.,
1999), suggests the use of the mean of the maxi-
mums method for the defuzzification stage, which
reduces the consequent MFs to simple impulses
located in their maximums.
The learning algorithm of the NEFCON model is
based on the idea of reinforcement learning (Sutton
and Barto, 1998). This algorithm can be divided into
two main phases: creating rules and optimizing the
MFs (Rodrigues et al., 2004; Rodrigues et al., 2006).
To create rules the algorithm may or not receive
a set of initial rules. If a set of initial rules is re-
ceived, then the rule creation phase will optimize it.
It is necessary to specify both the actuation intervals
for each input and the actuation interval for the out-
put, since these intervals enable the interval to com-
pare different-sized inputs and create a rule to reduce
the input of greatest error.
To illustrate this idea, consider the actuation inter-
vals of two inputs (E1 and E2) are [5, 5] and [-0.5,
0.5], respectively. The input E1 error is 1, and the E2
error is 0.3. To calculate the error of an input in terms
of its actuation interval, the value of the input error is
divided by the size of the actuation interval. Thus, the
error of E1 will be 0.1, whereas the error of E2 will be
0.3. Observe that even though it has a smaller abso-
lute value, the value of input E2 is greater than that of
input E1, a situation that leads the algorithm to create
a rule with a tendency to minimize the error of input
E2. Thus, the algorithm will discover which rule from
the set of rules is activated with greatest strength and
greatest µ. This rule will activate an output MF that
will be obtained by comparing the input in its actua-
tion interval and the output interval divided into out-
put MFs.
Different from that suggested by the algorithm
that inspired this work (Nrnberger et al., 1999), a pre-
viously created rule can be modified at any moment if
a different rule is found for the situation. There is also
no need to modify the structure of the MFs, given that
they will be treated in a later phase.
To optimize the MFs, the algorithm uses a strategy
similar to that used by reinforcement learning. When
an input MF is activated, it contributes to reducing or
increasing the error. If the action produced provokes
an increase in system error, this MF has its actuation
field reduced. Otherwise, the MF has its actuation in-
terval increased. A similar situation occurs with the
output MFs. However, with these, the gain or loss
occurs in their intensity; that is, the MF that collab-
orates with the increased error will have its intensity
reduced; otherwise, the intensity will be increased.
Mathematically, we have that the plant E error
is found according to the insertion of inputs into the
plant. The contribution, tr, of each rule for the output
is estimated and error Er is calculated for each rule
unit, according to the following equation,
Er = µ · E · sgn(tr) (1)
in which:
sgn(tr) = tr signal
With these data, the consequent modifications can
be represented by:
∆b
i
= η· µ · E (2)
And the antecedent modifications by:
∆a
(i)
j
= −η· Er · (b
(i)
j
− a
(i)
j
) (3)
∆c
(i)
j
= η· Er· (c
(i)
j
− b
(i)
j
) (4)
in which:
η = Learning coefficient
a, b, c = Vertices of the membership functions
It can be easily observed that the algorithm does
not alter the position of the MF of the antecedents. Its
base is only increased or decreased proportionally on
both sides; that is, if the MF has a positive contribu-
tion, there will be greater likelihood of its occurring
again.
A number of restrictions were inserted to avoid
the overlapping of more than two MFs and to avoid
the emergence of gaps between them. Therefore, an
overlap between zero and 50% must be guaranteed;
that is, the vertices of a triangle must be contained in
the interval corresponding to the middle of the base of
neighboring triangles.
3 APPLICATION IN THE BALL
AND BEAM SYSTEM
The ball and beam system, in which the controllers
were tested, is composed basically of a beam-ball sys-
tem, a servo motor with a reducer gearbox and a ruler
with a ball of reference. There are three sensors, one
to measure the position of the reference ball, another
for the position of the ball to be controlled and one to
measure the angular position of the servo motor (fig-
ure 3).
The aim of the controller is to makethe ball placed
on the beam to follow the pathway specified by the
reference ball. Thus, a control system is designed to
NEURO-FUZZY CONTROL OF NONLINEAR SYSTEMS - Application in a Ball and Beam System
203