Proportional Control For Water Level in A Tank: Experiment No. 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

MAPUA UNIVERSITY

SCHOOL OF ELECTRICAL, ELECTRONICS, AND COMPUTER ENGINEERING

Proportional Control for Water level in a Tank


EXPERIMENT NO. 1

Submitted by:
Group 2
Castillo, Dioselle
Mondejar, Dionel
Perido, Tamiya
San Jose, Rafaela Yvonne
Tuliao, Ybeth Angelyn

Submitted to:
Engr. Conrado Ostia
EXPERIMENT NO.1
Proportional Control for Water level in a Tank
Objective:
1. To familiarize the student in using MATLAB Simulink.
2. To control the water level in a tank using Proportional controller.
3. To demonstrate the components of the model and its subsystems.
4. To simulate the model.

Theoretical Discussion:
Proportional control is a control system technology based on a response in proportion to the difference
between what is set as a desired process variable (or set point) and the current value of the variable. It is used
where maintaining a process variable to a tighter tolerance and timely responsiveness are required. Control
systems in many industrial settings as well as some smart devices use proportional control.
Proportional control involves fine-grained control through a feedback mechanism. In comparison to the
on-off control of a traditional bi-metallic strip-switched domestic thermostat, devices that use proportional control
are more complex. The variable response is linearly proportional to the differential between a process variable
and the desired optimum set point. This means that the response of the controller and the mechanism for affecting
the variable make a greater response for a greater differential and a smaller change for a smaller differential. The
variability of the response to the process variable means tighter tolerances can be maintained. When automating
dangerous machinery, handling of sensitive materials and chemical processes, proportional control makes
processes and production safer and more reliable.
In the proportional control algorithm, on–off control will work where the overall system has a relatively
long response time, but can result in instability if the system being controlled has a rapid response time.
Proportional control overcomes this by modulating the output to the controlling device, such as a control valve
at a level which avoids instability, but applies correction as fast as practicable by applying the optimum quantity
of proportional gain. This can be mathematically expressed as:
𝑃 = 𝐾𝑐 + 𝐸
Where,
P = Proportional Control Mode
𝐾𝑐 = Controller Gain
𝐸 = Error
𝑃 = 𝐾𝑝 𝑒𝑝 (𝑡)

Where,
P = Proportional output
𝐾𝑝 = Proportional Gain

𝑒(𝑡) = 𝑒𝑟𝑟𝑜𝑟 = 𝑆𝑃 − 𝑃𝑉
𝑡 = 𝑡𝑖𝑚𝑒 𝑜𝑟 𝑖𝑛𝑠𝑡𝑎𝑛𝑡𝑎𝑛𝑒𝑜𝑢𝑠 𝑡𝑖𝑚𝑒
Combined water tank systems are used in many resident areas. Most of the time they are functioning
well, but there is some condition that the system faces the problem of overflows because of the system cannot
detect whether the water level have properly reached the desired level or the flow-in rate of the water are not
proportional with the flow-out rate. It can cause the water tank system empties faster than it fills up.
Consequently, the pressure of the water cannot support the distribution of the water to the resident area.
Construction of new tank, valve or system could be the solution to completely eliminate the problems.
However, such schemes are expensive and can also be extremely disruptive because the system networks may
extend across wide geographical areas. Alternatively, controlling the flow between parts of the system which
are under different loading can reduce the overflow spills. Actuated valve can be opened or closed to control the
flow past a certain point.
Consider a cylindrical tank with no outlet flow and an adjustable inlet flow that is controlled by a valve.
The inlet flow rate is not measured but there is a level measurement that shows how much fluid has been added
to the tank. The objective of this exercise is to develop a controller that can maintain a certain water level by
automatically adjusting the inlet flow rate.

Reference/s:
https://www.mathworks.com/help/fuzzy/water-level-control-in-a-tank.html
https://whatis.techtarget.com/definition/proportional-control

