A great man who created a complete new mathematics with many practical applications.

Slides:



Advertisements
Similar presentations
Fuzzy Logic 11/6/2001. Agenda General Definition Applications Formal Definitions Operations Rules Fuzzy Air Conditioner Controller Structure.
Advertisements

Fuzzy Logic and Robot Control Mundhenk and Itti, 2007.
Fuzzy Inference Systems
Fuzzy Logic and its Application to Web Caching
CS 561, Sessions This time: Fuzzy Logic and Fuzzy Inference Why use fuzzy logic? Tipping example Fuzzy set theory Fuzzy inference.
CS 561, Sessions This time: Fuzzy Logic and Fuzzy Inference Why use fuzzy logic? Tipping example Fuzzy set theory Fuzzy inference.
Fuzzy logic Fuzzy Expert Systems Yeni Herdiyeni Departemen Ilmu Komputer.
Fuzzy Expert System. Basic Notions 1.Fuzzy Sets 2.Fuzzy representation in computer 3.Linguistic variables and hedges 4.Operations of fuzzy sets 5.Fuzzy.
Fuzzy Expert Systems. Lecture Outline What is fuzzy thinking? What is fuzzy thinking? Fuzzy sets Fuzzy sets Linguistic variables and hedges Linguistic.
GATE Reactive Behavior Modeling Fuzzy Logic (GATE-561) Dr.Çağatay ÜNDEĞER Instructor Middle East Technical University, GameTechnologies Bilkent University,
Fuzzy Logic Based on a system of non-digital (continuous & fuzzy without crisp boundaries) set theory and rules. Developed by Lotfi Zadeh in 1965 Its advantage.
Fuzzy Expert System.
Chapter 18 Fuzzy Reasoning.
1 Chapter 18 Fuzzy Reasoning. 2 Chapter 18 Contents (1) l Bivalent and Multivalent Logics l Linguistic Variables l Fuzzy Sets l Membership Functions l.
Fuzzy Logic Dave Saad CS498. Origin Proposed as a mathematical model similar to traditional set theory but with the possibility of partial set membership.
Introduction to Fuzzy Logic Control
Fuzzy Logic. Priyaranga Koswatta Mundhenk and Itti, 2007.
FUZZY LOGIC Babu Appat. OVERVIEW What is Fuzzy Logic? Where did it begin? Fuzzy Logic vs. Neural Networks Fuzzy Logic in Control Systems Fuzzy Logic in.
CPSC 386 Artificial Intelligence Ellen Walker Hiram College
Fuzzy Logic Conception Introduced by Lotfi Zadeh in 1960s at Berkley Wanted to expand crisp logic.
Artificial Intelligence in Game Design Lecture 6: Fuzzy Logic and Fuzzy State Machines.
 Definition Definition  Bit of History Bit of History  Why Fuzzy Logic? Why Fuzzy Logic?  Applications Applications  Fuzzy Logic Operators Fuzzy.
Fuzzy Inference (Expert) System
Mobile Robot Navigation Using Fuzzy logic Controller
Logical Systems and Knowledge Representation Fuzzy Logical Systems 1.
Fuzzy Systems Michael J. Watts
Lec 34 Fuzzy Logic Control (II)
Fuzzy Sets and Control. Fuzzy Logic The definition of Fuzzy logic is a form of multi-valued logic derived frommulti-valued logic fuzzy setfuzzy set theory.
“Principles of Soft Computing, 2 nd Edition” by S.N. Sivanandam & SN Deepa Copyright  2011 Wiley India Pvt. Ltd. All rights reserved. CHAPTER 12 FUZZY.
CSCI1600: Embedded and Real Time Software Lecture 12: Modeling V: Control Systems and Feedback Steven Reiss, Fall 2015.
Homework 5 Min Max “Temperature is low” AND “Temperature is middle”
NEURO-FUZZY LOGIC 1 X 0 A age Crisp version for young age.
Fuzzy Expert System n Introduction n Fuzzy sets n Linguistic variables and hedges n Operations of fuzzy sets n Fuzzy rules n Summary.
Could Be Significant.
Aisha Iqbal (CT-084) Kanwal Hakeem (CT-098) Tehreem Mushtaq (CT-078) Talha Syed (CT-111)
S PEED CONTROL OF DC MOTOR BY FUZZY CONTROLLER MD MUSTAFA KAMAL ROLL NO M E (CONTROL AND INSTRUMENTATION)
This time: Fuzzy Logic and Fuzzy Inference
Robotics Training For The Riverside Robotics Society
A great man who created a complete new mathematics with many practical applications.
Introduction to Fuzzy Logic and Fuzzy Systems
Fuzzy Logic Control What is Fuzzy Logic ? Logic and Fuzzy Logic
PID Control Systems (Proportional, Integral, Derivative)
Artificial Intelligence CIS 342
Fuzzy Systems Michael J. Watts
FUZZY NEURAL NETWORKS TECHNIQUES AND THEIR APPLICATIONS
Fuzzy expert systems Fuzzy inference Mamdani fuzzy inference
Fuzzy Logic 11/6/2001.
Artificial Intelligence
Stanisław H. Żak School of Electrical and Computer Engineering
Fuzzy Logic and Fuzzy Sets
Homework 8 Min Max “Temperature is low” AND “Temperature is middle”
CSCI1600: Embedded and Real Time Software
Introduction to Fuzzy Logic
Fuzzy logic Introduction 3 Fuzzy Inference Aleksandar Rakić
Dr. Unnikrishnan P.C. Professor, EEE
Fuzzy System Structure
Dr. Unnikrishnan P.C. Professor, EEE
FUZZIFICATION AND DEFUZZIFICATION
Homework 9 Min Max “Temperature is low” AND “Temperature is middle”
This time: Fuzzy Logic and Fuzzy Inference
Better Line Following with PID
Dr. Unnikrishnan P.C. Professor, EEE
ECE 352 Digital System Fundamentals
This time: Fuzzy Logic and Fuzzy Inference
Motion: Speed & Acceleration
Fuzzy Logic Bai Xiao.
Fuzzy Inference Systems
Fuzzy Logic Based on a system of non-digital (continuous & fuzzy without crisp boundaries) set theory and rules. Developed by Lotfi Zadeh in 1965 Its advantage.
Fuzzy Logic KH Wong Fuzzy Logic v.9a.
Presentation transcript:

