Designing fuzzy controller requires knowledge of fuzzy inference systems such as the Mamdani approach of the Takagi-Sugeno approach. Fuzzy logic controllers are based on fuzzy logic. Most of the embedded devices nowadays implement one or other kind of FLC, for example, air conditioners, washing machines, traffic light controllers, flight navigation systems and many more.
The following steps should be followed to for designing a fuzzy controller:
Let us try to understand this with an example:
Consider the design of a fuzzy controller for a steam turbine. Assume the input of the fuzzy controller as temperature and pressure. The output will be the throttle setting of a steam turbine. Use 3 descriptors for input and 5 descriptors for output variables. Derive the set of rules for controller action and get the defuzzified values.
Assume that the current temperature is 30% and pressure is 40% and we have to determine the throttle position of the turbine for this particular condition
Solution:
Step 1: Identification of variables
Step 2: Fuzzy subset configuration
Assign a linguistic descriptor for each fuzzy subset
Step 3: Obtain Membership Function
Define membership functions for descriptors (Temperature)
The fuzzy membership function for temperature is depicted in the following figure:
From similar triangle rule we know that, (y2 – y1) / (x2 – x1) = (y – y1) / (x – x1)
For fuzzy set COOL:
[0, 20] ⇒ (0 – 1) / (20 – 0) = (y – 1) / (x – 0)
For fuzzy set NOMINAL:
[0, 20] ⇒ (1 – 0) / (20 – 0) = (y – 0) / (x – 0)
[20, 40] ⇒ (0 – 1) / (40 – 20) = (y – 1) / (x – 20)
Combining both in a single equation,
For fuzzy set WARM:
[20, 40] ⇒ (1 – 0) / (40 – 20) = (y – 0) / (x – 20)
Define membership functions for descriptors (Pressure)
The fuzzy membership function for pressure is depicted in the following figure:
For fuzzy set LOW:
[0, 50] ⇒ (0 – 1) / (50 – 0) = (y – 1) / (x – 0)
For fuzzy set OK:
[0, 50] ⇒ (1 – 0) / (50 – 0) = (y – 0) / (x – 0)
[50, 100] ⇒ (0 – 1) / (100 – 50) = (y – 1) / (x – 500)
Combining both in a single equation,
For fuzzy set STRONG:
[50, 100] ⇒ (1 – 0) / (100 – 50) = (y – 0) / (x – 50)
Define membership functions for descriptors (Rotation)
In a similar way, we can compute the membership function for rotation, as shown below:
Step 4: Fuzzy rule base configuration
As we assumed, this controller has 3 fuzzy subsets for temperature and 3 fuzzy subsets for pressure. So rule base will contain 3 x 3 i.e. 9 rules.
The rule base for given inputs and fuzzy sub-sets is depicted in the following table:
Step 6: Fuzzification
30 % of temperature:
xT = (40 ∗ 30) / 100 = 12
μCool = (20 – xT) / 20 = (20 – 12) / 20 = 8 / 20 = 2/5
μNominal = xT / 20 = 12 / 20 = 3/5
40 % of pressure:
xP = (100 ∗ 40) / 100 = 40
μlow = (50 – xP) / 50 = (50 – 40) / 50 = 10 / 50 = 1/5
Fired rules and the rule base for them are shown here:
Step 7: Identification of output
From the rule base of fired rules, we can derive the following rules,
Step 8: Defuzzification
The firing strength of each rule is highlighted in different colors in the above figures. To compute the corresponding crisp value, we shall aggregate all output functions by placing them on the same axis.
We can apply any defuzzification method on the above aggregated output function to find the crisp value. Let us apply weighted average method.
Thus, for 40% of temperature (xT = 12) and 30% of pressure (xP = 30), we shall rotate the throttle by 16.984 o .