Air Ball CLogix PIDTune Lab 2 SP 26
Air Ball CLogix PIDTune Lab 2 SP 26
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.
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.
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:
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.
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.
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 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 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
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
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.
When finished, click on Add and then enter the information for the next tag. After adding the last
tag, click on Close.
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.
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>
Number of Digits
Total: 3 Fractional: 1
Justify: Leading Spaces
Data Display Tag
HEIGHT_PV
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.
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
I/O Addresses
Tag
HEIGHT_MEAS Local:3:[Link]
DAMP_OPEN Local:2:[Link]
DAMP_CLOS Local:2:[Link]
FAN_SPEED Local:4:[Link]
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
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
PID Instruction Configuration Data. The operands and configuration for the PID
loops is shown below:
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
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