You are on page 1of 24

Refrigeration, Air Conditioning, and Heating

Courseware Sample

85055-F0

REFRIGERATION, AIR CONDITIONING, AND HEATING

COURSEWARE SAMPLE

by the Staff of Lab-Volt Ltd.

Copyright 2008 Lab-Volt Ltd. All rights reserved. No part of this publication may be reproduced, in any form or by any means, without the prior written permission of Lab-Volt Ltd.

Printed in Canada May 2008

Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Courseware Outline Familiarization with the Air Handling / Energy Management Training System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VII Sample Exercise Extracted from Familiarization with the Air Hangling / Energy Management Training System Ex. 6 PID Control of Temperature and Humidity . . . . . . . . . . . . . . . . . . . 3

III

IV

Introduction
The Lab-Volt Model 3403 Air Handling / Energy Management Training System is designed to introduce students to the principles and components of air handling and energy management, and help students develop an appreciation for the method of control. The trainer is controlled mainly by an Allen-Bradley Programmable Logic Controller (PLC). Access to the PLC is obtained through a personal computer. Instruction on energy management and optimizing system efficiency is provided through the PLCs programming.

VI

Courseware Outline
FAMILIARIZATION WITH THE AIR HANDLING / ENERGY MANAGEMENT TRAINING SYSTEM Introduction Exercise 1 Exercise 2 Exercise 3 Exercise 4 Exercise 5 Exercise 6 Appendices Air Flow Control Temperature Control Humidity Control The Programmable Logic Controller Supervisory Control and Data Acquisition (SCADA) PID Control of Temperature and Humidity A Setting up the Air Handling / Energy Management Training System B Maintenance C Controls, Indicators, and Connectors D PLC Inputs, Outputs, Addresses, and Symbols E Control of Duct Elements F Fault Switches G Temperature Conversion H Boolean Algebra and Digital Logic I The Refrigeration Cycle J Glossary of Terms

We Value Your Opinion!

VII

Sample Exercise Extracted from Familiarization with the Air Handling / Energy Management Training System

Exercise PID Control of Temperature and Humidity


OBJECTIVE

Become familiar with PID control of temperature and humidity in a zone using a PLC.

DISCUSSION In an on-off control system, a controller (thermostat, humidistat, etc.) is used to maintain the process variable (temperature, humidity, etc.) near the desired setpoint. The controller switches its output when the process variable crosses the setpoint. Since the controlled element is either on or off, the process variable cycles continually, going from below the setpoint to above and below again. PID Controller A PID (Proportional, Integral, Derivative) controller offers much more precise control of the process variable. A PID control loop functions in three steps: 1. Measurement of the process variable (PV) by a sensor; 2. Calculations in a controller element; 3. Action through a controlled variable (CV) such as a damper opening. With this type of controller, the output, or controlled variable (CV), is an analog value determined using the PID equation. The general form of this equation is Output = Proportional term + Integral term + Derivative term The control loop of a typical PID controller is presented in the diagram block of Figure 6-1. In this loop, the controller subtracts the sensor measurement from the setpoint to determine the error (E). The error is then used in the proportional, integral, and derivative terms of the PID equation to obtain a correction to the controlled variable. Each term (P, I, or D) serves a specific purpose: Proportional (P): determines the reaction to the current error. Note that proportional control alone will never reach the setpoint. A steady-state error remains that is a function of the proportional gain. Integral (I): determines the reaction to recent errors. This term provides an output that is function of the accumulated error over time. It forces the signal to reach the setpoint quicker than proportional controller alone and eliminates the steady-state error. However, the process tends to overshoot the setpoint. Derivative (D): determines the reaction to the rate by which the error changes. As the process variable approaches the setpoint, the error will diminish more slowly. This braking effect is used to reduce the magnitude of

PID Control of Temperature and Humidity


the overshoot produced by the integral component, but the process variable becomes slower to reach the setpoint.
Note: PI, PD, P, or I controllers can be obtained from a PID controller by setting the undesired control gains to zero.

Figure 6-1. PID Controller Diagram.

