0% found this document useful (0 votes)
10 views21 pages

Air Ball CLogix PIDTune Lab 2 SP 26

This lab exercise focuses on controlling the height of a ball in an air column using PLC with PID tuning and HMI modifications. Students will program the PLC to manage the ball height through fan speed adjustments, conduct various tuning exercises, and modify the HMI touch panel for better control and monitoring. The exercise includes submitting documentation of the programming process, tuning results, and reflections on the learning experience.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views21 pages

Air Ball CLogix PIDTune Lab 2 SP 26

This lab exercise focuses on controlling the height of a ball in an air column using PLC with PID tuning and HMI modifications. Students will program the PLC to manage the ball height through fan speed adjustments, conduct various tuning exercises, and modify the HMI touch panel for better control and monitoring. The exercise includes submitting documentation of the programming process, tuning results, and reflections on the learning experience.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Lab Exercise 2

Air Ball Height Control


with PID Tuning and HMI
Table of Contents
Page

Objective Lab 2–1


Preliminary Lab 2–1
To Be Handed In Lab 2–1
The Problem Lab 2–2
Tuning Exercise Lab 2–5
Disturbance Response Lab 2–7
HMI Screen Lab 2–7
Important Information Lab 2–11
Input/Output Definitions Lab 2–12
ControlLogix PID Implementation Details Lab 2–13
Starting Your Project Lab 2–14
Setting Up the PID Controllers Lab 2–17

Rev. A
EE 3340 Lab 2 - 1

Objective
This exercise is designed to provide a simple sequential control and PID control
application for a PLC, including tuning the loop. The exercise also includes modifying the HMI
(human-machine interface) touch panel.

Preliminary
A function chart for the program startup and normal operation is due as shown in the lab
schedule before the first lab session for this exercise. You must use the posted blank function
chart Excel file to formulate this function chart. Do not “invent” your own format. The format of
branches is shown on the second sheet.

