0% found this document useful (0 votes)
54 views45 pages

Introduction - Fuzzy Inference Systems - Examples

This document discusses fuzzy logic, providing an introduction to fuzzy logic concepts and applications. It describes fuzzy logic as a computational paradigm that allows for imprecise terms like temperature is hot or speed is slow, similar to how the human brain processes information. Examples of applications are given, such as subway control systems in Japan and automatic transmissions for cars that use fuzzy logic for smooth control.

Uploaded by

Sudo User
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)
54 views45 pages

Introduction - Fuzzy Inference Systems - Examples

This document discusses fuzzy logic, providing an introduction to fuzzy logic concepts and applications. It describes fuzzy logic as a computational paradigm that allows for imprecise terms like temperature is hot or speed is slow, similar to how the human brain processes information. Examples of applications are given, such as subway control systems in Japan and automatic transmissions for cars that use fuzzy logic for smooth control.

Uploaded by

Sudo User
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/ 45

• Introduction

• Fuzzy Inference Systems


• Examples
Fuzzy Logic
• Introduction
– What is Fuzzy Logic?
– Applications of Fuzzy Logic
– Classical Control System vs. Fuzzy Control
• Developing a Fuzzy Control System
• Examples
• Theory of Fuzzy Sets
• Fuzzy Inference Systems

menu
Topics
• Introduction
Basics • Basic Algorithm
Control Systems • Control Systems
Computations • Sample Computations
Inverted Pendulum • Inverted Pendulum
• Fuzzy Inference Systems
Mamdani – Mamdani Type
Sugeno – Sugeno Type
Fuzzy Sets • Fuzzy Sets & Operators
Defuzzification • Defuzzification
Mem. Fcns • Membership Functions
menu
Fuzzy Logic
What is Fuzzy Logic?
A computational paradigm that is based on how humans think

Fuzzy Logic looks at the world in imprecise terms, in much the same way
that our brain takes in information (e.g. temperature is hot, speed is slow),
then responds with precise actions.

The human brain can reason with uncertainties, vagueness, and


judgments. Computers can only manipulate precise valuations. Fuzzy logic
is an attempt to combine the two techniques.

“Fuzzy” – a misnomer, has resulted in the mistaken suspicion that FL is


somehow less exacting than traditional logic

menu
Fuzzy Logic
What is Fuzzy Logic?

FL is in fact, a precise problem-solving methodology.

It is able to simultaneously handle numerical data and linguistic


knowledge.

A technique that facilitates the control of a complicated system without


knowledge of its mathematical description.

Fuzzy logic differs from classical logic in that statements are no longer
black or white, true or false, on or off.
In traditional logic an object takes on a value of either zero or one.
In fuzzy logic, a statement can assume any real value between 0 and 1,
representing the degree to which an element belongs to a given set.

menu
Fuzzy Logic
History of Fuzzy Logic

Professor Lotfi A. Zadeh


http://www.cs.berkeley.edu/~zadeh/

In 1965, Lotfi A. Zadeh of the University of California at Berkeley published


"Fuzzy Sets," which laid out the mathematics of fuzzy set theory and, by
extension, fuzzy logic. Zadeh had observed that conventional computer logic
couldn't manipulate data that represented subjective or vague ideas, so he created
fuzzy logic to allow computers to determine the distinctions among data with
shades of gray, similar to the process of human reasoning.

Source: August 30, 2004 http://www.computerworld.com/news/2004/story/0,11280,95282,00.html


(Computerworld) menu
Pioneering works
20 years later after its conception
• Interest in fuzzy systems was sparked by Seiji Yasunobu and Soji
Miyamoto of Hitachi, who in 1985 provided simulations that
demonstrated the superiority of fuzzy control systems for the Sendai
railway. Their ideas were adopted, and fuzzy systems were used to
control accelerating and braking when the line opened in 1987.

• Also in 1987, during an international meeting of fuzzy researchers in


Tokyo, Takeshi Yamakawa demonstrated the use of fuzzy control,
through a set of simple dedicated fuzzy logic chips, in an "inverted
pendulum" experiment. This is a classic control problem, in which a
vehicle tries to keep a pole mounted on its top by a hinge upright by
moving back and forth.

• Observers were impressed with this demonstration, as well as later


