Introduction to Neural Networks and Fuzzy Logic Lecture

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

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

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 12/2

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 12/3

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 12/4

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 12/5

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 12/6

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 12/7

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 o os e n 1 op 1 cl high os okay cl low e fa st sl ow Single Tank System: 5 Rules Erwin Sitompul NNFL 12/8

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

Fuzzy Logic Fuzzy Control 1 – 0. 5 0 0. 5 4 0 1 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 12/9

Fuzzy Logic Fuzzy Control Single Tank System: 5 Rules FIS Editor President University Simulink

Fuzzy Logic Fuzzy Control Single Tank System: 5 Rules FIS Editor President University Simulink Erwin Sitompul NNFL 12/10

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. n Adding new membership Valve control functions and new rules. signal Valve opening President University Erwin Sitompul NNFL 12/11

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? Error Set point + r – e FV Measured variable y LI n Practical solution: Error signal as the input to the fuzzy controller. President University Erwin Sitompul NNFL 12/12

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 e os cl 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 12/13

Fuzzy Logic Fuzzy Control Parameter Settings n In case your simulation of the fuzzy

Fuzzy Logic Fuzzy Control Parameter Settings n In case your simulation of the fuzzy logic control does not run, try to change this parameter settings. n Go to File>Preferences President University Erwin Sitompul NNFL 12/14

Fuzzy Logic Fuzzy Control Parameter Settings n Continue to Configuration Defaults>Optimization, und change the

Fuzzy Logic Fuzzy Control Parameter Settings n Continue to Configuration Defaults>Optimization, und change the check sign as indicated by the arrow below. President University Erwin Sitompul NNFL 12/15

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

Fuzzy Logic Fuzzy Control Homework 12 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 12/16

Fuzzy Logic Fuzzy Control Homework 12 A n A DC motor is a common

Fuzzy Logic Fuzzy Control Homework 12 A n A DC motor is a common actuator in control system. The input to this device is a voltage given in Volt and the output is the rotation speed given in rad/s. n The electric circuit of a DC motor and its rotor is shown on the lower left figure. n A model of the DC motor in Matlab Simulink is also provided, as shown through the lower right figure. President University Erwin Sitompul NNFL 12/17

Fuzzy Logic Fuzzy Control Homework 12 A n In case there is no load

Fuzzy Logic Fuzzy Control Homework 12 A n In case there is no load change, the DC motor will rotate with a constant speed. n If the load is changed, the supplied voltage must be adjusted so that adequate current may flow and the desired rotation speed can be achieved. n Design a fuzzy logic control that will maintain the motor to rotate with the velocity of Student. ID/10 rad/s. n Embed the controller in the Matlab -Simulink file. n Submit the softcopy (*. fis, *. mdl) and the hardcopy (screenshots of *. fis, *. mdl and scope) n Deadline: Sunday, 8 April 2018. President University Erwin Sitompul NNFL 12/18