To Be Submitted to Canvas (#1-6, one per group; #7 individually):


1. Demonstrate the operation of the program to the instructor.
2. A 1/2 to 1 page description of the ladder logic operation. Indicate any unusual aspects of
your design
3. The final function chart for your program plus the marked-up function chart your group
turned for the preliminary. The final function chart must be "clean", that is, no markups.
4. A ladder logic program listing of the program. Use the documentation features of the
Studio 5000 software to add a description to any added internal memory. Also, comment
important groups of rungs (e.g., ones dealing with setpoint value checking), but you do
not need to comment all rungs.
5. Ball height loop tuning results:
a. Trend of setpoint change of +1.0 and corresponding PV response for Kp=1.0 and
Ti=100.0 minutes.
b. Trend of PV that has sustained oscillations to a setpoint change of +1.0. Value of Kp
for the oscillations.
c. Calculations for PI controller tuning parameters (Kp and Ti) using the Ziegler-Nichols
closed-loop tuning equations
d. Trend of setpoint change of +1.0 and corresponding PV response for Kp and Ti
determined in part c.
The trends should be "snipped" from the screen and pasted into a Word document for
submission.
6. Ball height load disturbance response:
a. Trend of height response due to closing the damper for 2 seconds. Plot must also
include the DAMP_CLOS tag value.
b. The trend should be "snipped" from the screen and pasted into a Word document for
submission.
7. Individually answer the following reflection questions. Submit your answers as a text
entry to the “Lab 2 – Air Ball” assignment.
1. What could you have done better?
2. What would you tell someone just starting the lab exercise?
3. What did you learn about yourself?

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


Lab 2 - 2 EE 3340

The Problem
You need to control the height of a ball suspended in a moving air column shown in
Figure 1. The ball height is controlled by the fan speed. You will need to program the PLC to
maintain the ball height when the setpoint is changed and when the inlet is restricted.
To start up the process the following steps must be taken:
1. Run the fan motor at half-speed for 4 seconds.
2. Keeping the motor running at half-speed, wait for the ball height to be at least 3
inches.
3. Save the current height (to be used in next test).
4. Close the inlet damper until the ball height has dropped at least 1 inch.
5. Now open the inlet damper for 10 seconds. Note: there is no switch indicating that
the damper is fully open, though the motor driving the damper will stop when the
damper is fully open or closed.
6. Now activate the normal operation, which controls the height to the high setpoint
for 30 seconds and then controls the height to the low setpoints for 30 seconds.
This operation continues until the system is reset. The LOW_SP_LA is on when
the low setpoint is being copied to the PID controller.
7. If the time for the motor test (step 2) requires more than 5 seconds or the damper
test (step 4) requires more than 5 seconds, then the system stops and flashes the
LOW_SP_LA lamp (one second on and one second off) until the system is reset.
The STOP_PB functions like a pause. When it is pressed (turned off), the operation is
paused at its current step and the fan motor is off. When the operation is paused, any timers that
are running continue to run. There is no separate reset pushbutton, so the STOP_PB initiates
reset when it is held down for 3 seconds. When the system is reset, any internal steps are reset
and the next time the START_PB is pressed, the system goes through its start-up procedure as
described above.
The process has a simple touch screen interface panel (Figure 2) consists of start/stop
pushbuttons and a running indicator. As part of the exercise, you will add more indications and
buttons to this panel.

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


EE 3340 Lab 2 - 3

Figure 1. Air ball height control system.

Figure 2. Starting operator touch panel.

You have been retained to design, program and implement an automatic control scheme
using a PLC that will operate this process. The specific tasks that must be done by the PLC are:

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


Lab 2 - 4 EE 3340

1. The sequential startup of the process as outlined above. Start/stop with the start and stop
buttons on the HMI touch panel (HMI_Start_PB and HMI_Stop_PB). A green light
should be lit when the system is running and a red lamp should be lit when the system is
stopped. Another light is on when the low setpoint is being moved to the PID controller.
These indicators appear on the operator panel (Fig. 2) and on the HMI touch panel. Your
program should control these indicators.
2. There are 2 real tags that hold the two setpoints:
Height_SP_High - High height setpoint
Height_SP_Low - Low height setpoint
3. Make sure the setpoints are within the specified limits:
Height_SP_Low/High in range of 0.2 to 11.5 inches
Height_SP_Low =< Height_SP_High
You will need to make sure that if the operator changes a high/low setpoint to a number
outside its valid range, the ladder logic changes it to a value inside its limits.
4. Note that the normal operation alternates between which setpoint, high or low, is copied
(moved) to the PID controller. This alternation will be used for the tuning exercise. The
LOW_SP_LA is on when the low setpoints are being copied to the PID controllers.
5. A PID loop provides the automatic control of the height.

The above tasks may seem like a lot of work, but the tags used to communicate to/from
the controllers and the controller parameters are defined below, so you will not be required to
understand the operation of the PID controllers. Most of your work will involve the sequential
operation and PID controller tuning.
So that the programming task does not seem overwhelming, a suggested outline of the
project tasks that will allow you to build up the program, testing as you go, is:
1. Start your project as outlined in the first 2 points in the “Important Information” section.
2. Program the logic for the sequential steps to perform the initial testing. Add the reset
logic. Add your PID blocks, following the directions in the section “Setting up the
Loops." Note that the PID controller should be in the manual mode when the system is
doing the initial tests and when paused (stopped) in normal operation. The PID controller
should be in the automatic mode when the system is running in normal operation. For the
test steps, move the appropriate fan speed into the Height_Tieback location, which has
the same units as FAN_SPEED.
3. Check that the analog I/O and PID block scaling has been properly configured by placing
the PLC in run mode and observe the [Link] value. The [Link] should be close to
zero.
4. Add initialization logic to set the high and low setpoints for the height loop to reasonable
starting values.

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


EE 3340 Lab 2 - 5

5. Add logic (MOV block) to move the proper setpoint (high/low) to the controller in the
proper location [Link]) during the normal operation step(s). The LOW_SP_LA is on
when the low setpoints are being copied to the PID controllers.
6. Test your PID loop and control of the fan speed by verifying that the fan speed changes
in accordance with which setpoint is being selected.
7. Add logic to enforce that the two height setpoints are within the limits and that the low
setpoint is not higher than the high setpoint.
8. Perform tuning exercise. Details in “Tuning Exercise” section. Modify the values for
Height_SP_High and Height_SP_Low by displaying the Controller tags and click on the
"Monitor Tags" tab.
9. Modify the C-More panel. These modifications are needed for the next steps.
10. With the touch panel, test your ladder logic to enforce the limits on the 2 setpoints by
modifying the setpoints from the touch panel.
11. Determine the disturbance response. Details in "Disturbance Response" section.

Tuning Exercise
Tune the height loop controller with the Ziegler-Nichols tuning method described on pages 834-
835 of the text. Use the Logix Designer Trend tool (built-in to the programming software) to
obtain real-time plots of the setpoint (SP) and process variable (PV).

The initial values of the PID controller tuning parameters should be Kp=1.0, Ti=100.0 minutes,
and Td=0.0 minutes.

To do this exercise, you will probably want to modify the presets of the two 30-second timers
that alternate between the high and low setpoints so that the period of alternation is 15 seconds
for each setpoint. Change the high and low height setpoints so there is a difference of 1.0
(inches) between them and the low height setpoint is 5.0 or above. Now you will be able to use
the normal operation to do the setpoint changes needed for tuning.

In general, the procedure to obtain one trend plot is:


1. Use the PID block configuration screens to set the values of Kp, Ti, and Td.
2. Start the trend plot (you may want to wait until close to the time the height setpoint will
change).
3. Stop the trend plot when you see your results.
4. You may need to modify the X-Axis trend properties in order to see the entire results
5. Snip the plot if you need to include in the tuning results.

Height loop tuning results:


a. Trend of setpoint change of +1.0 and corresponding PV response for Kp=1.0, Ti=100.0
minutes, and Td=0.0 minutes.

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


Lab 2 - 6 EE 3340

b. Trend of PV that has sustained oscillations to a setpoint change of +1.0. Value of Kp that
causes the sustained oscillations.
c. Calculations for PI controller tuning parameters (Kp and Ti) using the Ziegler-Nichols
closed-loop tuning equations.
d. Trend of setpoint change of +1.0 and corresponding PV response for Kp and Ti
determined in part c.
The trends should be "snipped" from the screen and pasted into a Word document for
submission.

To define a new trend:


Right-click on Trends in Project tree
Name the trend.
Add tags. You should have at least [Link], and [Link]

To modify trend,
Right-click on trend
Select Chart Properties
Some useful parameters:
Display tab
Background: you may wish to change it to something else other than black
X-Axis tab
Time span: 30-60 seconds
Y-Axis tab
Preset: selected and set the min/max on the Pen properties
Isolated graphing: checked
Display scale: checked and 2 decimal places
Scale options: Each pen on independent scale
Sampling tab
Sample period: 10 milliseconds
Samples: 60000 minutes

To "snip" the trend,


Select the "Snipping Tool"
Click and drag the snipping rectangle to surround the trend

To save trend,
Click on the arrow beside Log in the trend menu bar
Select Save Trend Log As…
Can save in one of two formats, CSV for use in Excel for plotting, or TBS for use in
Studio/RSLogix5000

To run the trend,


Click on the "Run" button just above the trend plot on the left side.

To stop the trend,


Click on the "Stop" button just above the trend plot on the left side.

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


EE 3340 Lab 2 - 7

More information about using the trending tool can be found in Appendix B of
Motion System Tuning Application Techniques, Rockwell Automation, pub. MOTION-AT005C-
EN-P, which is also posted to Canvas with the lab exercise.

Disturbance Response
Complete the HMI changes before doing this part, as the HMI changes includes the two
pushbuttons you will need to use for this part.

Create a trend that shows the ball height, the controller output (in percent), and the value of
DAMP_CLOS. These signals should be separated (isolated graphing). Set the high and low
setpoints to the same value.

