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

The text of a manual · part 27 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 212 to 221

Pages 212 to 221 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 212

Chapter

16

EAF Process Control Instructions

Chapter Objectives

This chapter describes the EAF Process Control instructions, which are a feature of the Mini-PLC-2/17 processor only. Table 16.A EAF Function Numbers If you want to perform an operation of this type

Use this function number

Only the Mini-PLC-2/17 can perform these functions PID Averaging Standard Deviation Set Clock Set Date Set Leap Year and Day of the Week Read Clock Read Date Read Leap Year and Day of the Week

PID Control

(06) (07) (27) (10) (11) (12) (15) (16) (17)

The PID EAF instruction lets the Mini-PLC-2/17 processor control regulating process loops for such quantities as pressure, temperature, flow rate, or fluid level (Figure 16.1). You configure your PID control instructions by selecting the desired features. Figure 16.1 Closed Loop Control FFWD or Bias

SP PV

Σ

E

PID Equation

Σ

P r o c e s s 10371-I

16-1

Page 213

Chapter 16 EAF Process Control Instructions

PID Features The PID EAF instruction provides the following features: Selectable dependent or independent gain PID equations Manual to automatic mode with bumpless transfer Derivative term calculates from PV or error Process variable and setpoint scaled to engineering units Output alarms Output limiting with anti-reset windup Zero crossing dead band Feedforward or output biasing Direct or reverse control action Concepts PID Closed Loop Control (Figure 16.2) holds a physical quantity such as pressure, temperature, or flow rate at a desired value (set point). Figure 16.2 Loop Control With A PID Controller FFWD or Bias

Set Point Flow Rate

Σ

Error

Process Variable

PID Equation

Σ Control Output

Level Detector

Control Valve

16-2

10372-I

Page 214

Chapter 16 EAF Process Control Instructions

This is accomplished by evaluating the PID equation whose output goes to a control device. An additional value may be added to the control output either as a bias to decrease offset when using proportional control, or as a feedforward control value. The result of the calculation tends to drive the quantity that you are trying to control towards the desired value (set point). The PID Equation = Proportional Term + Integral Term + Derivative Term + Bias Term Select either of two equations: the Dependent Gains equation or the Independent Gains equation. Select the equation with which you are most familiar. There is no difference in the control capabilities; you can achieve comparable control with either equation. In the Dependent Gains equation, a change in the proportional term affects the integral and derivative terms. In the Independent Gains equation, you adjust the proportional, integral and the derivative terms independently. Dependent Gains The Dependent Gains equation is an interactive algorithm that contains variables dependent upon the controller gain. When you adjust your controller gain (KC), you also change your integral and derivative terms. CO + K C

E) 1 Ti

ŕ Edt ) T dt t

D

) Bias

0 or, if derivation of PV is selected: CO + K C where:

E )1 Ti

C = = KC Ti = TD = dt = Bias = E = E(n-1) = PV = PV(n-1) =

ŕ Edt ) T dt t

0

D

) Bias control output controller gain constant (unitless) integral time constant (minutes) derivative time constant (minutes) time between samples (minutes) feedforward or output bias error equal to (PV – SP) or (SP – PV) error from last sample process variable process variable from last sample

16-3

Page 215

Chapter 16 EAF Process Control Instructions

Independent Gains Using the independent gain equation you adjust the proportional, integral and derivative terms separately. CO + K PE ) K I

ŕ t Edt ) KD[E *dtE(n * 1)]

) Bias o

CO + K PE ) K I where:

ŕ or KD[PV * PV(n * 1] Edt ) dt o t

) Bias

C= control output = proportional gain constant (unitless) KP KI = integral gain constant (1/sec) KD = derivative gain constant (sec) dt = time between samples Bias = feedforward or output bias E = error equal to (PV – SP) or (SP – PV) E(n-1) = error from last sample PV = process variable PV(n-1) = process variable from last sample

You can convert dependent gain constants to independent gain constants by using the following formulas: KP = K C KI = KC/(Ti(60 sec/min)) KD = KC(TD)(60 sec/min) For more information about PID control, see the Fundamentals of Process Control Theory by Paul W. Murrill (Instrument Society of America).

16-4

Page 216

Chapter 16 EAF Process Control Instructions

Loop Considerations

The number of PID loops, loop update time, and type of input and output modules are important considerations for using the PID instruction.

