Page 235 - Introduction to Microcontrollers Architecture, Programming, and Interfacing of The Motorola 68HC12
P. 235
212 Chapter? Arithmetic Operations
but if too infrequently, the system gets too far out of control. The steps of this kernel
are: fuzzification, rule evaluation, and defuzzification.
During fuzzification, the current system input values are compared against stored
input membership functions, usually in a program loop structure, to determine the degree
to which each linguistic variable of each system input is true. Three membership
functions are indicated in Figure 7.22; these convert a student's quiz test score to a letter
grade. This is accomplished by finding the y-value for the current input value on a
trapezoidal membership function for each label of each system input. If a student's test
score is 43, his or her membership in linguistic variable "Grade is A" is zero, in
linguistic variable "Grade is B" is $80 (50%), and in linguistic variable "Grade is C" is
$80 (50%). Fuzzy logic avoids the agony of missing a "B" by a point or two.
In our example, system inputs are each quiz's and homework assignment's numeric
grades. Linguistic variable values are the degree of confidence that the student has a
particular grade associated with each letter grade. If there are two quizzes and one
homework assignment, and each has three grades, then there are nine linguistic variables.
The end result of the fuzzification step is a collection of fuzzy linguistic variables
reflecting the system. This is passed to the rule evaluation phase, which processes a list
of rules from the knowledge base using current fuzzy input values to produce a list of
fuzzy output linguistic variables. These fuzzy outputs are considered raw suggestions for
what the system output should be in response to the current input conditions. The
following is an example of a typical rule:
If you get an A on quiz 1, an A on quiz 2, and an A on homework assignments, then
you should get an A+ for the course.
The left portion of the rule is a statement of input conditions, antecedents connected by
& fuzzy AND operator, and the right portion of the rule is a statement of output actions
called consequents,
In an automotive antiskid braking system, about 600 such rules are used to compute
the brake pressure to be applied. Analogous to the Boolean sum-of-products, rule
evaluation employs a fuzzy AND operator, used to connect antecedents within a rule, and
& fuzzy OR operator, which is implied among all rules affecting a given consequent.
Each rule is evaluated sequentially, but the rules as a group are treated as if they were all
evaluated simultaneously. The AND operator corresponds to the mathematical minimum
operation, and the fuzzy OR operation corresponds to the maximum operation. Before
evaluating any rules, all fuzzy outputs are set to zero (meaning none are true). As each
rule is evaluated, the minimum antecedent is taken to be the overall confidence of the
rule result. If two rules affect the same fuzzy output, the rule that is most true governs
the value in the fuzzy output, because the rules are connected by an implied fuzzy OR.
There is also & fuzzy negate operator, which complements each bit.
Each antecedent expression consists of the name of a system input, followed by
"is," followed by a label name defined by a membership function in the knowledge base.
Because "and" is the only operator allowed to connect antecedent expressions, there is no
need to include these in the encoded rule. Each consequent expression consists of the
name of a system output, followed by "is," followed by a label name; for example: