Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "A great man who created a complete new mathematics with many practical applications."— Presentation transcript:

1

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

3 Practical examples of Linguistic variables

4 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.

5 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 contribute in calculating the resulting output. All in all, fuzzy expert systems require fewer production rules since fuzzy rules embody more information.

6 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.

7 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.

8 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.

9 Fuzzification The function of the fuzzification component is to convert crisp numbers to equivalent fuzzy sets. Please notice that the inputs might require some pre-processing in order to fit the range of the fuzzy system.

10 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.

11 Conventional vs Fuzzy system

12 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].

13 Definitions of Fuzzy Sets in Fuzzy Expert Systems
We can have either continuous or discrete definition of a fuzzy set

14 Example of a Linguistic Variable
…. Terms, Degree of Membership, Membership Function, Base Variable…..

15 Fuzzy Logic Principles and Learning

16 Fuzzy Logic Principles
Fuzzy control produces actions using 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

17 Fuzzy Control

18 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

19 Industrial Application of Fuzzy Logic Control

20 History, State of the Art, and Future Development of fuzzy logic systems

21 Uncertainty

22 Types of Uncertainty and the Modeling of Uncertainty
Stochastic Uncertainty: The Probability of Hitting the Target is 0.8 Three Examples of Lexical Uncertainty:

23 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

24 Methods of inference under uncertainty
The certainty factor indicates the net belief in the conclusion and premises of a rule based 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 certainty is the difference between the two responses.

25 Fuzzy Logic practical easy examples

26 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.

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

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

29 Example 1: Using Fuzzy Logic for a Line Following Robot

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

31 Basic Motions of a Differential Drive robot
Reminder = Braitenberg Vehicles

32 Calculations for input rules

33 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

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

35 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

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

37 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

38 How to apply input rules?

39 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

40 Calculations for output rules

41 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

42 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 output membership functions Level of input membership functions Aggregation of rules Defuzzification speed of the motor Many methods exist

43 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.

44 Example 2: Using Fuzzy Logic for an Obstacle Avoiding Robot

45 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.

46

47 Can walk quickly Needs to walk slower

48 Very Basic Control Theory
@ Your speed towards a goal or away from an object should be proportional to the distance from If you want to get to a goal in an optimal amount of time you want to move However, you need to decelerate as you grow near the target so you can have more is proportional to distance-to-target Read carefully, you will experimentally create similar controllers for any robots Our informal rule Speed is proportional to the distance to target

49 Very Basic Control Theory
Read carefully Very Basic 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 increase your rate of deceleration based on how close you are to a goal or can also integrate over the distance to a goal to create a steady This is the basic idea behind a PID Integral physical derivation of PID can be tricky, we will avoid it for this is a part of an extremely interesting topic! Remember real systems have momentum We are not using PID controller but we want the system to work like with a PID controller

50 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?

51 If near, turn more

52 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

53 If an obstacle is near and center, turn sharp right.
If an obstacle is far and center, turn soft left or right. If an obstacle is near, turn slightly right. Distance Trajectory Turn true This is just one example of what you can create from general rules on earlier pages meters Degrees of angle Degrees of angle

54 Now we modify slightly the rules
different

55 Implication of the rules

56 Defuzzification

57

58 Get closer, turn more Many rules of thumb like this

59 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

60 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.

61 Experimental new rules for turning
Distance Trajectory Turn

62 Experimental new rules for speed
Try other variants

63 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

64 EXAMPLE 3: Fan control

65 Rule Base for Fan Control
Membership functions specified by triangles Only one input, one output controller 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} FAN TEMPERATURE Controller feedback SPEED

66 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

67 Fuzzy Air Conditioner outputs Mapping Inputs to Outputs
This is another useful visualization in two-dimensional space. inputs

68 Mapping Inputs to Outputs

69 EXAMPLE 4: Using Fuzzy Logic for a SWERVING ROBOT
This is a more detailed analysis of a simple version of Example 1 Here we have only one distance sensor

70 Motivating Example: Swerving Robot

71

72

73

74 proximity motion We take into account only PROXIMITY

75

76 18 36 54 72

77

78 0.3

79 0.7 0.3

80 DEFUZZIFICATION has many faces
Blended Centroid Largest Centroid Weighted Means

81 Defuzzification

82 Defuzzification: BLENDED CENTROID
18 36 72 54

83 And will crash on the obstacle

84 Defuzzification: Largest Centroid
Centroid of the largest component 18 36 72 54

85 Defuzzification: Weighted Means
These were just examples of defuzzification More defuzzification methods will be discussed

86 Back to Swerve Now we also take into account where is open (leftside or rightside) for motion open

87 Open can be rightside or leftside

88 Examples for evaluation with PROXIMITY and OPEN

89 evaluation open

90 Variant which uses NOT in a rule

91 Variant which uses hedges in a rule
Hard_Right Very Hard_Right

92 Summary on Fuzzy Controllers for simple robots

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

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

95

96 Advise for your project, 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.

97 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.

98 Sources Priyaranga Koswatta Mundhenk and Itti, 2007


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

Similar presentations


Ads by Google