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

The text of a manual · part 11 of 38

DL06 Micro PLC User Manual, Volume 2 of 2, pages 100 to 109

Pages 100 to 109 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.

For the AutomationDirect Direct Logic DL06

Page 100

Chapter 8: PID Loop Operation

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D

Ramp/Soak Table Location (Addr + 34) Each loop that you configure has the option of using a built-in Ramp/Soak generator dedicated to that loop. This feature generates SP values that follow a profile. To use the Ramp Soak feature, you must program a separate table of 32 words with appropriate values. A DirectSOFT 5 dialog box makes this easy to do. In the loop table, the Ramp/Soak Table Pointer at Addr+34 must point to the start of the ramp/soak data for that loop. This may be anywhere in user memory, and does not have to adjoin to the Loop Parameter table, as shown to the left. Each R/S table requires 32 words, regardless of the number of segments programmed. The ramp/soak table parameters are defined in the table below. Further details are in the section on Ramp/Soak Operation in chapter 8.

V–Memory Space User Data V2000 V2037

LOOP #1 32 words

LOOP #2 32 words

V3000

Ramp/Soak #1 32 words

V2034 = 3000 Octal Pointer to R/S table

8–24

Addr Offset

Step

+ 00 + 01 + 02 + 03 + 04 + 05 + 06 + 07 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17

1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8

Description

Addr Offset

Step

+ 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37

9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16

Ramp End SP Value Ramp Slope Soak Duration Soak PV Deviation Ramp End SP Value Ramp Slope Soak Duration Soak PV Deviation Ramp End SP Value Ramp Slope Soak Duration Soak PV Deviation Ramp End SP Value Ramp Slope Soak Duration Soak PV Deviation

Description Ramp End SP Value Ramp Slope Soak Duration Soak PV Deviation Ramp End SP Value Ramp Slope Soak Duration Soak PV Deviation Ramp End SP Value Ramp Slope Soak Duration Soak PV Deviation Ramp End SP Value Ramp Slope Soak Duration Soak PV Deviation

Ramp/Soak Table Programming Error Flags (Addr + 35) The individual bit definitions of the Ramp/Soak Table Programming Error Flags word (Addr+35) is listed in the following table. Further details are given in the PID Loop Mode section and in the PV Alarm section later in chapter 8. Bit

R/S Error Flag Bit Description

0 Starting Addr out of lower V-memory range 1 Starting Addr out of upper V-memory range 2–3 Reserved for Future Use 4 Starting Addr in System Parameter V-memory Range 5–15 Reserved for Future Use

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Read/Write

Bit=0

Bit=1 read read – read –

– – – – –

Error Error – Error –

Page 101

Chapter 8: PID Loop Operation

Configure the PID Loop

1 2 3 4 5 6 7 8 Select the Algorithm Type Chose either Position or Velocity. The default algorithm is Position. This is the choice for most applications which include heating and cooling loops as well as most position and level 9 control loops. A typical velocity control will consist of a process variable such as a flow totalizer in a flow control loop. 10 Enter the Sample Rate The main tasks of the CPU fall into categories as shown to the right. 11 The list represents the tasks done when the CPU is in Run Mode, on each PLC scan. Note that PID loop calculations occur after the ladder 12 logic task. The sample rate of a control loop is simply the frequency of the PID 13 calculation. Each calculation generates a new control output value. With the DL06 CPU, you can set the sample rate of a loop from 50 ms to 99.99 seconds. Most loops do not require a fresh PID calculation on 14 every PLC scan. Some loops may need to be calculated only once in 1000 scans. A Enter 0.05 sec., or the sample rate of your choice, for each loop, and the CPU automatically schedules and executes PID calculations on the B appropriate scans. C NOTE: If more than 4 loops are programmed, enter a minimum of 0.1 second. D Once the PID table is established in V-memory, configuring the PID loop continues with the DirectSOFT 5 PID setup configuration dialog. You will need to check and fill in the data required to control the PID loop. Select Configure and the following dialog will appear for this process.

