SlideShare uma empresa Scribd logo
1 de 54
Baixar para ler offline
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 1
Introduction to Intelligent Control & Fuzzy
Logic
Learning Outcomes
In this topic we shall look at the fundamentals of intelligent control
and fuzzy logic. At the end of this topic you should be able to:
 Define intelligent control.
 Define fuzzy logic.
 Explain the structure and operation of fuzzy logic
controllers/systems
 Create a fuzzy logic system in Matlab.
 Explain the application of fuzzy logic in mechatronic systems.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 2
Introduction to Intelligent Control
What is Normal (Classical) Control?
 Open loop control system
o Signal is sent to plant (mechatronic device) in order to
make it move to a certain position
o No feedback to tell if the target has been reached
 Closed-loop control system
o Output of the plant is feedback to the input side
Controller
K
Process
G(s)
Input
R Output C
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 3
o Error between input and output is applied to a controller
which then controls the plant
 The whole idea behind classical control is that the system to
be controlled requires a model.
 The success of the system depends on the accuracy of this
model and controller parameters (e.g. PID controller gains).
 The model and the parameters are rigid (i.e. fixed) E.g. first
and second order systems and PID controller equation
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 4
First order system:
1
( )
1
G s
Ts


Second order system: 2 2
1
( )
2 n n
G s
s s 

 
PID controller TF:
What about Intelligent Control?
 The premise behind intelligent control is that the system to be
controlled does not have to be rigidly modelled.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 5
 This is unlike classical control and is the biggest distinction
between the two approaches.
 Humans can perform complex tasks without knowing exactly
how they do them (and without using a rigid model).
 Therefore, one may say that an intelligent method solves
o A difficult (non-trivial, complex, usually large or
complicated) problem
o In a non-trivial human-like way
 Types of intelligent control include:
o Fuzzy logic
o Artificial neural networks
o Genetic programming
o Support vector machines
o Reinforcement learning
 We shall consider Fuzzy logic and artificial neural networks
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 6
Components of Intelligent Systems
Structure of intelligent system
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 7
 Two categories of components
o Software Elements
 Knowledge Base – similar to a database, stores
rules and relationships between data elements
 Inference Engine – is the processing (program)
element. Performs reasoning using knowledge base
content and inputs
 Knowledge base manager – resource and
consistency management of the knowledge base
and relationships between knowledge items
o Users
 Knowledge Engineer – design, implement, verify,
validate the system
 User – person or (process/plant/device) that
connects to the inference engine
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 8
Introduction to Fuzzy Logic
What is Fuzzy Logic?
 Fuzzy logic like most of the intelligent control methods
attempts to model the way of reasoning that goes on in the
human brain.
 It is based on the idea that human reasoning is approximate,
non-quantitative, and non-binary. In many cases, there is no
black and white answer, but shades of grey
 The simplest example is temperature. Usually when you as
someone the temperature they respond with “cool”, “warm”,
“hot”, “very hot” as opposed to telling the exact temperature
such as “28.5 degrees” or “33.1 degrees”
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 9
 Fuzzy logic is a convenient way to map input space to output
space. E.g. How much to tip at a hotel? Input space is the
quality of service and output space is the amount of tip.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 10
Why use Fuzzy Logic?
Advantages over ‘conventional’ or ‘classical’ control:
 Don’t need a good mathematical model of process being
controlled.
 Control system requires less information
 Can be quicker to implement
 Rules (more details later) can be tested individually
Other advantages include:
1. Conceptually easy to understand – mathematical concepts
are simple
2. Flexible – easy to layer on more functionality to existing
system
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 11
3. Fuzzy logic is tolerant of imprecise data
Applications in Mechatronics include:
1. Speed and position control in mechatronic systems
(alternative to PID controllers)
2. Robot trajectory control and obstacle avoidance
3. Control of appliances such as washing machines
General Approach to Fuzzy Logic Control
The general approach to designing a fuzzy logic controller is
made up 5 steps. These steps are
1. Define the Input and Output Variables
2. Define the subsets (Fuzzy sets) intervals
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 12
3. Choose the Membership Functions
4. Set the IF-THEN rules
5. Perform calculations (using Fuzzy Inference) and adjust rules
The block diagram of a fuzzy controller is shown below.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 13
It has several components:
1. The rule-base is a set of IF-THEN rules about how to control
2. Fuzzification is the process of transforming the numeric
inputs into a form that can be used by the inference
mechanism. This relies on fuzzy sets and membership
functions.
3. The inference mechanism uses information about the current
inputs (formed by fuzzification), decides which rules apply in
the current situation, and forms conclusions about what the
plant input should be.
4. Defuzzification converts the conclusions reached by the
inference mechanism into a numeric input for the plant.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 14
We shall look at Fuzzy sets, Membership Functions, IF-THEN
rules, and Fuzzy Inference in the next section. Fuzzy Inference is
the combination of Fuzzification, the Inference Mechansim and
Defuzzification
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 15
Components of Fuzzy Logic
Fuzzy Sets
 Fuzzy logic relies on the notion of fuzzy sets
 A fuzzy set is a set without any crisp, clearly defined
boundaries.
 It can contain elements with a partial degree of membership.
 Classical sets either wholly include an element or wholly
exclude it. E.g. a set of the days of the week
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 16
 An example of a fuzzy set would the set of days that make up
the weekend
 Another example is age. If we were to ask “what is middle
age?, we would be inclined to classify middle age on grade
so that we classify middle age as fuzzy, rather than a crisp
set.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 17
Crisp set Fuzzy set
The curve in the fuzzy set that defines middle age is a function
that maps the input space (age) to the output space (middle
agedness or grade). Specifically, this is known as a membership
function.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 18
Membership Functions
 A membership function (MF) is a curve that defines how each
point in the input space is mapped to a membership value (or
degree of membership) between 0 and 1.
 The input space is sometimes referred to as the universe of
discourse.
 The output-axis is a number known as the membership value
between 0 and 1.
 The curve is known as a membership function and is often
given the designation of μ.
The only condition a membership function must satisfy is that it
must vary between 0 and 1.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 19
A classical set might be described as
A= { x | x>6 }
A fuzzy set is an extension of a classical set. If X is the universe
of discourse and its elements are denoted by x, then the fuzzy set
A in X is defined as a set of ordered pairs.
A= { x, A (x) | xX}
A (x) is called the membership function (or MF) of x in A. The
membership function maps each element of X to a membership
value between 0 and 1.
The fuzzy logic toolbox includes membership function types such
as, triangular membership function (trimf), trapezoidal
membership function (trapmf), simple Gaussian curve (gaussmf)
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 20
and a two-sided composite of two different Gaussian curves
(gauss2mf), sigmoid membership function (sigmf) and others.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 21
Fuzzy Logic Operators
 Fuzzy logic is a superset of standard Boolean logic
 If we keep the fuzzy values to the extremes of 1 (completely
true) and 0 (completely false), standard logical operators will
hold.
Standard truth tables
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 22
Fuzzy truth tables
Note some books use ‘intersection’ or ‘ ’ for the min operator and
‘union’ or ‘ ’ for the max operator
The standard and fuzzy truth tables are illustrated in figure below
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 23
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 24
If-Then Rules
 If-Then rules are fuzzy rules that are defined as a conditional