The proportional, integral, and derivative terms must be individually adjusted, or "tuned" to the system being controlled. This is usually done using a trial and error method. When properly tuned, the controller should maintain much more accurate and stable control of the process variable than an on-off type controller, and should respond rapidly to changes in setpoint and load without excessive cycling of the process variable about the setpoint. PID Instruction in a Ladder Program In RSLogix 5 ladder programs, a PID instruction exists that can be used for PID process control. The process and controlled variables are identified directly in the instruction box, as shown in Figure 6-2. The setpoint and the three constants are stored in the control block, a file reserved for controlling the PID instruction.

PID Control of Temperature and Humidity

Figure 6-2. PID Instruction Box.

The PID instruction samples the process variable at regular intervals. For each sample, it determines the error, or difference between the setpoint and the process variable. The error is used in the PID equation to calculate the controlled variable. PID control of both temperature and humidity is performed in this exercise using the independent gains form of the PID equation. For temperature control, the process variable is the ZONE 1 THERMOCOUPLE level (Z1_TC) and the controlled variable is the REHEATER analog output (REHEAT_AN). The equations used are then:

where E(t) SP PV(t) CV(t) Kp Ki Kd dt

is the error; is the setpoint; is the process variable; is the controlled variable (output); is the proportional gain constant; is the integral gain constant; is the derivative gain constant; is the time between samples.

For humidity control, the process variable is the ZONE 1 relative humidity (Z1_HUM) and the controlled variable is the HUMIDITY DAMPER (HUMID_DMP). Because the damper uses reverse control, (0% = OPEN, 100% = CLOSED), the error is obtained by subtracting the process variable from the setpoint. A bias is added so that the damper is closed by default. The equations used are then:

Scaled and Unscaled Data The PID instruction must use "unscaled" data from the analog input modules. In the PLC Programming Software, unscaled data is defined as data that ranges from 0 to 4095. In contrast, data from the thermocouples is "scaled" because it can range from -200 to 1200C. Humidity data is also scaled because it can range from 0 to 100%.
5

PID Control of Temperature and Humidity


The descaling calculations are performed using FAL (File Arithmetic and Logic) instructions. These calculations make use of the scaled minimum and maximum values of the input data, Smin and Smax, as defined below. To descale the thermocouple inputs, the following calculation is performed:

where TCU TCS Smin Smax

is the unscaled thermocouple value (range: 0 to 4095); is the scaled thermocouple value (range: -200 to 1200); is the scaled minimum value (-200); is the scaled maximum value (1200).

To descale the relative humidities, the following calculation is performed:

where HUMU HUMS Smin Smax PROCEDURE Setup

is the unscaled relative humidity (range: 0 to 4095); is the scaled relative humidity (range: 0 to 100); is the scaled minimum value (0); is the scaled maximum value (100).

1. Make the following adjustments: POWER PANEL: POWER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OFF EXTERIOR AIR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . WINTER POWER CONSUMPTION recorder POWER . . . . . . . . . . . . . ON POWER CONSUMPTION recorder CHART . . . . . . . . mid. pos. PLC-5: POWER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ON KEY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . REM

PID Control of Temperature and Humidity


THERMOSTATS: SUMMER (back) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80F (27C) WINTER (back) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50F (10C) MANUAL DAMPERS: INLET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OPEN CONTROL PANEL DUCT ELEMENTS: PREHEATER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HUMIDIFIER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . COOLER/DEHUMIDIFIER . . . . . . . . . . . . . . . . . . . . . . REHEATER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . REMOTE REMOTE REMOTE REMOTE

AIR FLOW: BLOWER SPEED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MANUAL HUMIDIFIER DAMPER . . . . . . . . . . . . . . . MANUAL (CLOSED) ZONE 1 DAMPER . . . . . . . . . . . . . . . . . . . . . MANUAL (OPEN) ZONE 2 DAMPER . . . . . . . . . . . . . . . . . . . . . MANUAL (OPEN) RECIRC. DAMPER . . . . . . . . . . . . . . . . . . MANUAL (mid. pos.) ZONE 1 AND ZONE 2: THERMOSTAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . REMOTE HUMIDISTAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . REMOTE HEAT SOURCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OFF

G G