experiments by Yamakawa in which he mounted a wine glass
containing water or even a live mouse to the top of the pendulum.
The system maintained stability in both cases. Yamakawa
eventually went on to organize his own fuzzy-systems research lab
to help exploit his patents in the field.
http://en.wikipedia.org/wiki/Fuzzy_control_system menu
Meeting Lotfi in Germany

My Fuzzy Logic-based
Researches
• Robot Navigation
– Real-time path-planning
(Hybrid Fuzzy A*)
• Machine Vision
– Real-time colour-object
recognition
– Colour correction
– Fuzzy Colour Contrast 9th Fuzzy Days (2006), Dortmund,
Fusion Germany
– Fuzzy-Genetic Colour
Contrast Fusion
Meeting Prof. Yamakawa in Japan

ICONIP 2007, Kitakyushu, Japan

menu
Fuzzy Logic
Introduction of FL in the Engineering world (1990’s),
Fuzzy Logic is one of the most talked-about technologies to hit the embedded
control field in recent years. It has already transformed many product
markets in Japan and Korea, and has begun to attract a widespread following
In the United States. Industry watchers predict that fuzzy technology is on its
way to becoming a multibillion-dollar business.

Fuzzy Logic enables low cost microcontrollers to perform functions traditionally


performed by more powerful expensive machines enabling lower cost products
to execute advanced features.

Intel Corporation's Embedded Microcomputer Division Fuzzy Logic Operation

Motorola 68HC12 MCU

http://www.intel.com/design/mcs96/designex/2351.htm

menu
Sample Applications
In the city of Sendai in Japan, a 16-station subway system
is controlled by a fuzzy computer (Seiji Yasunobu and Soji
Miyamoto of Hitachi) – the ride is so smooth, riders do not
need to hold straps

Nissan – fuzzy automatic transmission, fuzzy anti-skid braking


system

CSK, Hitachi – Hand-writing Recognition


Sony - Hand-printed character recognition
Ricoh, Hitachi – Voice recognition

Tokyo’s stock market has had at least one stock-trading


portfolio based on Fuzzy Logic that outperformed the Nikkei
exchange average
Sample Applications
NASA has studied fuzzy control for automated space
docking: simulations show that a fuzzy control system can
greatly reduce fuel consumption

Canon developed an auto-focusing camera that uses a


charge-coupled device (CCD) to measure the clarity of the
image in six regions of its field of view and use the information
provided to determine if the image is in focus. It also tracks the
rate of change of lens movement during focusing, and controls
its speed to prevent overshoot.
The camera's fuzzy control system uses 12 inputs: 6 to obtain the current clarity
data provided by the CCD and 6 to measure the rate of change of lens movement.
The output is the position of the lens. The fuzzy control system uses 13 rules and
requires 1.1 kilobytes of memory.

http://en.wikipedia.org/wiki/Fuzzy_system
Sample Applications
For washing machines, Fuzzy Logic control is almost
becoming a standard feature
fuzzy controllers to load-weight, fabric-mix, and dirt sensors and automatically set the
wash cycle for the best use of power, water, and detergent.

GE WPRB9110WH Top Load Washer

Haier ESL-T21 Top Load Washer

LG WD14121 Front Load Washer

Miele WT945 Front Load All-in-One Washer / Dryer

AEG LL1610 Front Load Washer

Zanussi ZWF1430W Front Load Washer

Others: Samsung, Toshiba, National, Matsushita, etc.


Control Systems

• Conventional Control vs. Fuzzy Control

menu
Control Systems in General
Objective The aim of any control system is to produce a set of desired
outputs for a given set of inputs.

Samples
A household thermostat takes a
temperature input and sends a control
signal to a furnace.

Crankshaft (red), pistons (gray) in


their cylinders (blue), and flywheel
(black)

Image: http://en.wikipedia.org/wiki/Crankshaft

A car engine controller responds to variables such as engine position,


manifold pressure and cylinder temperature to regulate fuel flow and
spark timing.
menu
Conventional Control vs. Fuzzy
Look-up table
In the simplest case, a controller takes its cues from a look-up table, which tells
what output to produce for every input or combination of inputs.

Sample
The table might tell the controller,
“IF temperature is 85, THEN increase furnace fan speed to 300 RPM.”

