Almughtaribeen University
ALMUGHTARIBEEN UNIVERSITY
College of Engineering
Cnt 521
Fuzzy Logic Control
Lecture 8
Fuzzy Control Systems
Dr. Abusabah I. A. Ahmed
[email protected]
1
Lecture Outline
Introduction
ALMUGHTARIBEEN UNIVERSITY
Typical fuzzy control systems
Architecture of Madmani fuzzy control system
Takagi Sugeno Fuzzy System
Types of Fuzzy Controllers
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Introduction
Fuzzy control system is nonlinear mapping that derives its output based on
fuzzy reasoning and a set of fuzzy if-then rules. The domain and range of the
ALMUGHTARIBEEN UNIVERSITY
mapping could be fuzzy sets or points in a multidimensional spaces.
Fuzzy logic is a tech to embody human-like thinking into a control system
Traditional control approach require formal modelling of the plant
Fuzzy control incorporate ambiguous human logic into computer
programs. It is suitable for control problems that can not be easily
represented by mathematical models:
Weak model
Parameter variation
Unavailable or incomplete data
Very complex plants
Because of the unconventional approach they leads to easier development
and implementation cycle
Almughtaribeen University – [ Abusabah I. A. Ahmed]
ALMUGHTARIBEEN UNIVERSITY Typical Fuzzy Control Systems
The most popular Fuzzy Control Systems are:
Mamdani type
Larsen
Takagi Sugeno Kang (TSK)
Tsukamoto
Other methods
Almughtaribeen University – [ Abusabah I. A. Ahmed]
ALMUGHTARIBEEN UNIVERSITY Fuzzy Control System
Crisp Input
Fuzzification Input Membership Functions
Fuzzy Input
Rule Evaluation Rules / Inferences
Fuzzy Output
Defuzzification Output Membership Functions
Crisp Output
Almughtaribeen University – [ Abusabah I. A. Ahmed]
ALMUGHTARIBEEN UNIVERSITY Mamdani Fuzzy Inference System
The most commonly used fuzzy inference technique is
Mamdani inference method.
In 1975, Professor Ibrahim Mamdani of London University
built one of the first fuzzy systems to control a steam engine
and boiler combination.
Original Goal: Control a steam engine & boiler combination by
a set of linguistic control rules obtained from experienced
human operators.
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Mamdani Fuzzy Inference System
The Mamdani-style fuzzy inference process is
ALMUGHTARIBEEN UNIVERSITY
performed in four steps:
Fuzzification of the input variables,
Rule evaluation,
Aggregation of the rule outputs, and finally
Defuzzification.
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Mamdani Fuzzy Inference System
Using If-Then type fuzzy rules converts the fuzzy input to the fuzzy
ALMUGHTARIBEEN UNIVERSITY
output.
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Example 8-1
Let’s examine a simple two-input one-output problem that
ALMUGHTARIBEEN UNIVERSITY
includes three rules:
Rule: 1 Rule: 1
IF 𝑥 𝑖𝑠 𝐴 IF project_funding is adequate
OR 𝑦 𝑖𝑠 𝐵 OR project_staffing is small
THEN 𝑧 𝑖𝑠 𝐶 THEN risk is low
Rule: 2 Rule: 2
IF 𝑥 𝑖𝑠 𝐴 IF project_funding is marginal
AND 𝑦 𝑖𝑠 𝐵 AND project_staffing is large
THEN 𝑧 𝑖𝑠 𝐶 THEN risk is normal
Rule: 3 Rule: 3
IF 𝑥 𝑖𝑠 𝐴 IF project_funding is inadequate
THEN 𝑧 𝑖𝑠 𝐶 THEN risk is high
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Example 8-1
Step 1: Fuzzification
ALMUGHTARIBEEN UNIVERSITY
Take the crisp inputs, 𝑥 and 𝑦 (project funding and project
staffing).
Determine the degree to which these inputs belong to each of
the appropriate fuzzy sets.
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Example 8-1
Step 2: Rule Evaluation
ALMUGHTARIBEEN UNIVERSITY
take the fuzzified inputs, 𝜇(x=A1) = 0.5, 𝜇(x=A2) = 0.2, 𝜇(y=B1)
= 0.1 and 𝜇(y=B2) = 0.7
apply them to the antecedents of the fuzzy rules.
If a given fuzzy rule has multiple antecedents, the fuzzy
operator (AND or OR) is used to obtain a single number that
represents the result of the antecedent evaluation. This
number (the truth value) is then applied to the consequent
membership function.
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Example 8-1
Step 2: Rule Evaluation
ALMUGHTARIBEEN UNIVERSITY
To evaluate the disjunction of the rule antecedents, we use the
OR fuzzy operation. Typically, fuzzy expert systems make
use of the classical fuzzy operation union:
𝜇 A 𝜇 B(x) = max [𝜇 A(x), 𝜇 B(x)]
Similarly, in order to evaluate the conjunction of the rule
antecedents, we apply the AND fuzzy operation
intersection:
𝜇 A 𝜇 B(x) = min [𝜇 A(x), 𝜇 B(x)]
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Example 8-1
Step 2: Rule Evaluation
ALMUGHTARIBEEN UNIVERSITY
IF 𝑥 𝑖𝑠 𝐴 0 OR 𝑦 𝑖𝑠 𝐵 (0.1) THEN 𝑧 𝑖𝑠 𝐶 (0.1)
IF 𝑥 𝑖𝑠 𝐴 0.2 AND 𝑦 𝑖𝑠 𝐵 0.7 THEN 𝑧 𝑖𝑠 𝐶 (0.2)
IF 𝑥 𝑖𝑠 𝐴 (0.5) THEN 𝑧 𝑖𝑠 𝐶 (0.5)
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Example 8-1
Step 2: Rule Evaluation
ALMUGHTARIBEEN UNIVERSITY
Now the result of the antecedent evaluation can be applied to
the membership function of the consequent.
The most common method is to cut the consequent
membership function at the level of the antecedent truth.
This method is called clipping (Max-Min Composition) .
The clipped fuzzy set loses some information.
Clipping is still often preferred because:
it involves less complex and faster mathematics
it generates an aggregated output surface that is easier to
defuzzify.
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Example 8-1
Step 2: Rule Evaluation
ALMUGHTARIBEEN UNIVERSITY
While clipping is a frequently used method, scaling (Max-Product
Composition) offers a better approach for preserving the original
shape of the fuzzy set.
The original membership function of the rule consequent is
adjusted by multiplying all its membership degrees by the truth
value of the rule antecedent.
This method, which generally loses less information, can be very
useful in fuzzy expert systems.
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Example 8-1
Step 2: Rule Evaluation
ALMUGHTARIBEEN UNIVERSITY
Clipped and scaled membership functions
Max-Min Composition Max-Product Composition
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Example 8-1
Step 3: Aggregation of The Rule Outputs
ALMUGHTARIBEEN UNIVERSITY
Aggregation is the process of unification of the outputs of all rules.
We take the membership functions of all rule consequents previously
clipped or scaled and combine them into a single fuzzy set.
𝑧 𝑖𝑠 𝐶 (0.1) 𝑧 𝑖𝑠 𝐶 (0.2) 𝑧 𝑖𝑠 𝐶 (0.5)
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Example 8-1
Step 4: Defuzzification
ALMUGHTARIBEEN UNIVERSITY
Fuzziness helps us to evaluate the rules, but the final output of a fuzzy
system has to be a crisp number.
The input for the defuzzification process is the aggregated output fuzzy
set and the output is a single number.
There are several defuzzification methods, but probably the most
popular one is the centroid technique.
It finds the point where a vertical line would slice the aggregate set into
two equal masses. Mathematically this Centre Of Gravity (COG) can
be expressed as: b
x x dx
A
COG a
b
x dx
a
A
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Example 8-1
Step 4: Defuzzification
ALMUGHTARIBEEN UNIVERSITY
Centroid defuzzification method finds a point representing the
centre of gravity of the fuzzy set, A, on the interval, ab.
A reasonable estimate can be obtained by calculating it over a
sample of points.
( x)
1.0
0.8
0.6 A
0.4
0.2
a b
0.0 X
150 160 170 180 190 200 210
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Example 8-1
Step 4: Defuzzification
ALMUGHTARIBEEN UNIVERSITY
Degree of
Membership
1.0
0.8
0.6
0.4
0.2
0.0
0 10 20 30 40 50 60 70 80 90 100
67.4 Z
(0 10 20) 0.1 (30 40 50 60) 0.2 (70 80 90 100) 0.5
COG 67.4
0.1 0.1 0.1 0.2 0.2 0.2 0.2 0.5 0.5 0.5 0.5
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Takagi-Sugeno Fuzzy Models
Also known as TSK fuzzy model, Takagi, Sugeno & Kang, 1985.
ALMUGHTARIBEEN UNIVERSITY
Goal: Generation of fuzzy rules from a given input-output data
set.
Mamdani-style inference, requires to find the centroid of a
two-dimensional shape
by integrating across a continuously varying function.
In general, this process is not computationally efficient.
Michio Sugeno suggested to use a single spike, a singleton, as
the membership function of the rule consequent.
A fuzzy singleton, is a fuzzy set with a membership function
that is unity at a single particular point on the universe of
discourse and zero everywhere else.
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Takagi-Sugeno Fuzzy Models
Sugeno-style fuzzy inference is very similar to the Mamdani
ALMUGHTARIBEEN UNIVERSITY
method.
Sugeno changed only a rule consequent. Instead of a fuzzy set,
he used a mathematical function of the input variable.
The format of the Sugeno-style fuzzy rule is
IF x is A AND y is B
THEN z is f (x, y)
where x, y and z are linguistic variables
A and B are fuzzy sets on universe of discourses X and Y
f (x, y) is a mathematical function
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Takagi-Sugeno Fuzzy Models
The most commonly used zero-order Sugeno fuzzy model applies
ALMUGHTARIBEEN UNIVERSITY
fuzzy rules in the following form:
IF x is A AND y is B
THEN z is k
where k is a constant.
In this case, the output of each fuzzy rule is constant.
All consequent membership functions are represented by singleton
spikes.
Almughtaribeen University – [ Abusabah I. A. Ahmed]
ALMUGHTARIBEEN UNIVERSITY Takagi-Sugeno Fuzzy Models
Fuzzy Rules of TSK Model
If x is A and y is B then z = f(x, y)
Fuzzy Sets Crisp Function
f(x, y) is very often a polynomial function w.r.t. x and y.
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Takagi-Sugeno Fuzzy Models
Example 8-2
ALMUGHTARIBEEN UNIVERSITY
R1: if X is small and Y is small then z = x +y +1
R2: if X is small and Y is large then z = y +3
R3: if X is large and Y is small then z = x +3
R4: if X is large and Y is large then z = x + y + 2
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Takagi-Sugeno Fuzzy Models
Example 8-2
ALMUGHTARIBEEN UNIVERSITY
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Takagi-Sugeno Fuzzy Models
Sugeno-style rule evaluation
ALMUGHTARIBEEN UNIVERSITY
IF 𝑥 𝑖𝑠 𝐴 0 OR 𝑦 𝑖𝑠 𝐵 (0.1) THEN 𝑧 𝑖𝑠 𝑘 (0.1)
IF 𝑥 𝑖𝑠 𝐴 0.2 OR 𝑦 𝑖𝑠 𝐵 (0.7) THEN 𝑧 𝑖𝑠 𝑘 (0.2)
IF 𝑥 𝑖𝑠 𝐴 0.5 THEN 𝑧 𝑖𝑠 𝑘 (0.5)
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Takagi-Sugeno Fuzzy Models
Sugeno-style aggregation of the rule outputs
ALMUGHTARIBEEN UNIVERSITY
𝑧 𝑖𝑠 𝑘 (0.1) 𝑧 𝑖𝑠 𝑘 (0.2) 𝑧 𝑖𝑠 𝑘 (0.5)
Weighted Average (WA)
(k1) k1 (k 2) k 2 (k 3) k 3 0.1 20 0.2 50 0.5 80
WA 65
(k1) (k 2) (k 3) 0.1 0.2 0.5
Sugeno-style defuzzification 0 z1 Z
Crisp Output
z1
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Types of Fuzzy Controllers
Direct Controller
ALMUGHTARIBEEN UNIVERSITY
The Outputs of the Fuzzy Logic System are the command
variables of the plant:
The Outputs of the Fuzzy Logic System Are the Command Variables of the Plant:
Set Point Variable
Command
IF temp=low
AND P=high
Variables
Plant
THEN A=med
IF ...
Fuzzification Inference Defuzzification
Measured Variables
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Types of Fuzzy Controllers
Supervisory Control
ALMUGHTARIBEEN UNIVERSITY
Fuzzy Logic Controller Outputs Set Values for Underlying PID Controllers:
IF temp=low
Set Values PID
AND P=high
THEN A=med
PID Plant
IF ...
Fuzzification Inference Defuzzification PID
Measured Variables
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Types of Fuzzy Controllers
PID Adaptation
ALMUGHTARIBEEN UNIVERSITY
Fuzzy Logic Controller Adapts the P, I, and D Parameter of a
Conventional PID Controller:
Set Point Variable
IF temp=low
AND P=high P
THEN A=med
I Command Variable
D
IF ...
PID Plant
Fuzzification Inference Defuzzification
Measured Variable
The Fuzzy Logic System analyzes the performance of the PID
controller and optimizes It.
Almughtaribeen University – [ Abusabah I. A. Ahmed]
Types of Fuzzy Controllers
Feed forward Control
ALMUGHTARIBEEN UNIVERSITY
Fuzzy Logic Controller compensates for measurable
Disturbance
Disturbance
IF temp=low
AND P=high
THEN A=med
IF ...
Fuzzification Inference Defuzzification
Ref +
Deviation + Action Output
Controller Plant
+
‐
Almughtaribeen University – [ Abusabah I. A. Ahmed]
ALMUGHTARIBEEN UNIVERSITY
Almughtaribeen University – [ Abusabah I. A. Ahmed]
33