Chapter 5
Chapter 5
Fuzzy logic is a type of multi valued logic. It deals with approximate reasoning rather
than precise. Fuzzy logic derived from fuzzy set theory. Fuzzy logic was first proposed by
Lodi Zadeh in 1965. Fuzzy controller is an innovative technology that modifies the design of
systems with engineering expertise. Fuzzy logic use human knowledge to implement a
system. It is mostly use in system where there are no mathematical equations for handling
system. Common sense, human thinking and judgment arc fuzzy rules. It helps engineers to
solve non linear control problems. It mathematically emulates human knowledge for
intelligent control system and complex application.
Fuzzy Logic Controller (FLC) has some advantages compared to other classical
controller such as simplicity of control, low cost, and the possibility to design without
knowing the exact mathematical model of the process. Fuzzy logic incorporates an alternative
way of thinking which allows modelling complex systems using higher level of abstraction
originating from the knowledge and experience. Fuzzy logic can be described simply as
"computing words rather than numbers" or "control with sentence rather than equations".
There are two famous type of system currently used 2 fuzzy logic which are Mamdani
fuzzy inference, and Sugeno fuzzy inference.
They are
1) Antecedent and
2) Consequence or Conclusion.
The ‘If’ statement is the Antecedent and the Then statement is the Consequence. If -
(Antecedent) & Then - (Consequence).
Examples:
Classical Set: In a classical set for a universe of discourse the elements belonging to the set
must satisfy the rules specified by the set. It is represented by
𝐴 = {(𝑥, 𝜇𝐴(𝑥))|𝑥𝜖𝑈}
Operations:
Consider two Fuzzy A and B sets such that A, B ∈ U. Where, U is the Universe of
Discourse.
Main set operations are:
1. Complement
2. Intersection
3. Union
Complement:
The Complement of a fuzzy set can defined as a fuzzy set with the membership function
shown below:
(x) = 1 (x)
Intersection:
It can be defined as the biggest fuzzy set in both A and B which contains both the elements in
A and B. It can also written as ‘A ∩ B’. The membership function for Intersection is defined
as:
Union:
It can be defined as the smallest set which contains all the elements in ‘A’ or ‘B’. It can be
written as ‘A + B’ or ‘A U B’. The membership function for Union is defined as:
(x) = (x ) (x)
Figure 10: Membership functions of (a) Union (b) Intersection (c) Complement
5.2 Importance of Fuzzy Logic:
It maps the input to an output in a very efficient and the mapping can be very easily
controlled without much complex knowledge about the process. Steps to be performed in
Fuzzy control:
First, study how the rule base system and the operator can be applied to this control.
Analyse the power system to be controlled and decide the state variables to be considered
as inputs to the system.
Form an understanding as how to control the state variables to get the required control in
the plant.
Now form the Rule base for the linguistic variables of inputs and outputs.
Try to optimize the membership functions to make the control more efficient.
Integrate the fuzzy controller into the plant and check the result.
It needs very fewer data comparatively which is mainly rules and membership functions.
It is more efficient and can perform better even in non-linear models. The three main
components of a Fuzzy Logic controller are
1. Fuzzification,
3. Defuzzification.
The most important step in formulating a design for the fuzzy controller is to identify
the state variables which efficiently control the plant. After figuring out the state variables,
they are to be passed through the fuzzification block to fuzzzify the inputs as the FLC works
with only the Fuzzy inputs. As the Fuzzy Rule base employs rules on only linguistic
variables, the numerical inputs have to be converted to fuzzy linguistic variables first. This
process of converting a numerical state variable into a fuzzy input linguistic variable is called
Fuzzification process. The variables generally used comprise of state error, the rate of change
of state error (derivative of state error), or the area of a state error (integral of state error). The
membership function is the graphical representation of the degree of belonging of an element
to the fuzzy set. We can use different membership functions for an input and output
depending upon the requirement of the precision to be provided. Generally used membership
functions are triangular and trapezoidal membership functions. Gaussian and Bell shaped are
some other available membership functions. For number of membership functions, the
accuracy of control increases and the control works effectively.
Figure 12: Membership Function
Table 3: Rule Base Table
e
Δe NL NM NS Z PS PM PL
NL NL NL NL NL NM NS Z
NM NL NL NL NM NS Z PS
NS NL NL NM NS Z PS PM
Z NL NM NS Z PS PM PL
PS NM NS Z PS PM PL PL
PM NS Z PS PM PL PL PL
PL Z PS PM PL PL PL PL
5.6 Fuzzy Rule Inference:
Fuzzy inference is of two methods. They are Mamdani and Sugeno. They are
explained as below
The most common method used currently is fuzzy influence system. In 1975,
Professor Ebrahim Mamdani of London University introduced first time fu, systems to
control a steam engine and boiler combination. He applied a set of fuzzy rules experienced
human operators. The mamdani system usually done in four steps. The steps are fuzzification
of the inputs, rule evaluation, aggregation of the rules and defuzzification. Fuzzifications
convert input dam to degree of membership functions. In this process data is matched with
condition of the rule and determined how well data is matched with rule at particular
instance. Thus a degree of membership function is developed.
Then in Rule-base block rules are written according to system requirement. In case of
DC motor there are two input variables error and change in error is selected. Usually rules are
in if, and, then form. In inference engine aggregation is done in which degree of fulfilment is
calculated of the condition specifies by a rule. Defuzzification block converted resulting
fuzzy set into a number that is sent to the system and this number is actually the control
signal. There are seven defuzzification methods which are Centre of gravity (COG). Centre
of gravity method for singletons (COGS). Bisector of area (BOA). Mean of Maxima (MOM).
and Left most maximum (LM), and right most maximum (RM).
A fuzzy control system has certain rules that change various variables into a "fuzzy"
form, that is, the outcome is shown as membership functions and their degree of
membership in fuzzy sets. The easiest but not much useful technique is to select the fuzzy
set with the highest membership belonging, for this situation. The disadvantage of this
methodology is that some data gets lost in this process. The rules that performed "Reduce
Pressure" might as well have been absent with this process.
A helpful Defuzzification procedure should first include the outcomes of the results
together somehow. The most average fuzzy set enrolment capacity has the shape of a triangle.
Suppose, if this triangle were to be cut in a straight level line some place between the top and
the base, and the top segment were to be removed, the remaining figure is in the shape of a
trapezoid. This procedure removes parts of the figures to give trapezoids if the membership
function used earlier was triangular (or different shapes if the initial shapes were not
triangles). Generally these trapezoids are superimposed one upon another, giving a single
shape. Finally, the centroid of this is computed. The abscissa of the centroid gives the
defuzzified output.
5.8 Different Fuzzy Control Methods:
Fuzzy interface systems can be designed using two different methodologies. They are:
Mamdani,
Sugeno.
The outputs of these two methods vary somewhat in these two methods.
5.8.2 Mamdani Method:
Mamdani’s methods of the Fuzzy interface is the most commonly used method. It was
among the first control systems built using fuzzy set theory. This inference method expects
the output variable to be fuzzy sets. It is more advantageous to use a single membership
function of a linguistic variable instead of number of fuzzy sets which can be tedious in some
cases. This method of using a single linguistic variable in output is called as Singleton output
mechanism. It enhances the Defuzzification process because it greatly simplifies the
computation required by the more general Mamdani method which finds the centroid of the
two dimensional function. But in the Sugeno type of inference can be used to model any
inference system in which the output membership function is either linear or constant.
The first two parts namely, fuzzifying the inputs and applying the fuzzy operator, of
the Sugeno method are similar to the Mamdani method.
If the first input is x and the second input is y, then the Output is of the linear form
O = Kx +Ly + M
Sugeno Advantages:
The design of a Fuzzy Logic Controller requires the choice of Membership Functions.
The membership functions should be chosen such that they cover the whole universe of
discourse. It should be taken care that the membership functions overlap each other. This is
done in order to avoid any kind of discontinuity with respect to the minor changes in the
inputs. To achieve finer control, the membership functions near the zero region should be
made narrow. Wider membership functions away from the zero region provides faster
response to the system. Hence, the membership functions should be adjusted accordingly [9].
After the appropriate membership functions are chosen, a rule base should be created. It
consists of a number of Fuzzy If-Then rules that completely define the behaviour of the
system. These rules very much resemble the human thought process, thereby providing
artificial intelligence to the system.
5.10.1.1 Fuzzy Sets and MFs for Input Variable Speed Error (e)
Table 4: Fuzzy sets and the respective membership functions for change in voltage
Membership
Fuzzy Set or Label Range
Function
Table 5: Fuzzy sets and the respective membership functions for Change in Power
Membership Function
Fuzzy Set or Label Range
[-1.334e+04 -6667 0]
NS (Negative Small) Triangular
[-6667 0 6668]
ZE (Zero) Triangular
[0 6668 1.334e+04]
PS (Positive Small) Triangular
These inputs are processed to obtain an output known as the Change of Control (wsl).
5.10.2.1 Fuzzy Sets and MFs for Output Variable Change of Control (wsl)
Table 6: Fuzzy sets and the respective membership functions for Change of Duty cycle
Membership
Fuzzy Set or Label Range
Function
The Rule Base for deciding the output of the inference system consists of 49 If-Then
rules in this case since there are 7 fuzzy sets in each of the inputs. The table representing
the rule base is as follows:
e
NB
NM NS Z PS PM PB
Δe
NB NB NB NB NB NM NS Z
NM NB NB NB NM NS Z PS
NS NB NB NM NS Z PS PM
Z NB NM NS Z PS PM PB
PS NM NS Z PS PM PB PB
PM NS Z PS PM PB PB PB
PB Z PS PM PB PB PB PB
5.12Design of the Fuzzy Logic Controller using MATLAB
Step 1:
The program for designing of the Fuzzy Logic Controller is written in a word file.
The definitions for all the shown membership functions are written in the program.
The 49 rules shown in tabular form in section 5.4 are written in the program
according to the syntax provided by MATLAB.
All the 49 If-then rules of the rule base used for the design of the fuzzy logic
10. If (error is NS) and (changeinerror is NM) then (controlled is NB) (1)
12. If (error is PS) and (changeinerror is NM) then (controlled is NS) (1)
14. If (error is PB) and (changeinerror is NM) then (controlled is PS) (1)
15. If (error is NB) and (changeinerror is NS) then (controlled is NB) (1)
16. If (error is NM) and (changeinerror is NS) then (controlled is NB) (1)
17. If (error is NS) and (changeinerror is NS) then (controlled is NM) (1)
20. If (error is PM) and (changeinerror is NS) then (controlled is PS) (1)
21. If (error is PB) and (changeinerror is NS) then (controlled is PM) (1)
29. If (error is NB) and (changeinerror is PS) then (controlled is NM) (1)
30. If (error is NM) and (changeinerror is PS) then (controlled is NS) (1)
33. If (error is PS) and (changeinerror is PS) then (controlled is PM) (1)
34. If (error is PM) and (changeinerror is PS) then (controlled is PB) (1)
35. If (error is PB) and (changeinerror is PS) then (controlled is PB) (1)
36. If (error is NB) and (changeinerror is PM) then (controlled is NS) (1)
38. If (error is NS) and (changeinerror is PM) then (controlled is PS) (1)
39. If (error is Z) and (changeinerror is PM) then (controlled is PM) (1)
40. If (error is PS) and (change in error is PM) then (controlled is PB) (1)
41. If (error is PM) and (change in error is PM) then (controlled is PB) (1)
42. If (error is PB) and (change in error is PM) then (controlled is PB) (1)
43. If (error is NB) and (change in error is PB) then (controlled is Z) (1)
44. If (error is NM) and (change in error is PB) then (controlled is PS) (1)
45. If (error is NS) and (change in error is PB) then (controlled is PM) (1)
46. If (error is Z) and (change in error is PB) then (controlled is PB) (1)
47. If (error is PS) and (change in error is PB) then (controlled is PB) (1)
48. If (error is PM) and (change in error is PB) then (controlled is PB) (1)
49. If (error is PB) and (change in error is PB) then (controlled is PB) (1)