SRS Home | Front Page | Monthly Issue | Index
 Search WWW Search seattlerobotics.org

EXAMPLE ILLUSTRATIONS

To Case 1
To Case 2
To Case 3
To Case 4
To Case 5
The following five cases show what the system computes as error decreases toward zero and then changes to a positive value. Pictures of the input and output membership functions are included. The rate-of-change of the error stays constant throughout the five cases. It is not likely that this would happen in a real system, but for purposes of this illustration, that case has been assumed. The values of error and error-dot indicated from the membership functions are plugged into the rulebase from the "KEY" below and the responses computed for each case. These responses are then mathematically combined to yield a crisp output.

Note that because the "zero" membership function is centered on zero in the output function, its influence in the output computation is only in the denominator. The center of the "zero" doesn't need to be at zero, it just happens to be in this example..

KEY:

(e<0) "negative" error value (er<0) "negative" error-dot value
(e=0) "zero" error value (er=0) "zero" error-dot value
(e>0) "positive" error value (er>0) "positive" error-dot value
EXAMPLE CASE 1 - ERROR= -1.0F

Figure 9 - EXAMPLE CASE 1: (initial conditions)

INPUT DEGREE OF MEMBERSHIP

"error" = -1.0: "negative" = 0.5, "zero" = 0.5, "positive" = 0.0
"error-dot" = +2.5: "negative" = 0.0, "zero" = 0.5, "positive" = 0.5

1. If (e < 0) AND (er < 0) then Cool 0.50 & 0.00 = 0.00
2. If (e = 0) AND (er < 0) then Heat 0.50 & 0.00 = 0.00
3. If (e > 0) AND (er < 0) then Heat 0.00 & 0.00 = 0.00 >>>>
4. If (e < 0) AND (er = 0) then Cool 0.50 & 0.50 = 0.50 >>>>
5. If (e = 0) AND (er = 0) then No_Chng 0.50 & 0.50 = 0.50
6. If (e > 0) AND (er = 0) then Heat 0.00 & 0.50 = 0.00 >>>>
7. If (e < 0) AND (er > 0) then Cool 0.50 & 0.50 = 0.50 >>>>
8. If (e = 0) AND (er > 0) then Cool 0.50 & 0.50 = 0.50
9. If (e > 0) AND (er > 0) then Heat 0.00 & 0.50 = 0.00

"negative" = (R1^2 + R4^2 + R7^2 + R8^2) (Cooling) = (0.00^2 + 0.50^2 + 0.50^2 + 0.50^2)^.5 = 0.866
"zero" = (R5^2)^.5 = (0.50^2)^.5 (No Change) = 0.500
"positive" = (R2^2 + R3^2 + R6^2 + R9^2) (Heating) = (0.00^2 + 0.00^2 + 0.00^2 + 0.00^2)^.5 = 0.000

Figure 10 - Output function

(neg_center * neg_strength + zero_center * zero_strength + pos_center * pos_strength) = OUTPUT
(neg_strength + zero_strength + pos_strength)

(-100 * 0.866 + 0 * 0.500 + 100 * 0.000) = -63.4% (cooling)
(0.866 + 0.500 + 0.000)
EXAMPLE CASE 2 - ERROR = +1.25F

Figure 11 - EXAMPLE CASE 2

INPUT DEGREE OF MEMBERSHIP

"error" = -0.5: "negative" = 0.25, "zero" = 0.75, "positive" = 0.0
"error-dot" = +2.5: "negative" = 0.0, "zero" = 0.50, "positive" = 0.50

1. If (e < 0) AND (er < 0) then Cool 0.25 & 0.0 = 0.00
2. If (e = 0) AND (er < 0) then Heat 0.75 & 0.0 = 0.00
3. If (e > 0) AND (er < 0) then Heat 0.00 & 0.0 = 0.00 >>>>
4. If (e < 0) AND (er = 0) then Cool 0.25 & 0.50 = 0.25 >>>>
5. If (e = 0) AND (er = 0) then No_Chng 0.75 & 0.50 = 0.50
6. If (e > 0) AND (er = 0) then Heat 0.00 & 0.50 = 0.00 >>>>
7. If (e < 0) AND (er > 0) then Cool 0.25 & 0.50 = 0.25 >>>>
8. If (e = 0) AND (er > 0) then Cool 0.75 & 0.50 = 0.50
9. If (e > 0) AND (er > 0) then Heat 0.00 & 0.50 = 0.00

"negative" = (R1^2 + R4^2 + R7^2 + R8^2) (Cooling) = (0.00^2 + 0.25^2 + 0.25^2 + 0.50^2)^.5 = 0.612
"zero" = (R5^2)^.5 = (0.50^2)^.5 (No Change) = 0.50
"positive" = (R2^2 + R3^2 + R6^2 + R9^2) (Heating) = (0.00^2 + 0.00^2 + 0.00^2 + 0.00^2)^.5 = 0.000

Figure 12 - Output function

(neg_center * neg_strength + zero_center * zero_strength + pos_center * pos_strength) = OUTPUT
(neg_strength + zero_strength + pos_strength)

(-100 * 0.612 + 0 * 0.50 + 100 * 0.000) = -55.1% (cooling)
(0.612 + 0.500 + 0.000)
EXAMPLE CASE 3 - ERROR = 0.0F

Figure 13 - EXAMPLE CASE 3

INPUT DEGREE OF MEMBERSHIP

"error" = 0.0: "negative" = 0.0, "zero" = 1.0, "positive" = 0.0
"error-dot" = +2.5: "negative" = 0.0, "zero" = 0.50, "positive" = 0.50

