80 likes | 165 Views
Fuzzy logic. Henry Hexmoor Southern Illinois University Faner Hall, Room 2130 Carbondale, IL 62901. Fuzzy Logic. The value of a proposition “John has a fever” takes truth value in the interval [0-1]. 1.0. 0.0. 95 96 97 98 99 100 101 102 103 014 105 106 107. Temperatures. Fuzzy Logic.
E N D
Fuzzy logic Henry Hexmoor Southern Illinois University Faner Hall, Room 2130 Carbondale, IL 62901
Fuzzy Logic The value of a proposition “John has a fever” takes truth value in the interval [0-1]. 1.0 0.0 95 96 97 98 99 100 101 102 103 014 105 106 107 Temperatures
Fuzzy Logic T(p and q) = min (T(p), T(q)) T(p or q) = max (T(p), T(q)) T(not p) = 1 – T(p) T(p q) = min (1, 1 - T(p) + T(q))
Fuzzy Logic Let's consider the following rules: 1. obstacle very-close and left-side clear and right-side clear -> move left 2. obstacle very-close and left-side tight and right-side tight -> move tight-left 3. obstacle very-close and left-side tight and right-side clear -> move right 4. obstacle very-close and left-side clear and right-side tight -> move left 5. obstacle very-close and left-side closed and right-side tight -> move tight-right 6. obstacle very-close and left-side tight and right-side closed -> move tight-left
Fuzzy Logic Very Close Closed Tight Left Let's have the following functions: 1.0 1.0 1.0 0.0 0.0 0.0 -90 0 +90 1’ 10’ 1’ 10’ Dist to obstacle Side Clearance Direction change Clear Move Left Tight Right 1.0 1.0 1.0 0.0 0.0 0.0 -90 0 +90 -90 0 +90 1’ 10’ Side Clearance Direction change Direction change Tight Move Right 1.0 1.0 0.0 0.0 -90 0 +90 1’ 10’ Side Clearance Direction change
Fuzzy Logic To apply the rules, we follow these steps: 1. Get input. Suppose we get input of obstacle being 3 feet in front left side has a 1 foot clearance and right side has a 5 foot clearance. 2. Let's examine the applicability of left hand sides of the rules. AND in the left hand side means minimum. The resulting numbers are MODULATED values. I.e., the degree to which the rules will be activated. .8, .0, 1. ==> 0. .8, .8, .5 ==> .5 .8, .8, .2 ==> .2 .8, .2, .8 ==> .2 .8, .8, .5 ==> .5 .8, .8. .8 ==> .8 3. Scale down curves on the right hand side by the modulation factors. 4. Overlap and sum the scaled down function on the right hand side. Scale the summed curve to fit the range 0-1. 5. Find the place on the horizontal axis of output furntions that divides the space under the functions into two equal areas to the left and right. This is called finding the center of gravity for the output function. The value on the horizontal axis found is the ARBITRATED value sent to the actuators. In this case this will be amount of steering.
Fuzzy Logic 3. Scale down curves on the right hand side by the modulation factors. 4. Overlap and sum the scaled down function on the right hand side. Scale the summed curve to fit the range [0.0-1.0]. 5. Find the place on the horizontal axis of output functions that divides the space under the functions into two equal areas to the left and right. This is called finding the center of gravity for the output function. The value on the horizontal axis found is the ARBITRATED value sent to the actuators. In this case this will be amount of steering.