How Does Fuzzy Logic Work?
In order to illustrate some basic concepts in Fuzzy Logic, consider a simplified example of a thermostat controlling a heater fan illustrated in Figure 1. The room temperature detected through a sensor is input to a controller which outputs a control force to adjust the heater fan speed.
A conventional thermostat works like an on-off switch (Figure 2). If we set it at 78oF then the heater is activated only when the temperature falls below 75oF . When it reaches 81oF the heater is turned off. As a result the desired room temperature is either too warm or too hot.
A fuzzy thermostat works in shades of gray where the temperature is treated as a series of overlapping ranges. For example, 78oF is 60% warm and 20% hot. The controller is programmed with simple if-then rules that tell the heater fan how fast to run. As a result, when the temperature changes the fan speed will continuously adjust to keep the temperature at the desired level.
Our first step in designing such a fuzzy controller is to characterize the range of values for the input and output variables of the controller. Then we assign labels such as cool for the temperature and high for the fan speed, and we write a set of simple English-like rules to control the system. Inside the controller all temperature regulating actions will be based on how the current room temperature falls into these ranges and the rules describing the system behavior. The controller's output will vary continuously to adjust the fan speed.
The temperature controller described above can be defined in four simple rules:
IF temperature IS cold THEN fan_speed IS high
IF temperature IS cool THEN fan_speed IS medium
Here the linguistic variables cool, warm, high, etc. are labels which refer to the set of overlapping values shown in figure 2. These triangular shaped values are called membership functions.
A fuzzy controller works similar to a conventional system: it accepts an input value, performs some calculations, and generates an output value. This process is called the Fuzzy Inference Process and works in three steps illustrated in Figure 3: (a) Fuzzification where a crisp input is translated into a fuzzy value, (b) Rule Evaluation, where the fuzzy output truth values are computed, and (c) Defuzzification where the fuzzy output is translated to a crisp value.
During the fuzzification step the crisp temperature value of 78oF is input and translated into fuzzy truth values. For this example, 78oF is fuzzified into warm with truth value 0.6 (or 60%) and hot with truth value 0.2 (or 20%).
During the rule evaluation step the entire set of rules is evaluated and some rules may fire up. For 78oF only the last two of the four rules will fire. Specifically, using rule three the fan_speed will be low with degree of truth 0.6. Similarly, using rule four the fan_speed will be zero with degree of truth 0.2.
During the defuzzification step the 60% low and 20% zero labels are combined using a calculation method called the Center of Gravity (COG) in order to produce the crisp output value of 13.5 RPM for the fan speed.
Back to FIDE
© 1996-2000, Aptronix Inc.