PID Operations for IEC

See also: IEC 61131 Language Editor Programming

See also: Project Toolbox for IEC

 

Topic Menu

 

Home > View > Project Toolbox > PID Operations

 

PID Independent

Also called: PID_IND

 

Operator - Performs the proportional integral derivative (PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal.) algorithm.

 

Inputs

CB[ ] : Input the values of the register usage mentioned below. (TYPE : INTClosed Integer - [Data Type INT] - A 16-bit signed value. Integers are used where the value of the data is expected to be in the range of -32,768 to +32,767.[])

SP : Process Setpoint (TYPE : INT) - Enter a register address, or select a named register. This is the location of the User-defined Process Setpoint value. This value may NOT be a decimal constant.

PV : Process Variable (TYPE : INT) - Enter a register address or select a named register. This is the location (typically %AIClosed 16-bit input registers used to gather analog input data such as voltages, temperatures, and speed settings coming from an attached device.) of the Process Variable value coming in from the process. This value may NOT be a decimal constant.

MAN EN : Manual / Auto BooleanClosed Boolean- [Data Type BOOL] - A single bit, binary value, or register/variable. Boolean points have only two possible values, 'TRUE' or 'FALSE'. Switch (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled Manual Input bit. This register is a Boolean (1-bit) register, typically %TClosed Non-retentive single-bit registers..

UP : Manual Mode up adjustment input (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled UP Input bit. This register is a Boolean (1-bit) register, typically %T.

DOWN : Manual Mode down adjustment (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled DOWN Input bit. This register is a Boolean (1-bit) register, typically %T.

 

Outputs

CV : The control variable result (TYPE : INT) - Enter a register address, or select a named register. This is the location (typically %AQClosed 16-bit output registers used to send analog information such a voltages, levels, or speed settings to an attached device.) of the Control Variable value going out to the process. This value may NOT be a decimal constant.

 

Remarks

Independent PID: CVout = (Kp * Error) + (Ki * Error * dt) + (Kd * Derivative) + CVBias

 

Where:

dt = Internal elapsed time clock - previous elapsed time clock

Derivative = (Error - previous Error)/dt

--or--

Derivative = (pv - previous PV)/dt

[User selectable during configuration].

Ti = Integral time

Td = Derivative time

 

Register Usage - Either PID element requires an array of sixteen (16) WORD (16-bit) registers. These will typically be of type %RClosed Retentive 16-bit registers.. This is called the Reference Array.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Deadband might then be necessary

to prevent small changes in CV values due to slight variations in error.

2

Deadband -

PV Counts

-32000 to 0

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate.

In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV.

CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

CV Counts

-32000 to +32000

 

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds to move

32000 CV counts

Determines how fast the CV value can change.

10

Config Word

N/A

N/A

Internal Use - Do not modify this value.

11

Manual Command

CV Counts

Tracks CV in Auto mode;

sets CV in Manual Mode.

In the Automatic mode this register tracks the CV value.

In the Manual Mode, this register contains the value that is output to the CV within

the clamp and slew limits.

12

Internal SP

Used by OCS

N/A

Tracks SP in

13

Internal PV

Used by OCS

N/A

Tracks PV in

14

Internal CV

Used by OCS

N/A

Tracks PV out

15

Cycle Time

Seconds

N/A

Cycle Time for PWMClosed Pulse Width Modulation (PWM) - A technique for generating a DC voltage level from a higher constant DC voltage. The constant input voltage is chopped to produce pulses at a constant period and constant amplitude. Modulating the pulse width (duration) controls the average voltage of the output. in Seconds

 

ST Language

(* PID1 is a declared instance of PID_IND function block *)

PID1 (CB[], SP, PV, MANEN, UP, DOWN);

CV := PID1.CV;

 

FBD Language

 

LD Language

 

IL Language

(* PID1 is a declared instance of PID_IND function block *)

Caution: Overlapping references will result in erratic operation of the PID algorithm.

 

Return to the Top: PID Operations for IEC

 

PID Independent with Auto Tune

PID_IND_AUTO

 

Operator - Performs the proportional integral derivative (PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal.) algorithm with auto tuning function.

 

Inputs

CB[ ] : Input the values of the register usage mentioned below. (TYPE : INT[])

SP : Process Setpoint (TYPE : INT) - Enter a register address, or select a named register. This is the location of the User-defined Process Setpoint value. This value may NOT be a decimal constant.

PV : Process Variable (TYPE : INT) -

Enter a register address or select a named register. This is the location (typically %AIClosed 16-bit input registers used to gather analog input data such as voltages, temperatures, and speed settings coming from an attached device.) of the Process Variable value coming in from the process. This value may NOT be a decimal constant.

MAN EN : Manual / Auto Boolean Switch (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled Manual Input bit. This register is a Boolean (1-bit) register, typically %TClosed Non-retentive single-bit registers..

UP : Manual Mode up adjustment input (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled UP Input bit. This register is a Boolean (1-bit) register, typically %T.

DOWN : Manual Mode down adjustment (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled DOWN Input bit. This register is a Boolean (1-bit) register, typically %T.

TUNE : Input which controls when the function should start the auto tune process. (TYPE : BOOL) - An edge triggered Boolean TUNE input starts the autotuning cycle. This input needs to be held high during the autotuning cycle. If it is negated during the AUTOTUNE cycle, the controller stops autotuning and reverts to the previous settings.

#FILTER : (TYPE : DINTClosed Double Integer - [Data Type DINT] - A 32-bit signed value. Double Integers are used where the value of the data is expected to be in the range of -2,147,483,648 to +2,147,483,647.) - This defines how far above and below the setpoint the process must go when performing the auto tune experiment. Processes with more noise should be setup with a high percentage.

Filter at 0.04% - 0

Filter at 0.09% - 1

Filter at 0.16% - 2

Filter at 0.31% - 3

Filter at 0.63% - 4

Filter at 1.25% - 5

Filter at 2.50% - 6

Filter at 5.00% - 7

#RESP : (TYPE : DINT) - This defines the relative speed of the PID loop once it is tuned.

PID_Fast - 0

PID_Medium - 1

PID_slow - 2

PID_very slow - 3

#TYPE : (TYPE : DINT) - This options allows the auto tune procedure to calculate terms for PID, PI or P terms.

Type_PID - 0

Type_PI - 1

Type_P - 2

#TUNE2/3 : (TYPE : BOOL) - This allows the auto tuning experiment to change the output based on 2/3 the set point. Use this option when it is not desired for the process to travel above the setpoint during the auto tuning experiment.

 

Outputs

CV : The control variable result (TYPE : INT) - Enter a register address, or select a named register. This is the location (typically %AQClosed 16-bit output registers used to send analog information such a voltages, levels, or speed settings to an attached device.) of the Control Variable value going out to the process. This value may NOT be a decimal constant.

DONE : The control variable result (TYPE : BOOL) - This defines an output bit that is set by the function when the auto tune is complete.

 

Remarks

Independent PID_Auto: CVout = (Kp * Error) + (Ki * Error * dt) + (Kd * Derivative) + CVBias

 

Where:

dt = Internal elapsed time clock - previous elapsed time clock

Derivative = (Error - previous Error)/dt

--or--

Derivative = (pv - previous PV)/dt

[User selectable during configuration].

Ti = Integral time

Td = Derivative time

 

Register Usage - Either PID element requires an array of sixteen (16) WORD (16-bit) registers. These will typically be of type %RClosed Retentive 16-bit registers.. This is called the Reference Array.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Deadband might then be necessary

to prevent small changes in CV values due to slight variations in error.

2

Deadband -

PV Counts

-32000 to 0

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate.

In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV.

CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

CV Counts

-32000 to +32000

 

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds

to move 32000 CV counts

Determines how fast the CV value can change.

10

Config Word

N/A

N/A

Internal Use - Do not modify this value.

11

Manual Command

CV Counts

Tracks CV in Auto mode;

sets CV in Manual Mode.

In the Automatic mode this register tracks the CV value.

In the Manual Mode, this register contains the value that is output to the CV within

the clamp and slew limits.

12

Internal SP

Used by OCS

N/A

Tracks SP in

13

Internal PV

Used by OCS

N/A

Tracks PV in

14

Internal CV

Used by OCS

N/A

Tracks PV out

15

Cycle Time

Seconds

N/A

Cycle Time for PWMClosed Pulse Width Modulation (PWM) - A technique for generating a DC voltage level from a higher constant DC voltage. The constant input voltage is chopped to produce pulses at a constant period and constant amplitude. Modulating the pulse width (duration) controls the average voltage of the output. in Seconds

Each PID element must use a distinctly separate reference Array, even if the values are identical to an exiting PID element. There can be no overlapping of PID elements.

Registers at offset 0 through 9 must be configured before the PID element is used.

 

ST Language

(* PID3 is a declared instance of PID_IND_Auto function block *)

PID3 (CB[], SP, PV, MANEN, UP, DOWN, TUNE, #FILTER, #RESP, #TYPE, #TUNE2/3);

CV := PID3.CV;

Done :=PID3.Done;

 

FBD Language

 

LD Language

 

LT Language

(* PID3 is a declared instance of PID_IND_Auto function block *)

Caution: Overlapping references will result in erratic operation of the PID algorithm.

 

Return to the Top: PID Operations for IEC

 

PID ISA

Also called: PID_ISA

 

Operator - Performs the proportional integral derivative (PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal.) algorithm.

 

Inputs

CB[ ] : Input the values of the register usage mentioned below. (TYPE : INT[])

SP : Process Setpoint (TYPE : INT) - Enter a register address, or select a named register. This is the location of the User-defined Process Setpoint value. This value may NOT be a decimal constant.

PV : Process Variable (TYPE : INT) - Enter a register address or select a named register. This is the location (typically %AIClosed 16-bit input registers used to gather analog input data such as voltages, temperatures, and speed settings coming from an attached device.) of the Process Variable value coming in from the process. This value may NOT be a decimal constant.

MAN EN : Manual / Auto Boolean Switch (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled Manual Input bit. This register is a Boolean (1-bit) register, typically %TClosed Non-retentive single-bit registers..

UP : Manual Mode up adjustment input (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled UP Input bit. This register is a Boolean (1-bit) register, typically %T.

DOWN : Manual Mode down adjustment (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled DOWN Input bit. This register is a Boolean (1-bit) register, typically %T.

 

Outputs

CV : The control variable result (TYPE : INT) - Enter a register address, or select a named register. This is the location (typically %AQClosed 16-bit output registers used to send analog information such a voltages, levels, or speed settings to an attached device.) of the Control Variable value going out to the process. This value may NOT be a decimal constant.

 

Remarks

ISA PID : CVout = Kp * (Error + (Error * dt / Ti) + (Td * Derivative)) + CVBias

 

Where:

dt = Internal elapsed time clock - previous elapsed time clock

Derivative = (Error - previous Error)/dt

--or--

Derivative = (pv - previous PV)/dt

[User selectable during configuration].

Ti = Integral time

Td = Derivative time

 

Register Usage - Either PID element requires an array of sixteen (16) WORD (16-bit) registers. These will typically be of type %RClosed Retentive 16-bit registers.. This is called the Reference Array.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Deadband might then be necessary

to prevent small changes in CV values due to slight variations in error.

2

Deadband -

PV Counts

-32000 to 0

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate.

In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV.

CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

CV Counts

-32000 to +32000

 

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds

to move 32000 CV counts

Determines how fast the CV value can change.

10

Config Word

N/A

N/A

Internal Use - Do not modify this value.

11

Manual Command

CV Counts

Tracks CV in Auto mode;

sets CV in Manual Mode.

In the Automatic mode this register tracks the CV value.

In the Manual Mode, this register contains the value that is output to the CV

within the clamp and slew limits.

12

Internal SP

Used by OCS

N/A

Tracks SP in

13

Internal PV

Used by OCS

N/A

Tracks PV in

14

Internal CV

Used by OCS

N/A

Tracks CV out

15

Cycle Time

Seconds

N/A

Cycle Time for PWMClosed Pulse Width Modulation (PWM) - A technique for generating a DC voltage level from a higher constant DC voltage. The constant input voltage is chopped to produce pulses at a constant period and constant amplitude. Modulating the pulse width (duration) controls the average voltage of the output. in Seconds

Each PID element must use a distinctly separate reference Array, even if the values are identical to an exiting PID element. There can be no overlapping of PID elements.

Registers at offset 0 through 9 must be configured before the PID element is used.

Note: Each PID element must use a distinctly separate Reference Array, even if the values are identical to an exiting PID element. There can be no overlapping of PID elements. Registers at offset 0 through 9 must be configured before the PID element is used.

ST Language

(* PID2 is a declared instance of PID_ISA function block *)

PID2 (CB[], SP, PV, MANEN, UP, DOWN);

CV := PID2.CV;

 

FBD Language

 

LD Language

 

IL Language

(* PID2 is a declared instance of PID_ISA function block *)

 

Caution: Overlapping references will result in erratic operation of the PID algorithm.

 

Return to the Top: PID Operations for IEC

 

PID ISA with Auto Tune

Also called: PID_ISA_AUTO

 

Operator - Performs the proportional integral derivative (PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal.) ISA algorithm with auto tuning function.

 

Inputs

CB[ ] : Input the values of the register usage mentioned below. (TYPE : INT[])

SP : Process Setpoint (TYPE : INT) - Enter a register address, or select a named register. This is the location of the User-defined Process Setpoint value. This value may NOT be a decimal constant.

PV : Process Variable (TYPE : INT) - Enter a register address or select a named register. This is the location (typically %AIClosed 16-bit input registers used to gather analog input data such as voltages, temperatures, and speed settings coming from an attached device.) of the Process Variable value coming in from the process. This value may NOT be a decimal constant.

MAN EN : Manual / Auto Boolean Switch (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled Manual Input bit. This register is a Boolean (1-bit) register, typically %TClosed Non-retentive single-bit registers..

UP : Manual Mode up adjustment input (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled UP Input bit. This register is a Boolean (1-bit) register, typically %T.

DOWN : Manual Mode down adjustment (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled DOWN Input bit. This register is a Boolean (1-bit) register, typically %T.

TUNE : Input which controls when the function should start the auto tune process. (TYPE : BOOL) - An edge triggered Boolean TUNE input starts the autotuning cycle. This input needs to be held high during the autotuning cycle. If it is negated during the AUTOTUNE cycle, the controller stops autotuning and reverts to the previous settings.

#FILTER : (TYPE : DINT) - This defines how far above and below the setpoint the process must go when performing the auto tune experiment. Processes with more noise should be setup with a high percentage.

  • Filter at 0.04% - 0

  • Filter at 0.09% - 1

  • Filter at 0.16% - 2

  • Filter at 0.31% - 3

  • Filter at 0.63% - 4

  • Filter at 1.25% - 5

  • Filter at 2.50% - 6

  • Filter at 5.00% - 7

#RESP : (TYPE : DINT) - This defines the relative speed of the PID loop once it is tuned.

  • PID_Fast - 0

  • PID_Medium - 1

  • PID_slow - 2

  • PID_very slow - 3

#TYPE : (TYPE : DINT) - This option allows the auto tune procedure to calculate terms for PID, PI or P terms.

  • Type_PID - 0

  • Type_PI - 1

  • Type_P - 2

#TUNE2/3 : (TYPE : BOOL) - This allows the auto tuning experiment to change the output based on 2/3 the set point. Use this option when it is not desired for the process to travel above the setpoint during the auto tuning experiment.

 

Outputs

CV : The control variable result (TYPE : INT) - Enter a register address, or select a named register. This is the location (typically %AQClosed 16-bit output registers used to send analog information such a voltages, levels, or speed settings to an attached device.) of the Control Variable value going out to the process. This value may NOT be a decimal constant.

DONE : The control variable result (TYPE : BOOL) - This defines an output bit that is set by the function when the auto tune is complete.

 

Remarks

ISA PID_Auto : CVout = Kp * (Error + (Error * dt / Ti) + (Td * Derivative)) + CVBias

 

Where:

dt = Internal elapsed time clock - previous elapsed time clock

Derivative = (Error - previous Error)/dt

--or--

Derivative = (pv - previous PV)/dt

[User selectable during configuration].

Ti = Integral time

Td = Derivative time

 

Register Usage - Either PID element requires an array of sixteen (16) WORD (16-bit) registers. These will typically be of type %RClosed Retentive 16-bit registers.. This is called the Reference Array.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Deadband might then be necessary

to prevent small changes in CV values due to slight variations in error.

2

Deadband -

PV Counts

-32000 to 0

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate.

In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV.

CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

CV Counts

-32000 to +32000

 

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds

to move 32000 CV counts

Determines how fast the CV value can change.

10

Config Word

N/A

N/A

Internal Use - Do not modify this value.

11

Manual Command

CV Counts

Tracks CV in Auto mode;

sets CV in Manual Mode.

In the Automatic mode this register tracks the CV value.

In the Manual Mode, this register contains the value that is output to the CV within

the clamp and slew limits.

12

Internal SP

Used by OCS

N/A

Tracks SP in

13

Internal PV

Used by OCS

N/A

Tracks PV in

14

Internal CV

Used by OCS

N/A

Tracks CV out

15

Cycle Time

Seconds

N/A

Cycle Time for PWMClosed Pulse Width Modulation (PWM) - A technique for generating a DC voltage level from a higher constant DC voltage. The constant input voltage is chopped to produce pulses at a constant period and constant amplitude. Modulating the pulse width (duration) controls the average voltage of the output. in Seconds

Each PID element must use a distinctly separate Reference Array, even if the values are identical to an exiting PID element.

There can be no overlapping of PID elements.

Registers at offset 0 through 9 must be configured before the PID element is used.

 

ST Language

(* PID4 is a declared instance of PID_ISA_Auto function block *)

PID4 (CB[], SP, PV, MANEN, UP, DOWN, TUNE, #FILTER, #RESP, #TYPE, #TUNE2/3);

CV := PID4.CV;

DONE := PID4.Done;

 

FBD Language

 

LD Language

 

IL Language

(* PID4 is a declared instance of PID_ISA_Auto function block *)

 

Caution: Overlapping references will result in erratic operation of the PID algorithm.

 

Return to the Top: PID Operations for IEC

 

Set PID Control Block

SET_PID

 

Operator - Performs the setting for PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal. Registers.

 

Inputs

CB[ ] : Input the values of the register usage mentioned below (TYPE : INT[])

PERIOD : Sample Period (TYPE : INT)

DEADBANDClosed Normally associated with the PID function, the deadband defines a range of operation where the output is “good enough” and the PID will not try to adjust further. + : Dead Band + (TYPE : INT) - Defines the Upper Dead Band limits in terms of PV counts. Set to 0 (zero) if no dead band is required.

DEADBAND - : Dead Band - (TYPE : INT) - Defines the Upper Dead Band limits in terms of PV counts. Set to 0 (zero) if no dead band is required. Both Deadbands be set to 0 (zero) until the PID is tuned. A Dead Band might then be necessary to prevent small changes in CV values due to slight variations in error.

Kp : Proportional Gain (TYPE : INT) - Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

Kd : Derivative Gain (TYPE : INT) - Entered as a time with a resolution of 10 mS. In the PID equation this has the effect: Kd * delta Error / dt.

Ki : Integral Rate (TYPE : INT) - Entered as a number of repeats per second -- effectively the integration rate. In the PID equation this has the effect: Ki * Error * dt.

CVBias : CV Bias (TYPE : INT) - Number of CV counts added to the output before the rate and amplitude clamps.

CVUpClamp : CV Upper Clamp (TYPE : INT) - Number of CV Counts that represent the highest value for CV. CV Upper Clamp must be more positive the CV Lower Clamp.

CVDnClamp : CV Down Clamp (TYPE : INT) - Number of CV Counts that represent the lowest value for CV. CV Upper Clamp must be more positive the CV Lower Clamp.

MinSlew : Minimum Slew Time (TYPE : INT) - Determines how fast the CV value can change.

ErrAction : Error Action (TYPE : BOOL)

DAction: (TYPE : BOOL)

OutPol: (TYPE : BOOL)

Dsense: (TYPE : BOOL)

 

Register Usage - Either PID element requires an array of sixteen (16) WORD (16-bit) registers. These will typically be of type %RClosed Retentive 16-bit registers.. This is called the reference Array. Registers at offset 0 through 9 must be configured before the PID element is used. This is configured using the SetPID block.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Dead Band might then be necessary

to prevent small changes in CV values due to slight variations in error.

2

Dead Band -

PV Counts

0 to 32000

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate.

In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

Upper CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV.

CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

Lower CV Counts

-32000 to +32000

 

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds

to move 32000 CV counts

Determines how fast the CV value can change.

Each PID element must use a distinctly separate reference Array, even if the values are identical to an exiting PID element. There can be no overlapping of PID elements.

 

ST Language

(* SETPID1 is a declared instance of SetPID function block *)

SetPID (CB[], Period, DeadBand+, Deadband-, Kp, Kd, Ki, CVBias, CVUpClamp, CVDnClamp, MinSlew, ErrAction, DAction, Outpol, Dsense);

 

FBD Language

 

LD Language

IL Language

(* SETPID1 is a declared instance of SetPID function block *)

Caution: Overlapping references will result in erratic operation of the PID algorithm.

Return to the Top: PID Operations for IEC

 

Get PID Manual Mode Status

Also called: GETPIDMAN

 

Operator -Gets the Control Output value of the PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal. associated with the Control block given as Input and loads it in the Output Register.

 

Inputs

CB[ ] : Input the values of the register usage mentioned below (TYPE : INTClosed Integer - [Data Type INT] - A 16-bit signed value. Integers are used where the value of the data is expected to be in the range of -32,768 to +32,767.[])

 

Output

Q: The control variable result of the associated PID block. Enter a register address, or select a named register. This is the location of the Control Variable value of the associated PID Loop going out to the process. This value may NOT be a decimal constant.

 

Register Usage - Either PID element requires an array of sixteen (16) WORDClosed Word - [Data Type WORD] - A string of 16 consecutive bits. WORD values are used where the value of the data is not as important as the bit patterns (shifts and rotates). (16-bit) registers. These will typically be of type %RClosed Retentive 16-bit registers.. This is called the reference Array. Registers at offset 0 through 9 must be configured before the PID element is used. This is configured using the SETPID block.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Deadband might then

be necessary to prevent small changes in CV values due to slight variations in error.

2

Deadband -

PV Counts

-32000 to 0

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate.

In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

Upper CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV.

CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

Lower CV Counts

-32000 to +32000

 

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds

to move 32000 CV counts

Determines how fast the CV value can change.

Each PID element must use a distinctly separate reference Array, even if the values are identical to an exiting PID element. There can be no overlapping of PID elements.

 

ST Language

Q := GETPIDMAN(CB (*INT*) ) ;

 

FBD Language

 

Ladder Language

 

IL Language

Not Supported.

 

Return to the Top: PID Operations for IEC

 

Set PID in Manual Mode

SETPID_MAN

 

Operator - Sets in Manual mode, the PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal. associated with the Control block with the Input to this block as Control Output value.

 

Inputs

CB[ ]: Input the values of the register usage mentioned below (TYPE : INT[])

IN: Input value that will be fed to the Control Variable as Manual Output (TYPE: INT)

 

Output

OK: Block execution indicator, it goes high if the block has been executed successfully.

 

Register Usage - Either PID element requires an array of sixteen (16) WORD (16-bit) registers. These will typically be of type %RClosed Retentive 16-bit registers.. This is called the reference Array. Registers at offset 0 through 9 must be configured before the PID element is used. This is configured using the SETPID block.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Deadband might then be necessary

to prevent small changes in CV values due to slight variations in error.

2

Deadband -

PV Counts

-32000 to 0

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate.

In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

Upper CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV.

CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

Lower CV Counts

-32000 to +32000

 

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds

to move 32000 CV counts

Determines how fast the CV value can change.

Each PID element must use a distinctly separate reference Array, even if the values are identical to an exiting PID element. There can be no overlapping of PID elements.

 

ST Language

SETPIDMAN (CB, IN);

OK := SETPIDMAN. OK;

 

FBD Language

 

Ladder Language

 

 

IL Language

Not Supported.

 

Return to the Top: PID Operations for IEC

 

Independent PID Loop

(REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types.)

Also called: PID_IND_R

 

Operator - Performs the proportional integral derivative (PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal.) IND algorithm for real SP, PV & to output a real CV value.

 

Inputs

CB[ ]: Input indicating the location of a control block used to maintain the PID state for this PID loop. (TYPE : INT[])

SP: Process Setpoint (TYPE : REAL) - Enter a register address, or select a named register. This is the location of the User-defined Process Setpoint value. This value may be a decimal constant.

PV: Process Variable (TYPE : REAL) - Enter a register address or select a named register. This is the location of the Process Variable value coming in from the process.

MAN EN: Manual / Auto Boolean Switch (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled Manual Input bit. This register is a Boolean (1-bit) register.

UP: Manual Mode up adjustment input (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled UP Input bit. This register is a Boolean (1-bit) register.

DOWN: Manual Mode down adjustment (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled DOWN Input bit. This register is a Boolean (1-bit) register.

MUL: This selects the precision of the real inputs used in the PID loops. For example if accuracy to 0.01 is required in the loop, select 0.01. (TYPE : REAL)

 

Outputs

CV: The control variable result (TYPE : REAL) - Enter a register address, or select a named register. This is the location of the Control Variable value going out to the process.

 

Remarks

Independent PID Real PID_INT_R: CVout = (Kp * Error) + (Ki * Error * dt) + (Kd * Derivative) + CVBias

 

Where:

dt = Internal elapsed time clock - previous elapsed time clock

Derivative = (Error - previous Error)/dt

--or--

Derivative = (pv - previous PV)/dt

[User selectable during configuration].

Ti = Integral time

Td = Derivative time

 

Register Usage - Either PID element requires an array of sixteen (16) WORD (16-bit) registers. These will presumably be of type %RClosed Retentive 16-bit registers.. This is called the Reference Array.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Deadband might then be necessary

to prevent small changes in CV values due to slight variations in error.

2

Deadband -

PV Counts

-32000 to 0

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate.

In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV.

CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

CV Counts

-32000 to +32000

 

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds

to move 32000 CV counts

Determines how fast the CV value can change.

10

Config Word

N/A

N/A

Internal Use - Do not modify this value.

11

Manual Command

CV Counts

Tracks CV in Auto mode;

sets CV in Manual Mode.

In the Automatic mode this register tracks the CV value.

In the Manual Mode, this register contains the value that is output

to the CV within the clamp and slew limits.

12

Internal SP

Used by OCS

N/A

Tracks SP in multiplied by the input MUL

13

Internal PV

Used by OCS

N/A

Tracks PV in multiplied by the input MUL

14

Internal CV

Used by OCS

N/A

Tracks PV in multiplied by the input MUL Tracks CV out multiplied by the input MUL

15

Cycle Time

Seconds

N/A

Cycle Time for PWMClosed Pulse Width Modulation (PWM) - A technique for generating a DC voltage level from a higher constant DC voltage. The constant input voltage is chopped to produce pulses at a constant period and constant amplitude. Modulating the pulse width (duration) controls the average voltage of the output. in Seconds

Each PID element must use a distinctly separate reference Array, even if the values are identical to an exiting PID element. There can be no overlapping of PID elements. Registers at offset 0 through 9 must be configured before the PID element is used. Examples: PID_IND_R1 is a declared instance of PID_IND_R function block

 

ST Language

PID_IND_R1 (CB[], SP, PV, MANEN, UP, DOWN, MUL);

CV := PID_IND_R1.CV;

 

FBD Language

 

LD Language

 

IL Language

(*PID_IND_R1 is a declared instance of PID_IND_R function block *)

Caution: Overlapping references will result in erratic operation of the PID algorithm.

 

Return to the Top: PID Operations for IEC

 

ISA PID Loop with Auto Tune

(REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types.)

Also called: PID_ISA_AUTO_R

 

Operator - Performs the proportional integral derivative (PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal.) IND algorithm with auto tuning function. For real SP, PV & to output a real CV value.

 

Inputs

CB[ ]: Input the values of the register usage mentioned below. (TYPE: INT[])

SP: Process Setpoint (TYPE: REAL) - Enter a register address, or select a named register. This is the location of the User-defined Process Setpoint value. This value may NOT be a decimal constant.

PV: Process Variable (TYPE: REAL) - Enter a register address or select a named register. This is the location (typically %AIClosed 16-bit input registers used to gather analog input data such as voltages, temperatures, and speed settings coming from an attached device.) of the Process Variable value coming in from the process. This value may NOT be a decimal constant.

MAN EN: Manual / Auto Boolean Switch (TYPE: BOOL) - Enter a register address or select a named register that is the User-controlled Manual Input bit. This register is a Boolean (1-bit) register, typically %TClosed Non-retentive single-bit registers..

UP: Manual Mode up adjustment input (TYPE: BOOL) - Enter a register address or select a named register that is the User-controlled UP Input bit. This register is a Boolean (1-bit) register, typically %T.

DOWN: Manual Mode down adjustment (TYPE: BOOL) - Enter a register address or select a named register that is the User-controlled DOWN Input bit. This register is a Boolean (1-bit) register, typically %T.

TUNE: Input which controls when the function should start the auto tune process. (TYPE: BOOL) - A Boolean TUNE input starts the autotuning cycle. This input needs to be held high during the autotuning cycle. If it is negated during the AUTOTUNE cycle, the controller stops autotune and reverts to the previous settings.

#FILTER: (TYPE: DINT) - This input defines how far above and below the setpoint the process must go when performing the auto tune experiment. Hysteresis is applied to the setpoint using the selected filter constant – if the process is subject to noise it is recommended that the process autotune is setup with a higher percentage. Higher noise rejection filters will also cause the autotuning algorithm to select slightly slower more stable coefficients. Where the process is noisy it is recommended that PI rather than PID control is selected.

FILTER_0_04 – Filters at 0.04%

FILTER_0_08 – Filters at 0.08%

FILTER_0_16 – Filters at 0.16%

FILTER_0_31 – Filters at 0.31%

FILTER_0_63 – Filters at 0.63%

FILTER_1_25 – Filters at 1.25%

FILTER_2_50 – Filters at 2.5%

FILTER_5_00 – Filters at 5%

#RESP: (TYPE: DINT) - This defines the relative speed of the PID loop once it is tuned.

Allowable Inputs:

PID_FAST

PID_MEDIUM

PID_SLOW

PID_VERYSLOW

#TYPE: (TYPE: DINT) - TYPE_PID This option allows the auto tune procedure to calculate terms for PID, PI or P terms.

Allowable Values:

TYPE_PI

TYPE_P

#TUNE2/3: (TYPE: BOOL) - This allows the auto tuning experiment to change the output based on 2/3 the set point. Use this option when it is not desired for the process to travel above the setpoint during the auto tuning experiment.

MUL: This selects the precision of the real inputs used in the PID loops. For example if accuracy to 0.01 is required in the loop, select 0.01. (TYPE: REAL)

 

Outputs

CV: The control variable result (TYPE: REAL) - Enter a register address, or select a named register. This is the location (typically %AQClosed 16-bit output registers used to send analog information such a voltages, levels, or speed settings to an attached device.) of the Control Variable value going out to the process. This value may NOT be a decimal constant.

DONE: The control variable result (TYPE: BOOL) - This defines an output bit that is set by the function when the auto tune is complete.

 

Remarks

PID_ ISA_Auto_R : CVout = Kp * (Error + (Error * dt / Ti) + (Td * Derivative)) + CVBias

 

Where:

dt = Internal elapsed time clock - previous elapsed time clock

Derivative = (Error - previous Error)/dt

--or--

Derivative = (pv - previous PV)/dt

[User selectable during configuration].

Ti = Integral time

Td = Derivative time

 

Register Usage - Either PID element requires an array of sixteen (16) WORD (16-bit) registers. These will typically be of type %RClosed Retentive 16-bit registers.. This is called the Reference Array.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Deadband might then be necessary

to prevent small changes in CV values due to slight variations in error.

2

Deadband -

PV Counts

-32000 to 0

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate.

In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV.

CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

CV Counts

-32000 to +32000

 

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds

to move 32000 CV counts

Determines how fast the CV value can change.

10

Config Word

N/A

N/A

Internal Use - Do not modify this value.

11

Manual Command

CV Counts

Tracks CV in Auto mode;

sets CV in Manual Mode.

In the Automatic mode this register tracks the CV value.

In the Manual Mode, this register contains the value that is output to the CV

within the clamp and slew limits.

12

Internal SP

Used by OCS

N/A

Tracks SP in

13

Internal PV

Used by OCS

N/A

Tracks PV in

14

Internal CV

Used by OCS

N/A

Tracks CV out

15

Cycle Time

Seconds

N/A

Cycle Time for PWMClosed Pulse Width Modulation (PWM) - A technique for generating a DC voltage level from a higher constant DC voltage. The constant input voltage is chopped to produce pulses at a constant period and constant amplitude. Modulating the pulse width (duration) controls the average voltage of the output. in Seconds

Each PID element must use a distinctly separate Reference Array, even if the values are identical to an exiting PID element. There can be no overlapping of PID elements. Registers at offset 0 through 9 must be configured before the PID element is used. Example: PID_ISA_Auto_R1 is a declared instance of PID_ISA_Auto_R function block

 

ST Language

PID_ISA_Auto_R1 (CB[], SP, PV, MANEN, UP, DOWN, TUNE, #FILTER, #RESP, #TYPE, #TUNE2/ 3);

CV := PID_ISA_Auto_R1.CV;

Done := PID_ISA_Auto_R1.Done;

 

FBD Language

 

LD Language

 

IL Language

Caution: Overlapping references will result in erratic operation of the PID algorithm.

 

Return to the Top: PID Operations for IEC

 

ISA PID Loop

(REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types.)

Also called: PID_ISA_R

 

Operator - Performs the proportional integral derivative (PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal.) IND algorithm for real SP, PV & to output a real CV value.

 

Inputs

CB[ ]: Input the values of the register usage mentioned below. (TYPE : INT[])

SP: Process Setpoint (TYPE : REAL) - Enter a register address, or select a named register. This is the location of the User-defined Process Setpoint value. This value may NOT be a decimal constant.

PV: Process Variable (TYPE : REAL) - Enter a register address or select a named register. This is the location (typically %AIClosed 16-bit input registers used to gather analog input data such as voltages, temperatures, and speed settings coming from an attached device.) of the Process Variable value coming in from the process. This value may NOT be a decimal constant.

MAN EN: Manual / Auto Boolean Switch (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled Manual Input bit. This register is a Boolean (1-bit) register, typically %TClosed Non-retentive single-bit registers..

UP: Manual Mode up adjustment input (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled UP Input bit. This register is a Boolean (1-bit) register, typically %T.

DOWN: Manual Mode down adjustment (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled DOWN Input bit. This register is a Boolean (1-bit) register, typically %T.

MUL: This selects the precision of the real inputs used in the PID loops. For example if accuracy to 0.01 is required in the loop, select 0.01. (TYPE : REAL)

 

Outputs

CV: The control variable result (TYPE : REAL) - Enter a register address, or select a named register. This is the location (typically %AQClosed 16-bit output registers used to send analog information such a voltages, levels, or speed settings to an attached device.) of the Control Variable value going out to the process. This value may NOT be a decimal constant.

 

Remarks

PID_ISA_R : CVout = Kp * (Error + (Error * dt / Ti) + (Td * Derivative)) + CVBias

 

Where:

dt = Internal elapsed time clock - previous elapsed time clock

Derivative = (Error - previous Error)/dt

--or--

Derivative = (pv - previous PV)/dt

[User selectable during configuration].

Ti = Integral time

Td = Derivative time

 

Register Usage - Either PID element requires an array of sixteen (16) WORD (16-bit) registers. These will typically be of type %RClosed Retentive 16-bit registers.. This is called the Reference Array.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Deadband might then be necessary to prevent small changes in CV values due to slight variations in error.

2

Deadband -

PV Counts

-32000 to 0

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate. In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV. CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

CV Counts

-32000 to +32000

 

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds

to move 32000 CV counts

Determines how fast the CV value can change.

10

Config Word

N/A

N/A

Internal Use - Do not modify this value.

11

Manual Command

CV Counts

Tracks CV in Auto mode;

sets CV in Manual Mode.

In the Automatic mode this register tracks the CV value.

In the Manual Mode, this register contains the value that is output to the CV within the clamp and slew limits.

12

Internal SP

Used by OCS

N/A

Tracks SP in

13

Internal PV

Used by OCS

N/A

Tracks PV in

14

Internal CV

Used by OCS

N/A

Tracks CV out

15

Cycle Time

Seconds

N/A

Cycle Time for PWMClosed Pulse Width Modulation (PWM) - A technique for generating a DC voltage level from a higher constant DC voltage. The constant input voltage is chopped to produce pulses at a constant period and constant amplitude. Modulating the pulse width (duration) controls the average voltage of the output. in Seconds

Each PID element must use a distinctly separate reference Array, even if the values are identical to an exiting PID element. There can be no overlapping of PID elements. Registers at offset 0 through 9 must be configured before the PID element is used. Example: PID_ISA_R1 is a declared instance of PID_ISA_R function block

 

ST Language

PID_ISA_R1 (CB[], SP, PV, MANEN, UP, DOWN);

CV := PID_ISA_R1.CV;

 

FBD Language

 

LD Language

 

IL Language

Caution: Overlapping references will result in erratic operation of the PID algorithm.

 

Return to the Top: PID Operations for IEC

 

Independent PID Loop with Auto Tune

Also called: PID_IND_AUTO_R

 

Operator - Performs the proportional integral derivative (PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal.) IND algorithm with auto tuning function for real SP, PV, and to output a real CV value.

 

Inputs

CB[ ]: Input indicating the location of a control block used to maintain the PID state for this PID loop. (TYPE : INT[])

SP: Process Setpoint (TYPE : REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types.) - Enter a register address, or select a named register. This is the location of the User-defined Process Setpoint value. This value may be a decimal constant.

PV: Process Variable (TYPE : REAL) - Enter a register address or select a named register. This is the of the Process Variable value coming in from the process.

MAN EN: Manual / Auto Boolean Switch (TYPE : BOOLClosed Boolean- [Data Type BOOL] - A single bit, binary value, or register/variable. Boolean points have only two possible values, 'TRUE' or 'FALSE'.) - Enter a register address or select a named register that is the User-controlled Manual Input bit. This register is a Boolean (1-bit) register.

UP: Manual Mode up adjustment input (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled UP Input bit. This register is a Boolean (1-bit) register.

DOWN: Manual Mode down adjustment (TYPE : BOOL) - Enter a register address or select a named register that is the User-controlled DOWN Input bit. This register is a Boolean (1-bit) register.

TUNE: Input which controls when the function should start the auto tune process. (TYPE : BOOL) - A Boolean TUNE input starts the autotuning cycle. This input needs to be held high during the autotuning cycle. If it is negated during the AUTOTUNE cycle, the controller stops autotune and reverts to the previous settings.

#FILTER : (TYPE : DINTClosed Double Integer - [Data Type DINT] - A 32-bit signed value. Double Integers are used where the value of the data is expected to be in the range of -2,147,483,648 to +2,147,483,647.) - This input defines how far above and below the setpoint the process must go when performing the auto tune experiment. Hysteresis is applied to the setpoint using the selected filter constant – if the process is subject to noise it is recommended that the process autotune is setup with a higher percentage. Higher noise rejection filters will also cause the autotuning algorithm to select slightly slower more stable coefficients. Where the process is noisy it is recommended that PI rather than PID control is selected. Allowable Inputs:

FILTER_0_04 – Filters at 0.04%

FILTER_0_08 – Filters at 0.08%

FILTER_0_16 – Filters at 0.16%

FILTER_0_31 – Filters at 0.31%

FILTER_0_63 – Filters at 0.63%

FILTER_1_25 – Filters at 1.25%

FILTER_2_50 – Filters at 2.5%

FILTER_5_00 – Filters at 5%

#RESP : ( TYPE : DINT) - This defines the relative speed of the PID loop once it is tuned.

Allowable Inputs:

PID_FAST

PID_MEDIUM

PID_SLOW

PID_VERYSLOW

#TYPE : (TYPE : DINT) - TYPE_PID

Allowable Values:

TYPE_PI

TYPE_P

#TUNE2/3 : (TYPE : BOOL) - This allows the auto tuning experiment to change the output based on 2/3 the set point. Use this option when it is not desired for the process to travel above the setpoint during the auto tuning experiment.

MUL: This selects the precision of the real inputs used in the PID loops. For example if accuracy to 0.01 is required in the loop, select 0.01. (TYPE : REAL)

 

Outputs

CV: The control variable result (TYPE : REAL) - Enter a register address, or select a named register. This is the location of the Control Variable value going out to the process.

DONE: The control variable result (TYPE : BOOL) - This defines an output bit that is set by the function when the auto tune is complete.

 

Remarks

Where:

dt = Internal elapsed time clock - previous elapsed time clock

Derivative = (Error - previous Error)/dt

--or--

Derivative = (pv - previous PV)/dt

[User selectable during configuration].

Independent PID_Auto_R:

CVout = (Kp * Error) + (Ki * Error * dt) + (Kd * Derivative) + CVBias

Ti = Integral time

Td = Derivative time

 

Register Usage - Either PID element requires an array of sixteen (16) WORDClosed Word - [Data Type WORD] - A string of 16 consecutive bits. WORD values are used where the value of the data is not as important as the bit patterns (shifts and rotates). (16-bit) registers. These will presumably be of type %RClosed Retentive 16-bit registers.. This is called the Reference Array.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Deadband might

then be necessary to prevent small changes in CV values due to slight variations in error.

2

Deadband -

PV Counts

-32000 to 0

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate.

In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV.

CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

CV Counts

-32000 to +32000

 

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds

to move 32000 CV counts

Determines how fast the CV value can change.

10

Config Word

N/A

N/A

Internal Use - Do not modify this value.

11

Manual Command

CV Counts

Tracks CV in Auto mode;

sets CV in Manual Mode.

In the Automatic mode this register tracks the CV value.

In the Manual Mode, this register contains the value that is output

to the CV within the clamp and slew limits.

12

Internal SP

Used by OCS

N/A

Tracks SP in multiplied by the input MUL

13

Internal PV

Used by OCS

N/A

Tracks PV in multiplied by the input MUL

14

Internal CV

Used by OCS

N/A

Tracks CV out multiplied by the input MUL

15

Cycle Time

Seconds

N/A

Cycle Time for PWMClosed Pulse Width Modulation (PWM) - A technique for generating a DC voltage level from a higher constant DC voltage. The constant input voltage is chopped to produce pulses at a constant period and constant amplitude. Modulating the pulse width (duration) controls the average voltage of the output. in Seconds

Each PID element must use a distinctly separate reference Array, even if the values are identical to an exiting PID element. There can be no overlapping of PID elements. Registers at offset 0 through 9 must be configured before the PID element is used. Example: PID_IND_Auto_R1 is a declared instance of PID_IND_Auto_R function block

 

ST Language

PID_IND_Auto_R1 (CB[], SP, PV, MANEN, UP, DOWN, TUNE, #FILTER, #RESP, #TYPE, #TUNE2/ 3, MUL);

CV := PID_IND_Auto_R1.CV;

Done := PID_IND_Auto_R1.Done;


FBD Language

 

LD Language

 

IL Language

Caution: Overlapping references will result in erratic operation of the PID algorithm.

 

Return to the Top: PID Operations for IEC

 

Set PID Mode

(REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types.)

Also called: SETPID_R

 

Operator - Performs the setting for PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal. Registers as Real data type for KP, KD, KI & to CV Bias, Upclamp and DnClamp value.

 

Inputs

CB[ ] : Input the values of the register usage mentioned below (TYPE : INT[])

PERIOD : Sample Period (TYPE : INT)

DEADBANDClosed Normally associated with the PID function, the deadband defines a range of operation where the output is “good enough” and the PID will not try to adjust further. + : Dead Band + (TYPE : INT) - Defines the Upper Dead Band limits in terms of PV counts. Set to 0 (zero) if no dead band is required.

DEADBAND - : Dead Band - (TYPE : INT) - Defines the Upper Dead Band limits in terms of PV counts. Set to 0 (zero) if no dead band is required.

Note: Both Deadbands be set to 0 (zero) until the PID is tuned. A Dead Band might then be necessary to prevent small changes in CV values due to slight variations in error.

Kp : Proportional Gain (TYPE : REAL) - Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

Kd : Derivative Gain (TYPE : REAL) - Entered as a time with a resolution of 10 mS. In the PID equation this has the effect: Kd * delta Error / dt.

Ki : Integral Rate (TYPE : REAL) - Entered as a number of repeats per second -- effectively the integration rate. In the PID equation this has the effect: Ki * Error * dt.

CVBias : CV Bias (TYPE : REAL) - Number of CV counts added to the output before the rate and amplitude clamps.

CVUpClamp : CV Upper Clamp (TYPE : REAL) - Number of CV Counts that represent the highest value for CV. CV Upper Clamp must be more positive the CV Lower Clamp.

CVDnClamp : CV Down Clamp (TYPE : REAL) - Number of CV Counts that represent the lowest value for CV. CV Upper Clamp must be more positive the CV Lower Clamp.

MinSlew : Minimum Slew Time (TYPE : INT) - Determines how fast the CV value can change.

ErrAction : Error Action (TYPE : BOOL)

DAction: (TYPE : BOOL)

OutPol: (TYPE : BOOL)

Dsense: (TYPE : BOOL)

MUL: (TYPE: REAL) - This selects the precision of the real inputs used in the PID loops. For example if accuracy to 0.01 is required in the loop, select 0.01.

 

Register Usage - Either PID element requires an array of sixteen (16) WORD (16-bit) registers. These will typically be of type %RClosed Retentive 16-bit registers.. This is called the reference Array. Registers at offset 0 through 9 must be configured before the PID element is used. This is configured using the SetPID block.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Deadband might then be necessary to prevent small changes in CV values due to slight variations in error.

2

Deadband -

PV Counts

-32000 to 0

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate.

In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV. CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV. CV Upper Clamp must be more positive the CV Lower Clamp.

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds to move 32000 CV counts

Determines how fast the CV value can change.

Each PID element must use a distinctly separate reference Array, even if the values are identical to an exiting PID element. There can be no overlapping of PID elements.

Examples: SETPID_R1 is a declared instance of SetPID_R function block

 

ST Language

(* SETPID1 is a declared instance of SetPID function block *)

SetPID1 (CB[], Period, Deadband+, Deadband-, Kp, Kd, Ki, CVBias, CVUpClamp, CVDnClamp, MinSlew, ErrAction, DAction, Outpol, Dsense, MUL);

 

FBD Language

 

LD Language

 

IL Language

 

Caution: Overlapping references will result in erratic operation of the PID algorithm.

 

Return to the Top: PID Operations for IEC

 

Set PID Manual Mode Status

(REALClosed These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types.)

Also called: SETPIDMAN_R

 

Operator - Sets in Manual mode, the PIDClosed Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both. a. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation. b. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration. c. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal. associated with the Control block with the Input to this block as Control Output value.

 

Inputs

CB[ ]: Input the values of the register usage mentioned below (TYPE : INT[])

IN: Input value that will be fed to the Control Variable as Manual Output (TYPE: REAL)

MUL: This selects the precision of the real inputs used in the PID loops. For example if accuracy to 0.01 is required in the loop, select 0.01. (TYPE: REAL)

 

Output

OK: Block execution indicator, it goes high if the block has been executed successfully.

 

Register Usage - Either PID element requires an array of sixteen (16) WORD (16-bit) registers. These will typically be of type %RClosed Retentive 16-bit registers.. This is called the reference Array. Registers at offset 0 through 9 must be configured before the PID element is used. This is configured using the SETPID block.

Offset

Parameter

Units

Range

Description

0

Sample Period

10 mS

0 to 65535

The shortest time, in 10mS increments, allowed between PID solutions.

1

Deadband +

PV Counts

0 to 32000

Defines the Upper and Lower Deadband limits in terms of PV counts.

Set both to 0 (zero) if no deadband is required.

Both should be set to 0 (zero) until the PID is tuned. A Deadband might then be necessary to prevent small changes in CV values due to slight variations in error.

2

Deadband -

PV Counts

-32000 to 0

 

3

Proportional Gain (Kp)

Percent

0 to 327.67%

Sets the Proportional Gain (Kp) factor in terms of percent. 100 sets unity gain (gain of 1).

4

Derivative Gain (Kd)

10 mS

0 to 327.67 seconds

Entered as a time with a resolution of 10 mS.

In the PID equation this has the effect: Kd * delta Error / dt.

5

Integral Rate (Ki)

Repeats per 1000 second

0 to 32.767 repeats per second

Entered as a number of repeats per second -- effectively the integration rate.

In the PID equation this has the effect: Ki * Error * dt.

6

CV Bias

CV Counts

-32000 to +32000

Number of CV counts added to the output before the rate and amplitude clamps.

7

CV Upper Clamp

CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV. CV Upper Clamp must be more positive the CV Lower Clamp.

8

CV Lower Clamp

CV Counts

-32000 to +32000

Number of CV Counts that represent the highest and lowest value for CV. CV Upper Clamp must be more positive the CV Lower Clamp.

9

Minimum Slew Time

Seconds of full travel

0 to 32000 seconds to move 32000 CV counts

Determines how fast the CV value can change.

Each PID element must use a distinctly separate reference Array, even if the values are identical to an exiting PID element. There can be no overlapping of PID elements.

 

ST Language

SETPIDMAN (CB, IN);

OK := SETPIDMAN. OK;

 

FBD Language

 

LD Language

 

IL Language

Not Supported.

 

Return to the Top: PID Operations for IEC

 

PID Controls

PID Control in Horner PLC

Hands-on PID Turning on the Horner OCS

 

In a typical industrial process, one often wants to control some parameter of a process such as heat or pressure. This can be done in an open loop fashion:

In such a system, the Process Controller accepts some value from the user. This value is called the Setpoint. The Process Controller then generates a value to be sent to the process called the Control Variable. The desired parameter is the Process Variable, which changes in response to the value sent by the Process Controller. The problem with this system is that there is no way for the Process Controller to determine if the process is actually producing the proper Process Variable. The Process Controller must assume that the process completes it's job quickly and accurately. In many cases, this is sufficient.

 

But these assumptions are often incorrect or inaccurate. The process may simply be inaccurate in itself. For example, a heater can be told to produce 350 degrees but actually produces 400 degrees. There is also the possibility that changes in the process itself may produce errors. For example, adding hot or cold materials to a process certainly changes the temperature of the process. Any change in the system that produces a change in the Process Variable is called a disruption. A disruption can be caused by purposely changing the Setpoint or can be a side effect of some process activity like adding or subtracting material from the process. The control system needs to respond equally well to disruptions at either point and to both positive-going and negative-going changes.

 

Most process control systems use feedback. This is called a closed loop system. In these systems, the Process Variable is measured, and that value returned to the Process Controller:

 

 

Such a process can respond to both changes in the Setpoint value and to changes in the process or load. Change the setpoint, and the controller tries to drive the process to the new value. Change the value of the Process Variable and the controller tries to drive the process back to the Setpoint value.

 

The question in this situation is, "What do we do with the feedback?" In most applications, the feedback is subtracted from the setpoint to produce a value called Error. The magnitude of Error is determined by the difference between the Setpoint value and the Process Variable value. For example, a simple temperature controller might accept a setpoint of 350 degrees. The Process Variable measures 200 degrees. Therefore, the Error value is 150 degrees.

 

The first thought is to add the Error to the Setpoint, and use this value to drive the process towards the desired value in less time. In the above example, adding the 350 degrees Setpoint and the 150 degrees Error attempts to drive the process to 500 degrees, which would have the effect of causing the process to heat up faster. On the next reading, the Process Variable is found to be 250 degrees making the Error 100 degrees. The controller adds the Error to the Setpoint and tries to drive the process towards 450 degrees. Further readings find the process warmer. The Error is smaller, and the process moves slowly towards the final temperature.

 

The problem with such an arrangement is that the process can change too much before the changes from the controller can affect it. In the above example, the process might actually go to 400 or more degrees before the controller can bring it back down. Conversely, the temperature can drop significantly before the controller makes the necessary changes.

 

PID Terminology

Some terms need to be defined in order for a meaningful discussion of PID performance to be presented.

 

PID - Proportional, Integral, Derivative Control (PID) - An intelligent I/O module or program instruction providing automation closed-loop operation of process control loops. For each loop, this module or instruction can perform proportional control and optionally integral control, derivative control, or both.

  1. Proportional Control – Causes an output signal to change as a direct ratio of the error signal variation.

  2. Integral Control – Causes an output signal to change as a function of the integer or the error signal over the time duration.

  3. Derivative Control – Causes an output signal to change as a function of the rate or change of the error signal.

Setpoint - In a feedback control loop, the commanded value of the variable being controlled. See SP below.

Control Variable - The output of a process controller (Proportional, Proportional/Integral, or Proportional/Integral/Derivative) used to "drive" the process towards the desired setpoint. See CV below.

Process Variable - The current actual value of a process -- temperature, pressure, flow rate, etc. See PV below.

Bias - A component often added to PID equations that adds a constant offset to the final value.. BIAS - generally used with Proportional-only controls, and is set to 0 if Integral Control action is used.

K - Process Open Loop Gain as figured by PVstep / CVstep.

Kp - Proportional Gain. This is the amount of Error Value that is ultimately fed back to the system. Sometimes called Controller Gain (Kc).

Ki - Integral Gain. Actually a time period defining how often the Error is "integrated". Faster time is the equivalent of higher gain in the Integral portion.

Kd - Derivative Gain. This tells how much of the rate-of-change is fed back to the system.

SP - Setpoint. This is the value that the process needs to reach and maintain.

PV - Process Variable. This is the measured output of the process -- temperature, pressure, etc.

CV - Control Variable. This is the result of the PID function which is applied to the process in order to control it. This value contains components of Proportional, Integral, Derivative, and Bias.

Deadband - Deadband creates a PV (raw data) range of counts above (+) and below(-) the Setpoint value (SP), where the PID function holds the CV output. If the PV falls within the specified Deadband range, there is no change in output. Adding a deadband range can mitigate instability of the loop output caused by a noisy Process Variable. Enter a positive number for Deadband Upper. Enter a negative number for Deadband Lower. (i.e. A value of 5 in Deadband Upper and a value of -5 in Deadband Lower results in a Deadband range of 10 raw data counts: SP+5 and SP-5. If the PV is within the -5 to + 5 range, the CV output does not change.)

 

Proportional Control

A controller, which performs the above action is known as a Proportional Controller. In practice, Error is actually a portion (often expressed in percent) of the full-range error. In the above example, if the Error is 150 degrees, the controller might be programmed to add only 20% - 30% of the full error value. The process takes longer to change since it is not being driven as hard, but full control is more accurate.

 

The following is a graph of a typical process under Proportional control only:

Proportional control often has an Offset factor. That is, the process almost never has 0 error. This can be caused by a variety of reasons, all of which are outside the realm of control of the Proportional function.

 

On the other hand, adding too much Proportional control can cause the process to oscillate and go further out of control:

 

Bias

If the offset in a process is constant, it can be removed by simply adding an equal-but-opposite value, called BIAS. This is a fixed value, which is determined by the user but is not changed or operated on by the PID control. Many processes can be effectively controlled using on Proportional control and a little bias.

 

Integral Control

Integral functions are added to reduce the offset error amount. The Integral function works by measuring how long an error lasts and produces an additional error value that is added into the equation. This value is tuned such that it almost completely eliminates the Proportional Offset error.

 

The collecting and smoothing of values over time is known as integration. Because of the integrating action, the Integral portion of the control does not take full effect until the Process Variable starts to approach a steady-state (i.e., correction value become less and less significant) value. Quick changes in error are "smoothed out" by the integrating action, and have less effect on the process. As the Process Variable approaches steady-state, the Integral Error value becomes more important, and thus, serves to reduce the offset introduced by the Proportional control.

 

The problem with Integral control is that it does not respond well to quick changes in either the Setpoint or Process Variable. Although Integral control helps keep the process at a particular Setpoint, if either the Setpoint or Process Variable changes quickly, the Integral control has little effect.

Many processes respond well to Proportional-plus-Integral Control. In this case, Bias is reduced to 0 (zero).

 

Return to the Top: PID Operations for IEC

 

Derivative Control

The Derivative Control is introduced to handle quick changes in the process. The Derivative Control produces yet a third error signal based on the slope of the Error, or how much the error value changes in a given time period. When a change is first requested, the Error Slope is relatively steep and the Derivative portion of the error is significant. As the process reaches steady state the Error Slope will be shallow, and the effect of the Derivative control is reduced.

 

PID Control

Proportional-only control is sufficient for a large number of processes, but neither Integral nor Derivative control alone is sufficient to control a process. Integral and Derivative are helpers, which respond to differing condition of the process. PID is an acronym for Proportional Integral Derivative. PID is a function that applies all three methods simultaneously in order to generate the controller output value. Not only is such a function concerned with the raw error (proportional), but it also considers how long the error has been in effect (integral) and how quickly the error value is changing (derivative).

 

When the process is first disrupted, the Proportional component attempts to make changes in the Controller Output. The Derivative aspect measures how great those changes are and adds a bit more of its value, thus making the controller act more aggressively to bring the process back to the setpoint. The Integral aspect has little effect here, because the error values vary greatly. As the process comes more into control, the magnitude of the Error begins to reduce. The Proportional component is still driving the process towards the setpoint, but with the change in errors becoming smaller and smaller, the Derivative component begins to be reduced. The Integral component, seeing that the error value is approaching a steady state value, begins to assert itself in order to reduce the errors due to offset.

 

Once the process reaches steady state, the Proportional component is producing very small error values and is attempting to produce some offset value. The Integral component measures how long the Error stays at one value, and produces its own error signal to compensate. Since the rate of change in Error is small, the Derivative component is almost non-existent. There are two common methods of implementing a PID function -- the Independent Method and the ISA Method.

 

Independent PID

CVout = (Kp * Error) + (Ki * Error * dt) + (Kd * Derivative) + CVBias

ISA PID

CVout = Kp * (Error + (Error * dt / Ti) + (Td * Derivative)) + CVBias

 

Where:

dt = Internal elapsed time clock - previous elapsed time clock

Derivative = (Error - previous Error)/dt

--or--

Derivative = (pv - previous PV)/dt

[User selectable during configuration].

Ti = Integral time

Td = Derivative time

 

The Independent PID is considered the standard. Although both methods provide the same results, the ISA PID is often easier to tune.

 

CVBias is an additive term separate from the PID components. This is most commonly used where only the Proportional (Kp) term is used (a proportional-only element). This forces CV Output to some non-zero value when the Process Variable (PV) is equal to the Setpoint (SP). CVBias is generally not used (set to 0) if the Integral term is used.

 

Return to the Top: PID Operations for IEC

 

Tuning PID Loops

The object of a PID loop is, given a change in either the Setpoint SP or Process Variable PV, generate a Control Variable CV such that PV is driven towards and eventually stabilized at a value equal to the SP. This is done as rapidly as possible and with minimum fluctuations about the final value.

 

In order to meet these goals, the PID system must be tuned. That is, proper values must be selected for Kp, Ki, and Kd such that for any disruption in the process the process is returned to the desired value as quickly and as accurately as possible. These two requirements are usually mutually exclusive. A process can be controlled quickly but with less accuracy, or slower but more accurate. It is up to the process engineer to determine the optimal compromise between these two points, and make adjustment to the PID function (tune it) accordingly.

PID Tuning is considered difficult.

 

The users often use the "trial and error" method of tuning. Adjust the Kp, Ki, and Kd parameters and watch the process handle the next disturbance. If the control of the process is adequate, quit. Otherwise, tweak another control and try again. This process is time-consuming. An experienced process engineer usually has some feel for the process, and can make better estimates of the PID values. This is easier if the relationships among Kp, Ki, and Kd are understood.

 

Simply put, the Kp (proportional) control is the major factor in controlling the loop. Most loops can be brought into approximate control using Proportional only. The first step is to disable the Integral and Derivative controls and bring the process into alignment using only the Proportional Control. Using Proportional only usually results in an Offset Error. That is, the actual Process Variable value differs from the Setpoint value by a small, relatively constant amount. If the offset is small and remains constant, it can often be canceled using the CVBias value. Otherwise, set CVBias to 0 (zero) and try using Integral control.

 

The Ki (Integral) control was intended to reduce this error by adding an offset that is based on how long a specific error is present. The longer the error is present, the more effect the Integral control has. So with the Proportional Control properly set, begin to increase the Ki until the error is minimize, if not completely eliminated.

 

Most processes respond well to just these two adjustments, proportional and integral. However, one can find that the PV "wobbles" too much around the final value. This is known as a damped oscillation. Kp need to be adjusted just below the point that the process begins to oscillate and goes further out of control.

 

These oscillations can sometimes be further damped using the Kd (Derivative) control. The Derivative Control works on how fast the PV (and thus the resulting error) changes. The maximum rate of change occurs just after any disturbance, which is also when the Kp is oscillating. By increasing the Kd, the oscillations can be further damped to bring the process into control more quickly. PID tuning depends on the user's knowledge of the process to be controlled. Kp, Ki, and Kd are determined by the processes' characteristics, which must be understood before tuning can be performed.

 

There are two things that must be known about the process:

  1. How big is the change in Process Value when Control Value is change by a fixed amount?

  2. How quickly does Process Value change in response to a change in Control Value?

The change in PV is simply measured. When compared with CV using a simple equation, the OPEN LOOP GAIN (K) of the system is obtained:

 

Open Loop Gain (K) = PVstep / CVstep

If a step change in CV causes an identical step change in PV, the Open Loop Gain (K) is one (unity). If a step change in CV causes a step change in PV that is less than CV, the Open Loop Gain (K) is less than 1. If a small step change in CV causes a large change in PV, the Open Loop Gain (K) is greater than 1.

 

Most processes will not see any change in PV for some time after CV changes. This is called Pipeline Delay Time (Tp) or Dead Time. (Not to be confused with DEAD BAND.) The Time Constant (Tc) of the process is defined as the time between when the PV first starts to change and the time when PV reaches 63.2% of the expected final PV value.

 

Find K and Tc - Some experimenting must be done in order to obtain the desired values. This is best done by placing the PID Element into the MANUAL mode, make a small change in CV, and then plot the change in PV. For slow processes this can be done manually, but a strip chart recorder might be helpful. The change in CV is large enough to cause a measurable change in PV but not so large as to completely disrupt the process being controlled. The plot looks similar to the above graphic, and K, Tc, and Tp are easily measurable.

 

Return to the Top: PID Operations for IEC

 

Ziegler-Nichols Tuning Method

Tune the Process

If K, Tc, and Tp are known we can use the following equations can be used to estimate starting values for Kp, Ki, and Kd in a Proportional / Integral / Derivative (PID) control:

Kp = (1.2 * Tc) / (K * Tp)

Ki = (0.6 * Tc) / (K * Tp * Tp)

Kd = (0.6 * Tc) / K

Tc and Tp are time units. It is important to ensure that both are expressed in identical units (i.e., milliseconds, seconds, hours, or whatever time frame is appropriate to the process). However, for use in the Cscape PID TUNE dialog, these values must be expressed 10mS intervals (eg: "100" = 10mS * 100 = 1 second).

If Proportional-only control (Ki and Kd = 0) is desired, use the equation:

Kp = Tc / (K * Tp)

Or for Proportional / Integral control (Kd = 0), use the equations:

Kp = 0.9 * Tc / (K * Tp)

Ki = 0.3 * Kp / T p

These equations are known as the Ziegler-Nichols tuning method, which were developed by John Zeigler and Nathaniel Nichols in the 1940's.