Page 972 - The Mechatronics Handbook
P. 972
0066_Frame_C32.fm Page 22 Wednesday, January 9, 2002 7:54 PM
of gravity of modified membership functions m k z() ,
∗
n +∞ ∗
d
∑ k=1 ∫ m k z()zz
∞
z analog = ------------------------------------------ (32.47)
n +∞ ∗
d
∑ k=1 ∫ m k z() z
∞
In the case where shapes of the output membership functions m k (z) are the same, the equation can be
simplified to
n
z analog = ∑ k=1 z k zc k (32.48)
----------------------
n
∑ k=1 z k
where
n = number of membership function of z analog output variable,
z k = fuzzy output variables obtained from rule evaluation,
zc k = analog values corresponding to the center of kth membership function.
Equation (32.47) is usually too complicated to be used in a simple microcontroller based system;
therefore, in practical cases, Eq. (32.48) is used more frequently.
Design Example
Consider the design of a simple fuzzy controller for a sprinkler system. The sprinkling time is a function
of humidity and temperature. Four membership functions are used for the temperature, three for humid-
ity, and three for the sprinkle time, as shown in Fig. 32.23. Using intuition, the fuzzy table can be developed,
as shown in Fig. 32.24(a).
Assume a temperature of 60°F and 70% humidity. Using the membership functions for temperature and
humidity, the following fuzzy variables can be obtained for the temperature: [0, 0.2, 0.5, 0], and for the
humidity: [0, 0.4, 0.6]. Using the min operator, the fuzzy table can be now filled with temporary fuzzy
variables, as shown in Fig. 32.24(b). Note that only four fields have nonzero values. Using fuzzy rules, as
shown in Fig. 32.24(a), the max operator can be applied in order to obtain fuzzy output variables: short →
o 1 = max{0, 0, 0.2, 0.5, 0} = 0.5, medium → o 2 = max{0, 0, 0.2, 0.4, 0} = 0.4, long → o 3 = max{0, 0} = 0.
COLD COOL NORMAL HOT DRY NORMAL WET
1 1
0.6
0.5 0.4
0.2
T H
0 0
(a) 20 40 60 80 100 120 (b) 0 20 40 60 80 100 [%]
SHORT MEDIUM LONG SHORT MEDIUM LONG
1 1
TIME TIME
0 0
(c) 0 20 40 60 80 100 [min] (d) 0 20 40 60 80 100 [min]
FIGURE 32.23 Membership functions for the presented example: (a) and (b) are membership functions for input
variables, (c) and (d) are two possible membership functions for the output variable.
©2002 CRC Press LLC