2. Place the POWER switch in the I (ON) position. 3. Adjust the BLOWER SPEED to obtain a velocity pressure of 1" on MANOMETER 3. Balance the system to ensure equal air flow in the two zones (as in Exercise 1) and do the following adjustments: AIR FLOW: ZONE 2 DAMPER . . . . . . . . . . . . . . . . . . . MANUAL (CLOSED)

4. Turn on the computer, the monitor, and the printer. Start the RSLogix 5 Programming Software.

Ladder Program for PID Control

5. Open the program PID_Z1.RSP, download it in the PLC memory, and put the PLC in REMOTE PROG mode. This program provides PID control of temperature and humidity in ZONE 1.

PID Control of Temperature and Humidity


Examine the listing to understand how the program operates. This program has two PID instructions: one for temperature and one for humidity (rungs 13 and 14). FAL instructions are used to descale input data (rungs 9, 10, and 11).
Note: Those three FAL instructions descale more than one word at a time. For instance, N:10:11 (Z1_TC) becomes N17:9 when descaled, because the FAL instruction is applied to six consecutive words.

6. Make sure that all addresses in the PID boxes are set correctly: Zone1 Temperature PID Control Block Process Variable Tieback Control Variable Zone 1 Humidity PID Control Block Process Variable Tieback Control Variable N21:0 N17:12 0 N13:6 N22:0 N17:9 0 N13:7

7. Double-click "Setup Screen" in the first PID instruction box (rung 13). This PID instruction controls the temperature in ZONE 1. Figure 6-3 shows what this window should look like.

Figure 6-3. Setup Screen of the Temperature PID Instruction.

PID Control of Temperature and Humidity


Note: Values on the Setup Screen can also be found in the file identified as "Control Block". File N22, for instance, stores information about the ZONE 1 temperature PID instruction.

Double-click "Setup Screen" in the second PID instruction box (rung 14). This PID instruction controls the humidity in ZONE 1. Figure 6-4 shows what this window should look like.

Figure 6-4. Setup Screen of the Humidity PID Instruction.

8. On the Air Handling / Energy Management Training System, set the HUMIDIFIER DAMPER to REMOTE and put the PLC in REMOTE RUN mode. 9. On the computer screen, reopen the first PID setup screen(temperature). Change the temperature (scaled) setpoint to 30. Since error is set to 0 (SP-PV) the following relation should hold: ES = SPS - PVS

where ES is the scaled error; SPS is the scaled setpoint (displayed as "(Scaled) Setpoint"); PVS is the scaled process variable (displayed as "Scaled PV Value").

PID Control of Temperature and Humidity


This relationship also holds for the unscaled values, although these are not displayed in the setup screen: EU = SPU - PVU where EU is the unscaled error; SPU is the unscaled setpoint; PVU is the unscaled process variable.

G 10. Change the proportional gain Kp to 10.00. (Since the multiplier, in square
brackets, is .01, you must enter 1000.) Note the current controlled variable expressed in percent: Current CV % = Knowing the scaled error value (ES), verify that your measure is correct. Use the following calculations: EU = SPU - PVU = [(SPS + 200) x 2.925] - [(PVS + 200) x 2.925] = 2.925 x (SPS - PVS) = 2.925 x ES Since Kp = 10 and Ki = Kd = 0, CVU = Kp x EU = 10.00 x EU Finally, CV % = CVU / 4095 x 100% For example, if the scaled error is equal to 8 and Kp = 10.00, then EU CVU = 2.925 x 8 = 23.4 = Kp x Eu = 234

CV % = (234 / 4095) x 100% . 6% What value of CV % do you calculate? CV % = Is this value equal to the displayed value of CV %?

G Yes

G No

G 11. Increase the proportional gain Kp to 50.00 (enter 5000). Once the process
variable has stabilized, the error should be less than with Kp = 10.00.

10

PID Control of Temperature and Humidity


Increase Kp to 100.00. Note that with proportional control only (Ki = Kd = 0), increasing the gain Kp decreases the error but does not eliminate it.
Note: As the CV % increases, the REHEATER pilot lamp flashes on for a longer portion of its cycle.

Using the SCADA Program for Proportional Control

