Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Fuzzy logic has come a long way since it was first subjected to technical scrutiny
in 1965, when Dr. Lotfi Zadeh published his seminal work Fuzzy sets in the journal
Information and Control. Since that time, the subject has been the focus of many
independent research investigation by mathematicians, scientists, and engineers from
around the world. Unfortunately, perhaps because of the term’s connotations, fuzzy logic
did not receive serious notice in this country until the last decade. The attention currently
being paid to fuzzy logic is most likely the result of present popular consumer products
employing fuzzy logic. Over the last several years, the Japaness alone have field for well
over 1000 patents in fuzzy logic technology, and they have already grossed billions of
U.S dollars in the sales of fuzzy logic based products to consumers the world over.
This paper was written to provided engineers, lecturer, researcher and students
interested in fuzzy logic control systems, a systematic structure of concepts and
applications. The required mathematics for reading this paper are not beyond linear
algebra and engineering mathematics. In my paper, include case study and how to use the
fuzzy logic toolbox with MATLAB applications.
Furthermore, we hope that this paper will inspire further investigation, not only in
the area of fuzzy logic control but also in the more general area of intelligent control. For
further reading on the subject of fuzzy logic control, see the book and article cited in the
references. Of course, this paper can also be used as a self study and reference.
The fuzzy logic control system is expected to be able to reproduce the behavior of
the target system. The target system may be human operator in change of a processing
plant. Fuzzy logic control can be pursued in the following stages : select relevant input
and output variables, determine the number of linguistic terms associated with each input
and output variables, choose appropriate family of membership functions, interview
human expert who familiar with the target systems to determine the collection of fuzzy
If-Then rules and membership functions, and refine the membership functions and rules.
PREFACE ii
ABSTACTS iii
LIST OF FIGURES v
LIST OF TABLES vi
I. INTRODUCTION 1
II. FUZZY LOGIC 5
2.1 What and Why Fuzzy Logic 5
2.2 Basics of Fuzzy Sets and Fuzzy Relation 6
2.2.1 Definition of fuzzy sets 6
2.2.2 Fuzzy set operation 8
2.2.3 Properties of fuzzy sets 8
2.2.4 Membership function 9
2.3 Linguistic Variables, Values and Rules 11
2.4 Fuzzy Logic Control 13
III. CASE STUDY 24
IV. BASICS USING MATLAB FUZZY TOOLBOX 30
4.1 The FIS Editor 31
4.2 The Membership Function Editor 33
4.3 The Rule Editor 37
4.4 The Rule Viewer 39
4.5 The Surface Viewer 41
V. CONCLUSION 43
REFERENCES 44
Even today, where hundreds of successful fuzzy logic application have proved the
value of this technology, some scientists still condemn the concept, as this more recent
example shows :
“… Fuzzy logic is based on fuzzy thinking. It fails to distinguish between
the issues specifically addressed by the traditional methods of logic,
definition and statistical decision making …” (Jon Konieki in AI Expert,
1991)
Toshiro Terano (1994) pointed out that three conditions necessary for a new
theory :
• A societal need.
• A new methodology (both ideas and techniques).
• An attractiveness to researchers.
Table 1.1 describes the modern history of fuzzy logic after its invention by Zadeh.
It is incomprehensive and includes just some events but hopeful can be used for
illustration of the fuzzy logic development.
After 1991 fuzzy technology came out of scientific laboratories and became an
industrial tool (Reznik, 1997 ; Altrock, 1995 ; Zilouchian & Jamshidi, 2001 ; Marzuki,
1996). Application of fuzzy logic are as follows :
• Automatic control of dam gates for hydroelectric power plants (Tokyo Electric
Power)
A A
1 1
0 x 0 x
(a) Crisp set A (b) Fuzzy set A
Figure 2.1 Membership function for crisp and fuzzy set
A notation convention for fuzzy sets that is popular in the literature when the
universe of discourse, X, is discrete and finite, is given below for a fuzzy set A by,
µ A ( x1 ) µ A ( x2 ) µ A ( xi )
A = + + .......... = ∑
x1 x2 i xi
and, when the universe, X, is continuous and infinite, the fuzzy set A is denoted by,
µ A ( x)
A= ∫ x
In both notations, the horizontal bar is not quotient, but rather a delimiter. In both
notations, the numerator in each individual expression is the membership value in set A
associated with the element of the universe indicated in the denominator of each
expression. In the first notation, the summation symbol is not for algebraic summation,
but rather is denoting a fuzzy union, hence the “+” signs in the first notation are not
1
0 for x < a
2 [( x − a ) /( c − a )] for a ≤ x ≤ b 0.5
S ( x ; a ,b ,c ) =
1 − 2 [( x − c ) /( c − a )] for b ≤ x ≤ c
1 for x > c
x
a b c
1
S ( x ; c − b , c − b / 2 , c ) for x ≤ c
π ( x; b , c ) =
1 − S ( x ; c , c + b / 2 , c + b for x ≥ c 0.5 b
c
c-b c-b/2 c+b/2 c+ b x
0 for x < a 1
(x - a)/(b - a) for a ≤ x ≤ b
T ( x; a, b, c) =
(c - x)/(c - b) for b ≤ x ≤ c
0 for x > c
a b c x
α β γ δ x
µ(x) Core
1 a : Boundary
0 x
a a
Support
• Linguistic Values
As we saw in the previous section, a linguistic variable is a variable whose
arguments are fuzzy number and more generally words represented buy fuzzy sets. For
example, the arguments of the linguistic variable temperature may be LOW, MEDIUM,
MEMBERSHIP 1.0 0.9 0.7 0.4 0.4 0.8 1.0 0.8 0.4 0.7 0.9 1.0
UNIVERSE OF
DISCOURSE 0 12.5 25 37.5 50 62.5 75 87.5 100 T( oC)
• Linguistic Rules
The mapping of the inputs to the outputs for a fuzzy system is in part
characterized by a set of condition → action rules, or in modus ponens (If – Then) form,
If premise Then consequent.
Usually, the inputs of the fuzzy system are associated with the premise, and the outputs
are associated with consequent. These If-Then rules can be represented in many forms.
Two standard forms, multi-input multi-output (MIMO) and multi-input single-output
(MISO), are considered here. The MISO form of a linguistic rule is :
“ If temperature error is LOW and derivative of temperature error is
NEGATIVE Then change of compressor motor speed is FAST.”
A valid If-Then rule could be even though it does not follow the format of a MISO rule
given above. In this case, one premise term (linguistic variable) has been omitted from
the If-Then rule. We see that we allow for the case where the expert does not use all the
linguistic terms (and hence the fuzzy sets that characterize them) to state some rules.
Inference
Defuzzification
Reference Mechanism
Fuzzification
Input Input Process Output
Rule-base
µN
a b c d e f g
1
µL
1 2 3 4 5 6 7
1
X X+Y<1
Y
• Inference mechanism
An inference mechanism also called an inference engine or fuzzy inference
module, which emulates the expert’s decision making in interpreting and applying
knowledge about how best to control the plant (Passino, 1998).
In the inference mechanism, rules If-Then need to be developed to control the
process. Expert’s knowledge and experience should take place home to develop the
appropriate rule in order to perform an ideal control system. The rules that have been
developed by the expert can be simply by constructing the fuzzy associative memories
(FAM), which associate fuzzy set of output fuzzy variable L with fuzzy sets of input
variables H and N.
For example, by implementing example of figure 2.6, a FAM with 7 times 7-bank
matrix has been construct as in Table 2.2.
N
H
}
a b c d e f g
A 1 2 2 3 3 2 1
B 1 2 3 3 3 2 1
C 2 2 3 4 4 3 2
D 3 3 3 5 5 5 3 Consequents (Outputs)
E 6 5 4 4 5 6 6
F 7 6 5 5 5 6 7
G 7 6 5 5 6 6 7
After developing the FAM, the next stop is the inference engine, the objective of
the inference engine is to make a choice when there are an output variable fuzzy set with
different values. Normally, we can use the Correlation Minimum Encoding technique to
do the inferencing (Ong, 1999). The procedure or the correlation minimum encoding
technique is to choose the minimum value among all the values in a single input variable
fuzzy set, to insert the minimum value to the output variable fuzzy set as shown in figure
2. 8. The figure shows that when the membership function value of the input variable “H”
and “N” is 0.7 at membership function “C” and 0.4 at membership function “d”
respectively, the membership value of the output variable “L” will be 0.4 at membership
function “4”.
Input Fuzzy Variable Output Fuzzy Variable
µH H = C at 0.7
µN µL
N = d at 0.4 L = “4” at 0.4
H N L
z* z
z* =
∫ µ ( z ).zdz
x
∫ µ ( z )dz
x
z* z
z* =
∑ µ ( z ).z
x
∑ µ ( z) x
µ
1
0.9
0.5
z
a b
z
a z* b
∫ z∑
n
k =1
µC k ( z )dz
z =
* z
∫∑
n
k =1
µC k ( z )dz
z
C2
C1
z
z*
z* =
∫µ xm ( z ) z.dz
∫µ xm ( z )dz
where xm is the convex sub-region that has the largest area making up xk.
This condition applies in the case when the overall output xk is non
convex, and in the case when xk is convex, z* is the same quantity as
µ
1
z*
o First (or last) of maxima, This method uses the overall output or union of
all individual output fuzzy sets xk to determine the smallest value of the
domain with maximized membership degree xk. The equation of for z* are
as follow.
First, the largest height in the union [denoted hgt(xk)] is determined,
hgt(xk) = sup µ Xk ( z)
z∈Z
sup : supremum (is the least upper bound), inf : infimum (is the greatest
lower bound).
µ
z*
µH C
µN µL
d “4”
0.7
0.4
0.4
H N L
µH D
µN µL
d “5”
0.4
0.3
0.3
H N L
µL
“4” “5”
0.4
0.3
L
Centroid
Output
Set point + e Fuzzy ∆Z Air Temperature
Temperature Controller Conditioner
-
Sensor
e (oC)
µ∆e
∆e (oC)
µ∆Z
∆Z (rpm)
Therefore, if given :
e = -1.3 oC and ∆e = -1.2 oC
value of e = -1.3 oC satisfies two membership functions i.e. VC and CD with the value of
membership as shown in figure 3.4. Whereas, value of ∆e = -1.2 oC satisfies two
membership functions i.e. NL and NM with the value of membership as shown in figure
3.5.
(c − x) − 1 − (−1.3)
µVC = = = 0.6
(c − b) − 1 − (−1.5)
( x − a) − 1.3 − (−1.5)
µCD = = = 0.4
(b − a) − 1 − (−1.5)
(c − x) − 1 − (−1.12)
µ NL = = = 0.24
(c − b ) − 1 − (−1.5)
( x − a) − 1.12 − (−1.5)
µ NM = = = 0.76
(b − a) − 1 − (−1.5)
0.6
0.4
e (oC)
µ∆e
0.76
0.24
∆e (oC)
0.6
0.4
0.24
∆Z (rpm)
Center of Gravity
You will see the diagram updated to reflect the new names of the input and output
variables. There is now a new variable in the workspace called Aircond that
contains all the information about this system. By saving to the workspace with a
new name, you also rename the entire system. Your window will look something
like this.
1. Select the input variable, error, by double-clicking on it. Set both the Range and
the Display Range to the vector [-2 2].
2. Select Add MFs... from the Edit menu. The window below pops open.
3. Use the pull-down tab to choose trimf for MF Type and 7 for Number of MFs.
This adds seven Triangular curves to the input variable error.
4. Click once on the curve with the leftmost hump. Change the name of the curve to
VC. To adjust the shape of the membership function, either use the mouse, as
described above, or type in a desired parameter change, and then click on the
The numbers in the parentheses represent weights that can be applied to each rule
if desired. You can specify the weights by typing in a desired number between zero and
one under the Weight setting. If you do not specify them, the weights are assumed to be
unity (1).
To change a rule, first click on the rule to be changed. Next make the desired
changes to that rule, and then click on Change rule. For example, to change the first rule
to :
1. If (error not VC) Or (deltaerror not NL) Then (Speedcompressor is not VS) (1)
click not under each variable, and then click Change rule.
The Format pop-up menu from the Options menu indicates that you’re looking
at the verbose form of the rules. Try changing it to symbolic. You will see
1. (error==VC) => (Speedcompressor=VS) (1)
2. (error==CD) => (Speedcompressor=SL) (1)
3. (error==CL) => (Speedcompressor=LS) (1)
There is not much difference in the display really, but it’s slightly more language neutral,
since it doesn’t depend on terms like “if” and “then.” If you change the format to
indexed, you’ll see an extremely compressed version of the rules that has squeezed all the
language out.
1, 1 (1) : 1
2, 2 (1) : 1
3, 3 (1) : 1