0% found this document useful (0 votes)
17 views33 pages

Lec 8

Continue to fuzzy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views33 pages

Lec 8

Continue to fuzzy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Karary University

College of Engineering
Department of Electrical and Computer Engineering
Cnt 521
Fuzzy Logic Control
Lecture 8

Fuzzy Control Systems


[email protected]

[Karary University‐ Abusabah I. A. Ahmed] 1


Lecture Outline
 Introduction
 Typical fuzzy control systems
 Architecture of Madmani fuzzy control system
 Takagi Sugeno Fuzzy System
 Types of Fuzzy Controllers

[Karary 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
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

[Karary University‐ Abusabah I. A. Ahmed]


Typical Fuzzy Control Systems

 The most popular Fuzzy Control Systems are:


Mamdani type
Larsen
Takagi Sugeno Kang (TSK)
Tsukamoto
Other methods

[Karary University‐ Abusabah I. A. Ahmed]


Fuzzy Control System

Crisp Input

Fuzzification Input Membership Functions

Fuzzy Input

Rule Evaluation Rules / Inferences

Fuzzy Output

Defuzzification Output Membership Functions

Crisp Output

[Karary University‐ Abusabah I. A. Ahmed]


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.

[Karary University‐ Abusabah I. A. Ahmed]


Mamdani Fuzzy Inference System
 The Mamdani-style fuzzy inference process is
performed in four steps:
 Fuzzification of the input variables,
 Rule evaluation,
 Aggregation of the rule outputs, and finally

 Defuzzification.

[Karary University‐ Abusabah I. A. Ahmed]


Mamdani Fuzzy Inference System
Using If-Then type fuzzy rules converts the fuzzy input to the fuzzy
output.

[Karary University‐ Abusabah I. A. Ahmed]


Example 8-1
Let’s examine a simple two-input one-output problem that
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

[Karary University‐ Abusabah I. A. Ahmed]


Example 8-1
Step 1: Fuzzification
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.

[Karary University‐ Abusabah I. A. Ahmed]


Example 8-1
Step 2: Rule Evaluation

 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.

[Karary University‐ Abusabah I. A. Ahmed]


Example 8-1
Step 2: Rule Evaluation
 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)]

[Karary University‐ Abusabah I. A. Ahmed]


Example 8-1
Step 2: Rule Evaluation

IF 0 OR (0.1) THEN (0.1)

IF 0.2 AND 0.7 THEN (0.2)

IF (0.5) THEN (0.5)

[Karary University‐ Abusabah I. A. Ahmed]


Example 8-1
Step 2: Rule Evaluation
 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.

[Karary University‐ Abusabah I. A. Ahmed]


Example 8-1
Step 2: Rule Evaluation

 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.

[Karary University‐ Abusabah I. A. Ahmed]


Example 8-1
Step 2: Rule Evaluation
Clipped and scaled membership functions

Max-Min Composition Max-Product Composition

[Karary University‐ Abusabah I. A. Ahmed]


Example 8-1
Step 3: Aggregation of The Rule Outputs
 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)

[Karary University‐ Abusabah I. A. Ahmed]


Example 8-1
Step 4: Defuzzification
 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

[Karary University‐ Abusabah I. A. Ahmed]


Example 8-1
Step 4: Defuzzification
 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

[Karary University‐ Abusabah I. A. Ahmed]


Example 8-1

Step 4: Defuzzification
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

[Karary University‐ Abusabah I. A. Ahmed]


Takagi-Sugeno Fuzzy Models
 Also known as TSK fuzzy model, Takagi, Sugeno & Kang, 1985.
 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.

[Karary University‐ Abusabah I. A. Ahmed]


Takagi-Sugeno Fuzzy Models
 Sugeno-style fuzzy inference is very similar to the Mamdani
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

[Karary University‐ Abusabah I. A. Ahmed]


Takagi-Sugeno Fuzzy Models

 The most commonly used zero-order Sugeno fuzzy model applies


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.

[Karary University‐ Abusabah I. A. Ahmed]


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.

[Karary University‐ Abusabah I. A. Ahmed]


Takagi-Sugeno Fuzzy Models
Example 8-2

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

[Karary University‐ Abusabah I. A. Ahmed]


Takagi-Sugeno Fuzzy Models
Example 8-2

[Karary University‐ Abusabah I. A. Ahmed]


Takagi-Sugeno Fuzzy Models
Sugeno-style rule evaluation

IF 0 OR (0.1) THEN (0.1)

IF 0.2 OR (0.7) THEN (0.2)

IF 0.5 THEN (0.5)

[Karary University‐ Abusabah I. A. Ahmed]


Takagi-Sugeno Fuzzy Models
Sugeno-style aggregation of the rule outputs
(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

[Karary University‐ Abusabah I. A. Ahmed]


Types of Fuzzy Controllers
Direct Controller
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

[Karary University‐ Abusabah I. A. Ahmed]


Types of Fuzzy Controllers
Supervisory Control
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

[Karary University‐ Abusabah I. A. Ahmed]


Types of Fuzzy Controllers
PID Adaptation
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.
[Karary University‐ Abusabah I. A. Ahmed]
Types of Fuzzy Controllers
Feed forward Control
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
+

[Karary University‐ Abusabah I. A. Ahmed]


[Karary University‐ Abusabah I. A. Ahmed] 33

You might also like