Consideration:

Description:

Number of PID loops

The number of PID loops that a Mini-PLC-2/17 processor can handle depends on the update time required by the loops. The longer the update time and the less sophisticated the loop control, the more loops can be controlled. Typically, when programmed in the selectable timed interrupt subroutine, the processor can control 16 loops which have a 100 ms loop update time. You can also program slower loops in the main ladder program. The PID instruction is a time-based calculation which can be triggered with timer done bits.

Loop update time

The PID instruction calculates a new control output (CO) whenever its rung changes from false to true. The PID instruction is a time-based calculation. Trigger the calculation with either timer done bits or a selectable timed interrupt subroutine to control its update time. In order for the PID instruction to operate predictably, the update time (term that you entered in word 14) must be equal to the rate at which the PID rung is toggled. The rung will be toggled at the timing value of the timer (preset x time base) or each time value of the STI. Deviation in toggle rate from the update time will degrade the accuracy of PID calculations. To get the accuracy suited to your process: • Program loops with fast response time in the selectable timed interrupt (STI) subroutine along with their corresponding block transfer instructions. • Program slower response loops in the main ladder program using timers to control the update time.

Programming

Block Transfer Instructions Use block transfer instructions to transfer data between analog I/O modules and the PID instruction. Use a block transfer read instruction for input values, Process Variable (PV), and Tieback Use a block transfer write instruction for the Control Output (CO). Make each block transfer file address (Data File entry) the same address that you enter in the PID instruction respectively for the Process Variable, Tieback, and Control Output. Also, enter the module’s location (rack, group, and module) in each block transfer instruction. PID Instruction Input/Output Data Format The PID instruction must access its PV (input) and deliver its output in a particular format: The series A and series B Mini-PLC-2/17 processor must use 12-bit binary format The series C (and later) Mini-PLC-2/17 processor lets you select 12-bit binary or 4-digit BCD.

16-5

Page 217

Chapter 16 EAF Process Control Instructions

In both cases, PID data must be limited to a range of 0-4095. Set your analog input and output modules accordingly (by selection or by default in most analog modules). The PID Output (resultant address) is always formatted in 12-bit binary, with a range of 0-4095. Scale your output module accordingly. If the module cannot be scaled to 0 to 4095 (for example, 1771-IR and -IX), the input range must be descaled (refer to the section on descaling inputs on page 16-23). Tieback Input Tieback is an optional input used only when a hardware automatic/manual station is connected. It allows the PID instruction to track the station for bumpless transfer from manual to automatic. If Tieback is not needed, program its Get instruction with a dummy address. PID Control Block The control block is 24 words long. You need the control block to enter parameters, their signs, and selected features. Use a File-to-File Move (File 10) and then a Hexadecimal Data Monitor (Display 1) to display and enter data into the control block. We recommend displaying only the first 17 words, since the last 7 words are reserved for use by the instruction. Set/reset status and sign bits of words 01 and 02 using a Binary Data Monitor (Display 0). Each entry in the PID Control Block is displayed in 4-digit BCD. Parameters that must be entered directly into the control block (Set Output, Set Point, Feedforward, etc.) must be entered in this format only. For example, if the feedforward value is binary analog input, it must be converted to 4-digit BCD before being transferred into the PID Control Block. The series D update added two new bits to Control Word 02: the Resume Control From Last State bit and the Bumpless Transfer With Proportional Controllers bit. Resume Control from Last State The Resume bit is located in the PID Control Block Word 02, Bit 10. When this bit is set, you can select a PID resume function to be performed when switching from Program to Run mode.

16-6

Page 218

Chapter 16 EAF Process Control Instructions

Important:Do not set this bit when entering the PID instruction in Program mode. Since the PID instruction has not been executed yet, there is nothing to resume in Run mode. Set this bit only after the PID instruction has been executed in Run mode at least once. Bumpless Transfer with Proportional Controllers The Bumpless Transfer bit is located in the PID Control Block Word 02, Bit 11. This bit provides a bumpless transfer from manual mode to auto mode for loops that have no integral term (KI=0). When this bit is set, a Bias value is calculated and stored in the PID control file to account for the difference between the Proportional Term and the manually adjusted Control Output (CO). When you switch back to auto mode, this Bias value is added to the PID calculation to produce a CO value equal to the last manually adjusted CO value (thus achieving a bumpless transfer). Important:In this mode, the range on the Feedforward is 0-FFFF (hexadecimal). The Feedforward/Bias Sign Bit (Word 02 Bit 02) is still valid. Table 16.B, Table 16.C, Table 16.D and Table 16.E explain the functions of all of the words and bits in the PID Control Block.