A great man who created a complete new mathematics with many practical applications.

Fuzzy Logic practical easy examples

How to combine various, even conflicting pieces of advise? Linguistic How to combine various, even conflicting pieces of advise?

Examples of Operations on the same variable A  B A  B A

Example 1: Using Fuzzy Logic for a Line Following Robot

Mechanical Design of a very inexpensive Line-Following Robot In our example below: Line white, background black

Basic Motions of a Differential Drive robot Reminder = Braitenberg Vehicles

Calculations for input rules

Defuzzifier of the “sum” Structure of this type of the system: Two Levels, various membership functions in each, shared MIN MIN Defuzzifier of the “sum” Fuzzified inputs MIN MIN MIN Fuzzy values of combined first level groups One input Defuzzifier MIN MAX MIN Level of input membership functions Level of output membership functions Reminder = general simple scheme for Fuzzy Logic

Input Membership Functions Characteristics of two identical sensors We have three membership functions: Black, Gray and White

Sample Fuzzy Rule Base – for input rules Here is an example how you can create your own rules for a robot of your choice. This table decides what to do for every combination of data from both input sensors SR X = don’t know = undetermined The system will “learn” values for these don’knows. Descriptions such as this table: Generalize Truth Table Generalize Karnaugh Map

Output Membership Function Output of the controller can be negative or positive

This slide explains how to apply rules for left sensor We calculate for given measurement for the left sensor For black membership function white black gray For white membership function black Reading the data from left sensor

How to apply input rules?

How to calculate output? Here are some examples of rule calculations This calculated 0.7 for SL This calculated 0.2 for F Right sensor Left sensor

Calculations for output rules

How to calculate Output Membership Function Calculated in previous slide 0.7 for SL Calculated similarly for SR 0.2 for F Note: this is some kind of weighted sum This is one example of defuzzification that calculates the speed of the motor

Structure of this type of the system: Two Levels, various membership functions in each, shared Sensor L This is fuzzy “strength” of the fuzzy output value SL white SL 0.7 Defuzzifier 0.7 MIN Note: this is some kind of weighted sum gray This is fuzzy “strength” of the fuzzy output value F 0.8 SL F black -20 MIN F white other MIN HL ……. gray Fuzzy values of combined first level groups black Sensor R Level of input membership functions Level of output membership functions speed of the motor

To remember The previous slide was only a special case of defuzzification in a sum gate Many other methods and shapes are possible. Remember the general structure of the circuit. There are many variants of this circuit. With many defuzzification methods.

Example 2: Using Fuzzy Logic for an Obstacle Avoiding Robot

In this example the principles are the same as before, but the way of calculating is somewhat different. We have no table, just we directly write rules. This is just for didactic reasons.

Very Basic Control Theory Read carefully @ 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 control. @Speed is proportional to distance-to-target Speed is proportional to the distance to target

Very Basic Control Theory @ In systems with momentum (i.e. the real world) we have to worry about more complex acceleration and deceleration. @ 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 is a part of an extremely interesting topic! Read carefully

