The text of a manual · part 30 of 59
Mini-PLC-2/02, -2/16, -2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual: 16 - EAF Process Control Instructions, pages 242 to 251
Pages 242 to 251 of 490, from Mini-PLC-2/02, -2/16, -2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual
The original document is the PDF (2.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 1772-LX / LXP
Page 242
Chapter 16 EAF Process Control Instructions
Output Limiting (Word 01, Bit 03) Set/Reset this bit to enable/inhibit output limiting. Reset (0) Set (1)
Output limiting inhibited Output limiting enabled
Set the output limits as a percentage (0-100%) of control output. When the instruction detects that the output has reached either of these limits, the instruction sets an alarm bit in word 01 of the PID control block and prevents the output from exceeding either value. Select maximum and minimum control output limits by setting the output limiting bit (bit 03 of word 01), and entering a maximum limit (word 12) and minimum limit (word 13). Limit values are a percentage (0-100%) of the control output (word 17). If you do not select limits, the instruction limits the range to 0-100%. The difference between selecting output alarms and output limits is that you must set bit 03 of word 01 to enable limiting. Limit and alarm values are stored in the same words. Output alarms are always enabled. Output limiting is only enabled when word 01, bit 03 is set. Both output alarms and output limiting use the Maximum Control Output (word 12) and the Minimum Control Output (word 13) values to determine when action should be taken, such as set bits or limit the output. Proportional Gain Constant (Word 04) When using the Independent Gain Equation, this value is proportional gain (KP) or controller gain (KC) when using the Dependent Gain Equation. PV (Process Variable) (Word 15) This is the process measurement, scaled according to the minimum and maximum scaling values. It can be either BCD or Binary format. Process Variable Sign Bit (Word 02, Bit 06) This bit is set/reset by the EAF instruction to indicate the polarity of PV. Reset (0) Set (1)
PV = positive PV = negative
Reserved (Word 1, Bit 14 and 16; Words 18-24) These bits and words are used internally by the PID instruction and should NEVER be altered by the user. Resume Control From Last State (Word 02, Bit 10) This bit should be set when you want to keep the Control Output in last state (analog output module to hold the last output value). On the first program scan, the last stored value of the Control Output will then be used to back-calculate the accumulated integral value.
16-31
Page 243
Chapter 16 EAF Process Control Instructions
Important:This bit should not be set until a valid Control Output value is calculated and stored at the Result Address (i.e., until the PID instruction has been executed at least once in Run mode). Scaling Input scaling lets you specify the engineering units for the set point and Dead Band values and to display the process variable and error values in the same engineering units. Select input scaling as follows: Enter the Maximum Scaling Value (word 02, bit 03) and Minimum Scaling Value (word 02, bit 04) in the PID control block. The Minimum Scaling Value corresponds to an analog value of zero for the lowest reading of the process variable and the Maximum Scaling Value corresponds to an analog value of 4095 for the highest reading. Set values to zero if you do not want input scaling. The unscaled range is 0-4095. Enter the Set Point (word 03) and Dead Band (word 10) in the same scaled engineering units. Read process variable and error in these units as well. The control output (word 17) is scaled to a percentage (0-100%) of the resultant range. For example, a value of 50 in this word represents a control output of 2047 (50% of 4095). When you select scaling, the instruction scales the setpoint, Dead Band, process variable, and error. You must consider the effect on all these variables when you change scaling.
ATTENTION: Do not change scaling while the processor is in run mode. The processor could fault causing an undesirable process response resulting in possible damage to equipment and injury to personnel.
Set Output (Word 01, Bit 04) Set/reset this bit to replace the calculated CO with the set output value word. When reset, a bumpless transfer back to standard automatic will occur if there is a number greater than zero in the integral gain. This bit functions only when the controller is in automatic (word 01, bit 01). Reset (0) Set (1)
16-32
Set Output inhibited Set Output enabled
Page 244
Chapter 16 EAF Process Control Instructions
Set Output will not override Output Limiting. The Control Output abides by the Output Limiting value. For example, if Output Limiting is enabled and the Minimum Output is 30% and the set output is set to 0% and enabled, the Control Output goes to 30%. Set Output Value (Word 11) When operating in the Set Output mode, this value is sent as the Control Output. The PID instruction uses the value in this word only when the Set Output bit is set. The Set Output value should be entered as 0-100% Control Output range. Range
0000 – 0100 percent; positive integer value.
Sign Bit Word (Word 02) This word contains the PID sign bits. Set Point Error (Word 01, Bit 13) This bit is set/reset by the EAF instruction when the Set Point (SP) has been set out of the Maximum or Minimum Scaling Value ranges. Reset (0) Set (1)
SP is in range SP is out of range
Set Point Sign (Word 02, Bit 05) Set/Reset this bit to change the sign of the Setpoint. Reset (0) Set (1)
SP is positive SP is negative
SP (Set Point) (Word 03) This is the desired value of the process variable. Enter it with the same engineering units as the Minimum Scaling Value and Maximum Scaling Value. Use the same implied decimal point. Status Word (Word 01) This word contains the PID Status Bits. Tieback The Manual Control Station output is brought into the PID instruction as tieback (TB). This allows a bumpless transfer from manual to automatic control. The tieback input (output tracking) from a manual control station must also have the range of 0 to 4095. The instruction masks the upper four bits of this 16 bit value. Also, see Control Output Tracking.
16-33
Page 245
Chapter 16 EAF Process Control Instructions
Averaging and Standard Deviation Functions
These arithmetic functions have applications in various industries. You can use the average function for averaging thermocouple inputs or other process variables. You can use standard deviation and averaging for trend analysis and report generation. Status Bits Bits 14-17 of the most significant word of the result word are reserved for status bits: This Bit:
Stores this:
14 not used
15 done bit 1 the instruction is done and the result is valid 0 the result is not valid
16 sign bit 1 negative (-) 0 positive (+)
17 enable bit 1 instruction started 0 instruction not started
Important:Bit 16 of the most significant word of each operand is reserved for the sign bit. See chapter 14 for the word format used when a processor executes an EAF.
Difference Between Three-Digit and Six-Digit Functions
We provide two forms of these instructions (3-digit and 6-digit) for two types of users, one who will be block transferring 3-digit BCD data to his processor and one who needs up to 6 significant digits. The 3-digit function must be enabled once for each value to be averaged. The 6-digit function is completed by enabling the function once. Three-Digit Functions The 3-digit averaging and standard deviation ladder diagrams are very similar with the following exceptions:
16-34
1.
The averaging function number is 06 and standard deviation is 07.
2.
The EAF rung (rung 4) of the averaging ladder diagram is a branched rung. The standard deviation ladder diagram is not branched.
Page 246
Chapter 16 EAF Process Control Instructions
3.
The first result word in the averaging EAF occurs in the second word after the beginning of the result word address. The first 4 words of the standard deviation result are reserved for internal processor functions.
Averaging The averaging instruction determines the arithmetic average of a group of three digit BCD values. The maximum number of values you can average is 999 or is limited by the data table area available. The Averaging instruction uses the formula: y + n
ȍ Xn i i+1 where Xi = three digit signed BCD values y = the average of the values n = the number of values Entry and Display of Input and Result Values Figure 16.12 shows one method you can use to enter values and display results of the 3 digit averaging. Although there are several techniques for accomplishing this, we chose Get instructions. Be careful not to select data and result addresses so close together that they overlap.
16-35
Page 247
Chapter 16 EAF Process Control Instructions
Figure 16.10 3-Digit Averaging Ladder Diagram THREE DIGIT AVERAGE:
033 15
1
033
034
15
15
1
FILE TO WORD MOVE 0034 COUNTER ADDR: 000 POSITION: 005 FILE LENGTH: FILE A: 0201-0205 FILE A: 0036 041 15 033 15
0047 G 000
0032 G 005
0035 G 001
0036 G 000
0034 DN 15
EXECUTE AUX FUNCTION FUNCTION NUMBER: 06 0047 DATA ADDR: 0040 RESULT ADDR:
^ Changing Data ^ Always 1 ^ Number of Samples
070 00
0041 0042 G G 1 000 1 000 RES ULT 1
0033 TON 1.0 PR 003 AC 000 0034 CTU PR 005 AC 000
070 00
Indicates that these values need to be reset to zero in between calculations.
Entry and Display of Input and Result Values Here is a description of the ladder diagram. This programming example averages five values and stops.
16-36
Rung 1
Contains a free-running timer (033) that allows a different value to be summed every 3 seconds. The pre-set of this timer can be as small as 10 milliseconds.
Rung 2
Increments counter 034 every 3 seconds to externally index the File-to-Word Move in rung 3 that moves each value into the average instruction. The preset of the counter must equal the length or number of samples to average in word 0032 in the EAF rung. The accumulated value of the counter must start at zero.
Page 248
Chapter 16 EAF Process Control Instructions
Rung 3
This is an unconditional File-to-Word Move instruction containing the values you want to average. Addresses 201 through 205 are externally indexed by the counter 0034 and the position starting value must be zero (see rung 2).
Rung 4
This is the averaging EAF rung. The input conditions (second rung) must be programmed as shown. Branch 1 The result word done bit 04115 (when set) stops the averaging calculation after all five values have been entered and their average calculated. The positioning of the Get instructions cannot be altered from the example program Branch 2 Bit 03315 is a timer done bit enabling the calculation. (Timer in rung 1) Word 0032 is the the number of samples you want to average. Word 0035 is the rate (or sum) per scan which must always be 001. The instruction will not be completed in one scan but must be executed once per value to be averaged. Word 0036 is the result word of the File-to-Word move. It will contain a different value each time the instruction is enabled (every 3 seconds). The 3 Gets must be included in this rung. The first two can reside in any storage location; the third GET must correspond to the WORD ADDR(ess) from the File-to-Word Move in rung 3. The DATA ADDR(ess) in the EAF average instruction (047) is used by the function to store the position of the word currently being summed. The result address (040) is the first of three consecutive words reserved for the result. The first word is used by the instruction; the second word contains the three most significant digits of the result; and the third word contains the three least significant digits of the result.
Rung 5
Word 047 points to the next value added to the calculation (present position). (Optional display rung.) 16-37
Page 249
Chapter 16 EAF Process Control Instructions
Rung 6
This rung displays the result with a decimal point implied but not shown between the two words. Word 041 contains the 3 most significant digits and word (042) contains the 3 least significant digits. The values of these words are not valid until the done bit (04115) is ON. Word 040, the RESULT ADDR(ess) of the EAF instruction, is used for intermediate calculations and must not be manipulated by the user. (Optional display rung)
If you want to average a new set of values, you must reset to zero: 1.
The accumulated value of the counter and the timer (034 and 033 in this example).
2.
The data in the data address word, rung 5 (047 in this example).
3.
The results in the result words (041 and 042 in this example).
Standard Deviation The Standard Deviation instruction determines the standard deviation of a group of three digit values. The maximum number of values the instruction can handle is 999 or is limited by the data table area available. Standard deviation instruction uses the formula:
y +
NJ
ȍ(x * x ) avg i n
Nj
1/2
2
Where: xi xavg n
= the group of values whose standard deviation you want to calculate = the arithmetic average of the group of values = the number of values in the group
Entry and Display of Input and Result Values Figure 16.13 shows one method you can use to enter values and display results of the 3 digit standard deviation. Although there are several techniques for accomplishing this, we chose Get instructions.
16-38
Page 250
Chapter 16 EAF Process Control Instructions
Figure 16.11 3 Digit Standard Deviation Ladder Diagram THREE DIGIT STANDARD DEVIATION:
033 15
1
033
034
15
15
1
FILE TO WORD MOVE 0034 COUNTER ADDR: 005 POSITION: 005 FILE LENGTH: FILE A: 0201-0205 FILE A: 0036 033
044
15
15
032 G 005
035 G 001
036 G 000
^ Changing Data ^ Always 1 ^Number of Samples
0033 TON 1.0 PR 003 AC 000 0034 CTU PR 005 AC 000 0034 DN 15
EXECUTE AUX FUNCTION FUNCTION NUMBER: 07 0047 DATA ADDR: 0040 RESULT ADDR:
0047 G 000
070
0040 0041 0042 0043 0044 0045 G G G G G G 1 000 1 000 1 000 1 000 1 000 1 000 RES ULT ^ ^ ^ ^
070
00
00
Intermediate Results
1
Indicates that these values need to be reset to zero in between calculations.
Here is a description of the ladder diagram. This programming example calculates the standard deviation of five values and stops. Rung 1
Contains a free-running timer (033) that allows a different value to be summed every 3 seconds. The preset of this timer can be as small as 10 milliseconds.
Rung 2
The Timer Done Bit (03315) increments counter 034 every 3 seconds to externally index the File-to-Word Move in rung 3 that moves each value into the standard deviation instruction. The preset of the counter must equal the length or number of samples in word 032 in the EAF rung. The accumulated value of the counter must start at zero.
16-39
Page 251
Chapter 16 EAF Process Control Instructions
Rung 3
This is an unconditional File-to-Word Move instruction containing the values for which you want to calculate the standard deviation. Addresses 201 through 205 are externally indexed by the counter 0034. The starting position must be one (see rung 2).
Rung 4
This is the EAF rung. Bit 03315 a timer done bit enabling the calculation. (see rung 1) Bit 04415 the result word done bit that stops the standard deviation calculation after all five values have been entered and their standard deviation calculated. Word 0032 the calculation length or the number of samples for which you want to find the standard deviation (five in this example). Word 0035 the rate per scan (must be 001). Word 0036 the Output WORD ADDR(ess) of the File-to-Word Move instruction. It will contain a different value each time the instruction is enabled (every 3 seconds). The 3 Gets must be included. The first two can reside in any storage location; the third Get must correspond to the RESULT ADDR(ess) of the File-to-Word move in rung 3.
The Data Address, word 047, contains the current position for which the standard deviation is being calculated. The Result Address is the first of six consecutive words used for intermediate calculations and for storing the final result. The first 4 words (040-043) are reserved for intermediate calculations. Word 044 contains the 3 most significant digits of the result and word 045 contains the 3 least significant digits. There is an implied decimal point between the words (044 and 045).
16-40