670 likes | 1.14k Views
Fuzzy Control. Design of Embedded Systems Using 68HC12/11 Microcontrollers Chapter 14 Richard E. Haskell, Prentice Hall, 2000. Fuzzy Control. Fuzzy Sets Design of a Fuzzy Controller Fuzzification of inputs: get_inputs() Fuzzy Inference Processing the Rules: find_rules()
E N D
Fuzzy Control Design of Embedded Systems Using 68HC12/11 Microcontrollers Chapter 14 Richard E. Haskell, Prentice Hall, 2000
Fuzzy Control • Fuzzy Sets • Design of a Fuzzy Controller • Fuzzification of inputs: get_inputs() • Fuzzy Inference • Processing the Rules: find_rules() • Centroid Defuzzification • Output Defuzzification: find_output() • A Fuzzy Control Example -- • Floating Ping-Pong Ball
Fuzzy Sets Is this sentence true or false?
The Barber Paradox Sign on a Barber Shop: “I shave all who do not shave themselves.” Who shaves the barber?
Fuzzy Control • Fuzzy Sets • Design of a Fuzzy Controller • Fuzzification of inputs: get_inputs() • Fuzzy Inference • Processing the Rules: find_rules() • Centroid Defuzzification • Output Defuzzification: find_output() • A Fuzzy Control Example -- • Floating Ping-Pong Ball
Fuzzy Control • Fuzzy Sets • Design of a Fuzzy Controller • Fuzzification of inputs: get_inputs() • Fuzzy Inference • Processing the Rules: find_rules() • Centroid Defuzzification • Output Defuzzification: find_output() • A Fuzzy Control Example -- • Floating Ping-Pong Ball
Fuzzy Control • Fuzzy Sets • Design of a Fuzzy Controller • Fuzzification of inputs: get_inputs() • Fuzzy Inference • Processing the Rules: find_rules() • Centroid Defuzzification • Output Defuzzification: find_output() • A Fuzzy Control Example -- • Floating Ping-Pong Ball
Fuzzy Control • Fuzzy Sets • Design of a Fuzzy Controller • Fuzzification of inputs: get_inputs() • Fuzzy Inference • Processing the Rules: find_rules() • Centroid Defuzzification • Output Defuzzification: find_output() • A Fuzzy Control Example -- • Floating Ping-Pong Ball
* Fire all rules * firerules ( in.out.array rules -- ) FIRERULES LDD 2,X+ D -> rules LDY 2,X+ Y -> in.out.array PSHX TFR D,X X -> rules INX INX X -> Out0 addr PSHY save Y LDY 2,X+ Y -> Out0, X -> 1st rule LDAB 0,Y B = #out.memb.fncs FR0 CLR 1,+Y clear Out array DBNE B, FR0 PULY Y -> in.out.array LDAA #$FF REV rule evaluation PULX RTS Figure 14.19 68HC12 code for WHYP word firerules ( in.out.array rules-- )
Listing 14.2 Fuzzy Control in WHYP -- Making rules \ Fuzzy Logic Control Using WHYP12 File: FUZZY12.WHP \ ********** Defining word for making rules ********** : make.rules ( +++ ) CREATE HERE 0 , \ leave room for #rules 0 , \ leave room for ^Out0 DOES> ( pfa -- ) ; HEX : C: ( pfa ix -- pfa ) C, FE C, ; : C; ( pfa ix -- pfa ) C, FE C, 1 OVER +! ; \ inc #rules : C. ( pfa ix -- pfa ) C, FF C , 1 OVER +! ; \ inc #rules DECIMAL : end.rules ( pfa -- ) DROP ; \ drop addr of #rules
Fuzzy Control • Fuzzy Sets • Design of a Fuzzy Controller • Fuzzification of inputs: get_inputs() • Fuzzy Inference • Processing the Rules: find_rules() • Centroid Defuzzification • Output Defuzzification: find_output() • A Fuzzy Control Example -- • Floating Ping-Pong Ball
Fuzzy Control • Fuzzy Sets • Design of a Fuzzy Controller • Fuzzification of inputs: get_inputs() • Fuzzy Inference • Processing the Rules: find_rules() • Centroid Defuzzification • Output Defuzzification: find_output() • A Fuzzy Control Example -- • Floating Ping-Pong Ball
Fuzzy Control • Fuzzy Sets • Design of a Fuzzy Controller • Fuzzification of inputs: get_inputs() • Fuzzy Inference • Processing the Rules: find_rules() • Centroid Defuzzification • Output Defuzzification: find_output() • A Fuzzy Control Example -- • Floating Ping-Pong Ball