® Applications Guide PID Control in Tracer Controllers CNT-APG002-EN
® Applications Guide PID Control in Tracer Controllers CNT-APG002-EN October 2001
PID Control in Tracer Controllers This manual and the information in it are the property of American Standard Inc. and shall not be used or reproduced in whole or in part, except as intended, without the written permission of American Standard Inc. Since The Trane Company has a policy of continuous product improvement, it reserves the right to change design and specification without notice. The Trane Company has tested the system described in this manual.
® Contents Chapter 1 Overview of PID control. . . . . . . . . . . . . . . . . . . . . . 1 What PID loops do . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 How PID loops work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 PID calculations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Proportional calculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
® Contents Chapter 4 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Discharge-air temperature control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Building pressure control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Cascade control—first stage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Staging cooling-tower fans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
® Chapter 1 Overview of PID control This guide will help you set up, tune, and troubleshoot proportional, integral, derivative (PID) control loops used in Tracer controllers. These controllers include the Tracer MP580/581, AH540/541, and MP501 controllers. This chapter provides an overview of PID control.
® Chapter 1 Overview of PID control How PID loops work A PID loop performs proportional, integral, and derivative calculations to calculate system output. Figure 2 illustrates how a typical PID loop works. The sigma (Σ) symbol indicates that a sum is being performed. The plus (+) symbol indicates addition, and the minus (–) symbol indicates subtraction.
® PID calculations PID calculations A PID loop performs three calculations: the proportional calculation, the integral calculation, and the derivative calculation. These calculations are independent of each other but are combined to determine the response of the controller to the error. Proportional calculation The proportional calculation responds to how far the measured variable is from the setpoint. The larger the error, the larger the output of the calculation.
® Chapter 1 Overview of PID control Figure 4: The effects of proportional bias on system output Controller output (%) Proportional bias = 75 Proportional bias = 50 Proportional bias = 25 Error Integral calculation The integral calculation responds to the length of time the measured variable is not at setpoint. The longer the measured variable is not at setpoint, the larger the output of the integral calculation.
® PID calculations Figure 5: Integral output added to proportional output Output Error ≠ 0 Error = 0 Proportional + integral output Proportional + integral output when proportional output has gone to zero 2 1 Proportional-only output Time The value of the integral calculation can build up over time (because it is the sum of all past errors), and this built-up value must be overcome before the system can change direction.
® Chapter 1 Overview of PID control Because of these disadvantages, derivative control is rarely used in HVAC applications (with the exception of steam valve controllers and static pressure control). Derivative control can affect the output in two ways: it slows the output if the derivative gain is negative and increases the output if the derivative gain is positive.
® Velocity model Velocity model Trane controllers use a type of PID control known as the velocity model. The velocity model minimizes the problem of integral windup, which occurs when the sum of past errors in the integral calculation is too great to allow the controller to change the output at one of the extremes (see “Integral calculation” on page 4).
® Chapter 1 Overview of PID control 8 CNT-APG002-EN
® Chapter 2 PID settings This chapter describes some of the key variables used to set up and tune PID loops. The variables discussed here are: • • • • • Throttling range Gain Sampling frequency Action Error deadband Throttling range The throttling range is the amount of error it takes to move the output of a system from its minimum to its maximum setting. For example, a throttling range of 4°F (2.2°C) means that a controller fully opens or closes an actuator when the error is ±2°F (1.
® Chapter 2 PID settings The throttling range determines the responsiveness of a control system to disturbances. The smaller the throttling range, the more responsive the control. You cannot directly program the throttling range in Tracer controllers; rather, the throttling range is used to calculate the gains. Figure 9 shows that as the throttling range increases, the potential error becomes larger. When the output is at 0% or 100%, the error is equal to one-half of the throttling range.
® Calculating the gains Calculating the gains Table 1 shows recommended initial values for the proportional and integral gains for several applications. Most applications do not require a derivative contribution, so the derivative gain is not shown. We recommend using a ratio of 4:1 between the proportional and integral gains, so the proportional gain should be four times as large as the integral gain.
® Chapter 2 PID settings Sampling frequency The sampling frequency is the rate at which the input signal is sampled and the PID calculations are performed. Using the right sampling frequency is vital to achieving a responsive and stable system. Problems can arise when the sampling frequency is too slow or too fast in comparison to time lags in the system.
® Sampling frequency Problems also arise from sampling too quickly. Some systems have naturally slow response times, such as when measuring room temperature. Slow response times can also be caused by equipment lags. Since PID loops respond to error and changes in error over time, if the measured variable changes slowly, then the error will remain constant for an extended period of time.
® Chapter 2 PID settings Calculating the sampling frequency PID loops are carried out by programs, such as process control language (PCL) programs and Tracer graphical programming (TGP) programs. Since the PID calculation occurs when the program executes, the sampling frequency and the program execution frequency are generally the same. Note: Tracer controllers have different approaches to using the sampling frequency.
® Calculating the sampling frequency 6. Calculate two-thirds (66%) of the change in measured variable determined in step 4. Add this value to the initial temperature to determine at what point two-thirds of the total change occurs. In the example, 0.66 × 50°F = 33°F, so two thirds of the total change occurs at 70°F + 33°F = 103°F (0.66 × 28°C = 18°C; 21 + 18 = 39°C). 7. Again, set the analog output to 0% and allow the measured variable to stabilize. The measured variable stabilizes at 70°F (21°C). 8.
® Chapter 2 PID settings Example In this scenario, we want to find the sampling frequency for a PID loop controlling a heating application. 1. Fully close the output. 2. The stabilized temperature is 60°F (16°C). 3. Fully open the output. 4. The stabilized temperature is 105°F (41°C). 5. The change in temperature is 105°F – 60°F = 45°F (41 – 16 = 25°C). 6. Two-thirds of the change in measured variable is 0.
® Action Action The action of a PID loop determines how it reacts to a change in the measured variable (such as a room temperature). A controller using direct action increases the output when the measured variable increases. A controller using reverse action decreases the output when the measured variable increases. Direct action Figure 14 shows the temperature when a system is cooling a space. When the error is large and the PID output is at 100%, the actuator and valve combination are fully open.
® Chapter 2 PID settings Determining the action Table 3 shows the action settings for several applications. These settings are a good starting place for most applications.
® Error deadband Error deadband Error deadband is typically used to minimize actuator activity. It can also be used to allow for some slack in system sensors and actuator mechanics. Error deadband prevents the PID output from changing when the absolute value of the error is less than the error deadband. For example, in Figure 16 the error deadband is set at 2.0°F (1.1°C). As long as the absolute value of the error is less than the 2.0°F (1.1°C), the PID output cannot change.
® Chapter 2 PID settings Adjusting error deadband for modulating outputs In most applications, start with an error deadband of five or ten times the sensor resolution. For example, thermistors have a resolution of approximately 0.1°F (0.06°C), so 0.5°F (0.3°C) is an appropriate error deadband. This error deadband ensures that the sensor reading has changed an adequate amount before the controller responds.
® Other PID settings With the preceding guidelines in mind, use the following procedure to determine error deadband. To adjust the error deadband for staged outputs: 1. Run the system manually. If possible, do so under worst case conditions for the site. Although it is not always possible for a technician to do this, it is possible for a well-trained customer. 2.
® Chapter 2 PID settings 22 CNT-APG002-EN
® Chapter 3 Programming PID loops This chapter presents programs written in process control language (PCL) and the Tracer graphical programming (TGP) editor. This chapter does not discuss how to use the PCL or TGP editors. For information on using these editors, refer to Universal Programmable Control Module (UPCM) Programming Guide (EMTX-PG-5), Programmable Control Module (PCM) Edit Software Programming Guide (EMTX-PG-6), and Tracer Graphical Programming applications guide (CNT-APG001-EN).
® Chapter 3 Programming PID loops Table 6: PID settings in PCL DDC LOOP # 4 HEAT VALVE -----------PROPORTIONAL GAIN 4.00 INTEGRAL GAIN 1.00 DERIVATIVE GAIN 0.00 ACTION REVERS PROPORTIONAL BIAS 0.0 MINIMUM OUTPUT VALUE 0.0 MAXIMUM OUTPUT VALUE 100.0 ERROR DIFFERENTIAL 0.5 Follow these steps to program PID loops in PCL: 1. Make sure that the setpoint is within reasonable limits.
® Programming in PCL Table 7: PCL program for PID loops Line ---- Result 1st Arg -------- Operator 2nd Arg --------- -------- --------- 1 CALC_SP = ROOM_SP MIN *80.0 2 CALC_SP = CALC_SP MAX *65.0 3 PID_CALC = AIP1 DDC:1 CALC_SP 4 *L1 = NOT FAN_ON 5 *L2 = AIP1 FAIL 6 *IFT = *L1 OR 7 PID_CALC = *-10.
® Chapter 3 Programming PID loops Programming in TGP Figure 17 shows the PID block used to program PID loops in TGP editor. The PID block is more flexible than the DDC function in PCL. The enable/ disable and failure inputs can accept any binary value, regardless of source. The setpoint, measured variable, p-gain, i-gain, and d-gain inputs can accept any analog value, except analog outputs, including variable (local or from a BAS), hardware input, and network input.
® Programming in TGP Follow these steps to program PID loops in TGP: 1. Use the Limit block to make sure that the setpoint is within reasonable limits. 2. Run the PID calculation. 3. Define failure and other operation-dependent conditions. Check for fan-status and measured-variable input failures. Program sensible actuator positions or behavior for these conditions.
® Chapter 3 Programming PID loops 28 CNT-APG002-EN
® Chapter 4 Applications This chapter describes several HVAC applications that use PID control. It includes specific settings and recommendations for each application. Discharge-air temperature control When controlling hot/chilled-water valves in discharge-air applications, a PID loop controls the position of a valve to increase or decrease the flow of hot or chilled water. This section focuses on control of hot-water valves, but control of chilled-water valves is almost identical.
® Chapter 4 Applications Figure 20 shows a TGP program to control a hot-water valve. Output Status 1 (an analog output) provides the position of the chilled-water valve. If the chilled-water valve position is greater than zero, the hot-water valve will not open.
® Discharge-air temperature control After the initial installation and testing, the technician noticed that the discharge-air temperature was oscillating in a 10°F (5.6°C) band around setpoint. Slowing the sampling frequency to 30 seconds stopped the oscillations (see Chapter 5, “Troubleshooting”). The technician also increased the proportional and integral gains to make the discharge-air temperature reach setpoint faster.
® Chapter 4 Applications Building pressure control Space pressure is typically controlled by opening and closing relief dampers. A PID loop controls these dampers based on a space pressure setpoint and the measured space pressure. The space pressure in the building should remain slightly positive to keep dust particles out, but not so positive that outside doors are difficult to open. Table 11 shows a PCL program to control a relief damper. Figure 22 shows the same program in TGP.
® Building pressure control Table 12 lists the settings for the PID loop controlling building pressure. The sampling frequency is slow because building pressure changes slowly. For programs written in PCL, the error deadband is 1.0, which is equal to 100 times the minimum resolution of the pressure sensor. Table 12: Settings for building pressure control PID setting Initial value Proportional gain 4.0 Integral gain 1.0 Derivative gain 0.0 Error deadband PCL: 1.0, TGP: 0.
® Chapter 4 Applications Cascade control—first stage A PID loop can be used to automatically determine a discharge-air temperature setpoint. Other programs or control systems can then make use of this calculated setpoint. This type of control, called cascade control, results in very tight control of space temperature. Calculating the discharge-air temperature setpoint is the first stage of cascade control. Figure 24 illustrates how a PID loop calculates the discharge-air temperature setpoint.
® Cascade control—first stage Figure 25: TGP program for discharge-air temperature setpoint in cascade control If space temperature sensor has failed, switch control to space temperature setpoint If you use the settings shown in Table 14, you should not have to tune the loop. These values can be used in almost any cascade control application without change. The proportional and integral gains are high to respond aggressively to the error and change in error.
® Chapter 4 Applications Figure 26: Space temperature and calculated discharge-air setpoint Temperature (°F) PID calculated discharge-air setpoint Space temperature Space setpoint Time (minutes) The discharge-air temperature setpoint calculated by the PID loop may not control the discharge-air temperature depending on other conditions that have priority, such as high and low setpoint limits.
® Staging cooling-tower fans Staging cooling-tower fans Staging applications organize individual pieces of equipment into a group to accomplish a single task. For example, several fans might be used to maintain the supply water temperature in a cooling tower. Staging applications control a series of binary outputs on and off at specific times based on an analog value. This value can be generated by a linear equation, a PID calculation, a reset block, and so on.
® Chapter 4 Applications The PCL program in Table 15 stages two cooling-tower fans. Figure 28 shows the same program in TGP. The behavior of the stages programmed in this program is illustrated in Figure 30 on page 41.
® Staging cooling-tower fans The TGP program follows this sequence of operation: 1. Chilled-water pump status is checked. If there is flow, the cooling towers are allowed to operate. 2. Based on the error (the difference between the chilled-water setpoint and the chilled-water temperature), the controller turns cooling-tower fans on or off as needed to ensure efficient cooling tower operation. 3. If the chilled-water temperature sensor fails, all cooling-tower fans are turned on.
® Chapter 4 Applications The challenge in staging applications is to find the correct proportional bias. This value determines the output when the error is zero. The proportional bias should have the same value as the point at which the first stage turns on (see “Determining the staging points” on page 42). In this case, the first stage turns on at an output of 63%, so the proportional bias is set to 63%. Figure 29 shows the output versus error when the proportional bias is 63%.
® Staging cooling-tower fans For staging applications, the result of the PID calculation controls binary outputs rather than an analog output. For this kind of staging application, it is typical to use the deadband to make sure that the binary output state is maintained for some specific range. Figure 30 illustrates the staging points for two cooling-tower fans. The three lines indicate (from bottom to top): the number of fans versus the control value, fan 1 on and off points, and fan 2 on and off points.
® Chapter 4 Applications Determining the staging points This section describes how to find the points at which stages are turned on and off. Start with these guidelines: • • • • To avoid having a stage turn off at the lowest extreme, always have at least one stage on at 10% of the output range. Turn that stage off when the control value is less than 10%.
® Staging cooling-tower fans Example 1: Two-stage fan system The staging points are calculated as follows: 1. Calculate the overlap range. 80% 80% Overlap range = ----------------------------------------- = ------------- = 26.7% stage count + 1 2+1 2. Calculate the first stage control points. Stage 1 = On: control value ≥ 10% + ( 2 × 26.7 % ) ≈ 63% Off: control value < 10% 3. Calculate the second stage control points. Stage 2 = On: control value ≥ 10% + ( 3 × 26.
® Chapter 4 Applications Example 2: Three-stage fan system The staging points are calculated as follows: 1. Calculate the overlap range. 80% 80% Overlap range = ----------------------------------------- = ------------- = 20% stage count + 1 3+1 2. Calculate the first stage control points. Stage 1 = On: control value ≥ 10% + ( 2 × 20 % ) = 50% Off: control value < 10% 3. Calculate the second stage control points.
® Chapter 5 Troubleshooting This chapter offers a general troubleshooting procedure and tips for specific problems. Troubleshooting procedure When following this troubleshooting procedure, change only one thing at a time, then wait to see the effect the change has on the system. Follow these steps to troubleshoot a PID loop: 1. Make sure that the system is not in override. 2. Graph the measured variable, setpoint, and valve position over time to determine how the system performs.
® Chapter 5 Troubleshooting Tips for specific problems Table 17 provides tips for troubleshooting specific problems.
® Examples Examples This section presents troubleshooting scenarios from a hot-water valve application. The three examples have the same symptom but different solutions to the problem. Example 1 A hot-water valve cycles closed every few minutes. Although the space temperature remains fairly stable, the discharge-air temperature swings across a range of 10°F (5.6°C). The technician follows the troubleshooting procedure described in this chapter. However, nothing seems to work.
® Chapter 5 Troubleshooting The application is running in a cold climate during winter, so the chilledwater valve should not open at all (because chilled water is not being used). However, it might open in the following cases: • • The building automation system has information that chilled water is available. The program logic is wrong, and the hot-water valve should depend only on the heat/cool mode, not on the position of the chilled-water valve.
® Examples Discharge-air temperature and valve position Figure 34: Hot-water valve position, sampling frequency too short Discharge-air temperature setpoint (°F) Discharge-air temperature (°F) Hot-water valve position (%) Time (minutes) CNT-APG002-EN 49
® Chapter 5 Troubleshooting Example 3 The technician experiences the same problem as in the first two examples: a hot-water valve cycles closed every few minutes, and the discharge-air temperature swings across a range of 10°F (5.6°C). The technician graphs the discharge-air temperature setpoint and the hotwater valve position, as shown in Figure 35.
® Chapter 6 Frequently asked questions Why is the output of my PID loop always zero? • • • • • • • Maximum PID output may be set to zero. PID action setting may need to be changed. Setpoint may be zero or negative, driving the output to zero. Change the setpoint to a reasonable value manually or add a limit block to the PID loop to keep the setpoint within a reasonable range. Physical output may not have enough power to achieve the setpoint, leaving the output at the low end of its range.
® Chapter 6 Frequently asked questions I tried the 4:1 ratio for proportional and integral gains, but this did not optimize my system. Can I try another ratio? We recommend maintaining a 4:1 ratio between the proportional and integral gains. Changing the gains may slightly improve the speed and stability of a system, but the 4:1 ratio has proven to work effectively. See “Calculating the gains” on page 11 for more information.
® Frequently asked questions What’s the best sampling frequency? The best sampling frequency depends on the application. See “Calculating the sampling frequency” on page 14 for recommended sampling frequencies. You may need to adjust the sampling frequency (usually to slow it down). If the measured variable is oscillating around setpoint, the sampling frequency may be too fast or the gains may be too big.
® Chapter 6 Frequently asked questions 54 CNT-APG002-EN
® Appendix A The math behind PID loops This appendix presents the mathematical formulas used for PID control in Tracer MP580/581 controllers, the programmable control module (PCM), and the universal programmable control module (UPCM). Velocity model formula The formula used to calculate the output in the velocity model is shown below. It uses the integral and proportional gain, but not the derivative gain. The same formula is used in the PCM and the UPCM.
® Appendix A The math behind PID loops 56 CNT-APG002-EN
® Glossary action A PID setting that determines how the PID loop reacts to a change in the measured variable (such as a room temperature). A controller using direct action increases the output when the measured variable increases. A controller using reverse action decreases the output when the measured variable increases. See also measured variable. actuator Electric, hydraulic, or pneumatic motor that changes the position of moveable devices such as valves and dampers.
® Glossary error deadband A PID setting that defines how much the error must change before the PID loop reacts. Used to compensate for bearings, linkages, and other mechanical items. gain The primary tool for tuning PID loops, gain determines how a particular part of the PID calculation contributes to the final output. The bigger the gain, the more a part contributes. The proportional, integral, and derivative calculations each have an associated gain setting.
® Glossary program frequency The rate at which a program executes or cycles. proportional control Control action based on the error. The most important determinant in how quickly the system responds to the error. Some applications use proportional-only control. proportional, integral, derivative (PID) calculation The mathematical process that determines how quickly a controller reaches setpoint. Compare proportional, integral, derivative loop.
® Glossary system time constant The time it takes to reach 63.21% of the difference between the start point and the end point when controlling an output over a known range. Used to calculate the sampling frequency. Using 2/3 (66%) rather than 63.21% provides a good approximation of the system time constant. throttling range For an HVAC controller, the range of input that drives the output from the minimum output to the maximum output (typically 0% and 100%).
® Index Numerics C 4 to 1 ratio for gains, 11, 52 calculating action, 18 error deadband for staged outputs, 21, 40 gains, 11 sampling frequency, 14-15 staging points, 42 A action, 17-18 determining, 18 direct, 17, 52 examples, 18 recommended values, 18 reverse, 17, 52 actuator and error deadband, 19 and PID output, 2 cycling, troubleshooting, 46 aliasing, 12 applications, 29-44 building pressure control, 18, 32-33 cascade control, 34-36 cooling, 17 discharge-air temperature control, 29-31 duct static p
® Index E I PID Properties dialog box in TGP, 26 enable conditions, 24, 25, 27 IF statement in PCL, 24 error and the velocity model, 7 and throttling range, 9-10 definition, 2 integral control, 4-5 gain, 3, 7, 10-11 windup, 5, 7 pressure control building, 18, 32-33 duct static, 11, 12, 18 error deadband, 19-21 and sensor resolution, 20 and staging, 20-21, 37 calculating for staged outputs, 21, 40 for modulating outputs, 20 recommended values, 19 execution frequency, see sampling frequency L Limit
® Index S sampling frequency, 12-16, 53 aliasing, 12 calculating, 14-15 causing output to oscillate, 13, 46, 48 example, 16 in different controllers, 14 recommended values, 14 system time constant, 15 troubleshooting, 45, 46, 48 relief damper program, 32 staging program, 38 troubleshooting, 45-50 at maximum output, 45, 46, 51 at minimum output, 45, 46, 51 examples, 47-50 gains, 45, 46, 50 oscillating output, 13, 31, 51 overshoot, 46 procedure for, 45 sampling frequency, 45, 46, 48 undershoot, 46 sensor
® The Trane Company An American Standard Company www.trane.com For more information contact your local district office or e-mail us at comfort@trane.com Literature Order Number CNT-APG002-EN File Number PL-ES-CNT-APG002-EN-1001 Supersedes New Stocking Location La Crosse Since The Trane Company has a policy of continuous product and product data improvement, it reserves the right to change design and specifications without notice.