Read Inputs

Service Peripherals

PLC Scan

Ladder Program

Calculate PID Loops

Internal Diagnostics

Write Outputs

DL06 Micro PLC User Manual, 3rd Edition Rev. A

8–25

Page 102

Chapter 8: PID Loop Operation

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–26

Select Forward/Reverse It is important to know which direction the control output will respond to the error (SP-PV), either forward or reverse. A forward (direct) acting control loop means that whenever the control output increases, the process variable will also increase. The control output of most PID loops are forward acting, such as a heating control loop. An increase in heat applied will increase the PV (temperature). A reverse acting control loop is one where an increase in the control output results in a decrease in the PV. A common example of this would be a refrigeration system, where an increase in the cooling input causes a decrease in the PV (temperature). The Transfer Mode Choose either Bumpless I or Bumpless II to provide a smooth transition of the control output from Manual Mode to Auto Mode. Choosing Bumpless I will set the SP equal to the PV when the control output is switched from Manual to Auto. If this is not desired, choose BumplessII. The characteristics of Bumpless I and II transfer types are listed in the chart below. Note that their operation also depends on which PID algorithm you are using, the position or velocity form of the PID equation. Note that you must use Bumpless Transfer type I when using the Transfer TransferType Select Bit 3

Manual-to-Auto Transfer Action

PID Algorithm

Forces Bias = Control Output Forces Major Loop Output = Forces SP = PV Minor Loop PV Forces Major Loop Output = Forces SP = PV Minor Loop PV Forces Bias = Control Output none none none

Position

Bumpless Transfer I

0

Bumpless Transfer II

1

Auto-to-Cascade Transfer Action

Velocity Position Velocity velocity form of the PID algorithm. The transfer type can also be selected in a RLL program by setting bit 3 of PID Mode 1, V+00 setting as shown. PID Mode 1 Setting V+00

Bumpless Transfer I/II Select Bit 15 14 13 12 11 10 9 8

7

6 5

4

3

2 1

0

SP/PV & Output Format This block allows you to select either Common format or Independent format. Common format is the default and is most commonly used. With this format both SP/PV and Output will have the same data structure. Both will have the same number of bits and either bipolar or unipolar. If Independent format is selected, the data structure selections will be grayed out. The reason for this is that they become independently selectable in the SP/PV and the Output dialogs. Common Data Format Select either Unipolar data format (which is positive data only) in 12 bit (0 to 4095), 15 bit (0 to 32767), or 16 bit (0 to 65535) format, or Bipolar data format, which ranges from negative to positive (-4095 to 4095 or -32767 to 32767) and requires a sign bit. Bipolar selection displays input/output as magnitude plus sign, not two’s complement. The bipolar selection is not available when 16-bit data format is selected. DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 103

Chapter 8: PID Loop Operation Setpoint V+02

兺

Loop Calculation

Control Output V+05

1 2 3 4 5 6 The data format determines the numerical interface between the PID loop and the PV sensor, 7 and the control output device. This selects the data format for both the SP and the PV. Loop Mode 8 Loop Mode is a special feature that allows the PID loop controller to perform closed-loop control while the CPU is in the Program Mode. Careful thought must be taken before using 9 this feature called Independent of CPU mode in the dialog. Before continuing with the PID setup, a knowledge of the three PID loop modes will be helpful. The DL06 provides the three standard control modes: Manual, Automatic, and Cascade. The 10 sources of the three basic variables SP, PV and control output are different for each mode. In Manual Mode, the loop is not executing PID calculations (however, loop alarms are still 11 active). With regard to the loop table, the CPU stops writing values to location V+05 (control output) for that loop. It is expected that an operator or other intelligent source is manually 12 controlling the output by observing the PV and writing data to the control output as necessary to keep the process under control. The drawing below shows the equivalent schematic diagram of manual mode operation. 13 14 A In Automatic Mode, the loop operates normally and generates new control output values. It B calculates the PID equation and writes the result in location V+05 every sample period of that loop. The equivalent schematic diagram is shown below. C D +

