**5.2 Rules**

386 Fuzzy Inference System – Theory and Applications

1. LN Large Negative 2. MN Medium Negative 3. SN Small Negative

5. SP Small Positive 6. MP Medium Positive 7. LP Large Positive

Fig. 6. Temperature system in different states.

4. ZE Zero

Next we will use the linguistic quantifiers defined earlier to craft a rule set that captures the expert's knowledge regarding how to control the system. Specifically, we have the following rules to control the temperature:

1. If the error is LN, MN or SN, then increase-energy-supplied is LN.

This rule quantifies the situation in which the liquid's temperature is above that desired, meaning heat must not be supplied.

2. If the error is LP and the error-variation is SP, then increase-energy-supplied is LP.

This rule quantifies the situation in which the liquid's temperature is far below the setpoint (undesired situation) and decreasing, requiring a substantial heat input.

3. If the error is ZE and the error-variation is SP, then increase-energy-supplied is SP.

This rule quantifies the situation in which the liquid's temperature is close to the desired temperature but decreasing slightly, meaning that heat must be supplied to correct the error.

Each of the three rules above is a "linguistic rule", since it uses linguistic variables and values. Since these linguistic values are not precise representations of the magnitudes they describe, then neither are the linguistic rules. They are merely abstract ideas on how to achieve proper control, and may represent different things to different people. And yet, experts very often use linguistic rules to control systems.

#### **5.3 Rule base**

Using rules of the type described above, we can define every possible temperature control situation. Since we used a finite number of linguistic variables and values, there is a finite number of possible rules. For the temperature control problem, given two inputs and seven linguistic variables, there are 72=49 possible rules (every possible combination of the values of the linguistic variables).

Control Application Using Fuzzy Logic: Design of a Fuzzy Temperature Controller 389

Fig. 7. Fuzzy partition of controller input variables.

Fig. 8. Fuzzy partition of controller output variable.

**7. Fuzzification, inference and defuzzification** 

inference and defuzzification procedures.

In order to complete the design of the controller, we need to define the fuzzification,

In most practical applications of fuzzy control, the fuzzification process used is the "singleton", where the membership function is characterized by having degree 1 for a single value of its universe (input value) and 0 for the rest. In other words, the impulse function could be used to represent a membership function of this type, Figure 9. It is especially used in implementations because in the absence of noise, the input variables are guaranteed to

A convenient way of representing the set of rules when the number of inputs to the fuzzy controller is low (three or fewer) is by using a table. Each square represents the linguistic value of the consequent of a rule, with the left column and the top row containing the linguistic values of the antecedent's variables. A temperature control example is shown in Table 1. Note the symmetry exhibited by the table. This is not coincidental, and corresponds to the symmetrical behavior of the system to be controlled.


Table 1. Rule base for controlling temperature.
