You are on page 1of 27

See

discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/220045378

An Introduction to Fuzzy Control


Chapter January 1993
DOI: 10.1007/978-3-662-11131-4

CITATIONS

READS

1,211

771

1 author:
Dimiter Driankov
rebro universitet
94 PUBLICATIONS 4,065 CITATIONS
SEE PROFILE

Some of the authors of this publication are also working on these related projects:

E-care@home View project

All in-text references underlined in blue are linked to publications on ResearchGate,


letting you access and read them immediately.

Available from: Dimiter Driankov


Retrieved on: 09 November 2016

Introduction to Fuzzy Control


Hans P. Geering

Abstract
In this report, some of the basic mathematical definitions and rules
of fuzzy system theory are described inasmuch as they are relevant for
fuzzy control. Two examples are covered in detail, viz., a fuzzy closedloop halting control scheme for the forward motion of a mobile robot in
an automatic factory and a dog chasing a cat using fuzzy control.
Issues of computational efficiency are discussed. And some recommendations to potential designers of fuzzy controllers are summarized.
After studying this report, the reader should be in a position to design
simple fuzzy controllers and simulate the behaviour of the resulting fuzzy
control system on a general purpose digital computer.

IMRT Press
c Measurement and Control Laboratory

Swiss Federal Institute of Technology (ETH)


ETH-Zentrum
CH-8092 Zurich, Switzerland
3rd ed., September, 1998

ii

GEERING: FUZZY CONTROL

CONTENTS

iii

Contents
1 Fuzzy Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 Fuzzification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3 Fuzzy Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4 Fuzzy Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.1 Introducing Fuzzy Variables . . . . . . . . . . . . . . . . . . . . .
4.2 Fuzzification Revised . . . . . . . . . . . . . . . . . . . . . . . . .
4.3 Fuzzy Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3
3
4
4

5 Fuzzy Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1 Fuzzy SISO-Rule . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 Fuzzy AND-Rules . . . . . . . . . . . . . . . . . . . . . . . . . .
5.3 Other Fuzzy Rules . . . . . . . . . . . . . . . . . . . . . . . . . .

5
5
5
6

6 Fuzzy Associative Memory

. . . . . . . . . . . . . . . . . . . . .

7 Defuzzification . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8 Fuzzy Control Systems . . . . . . . . . . . . . . . . . . . . . . . .


8.1 Structure of a Fuzzy Control System . . . . . . . . . . . . . . . .
8.2 Example 1: Closed-loop halting control . . . . . . . . . . . . . .
8.3 Example 2: Dog chasing cat . . . . . . . . . . . . . . . . . . . . .

8
8
10
15

9 Computational Issues . . . . . . . . . . . . . . . . . . . . . . . . . 18
9.1 Efficient Defuzzification . . . . . . . . . . . . . . . . . . . . . . . 18
9.2 Derivatives of the Control Function . . . . . . . . . . . . . . . . . 20
9.3 Observations and Suggestions . . . . . . . . . . . . . . . . . . . . 21
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

22

iv

GEERING: FUZZY CONTROL

FUZZY SETS

Fuzzy Sets

Definition: A fuzzy set s is an ordered pair (X, f ), where X is a vector space


(usually the real line R) and f is a set membership function mapping X onto
the interval [0, 1] of the real line R, i.e., f : X [0, 1].
In a fuzzy control problem, X is the signal space of a signal or a vector
signal, respectively.
A set S X is associated with the fuzzy set s = (X, f ) in a natural way:
S = cl{x X | f (x) > 0} is the closure of the set in X where f attains positive
values.
Notice that the set membership function f is normalized in the sense that
the value f (x) = 1 is attained for at least one element x S X. However, this
normalization has mainly been introduced for practical and intuitive reasons.
Mathematically speaking, this normalization is dispensable.
Usually, a fuzzy set is a constant construct, i.e., a time-invariant part of a
fuzzy control system.
fi
6
NL

NS

@ 

@
 @

@
-10

-20

Z
PS
1
A

T
T
T  A 
T
A
T
T
T A
T
 T0 A
T
0
10

PL

- X
20

Figure 1: Fuzzy sets N L (negative large), N S (negative small), Z (zero), P S


(positive small), and P L (positive large) covering the real line X = R.
The following two scalar characteristics of a fuzzy set will be useful later.
Definition: The weight w and the centroid c of a fuzzy set s = (X, f ) are
defined as follows:
Z
w = f (x) dx
and

R
xf (x) dx
c= R
f (x) dx

where all of the integrals are taken over the signal space X.

GEERING: FUZZY CONTROL

Fuzzification

Consider a signal space X covered by several fuzzy sets si , i = 1, . . . , k. The