IDEA! Heuristic experimental rules Lets just hack a fuzzy controller together and avoid some math. The formal mathematicians will hate us, but if it works, that may be all that matters! Derive rule of thumb ideas for speed and direction If I am 6 meters from the obstacle, am I far from it?

If near, turn more

Experimental heuristics in robot design Try some fuzzy rules… Let us 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… You have to experiment with these rules

Degrees of angle Degrees of angle meters

Implication of the rules

Defuzzification

Get closer, turn more Many rules of thumb like this

Advise on creating rules The robot works in continuous time 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 observations. These are just examples. You decide for your robot and your sensors

Advise on creating rules Our robot has momentum 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.

Remember the general structure MIN MIN Defuzzifier of the “sum” Fuzzified inputs MIN MIN MIN Fuzzy values of combined first level groups One input Defuzzifier MIN MAX MIN Level of input membership functions Level of output membership functions Reminder = general simple scheme for Fuzzy Logic

EXAMPLE 3: Fan control

Controller Structure Fuzzification Inference Mechanism Defuzzification Scales and maps input variables to fuzzy sets Linear or not Single input single output Inference Mechanism Approximate reasoning Deduces the control action Various shapes of membership functions Various operators, not only MIN, MAX and NOT. Defuzzification Convert fuzzy output values to control signals Defuzzification can be a single output linear or nonlinear function with fuzzy input and crisp output Defuzzification can be built-into the “output sum” which can be other function than MAX or SUM or TRUNCATED SUM.

Rule Base for Fan Control 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} 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}

Defuzzifier of the “sum” Structure of this type of the system: Two Levels, various membership functions in each, shared MIN MIN Defuzzifier of the “sum” Fuzzified inputs MIN MIN MIN Fuzzy values of combined first level groups One input Defuzzifier MIN MAX MIN Level of input membership functions Level of output membership functions

Rules Air Conditioning Controller Example: IF Cold then Stop default: The truth of any statement is a matter of degree Membership function is a curve of the degree of truth of a given input value Rules 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 outputs This is another useful visualization in two-dimensional space. inputs

Mapping Inputs to Outputs

EXAMPLE 4: Using Fuzzy Logic for a SWERVING ROBOT This is a more detailed analysis of a simple version of Example 1

Motivating Example: Swerving Robot

proximity motion We take into account only PROXIMITY

DEFUZZIFICATION has many faces Blended Centroid Largest Centroid Weighted Means

Defuzzification

Defuzzification: BLENDED CENTROID

Defuzzification: Largest Centroid

Defuzzification: Weighted Means

Back to Swerve Now we also take into account where is open for motion

Open can be rightside or leftside

Examples for evaluation with PROXIMITY and OPEN

evaluation open

Variant which uses NOT in a rule

Variant which uses hedges in a rule Hard_Right Very Hard_Right

Summary on Fuzzy Controllers for simple robots

Advantages of Fuzzy Controllers Minimal mathematical formulation Can easily design with human intuition Smoother controlling Faster response

Few More real-life Applications ABS Brakes Expert Systems Control Units Bullet train between Tokyo and Osaka Video Cameras Automatic Transmissions

http://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.html http://www.cs.cmu.edu/Groups/AI/html/faqs/ai/fuzzy/part1/faq.html http://plato.stanford.edu/entries/logic-fuzzy/

Advise based on our previous projects Fuzzy logic is easy to program Fuzzy logic can be easily combined with any other method from this and next class In particular , there is a very good match to evolutionary ideas. Much software exist, you do not have to write from scratch. You should concentrate on combining ideas and analyzing results. I am not happy if you only give code but do not discuss, analyze and illustrate how it actually works on a robot, its part or your simulated model. With more time, it is good to modify the model step by step based on more experiments on a real robot Look to many examples from my 478, 479, and 510 AER webpages There are also many free books and reports on Internet. All this can be completely formalized, new math created and you can write a MS or PHD on these topics. Every branch of mathematics or calculus can be rewritten This happens always when we deal with something as fundamental as sets and probabilities. The same is in quantum. Quantum Fuzzy logic has been also created.

Defuzzifier of the “sum” Structure of this type of the system: Two Levels, various membership functions in each, shared MIN MIN Defuzzifier of the “sum” Fuzzified inputs MIN MIN MIN Fuzzy values of combined first level groups One input Defuzzifier MIN MAX MIN Level of input membership functions Level of output membership functions

Questions and Problems Draw the complete logic diagram for Example 1. Write software for Example 1. Draw the complete logic diagram for Example 2. Write software for Example 2. Draw the complete logic diagram for Example 3. Write software for Example 3. Draw the complete logic diagram for Example 4.

Priyaranga Koswatta Mundhenk and Itti, 2007