–

Process Variable V+03

PID Mode 2 Setting V+01

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

Data formats

LSB

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

Select data format using bits 0 and 1.

00

12 bit unipolar

0 to 0FFF (0 to 4095)

01

12 bit bipolar

0 to 0FFF, 8FFF to 8001 (0 to 4095, *–4095 to 4095)

10

15 bit unipolar

0 to 32767

11

15 bit bipolar

0 to 7FFF, FFFF to 8001 (0 to 32767, *–32767 to 32767)

= sign bit

* Magnitude plus sign

Input from Operator

Manual

Control Output V+05

Loop Calculation

Auto

Input from Operator

Manual

Control Output V+05

Loop Calculation

Auto

DL06 Micro PLC User Manual, 3rd Edition Rev. A

8–27

Page 104

Chapter 8: PID Loop Operation

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–28

In Cascade Mode, the loop operates as it does in Automatic Mode, with one important difference. The data source for the SP changes from its normal location at V+02 to using the control output value, V+05, from another loop. So in Auto or Manual modes, the loop calculation uses the data at V+02. In Cascade Mode, the loop calculation reads the control output from another loop’s parameter table, V+05. Another loop Loop Calculation

Cascaded loop Cascade

Control Output V+05

Setpoint +

Normal SP V+02

Loop Calculation

Control Output

–

Auto/Manual

Process Variable

As pictured below, a loop can be changed from one mode to another, but cannot go from Manual Mode directly to Cascade, or vice versa. This mode change is prohibited because a loop would be changing two data sources at the same time, and could cause a loss of control. Manual

Automatic

Cascade

Once the CPU is operating in the Run Mode, the normal operation of the PID loop controller is to read the loop data and perform calculations on each scan of the RLL program. When the CPU is placed in the Program Mode, the RLL program halts operation and all PID loops are automatically put into the Manual Mode. The PID parameters can then be changed if desired. Similarly, by placing the CPU in the Run mode, the PID loops are returned to the operational mode which they were previously in, i.e., Manual, Automatic and Cascade. With this selection you automatically affect the modes by changing the CPU mode. CPU Modes: Program

Mode change

Run

Loop Mode Linking PID Mode 1 Setting V+00

0 = loop follows PLC mode 1 = loop is independent Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 of PLC mode Loop Modes: Manual

Mode change

Automatic

Mode change

Cascade

If bit 15 is set to one, then the loops will run independent of the CPU mode. It is like having two independent processors in the CPU...one is running the RLL program and the other is running the process loops.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 105

Chapter 8: PID Loop Operation Having the ability to run loops independently of the RLL program makes it feasible to make a ladder logic change while the process is still running. This is especially beneficial for largemass continuous processes that are difficult or costly to interrupt. The independent of CPU is the feature used for this. If you need to operate the PID loops while the RLL program is halted, in Program Mode, either select the Independent of CPU mode in the dialog or edit your program to set and reset bit 15 of PID Mode 1 word (V+00) in your RLL program. If the bit is set to a zero, the loop will follow the CPU mode, then when the CPU is placed in the Program Mode, all loops will be forced into the Manual Mode. When Independent of CPU mode is used, you should also set the PV to be read directly from an analog input module. This can easily be done in the PID setup dialog, SP/PV. The SP/PV dialog has a block entitled Process Variable. There is a block within this block called Auto Transfer From (from analog input) with the information grayed out. Checking the box to the left of the Auto Transfer From will high-light the information. Select I/O Module then enter the slot number the input module resides in. Next, select the analog input channel of your choice. The second choice is V-Memory. When this is selected, the V-memory address from where the PV is transferred from must be specified. Whichever method of auto transfer is used, it is recommended to check the Enable Filter Factor (a low pass filter) and specify the coefficient.