Set the high and low setpoints to the same value. Start the trend. Wait about 10 seconds. Press
the panel pushbutton that closes the damper for about 2 seconds. Watch the height drop and then
the fan speed should increase to compensate and the ball height should return to the setpoint.
Stop the trend, "snip" it and paste it into a Word document for submission.

Press the panel pushbutton that opens the damper to its full open position.

HMI Screen
Modify the C-More touch panel to add the following items:
Status indicators TEST_LA, NORMAL_LA, and LOW_SP_LA
Both setpoints (Height_SP_High and Height_SP_Low)
Ball height
Damper control buttons (to manually open/close)
A sample screen is shown in Figure 3. You are allowed freedom to implement the functions.
However, do not change the title bar, the run indicator, the start button, the stop button, or the
Setup button. The basic steps in modifying the screen are:
Define the tags and their relationship to the processor tags.
Add the objects and animate them with the tags.
Transfer the configuration to the panel

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


Lab 2 - 8 EE 3340

Figure 3. Possible completed operator touch panel showing added objects

Download the starting screen from Canvas. If at station 1, download "AirBall_Start_Sta1.eap9".


If at station 2, download "AirBall_Start_Sta2.eap9". Start the C-More Programming Software
by typing "C-More" in the search bar and select "C-more Programming Software Ver6.43" with
a dark icon containing a green "C". Close the opening "Start a Project" pop-up by clicking on
Cancel.

Open the starting project by clicking on the Open icon in the toolbar and navigating to the
starting project you just downloaded. Immediately save the project with a new name by selecting
File and then Save Project as. Type a file name and then click on Save.

First enter the database tags – Database -> Tag name database

Click on the "Add" icon. As an example, the information for the processor TEST_LA tag is
entered. In general, it is best to name the C-more HMI tag with the same name as the processor
tag. That is the way this example will be done. Also, the C-more tag names are all capital letters.

On the "Tag Name – Add" popup, enter the following information:


Device Name: CLOGIX30 (station 1) or CLOGIX40 (station 2)
Tag Name: TEST_LA
Tag Data Type: Discrete
PLC Address
Memory Type: BOOL
Address: TEST_LA

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


EE 3340 Lab 2 - 9

When finished, click on Add and then enter the information for the next tag. After adding the last
tag, click on Close.

Other tags to define


Tag Name Tag Data Type PLC Type PLC Address
NORMAL_LA Discrete BOOL NORMAL_LA
HMI_LOW_SP_LA Discrete BOOL HMI_LOW_SP_LA
HEIGHT_SP_HIGH Floating PT 32 REAL Height_SP_High
HEIGHT_SP_LOW Floating PT 32 REAL Height_SP_Low
HEIGHT_PV Floating PT 32 REAL [Link]

You will need to add two tags to the PLC processor, one that is an alternate control to close the
damper (in addition to the step control to close the damper), and another that is an alternate
control to open the damper (in addition to the step control to open the damper). Add these two
tags to the C-More tags.

Add the following objects to the screen.

"Test" text indicator


Object type: Triggered Text (Object -> Text -> Triggered Text)
Frame Type: None
Tag Name: TEST_LA
OFF Text: <blank>
Text Color : <your choice>
Back Color: white
ON Text: Test
Text Color : <your choice>
Back Color: <your choice>
Frame Type: None
Size frame to 2 squares high and 5 squares wide. May need to change font size

"Normal" text indicator


Same as "Test" with "Normal" as the ON Text

Low SP indicator
Object type: Indicator Light (Object -> Indicator -> Indicator Light)
Frame Type: None
Label: <checked>
"LOW SP" on two lines in label box
Position: Top
Text Color : <your choice>
Back Color: <your choice>
OFF Text: <blank>
Text Color : <your choice>
Back Color: <your choice> - color of indicator when tag is off
ON Text: <blank>

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


Lab 2 - 10 EE 3340

Text Color : <your choice>