statement in the form:
IF x is A
THEN y is B
Where x and y are linguistic variables; and A and B are linguistic
values determined by fuzzy sets on the universe of discourses X
and Y, respectively
 The “IF” part of the rule is called the antecedent
 The “THEN” part is called the consequent
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 25
 Classical IF-THEN rules use binary logic, for example,
Rule: 1
IF speed is > 100
THEN stopping_distance is long
Rule: 2
IF speed is < 40
THEN stopping_distance is short
The variable speed can have any numerical value, but the
linguistic variable stopping_distance can take either value long or
short.
 Fuzzy IF-THEN rules example,
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 26
Rule: 1
IF speed is fast
THEN stopping_distance is long
Rule: 2
IF speed is slow
THEN stopping_distance is short
In this case the linguistic variable speed includes fuzzy sets such
as slow, medium and fast. The linguistic variable
stopping_distance may include fuzzy sets as short, medium and
long. Thus fuzzy rules relate to fuzzy sets.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 27
 Note that the antecedent is an interpretation that returns a
single number between 0 and 1.
 On the other hand, the consequent is an assignment that
assigns the entire fuzzy set B to the output variable y.
The Fuzzy Inference Process (from MATLAB Fuzzy Logic
Toolbox)
There are five parts to the fuzzy inference process (in the
MATLAB Fuzzy Logic Toolbox)
1. Fuzzification of the input variables
i. Takes the inputs and determines the degree to which
they belong to each of the appropriate fuzzy sets via
membership functions.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 28
ii. The input is always a crisp numerical value limited to
the universe of discourse of the input variable and the
output is a fuzzy degree of membership (always in
interval between 0 and 1).
2. Application of the fuzzy operator (AND or OR or NOT) in
the antecedent
i. If the antecedent of a given rule has more than one part,
the fuzzy operator is applied to obtain one number that
represents the result of the antecedent for that rule. This
number will then be applied to the output function.
ii. Any number of well-defined methods can fill in for the
AND operation or the OR operation.
iii. In fuzzy logic toolbox, two built -in AND methods are
supported: min (minimum) and prod (product). Two built-
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 29
in OR methods are also supported: max(maximum),
and the probabilistic OR method probor.
3. Implication from the antecedent to the consequent
i. The implication method is defined as the shaping of the
consequent (a fuzzy set) based on the antecedent ( a
single number).
ii. The input for the implication process is a single number
given by the antecedent, and the output is a fuzzy set.
iii. Implication occurs for each rule.
iv. Two built-in methods are supported, min (minimum)
which truncates the output fuzzy set, and prod (product)
which scales the output fuzzy set.
4. Aggregation of the consequents across the rules
i. Unify the outputs of each rule
5. Defuzzification
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 30
i. Input for defuzzification phase is unified fuzzy set
formed by aggregation of consequents and output is
crisp number.
ii. If there are more than one output variables, final output
for each variable is a crisp number.
iii. The most popular defuzzification method is the centroid
calculation, which returns the center of area under the
curve.
iv. There are five built-in methods supported: centroid,
bisector, middle of maximum ( the average of the
maximum value of the output set), largest of maximum,
and smallest of maximum.
The centroid defuzzification method is briefly explained below:
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 31
The centroid technique finds a point where a vertical line would
slice the aggregate set into two equal masses. In the figure below,
a centroid defuzzification finds a point representing the centre of
gravity of the fuzzy set, A, on the interval, ab. In practice, a
reasonable estimate is obtained by calculating over a sample of
points as shown below
( )
( )
b
A
x a
b
A
x a
x x
COG
x







EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 32
If you recall the block diagram of a fuzzy controller on page 12,
you will notice that the Inference Mechanism consists of steps
2,3,4 of the fuzzy inference process.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 33
Examples
The Basic Structure of Mamdani-style Fuzzy Inference
Lets examine a simple two-input one-output problem that includes
three rules:
Rule: 1
IF x is A3
OR y is B1
THEN z is C1
Rule: 2
IF x is A2
AND y is B2
THEN z is C2
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 34
Rule: 3
IF x is A1
THEN z is C3
Where x, y, z are linguistic variables; A1, A2 and A3 are linguistic
values determined by fuzzy sets on universe of discourse X; B1
and B2 are linguistic values determined by fuzzy sets on universe
of discourse Y; C1, C2, C3 are linguistic values determined by
fuzzy sets on universe of discourse Z.
The basic structure of the Mamdani-style fuzzy inference is shown
below:
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 35
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 36
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 37
For the defuzzification process, we calculate the centre of gravity
(centroid) of the output as:
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 38
Hence, the result of defuzzification, crisp output z1 is 67.4.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 39
Controlling the Distance Between Two Cars
Design a fuzzy controller/system for controlling the distance
between two cars.
Recall that the general approach to designing a fuzzy logic
controller is made up 5 steps (pages 11 and 12).
First, define the inputs and outputs. There are two inputs: D, the
distance between the cars, and v, the velocity of the following car.
There is one output: B, the amount of braking to apply to the
following car (force). The inputs and outputs are shown in the
figure below.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 40
Second, define the subsets’ intervals. To simplify things, 3 subset
intervals will be chosen for each variable. These are low, medium
and high for distance and velocity, and small, medium and big for
braking force. These subset intervals are illustrated in the figure
below.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 41
Third, choose the membership functions. In this example, the
shape of the membership functions are fairly simple, just a linear
transition between the various subsets (see above figure). To
illustrate, in the figure above, the membership function for low
distance goes down linearly from 1 to 0 as distance goes from 0
to 5 meters.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 42
Fourth, set the IF-THEN rules. This is how combinations of the
input determine the output. For example, IF the distance, D,
between the cars is low AND the velocity, v, of the following car is
high, THEN the braking to apply, B, is big. Similarly, the other
rules are defined. This is where the non-quantitative human
reasoning comes in. A simple two-rule system could be:
Rule: 1
IF D is Low
AND v is High
THEN B is Big
Rule: 2
IF D is Medium
AND v is High
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 43
THEN B is Medium
Fifth, perform calculations and adjust the rules. Since the rules
are non-exact some adjustments may be necessary to more
optimally control the vehicles’ distance.
As an example, say the distance between the vehicles is 2.5
meters and the speed of the following car is 100 km/h. From the
distance subset in Figure 8, the 2.5 meter distance translates into
0.25 medium distance plus 0.5 low distance. Likewise, the 100
km/h speed translates into 0.75 high speed. A process similar to
the Mamdani Fuzzy Inference Example (previous example) is
used to compute the final crisp braking percentage.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 44
Question
If the distance between the vehicles is 4 metres and the speed of
the following car is 60 km/hr what percentage braking will be
applied?
Using the Fuzzy Logic Toolbox GUI to Build a Fuzzy System
Refer to the document “Building Fuzzy System using GUI” in
Moodle. We shall build a fuzzy system for the previous example in
class.
Water Level Control (Simulink Example)
Refer to the document “Water Level Control” in Moodle
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 45
Further Mechatronic Systems Related Examples
Please refer to the papers in the reading resources folder on
Moodle.
Fuzzy knowledge-based controller design for autonomous
robot navigation
In this study a fuzzy logic controller for mobile robot navigation
has been designed. The designed controller deals with the
uncertainty and ambiguity of the information the system receives.
The technique has been used on an experimental mobile robot
which uses a set of seven ultrasonic sensors to perceive the
environment. The designed fuzzy controller maps the input space
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 46
(information coming from ultrasonic sensors) to a safe collision-
avoidance trajectory (output space) in real time. This is
accomplished by an inference process based on rules (a list of IF-
THEN statements) taken from a knowledge base. The technique
generates satisfactory direction and velocity maneuvers of the
autonomous vehicle which are used by the robot to reach its goal
safely. Simulation and experimental results show the method can
be used satisfactorily by wheeled mobile robots moving on
unknown static terrains
Fuzzy Logic Controller for Mechatronics and Automation
Conventional car suspensions systems are usually passive, i.e
have limitation in suspension control due to their fixed damping
force. Semi-active suspension system which is a modification of
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 47
active and passive suspension system has been found to be
more reliable and robust but yet easier and cheaper than the
active suspension system.
In semi active damping, the damper is adjustable and may be set
to any value between the damper-allowable maximum and
minimum values. Semi active control systems are a class of
active control systems for which external energy is needed like
active control systems.
In this paper a fuzzy logic controller and hybrid controller were
applied to a car Active suspension system. The fuzzy logic
controller was applied to the car suspension system with different
types of disturbances.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 48
The five general steps to design a fuzzy controller were followed
and a block diagram of the system is shown below:
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 49
Mechatronic Design and Control of Hybrid Electric Vehicles
The work in this paper presents techniques for design,
development, and control of hybrid electric vehicles (HEV’s).
Toward these ends, four issues are explored. First, the
development of HEV’s is presented. This synopsis includes a
novel definition of degree of hybridization for automotive vehicles.
Second, a load-leveling vehicle operation strategy is developed.
In order to accomplish the strategy, a fuzzy logic controller is
proposed. Fuzzy logic control is chosen because of the need for a
controller for a nonlinear, multidomain, and time-varying plant with
multiple uncertainties. Third, a novel technique for system
integration and component sizing is presented. Fourth, the system
design and control strategy is both simulated and then
implemented in an actual vehicle. The controller examined in this
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 50
study increased the fuel economy of a conventional full-sized
vehicle from 40 to 55.7 mi/h and increased the average efficiency
over the Federal Urban Driving Schedule from 23% to 35.4%. The
paper concludes with a discussion of the implications of intelligent
control and mechatronic systems as they apply to automobiles.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 51
Summary
 Intelligent control methods do not require rigid modelling of
the system that is to be controlled.
 An intelligent method solves a difficult problem in a non-trivial
human-like way.
 There are several types of intelligent control methods and we
considered fuzzy logic in this section.
 Fuzzy logic like most of the intelligent control methods
attempts to model the way of reasoning that goes on in the
human brain.
 It is based on the idea that human reasoning is approximate,
non-quantitative, and non-binary. In many cases, there is no
black and white answer, but shades of grey
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 52
 The general approach to designing a fuzzy controller
consists of 5 steps
o Define input and output variables
o Define the subsets intervals
o Choose membership functions
o Set IF-THEN rules
o Perform calculations (using Fuzzy Inference) and adjust
rules
 There are five parts to the fuzzy inference process
o Fuzzification of the input variables
o Application of the fuzzy operator (AND or OR or NOT) in
the antecedent
o Implication from the antecedent to the consequent
o Aggregation of the consequents across the rules
o Defuzzification
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 53
 Fuzzy logic can be used in mechatronic applications such
