Introduction to Neural Networks and Fuzzy Logic Lecture

  • Slides: 16
Download presentation
Introduction to Neural Networks and Fuzzy Logic Lecture 10 Dr. -Ing. Erwin Sitompul President

Introduction to Neural Networks and Fuzzy Logic Lecture 10 Dr. -Ing. Erwin Sitompul President University http: //zitompul. wordpress. com President University Erwin Sitompul NNFL 10/1

Fuzzy Logic Fuzzy Control Solution: Homework 7 President University Erwin Sitompul NNFL 10/2

Fuzzy Logic Fuzzy Control Solution: Homework 7 President University Erwin Sitompul NNFL 10/2

Fuzzy Logic Fuzzy Control Solution: Homework 7 (Cont. ) President University Erwin Sitompul NNFL

Fuzzy Logic Fuzzy Control Solution: Homework 7 (Cont. ) President University Erwin Sitompul NNFL 10/3

Fuzzy Logic Fuzzy Control Single Tank System FV Desired liquid level: 5 cm (0.

Fuzzy Logic Fuzzy Control Single Tank System FV Desired liquid level: 5 cm (0. 05 m) Required inflow rate: ? 0. 0119 m 3/s (11. 9 l/s) LI A : cross-sectional area of the tank a : cross-sectional area of the pipe President University Erwin Sitompul NNFL 10/4

Fuzzy Logic Fuzzy Control Single Tank System: 3 Rules Desired liquid level low okay

Fuzzy Logic Fuzzy Control Single Tank System: 3 Rules Desired liquid level low okay close fast high no change open fast 1 1 0 1 5 9 Liquid level [cm] 14 – 30 – 10 0 10 30 Valve control signal [%/s] FC with 3 Rules n Rule 1: IF level is okay, THEN valve is no change. Rule 2: IF level is low, THEN valve is open fast. Rule 3: IF level is high, THEN valve is close fast. President University Erwin Sitompul NNFL 10/5

Fuzzy Logic Fuzzy Control Single Tank System: 3 Rules Simulation in Simulink Liquid level

Fuzzy Logic Fuzzy Control Single Tank System: 3 Rules Simulation in Simulink Liquid level Valve control signal Valve opening President University Erwin Sitompul NNFL 10/6

Fuzzy Logic Fuzzy Control Single Tank System: 3 Rules Subsystem Valve Subsystem Single-Tank •

Fuzzy Logic Fuzzy Control Single Tank System: 3 Rules Subsystem Valve Subsystem Single-Tank • Double-click a subsystem block to see the elements inside President University Erwin Sitompul NNFL 10/7

Fuzzy Logic Fuzzy Control Fuzzy Logic Controller in Simulink n In Matlab workspace, design

Fuzzy Logic Fuzzy Control Fuzzy Logic Controller in Simulink n In Matlab workspace, design the fuzzy controller using fuzzy inference system (FIS) editor. n Export the fuzzy logic controller to workspace, give name. File > Export > To Workspace, (i. e. : STFC_3) n In Simulink, create a new model. n Open the Fuzzy Logic Toolbox and drag “Fuzzy Logic Controller” to the new model. n Double-click the “FLC” and insert the name given to the controller above. President University Erwin Sitompul NNFL 10/8

Fuzzy Logic Fuzzy Control Single Tank System: 3 Rules Evaluation “overshoot” too large slow

Fuzzy Logic Fuzzy Control Single Tank System: 3 Rules Evaluation “overshoot” too large slow response President University Erwin Sitompul NNFL 10/9

Fuzzy Logic Fuzzy Control 0 1 5 9 liquid level [cm] negative 14 st

Fuzzy Logic Fuzzy Control 0 1 5 9 liquid level [cm] negative 14 st – 30 – 20 – 10 0 10 20 30 valve control signal [%/s] zero positive 1 – 4 – 0. 5 0 0. 5 4 rate of liquid level [cm/s] President University fa op en sl ow en an ge ch n o se 1 op 1 cl o high os okay cl low e fa st sl ow Single Tank System: 5 Rules Erwin Sitompul NNFL 10/10

Fuzzy Logic Fuzzy Control 1 0 1 – 0. 5 0 0. 5 4

Fuzzy Logic Fuzzy Control 1 0 1 – 0. 5 0 0. 5 4 5 9 14 – 4 rate of liquid level [cm/s] liquid level [cm] 1: 2: 3: 4: IF IF level op – 30– 20 – 10 0 10 20 30 valve control signal [%/s] okay, THEN valve is no change. low, THEN valve is open fast. high, THEN valve is close fast. okay AND rate is negative, THEN valve is open slow. Rule 5: IF level is okay AND rate is positive, THEN valve is close slow. President University is is Erwin Sitompul fa en sl n 1 FC with 5 Rules n Rule st ow ge an op e ch o e n negative zero positive os high cl okay cl os 1 low e fa sl st ow Single Tank System: 5 Rules NNFL 10/11

Fuzzy Logic Fuzzy Control Single Tank System: 5 Rules FIS Editor Simulink Low pass

Fuzzy Logic Fuzzy Control Single Tank System: 5 Rules FIS Editor Simulink Low pass filter, Derivation, to smooth the to obtain the rate derivation result of liquid level President University Erwin Sitompul NNFL 10/12

Fuzzy Logic Fuzzy Control Single Tank System: 5 Rules acceptable “overshoot” faster response n

Fuzzy Logic Fuzzy Control Single Tank System: 5 Rules acceptable “overshoot” faster response n With all other factors stay the same, a better fuzzy control behavior and performance can be Liquid achieved by the level combination of: n Redefining existing membership functions. n Refining existing rule. Valve n Adding new membership control functions and new rules. signal Valve opening President University Erwin Sitompul NNFL 10/13

Fuzzy Logic Fuzzy Control Single Tank System: Feedback Control n How if the desired

Fuzzy Logic Fuzzy Control Single Tank System: Feedback Control n How if the desired liquid level should be changed to 10 cm? 7 cm? 12 cm? Set point Error + – e r FV Measured variable y LI n Practical solution: Error signal as the input to the fuzzy controller. President University Erwin Sitompul NNFL 10/14

Fuzzy Logic Fuzzy Control Single Tank System: Feedback Control e<0 negative . e<0 e>0

Fuzzy Logic Fuzzy Control Single Tank System: Feedback Control e<0 negative . e<0 e>0 negative positive zero . e>0 positive 1 1 4 fa st ow en sl en op n o ch sl e os cl an ow st fa se cl o 1 – 0. 5 0 0. 5 Rate of error [cm/s] ge – 4 op – 10 – 2 0 2 10 Error of liquid level [cm] – 30 – 20 – 10 0 10 20 30 Valve control signal [%/s] President University Erwin Sitompul NNFL 10/15

Fuzzy Logic Fuzzy Control Homework 8 n Implement the fuzzy logic controller as a

Fuzzy Logic Fuzzy Control Homework 8 n Implement the fuzzy logic controller as a feedback control for the single tank system in Matlab-Simulink. n Apply the 5 rule version with the corresponding membership functions. n Test the control loop to follow the reference trajectory as shown below. r [cm] 6 5 4 0 40 80 120 t [s] Reference trajectory President University Erwin Sitompul Method Settings NNFL 10/16