Equipment:
• MATLAB Simulink
Procedure:
1. Getting Started with Simulink
A. To start MATLAB, click on the MATLAB icon on your desktop.
B. In the command window type “open_system(‘sltank’)”.
C. A Simulink window will open. The model of a Water Level Control in a Tank.
D. Remove Fuzzy Logic Controller block and everything that is connected to it (the block does not cover this topic).

Figure 1.1 Water Level Control Model


2. Components of the Model

A. For the input of the Sum1 block, the constant block is connected to the positive, and the Signal Generator block is
connected to the negative.
B. Set the constant value of the Constant block to 1.
C. To set the parameters for the Signal Generator block, double – click the block and set the waveform to square,
choose Use simulation time for the time, input 0.5 for the amplitude, input 0.1 for the frequency, and choose
rad/sec for the units.
D. The output of the Sum1 block is connected to the positive of the error (Sum block) block.
E. The output of the error block is connected to PID Controller block. Double – click the PID controller and select “P”
in the controller for the Proportional control. P(s) will appear in the block.
F. Click the arrow pointing downward of the VALVE subsystem. It has two inputs, 1 is control and 2 is source flow.
The control has a Limited Integrator subsystem, click the arrow again to view its components.
G. In_1 is connected to the second input of the Mux block, then its output is connected to Fcn block that has a
mathematical expression input of u[2]*((((u[1]>lb)+(u[2]>=0))>0)*(((u[1]<ub)+(u[2]<=0))>0)).
H. Fcn block is connected the Integrator block in which it outputs the value of the integral of its input signal with
respect to time. Then its output is connected to Out_1, then another line connected to the first input of Mux.
I. Going back to the VALVE subsystem, the Product block is multiplying Limited Integrator subsystem and the
source flow input. Its output is connected to the Outport (out_flow) block to link signals to its destination outside
of the system.
J. Back to the Model, there is a constant block (tank max inflow) that has a value of 0.5 connected to the source flow
of the VALVE subsystem.
K. The output of the VALVE subsystem is connected to another subsystem called WATER TANK. Click the arrow to
show its components.
L. The WATER TANK subsystem has one input and three outputs. Its Inport block (flow in) is connected to the
positive of the sum block. The sum block is connected to another subsystem tank volume.
M. The components of tank volume subsystem are the same with the Limited Integrator subsystem.
N. Then its connected with the Gain block that has a parameters: for Gain, input 1/area , then choose Element-
wise(K.*u) for multiplication.
O. Then its output is connected to a Fcn block with a mathematical expression of sqrt(2*9.8*u). Then its output is
connected to Gain block (outletArea), and connected to an Outport (change the port number to 2) block named
flow out.
P. Going back to the 1/area gain block, its connected to Outport (change the port number to 1) block and named it
water flow. The gain block is also connected to the Relay (Overflow sensor), and connected to Outport (change
the port number to 3) block named overflow flag.
Q. The three outputs of the WATER TANK subsystem have different paths. The overflow flag output is connected to
second input of Mux, and it is also connected to the negative of sum block (error). The water flow output is
connected to Scope 4. Then, the flow out output is connected to Scope 2.
R. The output of Mux is connected to a S-function block (animtank), also connected to comparison scope.
S. From the Library Browser, search “workspace” and select the To Workspace block twice.
T. Connect the first workspace block to the output of Sum1 block that is connected the Mux block, and rename it as
“TargetLevel”.
U. For the second workspace block, connect it the output of the WATER TANK, and rename it as “Actual”.

3. Simulate the Model

A. To simulate the model, input “100” (or in how many seconds you want to run it) in the Stop time and then click the
Run button.
B. There is a window of the Water Tank that will appear. It demonstrates the water being filled in the tank and discharge
from the tank.
C. Click Comparison scope to see the graph for “TargetLevel” and “Actual”.
D. The yellow line represents the “TargetLevel” block. To view its values in the graph, type “TargetLevel” in the
command window.
E. The blue line represents the “Actual” block. To view its values in the graph, type “Actual” in the command window.

You might also like