Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Rahat Hasan
Department of Engineering and Design, London South Bank University
Abstract
The idea of this experiment is to understand the application of PID control of water level in a coupled
Tank system which was achieved by understanding the operation of Feedback 33-230 Coupled Tank
system and relating it to the mathematical modelling of a single tank system. The tank was then
calibrated to display water level is cm. A PID control of water levels was performed on the coupled
tank system by adding each control terms and analysing the response of the system. Firstly, a “P”
control was applied to make the system stable, then a “D” control to reduce the oscillations in the
system and finally an “I” control to achieve a good output response. This was then followed by the
measurement of flow rate based on the level of water in the Tank. This involved capturing data as the
tank empties water, calculating the rate of volume of water drained from the tank using two points on
the curve and finally determining the Time Constant of the tank.
Introduction
1
Mathematical Modelling of a Tank System
In a single tank system, the rate of water flow into the tank is proportional to the voltage applied to the
pump. The rate at which water flows out of the tank is non-linear and depends on the Height of the
Tank. The tank can be mathematically modelled as shown below:
The differential equation for the height, H, of the water in a tank is given by:
𝑑 𝑑𝐻
𝑉𝑜𝑙 = 𝐴 = 𝑏𝑉 − 𝑎√𝐻
𝑑𝑡 𝑑𝑡
Where,
Vol = the volume of water in the Tank.
A = the cross-sectional area of the Tank, (diameter 134mm).
b = Constant related to the flow rate into the Tank, (diameter 8mm).
a = Constant related to the flow rate out of the Tank, (diameter 8mm).
V = the voltage applied to the Pump, (0 – 5 volts).
H = the height (max 27cm) of water in the Tank, as a function of time due to the difference between
the flow rates into and out of the Tank. The equation contains one state, H, one input, V, and one
output H. The response is non-linear due to the square root of H.
A voltage of 2.85 V is applied to the pump to maintain a constant flow rate into and out of the tank at
a height of 13 cm.
2
Hardware interfaces exist in computing systems between many of the components such as the various
buses, storage devices and other I/O devices. A hardware interface is described by the mechanical,
electrical and logical signals at the interface and the protocol for sequencing them.
A software interface may refer to a range of different types of interface at different levels: an
operating system may interface with pieces of hardware. Applications or programs running on the
operating system may need to interact via streams, and in object oriented programs, objects within an
application may need to interact via methods [1].
Power up procedure
1. The PC is first powered up, then the UCI (universal control interface) is turned on and finally
the power to the Tank Rig is turned on.
2. The devices in the rig are connected to the Interface Card which are as follows:
D/A channel 1 to Pump 1 driver.
D/A channel 2 to Pump 2 driver.
A/D channel 1 to tank 1 sensor.
A/D channel 2 to tank 2 sensor.
A/D channel 3 to tank 3 sensor.
A/D channel 4 to tank 4 sensor.
3. The next step is the Simulink data acquisition. The Simulink model OneTANKTEST.mdl
enables to manually control the Pump on the rig and monitor the water levels using pressure
sensor signals. The sensor’s output is approximately 0 volts when the tank is empty and 3.2
volts at a height of 27 cm. the tanks overflow at 27 cm. It is important to calibrate the Tank
pressure sensors by recording the voltage values and converting the voltage level in cm [1]. A
picture of the model block is shown below:
3
Procedure on How to Run the Model
The steps followed to run the model are shown below:
1. Open Simulink Library Browser.
2. Build the model, i.e generate C-code, compile and link.
3. Connect to Target.
4. Run control on Target.
At step 2 the command window displays the code generation and compilation of the model. Once the
model is run, the simulation will run indefinitely until pressed stop. The slider gain block is the double
clicked to open it which will drive Pump 1. The value for Tank 1 sensor voltage is recorded and then
Pump 1 is driven at maximum speed by moving the slider to maximum of 5 volts. The Pump is
allowed to run at maximum speed until tank 1 is full and the voltage at Full level is recorded.
4
The model is executed for 120 seconds and then closed. The command prompt >>flowdata is typed in
Matlab command window.
The figure shown below has the x value of time and the y value of Height H of the tank as a voltage.
The rate of volume of water drained from the tank is measured using two points on the curve which is
then converted into Liters/min. The Time Constant of the Tank is also estimated from the figure.
5
Procedure on Water Level Control
Based on the calibrations, a closed loop system is created by adding blocks from the Simulink Library
browser. The model TankTest is shown below:
In order to perform proportional control, a PID block is set up to investigate Proportional control only
and the proportional gain is set to a value of above 1 while Derivative and Integral gain is set to zero.
The gain is increased in increments of 1 or less until it reaches Critical value and becomes unstable.
The system response for the P control is shown below:
To reduce oscillations a PD control is performed by increasing the derivative gain from a very low
value of 0.01 and thereafter in increments of 0.1. The system is tested repeatedly until the oscillation
is reduced or eliminated. The Integral gain should be set to zero. The system response for PD control
is shown below:
6
A slow or damped response can be achieved by setting the derivative gain to zero and the Integral
gain to 0.2 and thereafter in increments of 0.1 until a good output response is achieved.
Once a reasonable response is achieved in PD or PI control, a third term control is added and its value
is incremented by small amounts. The system is tested repeatedly until the best response is achieved.
7
𝑯 = 𝟏𝟏. 𝟑𝟕𝟖 𝑽 − 𝟖. 𝟓𝟓𝟔
The conversion formula is H = 11.378 V – 8.556.
Volume of the water in the Tank Calculation:
134
Radius of the Tank, r = 2
= 67 mm = 6.7 cm.
= 3807.7 𝑐𝑚3 .
Testing the calibration and Volume Function
At full Tank:
Predicted height = 27cm.
Observed height = 26.93 cm.
Predicted volume = 3807.7 𝑐𝑚3 .
x = 84.5, y = 2.226;
x = 98.6, y = 1.035.
2.226−1.035
∴ Gradient of the curve =
84.5−98.6
= - 0.0845 cm/s.
∴ Rate in cm = -0.0845 cm/s.
Rate of volume of water drained from the tank = π ×r^2×h/s
= π ×6.7^2 × -0.0845
= -11.917𝒄𝒎𝟑 /𝒔.
Calculation for Time Constant
Time constant is the time taken to get to 63.2% of the final value.
Final value = 2.606 cm.
∴ 63.2% of the final value = 63.2/100 ×2.606 = 1.647 cm.
∴ Time taken to reach 1.647cm or Time Constant of the tank = 44.2 seconds.
8
Discussion
The signal is noisy when the tank is being filled due to the water droplets dropping from a
height.
The system response has not changed when Integral control is introduced to the existing PD
control.
Conclusion
The first objective is achieved by understanding how the feedback 33-230 Coupled Tank
System works and what are the various components involved. The second objective was to
mathematically model a single Tank system which is achieved by analysing the model from
Simulink. The third objective was to perform a PID control of water levels in a coupled tank
system which is done by recording the value of Tank 1 voltage and then varying the Pump 1
speed. The Tank is then calibrated so it shows actual water levels in cm instead of voltage.
Then a second Simulink model of flow rate estimation is executed and the readings are noted.
The last objective is to perform a measurement of flow rate based on the water level which is
achieved successfully by creating a closed loop PID control and then tuning the PID to
achieve the best response.
References
1. T. Sattar. Experimental note of CTTanks from Control Systems. Lectures delivered in
Circuits, signals and systems, Lab Room T405. London South Bank University, 3 Feb 2013.