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

The text of a manual · part 54 of 68

DL405 User Manual: Chapter 8: PID Loop Operation (DL450 only), pages 479 to 488

Pages 479 to 488 of 608, from DL405 User Manual

The original document is the PDF (8.2 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 AutomationDirect D4-08B-1, AutomationDirect D4-08ND3S, AutomationDirect D4-16TA, PLC Direct D4-16TD2, AutomationDirect D4-32ND3-1, Konnect-It D4-08B-1, Koyo D4-08B-1, Konnect-It D4-08ND3S, and 6 more models

Page 479

PID Loop Operation (DL450 only)

8--51

Using Other PID Features How to Change Loop Modes

The first three bits of the PID Mode 1 word V+00 requests the operating mode of the corresponding loop. Note: These bits are mode change requests, not commands (certain conditions can prohibit a particular mode change -- see next page).

PID Mode 1 Setting V+00 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Manual Cascade Automatic

The normal state of these mode request bits is “000”. To request a mode change, you must SET the corresponding bit to a “1”, for one scan. The PID loop controller automatically resets the bits back to “000” after it reads the mode change request. Methods of requesting mode changes are: S DirectSOFT’s PID View -- this is the easiest method. Use the drop--down menu, or click on one of the radio buttons if using older DirectSOFT versions, and the appropriate bit will be set.

S

Ladder program-- ladder logic can request any loop mode when the PLC is in Run Mode. This will be necessary after application startup.

S

X0

Go to Auto Mode B2000.1 SET

Operator panel -- interface the operator’s panel to ladder logic using standard methods, then use the technique above to set the mode bit.

Since we can only request mode changes, the PID loop controller decides when to permit mode changes and provides the loop mode status. It reports the current mode on bits 0, 1, and 2 of the Loop Mode and Alarm Status word, location V+06 in the loop table. The parallel request / monitoring functions are shown in the figure below. The figure also shows the mode-dependent two possible SP sources, and the two possible Control Output sources. Input from Operator

Manual

Cascade

Control Output Setpoint +

Normal Source Auto/Manual

Error Term

Σ --

Loop Calculation

Auto/Cascade

Process Variable Mode Select PID Mode Control

PID Mode 1 Setting V+00 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Mode Request

Cascade

Manual Automatic

Loop Mode and Alarm Status V+06 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Mode Monitoring

Cascade

Manual Automatic

DL405 User Manual, 4th Edition

Maintenance

Control Output from another loop

PID Loop Operation (DL450 Only)

Use the rung shown to the right to SET the mode bit on (do not use an out coil). On a 0--1 transition of X0, the rung sets the Auto bit = 1. The loop controller resets it.

Page 480

8--52

PID Loop Operation (DL450 only)

Operator Panel Control of PID Modes

Since the modes Manual, Auto, and Cascade are the most fundamental and important PID loop controls, you may want to “hard-wire” mode control switches to an operator’s panel. Most applications will need only Manual and Auto selections (Cascade is used in a few advanced applications). Remember that mode controls are really mode request bits, and the actual loop mode is indicated elsewhere. The following figure shows an operator’s panel using momentary push-buttons to request PID mode changes. The panel’s mode indicators do not connect to the switches, but interface to the corresponding data locations. Operator’s Panel Manual Auto

Mode Request PID Mode 1 Setting V+00

Maintenance and Troubleshooting

PID Loop Operation (DL450 Only)

Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Cascade

Mode Monitoring

Loop Mode and Alarm Status V+06 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

PLC Modes’ Effect on Loop Modes

The modes of the PLC (Program, Run) interact with the loops as a group. The following summarizes this interaction: S When the PLC is in Program Mode, all loops are placed in Manual Mode and no loop calculations occur. However, note that output modules (including analog outputs) turn off in PLC Program Mode. So, actual manual control is not possible when the PLC is in Program Mode. S The only time the CPU will allow a loop mode change is during PLC run Mode operation. As such, the CPU records the modes of all 16 loops as the desired mode of operation. If power failure and restoration occurs during PLC run Mode, the CPU returns all loops to their prior mode (which could be Manual, Auto, or Cascade). S On a Program-to-Run mode transition, the CPU forces each loop to return to its prior mode recorded during the last PLC Run Mode. S You can add and configure new loops only when the PLC is in Program Mode. New loops automatically begin in Manual Mode.

Loop Mode Override

In normal conditions and during PLC Run Mode operation, the mode of a loop is determined by the request to V+00, bits 0, 1, and 2. However, a condition exists which will prevent a requested mode change from occurring: S A major loop of a cascaded pair of loops cannot go from Manual to Auto until its minor loop is in Cascade mode. In other situations, the PID loop controller will automatically change the mode of the loop to ensure safe operation: S A loop which develops an error condition automatically goes to Manual. S If the minor loop of a cascaded pair of loops leaves Cascade Mode for any reason, its major loop automatically goes to Manual Mode.

DL405 User Manual, 4th Edition

Page 481

PID Loop Operation (DL450 only)

8--53

Creating an Analog The DL450 does not support a built in filter, however, your analog inputs can be filtered effectively using the following RLL program example. Be sure to change the Filter in Ladder example memory locations to those that fit your application. Logic Filtering can induce a 1 part in 1000 error in your output because of “rounding”. Because of the rounding error, you should not use zero or full scale as alarm points. Additionally, the smaller the filter constant the greater the smoothing effect, but the slower the response time. Be certain that a slower response is acceptable in controlling your process. SP1

LD V2000

BIN

BTOR

SUBR V1400

Loads the analog signal, which is a BCD value and has been loaded from V-memory location V2000, into the accumulator. Contact SP1 is always on. Converts the BCD value in the accumulator to binary. This instruction is not needed if the analog value is originally brought in as a binary number. Converts the binary value in the accumulator to a real number.

MULR R0.2

Multiplies the real number in the accumulator by 0.2 (the filter factor), and stores the result in the accumulator. This is the filtered value.

ADDR V1400

Adds the real number stored in location V1400 to the real number filtered value in the accumulator, and stores the result in the accumulator.

OUTD V1400

BCD

OUT V1402

Copies the value in the accumulator to location V1400.

Converts the real number in the accumulator to a binary value, and stores the result in the accumulator. Converts the binary value in the accumulator to a BCD number. Note: the BCD instruction is not needed for PID loop PV (loop PV is a binary number). Loads the BCD number filtered value from the accumulator into location V1402 to use in your application or PID loop.

DL405 User Manual, 4th Edition

Maintenance

RTOB

PID Loop Operation (DL450 Only)

Subtracts the real number stored in location V1400 from the real number in the accumulator, and stores the result in the accumulator. V1400 is the designated workspace in this example.

Page 482

8--54

PID Loop Operation (DL450 only)

Use the DirectSOFT 5 Filter Intelligent Box Instruction

For those who are using DirectSOFT 5, you have the opportunity to use the Analog Helper Intelligent Boxes (IBox) instructions. Following is one example which is available. IBox instruction IB--402, Filter Over Time in Binary (decimal) will perform a first--order filter on the Raw Data on a defined time interval. The equation is,

Maintenance and Troubleshooting

PID Loop Operation (DL450 Only)

New = Old + [(Raw -- Old)/FDC] where, New = New Filtered Value Old = Old Filtered Value FDC = Filter Divisor Constant Raw = Raw Data The Filter Divisor Constant is an integer in the range K1 to K100, such that if it equaled K1, then no filtering is performed.

FilterB Example

The rate at which the calculation is performed is specified by time in hundredths of a second (0.01 seconds) as the Filter Freq Time parameter. Note that this Timer instruction is embedded in the IBox and must NOT be used any other place in your program. Power flow controls whether the calculation is enabled. If it is disabled, the Filter Value is not updated. On the first scan from Program to Run mode, the Filter Value is initialized to 0 to give the calculation a consistent starting point. Since the following binary filter example does not write directly to the PID PV location, the BCD filter could be used with BCD values and then converted to BIN. Following is an example of how the FilterB IBox is used in a ladder program. The instruction is used to filter a binary value that is in V2000. Timer (T1) is set to 0.5 seconds, the rate at which the filter calculation will be performed. The filter constant is set to 3.0. A larger value will increase the smoothing effect of the filter. A value of 1 results with no filtering. The filtered value will be placed in V2100.

See DL405 IBox Instructions PLC User Manual Supplement for more detailed information. NOTE: In order to use the IBox instructions found in DirectSOFT 5, the D4--450 CPU must have firmware version 3.30 or higher installed.

DL405 User Manual, 4th Edition

Page 483

PID Loop Operation (DL450 only)

8--55

Ramp/Soak Generator Introduction

Our discussion of basic loop operation noted the setpoint for a loop will be generated in various ways, depending on the loop operating mode and programming preferences. In the figure below, the ramp/soak generator is one of the ways the SP may be generated. It is the responsibility of your ladder program to ensure only one source attempts to write the SP value at V+02 at any particular time.

If the SP for your process rarely changes or can tolerate step changes, you probably will not need to use the ramp/soak generator. However, some processes require precisely--controlled SP value changes. The ramp/soak generator can greatly reduce the amount of programming required for these applications.

Maintenance

DL405 User Manual, 4th Edition

PID Loop Operation (DL450 Only)

The terms “ramp” and “soak” have special meanings in the process control industry, and refer to desired setpoint (SP) values in temperature control applications. In the figure to the right, the setpoint increases during the ramp segment. It remains steady at one value during the soak segment. Complex SP profiles can be generated by specifying a series of ramp/soak segments. The ramp segments are specified in SP units per second. The soak time is also programmable in minutes. It is instructive to view the ramp/soak generator as a dedicated function to generate SP values, as shown below. It has two categories of inputs which determine the SP values generated. The ramp/soak table must be programmed in advance, containing the values that will define the ramp/soak profile. The loop reads from the table during each PID calculation as necessary. The ramp/soak controls are bits in a special loop table word that control the real--time start/stop functionality of the ramp/soak generator. The ladder program can monitor the status of the ramp soak profile (current ramp/segment number).

Page 484

8--56

PID Loop Operation (DL450 only)

Maintenance and Troubleshooting

PID Loop Operation (DL450 Only)

Now that we have described the general ramp/soak generator operation, we list its specific features: S Each loop has its own ramp/soak generator (use is optional). S You may specify up to eight ramp/soak steps (16 segments). S The ramp soak generator can run anytime the PLC is in Run mode. Its operation is independent of the loop mode (Manual or Auto). S Ramp/soak real--time controls include Start, Hold, Resume, and Jog. S Ramp/soak monitoring includes Profile Complete, Soak Deviation (SP minus PV), and current ramp/soak step number. The following figure shows a SP profile consisting of ramp/soak segment pairs. The segments are individually numbered as steps from 1 to 16. The slope of each of the ramp may be either increasing or decreasing. The ramp/soak generator automatically knows whether to increase or decrease the SP based on the relative values of a ramp’s end points. These values come from the ramp/soak table.

Ramp/Soak Table

The parameters which define the ramp/soak profile for a loop are in a ramp/soak table. Each loop may have its own ramp/soak table, but it is optional. Recall the Loop Parameter table consists a 32--word block of memory for each loop, and together they occupy one contiguous memory area. However, the ramp/soak table for a loop is individually located, because it is optional for each loop. An address pointer in location V+34 in loop table specifies the starting location of the ramp/soak table. In the example to the right, the loop parameter tables for Loop #1 and #2 occupy contiguous 32--word blocks as shown. Each has a pointer to its ramp/soak table, independently located elsewhere in user V--memory. Of course, you may locate all the tables in one group, as long as they do not overlap.

DL405 User Manual, 4th Edition

Page 485

PID Loop Operation (DL450 only)

8--57

The parameters in the ramp/soak table must be user--defined. the most convenient way is to use DirectSOFT, which features a special editor for this table. Four parameters are required to define a ramp and soak segment pair, as pictured below. S Ramp End Value y specifies the destination SP value for the end of the ramp. Use the same data format for this number as you use for the SP. It may be above or below the beginning SP value, so the slope could be up or down (we don’t have to know the starting SP value for ramp #1). S Ramp Slope y specifies the SP increase in counts (units) per second. It is a BCD number from 00.00 to 99.99 (uses implied decimal point). S Soak Duration y specifies the time for the soak segment in minutes, ranging from 000.1 to 999.9 minutes in BCD (implied decimal point). S Soak PV Deviation y (optional) specifies an allowable PV deviation above and below the SP value during the soak period. A PV deviation alarm status bit is generated by the ramp/soak generator. Ramp End SP Value

Soak duration segment becomes active

Ramp/Soak Table V+00

XXXX

Ramp End SP Value

V+01

XXXX

Ramp Slope

V+02

XXXX

Soak Duration

V+03

XXXX

Soak PV Deviation

The ramp segment becomes active when the previous soak segment ends. If the ramp is the first segment, it becomes active when the ramp/soak generator is started, and automatically assumes the present SP as the starting SP. Step

Description

Addr Offset

Step

+ 00 + 01

1 1

Ramp End SP Value Ramp Slope

+ 20 + 21

9 9

Ramp End SP Value Ramp Slope

+ 02

2

Soak Duration

+ 22

10

Soak Duration

+ 03

2

Soak PV Deviation

+ 23

10

Soak PV Deviation

+ 04

3

Ramp End SP Value

+ 24

11

Ramp End SP Value

+ 05

3

Ramp Slope

+ 25

11

Ramp Slope

+ 06

4

Soak Duration

+ 26

12

Soak Duration

+ 07

4

Soak PV Deviation

+ 27

12

Soak PV Deviation

+ 10

5

Ramp End SP Value

+ 30

13

Ramp End SP Value

+ 11

5

Ramp Slope

+ 31

13

Ramp Slope

+ 12

6

Soak Duration

+ 32

14

Soak Duration

+ 13

6

Soak PV Deviation

+ 33

14

Soak PV Deviation

+ 14

7

Ramp End SP Value

+ 34

15

Ramp End SP Value

+ 15

7

Ramp Slope

+ 35

15

Ramp Slope

+ 16

8

Soak Duration

+ 36

16

Soak Duration

+ 17

8

Soak PV Deviation

+ 37

16

Soak PV Deviation

Description

DL405 User Manual, 4th Edition

Maintenance

Addr Offset

PID Loop Operation (DL450 Only)

SP

Slope

Soak PV deviation

Page 486

8--58

PID Loop Operation (DL450 only)

Ramp/Soak Table Flags

Many applications do not require all 16 R/S steps. Use all zeros in the table for unused steps. The R/S generator ends the profile when it finds ramp slope = 0. The individual bit definitions of the Ramp/Soak Table Flag (Addr+33) word is listed in the following table. Bit

Ramp/Soak Flag Bit Description

Read/Write

Bit=0

Bit=1

0 1

Start Ramp/Soak Profile Hold Ramp/Soak Profile write write

---

0¤1 Start 0¤1 Hold

2

Resume Ramp/soak Profile write

--

3

Jog Ramp/Soak Profile write

--

0¤1 Resume 0¤1 Jog

4

Ramp/Soak Profile Complete read

--

Complete

5

PV Input Ramp/Soak Deviation read

Off

On

6

Ramp/Soak Profile in Hold read

Off

On

7

Reserved read

Off

On

Current Step in R/S Profile read

8--15

Maintenance and Troubleshooting

PID Loop Operation (DL450 Only)

Ramp/Soak Generator Enable

Ramp/Soak Controls decode as byte (hex)

The main enable control to permit ramp/soak generation of the SP value is accomplished with bits 11 in the PID Mode 1 Setting V+00 word, as shown to the right. The other ramp/soak controls in V+33 shown in the table above will not operate unless this bit=1 during the entire ramp/soak process. The four main controls for the ramp/soak generator are in bits 0 to 3 of the ramp/soak settings word in the loop parameter table. DirectSOFT controls these bits directly from the ramp/soak settings dialog. However, you must use ladder logic to control these bits during program execution. We recommend using the bit--of--word instructions. Ladder logic must set a control bit to a “1“ to command the corresponding function. When the loop controller reads the ramp/soak value, it automatically turns off the bit for you. Therefore, a reset of the bit is not required when the CPU is in Run Mode. The example program rung to the right shows how an external switch X0 can turn on and the PD contact uses the leading edge to set the proper control bit to start the ramp soak profile. This uses the Set Bit--of--Word instruction.

DL405 User Manual, 4th Edition

Page 487

PID Loop Operation (DL450 only)

8--59

The normal state for the ramp/soak control bits is all zeros. Ladder logic must set only one control bit at a time. S Start y a 0 to 1 transition will start the ramp soak profile. The CPU must be in Run Mode, and the loop can be in Manual or Auto Mode. If the profile is not interrupted by a Hold or Jog command, it finishes normally. S Hold y a 0 to 1 transition will stop the ramp/soak profile in its current state, and the SP value will be frozen. S Resume y a 0 to 1 transition cause the ramp/soak generator to resume operation if it is in the hold state. The SP values will resume from their previous value. S Jog y a 0 to 1 transition will cause the ramp/soak generator to truncate the current segment (step), and go to the next segment. Ramp/Soak Profile Monitoring

You can monitor the Ramp/Soak profile status using other bits in the Ramp/Soak Settings V+33 word, shown to the right. R/S Profile Complete y =1 when the last programmed step is done. S Soak PV Deviation y =1 when the error (SP--PV) exceeds the specified deviation in the R/S table. S R/S Profile in Hold y =1 when the pro file was active but is now in hold. Ramp/ Soak Settings V+33. S

PID Loop Operation (DL450 Only)

Ramp/Soak Programming Errors

Maintenance

The number of the current step is available in the upper 8 bits of the Ramp/Soak Settings V+33 word. The bits represent a 2--digit hex number, ranging from 1 to 10. Ladder logic can monitor these to synchronize other parts of the program with the ramp/soak profile. Load this word to the accumulator and shift right 8 bits, and you have the step number. The starting address for the ramp/soak table must be a valid location. If the address points outside the range of user V--memory, one of the bits to the right will turn on when the ramp/soak generator is started. We recommend using DirectSOFT to configure the ramp/soak table. It automatically range checks the addresses for you.

Testing Your It’s a good idea to test your ramp/soak profile before using it to control the process. Ramp/Soak Profile This is easy to do, because the ramp/soak generator will run even when the loop is in Manual Mode. Using DirectSOFT’s PID View will be a real time--saver, because it will draw the profile on--screen for you. Be sure to set the trending timebase slow enough to display completed ramp--soak segment pairs in the waveform window.

DL405 User Manual, 4th Edition

Page 488

8--60

PID Loop Operation (DL450 only)

DirectSOFT Ramp/Soak Example The following example will step you through the Ramp/Soak setup.

Maintenance and Troubleshooting

PID Loop Operation (DL450 Only)

Setup the Profile in The first step is to use Setup in DirectSOFT PID to set the profile of your process. Open the Setup PID window and select the R/S tab, and then enter the Ramp/Soak PID Setup data. Note the V--memory location for the beginning of this profile is V5000, and V5037 is the end of the range of the profile.

DL405 User Manual, 4th Edition