16-7

Page 219

Chapter 16 EAF Process Control Instructions

Table 16.B Control Word 01 Bit Descriptions: Status Bits 00

- Equation (Set by User) Independent Gain =0

Dependent Gain = 1

01

- Mode (Set by User) Auto = )

Manual = 1

02

- Control Action (Set by User) Direct (SP-PV) = 0

Reverse (PV-SP) = 1

03

- Output Limiting (Set by User) No = 0

Yes = 1

04

- Set Output (Set by User) Inhibited = 0

Enabled = 1

05

- Cascade Bit (Set by User) 3 No = 0 Secondary Cascade Loop = 1

06

- Derivative Uses Error (set by User) 3 PV = 0 E=1

07

- Input Format (for Series C or later) Binary = 0 BCD = 1

10

- Dead Band (set by Instruction) 1 Out of DB = 0 Within DB = 1

11

- Maximum Output Alarm (set by Instruction) 1 Within limit = 0 Above limit = 1

12

- Minimum Output Alarm (Set by Instruction) 1 Within limit = 0 Below limit = 1

13

- Set point Error (Set by Instruction) 1 In range = 0 Out of range = 1

14

- Reserved

15

- Done bit (set by Instruction) 1 Not executed = 0 Executed = 1

16

- Reserved

17

- Enabled bit (set by Instruction) 1 Not enabled = 0 Enabled = 1

1 2 3

16-8

2

2

Do not change. Values are set by PID function. Do not change Reserved bits. Do not change while the processor is operating.

Page 220

Chapter 16 EAF Process Control Instructions

Table 16.C Control Word 02 Bit Descriptions: Status and SIgn Bits 00

-

01

- KP/10 (Set by User) Do not move decimal = 0 Move decimal = 1

02

- Feedforward/Bias Sign (Set by User) Pos = 0 Neg = 1

03

- Maximum Scaling Sign (Set by User) Pos = 0 Neg = 1

04

- Minimum Scaling Sign (Set by User) Pos = 0 Neg = 1

05

- Set Point Sign (Set by User) Pos = 0 Neg = 1

06

- Process Variable Sign (Set by Instruction) 1 Pos = 0 Neg = 1

07

- Error Sign (Set by Instruction) 1 Pos = 0 Neg = 1

10

- Resume Control From Last State 2 Disabled - on first scan, a new CO is calculated Enabled = on first scan, the accumulated integral value is back-calculated from the last CO value

11

- Bumpless Transfer With Proportional Controllers 3 0 = no adjustment to Bias 1 = bumpless manual to auto mode by adjusting Bias

1 2 3

KIx10 (Set by User) Do not move decimal = 0 Move decimal to right = 1

Do not change these values. They are set by the PID function. This bit should only be set after the PID program has been run to obtain a valid last CO value Do not change while the processor is operating.

16-9

Page 221

Chapter 16 EAF Process Control Instructions

Table 16.D Words 03 through 09

All range values are unitless unless noted otherwise. Independent Gain Equation Range

Range

Dependent Gain Equation Word 03

0000-9999

Set Point - SP Word 04

00.00-99.99

Word 05

Range

Range 1 2 3

16-10

Term 1/TI Range 00.00-99.99

Integral Gain

Units Word 06

Term KD Range Bit set 00.01-99.99 Bit reset 000.1-999.9 Units - sec

Unites - min

3

Range

Feedforward - FFWD 1 Word 08

0000-9999

Maximum Scaling Value 1 Word 09

0000-9999 rep/min

Term TD Range 00.00-99.99

Derivative Gain

Word 07 0000-4095 or 0000-FFFF

0000-9999

Range 00.00-99.99

Proportional Gain

Term KI Range Bit Set 0.000-9.999 Bit reset 0.000-9.999 Units rep/sec

Range

Range 1

Minimum Scaling Value

Can be negative number by setting appropriate sign bits. Do not change while processor is operating. With word 02 Bit 11 set.

Range 2

Range

0000-4095 or 0000-FFFF

0000-9999

0000-9999

3