Drawbacks
The problem with the tabular approach is that the table can get very long,
especially in situations where there are many inputs or outputs. And that, in
turn, may require more memory than the controller can handle, or more
than is cost-effective.

Tabular control mechanisms may also give a bumpy, uneven response, as the
controller jumps from one table-based value to the next.
menu
Conventional Control vs. Fuzzy
Mathematical formula

The usual alternative to look-up tables is to have the controller execute a


mathematical formula – a set of control equations that express the output
as a function of the input.

Ideally, these equations represent an accurate model of the system


behaviour.

For example:  2   2 
 m ( x  l sin  )  l cos    m ( l cos  )  l sin   mgl sin 
 t  t
2 2
 

Downside
The formulas can be very complex, and working them out in real-time may be
more than an affordable controller (or machine) can manage.
menu
Conventional Control vs. Fuzzy
Downside of Mathematical modeling approach
It may be difficult or impossible to derive a workable mathematical model in the
first place, making both tabular and formula-based methods impractical.

Though an automotive engineer might understand the general relationship


between say, ignition timing, air flow, fuel mix and engine RPM, the exact math
that underlies those interactions may be completely obscure.

Why use Fuzzy Logic?


FL overcomes the disadvantages of both table-based and formula-based
control.

Fuzzy has no unwieldy memory requirements of look-up tables,


and no heavy number-crunching demands of formula-based solutions.

menu
Conventional Control vs. Fuzzy
Why use Fuzzy Logic?

FL can make development and implementation much simpler.

It needs no intricate mathematical models, only a practical understanding of the


overall system behaviour.

FL mechanisms can result to higher accuracy and smoother control as well.

menu
Fuzzy Logic Explained
Fuzzy Set Theory

FL differs from orthodox logic in that it is multivalued.

Fuzzy deals with degrees of truth and degrees of membership.

menu
Fuzzy Logic Explained
Fuzzy Set Theory

Is a man whose height is 5’ 11-1/2” average or tall?

A fuzzy system might say that he is partly medium and partly tall.

Boolean representation Fuzzy representation

http://blog.peltarion.com/2006/10/25/fuzzy-math-part-1-the-theory/

In fuzzy terms, the height of the man would be


classified within a range of [0, 1] as average to a
degree of 0.6, and tall to a degree of 0.4.
menu
Fuzzy Logic Explained
Fuzzy Set Theory

Is a man whose height is 5’ 11-1/2” medium or tall?

A fuzzy system might say that he is partly medium and partly tall.

In other words, FL recognizes not only clear-cut, black-and-white alternatives,


but also the infinite gradations in between.

Fuzzy reasoning eliminates the vagueness by assigning specific numbers to


those gradations. These numeric values are then used to derive exact
solutions to problems.
In fuzzy terms, the height of the man would be
classified within a range of [0, 1] as medium to a
degree of 0.6, and tall to a degree of 0.4.

menu
Excerpts from History
Fuzzy Set Theory

“So far as the laws of mathematics refer to reality, they are not certain. And so
far as they are certain, they do not refer to reality.”
Albert Einstein
Theoretical Physicist and Nobel laureate
“Geometrie und Erfahrung,” Lecture to Prussian Academy, 1921

Most things in nature cannot be characterised with simple or convenient shapes


or distributions.
Membership functions characterize the fuzziness in a fuzzy set – whether the
elements in the set are discrete or continuous – in a graphical form for eventual
use in the mathematical formalisms of fuzzy set theory.
The statement above from Einstein, attests to the fact
that few things in real life are certain or can be
conveniently reduced to the axioms of mathematical
theories and models.
Source: Fuzzy Logic with Engineering Applications by Tim Ross menu
Fuzzy Inference Process

• What are the steps involved in creating a


Fuzzy Control System?

menu
Fuzzy Inference Process

Fuzzy Inference Process

e.g. theta e.g. force

Fuzzification Rule Defuzzification


Evaluation

Fuzzification: Translate input into truth values


Rule Evaluation: Compute output truth values
Defuzzification: Transfer truth values into output

menu
Obstacle Avoidance Problem
Robot Navigation

obstacle
(obsx, obsy)

(x,y)

Can you describe how the robot


should turn based on the position
Obstacle Avoidance & Target Pursuit
and angle of the obstacle?
Demonstration

