IDEC OPENNET CONTROLLER User Manual

April 22, 2002
OPENNET CONTROLLER
PID INSTRUCTION
PID INSTRUCTION
Introduction
The PID instruction implements a PID (proportional, integral, and derivative) algorithm with built-in auto tuning to deter­mine PID parameters, such as proportional gain, integral time, derivative time, and control action automatically. The PID instruction is primarily designed for use with an analog I/O module to read analog input data, and turns on and off a desig­nated output to perform PID control in applications such as temperature control described in the application example on page 14. In addition, when the output manipulated variable is converted, the PID instruction can also generate an analog output using an analog I/O module.
Warning
Special technical knowledge about the PID control is required to use the PID function of the
OpenNet Controller. Use of the PID function without understanding the PID control may cause
the OpenNet Controller to perform unexpected operation, resulting in disorder of the control sys­tem, damage, or accidents.
When using the PID instruction for feedback control, emergency stop and interlocking circuits
must be configured outside the OpenNet Controller. If such a circuit is configured inside the
OpenNet Controller, failure of inputting the process variable may cause equipment damage or
accidents.

PID (PID Control)

PID
Valid Operands
Operand Function I Q M R T C D L Constant
S1 (Source 1) Control register — — — D0-D7973 — S2 (Source 2) Control relay — Q0-Q590 M0-M2550 — — — — S3 (Source 3) Set point — — — D0-D7999 0-4000
S4 (Source 4) D1 (Destination 1) Manipulated variable — — — D0-D7999
S1
*****
Process variable (before conversion)
S2
*****S3*****S4*****
— — — D0-D7999 L100-L705
D1
*****
When input is on, auto tuning and/or PID action is exe­cuted according to the value (0 through 2) stored in a data register operand assigned for operation mode.
A maximum of 42 PID instructions can be used in a user program.
Source operand S1 (control register) uses 27 data registers starting with the operand designated as S1. Data registers D0 through D7973 can be designated as S1. For details, see the following pages.
Source operand S2 (control relay) uses 8 points of outputs or internal relays starting with the operand designated as S2. Outputs Q0 through Q590 or internal relays M0 through M2550 can be designated as S2. For details, see page 10.
Source operand S3 (set point): When the linear con version is disabled (S1+4 set to 0), the valid range of the set point (S3) is 0 through 4000 which can be designated using a data register or constant. When the linear conversion is enabled (S1+4 set to 1), the valid range is –32768 to 32767 that is a value after linear conversion. Use a data register to designate a nega­tive value for a set point when the linear conversion is used. For details, see page 12.
Source operand S4 (process variable) is designated using a data register or link register. When reading input data from an analog input module, designate a proper link register number depending on the slot position of the analog input module and the channel number connected to the analog input. For details, see page 12.
Destination operand D1 (manipulated variable) stores –32768 through 32767 that is a calculation result of the PID action. For details, see page 13.
OPENNET CONTROLLER PID INSTRUCTION USERS MANUAL 1
PID INSTRUCTION

Source Operand S1 (Control Register)