fuzzy question is: Given a vector x X, to which of the fuzzy sets si does x
belong or, in which of the sets Si associated with the fuzzy sets si does x lie?
In mathematical set theory, the answer for each of the sets Si is a binary
one. In fuzzy set theory, set membership is by degree.
Definition: Consider a fuzzy set s = (X, f ). An arbitrary element x X
belongs to the fuzzy set s with degree d = f (x).
Hence, the answer to the fuzzy question is: x belongs to each of the fuzzy
sets si to some degree, viz., to degrees di = fi (x), i = 1, . . . , k.
Examples: Consider the fuzzy sets N L, N S, Z, P S, and P L defined on the
signal space X = R which are displayed in Figure 1.
a) The element x = 20 is negative large to degree 1 and negative small,
zero, positive small, and positive large to degrees 0.
b) The element x = 2 is negative large and negative small to degrees 0,
zero to degree 0.52, positive small to degree 0.4, and positive large to
degree 0.

Fuzzy Logic

Fuzzy logic defines the rules governing the operators intersection and union of
fuzzy sets.
Consider two fuzzy sets s1 = (X, f1 ) and s2 = (X, f2 ) defined on the same
signal space X and their associated sets S1 X and S2 X, respectively.
Definition: An arbitrary element x X belongs to the union s1 s2 of the
two fuzzy sets s1 and s2 with degree d = max(f1 (x), f2 (x)).
Definition: An arbitrary element x X belongs to the intersection s1 s2 of
the two fuzzy sets s1 and s2 with degree d = min(f1 (x), f2 (x)).
Consequently, the union operator and the intersection operator yield the
fuzzy sets s1 s2 = (X, max(f1 , f2 )) and s1 s2 = (X, min(f1 , f2 )), respectively.
Notice that the intersection s1 s2 is a degenerated fuzzy set in the sense that
its set membership function min(f1 , f2 ) does not map onto the interval [0, 1] as
requested by the definition of a fuzzy set. This detail is not pursued any further
here because in fuzzy control, all calculations are done with fuzzy variables
rather than with fuzzy sets.

FUZZY VARIABLES

Fuzzy Variables

4.1

Introducing Fuzzy Variables

Definition: A fuzzy variable v is an ordered pair (s, d) where s is a fuzzy set


and d [0, 1] a real bounded variable.
Fuzzy variables arise in the fuzzification operation in a natural way: For the
variable x X, the real variable d is the degree of membership in the fuzzy
set s. (Cf. Section 4.2)
In another interpretation of a fuzzy variable, the real variable d modulates
the fuzzy set s: The scalar d and the set membership function f : X [0, 1] of
the fuzzy set s define a new function g : X [0, 1]. There are two modulation
schemes:
a) linear modulation:
g(x) = d f (x)
b) modulation by clipping: g(x) = min(f (x), d).
g, f
6
a)
p p p p fp p
p
p
ppp
p pp
ppp
ppp
pp p
g
pp p XXX p p p p
HH p p
pp
ppp
pp p
HH
p - X
0
1

6g, f
b)
p p p p fp p
p
p
ppp
p pp
ppp
ppp
g
pp p
p
pp p
@p p p p
pp
ppp
@
pp
pp 
@
p
0
X
1

Figure 2: Example of a fuzzy variable: fuzzy set (X, f ) modulated by d = 0.5:


a) linear modulation, b) modulation by clipping.
The author prefers the linear modulation scheme because the function g obtained by linear modulation typically contains more detailed information about
the structure of the fuzzy variable.
In Section 1, the weight w and the centroid c of a fuzzy set s = (X, f ) have
been defined. Obviously, the weight and the centroid of a fuzzy variable v can
be defined in an analogous way by replacing the set membership function f by
the modulated function g in these formulae.
Notice that the linear modulation scheme results in a linear reduction of the
weight of the fuzzy variable, wv = d ws , while the centroid remains unchanged,
cv cs for all d (0, 1].
For calculations with a fuzzy variable, it is more practical to use the modulated function g than to keep the scalar d and the set membership function
f of the underlying fuzzy set s apart. Furthermore, the restriction g(x) 1 for
all x X can be dropped. This is practical when sums of fuzzy variables are
calculated.

4.2

GEERING: FUZZY CONTROL

Fuzzification Revised

Consider a signal space X covered by the N fuzzy sets s1 , . . . , sN . An arbitrary


element x X belongs to the fuzzy sets s1 , s2 , . . . , and sN to degrees d1 = f1 (x),
d2 = f2 (x), . . . , and dN = fN (x), respectively.
Using fuzzy variables leads to the following definition of the fuzzification
operation.
Definition: The fuzzification operator F maps an element x X to the set of
fuzzy variables {(s1 , f1 (x)), (s2 , f2 (x)), . . . (sN , fN (x))}.
Examples: Reconsider the examples a) and b) of Section 2. With the above
definition we can rewrite the results succinctly in the following way:
a) F : 20 7 {(N L, 1), (N S, 0), (Z, 0), (P S, 0), (P L, 0)} and
b) F :
2 7 {(N L, 0), (N S, 0), (Z, 0.52), (P S, 0.4), (P L, 0)}.

4.3

Fuzzy Vectors

As the example in Section 4.2 shows, introducing vector notation in the range
space of the fuzzification operator F is efficient.
Again, consider a signal space X covered by the N fuzzy sets s1 , . . . , sN .
The fuzzification F(x) of an arbitrary element x X can be represented by an
N -vector in several equivalent ways:

