Fuzzy logic
1 / 71

Fuzzy Logic - PowerPoint PPT Presentation

  • Uploaded on

Fuzzy Logic. Priyaranga Koswatta. Mundhenk and Itti, 2007. Advantages of Fuzzy Controllers Minimal mathematical formulation Can easily design with human intuition Smoother controlling Faster response. Agenda. General Definition Applications Formal Definitions Operations Rules

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about ' Fuzzy Logic' - austin-chaney

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Priyaranga koswatta
Priyaranga Koswatta

  • Mundhenk and Itti, 2007


  • General Definition

  • Applications

  • Formal Definitions

  • Operations

  • Rules

  • Fuzzy Air Conditioner

  • Controller Structure

General definition
General Definition

Fuzzy Logic - 1965 Lotfi Zadeh, U.C. Berkeley

  • superset of conventional (Boolean) logic that has been extended to handle the concept of partial truth

  • central notion of fuzzy systems is that truth values (in fuzzy logic) or membership values (in fuzzy sets) are indicated by a value on the range [0.0, 1.0], with 0.0 representing absolute Falseness and 1.0 representing absolute Truth.

  • deals with real world vagueness


  • ABS Brakes

  • Expert Systems

  • Control Units

  • Bullet train between Tokyo and Osaka

  • Video Cameras

  • Automatic Transmissions

Formal definitions
Formal Definitions

  • Definition 1: Let X be some set of objects, with elements noted as x.

  • X = {x}.

  • Definition 2: A fuzzy set A in X is characterized by a membership function mA(x) which maps each point in X onto the real interval [0.0, 1.0]. As mA(x) approaches 1.0, the "grade of membership" of x in A increases.

  • Definition 3: A is EMPTY iff for all x, mA(x) = 0.0.

  • Definition 4: A = B iff for all x: mA(x) = mB(x) [or, mA = mB].

  • Definition 5: mA' = 1 - mA.

  • Definition 6: A is CONTAINED in B iff mA  mB.

  • Definition 7: C = A UNION B, where: mC(x) = MAX(mA(x), mB(x)).

  • Definition 8: C = A INTERSECTION B where: mC(x) = MIN(mA(x), mB(x)).



A  B A  B A

Example using fuzzy logic for a line following robot

Example:http://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.htmlUsing Fuzzy Logic for a Line Following Robot

Mechanical design of a very inexpensive line following robot
Mechanical Design of a very inexpensive Line-Following Robothttp://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.html

Basic motions of a differential drive robot
Basic Motions of a Differential Drive robothttp://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.html

Input membership functions
Input Membership Functionshttp://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.html

Sample fuzzy rule base
Sample Fuzzy Rule Basehttp://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.html

Output membership function
Output Membership Functionhttp://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.html

Example using fuzzy logic for an obstacle avoiding robot

Example:http://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.htmlUsing Fuzzy Logic for an Obstacle Avoiding Robot

Very basic control theory
Very http://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.htmlBasic Control Theory

􀂀 Your speed towards a goal or away from

an object should be proportional to the

distance from it.

􀁹 If you want to get to a goal in an optimal

amount of time you want to move quickly.

􀁹 However, you need to decelerate as you

grow near the target so you can have more


􀂀 Speed ∝ distance-to-target

Very basic control theory1
Very http://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.htmlBasic Control Theory

􀂀 In systems with momentum (i.e. the real world) we

have to worry about more complex acceleration and


􀁹 We can overshoot our target or stop short!

􀂀 You increase your rate of deceleration based on how

close you are to a goal or obstacle.

􀂀 You can also integrate over the distance to a goal to

create a steady state.

􀂀 This is the basic idea behind a PID controller.

􀁹 Proportional Integral Derivative

􀂀 The physical derivation of PID can be tricky, we will

avoid it for now.

􀁹 However this part of an extremely interesting topic!


􀂀 Lets just hack a fuzzy controller together

and avoid some math.

􀁹 The gods will curse us….

􀁹 But if it works, that may be all that matters!

􀂀 Derive rule of thumb ideas for speed

and direction

􀁹 If I’m 6 meters from the obstacle, am I far from it?

Try some fuzzy rules…http://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.html

􀂀 Lets look at adjusting trajectory first then

we will look at speed…

􀁹 If an obstacle is near and center, turn sharp

right or left.

􀁹 If an obstacle is far and center, turn soft left

or right.

􀁹 If an obstacle is near, turn slightly right or

left, just in case.

􀁹 Etc…

The robot works in continuoushttp://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.html


􀂀 The fuzzy rules should change slightly at

each time step.

􀁹 We don’t want the robot to jerk to a new

trajectory too quickly. Smooth movements tend

to be better.

􀁹 How often we need to update the controller is

dependant on how fast we are moving.

􀁹 For instance: If we update the controller 30

times a second and we are moving < 1 kph then

movement will be smooth.

􀁹 Ideally, the commands issued from the fuzzy

controller should create an equilibrium with the


Our robot has momentumhttp://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.html

􀂀 We have somewhat implicitly integrated

the notion of momentum.

􀁹 This is why we would slow down as we get

closer to an obstacle

􀂀 What about more refined control of

speed and direction?

􀁹 Use the derivative of speed and trajectory to

increase or decrease the rate of change.

􀁹 Thus, if it seems like we are not turning fast

enough, then turn faster and visa versa.

Controller structure
Controller Structurehttp://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.html

  • Fuzzification

    • Scales and maps input variables to fuzzy sets

  • Inference Mechanism

    • Approximate reasoning

    • Deduces the control action

  • Defuzzification

    • Convert fuzzy output values to control signals

Rule base
Rule Basehttp://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.html

  • Fan Speed

  • Set stop {0, 0, 0}

  • Set slow {50, 30, 10}

  • Set medium {60, 50, 40}

  • Set fast {90, 70, 50}

  • Set blast {, 100, 80}

Air Temperature

  • Set cold {50, 0, 0}

  • Set cool {65, 55, 45}

  • Set just right {70, 65, 60}

  • Set warm {85, 75, 65}

  • Set hot {, 90, 80}


Membership function is a curve of the degree of truth of a given input value


The truth of any statement is a matter of degree


Air Conditioning Controller Example:

  • IF Cold then Stop

  • If Cool then Slow

  • If OK then Medium

  • If Warm then Fast

  • IF Hot then Blast

Fuzzy air conditioner
Fuzzy Air Conditioner given input value

Mapping inputs to outputs
Mapping Inputs to Outputs given input value

Example using fuzzy logic for a swerving robot
EXAMPLE: given input valueUsing Fuzzy Logic for a SWERVING ROBOT