240 likes | 452 Views
Fuzzy Logic. Homework 5. Membership Function. Min. “Temperature is low” AND “Temperature is middle”. Max. “Temperature is low” OR “Temperature is middle”. Homework 5. Fuzzy Logic. Membership Function. Algebraic product. “Temperature is low” AND “Temperature is middle”. Algebraic sum.
E N D
Fuzzy Logic Homework 5 Membership Function Min “Temperature is low” AND “Temperature is middle” Max “Temperature is low” OR “Temperature is middle”
Homework 5 Fuzzy Logic Membership Function Algebraic product “Temperature is low” AND “Temperature is middle” Algebraic sum “Temperature is low” OR “Temperature is middle”
Homework 5 Fuzzy Logic Membership Function Bounded product “Temperature is low” AND “Temperature is middle” Bounded sum “Temperature is low” OR “Temperature is middle”
Linguistic Variables and Term Set Term set : family of membership functions
Fuzzy Control Loop Fuzzy Logic Fuzzy Control
Fuzzy Logic Fuzzy Interference Fuzzy Control • Prior to fuzzy control, the followings must be defined: • Fuzzy membership functions • Fuzzy logical operators • Fuzzy rules • The processing steps in a fuzzy control include: • Fuzzification • Implication • Accumulation • Defuzzification Min-Max, Algebraic, Bounded IF-THEN rules
Fuzzy Logic Fuzzy Rules Fuzzy Control • Example of a fuzzy rule while “Driving a Car”: “IF the distance to the car in front is small, AND the distance is decreasingslowly, THEN deceleratequite big” • The question that arises: Given a certain distance and a certain change of distance, what (crisp) value of acceleration should we select?
Fuzzy Logic Fuzzy Control v. small small perfect big v. big fast very fast v. slow slow moderate distance distance decrease –big zero +small +big –small acceleration Definition of Fuzzy Membership Functions
Fuzzy Logic Fuzzy Control v. small small perfect big v. big fast very fast v. slow slow moderate distance distance decrease –big zero +small +big –small acceleration Fuzzification Observation/ measurement Observation/measurement • Distance between small or perfect • Distance decrease can be moderate or fast • What acceleration should be applied?
Implication of Rules Fuzzy Logic Fuzzy Control v. small small perfect big v. big distance –big zero +small +big –small acceleration Observation/measurement 0.55 Inference core: Clipping approach Clip the fuzzy membership function of “–small” at the height given by the premises (0.55). Later, the clipped area will be considered in the final decision RULE 1:IF distance is small THEN decelerate small
Implication of Rules Fuzzy Logic Fuzzy Control fast very fast v. slow slow moderate distance decrease –big zero +small +big –small acceleration Observation/measurement 0.7 Inference core: Clipping approach Clip the fuzzy membership function of “zero” at the height given by the premises (0.7). Later, the clipped area will be considered in the final decision RULE 2:IF distance decrease is moderateTHEN keep the speed
Fuzzy Logic Fuzzy Control –big zero +small +big –small Rule 1 Rule 2 acceleration Accumulation • From each rule, a clipped area is obtained. But, in the end only one single output is wanted. How do we make a final decision? • In the accumulation (aggregation) step, all clipped areas are merged into one merged area (taking the union). • Rules with high premises will contribute large clipped area to the merged area. These rules will “pull” that merged area towards their own central value.
Fuzzy Logic Defuzzification Fuzzy Control Center of gravity –big zero +small +big –small acceleration crisp value • In this last step, the returned value is the wanted acceleration. • Out of many possible ways, the center of gravity is the commonly used one.
Fuzzy Logic Inference Core Fuzzy Control acceleration acceleration • There are two approach for inference core: 1. Clipping approach: 0.55 Min-Operator Membership function Fuzzification value 2. Scaling approach: 0.55 Algebraic Product
Fuzzy Logic Review on Center of Gravity Fuzzy Control Rectangle Triangle
Fuzzy Logic Review on Center of Gravity Fuzzy Control Isosceles Trapezoid Trapezoid
Fuzzy Logic Fuzzy Control Summary of Fuzzy Control Fuzzify inputs, determine the degree of membership for all terms in the premise. Apply fuzzy operators, if there are multiple terms in the premise (Min-Max, algebraic, bounded). Apply inference core (clipping, scaling, etc.) Accumulate all outputs (union operation i.e. max, sum, etc.) Defuzzify (center of gravity of the merged outputs, max-method, modified center of gravity, height method, etc)
Fuzzy Logic Fuzzy Control Limitations of Fuzzy Control • Definition and fine-tuning of membership functions need experience (covered range, number of MFs, shape). • Defuzzification may produce undesired results (needs redefinition of membership functions).
Fuzzy Logic Fuzzy Control v. small small perfect big v. big growing declining constant 1 0 5 10 15 20 25 –10 –5 0 5 10 speed change [m/s2] distance to next car [m] –big zero +small +big –small 1 –2 –1 0 1 2 acceleration adj. [m/s2] Homework 6 • A fuzzy controller is to be used in driving a car. The membership functions are defined as below.
Fuzzy Logic Fuzzy Control Homework 6 (Cont.) • A fuzzy controller is to be used in driving a car. The membership functions are defined as below. • Rule 1:IF distance is small ANDspeed is declining,THENmaintain acceleration. • Rule 2: IF distance is small ANDspeed is constant,THENacceleration adjustment negative small. • Rule 3: IF distance is perfect ANDspeed is declining, THEN acceleration adjustment positive small. • Rule 4: IF distance is perfect ANDspeed is constant, THEN maintain acceleration.
Fuzzy Logic Fuzzy Control Homework 6 (Cont.) • Using Min-Max as fuzzy operators, clipping as inference core, union operator as accumulator, and center of gravity method as defuzzifier, find the output of the controller if the measurements confirms that distance to next car is 13 m and the speed is increasing by 2.5 m/s2.