v1
v2
F(x) =
...
vN

(s , f (x))
1 1

(s2 , f2 (x))
(x) =
..

.
(sN , fN (x))

f (x)
1
f2 (x)

= ..
.

fN (x)

The relation operator


= points out the fact that, in the last vector, the fuzzy
sets si are not explicitly noted down but are implied by the indices i.
On the other side, every fuzzy n-vector can be represented by the corresponding modulated set membership functions gi :
(s , d ) (w , c )
g1
v1
g1 g1
1 1
(w
,
d
)
(s
v2 2 2 g2 g2 , cg2 )
.
= .

. =
..
..

. =
..
.
.
.
vn
gn
(sn , dn )
(wgn , cgn )

Here, the relation operator


= points out the fact that the weight wgi and
the centroid cgi do not completely characterize the fuzzy variable vi .
This representation is useful at the outputs of the fuzzy rules describing a
fuzzy controller.

FUZZY RULES

Fuzzy Rules

Fuzzy rules are used in fuzzy control in order to define the map from the fuzzified
input signals (error signals, measured signals, or command signals) of the fuzzy
controller to its fuzzy output signals (control signals).

5.1

Fuzzy SISO-Rule

Consider a fuzzy set se = (E, fe ) defined on the signal space E where the error
signal e lives and a fuzzy set su = (U, fu ) defined on the signal space U where
the control signal u lives. (Usually, E = R and U = R, hence the designation
SISO-rule.)
Definition: The SISO-rule mapping the fuzzy input variable ve = (se , de ) to
the fuzzy output variable vu = (su , du ) (of the fuzzy controller) is defined by
vu = (su , de ).
In the jargon of control engineering, this definition should be read as follows:
If the value e(t) of the error signal belongs to the fuzzy set se to degree de then
the fuzzy set su of the control signal is fired to degree du = de , i.e., modulated
by du = de .
In shorthand notation, the fuzzy SISO-rule is denoted by se su , where
the degree of firing du = de is implied.
The value u(t) of the control signal is obtained later by defuzzification
after all of the fuzzy rules pertaining to the control signal have been processed.

5.2

Fuzzy AND-Rules

Consider two fuzzy sets se1 = (E1 , fe1 ) and se2 = (E2 , fe2 ) defined on the signal
spaces E1 and E2 , respectively, where the error signals e1 and e2 live and a
fuzzy set su = (U, fu ) defined on the signal space U where the control signal u
lives.
Definition: The AND-rule mapping the fuzzy input variables ve1 = (se1 , de1 )
and ve2 = (se2 , de2 ) to the fuzzy output variable vu = (su , du ) is defined by
vu = (su , min(de1 , de2 )).
In the jargon of control engineering, this definition should be read as follows:
If the value e1 (t) of the first error signal belongs to the fuzzy set se1 to degree
de1 and the value e2 (t) of the second error signal belongs to the fuzzy set se2 to
degree de2 then the fuzzy set su of the control signal is fired to the smaller of
the two degrees, i.e., du = min(de1 , de2 ).
In shorthand notation, the fuzzy AND-rule is denoted by se1 se2 su ,
where the degree of firing du = min(de1 , de2 ) is implied.

GEERING: FUZZY CONTROL

The value u(t) of the control signal is obtained later by defuzzification


after all of the fuzzy rules pertaining to the control signal have been processed.
It should be obvious how the definition of the fuzzy AND-rule can be extended to three or more fuzzy input variables.

5.3

Other Fuzzy Rules

In analogy to the fuzzy AND-rules, fuzzy OR-rules or more complicated logical


combinations for fuzzy rules could be defined.
The author prefers to use fuzzy AND-rules exclusively because OR-ing several AND-rules together typically results in a weaker contribution to the overall
fuzzy output variable(s) and the corresponding defuzzified control variable(s).
Therefore, in the remainder of this report fuzzy rule stands for fuzzy
AND-rule or its SISO special case fuzzy SISO-rule.

Fuzzy Associative Memory

For a fuzzy controller, the collection of all of its fuzzy rules is called the fuzzy
associative memory.
For every control cycle, each of the fuzzy rules is evaluated. This can be
done by massively parallel processing. The output of each fuzzy rule is a fuzzy
variable.
The output of the fuzzy associative memory is equal to the (vector) sum of
all these fuzzy variables:
In the case of a scalar control signal u(t), the signal space is the real
P line,
U = R. Summing the fuzzy variables involves calculating the sum gu = j gj of
their modulated functions gj . Notice that the fuzzy variable vu at the output
of the fuzzy associative memory is represented exclusively by the (modulated)
function gu . (I.e., this fuzzy variable has no directly underlying fuzzy set which
is modulated by some degree du to yield the function gu .)
In the case of a vector control signal u(t) Rm , typically, the signal space
1, . . . , m.
of each of the components ui (t) is the real line, i.e., Ui = R for i = P
Summing the fuzzy variables involves calculating the m sums gui = j gij of
index i, i = 1, . . . , m.
the modulated functions gij for eachP
Of course, the summing operator
takes the pointwise sum of its argument
functions. As mentioned in Section 4.1, the sum g(u) may execeed 1 for some
values of the argument u. This poses no problem (cf. Section 7). (Clipping g(u)
to the maximal value 1 would be counterproductive because the centroid of g
would be shifted.)

