Group 2 - E06 - EXPERIMENT4

You might also like

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

MAPUA UNIVERSITY

SCHOOL OF ELECTRICAL, ELECTRONICS, AND COMPUTER ENGINEERING

Proportional plus Integral Control for Water


Level in a Tank
EXPERIMENT NO. 4

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

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

Theoretical Discussion:
Proportional and Integral Controller is a combination of proportional and an integral controller the output (also
called the actuating signal) is equal to the summation of proportional and integral of the error signal. Now let us analyze
proportional and integral controller mathematically. As we know in a proportional and integral controller output is directly
proportional to the summation of proportional of error and integration of the error signal, writing this mathematically we
have,

𝑒(𝑡) = 𝑆𝑃 − 𝑃𝑉 (4.1)
𝐾𝑐 𝑡
𝑢(𝑡) = 𝑈𝑏𝑖𝑎𝑠 + 𝐾𝑐 𝑒(𝑡) + ∫0 𝑒(𝑡)𝑑𝑡 (4.2)
𝜏𝐼

The Ubias term is a constant that is typically set to the value of u(t) when the controller is first switched from manual
to automatic mode. This gives "bumpless" transfer if the error is zero when the controller is turned on. The two tuning values
for a PI controller are the controller gain, Kc and the integral time constant τI. The value of Kc is a multiplier on the
proportional error and integral term and a higher value makes the controller more aggressive at responding to errors away
from the set point. The set point (SP) is the target value and process variable (PV) is the measured value that may deviate
from the desired value. The error from the set point is the difference between the SP and PV and is defined as e(t)=SP−PV.

The higher the proportion coefficient, the less the output power at the same control error. The higher the
integration coefficient, the slower the accumulated integration coefficient. PI control provides zero control error
and is insensitive to interference of the measurement channel. The PI control disadvantage is slow reaction to
disturbances. To adjust the PI controller, you should first set the integration time equal to zero, and the maximum
proportion time. Then by decreasing the coefficient of proportionality, achieve periodic oscillations in the system.
While the proportional term considers the current size of e(t) only at the time of the controller calculation, the
integral term considers the history of the error, or how long and how far the measured process variable has been
from the set point over time. Integration is a continual summing. Integration of error over time means that we
sum up the complete controller error history up to the present time, starting from when the controller was first
switched to automatic.

Reference/s:
https://www.mathworks.com/help/fuzzy/water-level-control-in-a-tank.html
https://blog.opticontrols.com/archives/344

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 with Proportional plus Integral Controller

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
“PI” in the controller for the Proportional control. PI(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. Simulation of 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