Back Color: <your choice> - color of indicator when tag is on
Tag Name: HMI_LOW_SP_LA
Object Style: Style 2 (round)

Labels for numbers (3 labels)


Object type: Static Text (Object -> Text -> Static Text)
Transparent: <checked>
Frame Type: None
Text: <as shown>
Text Color : <your choice>
Back Color: <your choice>
Size frame to 2 squares high and 5 squares wide. May need to change font size

Numeric Entry for high and low height setpoints (2 objects)


Object type: Numeric Entry (Object -> Entry -> Numeric Entry)
Frame Type: None
Label: <unchecked>
Font & Color
Text Size: 9
Color: <your choice>
Back: <your choice>
Display Format
Data Type: Floating Point
Number of Digits
Total: 3 Fractional: 1
Justify: Leading Spaces
Range
Min: 0.0
Max: 14.0
Data Entry Tag
HEIGHT_SP_HIGH or HEIGHT_SP_LOW (whichever is appropriate)
Use Display Tag <unchecked>
Use Tag for Decimal Point <unchecked>
Keypad: System Default EA9

Numeric Display for current height


Object type: Numeric Display (Object -> Indicator -> Numeric Display)
Frame Type: None
Label: <unchecked>
Font & Color
Text Size: 9
Color: <your choice>
Back: <your choice>
Display Format
Data Type: Floating Point

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


EE 3340 Lab 2 - 11

Number of Digits
Total: 3 Fractional: 1
Justify: Leading Spaces
Data Display Tag
HEIGHT_PV

Damper Control – Damper Open


Object type: Pushbutton (Object -> Button -> Pushbutton)
Frame Type: None
Label: <unchecked>
OFF Text: "Damp Open" on two lines in label box
Text Color : <your choice>
Back Color: <your choice>
ON Text: "Damp Open" on two lines in label box
Text Color : <your choice>
Back Color: <your choice> - make different from OFF Text so user has visual
feedback of button press
Tag Name: <Whatever you named it>
Object Style: Style 2 (round)
Object Type: Momentary On

Damper Control – Damper Close


Same as Damper Open button except "Damp Open" as text and use appropriate tag

Now load the configuration to the panel, over the USB cable:
Click on the “Send” button in the toolbar
Select “USB” if not selected already.
Click on Transfer
Project is transferred to panel

Important Information
Follow the directions in the “Starting Your Project” section to start your project.
You will need to solve the problem of initializing the setpoint. The S:FS bit is an internal
flag that indicates the first time a program is being scanned.
Remember, attempting to utilize the same ordinary output address on more than one rung
will result in incorrect operation unless you use the latch/unlatch output instructions. If you use
the same ordinary (unlatched) output instruction more than once, it is usually never energized at
any time.

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


Lab 2 - 12 EE 3340

Input/Output Definitions

Inputs
HMI_START_PB N. O. touch panel button, On when starting system
HMI_STOP_PB N. C. touch panel button, Off when stopping
HEIGHT_MEAS Ball height transmitter reading, represents 0 to 12.5 inches; Range:
7.8125 to 62.5

Outputs
RUN_LA On when operation is running. DO NOT use this tag as an
internal "Run" coil.
TEST_LA On when system is in steps where operation is being tested, before
normal operation
NORMAL_LA On when system is controlling ball height, alternating between the
high and low setpoints.
LOW_SP_LA On when low setpoints are being moved to the PID controllers.
When off, the high setpoints are being moved to the PID
controllers. This lamp does not indicate that the operator is
changing a low setpoint.
DAMP_OPEN On to open inlet damper
DAMP_CLOS On to close inlet damper
FAN_SPEED Fan speed, 0-100%; Range: 0 to 100

Internal Memory Used by PID Control Loop


[Link] Height loop auto/manual mode, ON whenever the controller is
stopped, OFF when it is running (write by ladder)
[Link] Setpoint for height PID controller (write by ladder), range 0 to 12.5
(inches)
[Link] Height measurement in inches.
Height_Tieback Output of height PID controller (write by ladder) when [Link]
is on, range 0 to 100.
PID_TMR Timer that initiates the PIDs every 0.1 seconds.