Store appropriate values to data registers starting with the operand designated by S1 before executing the PID instruction as required, and make sure that the values are within the valid range. Operands S1+0 through S1+2 are for read only, and operands S1+23 through S1+26 are reserved for the system program.
Operand Function Description R/W
When S1+4 (linear conversion) = 1 (enable linear conversion):
S1+0
S1+1 Output manipulated variable
S1+2 Operating status Stores the operating or error status of the PID instruction. R
S1+3 Operation mode
S1+4 Linear conversion
S1+5
S1+6
S1+7 Proportional gain S1+8 Integral time 1 to 65535 (0.1 sec to 6553.5 sec), 0 disables integral action R/W
S1+9 Derivative time 1 to 65535 (0.1 sec to 6553.5 sec), 0 disables derivative action R/W S1+10 Integral start coefficient S1+11 Input filter coefficient 0 to 99 (0% to 99%), 100 designates 99% R/W S1+12 Sampling period
S1+13 Control period
S1+14 High alarm value
S1+15 Low alarm value
S1+16
S1+17
S1+18
S1+19 AT sampling period
S1+20 AT control period
S1+21 AT set point S1+22 AT output manipulated variable 0 to 100 (101 designates 100) R/W
S1+23 S1+24 S1+25 S1+26
Process variable (after conversion)
Linear conversion maximum value
Linear conversion minimum value
Output manipulated variable upper limit
Output manipulated variable lower limit
Manual mode output manipulated variable
Stores the process variable after conversion. When S1+4 (linear conversion) = 0 (disable linear conversion): Stores the process variable without conversion.
Stores the output manipulated variable (manual mode output variable and AT output manipulated variable) in percent. 0 to 100 (0% to 100%)
0: PID action 1: AT (auto tuning) + PID action 2: AT (auto tuning)
0: Disable linear conversion 1: Enable linear conversion
–32768 to +32767 R/W
–32768 to +32767 R/W 1 to 10000 (0.01% to 100.00%)
0 designates 0.01%, 10001 designates 100.00%
1 to 100 (1% to 100%), 0 and 101 (except 200) designate 100% 200 executes integral action within the proportional range
1 to 10000 (0.01 sec to 100.00 sec) 0 designates 0.01 sec, 10001 designates 100.00 sec
1 to 500 (0.1 sec to 50.0 sec) 0 designates 0.1 sec, 501 designates 50.0 sec
When S1+4 (linear conversion) = 0: 0 to 4000 (4001 designates 4000) When S1+4 = 1: Linear conversion min. High alarm Linear conversion max. When S1+14 < S1+6 (linear conversion min.), S1+6 becomes high alarm. When S1+14 > S1+5 (linear conversion max.), S1+5 becomes high alarm.
When S1+4 (linear conversion) = 0: 0 to 4000 (4001 designates 4000) When S1+4 = 1: Linear conversion min. Low alarm Linear conversion max. When S1+15 < S1+6 (linear conversion min.), S1+6 becomes low alarm. When S1+15 > S1+5 (linear conversion max.), S1+5 becomes low alarm.
0 to 100, 10001 to 10099 (other values designate 100) R/W
0 to 100 (101 designates 100) R/W
0 to 100 (101 designates 100) R/W 1 to 10000 (0.01 sec to 100.00 sec)
0 designates 0.01 sec, 10001 designates 100.00 sec 1 to 500 (0.1 sec to 50.0 sec)
0 designates 0.1 sec, 501 designates 50.0 sec When S1+4 (linear conversion) = 0: 0 to 4000 (4001 designates 4000)
When S1+4 = 1: Linear conversion min. AT set point Linear conversion max.
— Reserved for processing the PID instruction —
R
R
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Note: The value stored in the data register designated by S1+3 (operation mode) is checked only when the start input for the PID instruction is turned on. Values in all other control registers are refreshed in every scan.
OPENNET CONTROLLER PID INSTRUCTION USERS MANUAL 2
PID INSTRUCTION
S1+0 Process Variable (after conversion)
When the linear conversion is enabled (S1+4 set to 1), the data register designated by operand S1+0 stores the linear con­version result of the process variable designated by operand S4. The process variable (S1+0) takes a value between the lin­ear conversion minimum value (S1+6) and the linear conversion maximum value (S1+5).
When the linear conversion is disabled (S1+4 is set to 0), the data register designated by operand S1+0 stores the same value as the process variable designated by operand S4.
S1+1 Output Manipulated Variable
While the PID action is in progress, the data register designated by operand S1+1 holds 0 through 100 read from the manipulated variable, –32768 through 32767, stored in the data register designated by operand D1, omitting values less than 0 and greater than 100. The percent value in S1+1 determines the ON duration of the control output (S2+6) in propor­tion to the control period (S1+13).
While manual mode is enabled with the auto/manual mode control relay (S2+1) set to on, S1+1 stores 0 through 100 read from the manual mode output manipulated variable (S1+18).
While auto tuning (AT) is in progress, S1+1 stores 0 through 100 read from the AT output manipulated variable (S1+22).
S1+2 Operating Status
The data register designated by operand S1+2 stores the operating or error status of the PID instruction. Status codes 1X through 6X contain the time elapsed after starting auto tuning or PID action. X changes from 0 through 9
in 10-minute increments to represent 0 through 90 minutes. The time code remains 9 after 90 minutes has elapsed. When the operation mode (S1+3) is set to 1 (AT+PID), the time code is reset to 0 at the transition from AT to PID.
Status codes 100 and above indicate an error, stopping the auto tuning or PID action. When these errors occur, a user pro­gram execution error will result, turning on the ERR LED and special internal relay M8004 (user program execution error). To continue operation, enter correct parameters and turn on the start input for the PID instruction.
Status Code Description Operation
1X AT in progress 2X AT completed 5X PID action in progress
6X
100 The operation mode (S1+3) is set to a value over 2. 101 The linear conversion (S1+4) is set to a value over 1.
102
103
104
105
106
107
200
201
PID set point (S3) is reached. Status code changes from 5X to 6X once the PID set point is reached.
When the linear conversion is enabled (S1+4 to 1), the linear conversion maximum value (S1+5) and the linear conversion minimum value (S1+6) are set to the same value.
The output manipulated variable upper limit (S1+16) is set to a value smaller than the out­put manipulated variable lower limit (S1+17).
When the linear conversion is enabled (S1+4 set to 1), the AT set point (S1+21) is set to a value larger than the linear conversion maximum value (S1+5) or smaller than the linear con­version minimum value (S1+6).
When the linear conversion is disabled (S1+4 set to 0), the AT set point (S1+21) is set to a value larger than 4000.
When the linear conversion is enabled (S1+4 set to 1), the set point (S3) is set to a value larger than the linear conversion maximum value (S1+5) or smaller than the linear conver­sion minimum value (S1+6).
When the linear conversion is disabled (S1+4 set to 0), the set point (S3) is set to a value larger than 4000.
The current control action (S2+0) differs from that determined at the start of AT. To restart AT, set correct parameters referring to the probable causes listed below:
• The manipulated variable (D1) or the control output (S2+6) is not outputted to the control target correctly.
• The process variable is not stored to the operand designated by S4.
• The AT output manipulated variable (S1+22) is not set to a large value so that the process variable (S4) can change sufficiently.
• A large disturbance occurred. AT failed to complete normally because the process variable (S4) fluctuated excessively. To
restart AT, set the AT sampling period (S1+19) or the input filter coefficient (S1+11) to a larger value.
AT is normal.
PID action is normal.
PID action or AT is stopped because of incorrect parameter settings.
AT is stopped because of AT execution error.
OPENNET CONTROLLER PID INSTRUCTION USERS MANUAL 3
PID INSTRUCTION
S1+3 Operation Mode
When the start input for the PID instruction is turned on, the CPU module checks the value stored in the data register des­ignated by S1+3 and executes the selected operation. The selection cannot be changed while ex ecuting the PID instruction.
0: PID action
The PID action is executed according to the designated PID parameters such as proportional gain (S1+7), integral time (S1+8), derivative time (S1+9), and control action (S2+0).
1: AT (auto tuning) + PID action
Auto tuning is first executed according to the designated AT parameters such as AT sampling period (S1+19), AT con­trol period (S1+20), AT set point (S1+21), and AT output manipulated variable (S1+22). As a result of auto tuning, PID parameters are determined such as proportional gain (S1+7), integral time (S1+8), derivative time (S1+9), and control direction (S2+0), then PID action is executed according to the derived PID parameters.
2: AT (auto tuning)
Auto tuning is executed according to designated AT parameters to determine PID parameters such as proportional gain (S1+7), integral time (S1+8), derivative time (S1+9), and control direction (S2+0); PID action is not executed.
S1+4 Linear Conversion
0: Disable linear conversion
Linear conversion is not executed. When the linear conversion is disabled (S1+4 set to 0), the analog input data (0 through 4000) from the analog I/O module is stored to the process variable (S4), and the same value is stored to the process variable (S1+0) without conversion.
1: Enable linear conversion
The linear conversion function is useful for scaling the process variable to the actual measured value in engineering units.
When the linear conversion is enabled (S1+4 set to 1), the analog input data (0 through 4000) from the analog I/O mod­ule is linear-converted, and the result is stored to the process variable (S1+0). When using the linear conversion, set proper values to the linear conversion maximum value (S1+5) and linear conv ersion minimum value (S1+6) to specify the linear conversion output range. When using the linear conversion function in a temperature control application, temperature values can be used to designate the set point (S3), high alarm value (S1+14), lo w alarm v alue (S1+15), and AT set point (S1+21), and also to read the process variable (S1+0).
Linear Conversion Result
Linear Conversion Maximum Value (S1+5)
Set point (S3), AT set point (S1+21), and process
variable (S1+0) must be within this range.
Linear Conversion Minimum Value (S1+6)
4000
S1+5 Linear Conversion Maximum Value
0
Analog Input Data
When the linear conversion is enabled (S1+4 set to 1), set the linear conversion maximum value to the data register desig­nated by operand S1+5. Valid values are –32768 through 32767, and the linear conversion maximum value must be larger than the linear conversion minimum v alue (S1+6). Select an appropriate v alue for the linear conversion maximum value to represent the maximum value of the input signal to the analog I/O module.
When the linear conversion is disabled (S1+4 set to 0), you don’ t ha v e to set the linear conversion maximum value (S1+5).
S1+6 Linear Conversion Minimum Value
When the linear conversion is enabled (S1+4 set to 1), set the linear conversion minimum value to the data register desig­nated by operand S1+6. Valid values are –32768 through 32767, and the linear conv ersion minimum v alue must be smaller than the linear conversion maximum v alue (S1+5). Select an appropriate v alue for the linear conversion minimum value to represent the minimum value of the input signal to the analog I/O module.
When the linear conversion is disabled (S1+4 set to 0), you don’t have to set the linear conversion minimum value (S1+6).
OPENNET CONTROLLER PID INSTRUCTION USERS MANUAL 4
PID INSTRUCTION
Example:
When the transducer connected to the analog input module has an input range of –50°C through +199°C, set the following values. The temperature values are multiplied by 10 to calculate the process variable.
Control mode (S1+4): 1 (enable linear conversion) Linear conversion maximum value (S1+5): 1990 (199.0°C) Linear conversion minimum value (S1+6): –500 (–50.0°C)
Process Variable after Conversion (S1+0)
Linear Conversion Maximum Value (S1+5): 1990 (199.0°C)
Linear Conversion Minimum Value (S1+6): –500 (–50.0°C)
S1+7 Proportional Gain
0
Digital Output from Analog Input Module
4000
The proportional gain is a parameter to determine the amount of proportional action in the proportional band. When auto tuning is used by setting the operation mode (S1+3) to 1 (AT+PID) or 2 (AT), a proportional gain is determined
automatically and does not have to be specified by the user. When auto tuning is not used by setting the operation mode (S1+3) to 0 (PID), set a required value of 1 through 10000 to
specify a proportional gain of 0.01% through 100.00% to the data register designated by operand S1+7. When S1+7 stores 0, the proportional gain is set to 0.01%. When S1+7 stores a value larger than 10000, the proportional gain is set to
100.00%. When the proportional gain is set to a large value, the proportional band becomes small and the response becomes fast, b ut
overshoot and hunching will be caused. In contrast, when the proportional gain is set to a small value, overshoot and hunching are suppressed, but response to disturbance will become slow.
While the PID action is in progress, the proportional gain value can be changed by the user.
S1+8 Integral Time
When only the proportional action is used, a certain amount of difference (offset) between the set point (S3) and the pro­cess variable (S1+0) remains after the control target has reached a stable state. An integral action is needed to reduce the offset to zero. The integral time is a parameter to determine the amount of integral action.
When auto tuning is used by setting the operation mode (S1+3) to 1 (AT+PID) or 2 (AT), an integral time is determined automatically and does not have to be specified by the user.
When auto tuning is not used by setting the operation mode (S1+3) to 0 (PID), set a required value of 1 through 65535 to specify an integral time of 0.1 sec through 6553.5 sec to the data register designated by operand S1+8. When S1+8 is set to 0, the integral action is disabled.
When the integral time is too short, the integral action becomes too large, resulting in hunching of a long period. In con­trast, when the integral time is too long, it takes a long time before the process variable (S1+0) reaches the set point (S3).
While the PID action is in progress, the integral time value can be changed by the user.
S1+9 Derivative Time
The derivati v e action is a function to adjust the process v ariable (S1+0) to the set point (S3) by increasing the manipulated variable (D1) when the set point (S3) is changed or when the difference between the process variable (S1+0) and the set point (S3) is increased due to disturbance. The deriv ative time is a parameter to determine the amount of derivative action.
When auto tuning is used by setting the operation mode (S1+3) to 1 (AT+PID) or 2 (AT), a derivative time is determined automatically and does not have to be specified by the user.
When auto tuning is not used by setting the operation mode (S1+3) to 0 (PID), set a required value of 1 through 65535 to specify a derivative time of 0.1 sec through 6553.5 sec to the data register designated by operand S1+9. When S1+9 is set to 0, the derivative action is disabled.
OPENNET CONTROLLER PID INSTRUCTION USERS MANUAL 5
Loading...
+ 12 hidden pages