Robot Engineering and Control (Fuzzy Logic Control)
Robot Engineering and Control (Fuzzy Logic Control)
•This means that as soon as the temperature is 75o or more, the air conditioning will
turn on. However, as you notice, the system will not turn on even if temperature is
74.9o. Considering the fuzzy descriptions we saw earlier, is this what we intend?
•consider a washing machine. In most machines, except for a simple time-of wash, there
are no other choices the user can make based on how much fabric is washed and how
dirty the clothes are. Would it not be better if there were a system where the water is
tested for its cleanliness and the washing (scrubbing) mode is adjusted accordingly? In
this case, we need to know how to define clean water versus dirty water. What is
considered clean (and how clean is clean) and what is dirty (and how dirty)?
Fuzzy Logic Control
Fuzzy Control: What Is Needed
•Now we have added a bit of flexibility to the system, as it is not just dependent on one
single value to operate but will also react differently depending on the temperature.
Notice that still for each statement, the controller reacts to one single value. As a result,
even at 78.99o the system is at 90% full-power.
•In the next sections, we will see how fuzzy inferences can be defined (called Fuzzy
Sets and Fuzzification), how a collection of control laws (called Fuzzy Inference Rules
Base) can be written, and how to convert the results into a useful engineering output
(called Defuzzification).
Fuzzy Logic Control
Crisp Values versus Fuzzy Values
•A crisp value is a clearly defined value with one interpretation. A crisp value of 75o F
means the same in any system, and it is a clearly defined and measurable value.
•a fuzzy value is unclear and may be interpreted differently depending on the
circumstances.
Fuzzy Logic Control
Fuzzy Sets: Degrees of Membership and Truth
•To be able to use a fuzzy description in a control setting, we define a fuzzy set whose
members describe the fuzzy variable at different degrees of membership or truth. Each
value in the fuzzy set has a degree of membership within the set, varying from 100%
(1) to 0% (0). This means that, in contrast to a crisp value that is the only true value and
all other values relative to it are false, a fuzzy set has fuzzy values with different
degrees of membership or truth, varying from 100% to 0% true.
•To understand this, let’s once again consider a washing machine and the following
statement:
•If we assume that CLEAN_WATER represents a purely clean water sample, then as a
crisp value, when the water sample is purely clean (no other material in the water), the
clean-water statement is true; otherwise, for all other samples, even with a slight
amount of impurity, the statement is false and the water is not clean.
Fuzzy Logic Control
Fuzzy Sets: Degrees of Membership and Truth
•in a fuzzy set defining CLEAN_WATER, a purely clean water sample will have a
degree of membership of 100% (or 1) in the set; it is purely clean water. However,
water with a slight amount of dirt is still somewhat clean, perhaps 95%. Water with a
little more dirt is not as clean, but perhaps 90% clean. So, every value in the set relates
to some definition of clean water, with only one single crisp value (called singleton),
but also containing countless other clean water possibilities with different degrees of
membership and different levels of truth. In this case, a dirty water sample could still be
a part of a CLEAN_WATER set, but may have a very low degree of membership.
•On the other hand, if we also define a fuzzy set called DIRTY_WATER, the purely
clean water sample mentioned earlier will have a degree of membership (or truth) of
zero in the DIRTY_WATER set, while the dirty water sample will have a 100% degree
of membership in that set. The water with a 90% degree of membership in the
CLEAN_WATER set may have a 15% degree of membership in the DIRTY_- WATER
set as well. So, if we define two sets, a water sample will have two defined values—one
in each set, each with a different degree of membership.
Fuzzy Logic Control
Fuzzy Control system
Fuzzy Logic Control
Fuzzy Control system
Fuzzy Logic Control
Fuzzification
•Fuzzification is the process of converting input and output values into their
membership functions. The result of fuzzification is a set of graphs or equations that
describe the degree of membership of different values in different fuzzy variables.
•To fuzzify a variable, its range of possible values is divided into a number of sets, each
describing a particular portion of the range. Subsequently, each range is represented by
an equation or a graph that describes the degree of truth or membership of each value
within the range.
•The number of sets, the range that each set represents, and the type of representation is
arbitrary and a choice of the designer of the system. As we will see later, these can be
modified and improved when the system is simulated and analyzed.
•A number of possible representations are available for each set. If you create your own
fuzzy system, you may use any representation you find appropriate.
•Based on these definitions, all membership values on all sets can be calculated from
the limits shown.
Fuzzy Logic Control
Fuzzy Inference Rule Base
•Fuzzy Inference Rule Base is the controller part of the system and is based on truth
table logic. The rule base is a collection of rules related to the fuzzy sets, the input
variables, and the output variables and is meant to allow the system to decide what to
do in each case.
•It generally takes one of the following forms, depending on the number of input and
output variables:
•As an example, for a system where the temperature is one input variable, humidity is
the second input variable, and the power setting of the air conditioning system is the
output variable, a fuzzy rule may be:
•Obviously, these two rules will behave differently. Based on commonly used truth tables,
in the first case, both conditions must be true for the consequence, while in the second
case, either condition will result in a consequence. However, remembering that these are
all rather fuzzy not crisp values, they do not result in true or false consequences.
Therefore, to evaluate the ‘‘and’’ and the ‘‘or’’ rules, we use the following:
Fuzzy Logic Control
Fuzzy Inference Rule Base
•With this definition, the system can check all the rules for the given inputs and
calculate a corresponding output. The logic system that checks the rules and finds the
corresponding output is called a fuzzy inference engine.
•The total number of rules in a rule base is equal to the product of the numbers of sets
of each input variable. For example, if there are three input variables, with m, n, and p
fuzzy sets, the total number of rules is R = m x n x p.
Fuzzy Logic Control
Defuzzification
•Defuzzification is the conversion of a fuzzy output value to an equivalent crisp value
for actual use.
•As the fuzzy rules are evaluated and corresponding values are calculated, the result
will be a number related to the corresponding membership values for different output
fuzzy sets.
•We will consider two common and useful techniques for defuzzification called Center
of Gravity and Mamdani’s Inference Method.
•Center of Gravity Method:
The following is a summary of this method:
1. Multiply the membership degrees for each output variable by the singleton value of
the output set.
2. Add all of the above together and divide by the summation of output membership
degrees.
As an example, suppose the values obtained for the output of the air conditioning
system membership sets are 0.4 for LOW and 0.6 for Medium, and further suppose that
the singleton value for LOW is 30% and for MEDIUM is 50% of full power. The output
value for the air conditioning would then be:
Fuzzy Logic Control
Defuzzification
•Mamdani’s Inference Method
Mamdani’s method can be summarized as
follows:
1. Truncate each output membership function at
its corresponding membership value, which is
found from the rule base as shown in figure 10.7.
2. Add the remaining truncated membership
functions with an ‘‘or’’ function in order to
consolidate them into one area describing the
output.
3. Calculate the center of gravity of the
consolidated area as the crisp output value.
•Through the process of fuzzification, application of the rules base, and defuzzification,
an output value is calculated that can be applied to the output. The following examples
demonstrate this procedure for the calculation of an output value.
Fuzzy Logic Control
Example
Fuzzy Logic Control
Example
Fuzzy Logic Control
Example
Fuzzy Logic Control
Example
Fuzzy Logic Control
Example
Fuzzy Logic Control
Example
Fuzzy Logic Control
Example
Fuzzy Logic Control
Example