DEN5200 CourseWork PDF
DEN5200 CourseWork PDF
Abstract
The report investigates how a PID controller is used to control water level in a beaker. First the equipment
used to measure, change and record the level was used, to familiarise ourselves with the equipment. This
included the CE117 control module and the CE2000 software. Using this software, we were able to change
the flow rate and pump voltage and see how the level changed. Then we tested our own PID controller to
see how the water level would be affected with the controller. There was a total of 3 controllers used. One
was a given PID controller and two were made by group members. One of these PID controllers turned out
to be stable and the other one turned out to be unstable. The time constant of the system was also
calculated and it was also determined experimentally. A
Introduction
There were two different experiments conducted. One was the ‘Open Loop Level Step Response Test and
the second was ‘Level Control by Pump Speed’ the aims of these experiments respectively were
• To become familiar with the process vessel and to measure the time constant.
• To control the level in the process vessel using PID control
Obaidullah Waheed 170419358
The PID controller is the most commonly used feedback controller. It is used to maintain and control output
at desired levels and reduce error. PID stands for Proportional-Integral-Derivative. This is illustrated in
Figure 1
Level
transmitter
Process vessel
with heat
exchanger Cooler
inside and air
vent on top
Drain
valve
Bypass valve
Pump 2
Reservoir
Figure 2- apparatus
Control module
• Provides access to all circuits in experiment
• Connected to computer with CE2000 software on to control experiment module
CE2000 software
• Used to test and simulate systems
• Used to record and extrapolate data from
Obaidullah Waheed 170419358
Experiment 1
In this experiment first the bypass valve is closed, the drain valve and air vent are opened, and the process
vessel is drained. The apparatus (Figure 2) is connected to a computer and its components are manipulated
using CE117 control module, which is connected to a computer with CE2000 software. First, the voltage of
pump 2 is set to 4V and the bypass valve to 10V. Then the pump voltage is adjusted until the water level is
stabilized just above the heat exchanger. Once the water level has stabilised, it is then recorded. This is
referred to as level A. then the pump voltage is increased by 0.5 V. the water level is then recorded. This is
referred to as level B
Experiment 2
The bypass valve is closed, the air vent and drain valve are open. On software, there is a block titled PID.
First, the block is clicked on and the gain constant values are adjusted. First, they are set for the given
values. These are as follows:
• 𝑘𝑖 = 0.5
• 𝑘𝑝 = 10
• 𝑘𝑑 = 0
The software is then run. After that, the set point is set to 6V and bypass valve is set to 10V and stabilized,
the set point is increased to 6.5 V. This way the water level can be monitored using the software. Then the
set point can be reduced back to 6V, stabilized and allow us to test our own PIDs, using our own gain
constants. These are listed below for two controllers:
• 𝑘𝑖 = 0.2438
• 𝑘𝑝 = 1.42
• 𝑘𝑑 = 1.413
Another set of values for another controller were:
• 𝑘𝑖 = 36.1
• 𝑘𝑝 = 11.72
• 𝑘𝑑 = 0.9036
The behaviour of these controllers were then compared with the sample controller.
To tune the PID controller, first MATLAB was opened, and then an app was opened known as ‘Control
system designer’. Then using the app, several poles or zeros are added to the system. The values of the
poles and zeros are then changed until the bode plots are stable. To check the stability of the system via
the bode plot, first, the phase crossover frequency (𝜔𝑝 ) is determined. This is the frequency where the
phase is equal to -180°. If at this frequency, the corresponding value for log (𝐺(𝑖𝜔𝑝 )) is less than 0 dB,
then the system is stable. The system is stable because of two things: we can tell from bode plots: that the
Obaidullah Waheed 170419358
system is stable, but because the system inside MATLAB tells us that. An example of one of the bode plots
for the designed controller are shown in Figure 4, the step response is shown in Figure 6.
Then the value of the gain constants of the transfer function of the designed controller are then processed
into the block diagram as shown in Figure 3.
The stability of the control system is checked by the bode plots and can be observed by the system itself on
MATLAB. Figure 5 shows the step response when:
𝑘𝑖 = 0.2438
𝑘𝑝 = 1.42
𝑘𝑑 = 1.413
Figure 5-Simulation result- Step response when testing a PID controller that was designed
𝑘𝑖 = 36.1
𝑘𝑝 = 11.72
𝑘𝑑 = 0.9036
Experimental validation:
Plot for experiment 1
12
10
8
Voltage (V)
0
0 500 1000 1500 2000 2500
Time (s)
Pump 2 LT Flow
Calculating Area
Obaidullah Waheed 170419358
𝑆 = 𝜋𝑟 2 = 𝜋(0.15)2 = 0.071
Calculating outflow resistance
∆ℎ 0.041
𝑅= = = 6150
∆𝑞 6. 6̇ × 10−6
10
8
Voltage (V)
0
0 50 100 150 200 250 300 350 400
-2
Time
Output LT Setpoint
For this controller, the simulation is shown in Figure 5, the PID gain values for this are:
• 𝑘𝑖 = 0.2438
• 𝑘𝑝 = 1.42
• 𝑘𝑑 = 1.413
Overshoot (%) Peak time Settling time Rise time Steady state error (%)
4.41 39.5 335 28.8 2.33
Obaidullah Waheed 170419358
10
Voltage (V)
0
0 50 100 150 200 250
-5
-10
Time
Output LT Setpoint
For this controller, the simulation is shown in figure 5, the PID gain values for this are:
• 𝑘𝑖 = 36.1
• 𝑘𝑝 = 11.72
• 𝑘𝑑 = 0.9036
Overshoot (%) Peak time Settling time Rise time Steady state error (%)
2.41 18 n/a 9.8 2.41
12
10
8
Voltage (V)
0
0 50 100 150 200 250 300 350
Time
Output LT Setpoint
• 𝑘𝑖 = 0.5
• 𝑘𝑝 = 10
• 𝑘𝑑 = 0
Overshoot (%) Peak time Settling time Rise time Steady state error (%)
7.69 30 110 27 0.077
Discussion
Comparing Simulink simulation with actual result.
Using Figure 5 and Figure 8, we can see that the physical model and simulation have some differences.
Although both appear to be stable systems, the simulation appears to reach steady state quicker than the
physical model (i.e. Lower settling time). The simulation also appears to have more overshoot and a lower
steady state error than the simulation. These differences occur since the physical system consisting of the
water beaker, the CE117 control module and the CE2000 software all form a nonlinear system, which
means that the input is not proportional to the output. Whereas the Simulink simulation only tests for
linear systems. One of other the reasons, that the system in real life did not reach steady state as fast as it
had done in the simulation was that in real life, there could not have been a pump capable enough to
deliver such a large voltage. Hence it was only set to 10 V because of the limitations of the equipment to be
able to produce voltages that were not high enough. This could be because producing a voltage too high
would have been dangerous.
Using Figure 6 and Figure 9, we can see that the second controller does not reach steady state. But the
simulation shows that it does, but with a high steady state error. We can see from the Simulink system that
overshoot in the experimental result is much higher. The fact that from the experimental plot, that there is
no settling into steady state, that the controller is unstable. This is again due to the fact that the simulation
showed a linear system, but the high overshoot was caused by a substantially high 𝑘𝑖 value and the high
steady state error and settling time (although the system doesn’t show to settle within the allotted time)
was caused by a high 𝑘𝑝 value. The fact that the system appeared to respond so slowly was due to a
relatively low 𝑘𝑑 value. The low 𝑘𝑑 value also contributed to the high instability of the system.
Conclusion
I feel that the aims of the experiment were reached. I am familiar with the equipment used to measure the
changing water level. I am now able to understand and implement the use of a PID controller to control
water level and how the individual components of a PID and the equipment used to test the PID (i.e. The
control module and experiment module) work. I can see why one of the PID controllers was stable and the
other wasn’t. If I were to work with PIDs again in the future I would consider, the mistakes made in this
experiment with the PID controller so I would not make them again. I would consider that real life systems
are nonlinear, and I would try to tune my PID so that the simulation shows it not just to be stable but also
with less steady state error and a lower settling time.
References
• ElProCus - Electronic Projects for Engineering Students. (2019). How Does a PID Controller Work? -
Structure & Tuning Methods. [online] Available at: https://www.elprocus.com/the-working-of-a-
pid-controller/ [Accessed 19 Mar. 2019].
• Li, G. (2019). Water tank level control. 1st ed. [PDF] London: Queen Mary university of London.
Available at:
https://qmplus.qmul.ac.uk/pluginfile.php/1555631/mod_resource/content/4/DEN5200%20Lab%2
0-2019-V2.pdf [Accessed 19 Mar. 2019].
• Me.unlv.edu. (n.d.). ME 421L Automatic Controls Laboratory Lab 8: Flow control by Valve. [online]
Available at:
http://www.me.unlv.edu/Undergraduate/coursenotes/control/Flow%20Control%20by%20Valve_L
ab_08.pdf [Accessed 19 Mar. 2019].
• Ang, K., Chong, G. and Li, Y. (2005). PID control system analysis, design, and technology - IEEE
Journals & Magazine. [online] Ieeexplore.ieee.org. Available at:
https://ieeexplore.ieee.org/abstract/document/1453566 [Accessed 19 Mar. 2019].