Motorola HC12 Refrence Manual page 306

Table of Contents

Advertisement

One method of organization is to have a fixed number of rules with a specific number
of antecedents and consequents. A second method, employed in Motorola Freeware
M68HC11 kernels, is to mark the end of the rule list with a reserved value, and use a
bit in the pointers to distinguish antecedents from consequents. A third method of or-
ganization, used in the CPU12, is to mark the end of the rule list with a reserved value,
and separate antecedents and consequents with another reserved value. This permits
any number of rules, and allows each rule to have any number of antecedents and
consequents, subject to the limits imposed by availability of system memory.
Each rule is evaluated sequentially, but the rules as a group are treated as if they were
all evaluated simultaneously. Two mathematical operations take place during rule
evaluation. The fuzzy and operator corresponds to the mathematical minimum opera-
tion and the fuzzy or operation corresponds to the mathematical maximum operation.
The fuzzy and is used to connect antecedents within a rule. The fuzzy or is implied
between successive rules. Before evaluating any rules, all fuzzy outputs are set to
zero (meaning not true at all). As each rule is evaluated, the smallest (minimum) an-
tecedent is taken to be the overall truth of the rule. This rule truth value is applied to
each consequent of the rule (by storing this value to the corresponding fuzzy output)
unless the fuzzy output is already larger (maximum). 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 .
In the case of rule weighting, the truth value for a rule is determined as usual by finding
the smallest rule antecedent. Before applying this truth value to the consequents for
the rule, the value is multiplied by a fraction from zero (rule disabled) to one (rule fully
enabled). The resulting modified truth value is then applied to the fuzzy outputs.
The end result of the rule evaluation step is a table of suggested or "raw" fuzzy outputs
in RAM. These values were obtained by plugging current conditions (fuzzy input val-
ues) into the system rules in the knowledge base. The raw results cannot be supplied
directly to the system outputs because they may be ambiguous. For instance, one raw
output can indicate that the system output should be medium with a degree of truth of
50% while, at the same time, another indicates that the system output should be low
with a degree of truth of 25%. The defuzzification step resolves these ambiguities.
9.2.3 Defuzzification (WAV)
The final step in the fuzzy logic program combines the raw fuzzy outputs into a com-
posite system output. Unlike the trapezoidal shapes used for inputs, the CPU12 typi-
cally uses singletons for output membership functions. As with the inputs, the x-axis
represents the range of possible values for a system output. Singleton membership
functions consist of the x-axis position for a label of the system output. Fuzzy outputs
correspond to the y-axis height of the corresponding output membership function.
The WAV instruction calculates the numerator and denominator sums for weighted av-
erage of the fuzzy outputs according to the formula:
MOTOROLA
9-6
FUZZY LOGIC SUPPORT
CPU12
REFERENCE MANUAL

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cpu12

Table of Contents