240 likes | 260 Views
This homework explores membership functions and fuzzy control with operators like min, max, algebraic product, and bounded sum.
E N D
Fuzzy Logic Homework 8 Membership Function Min “Temperature is low” AND “Temperature is middle” Max “Temperature is low” OR “Temperature is middle”
Homework 8 Fuzzy Logic Membership Function Algebraic product “Temperature is low” AND “Temperature is middle” Algebraic sum “Temperature is low” OR “Temperature is middle”
Homework 8 Fuzzy Logic Membership Function Bounded product “Temperature is low” AND “Temperature is middle” Bounded sum “Temperature is low” OR “Temperature is middle”
Fuzzy Logic Fuzzy Control Further Fuzzy Set Operations Dilation Concentration
Fuzzy Control Loop Fuzzy Logic Fuzzy Control
Fuzzy Logic Fuzzy Inference Fuzzy Control • Prior to fuzzy control, the followings must be defined: • Fuzzy membership functions • Fuzzy logic operators • Fuzzy rules, including fuzzy linguistic value and linguistic variable • The processing steps in a fuzzy control include: • Fuzzification • Implication / Inference Core • Accumulation • Defuzzification
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 and 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 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 v. slow slow moderate fast very fast Distance decrease –big zero +small +big –small Acceleration Observation/measurement 0.7 Inference core: Clipping 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 moderate THEN 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 method in defuzzification.
Fuzzy Logic Inference Core Fuzzy Control acceleration acceleration • There are two approaches that can be used 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 logic 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 declining constant v. small small perfect big v. big growing 1 1 0 5 10 15 20 25 –10 –5 0 5 10 Speed change [m/s2] Distanceto next car [m] –big zero +small +big –small 1 –2 –1 0 1 2 Acceleration adj.[m/s2] Homework 9 • A fuzzy controller is to be used in driving a car. The fuzzymembership functions for the two inputs and one output are defined as below.
Fuzzy Logic Fuzzy Control Homework 9 (Cont.) • A fuzzy controller is to be used in driving a car. The fuzzy rules are given as follows. • Rule 1:IF distance is small ANDspeed is declining,THENmaintain acceleration. • Rule 2: IFdistance 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 9 (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.
Fuzzy Logic Fuzzy Control Homework 9A • A driver of an open-air car determine how fast he drives based on the air temperature and the sky conditions. The corresponding fuzzy membership functions can be seen here.
Fuzzy Logic Fuzzy Control Homework 9A (Cont.) • After years of experience, he summarizes his personal driving rules as follows: • Rule 1:IF it is sunny AND warm, THEN drive fast. • Rule 2: IF it is partly cloudy AND hot, THEN drive slow. • Rule 3: IF it is partly cloudy, THEN drive fast. • You are now assigned to design a fuzzy control with the following requirements: • Fuzzy logic operators: algebraic sum / product • Inference core: scaling • Accumulator: union operator • Defuzzification: center of gravity method • The speed limit is 120 km/h. How fast will the driver go if in one day the temperature is 65 °F and the cloud cover is 25 %?