The text of a manual · part 12 of 38
DL06 Micro PLC User Manual, Volume 2 of 2, pages 110 to 119
Pages 110 to 119 of 370
The original document is the PDF (6.0 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Page 110
Chapter 8: PID Loop Operation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–34
Enable Deadband – When selected, the enable deadband function takes a range of small error values near zero, and simply substitutes zero as the value of the error. If the error is larger than the deadband range, then the error value is used normally. Freeze Bias The term reset windup refers to an undesirable characteristic of integrator behavior which occurs naturally under certain conditions. Refer to the figure below. Suppose the PV signal becomes disconnected, and the PV value goes to zero. While this is a serious loop fault, it is made worse by reset windup. Notice the bias (reset) term keeps integrating normally during the PV disconnect, until its upper limit is reached. When the PV signal returns, the bias value is saturated (windup) and takes a long time to return to normal. The loop output consequently has an extended recovery time. Until recovery, the output level is wrong and causes further problems. PV 0
PV loss Reset windup
PV loss Freeze bias enabled
Bias
Output Recovery time
Recovery time
In the second PV signal loss episode in the figure, the freeze bias feature is enabled. It causes the bias value to freeze when the control output goes out of bounds. Much of the reset windup is thus avoided, and the output recovery time is much less. For most applications, the freeze bias feature will work with the loop as described above. It is suggested to enable this feature by selecting it in the dialog. Bit 10 of PID Mode 1 Setting (V+00) word can also be set in RLL. NOTE: The freeze bias feature stops the bias term from changing when the control output reaches the end of the data range. If you have set limits on the control output other than the range (i.e, 0–4095 for a unipolar/12bit loop), the bias term still uses the end of range for the stopping point and bias freeze will not work.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 111
Chapter 8: PID Loop Operation Setup the PID Alarms Although the setup of the PID alarms is optional, you surely would not want to operate a process without monitoring it. The performance of a process control loop may generally be measured by how closely the process variable matches the setpoint. Most process control loops in industry operate continuously, and will eventually lose control of the PV due to an error condition. Process alarms are vital in early discovery of a loop error condition and can alert plant personnel to manually control a loop or take other measures until the error condition has been repaired. The alarm thresholds are fully programmable, and each type of alarm may be independently enabled and monitored. The following diagram shows the Alarm dialog in the PID setup which simplifies the alarm setup.
1 2 3 4 5 6 7 8 9 10 Monitor Limit Alarms Checking this box will allow all of the PV limit alarms to be monitored once the limits are 11 entered.The PV absolute value alarms are organized as two upper and two lower alarms. The alarm status is false as long as the PV value remains in the region between the upper and lower alarms, as shown below. The alarms nearest the safe zone are named High Alarm and 12 Low Alarm. If the loop loses control, the PV will cross one of these thresholds first. Therefore, you can program the appropriate alarm threshold values in the loop table locations shown 13 below to the right. The data format is the same as the PV and SP (12-bit or 15-bit). The threshold values for these alarms should be set to give an operator an early warning if the process loses control. 14 A B C NOTE: The Alarm dialog can be left as it first appears, without alarm entries. The alarms can then be setup D in the DirectSOFT 5 PID View. High–high Alarm High Alarm
PV
Low Alarm Low–low Alarm
Loop Table
V+16
XXXX
High-high Alarm
V+15
XXXX
High Alarm
V+14
XXXX
Low Alarm
V+13
XXXX
Low-low Alarm
DL06 Micro PLC User Manual, 3rd Edition Rev. A
8–35
Page 112
Chapter 8: PID Loop Operation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–36
If the process remains out of control for some time, the PV will eventually cross one of the outer alarm thresholds, named High-high alarm and Low-low alarm. Their threshold values are programmed using the loop table registers listed above. A High-high or Low-low alarm indicates a serious condition exists, and needs the immediate attention of the operator. The PV Absolute Value Alarms are reported in the four bits in PID Mode and Alarm Status V+06 the PID Mode and Alarm Status word in the loop table, as shown to the right. We highly recommend using ladder logic Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 to monitor these bits. The bit-of-word instructions make this High-high Alarm High Alarm easy to do. Additionally, you can monitor PID alarms using Low Alarm DirectSOFT 5. Low-low Alarm PV Deviation Alarms The PV Deviation Alarms monitor the PV deviation with respect to the SP value. The deviation alarm has two programmable thresholds, and each threshold is applied equally above and below the current SP value. In the figure below, the smaller deviation alarm is called the “Yellow Deviation”, indicating a cautionary condition for the loop. The larger deviation alarm is called the “Red Deviation”, indicating a strong error condition for the loop. The threshold values use the loop parameter table locations V+17 and V+20 as shown. Red Deviation Alarm Yellow Deviation Alarm
Red Yellow Green
SP Yellow Deviation Alarm Red Deviation Alarm
Loop Table V+17
XXXX
Yellow Deviation Alarm
V+20
XXXX
Red Deviation Alarm
Yellow Red
The thresholds define zones, which fluctuate with the SP value. The green zone which surrounds the SP value represents a safe (no alarm) condition. The yellow zones lie outside the green zone, and the red zones are beyond those. The PV Deviation Alarms are reported in the two bits in the PID Mode and Alarm Status V+06 PID Mode and Alarm Status word in the loop table, as shown to the right. We highly recommend using ladder logic Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 to monitor these bits. The bit-of-word instructions make this Red Deviation easy to do. Additionally, you can monitor PID alarms using Yellow Deviation DirectSOFT 5. The PV Deviation Alarm can be independently enabled and disabled from the other PV alarms, using bit 13 of the PID Mode 1 Setting V+00 word. Remember the alarm hysteresis feature works in conjunction with both the deviation and absolute value alarms, and is discussed at the end of this section.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 113
Chapter 8: PID Loop Operation PV Rate-of-Change Alarm An excellent way to get an early warning of a process fault is to monitor the rate-of-change of the PV. Most batch processes have large masses and slowly-changing PV values. A relatively fast-changing PV will result from a broken signal wire for either the PV or control output, a SP value error, or other causes. If the operator responds to a PV Rate-of-Change Alarm quickly and effectively, the PV absolute value will not reach the point where the material in process would be ruined. The DL06 loop controller provides a programmable PV Rate-of-Change Alarm, as shown below. The rate-of-change is specified in PV units change per loop sample time. This value is programmed into the loop table location V+21.
1 2 3 4 5 6 7 8 9 As an example, suppose the PV is the temperature for your process, and you want an alarm whenever the temperature changes faster than 15 degrees/minute. The PV counts per degree and the loop sample rate must be known. Then, suppose the PV value (in V+03 location) 10 represents 10 counts per degree, and the loop sample rate is 2 seconds. Use the formula below to convert our engineering units to counts/sample period: 11 10 counts / degree 150 15 degrees Alarm Rate-of-Change = X = = 5 counts 30 loop samples / min. 30 1 minute 12 From the calculation result, you would program the value 5 in the loop table for the rate-ofchange. The PV Rate-of-Change Alarm can be independently enabled and disabled from the 13 other PV alarms, using bit 14 of the PID Mode 1 Setting V+00 word. The alarm hysteresis feature (discussed next) does not affect the Rate-of-Change Alarm. 14 A B C D PV slope OK
Loop Table
PV slope excessive
V+21
XXXX
PV Rate-of-Change Alarm
PV
PID Mode and Alarm Status V+06 rate-of-change alarm
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Sample time
Sample time
PV Rate of Change Alarm
DL06 Micro PLC User Manual, 3rd Edition Rev. A
8–37
Page 114
Chapter 8: PID Loop Operation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–38
PV Alarm Hysteresis The PV Absolute Value Alarm and PV Deviation Alarm are programmed using threshold values. When the absolute value or deviation exceeds the threshold, the alarm status becomes true. Real-world PV signals have some noise on them, which can cause some fluctuation in the PV value in the CPU. As the PV value crosses an alarm threshold, its fluctuations cause the alarm to be intermittent and annoy process operators. The solution is to use the PV Alarm Hysteresis feature. The PV Alarm Hysteresis amount is programmable from 1 to 200 (binary/decimal). When using the PV Deviation Alarm, the programmed hysteresis amount must be less than the programmed deviation amount. The figure below shows how the hysteresis is applied when the PV value goes past a threshold and descends back through it. Alarm threshold Hysteresis Loop Table PV
V+22
XXXX
PV Alarm Hysteresis
Alarm 1 0
The hysteresis amount is applied after the threshold is crossed, and toward the safe zone. In this way, the alarm activates immediately above the programmed threshold value. It delays turning off until the PV value has returned through the threshold by the hysteresis amount. Alarm Programming Error The PV Alarm threshold values must have certain mathematical relationships to be valid. PID Mode and Alarm Status V+06 The requirements are listed below. If not met, the Alarm Programming Error bit will be set, as Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 indicated to the right. • PV Absolute Alarm value requirements: Low-low < Low < High < High-high
Alarm Programming Error
• PV Deviation Alarm requirements: Yellow < Red
Loop Calculation Overflow/Underflow Error This error occurs whenever the output reaches it’s upper or lower limit and the PV does not reach the setpoint. A typical example might be when a valve is stuck, the output is at it’s limit, but the PV has not reached setpoint.
PID Mode and Alarm Status V+06 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Loop Calculation Overflow/Underflow Error
NOTE: Overflow/underflow can be alarmed in PID View. The optional C-more operator interface panel (see the automationdirect.com website) can also be setup to read these error bits using the PID Faceplate templates.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 115
Chapter 8: PID Loop Operation Ramp/Soak R/S (Ramp/Soak) is the last dialog available in the PID setup. The basic PID does not require any entries to be made in order to operate the PID loop. Ramp/Soak will be discussed in another section.
1 2 3 4 5 6 7 8 Complete the PID Setup Once you have filled in the necessary information for the basic PID setup, the configuration 9 should be saved. The icons on the Setup PID dialog will allow you to save the configuration to the PLC and to disk. The save to icons have the arrow pointing to the PLC and disk. The read from icons have the arrows pointing away from the PLC and disk. 10 An optional feature is available with the Doc tab in the Setup PID window. You enter a name and description for the loop. This is useful if there are more than one PID loop in your 11 application. 12 13 Save to disk 14 Save to PLC A B C NOTE: It is good practice to save your project after setting up the PID loop by selecting File from the menu toolbar, then Save project > to disk. In addition to saving your entire project, all the PID parameters are also saved. D DL06 Micro PLC User Manual, 3rd Edition Rev. A
8–39
Page 116
Chapter 8: PID Loop Operation
Tuning 1 PID Loop Once you have set up a PID loop, it must be tuned in order for it to work. The goal of loop tuning is to adjust the loop gains so the loop has optimal performance in dynamic conditions. 2 The quality of a loop’s performance may generally be judged by how well the PV follows the SP after a SP step change. It is important to keep in mind that understanding the process is fundamental to getting a well designed control loop. Sensors must be in appropriate locations 3 and valves must be sized correctly with appropriate trim. PID control does not have typical values. There isn’t one control process that is identical to another. 4 Manual Tuning vs. Auto Tuning You may enter the PID gain values to tune your loops (manual tuning), or you can rely on 5 the PID processing “engine” in the CPU to automatically calculate the gain values (auto tuning). Most experienced process engineers will have a favorite method; the DL06 will 6 accommodate either preference. The use of auto tuning can eliminate much of the trial-anderror of the manual tuning approach, especially if you do not have a lot of loop tuning experience. However, performing the auto tuning procedure will get the gains close to 7 optimal values, but additional manual tuning can get the gain values to their optimal values. WARNING: Only authorized personnel fully familiar with all aspects of the process should make 8 changes that affect the loop tuning constants. Using the loop auto tune procedures will affect the process, including inducing large changes in the control output value. Make sure you thoroughly 9 consider the impact of any changes to minimize the risk of injury to personnel or damage to equipment. The auto tune in the DL06 is not intended to be used as a replacement for your process knowledge. 10 Open-Loop Test 11 Whether you use manual or auto tuning, it is very important to verify basic characteristics of a newly-installed process before attempting to tune it. With the loop in Manual Mode, verify the following items for each new loop. 12 • Setpoint – verify that the SP source can generate a setpoint. Put the PLC in Run Mode and leave the loop in Manual Mode, then monitor the loop table location V+02 to see the SP value(s). (If you 13 are using the ramp/soak generator, test it now). • Process Variable – verify that the PV value is an accurate measurement, and the PV data arriving in 14 the loop table location V+03 is correct. If the PV signal is very noisy, consider filtering the input either through hardware (RC low-pass filter), or using the filter in this chapter. • Control Output – if it is safe to do so, manually change the output a small amount (perhaps 10%) A and observe its affect on the process variable. Verify the process is direct-acting or reverse acting, and check the setting for the control output (inverted or non-inverted). Make sure the control output B upper and lower limits are not equal to each other. • Sample Rate – while operating open-loop, this is a good time to find the ideal sample rate (see Configure the PID Loop earlier in this chapter). However, if you are going to use auto tuning, the C auto tuning procedure will automatically calculate the sample rate in addition to the PID gains. D
8–40
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 117
Chapter 8: PID Loop Operation
Manual Tuning Procedure
1 2 3 NOTE: We recommend using the PID View Tuning and Trending window to select manual for the vertical scale feature, for both SP/PV area and Bias/Control Output areas. The auto scaling feature would otherwise 4 change the vertical scale on the process parameters and add confusion to the loop tuning process. • Adjust the gains so the Proportional Gain = 0.5 or 1.0 (1.0 is a good value based on experience), 5 Integral Gain = 9999 (this basically eliminates reset) and Derivative Gain =0000. This disables the integrator and derivative terms, and provides some proportional gain. 6 • Check the bias value in the PID View and set it to zero. • Set the SP to a value equal to 50% of the full range. 7 • Now, select Auto Mode. If the loop will not stay in Auto Mode, check the troubleshooting tips at the end of this chapter. Allow the PV to stabilize around the 50% point of the range. 8 • Change the SP to the 60% point of the range. 9 10 11 12 The response may take awhile, but you will see that there isn’t any oscillation. This response is 13 not desirable since it takes a long time to correct the error; also, there is a difference between the SP and the PV. • Increase the Proportional gain, for example to 2.0. The control output will be greater and the 14 response time will be quicker. The trend should resemble the figure below. A B C D It is not necessary to try to obtain the best values for the P, I and D parameters in the PID loop by trial and error. Following is a typical procedure for tuning a temperature control loop which you may use to tune your loop. Monitor the values of SP, PV and CV with a loop trending instrument or use the PID View feature in DirectSOFT 5 (see page 8-49).
error
60% here
10% of SP range
SP PV
Over-damped PV response
50% here
60% here
10% of SP range
PV response
SP PV
50% here
• Increase the Proportional gain in small increments, such as 4, 6, 7, etc. until the control output response begins to oscillate. This is the Proportional gain that should be recorded.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
8–41
Page 118
Chapter 8: PID Loop Operation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–42
Error
60% here
SP PV
50% here
• Now, return the Proportional gain to the stable response, for example, 9.7. The error, SP-PV, should be small, but not at zero. • Next, add a small amount of Integral gain (reset) in order for the error to reach zero. Begin by using 80 seconds (adjust in minutes if necessary). The error should get smaller. • Set the Integral gain to a lower value, such as 50 for a different response. If there is no response, continue to decrease the reset value until the response becomes unstable. See the figure below. 60% here
10% of SP range SP PV
50% here
Under-damped PV response
• For discussion, let us say that a reset value of 35 made the control output unstable. Return the reset value to the stable value, such as 38. Be careful with this adjustment since the oscillation can destroy the process. • The control output response should be optimal now, without a Derivative gain. The example recorded values are: Proportional gain = 9.7 and Integral gain = 38 seconds. Note that the error has been minimized. Minimum Oscillations
Shortest response time
The foregone method is the most common method used to tune a PID loop. Derivative gain is almost never used in a temperature control loop. This method can also be used for other control loops, but other parameters may need to be added for a stable control output. Test your loop for a high PV of 80% and again for a low PV of 20%, and correct the values if necessary. Small adjustments of the parameters can make the control output more precise or more unstable. It is sometimes acceptable to have a small overshoot to make the control output react quicker.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 119
Chapter 8: PID Loop Operation The derivative gain can be helpful for those control loops which are not controlling temperature. For these loops, try adding a value of 0.5 for the derivative gain and see if this improves the control output. If there is little or no response, increase the derivative by increments of 0.5 until there is an improvement to the output trend. Recall that the derivative gain reacts with a rate of change of the error.
DL06 Micro PLC User Manual, 3rd Edition Rev. A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
8–43