80 likes | 285 Views
Fuzzy Logic. Fuzzy Control. Solution: Homework 6. v. small. small. perfect. big. v. big. growing. declining. constant. 1. 1. 0. 75. 0.6. 0.4. 0.25. 0 5 10 15 20 25. – 10 – 5 0 5 10. speed change [m/s 2 ]. distance to next car [m].
E N D
Fuzzy Logic Fuzzy Control Solution: Homework 6 v. small small perfect big v. big growing declining constant 1 1 0.75 0.6 0.4 0.25 0 5 10 15 20 25 –10 –5 0 5 10 speed change [m/s2] distance to next car [m] 2.5 m/s2 13 m –big zero +small +big –small 1 –2 –1 0 1 2 acceleration adj. [m/s2]
Fuzzy Logic Fuzzy Control 0 0.4 0 0.6 Solution: Homework 6 (Cont.) 0 0.4 • 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. 0.75 0.4 0 0.6 0.75 0.6 FL-Operators: AND Min OR Max
Fuzzy Logic Fuzzy Control 0.4 0.6 1 –2 –1 0 1 2 acceleration change [m/s2] Solution: Homework 6 (Cont.) –big zero +small +big A2 –small 1 A1 –2 –1 0 1 2 acceleration adj. [m/s2]
Fuzzy Logic Fuzzy Control Solution: Homework 6 (Cont.) Implementation in Matlab Input 1 MFs Input 2 MFs Output MFs Rule Viewer
Fuzzy Logic Fuzzy Control Fuzzy Logic Toolbox in Matlab • The toolbox can be opened by typing “fuzzy” in Matlab Workspace • Some variables must be defined: • Number of inputs and outputs • Membership functions of each input and output • Fuzzy rules that will connect the membership functions • Fuzzy set operators, inference core, accumulation, and defuzzification
Fuzzy Logic Fuzzy Control Fuzzy Logic Toolbox in Matlab • Now, we utilize the fuzzy toolbox to analyze the input-output behavior of the fuzzy control. • Later, the resulting fuzzy control can be applied to control dynamic systems in Simulink environment. • In each session, remember to save the controller that has been designed: • Save files using Files >> Export >> To Disk • Open files using Files >> Import >> From Disk
Fuzzy Logic Fuzzy Control Homework 7 • Read the manual of Fuzzy Logic Toolbox carefully. • Learn how to use the toolbox and get familiar with it. • Redo the quiz problem in Matlab. Submit the *.fis file of the fuzzy control along with necessary supporting documents. • Submission must be in hardcopy and softcopy. • Incomplete submission will not be graded.