Water Tank Level Control Control Systems Analysis
Water Tank Level Control Control Systems Analysis
Ishak Hussain
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
Abstract
The primary aim of this experiment focused on the purpose of a PID controller in order to control
and regulate the fluid level in a water tank in comparison to a basic open loop system – this could
be achieved by calculating the time constants. As a result, the experiment was comprised into two
different sections in order to calculate the time constants: first using a graphical method
(specifically using the CE2000 software) and secondly observing the difference in flow rates and
heights when the system experienced a step input. This report includes an introduction, a design
of the PID model using Simulink, a description of the experiments taken place and finally a results
and discussion section to finalise the findings of the project.
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
Table of contents
Abstract ............................................................................................................................................ 2
1 Introduction ................................................................................................................................ 4
2 Problem Setup............................................................................................................................. 4
3 Controller Design and Numerical Simulation ......................................................................... 7
3.1 Proportional term ............................................................................................................... 8
3.2 Integral term ........................................................................................................................ 8
3.3 Derivative term .................................................................................................................... 8
3.4 PID Design Controller ......................................................................................................... 8
4 Experimental Validation............................................................................................................ 9
4.1 Experiment 1 ........................................................................................................................ 9
4.2 Time Constant (Calculation) .............................................................................................. 9
4.3 Time Constant (Graph) ..................................................................................................... 10
4.4 Time Constant (Comparison) ........................................................................................... 11
4.5 Experiment 1 Set-up .......................................................................................................... 11
4.6 Experiment 2 ...................................................................................................................... 12
5 Discussion.................................................................................................................................. 14
6 Conclusion ................................................................................................................................. 14
7 References ................................................................................................................................. 15
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
1 Introduction
This experiment focused on the effect of a PID controller for the control of a fluid within a water
tank. A PID controller is an instrument used to regulate process variables such as temperature,
flow and pressure using a control loop feedback mechanism – this controller consists of three
modes of control: proportional, integral and derivative. [1] In this experiment, a level transmitter
(LT) was used to measure and regulate the level of fluid in the water tank by converting the water
levels into electrical signals which would then control the actuator – this will allow an error to be
calculated thus establishing whether or not the flow rate needs to be adjusted. [3] As mentioned
previously, the efficiency of the PID was established through a two-part experiment. The first
experiment did not involve a PID controller. Instead, a basic open loop system was used and a
comparison was made between the two time constants calculations: one attained by the graph
from the CE2000 software and the other attained using manual calculation. The second
experiment used a PID controller, in which three different tests were held: the proportional and
integral gains and the derivative remained at zero during these trials. The results from this
experiment were processed into graphs presented in Section 4 and a comparison of the time
constants were calculated.
2 Problem Setup
2.1 Overview of the Experiment
The experimental system, as already mentioned, can be separated into two different parts: the
Open Loop level step response and Level Control pump speed which is regulated by the use of the
PID controller. In order for this experiment to take place, the CE117 Process Trainer, the Control
Module and the CE2000 software was required. These were all provided by the laboratory
technicians.
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
2.2 Equipment
The selected equipment used for this experiment as well as outlining their purpose is shown
below:
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
The purpose of the Control Module is to provide access to the actuator and transmitter circuits
involved in the Experimental process. It allows the CE117 hardware and CE2000 software to
function together as it allows the conversion of analogue to digital states, and vice versa.
The software interface shown above tests and regulates a range of controlled circuits, such as the
one in this experiment, by connecting the system to processes in real-time as well as capturing
data using a controller interface.
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
𝐶 = (𝐾𝑑 𝑠 2 + 𝐾𝑝 𝑠 + 𝐾𝑖 )
Where:
• 𝐾𝑑 is the derivative term
• 𝐾𝑖 is the integral term
• 𝐾𝑝 is the proportional term
Following the given lab instructions, a trial and error method was used until the obtained 𝐾 values
were deemed as satisfactory. The obtained 𝐾 values for the pre-lab session were:
𝐾𝑝 = 9.5
𝐾𝑖 = 2.1
𝐾𝑑 = 0.02
These were then inserted into the block diagram shown in Figure 6 in order to produce the graph
in Figure 5 as shown below.
Figure 5: Graph produced from Simulink using the K values mentioned previously.
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
𝑃𝑜𝑢𝑡 = 𝐾𝑝 𝑒(𝑡)
As seen in the equation above, the higher the error the greater the proportional control and from
this it can be concluded that the proportional control leads the system to a fast Setpoint. On the
other hand, there is a possibility of a steady state error involved, which can lead to an overshoot
when the system gets to the Setpoint. A way to avoid this error is to increase the proportional
term, but this can then lead to an unstable system. [6]
Figure 6 below shows the block diagram that was used to produce a voltage against time graph
using the 𝐾 values produced through Simulink (shown in Section 4.1). These were then inserted
into the block diagram – the circled areas on the figure below show where the 𝐾 values were
placed. This system was then ‘run’ in order to produce the graph shown in Figure 5.
Figure 6 : The PID design controller used to initially produce a graph with certain K values but then used to validate the
controller in the Lab sessions.
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
4 Experimental Validation
4.1 Experiment 1
The aim of this experiment was to investigate the response of the system after increasing the step
input by 0.5V. As the initial pump voltage was measured at 4V, the water level was slowly
increased to the desired pump voltage of 4.5V and was allowed to stabilise. This level was taken
to be level A – the height and flow rate for this level was recorded as shown in Table 1. The step
input was again increased by 0.5V to 5V which in turn resulted the flow rate to increase. Again,
this was allowed to stabilize, and the flow rate and height for this level B was recorded. This
difference in flow rate and height allowed for the determination of the time constants for
experiment 1, with a manual calculation shown in Section 4.2 as well as a calculation from the
graph in Section 4.3. The two time constants were then compared in Section 4.4 and a percentage
error was calculated – a percentage error of less than 20% would deem the experiment as
successful.
As shown in Table 1, the flow rates were measured in volts and was then converted to 𝐿/𝑚𝑖𝑛 for
calculation purposes. Using equation 1 below the flow rate was then converted into 𝑚 3 /𝑠.
1 1
𝑞 = (𝐹𝑙𝑜𝑤 𝑟𝑎𝑡𝑒(𝐿/𝑚𝑖𝑛)) × × (1)
1000 60
The cross-sectional area was calculated where the water level was controlled using equation 2
𝜋𝑑2 (2)
𝑆=
4
where 𝑆 refers to the cross-sectional area and 𝑑 is the diameter of the vessel (in this case, it is
150𝑚𝑚 as given in the lab handout)[3]
𝜋 × (0.15𝑚)2
𝑆= = 0.0177𝑚 2
4
The outflow resistance, 𝑅, is calculated by multiplying the difference in height (𝑚) by the flow rate
(𝑚 3 /𝑠) using equation 3. These equations are shown in more detail in source [3] in the Resources
section.
∆ℎ
𝑅= (3)
∆𝑞
0.018
𝑅= = 3600
0.5 × 10−5
The first time constant can now be calculated by multiplying the area, S, with the outflow
resistance, R, as shown by equation 4.
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
𝜏 = 𝑆𝑅 (4)
The results obtained from Experiment 1 is shown in the two tables below.
Flow Rate (𝑉𝑜𝑙𝑡) Flow Rate (𝐿/𝑚𝑖𝑛) Flow Rate (𝑚 3 /𝑠) × 10−5 Height (𝑚)
S (Area) 0.0177𝑚 2
R (Outflow Resistance) 3600
Time constant 𝜏 63.7secs
Table 2: Values of Area, Outflow resistance and Time constant τ produced from experiment 1
The first calculated time constant is 63.7 seconds as shown in Table 2 with the process of
calculation shown in Section 4.2. Another calculation is required to work out the second time
constant, and this is shown in the next section.
6 A
Voltage (V)
3 LT
2 Pump Flow
1 Flow Voltage
0
-100 0 100 200 300 400 500 600 700
Time (sec)
Figure 7: A graph showing voltage against time for the results produced in Experiment 1
10
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
The time constant 𝜏 refers to the time measured in seconds to charge a capacitor through the
resistor, from an initial charge of zero to roughly 63.2% of the value of an applied DC voltage. [4]
In order to calculate the time constant 𝜏 from the graph above, the voltage at A was subtracted
from the voltage at B (both are labelled on the displayed in Figure 7 above). This was then
multiplied by 0.632 (63.2%). This value was then added to the value at A, and this was then
correlated to find a time reading at this particular voltage reading. This time can be referred to as
𝑡1 . The measured time reading at 𝑡0 (time at A) was subtracted from 𝑡1 to calculate the time
constant. A detailed calculation of this is shown below:
A comparison between the time constants calculated in sections 4.2 and 4.3 is shown in the next
section by calculating a percentage error.
Percentage error between time constant from calculations and from graph is shown below:
63.72 − 54
× 100 = 15.3%
63.72
Figure 8 : A block diagram representing the Open Loop System for experiment 1
11
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
4.6 Experiment 2
The aim of this part of the experiment was to plot a graph using the given CE2000 software but
this time with the presence of a PID controller – this will allow the calculation of certain
characteristics (e.g. settling time, steady state error, etc) which will determine whether or not the
PID was effective. The first graph in Figure 9 shows a trial run (initial conditions) in which LT and
Output were plotted with each other and the other two graphs (Figure 10 & 11) represent the
data produced in the given PID and the experimental PID respectively.
10
8
Voltage/V
4
LT
2
Output
0
0 50 100 150 200 250 300 350 400 450
Time/s
Figure 9: A graph representing Voltage against Time for PID:Initial Conditions (Experiment 2)
A comparison was made between the voltage against time graphs for the given PID with a PID
controller designed myself with the 𝐾 values used in Section 3. This allowed for the analysis for
rising time, settling time, etc which were all determined from the observation of Figures 10 & 11.
The results of these are shown in Tables 3 & 4. A discussion regarding both these graphs and
tables is included in Section 5.
12
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
5
Voltage /V
3
LT
2
Setpoint
1
0
0 50 100 150 200 250 300
Time /s
Figure 10: A Voltage against Time graph for the given PID
Rise time (sec) Peak time (sec) Settling Time (sec) Percentage overshoot Steady State error
48.2 160 246.2 2.3% 0.02
Table 3: Analysis of Results of given PID
5
4
3
LT
2
Setpoint
1
0
0 50 100 150 200 250 300 350 400 450
Time /s
Figure 11: A Voltage against Time graph for the designed PID
Rise time (sec) Peak time (sec) Settling Time (sec) Percentage overshoot Steady State error
40.4 223.2 345 3.1% 0.2
Table 4: Analysis of results of own PID
13
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
5 Discussion
From the first experiment, a percentage error was calculated to be 15.3% and although this is
below the desired 20%, this value is still relatively high. Inaccuracies from the experiment could
be due to several errors. Firstly, the reading of the height at each water level was difficult to read
from the meniscus due to the constant fluctuations. There may also have been incorrect
judgement of the stability of water level as, again, the constant fluctuations, resulted in a human
error of measuring a few millimeters off the actual value. A small inaccuaracy like this, can result
in an incorrect time constant calculation (Section 4) as even a milimeter difference can vastly
change the outflow resistance value which in turn will affect the time constant. A systematic error
of this experiment could be related to a parallax error, which means that there is a displacement
error involved based on the viewing angle of, in this case, the water level. [2] A way to reduce this
error in a future experiment is to have the same person reading off the meniscus every time or
have several people check the reading in order to increase the reliability of the result observed.
A way of improving the reliability of the results, in general, would be to repeat the experiment
several times in order to obtain similar readings. However, due to the time-consuming nature of
these experiments, repeats were unable to be taken and so there is a significant possibilty of
random error involved in these results.
When comparing the two PID systems, it can be seen from Figures 10 and 11 that there was a
significant difference between the two settling times. The open loop system produced a settling
time of 345 seconds while the closed loop system (PID Controller) produced a settling time of
246.2 seconds. The difference in settling time can therefore be determined as 98.8 seconds. This
suggests that the PID controller, as opposed to an open loop system, is more efficient at producing
a stable system at a quicker rate. It can also be concluded that there is a greater control of the
system in the second experiment (PID Controller) because a feedback loop is utilised here instead
of the open loop system present in the first experiment. A closed loop system has negligible
sounds effects, unlike an open loop system, as they are composed of a feedback system and hence
there is a reduction of errors between input and out signals which would otherwise result in
external noise sources. On the other hand, there is a possibility that this feedback system can lead
to an oscillatory response which would then reduce the overall gain of the system. The gain of the
system was not specifically measured in this experiment, so it can be ignored in this project. An
advantage of the open loop system is that it has the capability to manually control and observe
precisely what is required from the experiment.[5] It typically is a much simpler system and from
an economic perspective, it is an attractive focal point as the construction costs are considerably
lower. [7] Despite this however, the PID Controller (closed loop system) will still be the favoured
system due to its very accurate nature which cannot be replicated by human application. As
mentioned already, the lack of a feedback mechanism in open loop systems may result in large
inaccuracies in terms of result output. [7]
6 Conclusion
As shown in the graphs from Section 4, the PID system (closed loop) stabilised at a much quicker
rate compared to the open loop system, as the PID recognises instability without additional
assistance as it considers its surroundings by assessing and changing any potential errors, which
in turn minimises fluctuations. In comparison, the open loop system is largely dependent on the
person manually changing the voltage values. To improve the PID system in this laboratory, the
derivative mode of the controller could be involved as only the proportional and integral modes
were in engagement but not the derivative mode which is the mode that reduces percentage
overshoot. Therefore, simply by tuning the PID controller correctly improvements can be made
to its efficiency and therefore increase the validity of the results of this experiment.
14
Downloaded by M 11 ([email protected])
lOMoARcPSD|25258607
7 References
[1] What is a PID Controller? Omega Engineering
https://www.omega.com/prodinfo/pid-controllers.html (available online) Accessed 16/03/19
[3] Den5200 Lab Sheet. Control Systems and Analysis. Water Level Tank Control
[5] Comparative study of P, PI and PID controller for speed control, K Smriti Rao, Ravi Mishra
[7] Speaking Technology. Open & Closed Loop Systems Advantages and Disadvantages
https://www.123mylist.com/2012/01/open-closed-loop-system-advantages.html (available
online) Accessed 19/03/19
15
Downloaded by M 11 ([email protected])