Fuzzy Logic and Fuzzy Control Systems: Report By: Hatef Khadivinassab
Fuzzy Logic and Fuzzy Control Systems: Report By: Hatef Khadivinassab
Spring 2010
Acknowledgement
The author is greatly indebted to Dr.Mehran Mirjaafari to introducing the fuzzy logic.
Furthermore, he is utterly grateful to Dr.Abdolreza Rahimi for his useful lectures and his
constructive comments on this report.
i
Abstract
A. Fuzzy sets
Fuzzy sets are class of connected series of objects, characterized by grade of membership
ranging between zero and one.
B. Fuzzy logic
As an extension of the case of multi-valued logic, valuations m: V 0 →W of
propositional variables V0 into a set of membership degrees W can be thought of as
membership functions mapping predicates into fuzzy sets (or more formally, into an
ordered set of fuzzy pairs, called a fuzzy relation). With these valuations, many-valued
logic can be extended to allow for fuzzy premises from which graded conclusions may be
drawn.
I. Inference Mechanisms
Inference mechanisms can be either based on fuzzy logic or non-fuzzy (crisp)
logic; Fuzzy inference systems will be discussed in this report.
i
Content
2. Introduction…………..
…………………………………………………………………………………………….1
3. Fuzzy
Sets…………………………………………………………………………………………
………………….2
4. Fuzzy Logic…..
………………………………………………………………………………………………
……..3
5. Fuzzification……………..
…………………………………………………………………………………….……6
6. Defuzzification...……………..
……………………………………………………………………………………7
7. Fuzzy Control: An Example….
……………………………………………………………………………….8
8. References……..……….
………………………………………………………………………………………….12
i
Introduction
Fuzzy logic was first proposed by Lotfi A.Zadeh of the University of California at
Berkeley in a 1965 paper. He elaborated on his ideas in a 1973 paper that introduced the
concept of "linguistic variables", which in this article equates to a variable defined as a
fuzzy set. Other research followed, with the first industrial application, a cement
kiln built in Denmark, coming on line in 1975.[4]
During the past several years, fuzzy logic and fuzzy control has appeared as one the most
active areas for research in the applications of fuzzy set theory, especially in the realm of
industrial processes, which do not lend themselves to control by conventional methods
because of lack of quantitative data regarding the input-output relations.
For preparing this report, some essays and articles studied and scanned about fuzzy logic,
fuzzy sets and fuzzy logic in control systems. There are also thorough and complete
researches arranged about this issue. This report has discussed fuzzy sets and fuzzy logic
at the beginning, and then it debates fuzzy control followed by fuzzification and
defuzzification.
i
Fuzzy Sets
A fuzzy set is a class of objects with a connected series of membership. Such a set is
characterized by a membership function, which assigns to each object a grade of
membership ranging between zero and one. For the convenience of the reader, this report
shall introduce some brief summarization of the basic concepts of fuzzy set theory.[1]
Fuzzy Sets and Terminology: Let U be the collection of objects denoted generically by
{u}, which could be separate or continuous. U is called the universe of the discourse, and
u represents the generic element of U. A fuzzy set F in a universe of discourse U is
characterized by a membership function μF which takes values in the interval [0,1]
namely, μF : U → [0,1]. A fuzzy set may be viewed as a generalization of the concept of
an ordinary set whose membership function only takes two values {0,1}. Thus, a fuzzy
set F in U may be represented as a set of ordered pairs of a generic element u and its
grade of membership function:
F = {(u , μF (u))| u U }
The support of a fuzzy set F is the crisp set of all points u in U such that μF (u) > 0. In
particular, the element u in U at which μ = 0.5, is called the crossover point and the fuzzy
F
set whose support is a single point in U with μF = 1.0 is referred to as fuzzy singleton.
Set Theoretic Operations: Let A and B be two fuzzy sets in U with membership
function μA and μB, respectively. The set theoretic operations of union, intersection and
complement for fuzzy sets are defined via their membership functions:
Union: The membership function μA ∪ B of the union A∪B is point wise defined for all u
U by:
μA ∪ B (u) = max { μA (u), μF (u)}
Intersection: The membership function μA ∩ B of the intersection A∩B is point wise defined
for all u U by:
μA ∩ B (u) = min { μA (u), μF (u)}
i
Complement: The membership function μA′ of the complement of a fuzzy set A is point
wise defined for all u U by:
μA′ ( u ) = 1 - μA ( u )
Fuzzy Logic
Fuzzy logic is derived from fuzzy set theory dealing with reasoning that is approximate
rather than precisely inferred from classical predicate logic. It can be thought of as the
application side of fuzzy set theory dealing with well thought out real world expert values
for a complex problem.[2]
The traditional way of the computer is binary, either true, 1, or false, 0, and nothing in
between. There are some great advantages to digital representation, but ultimately we live
in an analogue world and when describing it we are used to analogue terms defined
through language.
Suppose we say Bob is tall. In the digital world, it would look something like this:
However, this would mean that while Bob, who is 180.1 cm in height, is tall, while Frank
who is 179.9 cm is not. That doesn’t really reflect the way we would normally think.
Instead, we would probably say that Bob and Frank are both rather tall. A fuzzy
representation of the tall variable would look perhaps something like this:
i
Figure 2. Degree of membership-Height diagram in fuzzy criterion[6]
As you can see, no sharp boundary at 180 cm, but a smooth transition. On the vertical
axis we have Membership Degree, indicating to what degree the value of a variable is in
a set. In the digital world, membership degree can be 1 or 0, but in the fuzzy world it can
be any value between 0 and 1.
Suppose we wish to divide height into three classes: short, average and tall. A Boolean
representation would perhaps look something like this:
Again we see those sharp boundaries. A fuzzy representation on the other hand might
look something like this:
i
Figure 4. Fuzzy membership function [6]
Note how the regions are overlapping, this is one fundamental feature of fuzzy sets;
membership in a set is not exclusive. A person that is 165 cm in height is a member of
both the Short and the Average sets. Also note that there is nothing preventing you from
creating Boolean sets by using fuzzy logic. The regular Boolean logic is in fact a special
case of the more general fuzzy logic. Degrees of truth are often confused with
probabilities. However, they are conceptually distinct; fuzzy truth represents membership
in vaguely defined sets, not likelihood of some event or condition.
Fuzzy logic is not any less precise than any other form of logic; it is an organized and
mathematical method of handling inherently imprecise concepts. The concept of coldness
cannot be expressed in an equation, because although temperature is a quantity, coldness
is not. However, people have an idea of what cold is, and agree that there is no sharp
cutoff between cold and not cold, where something is cold at N degrees but not cold at
N+1 degrees, a concept classical logic cannot easily handle due to the principle of
bivalence. The result has no set answer so it is believed to be a fuzzy answer.
Fuzzy set theory defines fuzzy operators on fuzzy sets. The problem in applying this is
that the appropriate fuzzy operator may not be known. For this reason, fuzzy logic
usually uses If / Then rules, or constructs that are equivalent, such as fuzzy associative
matrices. Rules are usually expressed in the form: If variable is set Then action. For
instance, an extremely simple temperature regulator that uses a fan might look like this:
[6]
Notice there is no Else. All of the rules are evaluated, because the temperature might be
cold and normal at the same time to differing degrees. However, this criticism is mainly
due to the fact that there exist problems with conditional possibility, the fuzzy set theory
equivalent of conditional probability. This makes it difficult to perform inference.
Nevertheless, there have not been many studies comparing fuzzy-based systems with
i
probabilistic ones.
Fuzzification
2. Observed data are disturbed by random noise. In this case, a fuzzification operator
should convert the probabilistic data into fuzzy numbers.
Basically, defuzzification is a mapping from a space of fuzzy control actions defined over
an output universe of discourse into a space of non-fuzzy (crisp) control actions. It is
employed because in many practical applications a crisp control action is required. A
defuzzification strategy is aimed at producing a non-fuzzy control action that best
represents the possibility distribution of an inferred fuzzy control action. Unfortunately,
there is no systematic procedure for choosing a defuzzification strategy. Zadeh first
pointed out this problem and made tentative suggestions for dealing with it. At present,
the commonly used strategies may be described as the max criterion, the mean of
maximum, and the center of area.[4]
This example devotes to control the position of a DC motor with a fuzzy control system.
First the problem itself should be clarified; by giving an input the desired angle of the
shaft will be recognized. Consequently, this input should be fuzzified into fuzzy sets.
Then, the inference mechanism will make decision and convert fuzzy data to
understandable data by defuzzification. The block set diagram below shows the control
mechanism of this problem.
Suppose we are using error function , in which r is the desired angle and
y is the sensor feedbacks of the current angle. Moreover, u indicates the voltage input to
the DC motor. For simplifying the control mechanism we assume the desired angle is
zero. Hence; ,
i
After identifying inputs and outputs we shall choose the control method; in this very case
the PD control is used, because, it is much sensible than PID, PI or P method.
The next step would be the fuzzification step. In this stage the membership functions is
determined. Initially, the number of cases should be hypothesized. In this problem,
poslarge, possmall, zero, negsmall, neglarge are the cases. The linguistic-numeric values
are also assigned for this case in order to facilitate the notation; 2, 1, 0, -1, -2 are the
assigned numbers, respectively. Hence, the membership functions will be:
As shown in figure 8, it is convenient to take 0.25 certainty for error change in zero
region and 0.75 in possmall region. Moreover, the certainty for error is always 1 since
error in this example is zero. Consequently, it is suitable to write:
i
Figure 9. Implied membership functions [3]
After the certainties are extracted, we use on of defuzzification methods to combine these
cases and interpret a single output. In this very example, the center of gravity method will
be used.
The basic formula for calculating center of gravity or center of area is:
uequivalent =
∑ ci Ai
∑ Ai
Where in this case we have:
( 0´ 4 . 375)+(−10 ´ 9 . 375)
uequivalent = =- 6. 81
( 4 . 375+9 . 375)
Therefore, the voltage of -6.81 would be applied to the motor.
This process will be continued until the error and change of error with respect to time
reaches to zero. In which, the position of the motor is the desired position with perfect
approximation. [3]
i
References
[1] L. A. Zadeh, “Fuzzy set,” Informat. Control, vol. 8. pp. 338-353, 1965.
[2] Chuen Chien Lee, “Fuzzy Logic in Control System: Fuzzy Logic Controller, Part
I&II,” IEEE Trans. On System. Man. And Cybernetics. , vol. 20, No. 2, pp. 404-418,
1990.
[3] Kevin M. Passino; Stephen Yurkovich, Fuzzy Control, An Imprint of Addison-
Wesley Longman, Inc., 1998.
[4] http://www.wikipedia.com/wiki/Fuzzy_control_system
i
[5] http://www.wikipedia.com/wiki/Fuzzy_logic
[6] http://www.fuzzy-logic.com