G 12. Start RSView32 software. Open the file 3403.RSV and run the project.
On the main window, click "PID Control". The window of Figure 6-5 should appear. In this window, you can modify the temperature and the humidity setpoints, as well as the proportional, integral, and derivative gain constants.

Figure 6-5. PID Control Window in RSView32.

Study the display to understand how the temperature control loop operates. The proportional, integral, and derivative gain constants for this loop are
11

PID Control of Temperature and Humidity


identified as TEMP_KP, TEMP_KI, and TEMP_KD, respectively. These are entered as whole numbers, which are multiplied by the indicated factors to obtain the actual constants: TEMP_KP: 0.01 TEMP_KI: 0.001 / secs TEMP_KD: 0.01 secs HUM_KP: 0.01 HUM_KI: 0.001 / secs HUM_KD: 0.01 secs

G 13. Set all gain constants to 0. The temperature process variable, setpoint, and
output (control variable) are identified as TEMP_PV, TEMP_SP, and TEMP_OUT, respectively. The process variable is equal to the ZONE 1 thermocouple reading (Z1_TC). The setpoint should presently be equal to 30. The output should be zero, since the gains are all zero.

G 14. Enter 10000 for TEMP_KP (equivalent to Kp = 100.00). Note that the
REHEATER begins heating. The process variable TEMP_PV will begin to increase slowly. Go to the "Trend" window, adjust the Y-Axis, and note near what value the Zone 1 Thermocouple stabilizes.

Observe that, as the process variable approaches the setpoint, the output (control variable) decreases. This is because the control equation for the system is presently CV = Kp x E = Kp(SP-PV) where CV Kp E SP PV is the output (control variable); is the proportional gain; is the error; is the setpoint; is the process variable.

When the system is stable, observe that there is a gap (error) between the process variable and the setpoint. Change TEMP_KP back to 0 and wait until the process variable is stable.

G 15. Go back to the PID Control window and change the proportional gain
constant TEMP_KP to 150.00 (enter 15000).
12

PID Control of Temperature and Humidity


Return to the trend window and observe near what value the Zone 1 Thermocouple stabilizes.

Note: Increasing the proportional gain should decrease but not eliminate the error.

Change TEMP_KP back to 0 and wait until the process variable is stable. Integral Control

G 16. Change the integral gain to 1.000 (enter 1000), and go to the trend window.
Observe the trend until the process variable is stable. Note that the process variable first overshoots the setpoint, then decreases. Note also that it takes a long time for the system to stabilize, but when it does, there is practically no error. Return to the PID Control window. Change the integral gain to 0 and wait until the process variable is stable. Change the integral gain to 5.000 (enter 5000), and return to the trend window. Observe that the stabilization time is shorter with a higher gain, but the overshoot is greater. There may also be an undershoot before the process variable stabilizes.

G 17. Experiment with various combinations of proportional, integral, and


derivative gains. Try to obtain the combination that provides the most rapid stabilization with the least overshoot.
Note: The maximum value you can enter for the proportional, integral, or derivative gain is 32767.

Humidity Control

G 18. In the PID Control window, set all six proportional, integral, and derivative
gains to 0.

G 19. Observe the display to understand the operation of the humidity loop. Since
the damper uses reverse control (0% = OPEN, 100% = CLOSED), the error is obtained by subtracting the process variable from the setpoint. A bias is added at the output of the PID instruction to close the damper by default.
Note: The bias is identified as "Feed Forward" in the humidity Setup Screen of the ladder program.

Set the humidity setpoint to slightly higher that the present value of the process variable. Then experiment with different gains. You can use the Trend window to observe the evolution of the ZONE 1 humidity.
13

PID Control of Temperature and Humidity

Temperature and Humidity Control

G 20. Set the gains in both loops to control temperature and humidity
simultaneously. Experiment with different gains, using theTrend window to monitor the system behavior.

G 21. Place the POWER switch in the 0 (off) position. Turn off the computer and
the printer. CONCLUSION In this exercise, you learned how to use a PID instruction in a ladder diagram for proportional, integral, and derivative control of a process variable. You also used the SCADA program to tune the proportional, integral, and derivative gain constants for temperature and humidity control.

14