1. If (e < 0) AND (er < 0) then Cool 0.00 & 0.00 = 0.0
2. If (e = 0) AND (er < 0) then Heat 1.00 & 0.00 = 0.0
3. If (e > 0) AND (er < 0) then Heat 0.00 & 0.00 = 0.0
4. If (e < 0) AND (er = 0) then Cool 0.00 & 0.50 = 0.0 >>>>
5. If (e = 0) AND (er = 0) then No_Chng 1.00 & 0.50 = 0.50
6. If (e > 0) AND (er = 0) then Heat 0.00 & 0.50 = 0.0
7. If (e < 0) AND (er > 0) then Cool 0.00 & 0.50 = 0.0 >>>>
8. If (e = 0) AND (er > 0) then Cool 1.00 & 0.50 = 0.50
9. If (e > 0) AND (er > 0) then Heat 0.00 & 0.50 = 0.0

"negative" = (R1^2 + R4^2 + R7^2 + R8^2) (Cooling) = (0.0^2 + 0.0^2 + 0.0^2 + 0.50^2)^.5 = 0.50
"zero" = (R5^2)^.5 = (0.5^2)^.5 (No Change) = 0.5
"positive" = (R2^2 + R3^2 + R6^2 + R9^2) (Heating) = (0.00^2 + 0.00^2 + 0.00^2 + 0.00^2)^.5 = 0.000

Figure 14 - Output function

(neg_center * neg_strength + zero_center * zero_strength + pos_center * pos_strength) = OUTPUT
(neg_strength + zero_strength + pos_strength)

(-100 * 0.50 + 0 * 0.50 + 100 * 0.000) = -50% (cooling)
(0.50 + 0.50 + 0.000)
EXAMPLE CASE 4 - ERROR = +0.5F

Figure 15 - EXAMPLE CASE 4

INPUT DEGREE OF MEMBERSHIP

"error" = +0.50: "negative" = 0.0, "zero" = 0.75, "positive" = 0.25
"error-dot" = +2.5: "negative" = 0.0, "zero" = 0.50, "positive" = 0.50

1. If (e < 0) AND (er < 0) then Cool 0.00 & 0.00 = 0.0
2. If (e = 0) AND (er < 0) then Heat 0.75 & 0.00 = 0.0
3. If (e > 0) AND (er < 0) then Heat 0.25 & 0.00 = 0.0
4. If (e < 0) AND (er = 0) then Cool 0.00 & 0.50 = 0.0 >>>>
5. If (e = 0) AND (er = 0) then No_Chng 0.75 & 0.50 = 0.50 >>>>
6. If (e > 0) AND (er = 0) then Heat 0.25 & 0.50 = 0.25
7. If (e < 0) AND (er > 0) then Cool 0.00 & 0.50 = 0.0 >>>>
8. If (e = 0) AND (er > 0) then Cool 0.75 & 0.50 = 0.50 >>>>
9. If (e > 0) AND (er > 0) then Heat 0.25 & 0.50 = 0.25

"negative" = (R1^2 + R4^2 + R7^2 + R8^2) (Cooling) = (0.0^2 + 0.0^2 + 0.0^2 + 0.50^2)^.5 = 0.50
"zero" = (R5^2)^.5 = (0.5^2)^.5 (No Change) = 0.50
"positive" = (R2^2 + R3^2 + R6^2 + R9^2) (Heating) = (0.00^2 + 0.00^2 + 0.25^2 + 0.50^2)^.5 = 0.354

Figure 16 - Output function

(neg_center * neg_strength + zero_center * zero_strength + pos_center * pos_strength) = OUTPUT
(neg_strength + zero_strength + pos_strength)

(-100 * 0.50 + 0 * 0.5 + 100 * 0.354) = -10.8% (cooling)
(0.50 + 0.50 + 0.354)
EXAMPLE CASE 5 - ERROR = +1.0F

Figure 17 - EXAMPLE CASE 5

INPUT DEGREE OF MEMBERSHIP

"error" = +1.0: "negative" = 0.0, "zero" = 0.5, "positive" = 0.5
"error-dot" = +2.5: "negative" = 0.0, "zero" = 0.5, "positive" = 0.5

1. If (e < 0) AND (er < 0) then Cool 0.00 & 0.00 = 0.0
2. If (e = 0) AND (er < 0) then Heat 0.50 & 0.00 = 0.0
3. If (e > 0) AND (er < 0) then Heat 0.50 & 0.00 = 0.0
4. If (e < 0) AND (er = 0) then Cool 0.00 & 0.50 = 0.0 >>>>
5. If (e = 0) AND (er = 0) then No_Chng 0.50 & 0.50 = 0.5 >>>>
6. If (e > 0) AND (er = 0) then Heat 0.50 & 0.50 = 0.5
7. If (e < 0) AND (er > 0) then Cool 0.00 & 0.50 = 0.0 >>>>
8. If (e = 0) AND (er > 0) then Cool 0.50 & 0.50 = 0.5 >>>>
9. If (e > 0) AND (er > 0) then Heat 0.50 & 0.50 = 0.5

"negative" = (R1^2 + R4^2 + R7^2 + R8^2) (Cooling) = (0.00^2 + 0.00^2 + 0.00^2 + 0.50^2)^.5 = 0.500
"zero" = (R5^2)^.5 = (0.50^2)^.5 (No Change) = 0.500
"positive" = (R2^2 + R3^2 + R6^2 + R9^2) (Heating) = (0.00^2 + 0.00^2 + 0.50^2 + 0.50^2)^.5 = 0.707

Figure 18 - Output function

(neg_center * neg_strength + zero_center * zero_strength + pos_center * pos_strength) = OUTPUT
(neg_strength + zero_strength + pos_strength)

(-100 * 0.500 + 0 * 0.500 + 100 * 0.707) = +12.1% (heating)
(0.500 + 0.500 + 0.707)

File: FL_CASES.HTM by Steven Kaehler 2-13-98