as speed, position, level control, robot trajectory control and
obstacle avoidance, hybrid electric vehicles, vehicle active
suspension systems, control of appliances such as washing
machines etc.
Sources
B. Smith, “Classical vs Intelligent Control”, in EN9940 Special Topics in Robotics Notes, Memorial
University, 2002. (http://www.engr.mun.ca/~baxter/Publications/ClassicalvsIntelligentControl.pdf )
K.M. Hangos, R. Lakner and M. Gerzson, “Intelligent Control Systems: An Introduction with
Examples”, Kluwer Academic Publishers, New York, USA, 2004.
“Fuzzy Logic Toolbox”, in MATLAB Full Product Family Help, MATLAB 7.10.0 (Release 2010a), The
Math Works Inc., Natick MA, USA, 2010. (electronic resource)
“Fuzzy Logic Toolbox User’s Guide Version 2.2.11”, in MATLAB Release 2010a PDF Documentation,
CDROM, The Math Works Inc., Natick MA, USA, 2010.
D. Necsulescu, “Mechatronics”, Prentice Hall, New Jersey, USA, 2002.
EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 54
M. Negnevitsky, “Artificial Intelligence: A Guide to Intelligent Systems”, Addison Wesley, Essex,
England, 2005.

Mais conteúdo relacionado

Mais procurados

Phase plane analysis (nonlinear stability analysis)
Phase plane analysis (nonlinear stability analysis)Phase plane analysis (nonlinear stability analysis)
Phase plane analysis (nonlinear stability analysis)Bindutesh Saner
 
Modern Control - Lec 01 - Introduction to Control System
Modern Control - Lec 01 - Introduction to Control SystemModern Control - Lec 01 - Introduction to Control System
Modern Control - Lec 01 - Introduction to Control SystemAmr E. Mohamed
 
Classical and Modern Control Theory
Classical and Modern Control TheoryClassical and Modern Control Theory
Classical and Modern Control TheoryQazi Ejaz
 
PID Controller Tuning
PID Controller TuningPID Controller Tuning
PID Controller TuningAhmad Taan
 
Control system lectures
Control system lectures Control system lectures
Control system lectures Naqqash Sajid
 
Modern Control - Lec 02 - Mathematical Modeling of Systems
Modern Control - Lec 02 - Mathematical Modeling of SystemsModern Control - Lec 02 - Mathematical Modeling of Systems
Modern Control - Lec 02 - Mathematical Modeling of SystemsAmr E. Mohamed
 
Error analysis
Error analysisError analysis
Error analysisSyed Saeed
 
Pid control
Pid controlPid control
Pid controlAB Rizvi
 
Transfer function of Electrical system
Transfer function of Electrical system Transfer function of Electrical system
Transfer function of Electrical system KALPANA K
 
Neuro-fuzzy systems
Neuro-fuzzy systemsNeuro-fuzzy systems
Neuro-fuzzy systemsSagar Ahire
 
Root locus compensation
Root locus compensationRoot locus compensation
Root locus compensationRamaiahsubasri
 
Application of fuzzy logic
Application of fuzzy logicApplication of fuzzy logic
Application of fuzzy logicViraj Patel
 
Fuzzy Logic and Neural Network
Fuzzy Logic and Neural NetworkFuzzy Logic and Neural Network
Fuzzy Logic and Neural NetworkSHIMI S L
 
Tuning of pid controller
Tuning of pid controllerTuning of pid controller
Tuning of pid controllerSubhankar Sau
 
State space analysis, eign values and eign vectors
State space analysis, eign values and eign vectorsState space analysis, eign values and eign vectors
State space analysis, eign values and eign vectorsShilpa Shukla
 

Mais procurados (20)

Phase plane analysis (nonlinear stability analysis)
Phase plane analysis (nonlinear stability analysis)Phase plane analysis (nonlinear stability analysis)
Phase plane analysis (nonlinear stability analysis)
 
Modern Control - Lec 01 - Introduction to Control System
Modern Control - Lec 01 - Introduction to Control SystemModern Control - Lec 01 - Introduction to Control System
Modern Control - Lec 01 - Introduction to Control System
 
Classical and Modern Control Theory
Classical and Modern Control TheoryClassical and Modern Control Theory
Classical and Modern Control Theory
 
Basics of control system
Basics of control system Basics of control system
Basics of control system
 
PID Controller Tuning
PID Controller TuningPID Controller Tuning
PID Controller Tuning
 
Control system lectures
Control system lectures Control system lectures
Control system lectures
 
Modern Control - Lec 02 - Mathematical Modeling of Systems
Modern Control - Lec 02 - Mathematical Modeling of SystemsModern Control - Lec 02 - Mathematical Modeling of Systems
Modern Control - Lec 02 - Mathematical Modeling of Systems
 
Compensators
CompensatorsCompensators
Compensators
 
Error analysis
Error analysisError analysis
Error analysis
 
Pid control
Pid controlPid control
Pid control
 
Nonlinear systems
Nonlinear systemsNonlinear systems
Nonlinear systems
 
Transfer function of Electrical system
Transfer function of Electrical system Transfer function of Electrical system
Transfer function of Electrical system
 
Neuro-fuzzy systems
Neuro-fuzzy systemsNeuro-fuzzy systems
Neuro-fuzzy systems
 
6. steady state error
6. steady state error6. steady state error
6. steady state error
 
Root locus compensation
Root locus compensationRoot locus compensation
Root locus compensation
 
Application of fuzzy logic
Application of fuzzy logicApplication of fuzzy logic
Application of fuzzy logic
 
State space analysis
State space analysisState space analysis
State space analysis
 
Fuzzy Logic and Neural Network
Fuzzy Logic and Neural NetworkFuzzy Logic and Neural Network
Fuzzy Logic and Neural Network
 
Tuning of pid controller
Tuning of pid controllerTuning of pid controller
Tuning of pid controller
 
State space analysis, eign values and eign vectors
State space analysis, eign values and eign vectorsState space analysis, eign values and eign vectors
State space analysis, eign values and eign vectors
 

Semelhante a Intelligent Control and Fuzzy Logic

A Learning Linguistic Teaching Control for a Multi-Area Electric Power System
A Learning Linguistic Teaching Control for a Multi-Area Electric Power SystemA Learning Linguistic Teaching Control for a Multi-Area Electric Power System
A Learning Linguistic Teaching Control for a Multi-Area Electric Power SystemCSCJournals
 
Report on robotic control
Report on robotic controlReport on robotic control
Report on robotic controlAnil Maurya
 
Presentation on fuzzy logic and fuzzy systems
Presentation on fuzzy logic and fuzzy systemsPresentation on fuzzy logic and fuzzy systems
Presentation on fuzzy logic and fuzzy systemsShreyaSahu20
 
Fuzzy logic systems
Fuzzy logic systemsFuzzy logic systems
Fuzzy logic systemsPham Tung
 
DESIGN AND SIMULATION OF FUZZY LOGIC CONTROLLER USING MATLAB
DESIGN AND SIMULATION OF FUZZY LOGIC CONTROLLER USING MATLABDESIGN AND SIMULATION OF FUZZY LOGIC CONTROLLER USING MATLAB
DESIGN AND SIMULATION OF FUZZY LOGIC CONTROLLER USING MATLABDr M Muruganandam Masilamani
 
Intelligence control using fuzzy logic
Intelligence control using fuzzy logicIntelligence control using fuzzy logic
Intelligence control using fuzzy logicelakiyakishok
 
Survey on Artificial Neural Network Learning Technique Algorithms
Survey on Artificial Neural Network Learning Technique AlgorithmsSurvey on Artificial Neural Network Learning Technique Algorithms
Survey on Artificial Neural Network Learning Technique AlgorithmsIRJET Journal
 
Universal Artificial Intelligence for Intelligent Agents: An Approach to Supe...
Universal Artificial Intelligence for Intelligent Agents: An Approach to Supe...Universal Artificial Intelligence for Intelligent Agents: An Approach to Supe...
Universal Artificial Intelligence for Intelligent Agents: An Approach to Supe...IOSR Journals
 
Intelligent Controller Design for a Chemical Process
Intelligent Controller Design for a Chemical ProcessIntelligent Controller Design for a Chemical Process
Intelligent Controller Design for a Chemical ProcessCSCJournals
 
Fuzzy Logic Based Parameter Adaptation of Interior Search Algorithm
Fuzzy Logic Based Parameter Adaptation of Interior Search AlgorithmFuzzy Logic Based Parameter Adaptation of Interior Search Algorithm
Fuzzy Logic Based Parameter Adaptation of Interior Search Algorithmijtsrd
 
Introduction Of Artificial neural network
Introduction Of Artificial neural networkIntroduction Of Artificial neural network
Introduction Of Artificial neural networkNagarajan
 
The application of fuzzy pid and multi-neuron adaptive pid control algorithm ...
The application of fuzzy pid and multi-neuron adaptive pid control algorithm ...The application of fuzzy pid and multi-neuron adaptive pid control algorithm ...
The application of fuzzy pid and multi-neuron adaptive pid control algorithm ...Evans Marshall
 

Semelhante a Intelligent Control and Fuzzy Logic (20)

A Learning Linguistic Teaching Control for a Multi-Area Electric Power System
A Learning Linguistic Teaching Control for a Multi-Area Electric Power SystemA Learning Linguistic Teaching Control for a Multi-Area Electric Power System
A Learning Linguistic Teaching Control for a Multi-Area Electric Power System
 
Report on robotic control
Report on robotic controlReport on robotic control
Report on robotic control
 
International Journal of Engineering Inventions (IJEI)
International Journal of Engineering Inventions (IJEI)International Journal of Engineering Inventions (IJEI)
International Journal of Engineering Inventions (IJEI)
 
Ejsr 86 3
Ejsr 86 3Ejsr 86 3
Ejsr 86 3
 
Presentation on fuzzy logic and fuzzy systems
Presentation on fuzzy logic and fuzzy systemsPresentation on fuzzy logic and fuzzy systems
Presentation on fuzzy logic and fuzzy systems
 
Fuzzy logic systems
Fuzzy logic systemsFuzzy logic systems
Fuzzy logic systems
 
DESIGN AND SIMULATION OF FUZZY LOGIC CONTROLLER USING MATLAB
DESIGN AND SIMULATION OF FUZZY LOGIC CONTROLLER USING MATLABDESIGN AND SIMULATION OF FUZZY LOGIC CONTROLLER USING MATLAB
DESIGN AND SIMULATION OF FUZZY LOGIC CONTROLLER USING MATLAB
 
Ece478 12es_final_report
Ece478 12es_final_reportEce478 12es_final_report
Ece478 12es_final_report
 
Intelligence control using fuzzy logic
Intelligence control using fuzzy logicIntelligence control using fuzzy logic
Intelligence control using fuzzy logic
 
What is Fuzzy Logic?
What is Fuzzy Logic?What is Fuzzy Logic?
What is Fuzzy Logic?
 
Survey on Artificial Neural Network Learning Technique Algorithms
Survey on Artificial Neural Network Learning Technique AlgorithmsSurvey on Artificial Neural Network Learning Technique Algorithms
Survey on Artificial Neural Network Learning Technique Algorithms
 
Universal Artificial Intelligence for Intelligent Agents: An Approach to Supe...
Universal Artificial Intelligence for Intelligent Agents: An Approach to Supe...Universal Artificial Intelligence for Intelligent Agents: An Approach to Supe...
Universal Artificial Intelligence for Intelligent Agents: An Approach to Supe...
 
Intelligent Controller Design for a Chemical Process
Intelligent Controller Design for a Chemical ProcessIntelligent Controller Design for a Chemical Process
Intelligent Controller Design for a Chemical Process
 
Fuzzy Logic Based Parameter Adaptation of Interior Search Algorithm
Fuzzy Logic Based Parameter Adaptation of Interior Search AlgorithmFuzzy Logic Based Parameter Adaptation of Interior Search Algorithm
Fuzzy Logic Based Parameter Adaptation of Interior Search Algorithm
 
J010528691
J010528691J010528691
J010528691
 
Fuzzy logic ppt
Fuzzy logic pptFuzzy logic ppt
Fuzzy logic ppt
 
Project_Report_Debargha
Project_Report_DebarghaProject_Report_Debargha
Project_Report_Debargha
 
109 me0422
109 me0422109 me0422
109 me0422
 
Introduction Of Artificial neural network
Introduction Of Artificial neural networkIntroduction Of Artificial neural network
Introduction Of Artificial neural network
 
The application of fuzzy pid and multi-neuron adaptive pid control algorithm ...
The application of fuzzy pid and multi-neuron adaptive pid control algorithm ...The application of fuzzy pid and multi-neuron adaptive pid control algorithm ...
The application of fuzzy pid and multi-neuron adaptive pid control algorithm ...
 

Mais de Praneel Chand

Oscilloscopes and Scan Tools
Oscilloscopes and Scan ToolsOscilloscopes and Scan Tools
Oscilloscopes and Scan ToolsPraneel Chand
 
project marking rubric - EE323 2015
project marking rubric - EE323 2015project marking rubric - EE323 2015
project marking rubric - EE323 2015Praneel Chand
 
EE323 Mini-Project - Line tracing robot
EE323 Mini-Project - Line tracing robotEE323 Mini-Project - Line tracing robot
EE323 Mini-Project - Line tracing robotPraneel Chand
 
EE312_ Control System Engineering_Moodle_Page
EE312_ Control System Engineering_Moodle_PageEE312_ Control System Engineering_Moodle_Page
EE312_ Control System Engineering_Moodle_PagePraneel Chand
 
Assessment 3 descriptor
Assessment 3 descriptorAssessment 3 descriptor
Assessment 3 descriptorPraneel Chand
 
Assessment 2 descriptor
Assessment 2  descriptorAssessment 2  descriptor
Assessment 2 descriptorPraneel Chand
 
Assessment 1 descriptor
Assessment 1 descriptorAssessment 1 descriptor
Assessment 1 descriptorPraneel Chand
 
Introduction to Vehicle Electronic Systems and Fault Diagnosis
Introduction to Vehicle Electronic Systems and Fault DiagnosisIntroduction to Vehicle Electronic Systems and Fault Diagnosis
Introduction to Vehicle Electronic Systems and Fault DiagnosisPraneel Chand
 
Multisensor Fusion and Integration - pres
Multisensor Fusion and Integration - presMultisensor Fusion and Integration - pres
Multisensor Fusion and Integration - presPraneel Chand
 
Direct Digital Design
Direct Digital DesignDirect Digital Design
Direct Digital DesignPraneel Chand
 
EE312 – System Performance-lect rev1
EE312 – System Performance-lect rev1EE312 – System Performance-lect rev1
EE312 – System Performance-lect rev1Praneel Chand
 

Mais de Praneel Chand (12)

Oscilloscopes and Scan Tools
Oscilloscopes and Scan ToolsOscilloscopes and Scan Tools
Oscilloscopes and Scan Tools
 
Moodle page samples
Moodle page samplesMoodle page samples
Moodle page samples
 
project marking rubric - EE323 2015
project marking rubric - EE323 2015project marking rubric - EE323 2015
project marking rubric - EE323 2015
 
EE323 Mini-Project - Line tracing robot
EE323 Mini-Project - Line tracing robotEE323 Mini-Project - Line tracing robot
EE323 Mini-Project - Line tracing robot
 
EE312_ Control System Engineering_Moodle_Page
EE312_ Control System Engineering_Moodle_PageEE312_ Control System Engineering_Moodle_Page
EE312_ Control System Engineering_Moodle_Page
 
Assessment 3 descriptor
Assessment 3 descriptorAssessment 3 descriptor
Assessment 3 descriptor
 
Assessment 2 descriptor
Assessment 2  descriptorAssessment 2  descriptor
Assessment 2 descriptor
 
Assessment 1 descriptor
Assessment 1 descriptorAssessment 1 descriptor
Assessment 1 descriptor
 
Introduction to Vehicle Electronic Systems and Fault Diagnosis
Introduction to Vehicle Electronic Systems and Fault DiagnosisIntroduction to Vehicle Electronic Systems and Fault Diagnosis
Introduction to Vehicle Electronic Systems and Fault Diagnosis
 
Multisensor Fusion and Integration - pres
Multisensor Fusion and Integration - presMultisensor Fusion and Integration - pres
Multisensor Fusion and Integration - pres
 
Direct Digital Design
Direct Digital DesignDirect Digital Design
Direct Digital Design
 
EE312 – System Performance-lect rev1
EE312 – System Performance-lect rev1EE312 – System Performance-lect rev1
EE312 – System Performance-lect rev1
 

Intelligent Control and Fuzzy Logic

  • 1. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 1 Introduction to Intelligent Control & Fuzzy Logic Learning Outcomes In this topic we shall look at the fundamentals of intelligent control and fuzzy logic. At the end of this topic you should be able to:  Define intelligent control.  Define fuzzy logic.  Explain the structure and operation of fuzzy logic controllers/systems  Create a fuzzy logic system in Matlab.  Explain the application of fuzzy logic in mechatronic systems.
  • 2. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 2 Introduction to Intelligent Control What is Normal (Classical) Control?  Open loop control system o Signal is sent to plant (mechatronic device) in order to make it move to a certain position o No feedback to tell if the target has been reached  Closed-loop control system o Output of the plant is feedback to the input side Controller K Process G(s) Input R Output C
  • 3. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 3 o Error between input and output is applied to a controller which then controls the plant  The whole idea behind classical control is that the system to be controlled requires a model.  The success of the system depends on the accuracy of this model and controller parameters (e.g. PID controller gains).  The model and the parameters are rigid (i.e. fixed) E.g. first and second order systems and PID controller equation
  • 4. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 4 First order system: 1 ( ) 1 G s Ts   Second order system: 2 2 1 ( ) 2 n n G s s s     PID controller TF: What about Intelligent Control?  The premise behind intelligent control is that the system to be controlled does not have to be rigidly modelled.
  • 5. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 5  This is unlike classical control and is the biggest distinction between the two approaches.  Humans can perform complex tasks without knowing exactly how they do them (and without using a rigid model).  Therefore, one may say that an intelligent method solves o A difficult (non-trivial, complex, usually large or complicated) problem o In a non-trivial human-like way  Types of intelligent control include: o Fuzzy logic o Artificial neural networks o Genetic programming o Support vector machines o Reinforcement learning  We shall consider Fuzzy logic and artificial neural networks
  • 6. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 6 Components of Intelligent Systems Structure of intelligent system
  • 7. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 7  Two categories of components o Software Elements  Knowledge Base – similar to a database, stores rules and relationships between data elements  Inference Engine – is the processing (program) element. Performs reasoning using knowledge base content and inputs  Knowledge base manager – resource and consistency management of the knowledge base and relationships between knowledge items o Users  Knowledge Engineer – design, implement, verify, validate the system  User – person or (process/plant/device) that connects to the inference engine
  • 8. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 8 Introduction to Fuzzy Logic What is Fuzzy Logic?  Fuzzy logic like most of the intelligent control methods attempts to model the way of reasoning that goes on in the human brain.  It is based on the idea that human reasoning is approximate, non-quantitative, and non-binary. In many cases, there is no black and white answer, but shades of grey  The simplest example is temperature. Usually when you as someone the temperature they respond with “cool”, “warm”, “hot”, “very hot” as opposed to telling the exact temperature such as “28.5 degrees” or “33.1 degrees”
  • 9. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 9  Fuzzy logic is a convenient way to map input space to output space. E.g. How much to tip at a hotel? Input space is the quality of service and output space is the amount of tip.
  • 10. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 10 Why use Fuzzy Logic? Advantages over ‘conventional’ or ‘classical’ control:  Don’t need a good mathematical model of process being controlled.  Control system requires less information  Can be quicker to implement  Rules (more details later) can be tested individually Other advantages include: 1. Conceptually easy to understand – mathematical concepts are simple 2. Flexible – easy to layer on more functionality to existing system
  • 11. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 11 3. Fuzzy logic is tolerant of imprecise data Applications in Mechatronics include: 1. Speed and position control in mechatronic systems (alternative to PID controllers) 2. Robot trajectory control and obstacle avoidance 3. Control of appliances such as washing machines General Approach to Fuzzy Logic Control The general approach to designing a fuzzy logic controller is made up 5 steps. These steps are 1. Define the Input and Output Variables 2. Define the subsets (Fuzzy sets) intervals
  • 12. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 12 3. Choose the Membership Functions 4. Set the IF-THEN rules 5. Perform calculations (using Fuzzy Inference) and adjust rules The block diagram of a fuzzy controller is shown below.
  • 13. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 13 It has several components: 1. The rule-base is a set of IF-THEN rules about how to control 2. Fuzzification is the process of transforming the numeric inputs into a form that can be used by the inference mechanism. This relies on fuzzy sets and membership functions. 3. The inference mechanism uses information about the current inputs (formed by fuzzification), decides which rules apply in the current situation, and forms conclusions about what the plant input should be. 4. Defuzzification converts the conclusions reached by the inference mechanism into a numeric input for the plant.
  • 14. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 14 We shall look at Fuzzy sets, Membership Functions, IF-THEN rules, and Fuzzy Inference in the next section. Fuzzy Inference is the combination of Fuzzification, the Inference Mechansim and Defuzzification
  • 15. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 15 Components of Fuzzy Logic Fuzzy Sets  Fuzzy logic relies on the notion of fuzzy sets  A fuzzy set is a set without any crisp, clearly defined boundaries.  It can contain elements with a partial degree of membership.  Classical sets either wholly include an element or wholly exclude it. E.g. a set of the days of the week
  • 16. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 16  An example of a fuzzy set would the set of days that make up the weekend  Another example is age. If we were to ask “what is middle age?, we would be inclined to classify middle age on grade so that we classify middle age as fuzzy, rather than a crisp set.
  • 17. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 17 Crisp set Fuzzy set The curve in the fuzzy set that defines middle age is a function that maps the input space (age) to the output space (middle agedness or grade). Specifically, this is known as a membership function.
  • 18. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 18 Membership Functions  A membership function (MF) is a curve that defines how each point in the input space is mapped to a membership value (or degree of membership) between 0 and 1.  The input space is sometimes referred to as the universe of discourse.  The output-axis is a number known as the membership value between 0 and 1.  The curve is known as a membership function and is often given the designation of μ. The only condition a membership function must satisfy is that it must vary between 0 and 1.
  • 19. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 19 A classical set might be described as A= { x | x>6 } A fuzzy set is an extension of a classical set. If X is the universe of discourse and its elements are denoted by x, then the fuzzy set A in X is defined as a set of ordered pairs. A= { x, A (x) | xX} A (x) is called the membership function (or MF) of x in A. The membership function maps each element of X to a membership value between 0 and 1. The fuzzy logic toolbox includes membership function types such as, triangular membership function (trimf), trapezoidal membership function (trapmf), simple Gaussian curve (gaussmf)
  • 20. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 20 and a two-sided composite of two different Gaussian curves (gauss2mf), sigmoid membership function (sigmf) and others.
  • 21. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 21 Fuzzy Logic Operators  Fuzzy logic is a superset of standard Boolean logic  If we keep the fuzzy values to the extremes of 1 (completely true) and 0 (completely false), standard logical operators will hold. Standard truth tables
  • 22. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 22 Fuzzy truth tables Note some books use ‘intersection’ or ‘ ’ for the min operator and ‘union’ or ‘ ’ for the max operator The standard and fuzzy truth tables are illustrated in figure below
  • 23. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 23
  • 24. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 24 If-Then Rules  If-Then rules are fuzzy rules that are defined as a conditional statement in the form: IF x is A THEN y is B Where x and y are linguistic variables; and A and B are linguistic values determined by fuzzy sets on the universe of discourses X and Y, respectively  The “IF” part of the rule is called the antecedent  The “THEN” part is called the consequent
  • 25. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 25  Classical IF-THEN rules use binary logic, for example, Rule: 1 IF speed is > 100 THEN stopping_distance is long Rule: 2 IF speed is < 40 THEN stopping_distance is short The variable speed can have any numerical value, but the linguistic variable stopping_distance can take either value long or short.  Fuzzy IF-THEN rules example,
  • 26. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 26 Rule: 1 IF speed is fast THEN stopping_distance is long Rule: 2 IF speed is slow THEN stopping_distance is short In this case the linguistic variable speed includes fuzzy sets such as slow, medium and fast. The linguistic variable stopping_distance may include fuzzy sets as short, medium and long. Thus fuzzy rules relate to fuzzy sets.
  • 27. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 27  Note that the antecedent is an interpretation that returns a single number between 0 and 1.  On the other hand, the consequent is an assignment that assigns the entire fuzzy set B to the output variable y. The Fuzzy Inference Process (from MATLAB Fuzzy Logic Toolbox) There are five parts to the fuzzy inference process (in the MATLAB Fuzzy Logic Toolbox) 1. Fuzzification of the input variables i. Takes the inputs and determines the degree to which they belong to each of the appropriate fuzzy sets via membership functions.
  • 28. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 28 ii. The input is always a crisp numerical value limited to the universe of discourse of the input variable and the output is a fuzzy degree of membership (always in interval between 0 and 1). 2. Application of the fuzzy operator (AND or OR or NOT) in the antecedent i. If the antecedent of a given rule has more than one part, the fuzzy operator is applied to obtain one number that represents the result of the antecedent for that rule. This number will then be applied to the output function. ii. Any number of well-defined methods can fill in for the AND operation or the OR operation. iii. In fuzzy logic toolbox, two built -in AND methods are supported: min (minimum) and prod (product). Two built-
  • 29. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 29 in OR methods are also supported: max(maximum), and the probabilistic OR method probor. 3. Implication from the antecedent to the consequent i. The implication method is defined as the shaping of the consequent (a fuzzy set) based on the antecedent ( a single number). ii. The input for the implication process is a single number given by the antecedent, and the output is a fuzzy set. iii. Implication occurs for each rule. iv. Two built-in methods are supported, min (minimum) which truncates the output fuzzy set, and prod (product) which scales the output fuzzy set. 4. Aggregation of the consequents across the rules i. Unify the outputs of each rule 5. Defuzzification
  • 30. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 30 i. Input for defuzzification phase is unified fuzzy set formed by aggregation of consequents and output is crisp number. ii. If there are more than one output variables, final output for each variable is a crisp number. iii. The most popular defuzzification method is the centroid calculation, which returns the center of area under the curve. iv. There are five built-in methods supported: centroid, bisector, middle of maximum ( the average of the maximum value of the output set), largest of maximum, and smallest of maximum. The centroid defuzzification method is briefly explained below:
  • 31. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 31 The centroid technique finds a point where a vertical line would slice the aggregate set into two equal masses. In the figure below, a centroid defuzzification finds a point representing the centre of gravity of the fuzzy set, A, on the interval, ab. In practice, a reasonable estimate is obtained by calculating over a sample of points as shown below ( ) ( ) b A x a b A x a x x COG x       
  • 32. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 32 If you recall the block diagram of a fuzzy controller on page 12, you will notice that the Inference Mechanism consists of steps 2,3,4 of the fuzzy inference process.
  • 33. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 33 Examples The Basic Structure of Mamdani-style Fuzzy Inference Lets examine a simple two-input one-output problem that includes three rules: Rule: 1 IF x is A3 OR y is B1 THEN z is C1 Rule: 2 IF x is A2 AND y is B2 THEN z is C2
  • 34. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 34 Rule: 3 IF x is A1 THEN z is C3 Where x, y, z are linguistic variables; A1, A2 and A3 are linguistic values determined by fuzzy sets on universe of discourse X; B1 and B2 are linguistic values determined by fuzzy sets on universe of discourse Y; C1, C2, C3 are linguistic values determined by fuzzy sets on universe of discourse Z. The basic structure of the Mamdani-style fuzzy inference is shown below:
  • 35. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 35
  • 36. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 36
  • 37. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 37 For the defuzzification process, we calculate the centre of gravity (centroid) of the output as:
  • 38. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 38 Hence, the result of defuzzification, crisp output z1 is 67.4.
  • 39. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 39 Controlling the Distance Between Two Cars Design a fuzzy controller/system for controlling the distance between two cars. Recall that the general approach to designing a fuzzy logic controller is made up 5 steps (pages 11 and 12). First, define the inputs and outputs. There are two inputs: D, the distance between the cars, and v, the velocity of the following car. There is one output: B, the amount of braking to apply to the following car (force). The inputs and outputs are shown in the figure below.
  • 40. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 40 Second, define the subsets’ intervals. To simplify things, 3 subset intervals will be chosen for each variable. These are low, medium and high for distance and velocity, and small, medium and big for braking force. These subset intervals are illustrated in the figure below.
  • 41. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 41 Third, choose the membership functions. In this example, the shape of the membership functions are fairly simple, just a linear transition between the various subsets (see above figure). To illustrate, in the figure above, the membership function for low distance goes down linearly from 1 to 0 as distance goes from 0 to 5 meters.
  • 42. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 42 Fourth, set the IF-THEN rules. This is how combinations of the input determine the output. For example, IF the distance, D, between the cars is low AND the velocity, v, of the following car is high, THEN the braking to apply, B, is big. Similarly, the other rules are defined. This is where the non-quantitative human reasoning comes in. A simple two-rule system could be: Rule: 1 IF D is Low AND v is High THEN B is Big Rule: 2 IF D is Medium AND v is High
  • 43. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 43 THEN B is Medium Fifth, perform calculations and adjust the rules. Since the rules are non-exact some adjustments may be necessary to more optimally control the vehicles’ distance. As an example, say the distance between the vehicles is 2.5 meters and the speed of the following car is 100 km/h. From the distance subset in Figure 8, the 2.5 meter distance translates into 0.25 medium distance plus 0.5 low distance. Likewise, the 100 km/h speed translates into 0.75 high speed. A process similar to the Mamdani Fuzzy Inference Example (previous example) is used to compute the final crisp braking percentage.
  • 44. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 44 Question If the distance between the vehicles is 4 metres and the speed of the following car is 60 km/hr what percentage braking will be applied? Using the Fuzzy Logic Toolbox GUI to Build a Fuzzy System Refer to the document “Building Fuzzy System using GUI” in Moodle. We shall build a fuzzy system for the previous example in class. Water Level Control (Simulink Example) Refer to the document “Water Level Control” in Moodle
  • 45. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 45 Further Mechatronic Systems Related Examples Please refer to the papers in the reading resources folder on Moodle. Fuzzy knowledge-based controller design for autonomous robot navigation In this study a fuzzy logic controller for mobile robot navigation has been designed. The designed controller deals with the uncertainty and ambiguity of the information the system receives. The technique has been used on an experimental mobile robot which uses a set of seven ultrasonic sensors to perceive the environment. The designed fuzzy controller maps the input space
  • 46. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 46 (information coming from ultrasonic sensors) to a safe collision- avoidance trajectory (output space) in real time. This is accomplished by an inference process based on rules (a list of IF- THEN statements) taken from a knowledge base. The technique generates satisfactory direction and velocity maneuvers of the autonomous vehicle which are used by the robot to reach its goal safely. Simulation and experimental results show the method can be used satisfactorily by wheeled mobile robots moving on unknown static terrains Fuzzy Logic Controller for Mechatronics and Automation Conventional car suspensions systems are usually passive, i.e have limitation in suspension control due to their fixed damping force. Semi-active suspension system which is a modification of
  • 47. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 47 active and passive suspension system has been found to be more reliable and robust but yet easier and cheaper than the active suspension system. In semi active damping, the damper is adjustable and may be set to any value between the damper-allowable maximum and minimum values. Semi active control systems are a class of active control systems for which external energy is needed like active control systems. In this paper a fuzzy logic controller and hybrid controller were applied to a car Active suspension system. The fuzzy logic controller was applied to the car suspension system with different types of disturbances.
  • 48. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 48 The five general steps to design a fuzzy controller were followed and a block diagram of the system is shown below:
  • 49. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 49 Mechatronic Design and Control of Hybrid Electric Vehicles The work in this paper presents techniques for design, development, and control of hybrid electric vehicles (HEV’s). Toward these ends, four issues are explored. First, the development of HEV’s is presented. This synopsis includes a novel definition of degree of hybridization for automotive vehicles. Second, a load-leveling vehicle operation strategy is developed. In order to accomplish the strategy, a fuzzy logic controller is proposed. Fuzzy logic control is chosen because of the need for a controller for a nonlinear, multidomain, and time-varying plant with multiple uncertainties. Third, a novel technique for system integration and component sizing is presented. Fourth, the system design and control strategy is both simulated and then implemented in an actual vehicle. The controller examined in this
  • 50. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 50 study increased the fuel economy of a conventional full-sized vehicle from 40 to 55.7 mi/h and increased the average efficiency over the Federal Urban Driving Schedule from 23% to 35.4%. The paper concludes with a discussion of the implications of intelligent control and mechatronic systems as they apply to automobiles.
  • 51. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 51 Summary  Intelligent control methods do not require rigid modelling of the system that is to be controlled.  An intelligent method solves a difficult problem in a non-trivial human-like way.  There are several types of intelligent control methods and we considered fuzzy logic in this section.  Fuzzy logic like most of the intelligent control methods attempts to model the way of reasoning that goes on in the human brain.  It is based on the idea that human reasoning is approximate, non-quantitative, and non-binary. In many cases, there is no black and white answer, but shades of grey
  • 52. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 52  The general approach to designing a fuzzy controller consists of 5 steps o Define input and output variables o Define the subsets intervals o Choose membership functions o Set IF-THEN rules o Perform calculations (using Fuzzy Inference) and adjust rules  There are five parts to the fuzzy inference process o Fuzzification of the input variables o Application of the fuzzy operator (AND or OR or NOT) in the antecedent o Implication from the antecedent to the consequent o Aggregation of the consequents across the rules o Defuzzification
  • 53. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 53  Fuzzy logic can be used in mechatronic applications such as speed, position, level control, robot trajectory control and obstacle avoidance, hybrid electric vehicles, vehicle active suspension systems, control of appliances such as washing machines etc. Sources B. Smith, “Classical vs Intelligent Control”, in EN9940 Special Topics in Robotics Notes, Memorial University, 2002. (http://www.engr.mun.ca/~baxter/Publications/ClassicalvsIntelligentControl.pdf ) K.M. Hangos, R. Lakner and M. Gerzson, “Intelligent Control Systems: An Introduction with Examples”, Kluwer Academic Publishers, New York, USA, 2004. “Fuzzy Logic Toolbox”, in MATLAB Full Product Family Help, MATLAB 7.10.0 (Release 2010a), The Math Works Inc., Natick MA, USA, 2010. (electronic resource) “Fuzzy Logic Toolbox User’s Guide Version 2.2.11”, in MATLAB Release 2010a PDF Documentation, CDROM, The Math Works Inc., Natick MA, USA, 2010. D. Necsulescu, “Mechatronics”, Prentice Hall, New Jersey, USA, 2002.
  • 54. EE363 Mechatronics – 2014: Introduction to Intelligent Control & Fuzzy Logic Dr. Praneel Chand 54 M. Negnevitsky, “Artificial Intelligence: A Guide to Intelligent Systems”, Addison Wesley, Essex, England, 2005.