Other Internal Memory


Height_SP_High High height setpoint
Height_SP_Low Low height setpoint

I/O Addresses
Tag
HEIGHT_MEAS Local:3:[Link]

DAMP_OPEN Local:2:[Link]

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


EE 3340 Lab 2 - 13

DAMP_CLOS Local:2:[Link]
FAN_SPEED Local:4:[Link]

Internal memory already defined


Tag Data type
Height PID

Control Logix PID Implementation Details


All process variable values are scaled by the analog input module to be in the range of 0
to 100. These values are scaled by the PID block to the proper units. The corresponding setpoints
are in units of the scaled process variables. All controlled variable (controller output) values are
in the range of 0 to 100.
Note that the .MO bit for all PID structures must be controlled by your ladder to make the
PID loops operate as needed.
When a PID controller is not on (in manual mode), the output that it controls should
be in a steady state. So, if Height (the height PID controller) is not on, then the fan speed should
be at a set constant value. To do this, the Height_Tieback tag needs to be set to a constant. The
Height PID block scales the height measurement to the range of 0 to 12.5, which is accessed as
[Link].
When the operation is stopped (not running), the fan must also not be running, which
means the controller output (FAN_SPEED) must be zero when the operation is paused.
An example ladder logic with the PID controller is shown in Figure 4. A block diagram
of the PID loop, identifying the inputs and outputs that need to be accessed by your ladder logic
is shown in Figure 5.

Use these fields in the PID structure to control PID loops


.MO Loop software auto/manual mode, ON whenever the controller is disabled
(manual mode), OFF when controller is enabled (automatic mode); write by
ladder.
.SP Setpoint for loop, range is the appropriate scaled units for all loops; write by
ladder.

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


Lab 2 - 14 EE 3340

Starting Your Project


In addition to adding the analog modules, you need to import two routines: “MapInputs”
that transfers the discrete and analog input channel values into the proper input tags and
“MapOutputs” that transfers the proper output tags to the discrete and analog output channels.
These two routines essentially define the I/O addresses as listed below. You will also define a
routine in which you will program the ladder logic for the exercise. Procedure:
1. Download the “MapInputs_Routine_RLL.L5X” file and the
“MapOutputs_Routine_RLL.L5X” file from Canvas. Download the database of tags,
“[Link] from Canvas.
2. Start the project as outlined in section B of the Studio 5000 documentation. Add the
discrete input and discrete output modules.
3. Set the Ethernet/IP Mode to “A1/A2: Linear/DLR” as follows:
Right-click the top line of the project tree “Controller Organizer”
Select Properties
Click on the Change IP Mode button (lower right)
If the current mode is “A1/A2: Dual-IP”, click on the down arrow and select
A1/A2: Linear/DLR
Click on OK
Click on OK
4. Add the analog input and output modules as follows

Module Slot Notes


5069-IY4 3 On Device Definition popup
Revision: 2.001
Connection is "Data"
Input Data is “Analog Data”
After specifying the data format, click on OK
“Channels” should appear in the left side. Expand it to show “Ch00”
through “Ch03” below it.
Click on the “Ch00” entry to configure channel 0.
Set the parameters to the following
Input Type: Voltage (V)
Input Range: 0 to 10 V
High Signal: 10
High Engineering: 100
Low Signal: 0
Low Engineering: 0
Click on the “Alarm” entry below “Ch00”
Set the “Disable All Alarms” box for channel 0.
Click on OK.

5069-OF4 4 On Device Definition popup


Revision: 2.001
Connection is "Data"

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


EE 3340 Lab 2 - 15

Output Data is “Analog Data”


