Вы находитесь на странице: 1из 20

WATER TANK USING

FUZZY LOGIC

1.
2.
3.
4.
5.

ADHYATMA ABBAS
AYU DEWITA
DIYANATUL HUSNA
GANDHI ARSSEGI
MAGHFIROTUL AMALIA

Signal and System

Fuzzy Logic Application

Almost any control system can be


replaced with a fuzzy logic based control
system.
There are many cases when tuning a PID
controller or designing a control system
for a complicated system is
overwhelming, this is where fuzzy logic
gets its chance to be used.

Water Tank

As a more advanced
look at the
possibilities of fuzzy
logic we will look at
the control of a water
tank.
The goal of the
control system is to
take a set value and
change the input
valve so that the

Water Tank (Contd)

That water tank has a pipe flowing in


and a pipe flowing out.
The input flow rate is variable by a
control valve.
The output flow rate is dependant on the
amount of water in the tank; more water
in the tank results in a faster output flow
rate.
The water will drain out of the tank
faster when there is more water in the
tank and slower when there is less water

Simulink

The tank can be represented in Simulink


using the following block:

Simulink (Contd)

The fuzzy controller inputs are the


amount of error in the tank water level
and the rate of change for the tank
water level.
These two inputs will be considered
when the fuzzy logic controller
determines the proper input valve
setting.

Simulink (Contd)

The desired water level is set using the


constant input and the max inflow is also
set using a constant.
The inflow max is in place since a given
pipe can only provide a limited amount
of water.

Simulink (Contd)

Adding another input in FIS Editor


Edit>Add Variable>Input

Input1
Input2

Simulink (Contd)

The error input will be in the range of -1


to 1 and the rate input will be in the
range of -0.1 to 0.1 while the valve
output will be in the range of 0 to 1.

Simulink (Contd)

There are three membership functions


for the error input, negative, okay, and
positive.
The negative function is a trapezoidal
membership function which has the
following paramaters: [-1.27 -1.13 -0.8
0].
The okay membership function is
triangular with the following paramaters:
[-0.6667 0 0.6667].
The positive membership function is

Simulink (Contd)

The rate input also has three membership


functions: negative, none and positive.
The negative membership function is
trapezoidal with params: [-0.172 -0.11 -0.06 0].
The none membership function is triangular
with params: [-0.07067 0 0.07067].
The positive membership function is trapezoidal
with params: [-0.07067 0 0.07067].
This set of membership functions act on the
rate input of the controller.

Simulink (Contd)
There are five output membership
functions for the valve output on the
system: close_fast, close_slow,
no_change, open_slow, and open_fast.
close_fast : [-1 -0.9 -0.8]
close_slow : [-0.6 -0.5 -0.4]
no_change : [-0.1 0 0.1]
open_slow : [0.4 0.5 0.6]
open_fast: [0.8 0.9 1]

Simulink (Contd)

Simulink (Contd)

The rule:

Simulink (Contd)

Another way to visualize the rules is to


look at the rules surface for the system.
View > Surface in the FIS Editor.
The rule
surface
shows the
output value
for any
combination
of the two
input values.

Simulink (Contd)

File > Export > To Workspace... and then


enter in the a workspace variable,
example watertank'.
Now in the Simulink model double click
the Fuzzy Logic Controller and enter
watertank' for the 'FIS matrix'
paramater. This is important or else the
Simulink model will now know where to
look for the fuzzy control system.

Simulink (Contd)

Simulink (Contd)

The tank begins with a water level of 0.5


and then begins to drain when the fuzzy
controller picks up and opens the valve
rapidly and then slows down opening
and closes it a little as the tank
approaches the desired level of 1 where
the system reaches steady state.

Source:

http://www.calvin.edu/~
pribeiro/othrlnks/Fuzzy/tutorial2.htm
http://www.mathworks.com/access/helpde
sk/help/toolbox/fuzzy
/

Thank You!

Вам также может понравиться