Haoqiang Ji MEng 2017-38-57
Haoqiang Ji MEng 2017-38-57
and current carrying capacity of wires. All considerations are necessary to ensure that
all connections are connected properly and correctly to right terminals. Furthermore,
before connecting devices to the SCADAPack 350, correct fuses should be added to
provide proper protection to the system.
2.4.1 Wiring
In this project, the wiring technique, selection of fuses, and some safety notices are
mainly introduced in this section. There are four main parts in the control box,
which is shown in Fig 2.1. They are Power Supply 1 and 2, Terminal Block, and
the SCADAPack 350. The power supply 1 is a DC adapter. It can transfer 120
VAC input to 20VDC, 600mA output. The power supply 2 is a GE Fanuc standard
power supply programmable controller. The power supply 2 can transfer 120 VAC
to 24 VDC, 800mA. The system wiring schematic is shown in Fig 2.14. Table 2.9
demonstrates the definition of acronyms of elements.
2.4.2 Fuses
From Fig 2.14, the external power supply, which provides a 120 VAC input to the
system, is separated into three different wires: Live (L), Neutral (N), and Ground
30
(GND). The PS1 and PS2 are connected to the three different wires correspondingly.
To protect the system, fuse 1 and 2 (F1 and F2) are added to play protectors for
the live wire in case of a fail external power supply. Then, a 20 VDC and maximum
600 mA current flows through F100 into the SCADAPack 350, and a 24 VDC and
maximum 800 mA current flow through F101 into pressure transmitter and flowrate
sensor. Both F100 and F101 project the devices in case of a fail PS1 or PS2. The
specifications of fuses that are used in this project are shown in Table 2.10.
Chapter 3
Features Details
Type of SCADAPack 350
Controller 5V/10mA Controller
30001 Pressure Sensor
Register Analog
30002 Flowrate Transmitter
Assignments Inputs
30003 &
Spare Port
30004
Analog 40001 Control Valve
Outputs 40002 Spare Port
Protocol Method Modbus USB
IP 192.168.0.2
Serial Subnet Mask 255.255.255.0
Communication Gateway IP Address 192.168.0.2
Station Number 3
Experimental Process To design a ladder diagram for this project, the first step
is to understand how the system works in the experimental. In order to achieve an
accurate result, the first objective of the system is to get rid of the air pressure error.
Then, the pressure sensor measures the water pressure and transmits the measured
result to the PLC controller. Then, by using PID algorithm, the control input signal
value is generated and transmitted to the control valve. Finally, the control valve
adjust the outflow rate of the water tank to achieve the control objective. By repeating
34
the above process until the actual height is nearly equal to the desired height, we can
conclude that this PLC based water level control system achieved its goal. Fig 3.2 is
a flowchart which shows the logic of the PLC program.
Ladder Diagram The ladder diagram consists of different types of function blocks
and each function block has its particular register addresses. In the Telepace Studio,
each address of a function block can be tagged as a different name in order to be
easily monitored and modified in the host PC. The function blocks that are used in
this project are SUB, STOF, PIDA, FTOS, ADD, CALL and SUBR, and DLGF.
The definitions are shown in Table 3.2.
Function
Definitions
Blocks
SUB Subtract Signed Values
STOF Signed Interger to Floating-point
PIDA Analog Output PID
FTOS Floating-Point to Signed Integer
ADD Add Signed Values
CALL & Execute Subroutine &
SUBR Start of subroutine
DLGF Data Log to File
Furthermore, because the Telepace Studio limits the size of ladder diagram up to
8 rungs, the program is written by 3 parts: main Program, air error elimination, and
PID level control. The ladder diagram of the main program is shown in Fig 3.3. The
first line of the main program is an execute subroutine which is the signal to call for
air error elimination (CALL 100). The second line is a latching switch function which
is used to turn off CALL 100 and turn on CALL 101, which is the network of the
PID level control.
In Fig 3.3, there is a boolean switch 10001 which is the start button of the system.
When the start button is pushed, the air error elimination function is executed. Fig
3.4 shows the ladder diagram of air error elimination function. To get rid of the air
pressure error, the control valve is turned off for 5 seconds, and turned on for 5 seconds
repeatedly for a while. When the start switch is ON, the timer 1 is implemented,
and a ‘close’ signal value is set on the control valve for 5 seconds. Then, the coil 1 is
implemented. At the same time, the timer 2 is executed, and an ‘open’ signal value
is set on the control valve for 5 seconds. Finally, after 5 seconds, a ‘close’ signal value
is set on the control valve. At the same time, the coil 2 is executed. The coil 2 causes
switch 2 in Fig 3.3 being turned on, and the latching coil 3 turns off the air pressure
error elimination and turn on the PID level control network. Fig 3.5 shows the ladder
diagram of PID level control.
In Fig 3.5, the desired height in the PLC program is set at 10288, which represents
36
40cm. When the PID level control network is activated, the pressure sensor transmits
a value into register 30001. At the first function block, the value from 30001 is
subtracted by the desired height, and the difference is stored at register 40013. Then,
the difference is compared with 0 at CMP function block. If the error is less or equal
to 0, which means the actual height is lower than the desired height, the control valve
stays at the closed position. With the water level rises, the difference is getting smaller
and smaller until the error greater than 0, which means the actual height is higher
than the desired height. At this time, the error is transmitted to PIDA function
block. At the PIDA function block, the error is calculated by PID algorithm, and a
new signal value is generated and held at 40021 register. Before and after the PIDA
function block, there are two number converters, STOF and FTOS. According to the
Table 3.2, these two function blocks are used for converting integer to floating-point
and floating-point to integer respectively. Finally, the signal value at register 40015
is added by 6552, which is the minimum operating current of the control valve, to
operate the control valve. As a result of repeating the process above, the water level
can be maintained at the desired height 40 cm with inlet flow and outlet flow. To
37
drain all water out after the experimental test, there are two more lines under the
main program. The ladder diagram is shown in Fig 3.6. The switch 10002 is going
to fully turn on the control valve and the switch 10003 is going to close the control
valve. This action is done manually.
• H: Actual Height
• H0 : Desired Height
38
• g: Gravity Acceleration
The physical meanings of the symbols of the water tank system are shown in Fig
3.7. It is noted that the A, a, qin , and g are time invariant parameters, and qout is
related to the current value of the control valve.
Then, based on the law of conservation of mass, the actual height is equal to
the total inflow mass subtracts the total outflow mass. As a result, (3.1) shows the
relationship among these three parameters. The outflow can be calculated by (3.2).
∂H
A× = qin − qout (3.1)
∂t
p
qout = K1 a 2gH (3.2)
39
From (3.2), it can be seen that the water level control system is a non-linear
system. However, around the desired height, the outflow equation can be linearized
as a linear model. (3.2) is rewritten approximately as (3.3):
qout K1 × a
≈√ = K2 (3.3)
2gH 2gH0
Then, by substituting (3.4) to (3.1), the model of the system is generated as (3.5):
∂H
A× = qin − K2 × 2gH (3.5)
∂t
1 ×a
where, K2 = √K2gH 0
, and K1 = IImax
act
because the valve coefficient is proportional
to the valve position and equal to the actual current of the valve over the maximum
current of the valve. By taking K1 and K2 in to (3.5), the model of the system can
be represented by the actual current Iact and the actual height H. The equation is
written as (3.6) The values of each parameters are shown in Table 3.3.
∂H
= C1 × qin − C2 × Iact × H (3.6)
∂t
1 2ga
where, the constant C1 and C2 can be calculated by C1 = A
, and C2 = √
2gH0 ×Imax ×A
.
1
1
1 -K- s
Product Out1
In1 Gain Integrator
-C- Inflow
50
Actual Height
45 Desired Height
40
30
25
20
15
10
0
0 10 20 30 40 50 60
Time (sec)
44 Actual Height
Desired Height
42
Actual Height (cm)
40
38
36
34
32
30
60 80 100 120 140
Time (sec)
From Fig 3.10, it can be seen that the actual height goes up with a constant slope
because the system is under the filling process without piping out action. When the
actual height is over 40 cm, the PID function is enabled. The PID adjustment is
reflected in the period after 20 seconds. From the simulation result, we can see that
42
the PID controller works very well, and the final goal is achieved. However, this
simulation result does not cover air pressure error elimination.
41
Actual Height
40.75 Desired Height
40.5
Actual Height (cm)
40.25
40
39.75
39.5
39.25
39
0 5 10 15 20 25 30 35 40
Time (sec)
50
Actual Height
45 Desired Height
40
Actual Height (cm)
35
30
25
20
15
10
0
0 25 50 75 100 125 150
Time (sec)
44 Actual Height
Desired Height
42
38
36
34
32
30
60 80 100 120 140
Time (sec)
Chapter 4
4.1 Conclusion
This report investigates a designing process of PLC based level control system. In
Chapter 1, a brief history and development of PLC are introduced. The initial idea
of developing a PLC is to simply a process control by using PLC to replace electrical
relays. With an increasing requirement of the industrial process, PLCs become a
significantly used controller in most industries. Also, a water level control system is
a typical process control system, so understanding how a water level control system
works is necessary for us to know other design procedure in other industrial process
control system. For this reason, a PLC based water level control system is designed
in our laboratory.
The experimental setup is proposed in Chapter 2. In this system, an SCADAPack
350 PLC, Fisher 360 control valve, and WIKA C-10 pressure sensor are used. To
mount all the equipment, a steel frame is installed on a cart. Furthermore, in order
to select a water tank gasket and set the position of filling entrance correctly, a
water tank finite element analysis and flow simulation are described in Chapter 2. In
Chapter 2, the PLC schematic is discussed. With filling water into a water tank, the
pressure sensor converts the water pressure to the analog signal. The PLC controls
the valve based on the analog signal which comes from the pressure sensor.
After a complete experimental setup, Chapter 3 introduces the PLC ladder di-
agram programming, system modeling and simulation results, experimental results
and system stability test results. The PLC ladder diagram programming is achieved
on Telepace Studio which is developed for SCADAPack Series PLC. Before the exper-
46
imental test, the system simulation is run on Matlab/Simulink. The system modeling
is based on the law of conservation of mass. In order to get a better result, a PID
control algorithm is introduced. In programming PLC, a PID control algorithm is
used. A PID control block is provided in the Telepace Studio. By using PID control
algorithm, we get better results on both experimental tests and the simulation. As
results showing, the PLC based level control system is stable and accurate.
Bibliography
[1] V. R. Segovia and A. Theorin, “History of Control History of PLC and DCS,”
2012.
[4] General Purpose Transmitter Type C-10, WIKA Instrument Corporation, 1000
Wiegand Boulevard Lawrenceville, GA 30043, 2010.
[5] Fisher 3660 and 3661 Positioner, EMERSON Process Management, Marshall-
town, Iowa 50158 USA, 2015.
[8] Wikipedia, “Modbus — wikipedia, the free encyclopedia,” 2017. [Online]. Avail-
able: https://en.wikipedia.org/w/index.php?title=Modbus&oldid=775804169
[9] I. Modbus, “Modbus application protocol specification v1. 1a,” North Grafton,
Massachusetts (www. modbus. org/specs. php), 2004.
[11] P. Panchal, A. Patel, and J. Barve, “PI control of level control system using PLC
and LabVIEW based SCADA,” in 2015 International Conference on Industrial
Instrumentation and Control (ICIC). IEEE, 2015, pp. 1196–1201.
[12] M. Sreejeth and S. Chouhan, “PLC based automated liquid mixing and bottle
filling system,” in IEEE International Conference on Power Electronics, Intelli-
gent Control and Energy Systems (ICPEICES). IEEE, 2016, pp. 1–5.
[16] Telepace Ladder Logic User and Reference Manual, Control Microsystems, 48
Steacie Drive Kanata, Ontario, Canada, K2K 2A9, apr 2008.
[18] ——, “Ethernet — wikipedia, the free encyclopedia,” 2017. [Online]. Available:
https://en.wikipedia.org/w/index.php?title=Ethernet&oldid=772682320