Hgskolen i Telemark
Fakultet for teknologiske fag
Bachelor i ingenirfag
Two-Tank Control
2-tank Process
DeltaV Workstation
-PID Controller
-Alarm System
-User Control
Ethernet
DeltaV
Controller with
I/O Moduls
24VDC Power
Supply
AO
Control Signal
4-20mA
(PUMP)
|
DO
Valve Signal
0/24VDC
Out
420mA
Out
0/
24VDC
DI Level Indicators
0/24VDC
AI Level Measurement
(Level)
4-20mA
Fakultet for teknologiske fag
Adresse: Kjlnes ring 56, 3918 Porsgrunn, telefon 35 02 62 00, www.hit.no
Bachelorutdanning - Masterutdanning Ph.D. utdanning
Hgskolen i Telemark
Table of contenst
TABLE OF CONTENST
Table of contenst .................................................................................................................. 3
1 Introduction ..................................................................................................................... 4
2 Program ........................................................................................................................... 7
2.1
2.2
2.3
2.4
2.5
2.6
Step 1: Creating a new database .......................................................................................................... 7
Step 2: Starting to program a PID module ......................................................................................... 7
Step 3: Configure I/O ............................................................................................................................ 9
Step 4: Connect I/O to the PID_LOOP ............................................................................................. 10
Step 5: Connecting I/O to the rest of the signals .............................................................................. 13
Step 6: Assign modules and download .............................................................................................. 17
3 HMI ................................................................................................................................ 19
3.1
3.2
3.3
3.4
3.5
3.6
3.7
Step 1: Open a new picture ................................................................................................................ 19
Step 2: Creating two tanks ................................................................................................................. 20
Step 3: Creating a Faceplate Button .................................................................................................. 23
Step 4: Pump animation and the flow transmitter ........................................................................... 23
Step 5: Solenoid valves ........................................................................................................................ 25
Step 6: Datalinks ................................................................................................................................. 27
Step 7: Finishing picture ..................................................................................................................... 28
4 Operate ........................................................................................................................... 29
Hgskolen i Telemark
1 Introduction
1 INTRODUCTION
In this task you will learn how to create a program and a HMI to control the two-tank system
with DeltaV. Figure 1-1 shows the two-tank system you will be controlling.
While Figure 1-2 shows a P&ID drawing of the two-tank system.
Figure 1-1 The Two-tank system
Hgskolen i Telemark
1 Introduction
Qp [cm^3/s]
LT1
Overlp
Overlp
HA1
Tank1
y1
LA1
FT
Q2
Q1
LV1
LT2
Overlp
HA2
y2
Tank2
LA2
Q4
Q3
LV2
u[V]
Reservoar
Figure 1-2 Level Control System
Hgskolen i Telemark
1 Introduction
Equation (1-1) is the mathematical calculation of the volume in tank1.
Equation (1-2) is the mathematical calculation of the volume in tank2.
Tank1
(1-1)
Tank2
(1-2)
Where:
[Area in tank1 = 113,1 cm2]
[Level in tank1]
Qp[The flow to tank1]
Q1[The flow out of tank1]
Q2[The flow out of the solenoid valve]
[Area in tank2 = 113,1cm2]
[The Level in tank2]
Q1[The flow to tank2]
Q3[The flow out of tank2]
Q4[The flow out of the solenoid valve]
Hgskolen i Telemark
2 Program
2 PROGRAM
In this chapter we will learn how to create the program used to control the Two-tank system.
2.1 Step 1: Creating a new database
Before we start to program in DeltaV we would like to start on an empty program where no
configuration is made. This is easily done with the use of database. To avoid adding all the
hardware configurations each time, we have premade a database that is empty, but contains the
hardware configurations you need.
The First thing you need to do is to log on to the DeltaV station with username: Administrator
and password: Deltav. When this is done choose DeltaV Desktop. Click on the start-menu and
Database Administration. Double click on the icon Copy Database, choose Student1 and write
your name in the Copy to field. Figure 2-1 is showing you how it should look like.
Figure 2-1 Database
Now set the database you just made active, with the Set Active Database button. Select the
database you just made and press ok.
Your database is now created and active.
2.2 Step 2: Starting to program a PID module
Go back to the start menu and start DeltaV Explorer.
Right click on Control Strategies and select New Area. Call this area 2-TANK.
We now have a new area called 2-TANK. Now we just need to configure a control module.
Grab a PID module from library. See Figure 2-2
Choose LibraryModule Templates Analog Control, Select the PID_LOOP and drag and
drop it down to your Area called 2-TANK.
Hgskolen i Telemark
2 Program
Figure 2-2 Exploring DeltaV
We also need a new Area where we can configure all the other I/O. Right click on Control
Strategies and choose New Area. This new area we can name 2-TANK2.
Figure 2-3 is a picture of how it should look.
Figure 2-3 Area 2-TANK2
Hgskolen i Telemark
2 Program
2.3 Step 3: Configure I/O
This 2-TANK module needs quite a lot of I/O. They are already terminated on the module, but
we need to activate them in the Exploring DeltaV software. Choose Applications I/O
configuration like Figure 2-4 is showing.
Figure 2-4 I/O Configuration
Table 2-1 Channel list
IN
CARD/CHANEL
DESCRIPTION
LT1
C01CH03
LEVEL TANK1
LT2
C01CH04
LEVEL TANK2
FT1
C01CH05
FLOW
HA1
C03CH01
HIGH ALARM TANK1
LA1
C03CH02
LOW ALARM TANK1
HA2
C03CH03
HIGH ALARM TANK2
LA2
C03CH04
LOW ALARM TANK2
P1
C02CH03
PUMP
LV1
C04CH01
SOLONOID VALVE
TANK1
LV2
C04CH02
SOLONOID VALVE
TANK2
OUT
Table 2-1 is an overview over cards with channels connected to the controller. Right click on the
channels, as shown in Figure 2-5, and enable all the channels presented in the table above. When
the channels are active they should change color from grey to yellow.
Hgskolen i Telemark
2 Program
Figure 2-5 I/O Configuration
All I/O that we need to control the 2-TANK should now be active.
2.4 Step 4: Connect I/O to the PID_LOOP
We will now return to Exploring DeltaV to connect the I/O to the logic. Lets start with the PID
regulator. We will find it in AREA 2-TANK. Right click on the PID_LOOP_1 and choose open
with Control Studio, like shown in Figure 2-6.
10
Hgskolen i Telemark
2 Program
Figure 2-6 Open with Control Studio
Figure 2-7 is showing the PID block. Right click the block and choose Assign I/O to Signal Tag.
.
Figure 2-7 Assign I/O to Signal Tag
Mark IO_OUT and press Modify, now choose Browse and double click on CTLR-1_HIT, mark
TLR-1-HITC02CH03 and press OK. It is the gain signal to the pump that is connected to this
card. This procedure is shown in Figure 2-8.
11
Hgskolen i Telemark
2 Program
Figure 2-8 Signal Tag
The level transmitter on the tank has a 4mA output signal when the level is at 100%. Because of
this we need to reverse the signal to the regulator, this is done by getting an Analog Input block
from the I/O tab, and a Scaler block from the Analog Control tab.
Your picture should now look similar to Figure 2-9.
Figure 2-9 PID configuration
Now we need to connect the OUT on the Analog In block to the IN on the SCLR block. We also
need to connect the OUT on SCLR to the IN on the PID block.
12
Hgskolen i Telemark
2 Program
Right click on the Analog In block and choose Assign I/O to Signal Tag, press browse, double
click on CTLR-1-HIT, mark TLR-1-HITC01CH03 and press OK. This is the level transmitter
that is connected to this channel.
Now mark the SCLR block. A property window will appear in the lower left corner, as shown in
Figure 2-10. Double click on OUT SCALE and enter 0 on 100% scale, and 100 on 0% scale.
Press OK.
Figure 2-10 Reversing the PID-regulator
Now press the
button.
Press yes, and choose CTLR-1-HIT and click OK. Press yes, and OK until the download is
completed.
Close Control Studio. Press yes if you get question about saving.
2.5 Step 5: Connecting I/O to the rest of the signals
We have now configured our PID regulator with correct IN and OUT. Now we need to look at
the other signals. Head back to Exploring DeltaV right click on 2-TANK2 and choose New
Control Module. This is shown in Figure 2-11.
13
Hgskolen i Telemark
2 Program
Figure 2-11 New Control Module
Lets call this module IO. The module is located in the area 2-TANK2. Figure 2-12 shows you
what happens when you right click the IO area. Do this and Open with Control Studio.
Figure 2-12 Open with Control Studio
Now we need to connect the remaining I/O to the physical model. All the blocks we need are
found under the I/O tab. Grab four Discrete Input blocks, two Discrete Output blocks and two
Analog Input blocks.
By right clicking on the blocks you can change the name on each of the blocks to the correct tag
they are supposed to have. Name each of the blocks as seen in Figure 2-13, this will make the
program easier to read.
14
Hgskolen i Telemark
2 Program
Figure 2-13 Analog and Digital blocks needed
Now we need to connect the blocks to the correct I/O.
Right click on HA1 and choose Assign I/O to Signal Tag, then press browse, double click on
CTLR-1-HIT, mark TLR-1-HITC03CH01 and press OK.
Right click on LA1 and choose Assign I/O to Signal Tag, then press browse, double click on
CTLR-1-HIT, mark TLR-1-HITC03CH02 and press OK.
Right click on HA2 and choose Assign I/O to Signal Tag, then press browse, double click on
CTLR-1-HIT, mark TLR-1-HITC03CH03 and press OK.
Right click on LA2 and choose Assign I/O to Signal Tag, then press browse, double click on
CTLR-1-HIT, mark TLR-1-HITC03CH04 and press OK.
Right click on LT2 and choose Assign I/O to Signal Tag, then press browse, double click on
CTLR-1-HIT, mark TLR-1-HITC01CH04 and press OK.
Right click on FT1 and choose Assign I/O to Signal Tag, then press browse, double click on
CTLR-1-HIT, mark TLR-1-HITC01CH05 and press OK.
Right click on LV1 and choose Assign I/O to Signal Tag, mark IO_OUT, press Modify then
Browse, double click on CTLR-1-HIT, mark TLR-1-HITC04CH01 and press OK.
Right click on LV2 and choose Assign I/O to Signal Tag, mark IO_OUT, press Modify then
Browse, double click on CTLR-1-HIT, mark TLR-1-HITC04CH02 and press OK.
Figure 2-14 shows all the blocks connected to the correct INN and OUT.
15
Hgskolen i Telemark
2 Program
Figure 2-14 Analog and Digital blocks connected
To be able to operate the valves LV1 and LV2 you need to change their mode from Cascade to
Manual. This is done by marking LV1, a property box will appear in lower left corner as shown
in Figure 2-15. Double click on mode that is located in the Operating sub-menu. Set Normal
Mode and Target to Manual. Do exactly the same for LV2.
Figure 2-15 Valve mode
16
Hgskolen i Telemark
Now press the
2 Program
button.
Press yes, and choose CTLR-1-HIT and click OK. Press yes, and OK until the download is
completed.
Close Control Studio. Press yes if you get question about saving.
2.6 Step 6: Assign modules and download
Return to Exploring DeltaV. Now we need to connect our areas to alarm and events. To do this
you need to mark the 2-TANK area and drag it down to Alarm and events, as shown in Figure
2-16, press yes on the box that appears. Do the same with area 2-TANK2 and AREA_A.
Figure 2-16 Alarms and Events
17
Hgskolen i Telemark
2 Program
Now we need to download the program to the controller. This is done by right clicking on
Physical Network and choose download Physical Network as seen in Figure 2-17.
Figure 2-17 Download Physical Network
Our program is now done and the next thing we need to do is create a HMI, so we can control
our model with the program.
18
Hgskolen i Telemark
3 HMI
3 HMI
To be able to read and write values and simulate a process we need to create an HMI.
3.1 Step 1: Open a new picture
When you are in Exploring Deltav. Go to applications and press DeltaV Operate Configure. See
Figure 3-1
Figure 3-1 DeltaV Operate Configure
Press + on the Pictures folder, then templates and double-click on main. See Figure 3-2. Then
you will get the default picture.
Figure 3-2 the main Picture is the default picture
Mark everything on the picture and delete it. Figure 3-3 is showing you how your picture should
look when everything is deleted.
19
Hgskolen i Telemark
3 HMI
Figure 3-3 Starting Picture
3.2 Step 2: Creating two tanks
Now we can start construct our picture. In the left column you can find a lot of pre drawn
components. We need two tanks, some piping, valves, flow transmitter, a pump and level
transmitters.
Click on the folder Dynamo Sets and Tanks Anim1.
Figure 3-4 Different Tank dynamo pictures
Figure 3-4 shows you that there are lots of pre drawn tanks with animations.
Find a suitable tank you would like to use. A Dynamo box will appear after you have placed
your tank, as shown in Figure 3-5.
20
Hgskolen i Telemark
3 HMI
Figure 3-5 Tank Dynamo properties
Now we need to connect this to the value of the level to tank1. Press the
button and press
Browse DeltaV Control Parameters, choose PID_LOOP_1, PID1, choose PV, then choose CV.
Press OK until you are back to your picture.
We are now done with one tank. Now grab another tank, similar to the first one. This one we
need to reverse the visual display, because it is not scaled in the program. This is done by setting
Lowest Input Value to 100 and Highest Input Value to 0.
Figure 3-6 Tank Dynamo properties completed
Press the
button.
button and press Browse DeltaV Control Parameters, then press the folder up
21
Hgskolen i Telemark
3 HMI
Figure 3-7 Control Strategies
Choose 2-TANK2, then IO, LT2, PV then CV and press OK until you are back to your picture.
By pressing A in the toolbox you can write on your picture. Write Tank1,Tank2 and
Open Faceplate and make your picture similar to Figure 3-8.
Figure 3-8 How your picture should be similar to
22
Hgskolen i Telemark
3 HMI
3.3 Step 3: Creating a Faceplate Button
Now we will make a button to open the faceplate to our regulator. Choose a circle from the
toolbox and place it next to the text Open Faceplate.
Double click the circle. Under command make sure to activate click.
Double click on DeltaV Open Faceplate, press the
button and choose Browse DeltaV
Control Parameters. Then we need to choose 2-TANK, PID_LOOP_1, double click on PID1,
choose PV, then choose CV and press OK until you are back to your picture.
Figure 3-9 is showing you how to configure the button to open the faceplate.
Figure 3-9 Creating a button to open the PID-regulator faceplate
We now made it possible to open the faceplate to our regulator when the program is running.
3.4 Step 4: Pump animation and the flow transmitter
Now we need a pump. Pumps are found in Dynamo Sets, PumpsAnim. Find a suitable pump.
The Dynamo box will also appear. Make sure Animate Pump Color is activated. Choose range
from 1 to 100 as color green. As shown in Figure 3-10
The pump will then turn green when its turned on.
23
Hgskolen i Telemark
3 HMI
Figure 3-10 How to make your pump change color when its running
Press the
button, choose Browse DeltaV Control Parameters. Then we need to choose 2TANK,PID_LOOP_1, double click on PID1,OUT, choose CV and press OK until you are back
at your picture.
The Flow Transmitter can be found under Dynamo Sets and FlowMeters see Figure 3-11. Find a
suitable flow transmitter to use on your picture.
Figure 3-11 Flow transmitters
24
Hgskolen i Telemark
3 HMI
3.5 Step 5: Solenoid valves
Now we are only missing two solenoid valves, one to each tank. Valves are also found in
Dynamo Sets and Valves_DF. Find two suitable valves and place them at the outlet of each tank.
This is shown in Figure 3-12.
Figure 3-12 Different Valves
Double click on the valve you placed next to tank1. Figure 3-13 will appear, make sure
Foreground Color is activated and press the button next to it.
Figure 3-13 Valve Animation
Make sure Exact Match is activated, delete all the rows and add two new rows. The color of the
valve, at value 0 should be gray. At value 1, the valve should be green, as seen in Figure 3-14.
25
Hgskolen i Telemark
3 HMI
Figure 3-14 Changing the color of the valve when its open
Then press the
button, choose Browse DeltaV Control Parameters, 2-TANK2, IO, LV1,
OUT_D, CV and press Ok until you return to your picture. Figure 3-15 combined with the text
should help you connect the valve signal.
Figure 3-15 Connecting the valve signal
26
Hgskolen i Telemark
3 HMI
The valve will now change color from gray to green when its open. Now do the same thing with
the valve you placed close to tank2. The only difference is that you need to choose LV2 instead
of LV1 when we configured the other valve.
3.6 Step 6: Datalinks
Now we need to make two datalinks, Figure 3-16, to be able to control the valves. Press
the Toolbox. Choose Data Entry Type to In-Place and choose Formating Type to Numeric.
in
Figure 3-16 Datalink - Valves
Now press the
button and choose Browse DeltaV Control Parameters, 2-TANK2, IO, LV1,
OUT_D, CV and press OK until you return to your picture. Place this Datalink over the valve to
Tank1.
Do exactly the same for valve 2. The only difference is you need to choose LV2, instead of LV1.
Now we need to display the value from the flow transmitter. This is also done with the use of
Datalink, Figure 3-17. Press
.Set Formatting Type to Numeric and press the
button,
choose Browse DeltaV Control Parameters, 2-TANK2, IO, FT1, OUT, CV and press okay until
you return to your picture. Place the Datalink next to the flow transmitter.
Figure 3-17 Datalink Flow Transmitter.
27
Hgskolen i Telemark
3 HMI
3.7 Step 7: Finishing picture
The only thing that should remain now is the piping and a water reservoir to the pump. Pipes are
found in Dynamo sets under Pipes_DF and water reservoir can be drawn by using DeltaV
Toolbox.
Figure 3-18 is a suggestion to how it can look when its completed.
Figure 3-18 Finished product
Save your picture in the Templates folder, and name it your name.
28
Hgskolen i Telemark
4 Operate
4 OPERATE
In this chapter we will learn how to run the program used to control the Two-tank system.
To be able to control the two-tank you need to physically connect the model to DeltaV. This is
done by connecting the connection pins together. They are marked, and the wire with nr 1 from
the model is connected to the wire with nr 1 on DeltaV. Figure 4-1 is how the connection is
done.
Figure 4-1 Wire Connection
The model also needs to be connected to 230V and be turned on. When turning the power on,
make sure the components inside the model are powered.
To run the model you need to open DeltaV Operate config. Open the HMI you created, that you
named with your name. This HMI is found under templates. Press Ctrl+w to witch to run mode
in DeltaV. The process can now be operated. As you can see in Figure 4-2 the process is running.
Figure 4-2 DeltaV Operate Run
29
Hgskolen i Telemark
4 Operate
Now press the faceplate button you made. The faceplate window should appear, Figure 4-3.
On the faceplate you have options to control the process manually or set it to auto. You can trend
the regulator by pressing the button that looks like a graph. You will then see SP, OP and PV.
Figure 4-3 PID-regulator faceplate
If you would like to change the regulator parameters you press the magnify glass button in the
faceplate window. The detail picture in Figure 4-4 will appear.
This is where you change the PID parameters. Under tuning, Gain is the P-value, Reset is the
I-value and Rate is the D-value. We choose P=2 and I=10 as start values. But feel free to
experiment and find better values.
30
Hgskolen i Telemark
4 Operate
Figure 4-4 PID-regulator detail point
31