After specifying the data format, click on OK
“Channels” should appear in the left side. Expand it to show “Ch00”
through “Ch03” below it.
Click on the “Ch00” entry to configure channel 0.
Set the parameters to the following
Output Type: Voltage (V)
Output Range: -10 to 10 V
High Signal: 10
High Engineering: 100
Low Signal: 0
Low Engineering: 0
Click on the “Limits” entry below “Ch00”
Set the parameters to the following for channel 0:
High Clamp: 10.0
Low Clamp: 0
Disable All Alarms checked
Click on Apply after entering the channel settings.
Click on OK.

When you are finished, it should look like:

5. Import the MapInputs routine.


a. Right-click on MainProgram
b. Select “Add” then “Import Routine”
c. Browse to MapInputs_Routine_RLL.L5X and click on it so the name appears
in the “File name:” box
d. Click on Open
e. Check that the entries on the pop-up are as follows:
Operation: Create
Final Name: MapInputs
In Program: MainProgram
f. Click on OK
g. The routine is imported, placed in the MainProgram and the internal tags
associated with the inputs are also imported.

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


Lab 2 - 16 EE 3340

6. Import the MapOutputs routine with the same procedure as for the MapInputs routine,
except the imported file name is MapOutputs_Routine_RLL.L5X and the final name
is “MapOutputs”
7. Add a “AirBall” routine:
a. Right-click on MainProgram
b. Select “Add” then “New Routine”
c. Fields should be:
Name: “AirBall”
Type: Ladder Diagram
In Program: MainProgram
d. Click on OK

8. To the MainRoutine, add 3 JSR blocks as shown below.

9. To import the other tags from a .CSV (comma separated variable) file:
a. From the main menu select Tools.
b. Select Import and then Tags and Logic Comments...
c. An Import Tags window will appear. Select the following:
Files of Type - CSV
Select the appropriate file – “[Link]”.
On Collisions: - Create New Tags & Overwrite Existing Tags
d. Click on Import
e. The addresses and tags are imported.
f. A window showing the status of the import will be displayed. Click on OK
when finished.
10. Put your ladder logic in the “AirBall” routine

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


EE 3340 Lab 2 - 17

Setting Up the PID Controllers


Enter the two PID block instructions, as shown in Figure 2.
Append PID instruction. To append a PID instruction to the current rung (while
editing):
Click on the Special instruction tab
Click on PID
A PID instruction box will appear.
Fill in the other fields as they appear in the listing
Click on the button to the right of the PID block. A configuration screen should appear.
Fill in the information for the PID controller setup tabs as shown below.
Click on the OK button of the configuration screen to close it.

PID Instruction Configuration Data. The operands and configuration for the PID
loops is shown below:

Height PID Instruction Operands


PID Height
Process Variable HEIGHT_MEAS
Tieback Height_Tieback
Control Variable FAN_SPEED
PID Master Loop 0
Inhold Bit 0
Inhold Value 0

Height PID Instruction Configuration Data


Configuration tab (do this first)
PID Equation: Dependent
Control Action: SP-PV
Derivative Of: PV
Loop Update Time [secs]: 0.1
CV High Limit: 100
CV Low Limit: 0
Deadband Value: 0

Tuning tab
Output Bias: 0 Software Manual: unchecked
Proportional Gain (Kc): 0.7
Reset time (Ti) [min/repeat]: 0.1
Derivative Time (Td) [min]: 0

Alarms tab
Process Variable (PV) High: 90
Process Variable (PV) Low: 10

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


Lab 2 - 18 EE 3340

Process Variable (PV) Deadband: 10


Positive Deviation: 10
Negative Deviation: 10
Deviation Deadband: 4
Deadband Value: 0

Scaling tab
Process Variable
Unscaled Max: 62.5 Engineering Unit Max: 12.5
Unscaled Min: 7.81 Engineering Unit Min: 0.0
Control Variable Tieback
Max (at 100%): 100 Max (at 100%): 100
Min (at 0%): 0 Min (at 0%): 0

PID Initialized: checked

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]


EE 3340 Lab 2 - 19

Figure 4. PID function block.

Fig 5. Block diagram representation of height PID loop.

COPYRIGHT © 2021-26, Kelvin T. Erickson [Link]

You might also like