DEFUZZIFICATION

Defuzzification

Defuzzification is the process of assigning a representative value to a fuzzy variable. Consider a fuzzy variable vu on the signal space U = R which is represented by the modulated function gu .
Definition: The defuzzification operator D maps the fuzzy variable vu to the
centroid u of the modulated function gu ,
R
gu () d
,
u = D{vu } = D{gu } = R
gu () d
where both of the integrals are calculated over the signal space U = R. The
defuzzification operator D is understood to accept an arbitrary representation
of the fuzzy variable vu as its argument.
Upon conclusion of the fuzzy control algorithm, precise values u1 (t), . . . , um (t)
must be assigned to the components of the control vector. However, the fuzzy
associative memory P
yields m fuzzy variables vui (t) represented by their sum
functions gui (, t) = j gij (, t). Defuzzifying yields the control signals
R
gui (, t) d
ui (t) = D{vui (t)} = R
gui (, t) d

i = 1, . . . , m

For the sake of simplicity, one-dimensional signal spaces Ui = R for i = 1, . . . ,


m have been discussed. It would be rather straightforward to use signal spaces of
higher dimensions, in particular U = Rm . The defuzzification of the m control
signals ui (t) would then obviously involve the corresponding multiple integrals
over the signal space U = Rm . In practice, there is no advantage in using
such a generalization.

8
8.1

GEERING: FUZZY CONTROL

Fuzzy Control Systems


Structure of a Fuzzy Control System

Sections 1, 2, and 47 describe all of the elements and operations needed in a


fuzzy controller. Figure 3 shows the block diagram of a fuzzy control system
implementing both feedback control and feed-forward control. All of the signals
w

- i e+

CF F

uo
uc - ?
iu+

CF B

-y

Figure 3: Fuzzy control system consisting of the plant P , the fuzzy feedback
controller CF B , and the fuzzy feed-forward controller CF F .
in Figure 3 are precise (i.e., crisp or non-fuzzy) signals. The internal structures
of the feed-forward controller and the feedback controller are identical.
Figure 4 depicts the major components of the fuzzy feedback controller CF B ,
viz., the fuzzifier F, the fuzzy associative memory F AM , and the defuzzifier D.
e(t)

ve (t)
vu (t)
- F > F AM > D

uc (t)
-

Figure 4: Fuzzy feedback controller.


The wiggly or fuzzy double arrow emphasizes the fact that even for a scalar
error signal e(t), the quantity ve (t) = F{e(t)} is a fuzzy vector (cf. Sections 4.2
and 4.3). On the other hand, vu (t) is a fuzzy variable which is defuzzified to
the scalar control signal uc (t).
Figure 5 shows a detailed block diagram of a fuzzy controller with two input
signals and one output signal. The error signals e1 and e2 are fuzzified to the
fuzzy N -vector ve1 and the fuzzy M -vector ve2 , respectively. The components
of the fuzzy vectors, i.e., the N + M fuzzy variables are shipped to the N M
fuzzy AND-rules. The fuzzy variables at the outputs of the AND-rules are
summed up. This yields the fuzzy control variable vuc at the output of the
fuzzy associative memory and the defuzzified control signal uc . Notice that,
typically, one and the same fuzzy set of the control signal is fired by several of
the fuzzy AND-rules.

FUZZY CONTROL SYSTEMS