menu
Another example: Fuzzy Sets for Robot Navigation

Angle and Distance

SMALL
MEDIUM

LARGE

NEAR

FAR

VERY FAR

* Sub ranges for angles & distances overlap


Fuzzy Systems for Obstacle Avoidance
Vision System
Nearest Obstacle (Distance and Angle)
Fuzzy System 3 (Steering)
NEAR FAR VERY FAR
e.g. If the Distance from the Obstacle is NEAR and
SMALL Very Sharp Sharp Turn Med Turn
the Angle from the Obstacle is SMALL
Then turn Very Sharply.
MEDIUM Sharp Turn Med Turn Mild Turn

LARGE Med Turn Mild Turn Zero Turn

Angle

Fuzzy System 4 (Speed Adjustment)


NEAR FAR VERY FAR
e.g. If the Distance from the Obstacle is NEAR and
the Angle from the Obstacle is SMALL
SMALL Very Slow Slow Speed Fast Fast
Then move Very Slowly.
MEDIUM Slow Speed Fast Speed Very Fast

LARGE Fast Speed Very Fast Top Speed

Speed
Fuzzy Control
Different stages of Fuzzy control

1. Fuzzification

Input variables are assigned degrees of membership in various classes

e.g. A temperature input might be graded according to its degree of coldness,


coolness, warmth or heat.

The purpose of fuzzification is to map the inputs from a set of sensors (or
features of those sensors) to values from 0 to 1 using a set of input
membership functions.

We will see a complete


example of the steps
involved later.
menu
Fuzzification
Fuzzification Example

Fuzzy Sets = { Negative, Zero, Positive }

NEGATIVE ZERO POSITIVE


1.0

0.0

-3.0 -2.5 -1.0 -0.5 0.0 0.5 1.0 2.5 3.0

Assuming that we are using trapezoidal membership functions.

Crisp Input: x = 0.25


What is the degree of
membership of x in each of
the Fuzzy Sets?
menu
Sample Calculations
Crisp Input: x  0.25

  xa dx  
Fzero(0.25) FZE (0.25)  max  min 

,1, ,0
 ba dc  

  0.25  (1) 1  0.25  


 max  min  ,1, ,0
  0.25  ( 1) 1  0.25  

 max  min 1.67,1,1 , 0 


1

Fpositive(0.25)   0.25  (0.5) 3  0.25  


FP (0.25)  max  min  ,1, ,0
  0.5  (0.5) 3  0.25  
 max  min  0.75,1,5.5  , 0 
 0.75

  0.25  (3) 0.5  0.25  


Fnegative(0.25) FN (0.25)  max  min 
   
,1,
 
,0
 
 2.5 ( 3) 0.5 ( 0.5)
 max  min  6.5,1, 0.25  , 0 
 0.25
menu
Sample Calculations
Crisp Input: y  0.25
  0.25  (1) 1  (0.25)  
Fzero(-0.25) FZE (0.25)  max  min 
  
,1,

,0
  0.25 ( 1) 1 0.25  

 max  min 1,1,1.67  , 0 


1

  0.25  (3) 3  (0.25)  


Fpositive(-0.25) FP (0.25)  max  min 
 
,1,

,0
  0.5 ( 0.5) 3 2.5  

 max  min  0.25,1, 6.5  , 0 


 0.25

  0.25  (3) 0.5  (0.25)  


FN (0.25)  max  min 
Fnegative(-0.25)   2.5  ( 3)
,1,
0.5  ( 0.5)
,0
 

 max  min  5.5,1, 0.75  , 0 


 0.75

menu
Trapezoidal Membership Functions

LeftTrapezoid

Left_Slope = 0
Right_Slope = 1 / (A - B)
a b
CASE 1: X < a
Membership Value = 1

CASE 2: X >= b
Membership Value = 0

CASE 3: a < x < b


Membership Value = Right_Slope * (X - b)

menu
Trapezoidal Membership Functions

RightTrapezoid

Left_Slope = 1 / (B - A)
Right_Slope = 0 a b
CASE 1: X <= a
Membership Value = 0

CASE 2: X >= b
Membership Value = 1

CASE 3: a < x < b


Membership Value = Left_Slope * (X - a)

menu
Trapezoidal Membership Functions

Regular Trapezoid

