1.36k likes | 1.38k Views
Learn about fuzzy logic, its application in control systems, rules, and fuzzy logic examples. Understand the steps involved in fuzzy logic implementation in systems like automotive controllers and inverted pendulums.
E N D
UNIT III FUZZY LOGIC I Prepared by Mrs.Priyacharles
What is Fuzzy Logic Fuzzy Logic was developed by LotfiZadeh at UC Berkleyin 1960. “Fuzzy logic is derived from fuzzy set theory dealing with reasoning which is approximate rather than precisely deduced from classical predicate logic”
Introduction Steps (Earl Cox based on previous slide): 1. Input – vocabulary, fuzzification (creating fuzzy sets) 2. Fuzzy propositions – IF X is Y THEN Z (or Z is A) … there are four types of propositions 3. Hedges – very, extremely, somewhat, more, less 4. Combination and evaluation – computation of the results given the inputs 5. Action - defuzzification
Fuzzy Logic Example Automotive Speed Controller 3 inputs: speed (5 levels) acceleration (3 levels) distance to destination (3 levels) 1 output: power (fuel flow to engine) Set of rules to determine output based on input values
Fuzzy Logic Example Example Rules IF speed is TOO SLOW and acceleration is DECELERATING, THEN INCREASE POWER GREATLY IF speed is SLOW and acceleration is DECREASING, THEN INCREASE POWER SLIGHTLY IF distance is CLOSE, THEN DECREASE POWER SLIGHTLY . . .
Fuzzy Logic Example Output Determination Degree of membership in an output fuzzy set now represents each fuzzy action. Fuzzy actions are combined to form a system output.
Steps by Step Approach • Step One • Define the control objectives and criteria. • Consider question like • What is trying to be controlled? • What has to be done to control the system? • What kind of response is needed? • What are the possible (probable) system failure modes? • Step Two • Determine input and output relationships • Determine the least number of variables for inputs to the fuzzy logic system
Steps by Step Approach • Step Three • Break down the control problem into a series of IF X AND Y, THEN Z rules based on the fuzzy logic rules. • These IF X AND Y, THEN Z rules should define the desired system output response for the given systems input conditions. • Step Four • Create a fuzzy logic membership function that defines the meaning or values of the input and output terms used in the rules
Steps by Step Approach • Step Five • After the membership functions are created, program everything then into the fuzzy logic system • Step Six • Finally, test the system, evaluate results and make the necessary adjustments until a desired result is obtain
Steps by Step Approach • The above steps are summarized into three main stages • Fuzzification • Membership functions used to graphically describe a situation • Evaluation of Rules • Application of the fuzzy logic rules • Deffuzification • Obtaining the crisp results
Inverted Pendulum • Task: • To balance a pole on a mobile platform that can move in only two directions, either to the left or to the right.
Inverted Pendulum • The input and output relationships of the variables of the fuzzy system are then determined. • Inputs: • Angle between the platform and the pendulum • Angular velocity of this angle. • Outputs: • Speed of platform
Inverted Pendulum • Use membership functions to graphically describe the situation (Fuzzification) • The output which is speed can be high speed, medium speed, low speed, etc. These different levels of output of the platform are defined by specifying the membership functions for the fuzzy-sets
Inverted Pendulum • Define Fuzzy Rules • Examples • If angle is zero and angular velocity is zero, then speed is also zero • If angle is zero and angular velocity is negative low, the speed is negative low • If angle is positive low and angular velocity is zero, then speed is positive low • If angle is positive low and angular velocity is negative low, then speed is zero
Inverted Pendulum • Finally, the Defuzzification stage is implemented. • Two ways of defuzzification is by • Finding the center of Gravity and • Finding the average mean.
INTRODUCTION • What is Fuzzy Logic? • Problem-solving control system methodology • Linguistic or "fuzzy" variables • Example: IF (process is too hot) AND (process is heating rapidly) THEN (cool the process quickly)
INTRODUCTION (Contd.) • Advantages • Mimicks human control logic • Uses imprecise language • Inherently robust • Fails safely • Modified and tweaked easily
INTRODUCTION (Contd.) • Disadvantages • Operator's experience required • System complexity
DEMOS Fuzzy Logic Anti-sway Crane Controller
DEMOS (Contd.) Control of a Flexible Robot
DEMOS (Contd.) Anti-Swing Control of an Overhead Crane
DEMOS (Contd.) Robot Skating
DEMOS (Contd.) • Fuzzy Shower • http://ai.iit.nrc.ca/IR_public/fuzzy/fuzzyShower.html • Fuzzy Controller for an Inverted Pendulum • http://www.aptronix.com/fuzzynet/java/pend/pendjava.htm • Prevention of Load Sway by a Fuzzy Controller • http://people.clarkson.edu/~esazonov/neural_fuzzy/loadsway/LoadSway.htm
What Is Fuzzy Logic? • Theory of fuzzy sets • Membership is a matter of degree. • Fuzzy sets VS classical set theory. • Basic foundations of fuzzy sets • Fuzzy sets (Zadeh, 1965) , Fuzzy Logic (Zadeh, 1973) • Fuzzy • Reflect how people think • Attempts to model our sense of words decision making, and common sense. • Mathematical principles for knowledge representation based on degrees of membership rather than on crisp membership of classical binary logic.
Fuzzy sets • Accept that things can be partly true and partly false to any degree at the same time. • Crisp and fuzzy sets of ‘tall men’
Membership function • Crisp set representation • Characteristic function • Fuzzy set representation • Membership function
Well known Membership Functions Triangular Trapezoidal Gaussian Bell
Fuzzy Vs Probability • Fuzzy ≠ Probability => μA(x) ≠ pA(x) • Both map x to a value in [0,1]. • PA(x) measures our knowledge or ignorance of the truth of the event that x belongs to the set A. • Probability deals with uncertainty and likelihood. • μA(x) measures the degree of belongingness of x to set A and there is no interest regarding the uncertainty behind the outcome of the event x. Event x has occurred and we are interested in only making observations regarding the degree to which x belongs to A. • Fuzzy logic deals with ambiguity and vagueness.
Example • A bottle of water • 50% probability of being poisonous means 50% chance. • 50% water is clean. • 50% water is poisonous. • 50% fuzzy membership of poisonous means that the water has poison. • Water is half poisonous.
In traditional set theory, an element either belongs to a set, or it does not. Membership functions classify elements in the range [0,1], with 0 and 1 being no and full inclusion, the other values being partial membership Fuzzy Set Theory
People generally do not divide things into clean categories, yet still make solid, adaptive decisions Dr.Zadeh felt that having controllers to accept 'noisy' data might make them easier to create, and more effective Where did Fuzzy Logic come from
Controlling a fan: Conventional model – if temperature > X, run fan else, stop fan Fuzzy System - if temperature = hot, run fan at full speed if temperature = warm, run fan at moderate speed if temperature = comfortable, maintain fan speed if temperature = cool, slow fan if temperature = cold, stop fan http://www.duke.edu/vertices/update/win94/fuzlogic.html Simple example of Fuzzy Logic
MASSIVE Created to help create the large-scale battle scenes in the Lord of the Rings films, MASSIVE is program for generating crowd-related visual effects Some Fuzzy Logic applications
Vehicle Control A number of subway systems, particularly in Japan and Europe, are using fuzzy systems to control braking and speed. One example is the Tokyo Monorail Applications of Fuzzy Logic
Appliance control systems Fuzzy logic is starting to be used to help control appliances ranging from rice cookers to small-scale microchips (such as the Freescale 68HC12) Applications of Fuzzy Logic