>
i
1
AN D >
>
pp
pp
1
>
j
M
AN D >
>
ve1
- F >
p
vuc
p
+ > D
p
ve2
p
- F >
N
>
k
1
AN D >
>
pp
pp
N
>
`
M
AN D >
>

e1

e2

Figure 5: Detailed block diagram of a fuzzy feedback controller.

u
-c

10

8.2

GEERING: FUZZY CONTROL

Example 1: Closed-loop halting control

In a fully automatic factory, parts, subassemblies, and the finished products are
transported by several identical mobile robots. The navigation of the mobile
robots about the factory is fully automated. In this example, the forward motion
along the trajectories is considered only. Getting away from one station and
cruising to the next station is under closed-loop speed control. The robot should
stop at the next station within a very small tolerance for the position error.
Therefore, closed-loop halting control must be implemented.
The problem of designing a fuzzy control scheme for halting control is investigated here.
The following information is available: The robot has a mass of anywhere
between 150 and 450 kg, depending on the actual payload. The maximal cruising
speed is 2 m/s. The positioning error at a station must be less than 1 mm. The
maximal traction force for acceleration and deceleration is 500 N. The nominal
2
deceleration in the approach to a station is a = 1 m/s . There is no requirement
for the smoothness of the acceleration. At every station, within a reach of 2.5 m,
a precise measurement of the instantaneous distance to the stop is transmitted
to the robot at a very high rate. Furthermore, the robot has a precise velocity
sensor.
The following concept for a fuzzy halting controller is chosen:
The control law for the forward motion of the robot is switched from cruise
control to fuzzy halting control as soon as the simultaneous measurements p
and v of the position and the velocity, respectively, satisfy the inequality
v2
.
2a
At the switching time, a non-fuzzy signal generator for the setpoint variable
wp (t) for the position, the setpoint variable wv (t) for the velocity, and the feedforward force uo (t) is initialized as follows:
|p|

wp (0)
wv (0)
uo (0)

= p

p
= sign(p) 2a|p|
= sign(p)mnom a = 250 N .

While the robot is in the halting control mode, the signal generator furnishes
the setpoint values wp (t) and wv (t) and the feed-forward control signal uo (t)
according to the formulae
wp (t)

= wp (0) + wv (0)t + sign(wp (0))

at2
2

wv (t) = wv (0) + sign(wp (0))at


uo (t) uo (0) ,
where t is the time elapsed since the initialization of the signal generator.

FUZZY CONTROL SYSTEMS

11

The error signals ep (t) = wp (t) p(t) and ev (t) = wv (t) v(t) are processed
in a fuzzy feedback controller which produces the feedback force uc (t). The
detailed block diagram of this fuzzy two-input one-output feedback controller
corresponds to the one shown above in Figure 5. Finally, the total traction force
is u(t) = sat{uo (t) + uc (t)}. (It is clipped to +500 N or 500 N, respectively,
whenever the sum exceeds the limit of the available traction force.)
The fuzzy halting control law is deactivated as soon as the velocity vanishes
for the first time, v(t) = 0. Simultaneously, the parking brakes are set.
The fuzzy sets covering the signal space Ep = R where the position error
ep (t) lives are shown in Figure 6. The fuzzy sets covering the signal space
Ev = R where the velocity error ev (t) lives are shown in Figure 7.
fpi
6
PNL
PNS
PZ
PPS
1
HH
@
A
@ 
HH
@
 A
@


HH @ 
A 
@
HH@
A

@
A
HH
@
@
0
-4
-2
0
2

PPL

- p
[mm]

Figure 6: Fuzzy sets for the position error: P N L (negative large), P N S (negative small), P Z (zero), P P S (positive small), and P P L (positive large).

V NL
@

V NS
@
@

-4

@
-2

@
@

fvi
6
VZ
1
@
@

V PS
@
@

@0
0

V PL
@
@

- v
[mm/s]

Figure 7: Fuzzy sets for the velocity error: V N L (negative large), V N S (negative small), V Z (zero), V P S (positive small), and V P L (positive large).
The fuzzy sets chosen for the feedback traction force uc (t) are depicted in
Figure 8. Notice that the centroids of the fuzzy sets U P X and U N X are
located at 500 N and +500 N, respectively, in order to give the fuzzy feedback
controller full authority over the range 500 . . . + 500 N. Furthermore, no fuzzy
set U Z centered at 0 N is introduced in order to obtain stiff characteristics of
the fuzzy feedback control law.
In Figure 9, the set of 20 fuzzy rules defining the fuzzy associative memory
of the fuzzy feedback controller is displayed. The entries of this tabloid should

12

GEERING: FUZZY CONTROL


fui
6
UPS UPL
UNX
UNL UNS
UPX
1
L
T


T
T
L
T
L  T 

T  T L
T
L
T

T
T
L
T
L
T

T
T
L
T

 T T L 0  L  T
T
-500
0
500

- u
[N]

Figure 8: Fuzzy sets for the control of the traction force: U N X (negative extra
large), U N L (negative large), U N S (negative small), U P S (positive small),
U P L (positive large), and U P X (positive extra large).
be read as explained in the following example. Shorthand explanation: P N L
V N L U N X. Longhand explanation: If ep (t) belongs to the fuzzy set P N L to
degree d1 and if ev (t) belongs to the fuzzy set V N L to degree d2 then the fuzzy
set U N X is fired to the smaller of the two degrees, i.e., to degree d = min(d1 , d2 ).

V PL
V PS
vv :
velocity
error

VZ

UPS UPL UPX UPX


UNS

UPS UPL UPX

UNL UNS

UPS UPL

V NS UNX UNL UNS

UPS

V NL UNX UNX UNL UNS


PNL PNS PZ PPS PPL
vp : position error
Figure 9: Fuzzy associative memory for the fuzzy closed-loop servo controller
containing twenty fuzzy rules.

FUZZY CONTROL SYSTEMS

13

In order to evaluate the effectiveness of the proposed fuzzy control scheme,


the mobile robot is simulated. For the simulation, the true robot is modelled
as follows:
p(t)

= v(t)
p(0) = 2 m
1
{u(t) sign(v(t))mg}
v(t)

=
m
v(0) = 2 m/s ,
where m = 150 . . . 450 kg is the true mass of the robot, g = 9.81 m/s2 the
gravitational constant, and = 0.01 the coefficient of roll friction. For the
simulations, digital control with a sampling and control rate of 500 Hz is assumed. This fairly high sampling rate is chosen in order to prevent mechanical
resonances in the mobile robot.
In Figures 10 and 11, the trajectory of the robot is shown in the phase plane
(p, v) in several scales for a true mass m = 450 kg and m = 150 kg, respectively.
For the complete trajectory labelled a), the units for p and v are m and m/s,
respectively. For the increasingly enlarged final parts b), c), and d) of
the trajectory, the units are dm and dm/s, cm and cm/s, and mm and mm/s,
respectively.
As the Figures show, the heaviest robot (m = 450 kg) overshoots the station
by less than 0.2 mm, whereas the lightest robot (m = 150 kg) stops less than
0.2 mm short of the station. Hence, the specifications are met.
This servo control example is deceptively simple because the plant under consideration essentially is a double integrator and because with a PD-controller
or with the equivalent linear state feedback controller one cannot arrive at an
unstable control system, provided the signs of the two control gains are chosen
correctly. The only open question is whether the specifications for the precision
of halting are met.
From the next example it can be inferred that asymptotic stability of a
fuzzy control system is not necessarily obtained by choosing the fuzzy control
scheme with straightforward commonsense logic. As a matter of fact, proving
the asymptotic stability of a fuzzy control system (even of moderate complexity)
can turn out to be very difficult.

14

GEERING: FUZZY CONTROL

Figure 10: Trajectory of a robot with a mass of 450 kg in the phase plane (p, v).
Scales: a) m and m/s; b) dm and dm/s; c) cm and cm/s; d) mm and mm/s.

Figure 11: Trajectory of a robot with a mass of 150 kg in the phase plane (p, v).
Scales: a) m and m/s; b) dm and dm/s; c) cm and cm/s; d) mm and mm/s.

FUZZY CONTROL SYSTEMS

8.3

15

Example 2: Dog chasing cat

In this example, a dog chasing a cat is considered. Like most dogs, this dog
is not smart enough to use proportional navigation. Rather, he tries to always
run in the direction where he sees the cat. The dog would probably explain his
scheme of navigation by the following qualitative rules for choosing the direction
of his next leap: If the cat is straight ahead, I take the next leap in the same
direction; if the cat is a little bit to the left (right), I turn a little bit to the left
(right) for the next leap; if the cat is pretty much to the left (right), I turn quite
a bit to the left (right) for the next leap.
Obviously, a fuzzy one-input one-output feedback controller for this scheme
of navigation can be formulated with five fuzzy sets for the line of sight angle
(tk ), five fuzzy sets for the change of the dogs heading angle (tk ) for the
next leap, and five fuzzy SISO-rules.
Figure 12 shows the fuzzy sets covering the signal space A = [180 , 180 ]
where the line of sight angle (tk ) lives. Figure 13 shows the fuzzy sets covering
the signal space U = R where the change of the dogs heading angle (tk )
lives.

AN L

-180

fi
6
AN S AZ AP S
1
A A B A 
A A  B  A
A A B A
 A  A0 B  A
-45
0
45

AP L

-
180

Figure 12: Fuzzy sets for the line of sight angle: AN L (negative large), AN S
(negative small), AZ (zero), AP S (positive small), and AP L (positive large).

UNL

-180

-90

6fui
UNS UZ UPS
1
@ B B B
@ B B B
 @B B B
  @B 0 B B

-45
0
45

UPL
@

90

@
@
@
180

Figure 13: Fuzzy sets for the dogs change of heading angle: U N L (negative
large), U N S (negative small), U Z (zero), U P S (positive small), and U P L (positive large).
The five fuzzy rules of the fuzzy associative memory of the fuzzy feedback
controller can be written in shorthand as follows: AN L U N L, AN S U N S,

16

GEERING: FUZZY CONTROL

AZ U Z, AP S U P S, and AP L U P L. This should be read as follows:


If (tk ) belongs to the fuzzy set AN L to degree d then the fuzzy set U N L for
the change of heading angle should be fired to degree d, etc.
Since it is not quite clear what the dog means by turning a little bit or
turning pretty much, a multiplicative doggy gain K is introduced. Furthermore, it is assumed that the dog cannot change his heading angle by more than
90 in either direction from one step to the next. This leads to the final control
law
u(tk ) = (tk ) = sat{KD{vu (tk )}} ,
where vu (tk ) is the fuzzy variable at the output of the fuzzy associative memory
at time tk (cf. Figure 4).
In order to evaluate the effectiveness of the dogs fuzzy feedback control, a
dog chases cat scenario is simulated.
In Figures 14 and 15, the cat runs along a rectangular course at constant
speed, starting in the northwest corner. The dog starts running at a position
close to the center of the rectangle. The dogs speed exceeds the cats speed by
32.5 %. A blood stain is left on the ground whenever the dog intercepts the cat
with very high precision but the chase continues immediately.
A natural value for the doggy gain is K = 0.5 since there is no reason why the
dog should turn by more than 45 when the cat is off by 45 . The simulation for
this value of the doggy gain is shown in Figure 14. Obviously, the dog performs
reasonably well. Of course, whenever the dog overshoots the cat, he has to
manoeuvre with a high turning rate until the cat is again in front of him.
In Figure 15, the simulation is done with K = 1. Now, the dog is zig-zagging
most of the time, changing his direction by 90 from step to step. He only
catches the cat because he luckily happens to cut the southeast corner in an
efficient way. Essentially, the dog fails his mission with this high value of the
doggy gain. Note however, that the critical value for the doggy gain depends
on how much the dogs speed exceeds the cats speed.
In [9], the fuzzy pursuit problem of this example has been extended to a
fuzzy pursuit and evasion game, i.e., both the dog and the cat use fuzzy control
schemes.

FUZZY CONTROL SYSTEMS

Figure 14: The dog chases the cat with gain K = 0.5.

Figure 15: The dog chases the cat with gain K = 1.

17

18

GEERING: FUZZY CONTROL

Computational Issues

9.1

Efficient Defuzzification

Consider the task of simulating a fuzzy control system on a general purpose


digital computer. For the simulation of the fuzzy (feedback) controller, Figures
4 and 5 suggest that the following sequence of operations should be executed at
every sampling time:
Fuzzify each of the error signals ei to the corresponding fuzzy vector vei :
vei = F(ei ).
Evaluate all of the fuzzy rules defined for the fuzzy controller. Each of the
fuzzy rules yields a fuzzy variable vj which is represented by the modulated
function gj (u).
Calculate the sum of all of these
fuzzy variables vj in order to get the
P
fuzzy control
variable vu = j vj which is represented by the function
P
g(u) = j gj (u).
Defuzzify theR fuzzy control variable vu by calculating its centroid u:
ug(u)du
.
u = D(vu ) = R
g(u)du

Notice that for piecewise linear functions gj (u), the sum g(u) is also a piecewise linear function and both of the integrals of the defuzzification operation can
be calculated analytically. Therefore, using fuzzy sets with piecewise linear set
membership functions only (such as triangles, trapezoids, or piecewise linear approximations of more sophisticated smooth functions) can lead to rather
efficient program code.
In order to further reduce the run time of the simulation significantly, the
result of the following lemma is needed.
Consider the modulated functions gj , j = 1, . . . , N , and the corresponding
PN
function g = j=1 gj of the fuzzy control signal vu . Let wgj and cgj be the
weights and the centroids, respectively, of the modulated functions gj , i.e.,
Z
w gj =
and

gj (u) du

Z
cg j = Z

ugj (u) du
gj (u) du

1
=
wgj

Z
ugj (u) du .

COMPUTATIONAL ISSUES

19

Lemma: The defuzzified value u of the control variable can be obtained by


evaluating the following purely algebraic equation:
N
X

wgj cgj

j=1

u = D(vu ) =

N
X

.
wgj

j=1

Proof:
Z

ug(u) du
u = D(vu ) = Z

N
X

gj (u) du

j=1

N Z
X

ugj (u) du

j=1

= N Z
=
= Z N
X
X
g(u) du
gj (u) du
gj (u) du
j=1

j=1

N
X

wgj cgj

j=1
N
X

.
wgj

j=1

Notice that the weight wgj and possibly the centroid cgj vary as the degree
dj of firing for the corresponding fuzzy set sj varies.
However, if the linear modulation scheme is used, the variable weights wgj
and centroids cgj can be expressed by the constant weights wj and centroids cj
of the set membership functions fj as follows:
wgj = dj wj

cgj cj

for j = 1, . . . , N .

This observation leads to the following


Corollary: If the linear modulation scheme is used, the defuzzification operation simplifies to
N
X
dj wj cj
u = D(vu ) =

j=1
N
X

.
dj wj

j=1

Of course, the N products wj cj need only be calculated once.


It now is obvious that in the Examples of Sections 8.2 and 8.3 there was
no need to fully specify the set membership functions of the fuzzy sets for the
control variables (cf. Figures 8 and 13, respectively). It would have sufficed to
merely specify their weights and their centroids. This could have been done in
the following equivalent way:

20

GEERING: FUZZY CONTROL

Example 1: Closed-loop halting control


fuzzy set si
UNX
UNL
UNS
UPS
UPL
UPX

centroid ci
500 N
250 N
100 N
100 N
250 N
500 N

weight wi
277
167
111
111
167
277

centroid ci
90
15
0
15
90

weight wi
9
1
1
1
9

Example 2: Dog chasing cat


fuzzy set si
UNL
UNS
UZ
UPS
UPL

9.2

Derivatives of the Control Function

If the linear modulation scheme is used, the simplified defuzzification formula of


the above Lemma lends itself to calculating derivatives of the control function
in a straightforward way.
In order to keep the notation fairly simple, consider a fuzzy feedback controller with the p input signals e1 , . . . , ep , the single output signal u, and N fuzzy
AND-rules. The partial derivative u/ei of the control function u(e1 , . . . , ep )
with respect to the error signal ei is
N
! N
!
N
! N
!
X dj
X
X
X dj
wj cj
dj wj
dj wj cj
wj
ei
ei
u
j=1
j=1
j=1
j=1
=
.
N
!2
ei
X
dj wj
j=1

Notice that j numbers the fuzzy rules rather than the fuzzy sets defined for the
control signal. One and the same fuzzy set of the control signal may be fired by
more than one fuzzy rule (cf. Figure 9).
Discontinuities of these partial derivatives are caused both by the corners
of the (piecewise linear) set membership functions of the fuzzy sets covering
the signal spaces where e1 , . . . , ep live and the corners of the functions
dj = min( ) of the fuzzy AND-rules.

COMPUTATIONAL ISSUES

9.3

21

Observations and Suggestions

For the sake of simplicity, consider a fuzzy SISO feedback controller. From the
formulae for the defuzzification operator and for the derivative of the control
function, the following observations and suggestions ensue:
If none of the fuzzy sets of the control signal u is fired to a strictly positive
degree, the value of the defuzzified control signal is undefined. Therefore,
the signal space E, where the error signal e lives, must be covered completely by its collection of fuzzy sets, and these fuzzy sets should overlap.
In other words, every error e E should belong to at least one fuzzy set to
a strictly positive degree. Furthermore, in the associative memory, every
fuzzy set of the error signal should fire (at least) one of the fuzzy sets of
the control signal.
If two neighbouring fuzzy sets of the error signal touch at e1 but do not
overlap, the control function is discontinuous at e1 . For e = e1 , the result
of the defuzzification operator is undefined. The value of the control signal
must be defined separately. In Example 1 (fuzzy halting control), the
analogous situation occurs for ep = ev = 0. The obvious extra definition
is uc (0, 0) = 0.
Assume that the linear modulation scheme is applied. If in some interval
[ea , eb ] E the error e belongs to exactly one fuzzy set to a strictly positive
degree, the control function is constant on this interval, irrespective of the
shape of this fuzzy set for the error signal. In Example 2 (dog chasing
cat), the dog will turn by = sat{K 15 } if the line of sight angle
is in the interval [15 , 22.5 ], or by = sat{K 90 } if the line of sight
angle exceeds 45 . (Obviously, the dog could improve his performance
significantly by choosing the centroids +45 and 45 for the fuzzy sets
U P L and U N L, respectively, and the doggy gain K = 1.)
Assume that the linear modulation scheme is applied. For the purpose of
implementing a finished design of a fuzzy controller, only the weights wi
and the centroids ci of the fuzzy sets for the control signals are needed in
the defuzzification operation (cf. Section 9.1). On the other hand, the
complete specifications of the set membership functions of the fuzzy sets
for the control signals are needed, if the fuzzy rules of the controller must
be learnt by watching an expert performing the task at hand. This topic
is beyond the scope of this report. The interested reader is referred to [1],
and [8], and the references cited there.
In Section 8, static fuzzy controllers are considered only. The reader
should have no problem in extending these ideas to fuzzy controllers incorporating dynamic compensation. In the simplest case the input signals
of the fuzzy dynamic compensator include the most recent error signals

22

GEERING: FUZZY CONTROL


ei (k) and the delayed error signals ei (k 1), ei (k 2), etc., and perhaps
previously issued control signals uj (k1), uj (k2) etc.. In the latter case it
is efficient to refuzzify the defuzzified control signals in order to obtain the
required delayed fuzzy control variables. All or most of the processing is
performed in the fuzzy part of the controller. In more sophisticated cases,
non-fuzzy dynamic compensation (e.g., in the form of a full state observer)
can be performed in a preprocessor to the fuzzy controller proper.

References
[1] B. Kosko, Neural Networks and Fuzzy Systems: A Dynamical Systems Approach to Machine Intelligence, Prentice-Hall, Englewood Cliffs, NJ, USA,
1992.
[2] H.-J. Zimmermann, Fuzzy Set Theory and its Applications, 2nd ed., Kluwer,
Boston, MA, USA, 1991.
[3] W. Pedrycz, Fuzzy Control and Fuzzy Systems, Electronic & Electrical Engineering Research Studies, Control Theory and Applications Series, vol. 3,
Research Studies Press (Wiley), Taunton, Somerset, England, 1989.
[4] D. J. Dubois, H. M. Prade, Fuzzy Sets and Systems, Academic Press, New
York, NY, 1980.
[5] L. A. Zadeh, Fuzzy Sets and Applications: Selected Papers, Wiley-Interscience, New York, NY, USA, 1987.
[6] M. M. Gupta, T. Yamakawa, (eds.), Fuzzy Computing, Hardware, and Applications, North-Holland, Amsterdam, Netherlands, 1988.
[7] M. Sugeno, (ed.), Industrial Applications of Fuzzy Control, North-Holland,
Amsterdam, Netherlands, 1985.
[8] C.-T. Lin, C. S. G. Lee, Neural-Network-Based Fuzzy Logic Control
and Decision Systems, IEEE Transactions on Computers, vol. 40(1991),
pp. 13201336.
[9] S. Ginsburg, R. Wimmer, H. P. Geering, Clever Dog versus Smart Cat,
Proceedings of the International ICSC Symposium on Fuzzy Logic, pp. A99
A104, Zurich, Switzerland, May, 1995.
[10] H. Kiendl, Fuzzy Control methodenorientiert, Oldenbourg, Munich, Germany, 1997.

You might also like