1 2 3 4 5 6 7 8 9 10 11 You should also select the analog output for the control output to 12 be transferred to. This is done in the PID setup Output dialog shown here. The block of information in this dialog is “grayed13 out” until the box next to Auto transfer to I/O module is checked. Once checked, enter the slot number where the output module is 14 residing and then enter the analog output channel number. A NOTE: To make changes to any loop table parameters, the PID loop must be in Manual mode and the PLC B must be stopped. If you have selected to operate the PID loop independent of the CPU mode, then you must take certain steps to make it possible to make loop parameter changes. You can temporarily make the loops follow the CPU mode by changing bit 15 to 0. Then you will be able to place the loop into Manual Mode C using DirectSOFT 5. After you change the loop’s parameter setting/s, just restore bit 15 to a value of 1 to reestablish PID operation independent of CPU. D DL06 Micro PLC User Manual, 3rd Edition Rev. A

8–29

Page 106

Chapter 8: PID Loop Operation

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–30

You may optionally configure each loop to access its analog I/O (PV and control output) by placing proper values in the associated loop table registers in your RLL program. The following figure shows the loop table parameters at V+36 and V+37 and their auto transfer role to access the analog values directly.

Setpoint V +02

Error

Loop Calculation

Control output V+05

Process variable V+03 Loop Table V2036

0X XX

Base/Slot /Channel number for PV

V2037

0X XX

Base/Slot/Channel number for Output

XX 0X Channel number 1 to 48 Slot number 1 to 4 Base 0

When these loop table parameters are programmed directly, a value of “0102” in register V2036 directs the loop controller to read the PV data from channel 1 of the analog input. A value of “0000” in either register tells the loop controller not to access the corresponding analog value directly. In that case, ladder logic must be used to transfer the value between the analog input and the loop table. NOTE: When auto transfer to/from I/O is used, the analog data for all of the channels on the analog module cannot be accessed by any other method, i.e., pointer or multiplex.

SP/PV Addresses An SP/PV dialog will be made available to setup how the setpoint (SP) and the process variable (PV) will be used in the loop. If this loop is the minor loop of a cascaded pair, enter that control output address in the Remote SP from Cascaded Loop Output area. It is sometimes desirable to limit the range of setpoint values allowed to be entered. To activate this feature, check the box next to Enable Limiting. This will activate the Upper and Lower fields for the values to be entered. Set the limits around the SP value to prevent an operator from entering a

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 107

Chapter 8: PID Loop Operation setpoint value outside of a safe range. The Square root box is only checked for certain PID loops, such as a flow control loop. If the Auto transfer from I/O module is selected, a first-order low-pass filter can be used by checking the Enable Filter box. The filter coefficient is user specified. The use of this filter is recommended during closed loop auto-tuning. If the Independent format had been checked previously, make the Data format selections here. NOTE: The SP/PV dialog can be left as it first appears for basic PID operation.

Set Control Output Limits Another dialog that will be available in the PID setup will be the Output dialog. The control output address, V+05, (determined by the PID loop table beginning address) will be in view. Enter the output range limits, Upper Limit and Lower Limit, that will meet the requirement of the process and which will agree with the data format that has been selected. For a basic PID operation using a 12 bit output module, set the Upper Limit to 4095 and leave the

Lower Limit set to 0. Check the box next for Auto transfer to I/O module if there is a need to send the control output to a certain analog output module, as in the case of using the Loop Mode independent of CPU Mode; otherwise, the PID output signal cannot control the analog output when the PLC is out of RUN Mode. If the Auto transfer to I/O module feature is checked, all channels of the module must be used for PID control outputs. If Independent format has been previously chosen, the Output Data Format will need to be setup here, that is, select Unipolar or Bipolar format and the bit structure. This area is not available and is grayed out if Common format has been chosen (see page 8-26).

WARNING: If the Upper Limit is set to zero, the output will never get above zero. In effect, there will be no control output.

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–31

Page 108

Chapter 8: PID Loop Operation

1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 8–32

Enter PID Parameters Another PID setup dialog, Tuning, is for entering the PID parameters shown as: Gain (Proportional Gain), Reset (Integral Gain) and Rate (Derivative Gain).

