Fuzzy Logic PDF
Fuzzy Logic PDF
2.1 Introduction
Fuzzy logic idea is similar to the human beings feeling and inference process.
Unlike classical control strategy, which is a point-to-point control, fuzzy logic
control is a range-to-point or range-to-range control. The output of a fuzzy
controller is derived from fuzzifications of both inputs and outputs using the
associated membership functions. A crisp input will be converted to the different
members of the associated membership functions based on its value. From this
point of view, the output of a fuzzy logic controller is based on its memberships of
the different membership functions, which can be considered as a range of inputs.
Fuzzy ideas and fuzzy logic are so often utilized in our routine life that nobody
even pays attention to them. For instance, to answer some questions in certain
surveys, most time one could answer with 'Not Very Satisfied' or 'Quite Satisfied',
which are also fuzzy or ambiguous answers. Exactly to what degree is one satisfied
or dissatisfied with some service or product for those surveys? These vague
answers can only be created and implemented by human beings, but not machines.
Is it possible for a computer to answer those survey questions directly as a human
beings did? It is absolutely impossible. Computers can only understand either '0' or
'1', and 'HIGH' or 'LOW'. Those data are called crisp or classic data and can be
processed by all machines.
Is it possible to allow computers to handle those ambiguous data with the help
of a human being? If so, how can computers and machines handle those vague
data? The answer to the first question is yes. But to answer the second question, we
need some fuzzy logic techniques and knowledge of fuzzy inference system.
The idea of fuzzy logic was invented by Professor L. A. Zadeh of the
University of California at Berkeley in 1965 [1]. This invention was not well
recognized until Dr. E. H. Mamdani, who is a professor at London University,
applied the fuzzy logic in a practical application to control an automatic steam
engine in 1974 [2], which is almost ten years after the fuzzy theory was invented.
Then, in 1976, Blue Circle Cement and SIRA in Denmark developed an industrial
application to control cement kilns [3]. That system began to operation in 1982.
More and more fuzzy implementations have been reported since the 1980s,
including those applications in industrial manufacturing, automatic control,
18 Advanced Fuzzy Logic Technologies in Industrial Applications
As mentioned before, all machines can process crisp or classical data such as
either '0' or '1'. In order to enable machines to handle vague language input such as
'Somehow Satisfied', the crisp input and output must be converted to linguistic
variables with fuzzy components. For instance, to control an air conditioner
system, the input temperature and the output control variables must be converted to
the associated linguistic variables such as 'HIGH', 'MEDIUM', 'LOW' and 'FAST',
'MEDIUM' or 'SLOW'. The former is corresponding to the input temperature and
the latter is associated with the rotation speed of the operating motor. Besides those
conversions, both the input and the output must also be converted from crisp data
to fuzzy data. All of these jobs are performed by the first step fuzzification.
In the second step, to begin the fuzzy inference process, one need combine the
Membership Functions with the control rules to derive the control output, and
arrange those outputs into a table called the lookup table. The control rule is the
core of the fuzzy inference process, and those rules are directly related to a human
beings intuition and feeling. For example, still in the air conditioner control
system, if the temperature is too high, the heater should be turned off, or the heat
driving motor should be slowed down, which is a human beings intuition or
common sense. Different methods such as Center of Gravity (COG) or Mean of
Maximum (MOM) are utilized to calculate the associated control output, and each
control output should be arranged into a table called lookup table.
During an actual application, a control output should be selected from the
lookup table developed from the last step based on the current input. Furthermore,
that control output should be converted from the linguistic variable back to the
crisp variable and output to the control operator. This process is called
defuzzification or step 3.
In most cases the input variables are more than one dimension for real
applications, and one needs to perform fuzzification or develop a Membership
Function for each dimensional variable separately. Perform the same operation if
the system has multiple output variables.
Summarily, a fuzzy process is a process of crisp-fuzzy-crisp for a real system.
The original input and the terminal output must be crisp variables, but the
intermediate process is a fuzzy inference process. The reason why one needs to
change a crisp to a fuzzy variable is that, from the point of view of fuzzy control or
a human beings intuition, no absolutely crisp variable is existed in our real world.
Fundamentals of Fuzzy Logic Control 19
Any physical variable may contain some other components. For instance, if
someone says: the temperature here is high. This high temperature contains some
middle and even low temperature components. From this point of view, fuzzy
control uses universal or global components, not just a limited range of
components as the classical variables did.
With the rapid development of fuzzy technologies, different fuzzy control
strategies have been developed based on different classical control methods, such
as PID-fuzzy control [4], sliding-mode fuzzy control [5], neural fuzzy control,
adaptor fuzzy control [6] and phase-plan mapping fuzzy control [7]. More and
more new fuzzy control strategies or combined crisp and fuzzy control techniques
are being developed and will be applied to many areas in our society in the future.
This chapter starts with an introduction to fuzzy logic control and fuzzy
terminology. Following sections provide detailed description of the fuzzy inference
process and the architecture of fuzzy logic control. Section 2 discusses fuzzy sets
and crisp sets. Fuzzifications and the membership function are covered in Section
3. Fuzzy control rules and defuzzification are discussed in Sections 4 and 5,
respectively. Some related combined fuzzy control methods are provided in the
remaining sections of this chapter.
F = { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 } (2.1)
20 Advanced Fuzzy Logic Technologies in Industrial Applications
XF
A = {x1, x2, x3, x4} F (2.2)
B = {x1, x2, x3} A
It can be seen that all elements in set B belong to set A, or the set A contains set
B. In this case, set B can be considered as a subset of set A and can be expressed as
B A.
The relationship among different sets we discussed above can be described in
Figure 2.1. The basic classical set operations include complement, intersection and
union, which are represented as
F A (computer science)
The representations of those classical set operations are shown in Figure 2.2.
It is clear that an element either belongs to a set or does not belong to that set in
the classical set and its operation. There is a sharp boundary between different
elements for different sets and these cannot be mixed with each other. However,
for the fuzzy set, it has different laws.
The classical set we discussed in the last section can be represented or mapped into
some functions. This means that we can relate set-theoretic forms to function-
theoretic representations, and map elements on one universe of discourse to
elements or sets in another universe. For the classical or crisp sets, this mapping is
Fundamentals of Fuzzy Logic Control 21
very easy and straightforward. Assume that X and Y are two different universes of
discourse. If an element x belongs to X and it corresponds to an element y
belonging to Y, the mapping between them can be expressed as
1, (x A)
PA(x) = (2.6)
0, (x A)
where PA represents 'membership' in a set A for the element x in the universe. This
membership idea is exactly a mapping from the element x in the universe X to one
of two elements in universe Y, or to elements 0 or 1.
F F
AC
A
B A
(a) B A (b) AC
F F
A B A B
(c) A B (d) A B
Still using the example in the last section, a set of faculty members in a college
that contains two subsets A and B, we want to define a new set P(x) as
P(x) = { A, B } (2.7)
and mapping these two sets from universe of discourse F to another universe Y
with two elements, 0 or 1.
Now we can define operations of two classical sets, says A and B, on the universe
F as follows:
As we discussed in the previous section, the classical set has a sharp boundary,
which means that a member either belongs to that set or does not. Also, this
classical set can be mapped to a function with two elements, 0 or 1. For example,
in the previous section, we defined the faculty member in the department of
computer science as set A. A faculty either fully belongs to this set (PA(x) = 1) if
one is a faculty of the computer science department or has nothing to do with set A
(PA(x) = 0) if he is not a faculty in that department. This mapping is straightforward
with sharp boundary without any ambiguity. In other words, this fully belonging
to can be mapped as a member of set A with degree of 1, and not belong to can
be mapped as a member of set A with degree of 0. This mapping is similar to a
black-and-white binary categorization.
Compared with a classical set, a fuzzy set allows members to have a smooth
boundary. In other words, a fuzzy set allows a member to belong to a set to some
partial degree. For instance, still using the temperature as an example, the
temperature can be divided into three categories: LOW (0 ~30 qF), MEDIUM (30
qF ~ 70 qF) and HIGH (70 ~ 120 qF) from the point of view of the classical set,
which is shown in Figure 2.3a.
qF qF
0 30 70 120 0 30 70 120
In the classical set, any temperature can only be categorized into one subset,
either LOW, MEDIUM or HIGH, and the boundary is crystal clear. But in the
fuzzy set such as shown in Figure 2.3b, these boundaries becomes vague or
smooth. One temperature can be categorized into two or maybe even three subsets
simultaneously. For example, the temperature 40 qF can be considered to belong to
LOW to a certain degree, say 0.5 degree, but at the same time it can belong to
MEDIUM to about 0.7 degree. Another interesting thing is the temperature 50 qF,
which can be considered to belong to LOW and HIGH to around 0.2 degree and
belong to MEDIUM to almost 1 degree. The dash-line in Figure 2.3b represents the
classical set boundary.
Fundamentals of Fuzzy Logic Control 23
It is clear that a fuzzy set contains elements which have varying degrees of
membership in the set, and this is contrasted with the classical or crisp sets because
members of a classical set cannot be members unless their membership is full or
complete in that set. A fuzzy set allows a member to have a partial degree of
membership and this partial degree membership can be mapped into a function or a
universe of membership values. Assume that we have a fuzzy set A, and if an
element x is a member of this fuzzy set A, this mapping can be denoted as
P A ( x1 ) P A (x2 ) P A ( xi )
A=
x1
x2
......
i xi
(2.11)
When the universe X is continuous and infinite, the fuzzy set A can be
represented as
P ( x)
A= A (2.12)
x
qF qF qF
0 3 7 12 0 3 7 12 0 3 7 12
(a) Fuzzy set union (b) Fuzzy set intersection (c) Fuzzy set complement
Figure 2.4. Fuzzy set operations
As we discussed in the previous section for the classical set operations, the
basic fuzzy set operations also include intersection, union and complement, and
those operations are defined as
where A and B are two fuzzy sets and x is an element in the universe of discourse,
X. The graphical illustrations of those operations are shown in Figure 2.4.
According to the definition of fuzzy set operations, a fuzzy set union operation
is exactly equivalent to select the maximum member from those members in the
sets, and the intersection operation is selecting the minimum member from the sets.
24 Advanced Fuzzy Logic Technologies in Industrial Applications
Recall that in Section 2.2.1 we defined a college faculty set F, a faculty set for the
computer science department, set A, and a set of faculty members who are under
age 40, or set B. Now we can make a clear comparison for the classical and fuzzy
sets using this example.
According to classical or crisp set theory, set B includes only three members
who are under age 40 (x1, x2, x3), so the boundary between the faculty who are
under age 40 and the faculty who are above age 40 is crystal clear (see solid-line in
Figure 2.5). However, for the fuzzy set theory, set B contains not only those three
members, x1, x2, x3, but also some other members to some varying degree. The
actual age distribution of all ten faculty members is displayed in the x-axis in
Figure 2.5.
It can be found from Figure 2.5 that the member x4 and x5 do not belong to the
set B in the view of the crisp set, but they can be considered as partial members in
a partial membership of 0.7 and 0.3 degrees, respectively. Mapping this to a
membership function, it can be expressed as
1 1 1 0.7 0.3
PB(x) = (2.14)
x1 x 2 x3 x 4 x5
Classical
1
Fuzzy set
x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
32 28 38 42 49 51 58 48 52 61
where the division operator is called a separator, and '+' is the or operator. All other
members whose membership is 0 are omitted from this function.
problem, as we discussed before, three consecutive steps are needed, which are:
Fuzzification, fuzzy inference and defuzzification.
Fuzzification is the first step to apply a fuzzy inference system. Most variables
existing in the real world are crisp or classical variables. One needs to convert
those crisp variables (both input and output) to fuzzy variables, and then apply
fuzzy inference to process those data to obtain the desired output. Finally, in most
cases, those fuzzy outputs need to be converted back to crisp variables to complete
the desired control objectives.
Generally, fuzzification involves two processes: derive the membership
functions for input and output variables and represent them with linguistic
variables. This process is equivalent to converting or mapping classical set to fuzzy
set to varying degrees.
In practice, membership functions can have multiple different types, such as the
triangular waveform, trapezoidal waveform, Gaussian waveform, bell-shaped
waveform, sigmoidal waveform and S-curve waveform. The exact type depends on
the actual applications. For those systems that need significant dynamic variation
in a short period of time, a triangular or trapezoidal waveform should be utilized.
For those system that need very high control accuracy, a Gaussian or S-curve
waveform should be selected.
To illustrate the process of fuzzification, we still use the air conditioner
example developed in the previous section. Assume that we have an air conditioner
control system that is under the control of only a heater. If the temperature is high,
the heater control motor should be turned off, and if the temperature is low, that
heater motor should be turned on, which are common sense.
Regularly, the normal temperature range is from 20 qF to 90 qF. This range can
be further divided into three sub-range or subset, which are
30 40 qF
0
20 60 80 90
Boundary
Support
(a) Membership function of the input
P
Core OUTPUT Motor Speed
1.0
SLOW MEDIUM FAST
30 50 80 R/M
0
10 60 70 100
Support Boundary
The core of a fuzzy set is the set of elements whose degree of membership in
that set is equal to 1, which is equivalent to a crisp set. The boundary of a fuzzy set
indicates the range in which all elements whose degree of membership in that set is
between 0 and 1 (0 and 1 are excluded).
After the membership functions are defined for both input and output, the next
step is to define the fuzzy control rule.
calculate the degree between a fuzzy input T (temperature) and a fuzzy condition
LOW. Here we still use the air conditioner system as an example.
P
T
1.0
Fuzzy Condition
LOW
0.4
0 qF
20 30 40
Two types of fuzzy control rules are widely utilized for most real applications.
One is fuzzy mapping rules and the other is called fuzzy implication rules.
Fuzzy mapping rules provide a functional mapping between the input and the
output using linguistic variables. The foundation of a fuzzy mapping rule is a fuzzy
graph, which describes the relationship between the fuzzy input and the fuzzy
output. Sometimes, in real applications, it is very hard to derive a certain
relationship between the input and the output, or the relationship between those
inputs and outputs are very complicated even when that relationship is developed.
Fuzzy mapping rules are a good solution for those situations.
Fuzzy mapping rules work in a similar way to human intuition or insight, and
each fuzzy mapping rule only approximates a limited number of elements of the
function, so the entire function should be approximated by a set of fuzzy mapping
rules. Still using our air conditioner system as an example, a fuzzy mapping rule
can be derived as
IF the temperature is LOW, THEN the heater motor should be rotated FAST.
.
T
T LOW MEDIUM HIGH
The rows and columns represent two inputs, the temperature input and the
change rate of the temperature input, and those inputs are related to IF parts in IF-
THEN rules. The conclusion or control output can be considered as a third
dimensional variable that is located at the cross point of each row (temperature)
and each column (change rate of the temperature), and that conclusion is associated
with the THEN part in IF-THEN rules. For example, when the current temperature
is LOW, and the current change rate of the temperature is also LOW, the heater
motors speed should be FAST to increase the temperature as soon as possible.
This can be represented by the IF-THEN rule as
IF the temperature is LOW, and the change rate of the temperature is LOW,
THEN the conclusion or output (heater motor speed) should be FAST
All other rules follow a similar strategy, which is very similar to a human
beings intuition.
In this air conditioner example, a total of nine rules are developed. For those
applications that need high control accuracy, the input and output should be
divided into more small segments, and more fuzzy rules should be applied.
Based on this implication and a fact: the temperature is HIGH. The result that
the heater motor should slow down or the SLOW can be inferred.
'
x
'
MOM(FAST) = x T
T = {x |PFAST(x)=Support PFAST(x)} (2.17)
T
where T is the set of output x that has the highest degrees in the set FAST.
A graphic representation of the MOM method is shown in Figure 2.8a.
A shortcoming of the MOM method is that it does not consider the entire shape
of the output membership function, and it only takes care of the points that have
the highest degrees in that function. For those membership functions that have
different shapes but the same highest degrees, this method will produce the same
result.
P P
x x
x x
The Center of Gravity method (COG) is the most popular defuzzification technique
and is widely utilized in actual applications. This method is similar to the formula
30 Advanced Fuzzy Logic Technologies in Industrial Applications
for calculating the center of gravity in physics. The weighted average of the
membership function or the center of the gravity of the area bounded by the
membership function curve is computed to be the most crisp value of the fuzzy
quantity. For example, for the conclusion: the heater motor x is rotated FAST. The
COG output can be represented as
P x
FAST ( x) u x
COG(FAST) = (2.18)
P x
FAST ( x)
P FAST ( x) xdx
COG(FAST) = (2. 19)
P FAST ( x)dx
This defuzzification method is valid only for the case where the output
membership function is an aggregated union result of symmetrical functions [9].
This method can be divided into two steps. First, the consequent membership
function Fi can be converted into a crisp consequent x = fi where fi is the center of
gravity of Fi. Then the COG method is applied to the rules with crisp consequents,
which can be expressed as
w f
i 1
i i
x= M
(2.20)
w
i 1
i
where wi is the degree to which the ith rule matches the input data. The advantage
of this method is its simplicity. Therefore many neuro-fuzzy models use this
defuzzification method to reduce the complex of calculations.
in the associated location in the lookup table according to the current temperature
and temperature change rate. In the following we use the air conditioner system as
an example to illustrate the defuzzification process and the creation of the lookup
table.
To make this illustration simple, we make two assumptions: I. assume that the
membership function of the change rate of the temperature can be described as in
Figure 2.9; II. only four rules are applied to this air conditioner system, which are
'qF/Hour
0
0 0.5 1 2 3 5
Based on the assumption made for the membership function and fuzzy rules,
we can illustrate this defuzzification process using a graph. Four fuzzy rules can be
interpreted as functional diagrams, as shown in Figure 2.10.
As an example, consider the current input temperature is 35 qF and the change
rate of the temperature is 1 qF per hour.
From Figure 2.10, it can be found that the points of intersection between the
temperature values of 35 qF and the graph in the first column (temperature input T)
have the membership functions of 0.6, 0.8, 0.5 and 0.8. Likewise, the second
column (temperature change rate 'T) shows that a temperature change rate of 1 qF
per hour has the membership functions of 1.0, 0.4, 0.4 and 1.0. The fuzzy output
for the four rules is the intersection of the paired values obtained from the graph, or
the AND result between the temperature input and the temperature change rate
input. According to Equation (2.13), this operation result should be: min (0.6, 1.0),
min (0.8, 0.4), min (0.5, 0.4) and min (0.8, 1.0), which produces to 0.6, 0.4, 0.4 and
0.8, respectively.
32 Advanced Fuzzy Logic Technologies in Industrial Applications
S
T LOW 'T
LOW FAST
1.0
0.6 0.6
T MEDIUM 'T
MEDIUM
S
SLOW
0.8 0.8
0.4 0.4
P
Contributed by Contributed by
Rule 2 Rule 4 Contributed by
1.0 Rule 1
MEDIUM
0.8
FAST
0.6 Contributed by
SLOW Rule 3
0.4
0.2
R/M
100 300 500 600 700 800 1000
This defuzzified fuzzy output is a crisp or classical value, and should be entered
into a certain location in a table called the lookup table. Since this fuzzy output
element is associated with a temperature input pair with a temperature of 35 qF
(belonging to LOW in the temperature membership function) and a change rate of
temperature of 1 qF/h (also belonging to LOW in the membership function of
change rate of temperature), this output value should be located in the cross point
.
between the LOW temperature T (row) and the LOW change rate T (column) as
shown in Table 2.2.
Table 2.2 shows an example of a lookup table.
.
T
T LOW MEDIUM HIGH
LOW 600 ? ?
MEDIUM ? ? ?
HIGH ? ? ?
To fill this table, one needs to use the defuzzification technique to calculate all
other fuzzy output values and locate them in the associated positions in the lookup
table as we did in this example. Generally, the dimensions of the fuzzy rules should
be identical with the dimensions of the lookup table as shown in this example. To
obtain more accurate control accuracy or fine fuzzy output element values, one can
divide the inputs, say the temperature input and change rate of the temperature,
into multiple smaller subsets to get finer membership functions. For instance, in
this example, one can define a VERY LOW subset that covers 20 ~ 30 qF for the
temperature input, a LOW subset that contains a range of 30 ~ 40 qF, and so on.
Performing the same process to the change rate of temperature and the heater
motor output, one can get a much finer lookup table.
34 Advanced Fuzzy Logic Technologies in Industrial Applications
interpolation block S is used to smooth the output element of the lookup table. A
feedback signal is obtained from the output of the system.
Input
r=0 Error Lookup
M G S P
Table
+
- Error
Rate
Control Fuzzy
Rules Subset P = Plant
Sensor
Control Fuzzy
Rules Subset
Limits For
Fine Fuzzy Lookup S = Interpolation
Table
Input (coarse)
r=0 Error M Lookup
G S P
+-
Table
Error
(fine)
Rate P = Plant
Control Fuzzy
Rules Subset
Sensor
For a system that needs higher control accuracy, a multiple lookup tables fuzzy
control system is needed, which is shown in Figure 2.13.
Two lookup tables are developed in this control system, a coarse and a fine
table. During the application, the switch between the coarse and the fine table is
under the control of the input error limit. This limit value can be defined by the
user based on the real application. Two-set membership functions and control rules
are utilized in this system to satisfy the requirement of higher control accuracy.
When the system needs quick responses or quick actions, the coarse table is used.
When the system needs high control accuracy or small control errors, the fine
lookup table is selected. The sacrifice for this method is that more memory is
needed to store both coarse and fine tables, and a little longer time is needed to
make decision in selecting table in terms of the input error limit value.
36 Advanced Fuzzy Logic Technologies in Industrial Applications
2.7 Summary
A review of the fundamentals of fuzzy sets, fuzzy rules and fuzzy inference
systems is provided in this chapter. Beginning with crisp or classical sets and their
operations, we derived fuzzy sets and their operations. Classical set membership
functions and fuzzy membership functions are discussed in detail following set
theory. Fuzzy rules are described using an air conditioner control example. The
different defuzzification techniques and their processes are discussed with the same
example step by step. Finally, some other fuzzy techniques are discussed such as
off-line and on-line fuzzy control systems as well as a fuzzy closed-loop control
system including multiple lookup tables.
Because of space limitations, the author cannot cover all different fuzzy
systems and their applications such as sliding mode fuzzy, adaptor fuzzy and
neural fuzzy control systems in one chapter. With the development of new fuzzy
techniques, fuzzy control will play a more and more important role in our society.
References
[1] Zadeh L. A. (1965) Fuzzy Sets. Intl J. Information Control 8:338-353.
[2] Mamdani E. H., Assilion S (1974) An Experiment in Linguistic Synthesis With a
Fuzzy Logic Controller, Intl J. Man-Machine Stud 7:1-13.
[3] Holmblad L. P., Ostergaard J. J. (1982) Control of Cement Kiln by Fuzzy Logic,
Gupta M. M, Sarchez E, Fuzzy Information and Decision Processes, North Holland,
pp. 389-399.
[4] Meng Joo Er and Ya Lei Sun, Hybrid Fuzzy Proportional Integral Plus Conventional
Derivative Control of Linear and Nonlinear Systems, IEEE Trans. On Industrial
Electronics, Vol.48, No.6 December 2001, pp. 1109-1117.
[5] J. C. Wu and T. S. Liu, A Sliding-Mode Approach to Fuzzy Control Design, IEEE
Trans. On Control Systems Technology, Vol.4, No.2, March 1996, pp. 141-151.
[6] Feng-Yi Hsu and Li-Chen Fu, Intelligent Robot Deburring Using Adaptive Fuzzy
Hybrid Position/Force Control, IEEE Trans. On Robots and Automation, Vol.16,
No.4, August 2000, pp.325-334.
[7] H. X. Li and H. B. Gatland, A New Methodology for Designing a Fuzzy Logic
Controller, IEEE Trans. On Sys., Man, and Cybernetics, Vol.25, No.3, March 1995,
pp. 505-512.
[8] John Yen and Reza Langari (1999) Fuzzy Logic Intelligence, Control, and
Information, Prentice Hall.
[9] Mohammad Jamshidi, Nader Vadiee and Timothy J. Ross (1993), Fuzzy Logic and
Control, Prentice Hall.
[10] Ying Bai, Hanqi Zhuang and Zvi. S Roth, Fuzzy Logic Control to Suppress Noises
and Coupling Effects in a Laser Tracking System, IEEE Trans on Control Systems
Technology, Vol.13, No.1, January 2005, pp.113-121.