980 likes | 998 Views
Learn how linguistic variables are used in expert systems and explore the practical applications and components of fuzzy logic control systems. Discover the principles and implementation of fuzzy logic for handling uncertainty in expert systems.
E N D
A great man who created a completenew mathematics with many practical applications.
Linguistic variables in Expert Systems • Expert Systems are based on hundreds of “If the Else rules that combine inputs , logic and outputs • Similar to binary logic and state machines. • We can create similar Fuzzy Expert Systems • Looking at the production rules of either a expert system or a fuzzy expert system one can not see any differences • except that the fuzzy system is employing linguistic descriptors rather than absolute numerical values. • However, both parts of fuzzy rules have associated `levels of belief' something lacking in traditional production rules.
What is good about fuzzy expert systems • Observe that in traditional production rules even when more than one rule applies only one executes. • With fuzzy rules all applicable rules contributein calculating the resulting output. • All in all, fuzzy expert systems require fewer production rules since fuzzy rules embody more information.
Linguistic variables in Fuzzy Expert Systems • A major reason behind using fuzzy logic is the use of linguistic expressions. • A linguistic variable consists of: • the name of the variable (u), • the term set of the variable (T(u)), • its universe of discourse (U) in which the fuzzy sets are defined, • a syntactic rule for generating the names of values of u, and • a semantic rule for associating with each value its meaning.
More FUZZY LOGIC SYSTEMS APPLICATIONS • 1. Discuss a Fuzzy Logic Control System • 2. Steps in Designing a Fuzzy Logic Control System • 3. Design of a Fuzzy Logic Control System: • Input membership function, • Fuzzy logic rules table, • Output membership function.
Components of Fuzzy system: • The components of a conventional expert system and a fuzzy system are the same. • Fuzzy systems though contain `fuzzifiers’. • Fuzzifiers convert crisp numbers into fuzzy numbers, • Fuzzy systems contain `defuzzifiers', • Defuzzifiers convert fuzzy numbers into crisp numbers.
Fuzzification • The function of the fuzzification component is toconvert crispnumbers to equivalent fuzzy sets. • Please notice that the inputs might require some pre-processing in order tofit the rangeof the fuzzy system.
Defuzzification • The output of the combined operation is defuzzified before being broadcast to the external world. • This implies the conversion of a fuzzy set to a crisp number. • There are several techniques of defuzzification.
For example: • if u is temperature, • then its term set T(temperature) could be: • T(temperature)={cold, cool, warm, hot} over a universe of discourse U=[0,300].
Definitions of Fuzzy Sets in Fuzzy Expert Systems We can have either continuous or discrete definition of a fuzzy set
Example of a Linguistic Variable • …. Terms, Degree of Membership, Membership Function, Base Variable…..
Fuzzy Logic Principles • Fuzzy control produces actionsusing a set of fuzzy rules based on fuzzy logic • Fuzzy controller involves: • fuzzifying: mapping sensor readings into a set of fuzzy inputs • fuzzy rule base: a set of IF-THEN rules • fuzzy inference: maps fuzzy sets onto other fuzzy sets using membership fncts. • defuzzifying: mapping a set of fuzzy outputs onto a set of crisp output commands
Fuzzy Control • Fuzzy logic allows for specifying behaviors as fuzzy rules • Such behaviors can be smoothly blended together (e.g., Flakey robot) • Fuzzy rules can be learned • Any learning method can be used
History, State of the Art, and Future Development of fuzzy logic systems
Types of Uncertainty and the Modeling of Uncertainty • Stochastic Uncertainty: • The Probability of Hitting the Target is 0.8 Three Examples of Lexical Uncertainty:
Methods of inference under uncertainty • inference under uncertainty is very important to consider when using expert systems since sometimes data is uncertain (i.e., ambiguous, incomplete, noisy etc.). • A number of theories have been devised to deal with uncertainty. • These include : • classical probability, • Bayesian probability, • Shannon theory, • Dempster-Shafer theory, • other. • A popular method of dealing with uncertainty uses certainty factors
Methods of inference under uncertainty • The certainty factor indicates the net belief in the conclusion and premises of a rulebased on some evidence. • Certainty factors are hand-crafted by asking potential users questions such as `How much do you believe that opening valve x will start a flooding' and `How much do you disbelieve that opening valve x will start a flooding'. • The degree of certaintyis the difference between the two responses.
Controller Structure • Fuzzification • 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.
How to combine various, even conflicting pieces of advise? Linguistic
Examples of Operations on the same variable A B A B A B A
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
Structure of this type of the system: Two Levels, various membership functions in each, shared MIN MIN Defuzzifier of the “sum” MIN Fuzzified inputs MIN MIN Fuzzy values of combined first level groups One input Defuzzifier MAX MIN 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 calculate output? • Here are some examples of rule calculations This calculated 0.7 for SL This calculated 0.2 for F Similarly we calculate 0.3 for SR Right sensor Left sensor
How to calculate Output Membership Function Calculated in previous slide 0.7 for SL Calculated similarly for SR 0.2 calculated for F Note: this is some kind of weighted sum, easy to calculate for symmetric triangles, just example 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 SL 0.8 F -20 black MIN F other white 0 HL MIN ……. gray Fuzzy values of combined first level groups black Level of output membership functions Sensor R Level of input membership functions • Aggregation of rules • Defuzzification speed of the motor Many methods exist
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.
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.
Can walk quickly Needs to walk slower
Very Basic Control Theory Read carefully, you will experimentally create similar controllers for any robots @ 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 Our informal rule Speed is proportional to the distance to target
Read carefully Very Basic Control Theory Remember real systems have momentum @ 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! We are not using PID controller but we want the system to work like with a PID controller
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?