Recall the position and velocity forms of the PID loop equations which were introduced earlier. The equations basically show the three components of the PID calculation: Proportional Gain (P), Integral Gain (I) and Derivative Gain (D). The following diagram shows a form of the PID calculation in which the control output is the sum of the proportional gain, integral gain and derivative gain. With each calculation of the loop, each term receives the same error signal value. Loop Calculation P Setpoint

Error T erm

+ –

Process Variable

I D

+ +

Control Output

+

The P, I and D gains are 4-digit BCD numbers with values from 0000 to 9999. They contain an implied decimal point in the middle, so the values are actually 00.00 to 99.99. Some gain values have units – Proportional gain has no unit, Integral gain may be selected in seconds or in minutes, and Derivative gain is in seconds. Gain (Proportional Gain) – This is the most basic gain of the three. Values range from 0000 to 9999, but they are used internally as xx.xx. An entry of “0000” effectively removes the proportional term from the PID equation. This accommodates applications which need integral-only loops. Reset (Integral Gain) – Values range from 0001 to 9998, but they are used internally as xx.xx. An entry of “0000” or “9999”causes the integral gain to be “⬁”, effectively removing the integrator term from the PID equation. This accommodates applications which need proportional-only loops. The units of integral gain may be either seconds or minutes, as shown in the above dialog. Rate (Derivative Gain) – Values which can be entered range from 0001 to 9999, but they are used internally as XX.XX. An entry of “0000” allows removal of the derivative term from the PID equation (a common practice). This accommodates applications which require only proportional and/or integral loops. Most control loops will operate as a PI loop.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

Page 109

Chapter 8: PID Loop Operation

NOTE: You may elect to leave the tuning dialog blank and enter the tuning parameters in the DirectSOFT 5 PID View.

1 2

3 4 5 6 7 Derivative Gain Limiting The derivative gain (rate) has an optional gain-limiting feature. This is provided because the derivative gain reacts badly to PV signal noise or other causes of sudden PV fluctuations. The 8 function of the gain-limiting is shown in the diagram below. The gain limit can be particularly useful during loop tuning. Most loops can tolerate only a 9 little derivative gain without going into uncontrolled oscillations. If this option is checked, a Limit from 0 to 20 must also be entered. 10 NOTE: When first configuring a loop, it’s best to use the standard error term until after the loop is tuned. Once the loop is tuned, you will be able to tell if these functions will enhance control. The Error Squared 11 and/or Enable Deadband can be selected later in the PID setup. Also, values are not required to be entered in the Tuning dialog, but they can set later in the DirectSOFT 5 PID View. 12 Error Term Selection 13 The error term is internal to the CPUs PID loop controller, and is generated again in each PID calculation. Although its data is not directly accessible, you can easily calculate it by subtracting: Error = (SP–PV). If the PV square-root extract is enabled, then: Error = 公PV 14 In any case, the size of the error and algebraic sign determine the next change of the control output for each PID calculation. A Error Squared – When selected, the squared error function simply squares the error term (but preserves the original algebraic sign), which is used in the calculation. This affects the Control B Output by diminishing its response to smaller error values, but maintaining its response to larger errors. Some situations in which the error squared term might be useful: • Noisy PV signal – using a squared error term can reduce the effect of low-frequency electrical noise C on the PV, which will make the control system jittery. A squared error maintains the response to larger errors. D • Non-linear process – some processes (such as chemical pH control) require non-linear controllers Loop Calculation

P

Error T erm

Setpoint

I

+

–

D

Proportional

Control Output

+ +

Integral

Derivative

0

Derivative, gain-limited

1

+

Process Variable

Loop Table

V+25

00XX

P ID Mode 1 Setting V+00

Derivative Gain Limit

Bit 15 14 13 12 11 10 9 8 7

6 5

4 3

2 1

0

Derivative gain limit select for best results. Another application is surge tank control, where the Control Output signal must be smooth.

DL06 Micro PLC User Manual, 3rd Edition Rev. A

8–33