Fuzzy Control
Fuzzy Control
Module 2
4
2.1.1 Review of Control System Basics
Example of control systems
• Position • Pressure
• Speed • Turgidity
• Liquid level • Concentration
• Intensity
• Temperature • Etc.
5
Setpoint +
or Controller Process Output
-
Summer Feedback
(Op-Amp)
Control objective.
• In many control systems, the objective is to design a controller such
that output can be controlled by giving the desired signals at the
input.
Example of control.
– Alignment of the front wheel of a vehicle follows that of the
driver’s steering wheel.
– Rudders of a boat follow its steering wheel.
– Concentration in liquids follows a given set-point.
– Temperature of furnace follows a given set-point. 6
Control Systems Performance
• What are the factors affecting control systems?
– Choice of the Controllers (Algorithms)
– Tuning of Controllers
– Selection of Control Variables
– Selection of Performance Index
– Types of Sensors (Measurement Errors)
– Actuators
– Disturbances/Environment
– Noise
– Control Configuration
– Design Techniques
– Nonlinearity
7
8
Control system components
A military helicopter
A space shuttle
10
Example of Control Paradigms
Control Design Techniques and Control Paradigms
Modern
Classical
Artificial Intelligence
State Feedback
Root Locus State Estimation
Bode Plot Observers
Nichols Chart Optimal Control
Nyquist Plots Robust Control
H-Infinity
Internal Model Control
Adaptive Control
Neuro-Control
Fuzzy Control
Genetic Algorithms
Knowledge Based Systems
11
Example of Controllers
That Can Be Applied in Control Systems
Conventional Controllers Predictive Controllers
• Bang-Bang (on-off) • Smith Predictor
• Proportional • Generalized Predictive
Controllers
• PID Controller
Intelligent Controllers
Adaptive Controllers
• Knowledge Based
• Self-Tuning Controller
• Fuzzy Logic Controllers
• Self-Tuning PID
Controller • Neuro-Controllers
• Auto-Tuning PID • Adaptive Fuzzy
Controller
• Pole Placement 12
Overview of Fuzzy Logic Control
• The idea was first proposed by Mamdani and Assilian around 1972.
14
Benefits of Fuzzy Control
• Suitable for Complex Ill-defined Systems where
mathematical modeling is difficult or Plant is too
abstract e.g. Complex chemical plant, cement-kiln,
etc.
• Simple to design
15
Where do we start?
What are the Basics/Background
needed?
What are the components of a Fuzzy
Controller?
Where can it be applied?
16
A fuzzy logic control system
Def uzz
Fu zz
R u le s
-
Rate of Change
of Error Output Transducer
or Sensor
17
Knowledge
Base
Fuzzy Fuzzy
Inference
Fuzzifier Defuzzifier
Engine
19
Design Process
Identify controller Inputs and Outputs as the Fuzzy
variables
21
Inference Mechanism
Sensor
e readings
Control
Defuzzification
signal
Fuzzi fication
Rule base
Du
De IFXis AAND Yis B
THEN Zis C
23
2.2.2 Fuzzification
What is
Fuzzification?
25
Fuzzification
• Involves the conversion of the input/output
signals into a number of fuzzy represented
values (fuzzy sets).
• Choose an appropriate Membership Function to
represent each Fuzzy Set.
• Label the Fuzzy Sets appropriately such that they
reflect the problem to be solved.
• Set up the Fuzzy Sets on appropriate Universes
of Discourse.
• Adjust / tune the widths and centerpoints of
membership functions judiciously.
26
Consider a Fuzzy Rice Cooker
• First, we need to identify the input and
output variables of the process, in this
case, the rice cooker.
• Study the control mechanism.
27
Rate of Heating, DE
2 Best Candidates of
the Input Variables (in
order to make the
output decision) would
be:
Amount of Temp. of
Rice, W Rice, q
28
Fuzzification
Rate of • For each Variable, how
Heating, DE many fuzzy sets should each
be partitioned into?
29
Fuzzification
Membership
Value, mDE MEDIUM
LOW HIGH
1.0
Rate of
Heating, DE
30
Membership
Value, mW MEDIUM
LOW HIGH
1.0
Amount of
Rice, W
Membership
Value, mq MEDIUM
LOW HIGH
1.0
Temp. of
Rice, q
31
Negative Medium NM
Negative Small NS
Zero ZE
Positive Small PS
Positive Medium PM
32
Consider an Air Conditioner
33
mq
NM NS ZE PS PM
1
0
0 Pendulum Angle,q
mDq
NM NS ZE PS PM
1
0
0 Angular Velocity,Dq
mv
NM NS ZE PS PM
1
0
0 Motor Voltage, v
37
• The set of fuzzy control rules forms the rule base of the fuzzy
logic controller.
39
40
Example of Fuzzy Control Rules
41
42
Example 2.1
• For simplification a matrix can be used for
presenting the rules which is called fuzzy rule
matrix.
• Many control rules are written in the form below:
( Antecedents) (Consequent).
IF X AND Y THEN Z.
43
N N N P
Z N Z P
P N P P
Steady State Rule
Consequents
44
Rules?
•How do we
formulate the
rules??
45
Inference Mechanism
Sensor
e readings
Control
signal
Defuzzification
Fuzzification
Rule base
Du
De
IF X is A AND Y is B
THEN Z is C
47
• More specifically,
R1: if (E is negative and DE is positive )
then DU is positive,
R2: if (E is negative and DE is negative)
then DU is negative.
48
Observation of system response
for deriving fuzzy control rules
e(k)=r(k)-y(k)
De(k ) e(k ) e(k 1)
e- e-
De+ De- e-
Setpoint De+
e+
De+
e+ e+ e- e+ e+ e- e- e+
De- De De- De- De+ De+ De- De-
+
a1
1 2 3 4 5 6 7 8 9 10 11 12
49
TABLE I
PROTOTYPE OF FUZZY CONTROL RULES WITH TERM SETS
(NEGATIVE, ZERO, POSITIVE)
TABLE 2
PROTOTYPE OF FUZZY CONTROL RULES WITH TERM SETS
(NEGATIVE, ZERO, POSITIVE)
51
TABLE 4
PROTOTYPE OF FUZZY CONTROL RULES WITH TERM SETS
{NB, NM, NS, ZE, PS, PM, PM}
52
2.2.4 The Inference Mechanism
What is an Inference
Procedure in FLCS?
Fuzzy Controller
Knowledge
Base
Fuzzy Fuzzy
Inference
Fuzzifier Defuzzifier
Engine
• Two most common methods used in fuzzy logic control are the
max-min composition and the max-(algebraic) product composition.
• The inference or firing with this fuzzy relation is performed via the
operations between the fuzzified crisp input and the fuzzy relation
representing the meaning of the overall set of rules.
Example 2.2
• Consider a simple system where each rule comprises two antecedents and
one consequent. A fuzzy system with two non-interactive inputs x1 and x2
(antecedents) and a single output y (consequent) is described by a
collection of n linguistic if-then propositions:
where A1(k) and A2(k) are fuzzy sets representing the kth antecedent pairs
and B(k) are the fuzzy sets representing the k th consequent.
• Based on the Mamdani implication method of inference, and for a set of
disjunctive rules, the aggregated output for the n rules will be given by
m m m
A11 A12 1 B1
1 1
min
0 x1 0 x2 y
input(i) input(j)
Rule 2
m m m
A21 1 A22 1 B2
1
min
0 x1 x2 y
input(i) input(j)
Defuzzification
m
1
y
y*
• The symbols A21 and A22 refer to the first and second fuzzy
antecedents, respectively, of the second rule, and the symbol B2
refers to the fuzzy consequent of the second rule.
59
Example 2.3
Rule 1
m m m
A11 A12 1 B1
1 1
0 x1 0 x2 y
input(i) input(j)
Rule 2
m m m
A21 1 A22 1 B2
1
0 x1 x2 y
input(i) input(j)
Defuzzification
m
1
y
y*
2.2.5 Defuzzification
Fuzzy Controller
Knowledge
Base
62
Some Notes of
Defuzzification
• Defuzzification is a mapping from a space of fuzzy control
actions defined over an output universe of discourse into
a space of non-fuzzy (crisp) control action.
• This process is necessary because in many practical
applications crisp control action is required to actuate the
plant.
• The defuzzifier also performs an output denormalization if
a normalization is performed in the fuzzification module.
• There are many methods of defuzzification that have
been proposed in recent years.
• Unfortunately, there is no systematic procedure for
choosing a defuzzification strategy. 63
64
(i) Max membership method
• This scheme is limited to peaked output
functions.
• This method is given by the algebraic
expression:
mz(z*) mz(z) for all z Z
m
1
0 z
z*
65
mz z*
m ( z ).z
Z
1 m ( z) Z
0
z
z* 66
(iii) Weight average method
• This method is only valid for symmetrical output
membership functions.
• The weight average method is formed by weighting
each membership function in the output by its
respective maximum membership value, z.
• It is given by the algebraic expression
m m ( z ).z
z*
z
m ( z)
1
z
0
z1 z2 z 67
0 a z* b z
68
2.3 Design procedure of the fuzzy logic controller
• Firstly, the designer have to identify the process input and output
variables that need to be considered. Thus, one must have a good
knowledge on the system to be controlled.
69
71
Design Planning
-identify process input & output variables
-Identify Controllers inputs & outputs
- determine the number of fuzzy partitions
- choose types of membership functions
- derive fuzzy control rules-based
- define inference engine
- choose defuzzification method
Fuzzy Logic
Parameters Tuning Controller Operation
- mapping of membership
- Fuzzification
functions
- Fuzzy Inference
- fuzzy inference rules
- Defuzzification
- scaling factors
N OK
o
Yes
End 72
2.4 Summary of Module 2
• As fuzzy logic has been successfully applied to many control
problems, more than any other areas of applications, in this
module we review some control system basics.
73