EMS507U - Water Level in Tank Report
EMS507U - Water Level in Tank Report
Design - 2023/24
Control Problem-Oriented Exercise
Water Level in a Tank
Abstract
This report investigates the application of PID controllers in managing fluid levels within a
tank. Within the closed-loop experimentation the PID parameters are tuned to reach desirable
output characteristics. Findings reveal the superiority of closed-loop PID systems over open-
loop configurations in terms of precision. There was little success in reaching an adequate
output signal post tuning. However, challenges such as experimental setup time and PID
tuning complexity are noted, prompting considerations for future improvements. The study
contributes to advancing understanding in control systems and highlights the importance of
PID tuning for achieving optimal performance in fluid level control applications.
Table of Contents
1 - Introduction
2 - Apparatus
3 - Controller Design
5 - Discussion
6 - Conclusion
7 - References
1
1 - Introduction
This experiment aimed to conduct control analysis on water level within a water tank that
adjusted the amount of water through the use of a level sensor, transmitter, actuator
(determines flow rate into tank through the pump) and drain valve (determines the flow rate
out of tank).
This experiment explores the application and assessment of a PID (Proportional Integral
Derivative) controller in managing fluid levels within a water tank. Using the CE117
apparatus and CE200 software, it compares the effectiveness of two control systems: an
open-loop configuration and a closed-loop PID system implemented through
MATLAB/Simulink.
The experimental procedure involves two stages: initially evaluating time constants in both
control systems, followed by fine-tuning PID parameters to optimize performance. PID
controllers, with their proportional, integral, and derivative elements, require precise
adjustment to achieve optimal operation.
This report aims to present comprehensive findings across various sections, including
problem setup, Simulink-based system modelling, results analysis, discussion, and
conclusion. By examining both experimental and simulated data, it seeks to provide insights
into PID controller effectiveness and its practical relevance, thereby enhancing understanding
and proficiency in control system design and analysis.
2 - Apparatus
2
The experimental setup comprises several key components essential for accurate
measurement and control within the system. The Process Vessel serves as the primary
container for water, allowing precise monitoring of its level; it also contains the Heat
Exchanger to regulate temperature of water. The Cooler plays a crucial role in lowering the
water temperature within the vessel. Operating in conjunction with the Proportional Valve,
the Bypass Valve facilitates the transfer of water from the reservoir to the Process Vessel.
Meanwhile, the Reservoir acts as a storage unit for water, while the Drain Valve enables the
controlled return of water to the reservoir using gravity. The Level Transmitter (LT) generates
an electrical signal corresponding to the water level in the Process Vessel, contributing to data
acquisition and control. Pump 2 functions as the primary mechanism for transporting water
from the Reservoir to the Process Vessel via the Cooler and Proportional Valve. The Flow
Transmitter measures flow rates, providing calibrated output signals essential for monitoring
fluid dynamics. Lastly, the Air Vent regulates pressure within the Process Vessel, ensuring
optimal conditions for the experiment and maintaining desired water levels.
Workspace
Figure 2a – CE117 Control Module Schematic [1] Figure 2b – Annotated screenshot of CE2000 Software
Interface [1]
Figure 2a shows the CE117 Control Module, this serves the function of facilitating access to
both actuator and transmitter circuits utilized in the experimental process. Its role is pivotal in
enabling seamless coordination between the hardware and CE2000 software, enabling the
conversion between analogue and digital states, facilitating the integration and
synchronization of these components for efficient operation.
Figure 2b shows the software interface; used to test and regulate a range of controlled
circuits, such as the one in this experiment. Connecting the system to processes in real-time
as well as capturing data using a controller interface simultaneously allowing for adjustment
and tuning.
3 - Controller Design
Before commencing the experiments, a preliminary session was conducted to become
acquainted with the control problem under investigation. Utilizing SIMULINK [2], the
objective was to devise a PID controller that met the specified control objectives outlined in
the design brief. A PID controller is a feedback control system used to regulate dynamic
processes by continuously adjusting an actuator output based on the difference between a
3
desired setpoint and the actual process variable. It combines three control actions:
proportional, integral, and derivative, each contributing to the controller's response to
deviations from the setpoint. Subsequently, this controller design was verified in the
laboratory to enable comparisons between simulated and real-time outcomes. Simulink
software facilitated the generation of gain values, which were then incorporated into the
equation:
where 𝐾𝑑 represents the derivative gain, 𝐾𝑖 denotes the integral gain, and 𝐾𝑝 signifies the
proportional gain.
The proportional term, 𝑃(𝑡), in a PID controller directly responds to the current error,
providing immediate correction. Manipulating the proportional gain amplifies this correction,
affecting the controller's responsiveness. Alternatively, there's a risk of encountering a steady-
state error, which might cause overshoot as the system approaches the Setpoint. To mitigate
this error, one approach is to elevate the proportional term. However, such adjustment could
potentially render the system unstable. [4][11][12]
𝑡
𝐼(𝑡) = 𝐾𝑖 ∙ ∫ 𝑒(𝜏) 𝑑𝜏 {3}
0
𝜏 − Time Constant
The integral term, 𝐼(𝑡), addresses accumulated error over time, aiming to eliminate steady-
state errors. It adjusts itself according to past values which does mean it’s not a perfect
stabiliser for adjusting future errors, however adjusting the integral gain fine-tunes the
controller's ability to reach the setpoint accurately.[11][12]
𝑑𝑒(𝑡) {4}
𝐷(𝑡) =
𝑑𝑡
The derivative term, 𝐾𝑑, attempts to assist in what the integral term cannot compensate for, it
anticipates future error trends by measuring the rate of change of the error. It helps reduce
overshoot and settling time. Adjusting the derivative gain affects the controller's
responsiveness to changes in the error signal.[11][12]
Following the given lab instructions, a trial and error method was used until the obtained gain
values were deemed as satisfactory. The obtained values for the pre-lab session were:
These were then inserted into the equivalent PID block diagram system to produce the
diagram below on Simulink. This will be used for comparison in Test 2.
4
Figure 3 – Voltage-Time plot for SIMULINK modelled closed-loop PID controller.
The procedure begins with initializing the CE2000 software and setting up the necessary
connections. The initial pump voltage was measured at 6.5V, so the water level was slowly
increased to the desired pump voltage of 7V and was allowed to stabilise – this was Level A.
Subsequently, the flow rate was then increased by 0.5V to 7.5V. This was Level B and time
was given to allow the system to stabilise. Height recordings, ℎ, were taken for both levels
and the difference in flow rate and height allows for the determination of the time constant
for the system, with a manual calculation shown as well as a calculation from the graph. The
two time constants are then compared.
Table 1 – Raw data collected from lab.
Flow rate (Volt) Flow rate (L/minute) Flow rate q (m3/sec) h (m)
[5s.f]
Level A 7 7 0.00011667 0.127
Level B 7.5 7.5 0.00012500 0.214
Difference 0.00001333 0.087
The cross-sectional area, 𝑆, was calculated for the process vessel using equation {5} where
the diameter of the vessel, 𝑑, was 150mm [1].
𝜋 ∙ 𝑑2 {5}
𝑆=
4
5
Thus, the time constant, 𝜏, can be calculated through:
𝜏 = 𝑆𝑅 {7}
Test 1
Level B
10 Level A
9
8
7
Voltage (V)
6
5
4
3
2
1
0
0 200 400 600 800 1000 1200
Time (s)
A time constant can be estimated from Figure 4 as 63.2% of the time taken from Level A to
reach Level B (marked on graph). The time at Level A (before the step increase) is 735 sec
and the LT Voltage at this point is 8.525 V. The time at Level B (after the step increase) is
1066 sec and the LT Voltage is 9.165 V. The difference in time is 331 sec and so the time
constant comes out to 63.2% of this value:
𝜏Graph = 209.19 sec [5s.f]
The percentage error between 𝜏Calc and 𝜏Graph is 13.39% [4s.f].
A similar procedure to Test 1 will be conducted using the CE2000 software and the making of
Voltage-Time plots but the difference lies in controlling the system using a PID controller and
calculating separate characteristics other than the time constant (e.g. settling time, steady
state error etc.) to determine the effectiveness of the PID controller and it’s chosen
6
parameters. The system was set to a value of 6 V and given time to stabilise, then it was
increased to 6.5 V and allowed to settle (this is where the analysis will occur) before being set
back down to 6 V.
Case A - The initial values of the PID controller were 𝐾𝑝 = 10, 𝐾𝑖 = 0.5, 𝐾𝑑 = 0. A plot was
made for these settings in Figure 5 and Table 3.
Rise Time (sec) Peak Time (sec) Settling Time (sec) Percentage Overshoot Steady State Error
48.3 139.2 95.1 10.08% 0.03
Case B - The PID values were then adjusted to 𝐾𝑝 = 10.5, 𝐾𝑖 = 2.1, 𝐾𝑑 = 0.02 (determined
in Section 3) to make Figure 6 and generate the values in Table 4.
Rise Time (sec) Peak Time (sec) Settling Time (sec) Percentage Overshoot Steady State Error
40.4 121.1 110.9 8.7% 0.11
7
5 - Discussion
Experiment
There were initial challenges encountered during the experiment while familiarizing with the
CE117 control module and the CE2000 software. However, the overall effectiveness of both
tools facilitated smoother operation during the lab session. Despite these advancements, the
considerable time required for apparatus setup and system stabilization constrained the extent
of testing and data recording, thereby limiting the depth of analysis achievable in this
investigation. To enhance the scrutiny of control systems and PID controllers, future
improvements could focus on refining the experimental procedure, perhaps by incorporating
pre-calibration of the equipment and more comprehensive training to not only expedite the
experimental process but also ensure consistency and reproducibility across multiple trials.
Test 1
The first experiment showed an error of 13.39% between the calculated values and the
graphical estimate, this is similar to literature [3] yet relatively high. This error can be
attributed to a multitude of sources. One such error is that due to the fluctuation of the water
level (despite stabilising time), the systematic parallax error in reading the meniscus of the
water level was greatly enhanced. This could be reduced in the future using level indicators to
enhance visibility & alignment with the water level and practicing proper measurement
technique at a consistent measuring distance. Another error can be attributed to the lack of
time given for the system to settle, as it can be seen from Figure 4 that although it is relatively
stable, a more detailed inspection finds that 10 min may not be satisfactory for the system to
reach a negligible steady state error level; it should be noted that the stabilising times for each
pump voltage wasn’t equivalent and in the future this should be noted and adhered to. The
reliability of the experiment is severely lacking as it only considers one set of results for very
few step voltages. To truly recognise the results of this test and eliminate any outliers the test
should be repeated multiple times over a few different step voltage ranges (preferably at least
3 repeats for every voltage range).
Test 2
In comparing the two systems of Figure 5/Table 3 and Figure 6/Table 4 it can be seen that
adjusting the PID values made a notable change. The rise time was 7.9 sec shorter, likely due
to the slight increase in the 𝐾𝑝 term. However, this does have a drawback in increasing the
steady state error from Case A by more than triple in Case B when in theory the proportional
term should decrease the error. Unfortunately, the settling time post PID tuning was
considerably larger (16.6%) and this was undoubtedly caused by the increase in the 𝐾i term as
8
it prioritises trying to reach the set point accurately whilst mitigating fluctuations but it does
mean it will take longer to stabilise. A single benefit of the PID tuning was that the system
was a lot more accurate at the 6.5 V step voltage, the percentage overshoot was also 1.38%
lower; this could be attributed to the derivative gain, 𝐾d, which aimed to alleviate the
aggressiveness of the system caused by the increased proportional gain value. Ultimately,
Case B cannot be said to be better than Case A because the system was wildly unstable
(relative to Case A), there were significant fluctuations that occurred too rapidly and often,
this is not the ideal scenario for a control system as significant oscillations will cause
unintended consequences. Some notable examples that showcase this theory are the JAS39
Gripen fighter jet crashes in Feb 1989 and Aug 1993 where pilot-induced-oscillation counter-
acted an over-sensitive yet slow-response flight control system resulting in extremely violent
fluctuations [5][6]. One can see that there is an importance in finding balance between
accuracy and stability of the system. A system that is too not very accurate but highly stable
will not be very effective in practice and contain many inefficiencies (Case A). A system that
is quite accurate but unstable will allow for uncontrollable behaviour and cause safety
concerns in practice (Case B).
Upon comparison of Case B to the SIMULINK result, Figure 3, they both display similar
behaviour – in that of decent overshoot, a steep correction, and some fluctuation – but Case B
seems to be more accurate than the simulation yet much more unstable. It can be seen that the
expected values differ greatly from those in practice. It is unclear as to why this is the case
specifically but one could predict it being an inability to fully capture the experimental
conditions within the simulation or the low reliability of the experimental data causing
considerable deviation to theory.
PID Tuning
A heuristic method was chosen to tune the PID controller based on the assumption that
although the method is not guaranteed to be optimal, perfect, or rational it is sufficient in
reaching a suitable approximation. This did simplify the process as it was intuitive but in
retrospect contain severe disadvantages. It didn’t manage to identify an extremely stable and
accurate solution even after several iterations and was significantly time consuming.
Employing a Ziegler-Nichols tuning method would allow for an equally simple method in
obtaining a much more stable control signal, yet it is known to oversimplify, and this method
isn’t particularly applicable to the complex case of Test 2; more sophisticated tuning methods
would be necessary [8].
9
6 - Conclusion
In conclusion, this report has detailed the experimentation and analysis conducted to assess
the effectiveness of PID controllers in managing fluid levels within a water tank. Through a
combination of theoretical understanding, practical experimentation, and data analysis,
several key findings have emerged.
Firstly, the comparison between open-loop and closed-loop systems clearly demonstrates the
advantages of closed-loop systems employing PID controllers. While open-loop systems offer
simplicity, they lack the precision and accuracy necessary for effective control, particularly in
dynamic environments. In contrast, PID controllers provide feedback mechanisms that
minimize errors between desired and actual values, resulting in superior control and stability.
The experiments conducted, particularly Test 1 and Test 2, emphasised on the parameters in
PID controllers and how adjustments in these can result in overall changes in output signals.
Varying observations were made some of which were as expected and planned whilst others
were unintended and didn’t align with theoretical assumptions. This also highlighted the
significance of PID tuning in achieving optimal performance. The experiments underscored
the importance of striking a balance between accuracy and stability in controller design, as
overly aggressive tuning can lead to instability and oscillations, compromising system
effectiveness. Moreover, heuristic methods were employed initially for tuning, it became
evident that more sophisticated methods could offer improved stability and accuracy.
10
7 - References
[1] Queen Mary's University of London, Water Level Tank Control | Control Systems Analysis
and Design. 2024. Available:
https://qmplus.qmul.ac.uk/pluginfile.php/3517751/mod_resource/content/1/EMS507%20Lab
%20Experiment%20Handout%20-%202023.pdf
[4] F. Kudlačák and T. Tibor Krajčovič, Error Behaviour in PID Control Systems with
Dynamic Processes . 2016. Available: https://core.ac.uk/download/pdf/295596623.pdf
[8] K. J. Åström and T. Hägglund, “Revisiting the Ziegler–Nichols step response method for
PID control,” Journal of Process Control, vol. 14, no. 6, pp. 635–650, Sep. 2004, doi:
https://doi.org/10.1016/j.jprocont.2004.01.002.
[9] Ilahia College of Engineering and Technology, Linear Control Systems notes. 2014.
Available:
https://www.icet.ac.in/Uploads/Downloads/EE%20303%20Linear%20Control%20Systems%
20notes.pdf
[10] S. Nammi, EMS 507U: Control System Analysis and Design | PID Control I & II. 2024.
Available:
https://qmplus.qmul.ac.uk/pluginfile.php/4119515/mod_resource/content/3/Wk4__PID%20c
ontrol_v3.pdf
[12] Heinz Unbehauen, Control Systems, Robotics and Automation - Volume II. EOLSS
Publications, 2009.
11