Left_Slope = 1 / (B - A)
Right_Slope = 1 / (C - D)
a b c d
CASE 1: X <= a Or X >= d
Membership Value = 0

CASE 2: X >= b And X <= c


Membership Value = 1

CASE 3: X >= a And X <= b


Membership Value = Left_Slope * (X - a)

CASE 4: (X >= c) And (X <= d)


Membership Value = Right_Slope * (X - d)

menu
Fuzzy Control
Different stages of Fuzzy control

2. Rule Evaluation

Inputs are applied to a set of if/then control rules.

e.g. IF temperature is very hot, THEN set fan speed very high.
Fuzzy Control
Different stages of Fuzzy control
Fuzzy rules are always written in the following form:

If (input1 is membership function1) and/or


(input2 is membership function2) and/or ….

Then (output is output membership function).

For example, one could make up a rule that says:

if temperature is high and humidity is high then room is hot.

menu
Fuzzy Control
Different stages of Fuzzy control

2. Rule Evaluation

Inputs are applied to a set of if/then control rules.

The results of various rules are summed together to generate a set of “fuzzy
outputs”.

FAMM
Outputs x
NL=-5 N ZE P
NS=-2.5 NL NS NS W1 W4 W7
N
ZE=0 y
ZE NS ZE PS W2 W5 W8
PS=2.5 P
PS PS PL W3 W6 W9
PL=5.0
Fuzzy Control
Rule Evaluation Example

Assuming that we are using the conjunction operator (AND) in the


antecedents of the rules, we calculate the rule firing strength Wn.

FAMM W1  min  FN (0.25), FN (0.25)  min  0.25, 0.75  0.25

x
W2  min  FN (0.25), FZE (0.25)  min  0.25,1  0.25
N ZE P W3  min  FN (0.25), FP (0.25)  min  0.25, 0.25  0.25
W4  min  FZE (0.25), FN (0.25)  min 1, 0.75  0.75
NL NS NS
N
y
ZE NS ZE PS

W5  min  FZE (0.25), FZE (0.25)   min 1,1  1


P
PS PS PL

W6  min  FZE (0.25), FP (0.25)   min 1, 0.25  0.25


W7  min  FP (0.25), FN (0.25)  min  0.75, 0.75  0.75
W8  min  FP (0.25), FZE (0.25)  min  0.75,1  0.75
W1 W4 W7

W2 W5 W8

W3 W6 W9 W9  min  FP (0.25), FP (0.25)  min  0.75, 0.25  0.25

menu
Does a FAMM need to be a
square?

Is it possible to use more than 2


input parameters for a FAMM?

menu
Fuzzy Control
Different stages of Fuzzy control

3. Defuzzification

Fuzzy outputs are combined into discrete values needed to drive the control
mechanism

(e.g. A cooling fan)

We will see a complete


example of the steps
involved later.
menu
Fuzzy Control
Defuzzification Example

Assuming that we are using the center of mass defuzzification


method.

(W1  NL  W2  NS  W3  PS  W4  NS  W5  ZE  W6  PS  W7  NS  W8  PS  W9  PL)
OUTPUT  9

W
i 1
i


 0.25  (5)  0.25  2.5  0.25  2.5  0.75  2.5  1 0  0.25  2.5  0.75  2.5  0.75  2.5  0.25  5 
 0.25  0.25  0.25  0.75  1  0.25  0.75  0.75  0.25

= -1.25/ 4.5 = -0.278


FAMM
Outputs x
NL=-5 W1 W4 W7 N ZE P
NS=-2.5 NL NS NS
W2 W5 W8 N
ZE=0 y
ZE NS ZE PS
W3 W6 W9
PS=2.5 P
PS PS PL
PL=5.0
menu
Summary of Steps
To compute the output of this FIS given the inputs, one must go through six
steps:

1. determining a set of fuzzy rules


2. fuzzifying the inputs using the input membership functions,
3. combining the fuzzified inputs according to the fuzzy rules to establish
a rule strength,
4. finding the consequence of the rule by combining the rule strength and
the output membership function (if it’s a mamdani FIS),
5. combining the consequences to get an output distribution, and
6. defuzzifying the output distribution (this step applies only if a crisp
output (class) is needed).

menu
EXAMPLE

You might also like