Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 42 of 55

Hand-Held Terminal (Catalog Number 1747-PT1) User Manual: 26 - PID Instruction, pages 361 to 368

Pages 361 to 368 of 486, from Hand-Held Terminal (Catalog Number 1747-PT1) User Manual

The original document is the PDF (1.5 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.

For the Allen-Bradley 1747-PT1

Page 361

Chapter 26 PID Instruction

Select scaling as follows: 1. Enter the maximum and minimum scaling values Smax and Smin in the PID control block. Refer to the control block of the PID instruction on page 26–9. The Smin value corresponds to an analog value of zero for the lowest reading of the process variable, and Smax corresponds to an analog value of 16383 for the highest reading. These values reflect the process limits. Setpoint scaling is selected by entering a non-zero value for one or both parameters. If you enter the same value for both parameters, setpoint scaling is disabled. For example, if measuring a full scale temperature range of – 73 (PV=0) to +1156° C (PV=16383), enter a value of –73 for Smin and 1156 for Smax. Remember that inputs to the PID instruction must be 0 to 16383. Signal conversions could be as follows: Process limit –73 to +1156o C Transmitter output (if used) +4 to +20 mA Output of analog input module 0 to 16383mA PID instruction, Smin to Smax –73 to +1156o C 2. Enter the setpoint (word 2) and deadband (word 9) in the same scaled engineering units. Read the scaled process variable and scaled error in the control block as well. The control output (word 16) is displayed as a percentage of the 0 to 16383 range. The output transferred to the output modules is always unscaled. When you select scaling, the instruction scales the setpoint, deadband, process variable, and error. You must consider the effect on all these variables when you change scaling.

Zero-crossing Deadband DB The adjustable deadband lets you select an error range above and below the setpoint where the output does not change as long as the error remains within this range. This lets you control how closely the process variable matches the setpoint without changing the output. +DB SP

Error Range

–DB Time

Zero-crossing is deadband control that lets the instruction use the error for computational purposes as the process variable crosses into the deadband until it crosses the setpoint. Once it crosses the setpoint (error crosses zero and changes sign) and as long as it remains in the deadband, the instruction considers the error value zero for computational purposes. Select deadband by entering a value in the deadband storage word (word 9) in the control block. The deadband extends above and below the setpoint by the value you enter. A value of zero inhibits this feature. The deadband has the same scaled units as the setpoint if you choose scaling. 26–17

Page 362

Chapter 26 PID Instruction

Output Alarms You may set an output alarm on the control output (CO) at a selected value above and/or below a selected output percent. When the instruction detects that the output (CO) has exceeded either value, it sets an alarm bit (bit 10 for lower limit, bit 9 for upper limit) in word 0 of the PID control block. Alarm bits are reset by the instruction when the output (CO) comes back inside the limits. The instruction does not prevent the output (CO) from exceeding the alarm values unless you select output limiting. Select upper and lower output alarms by entering a value for the upper alarm (word 11) and lower alarm (word 12). Alarm values are specified as a percentage of the output. If you do not want alarms, enter zero and 100% respectively for lower and upper alarm values and ignore the alarm bits.

Output Limiting with Anti-reset Windup You may set an output limit (percent of output) on the control output. When the instruction detects that the output (CO) has exceeded a limit, it sets an alarm bit (bit 10 for lower limit, bit 9 for upper limit) in word 0 of the PID control block, and prevents the output (CO) from exceeding either limit value. The instruction limits the output (CO) to 0 and 100% if you choose not to limit. Select upper and lower output limits by setting the limit enable bit (bit 3 of control word 0), and entering an upper limit (word 11) and lower limit (word 12). Limit values are a percentage (0 to 100%) of the control output (CO). The difference between selecting output alarms and output limits is that you must select output limiting to enable limiting. Limit and alarm values are stored in the same words. Entering these values enables the alarms, but not limiting. Entering these values and setting the limit enable bit enables limiting and alarms. Anti-reset windup is a feature that prevents the integral term from becoming excessive when the output (CO) reaches a limit. When the sum of the PID and bias terms in the output (CO) reaches the limit, the instruction stops calculating the integral output term until the output (CO) comes back in range.

26–18

Page 363

Chapter 26 PID Instruction

The Manual Mode In the manual mode, the PID algorithm does not compute the value of the control variable. Rather, it uses the value as an input to adjust the integral sum (words 17 and 18) so that a bumpless transfer takes place upon re-entering the AUTO mode. In the manual mode, the HHT allows you to enter a new CO value from 0 to 100%. This value is converted into a number from 0 to 16383 and written to the Control Variable address. If you are using an analog output module for this address, you must save (compile) the program with the File Protection option set to None. This allows writing to the output data table. If you do not perform this save operation, you will not be able to set the output level in the manual mode. If your ladder program sets the manual output level, design your ladder program to write to the CV address when in the manual mode. Note that this number is in the range of 0 to 16383, not 0 to 100. Writing to the CO percent (word 16) with your ladder program has no effect in the manual mode. The following is an example that can be used to control the output (CV) with your ladder program.

26–19

Page 364

Chapter 26 PID Instruction

Example – To Manually Control the CV Output A/M Bit

Manual I:2.0 ] [ 2

N7:10 (L) 1 A/M Bit

Auto I:2.0 ] [ 1 A/M Bit N7:10 ] [ 1

N7:10 (U) 1 Accept CV I:2.0 ] [ 0

FRD

B3 [OSR] 0

FROM BCD Source

I1:1.0

Dest

N7:0

LIM

MUL

LIMIT TEST Low Lim

0

MULTIPLY Source A

N7:0

Test

N7:0

Source B

16384

High Lim

100

Dest

N7:2

DDV

Notes on Operation A 3-digit BCD thumbwheel is wired to an input module at I1:1.0 (range 0–100).

LIMIT TEST Low Lim

101

N7:2 stores an intermediate calculation.

Test

N7:0

N7:8 is the PID control variable address.

High Lim

N7:26 Percent output is updated automatically by the PID instruction.

26–20

LIM

N7:0 stores the value entered on the thumbwheel switch.

N7:10 is the control block address of the PID instruction.

100

Dest

N7:8

S:5 (U) 0

A pushbutton wired to I1:2.0/0 accepts the thumbwheel value. A selector switch for auto/manual mode is wired to I1:2.0/1 (auto) and I1:2.0/2 (manual).

DOUBLE DIVIDE Source

–1

Error – Out of Range B3 ( ) 3

Page 365

Chapter 26 PID Instruction

Feed Forward Applications involving transport lags may require that a bias be added to the CV output in anticipation of a disturbance. This bias can be accomplished in the SLC 5/02 processor by writing a value to the Feed Forward Bias element, the seventh element (word 6) in the control block file (see page 26–7). The value you write will be added to the output, allowing a feed forward action to take place. You may add a bias by writing a value between 0 and 16383 to word 6 with your HHT or ladder program.

Time Proportioning Outputs For heating or cooling applications, the Control Variable analog output is typically converted to a time-proportioning output. While this cannot be done directly in the SLC 5/02 processor, you can use the program on the following page to convert the Control Variable to a time proportioning output. In this program, cycle time is the preset of timer T4:0. Cycle time relates to % on-time as follows: T4:0.PRE is the cycle time % on–time

100% output on–time

26–21

Page 366

Chapter 26 PID Instruction

Example – Time Proportioning Outputs PID PID Control Block Process Variable Control Variable Control Block Length

N7:2 N7:0 N7:1 23

TON TIMER ON DELAY Timer T4:0 Time Base 0.01 Preset 1000 Accum 0

GRT

(EN) (DN) Cycle Time of the Output

O:1.0 (U) 0

GREATER THAN Source A T4:0.ACC 0 Source B N7:25 0

Time Proportioning Output Contact T4:0 (RES)

T4:0 ] [ DN NEQ NOT EQUAL Source A Source B

N7:25 0 0

O:1.0 (L) 0

MUL

N7:2 ] [ 13

MULTIPLY Source A Source B

PID Instruction Done Bit

Dest

Control Variable N7:1 0 T4:0.PRE 1000 N7:25 0

DDV DOUBLE DIVIDE Source 16383 Dest

N7:25 0

CLR CLEAR Dest

END

26–22

Output as a Fraction of Cycle Time

Clears Minor Error Flag S:5 0

Page 367

Chapter 26 PID Instruction

PID Tuning PID tuning requires a knowledge of process control. If you are inexperienced, it will be helpful if you obtain training on the process control theory and methods used by your company. There are a number of techniques that can be used to tune a PID loop. The following PID tuning method is general, and is limited in terms of handling load disturbances. When tuning, changes should be made in the manual mode, followed by a return to auto. Output limiting is applied in the manual mode. Important: This method requires that the PID instruction controls a non-critical application in terms of personal safety and equipment damage. The method requires only a few simple calculations.

Procedure 1. Create your ladder program. Make certain that you have properly scaled your analog input to the range of the process variable PV and that you have properly scaled your control variable CV to your analog output. 2. Connect your process control equipment to your analog modules. Download your program to the processor. Leave the processor in the program mode. Important: Ensure that all possibilities of machine motion have been considered with respect to personal safety and equipment damage. It is possible that your output CV may swing between 0 and 100% while tuning. 3. Enter the following values: The initial setpoint SP value, a reset Ti of 0, a rate Td of 0, a gain Kc of 1, and a loop update of 5. Set the PID mode to STI or Timed, per your ladder diagram. If STI is selected, ensure that the loop update time equals the STI time interval. Enter the optional settings that apply (output limiting, output alarm, Smax – Smin scaling, feedforward). 4. Get prepared to chart the CV, PV, analog input, or analog output as it varies with time with respect to the setpoint SP value. 5. Place the PID instruction in the MANUAL mode, then place the processor in the Run mode. 6. While monitoring the PID display, adjust the process manually by writing to the CO percent value. 7. When you feel that you have the process under control manually, place the PID instruction in the AUTO mode. 26–23

Page 368

Chapter 26 PID Instruction

8. Adjust the gain while observing the relationship of the output to the setpoint over time. Note that gain adjustments disrupt the process when you change values. To avoid this disruption, switch to the MANUAL mode prior to making your gain change, then switch back to the AUTO mode. 9. When you notice that the process is oscillating above and below the setpoint in an even manner, record the time of 1 cycle. That is, obtain the natural period of the process. Record the gain value. Return to the MANUAL mode (stop the process if necessary). 10. Set the loop update time (and STI time interval if applicable) to a value of 5 to 10 times faster than the natural period. If the cycle time is 20 seconds for example, and you choose to set the loop update time to 10 times faster than the natural rate, set the loop update time to 200, which would result in a 2-second rate. 11. Set the gain Kc value to 1/2 the gain needed to obtain the natural period of the process. For example, if the gain value recorded in step 9 was 80, set the gain to 40. 12. Set the reset term Ti to approximate the natural period. If the natural period is 20 seconds, as in our example, you would set the reset term to 3 (0.3 minutes per repeat approximates 20 seconds). 13. Now set the rate Td equal to a value 1/8 that of the reset term. For our example, the value 4 will be used to provide a rate term of 0.04 minutes per repeat. 14. Place the process in the AUTO mode. If you have an ideal process, the PID tuning will be complete. 15. To make adjustments from this point, place the PID instruction in the MANUAL mode, enter the adjustment, then place the PID instruction back in the AUTO mode. This technique of going to MANUAL, then back to AUTO ensures that all “integral buildup” and “gain error” is removed at the time each adjustment is made. This allows you to see the effects of each adjustment immediately.

26–24