PIDINIT Instruction
The PIDINIT command checks the items and initializes the devices set up for PID operation.
The PID Control Special Program is represented as shown below.
*When the value of each item is 0, do not use the item.
Offset | Item | Description | Range | Remarks |
0 | Number of Loops |
| 1 – 32 | Common for Entire Loops |
1 | Number of Loops for a Scan |
| 1 – 32 | |
2(0) | Operation Type | Forward(0) / Reverse(1) | 0 / 1 | For Loops |
3(1) | Sampling Interval (Ts) | 0.01 – 60.00s | 1 – 6,000 | |
4(2) | Proportional Gain (Kp) | 0.01 – 300.00 | 1 – 30,000 | |
5(3) | Integral Gain (Ki) | 0.01 – 300.00s | 0 – 30,000 | |
6(4) | Derivative Gain (Kd) | 0.00 – 300.00s | 0 – 30,000 | |
7(5) | Filter Coefficient (á) | 0.00 – 1.00 | 0 – 100 | |
8 (6) | Manipulated Value Low Limit (MVLL) | 0 – 16,000 | 0 – 16,000 | |
9 (7) | Manipulated Value High Limit (MVHL) | 0 – 16,000 | 0 – 16,000 | |
10 (8) | Variation Rate Limit of Manipulated Value (∆MVL) | 0 – 16,000 | 0 – 16,000 | |
11 (9) | Use of MV Automatic Apply | Not Use(0) / Use(1) | 0 / 1 | |
12 (10) | SV Transition Step | 0 – 1,000 times | 0 – 1,000 | |
13 (11) | PV Inertia Amount | 0 – 16,000 | 0 – 16,000 | |
14 (12) | ON/OFF Control Time | 1.00 – 60.00s | 1 – 6000 0: Not Use | |
15 (13) | PIDINIT Operation Status | Indicates Errors | *Table | |
16 (14) | FLAGS |
|
| Not Available to Users |
17 (15) | Reserved |
|
| |
18 (16) | Auto Tuning Counter 1 |
|
| |
19 (17) | Auto Tuning Counter 2 |
|
| |
20 (18) | On/OFF Control Counter |
|
| |
21 (19) | Sampling Counter |
|
|
Common setting data
Offset | Item | Description |
0 | Number of Loops | Configures the number of loops to operate PID. To control an object, one PID operation loop is used. Up to 32 loops. |
1 | Number of Loops for a Scan | Set up the number of loops for one scan in case of several loops at sampling intervals. |
Setting data for each loop
Offset | Item | Description |
2 | Operation Type | Determines Forward (0) or Reverse (1) operation. |
3 | Sampling Interval (Ts) | This is used to set up PID calculation interval. Generally, this interval should be the interval of PV change while MV output is at maximum status. Typically, approximately 5-second-interval is recommended for a building temperature control as an example. |
4 | Proportional Gain (Kp) | Configures the proportional gain. The value of Kp can be set from 1 to 65535. Proportional gain can maximize its setting range up to 100 times by using the function selection flag of the PIDCAL command. By enabling this function, the range value of Kp can be expanded from 100 to a maximum of 6,553,500. This function is inclusive of PID_2. |
5 | Integral Gain (Ki) | Configures the integral gain. |
6 | Derivative Gain (Kd) | Configures the derivative gain. |
7 | Filter Coefficient (á) | This is used to set up the range of the filtering effect on the measured value (PV), which is entered from an A/D card. The closer it gets to 0, the less filtering effect is. |
8 | MV Low Limit | Sets up the lowest manipulated value for the PID operation in auto mode. By enabling this function, a manipulated value (MV) can never be lower than the fixed minimum manipulated value. |
9 | MV High Limit | Sets up the highest manipulated value for the PID operation in auto mode. By enabling this function, a manipulated value (MV) can never be higher than the fixed maximum manipulated value. |
10 | Variation Rate Limit of MV (∆MVL) | Sets the MV change rate limit which compares with the change rate of current manipulated value and the previous manipulated value. When the change of the MV is greater than the fixed MV change rate limit, the output value is outputted as the fixed variation rate limit. |
11 | Use of MV Automatic Apply | Use (1): MV value gets automatically passed to the manual MV in auto mode. When switched to manual mode, the current MV value can be maintained. Not Use (0): When converted to manual mode, the initial setting value is applied as the manipulated value (MV). |
12 | SV Transition Step | To control the occurrence of overshoot due to a sharply changed target value (SV) and to keep stable control, this is used to divide a variation value into 10 steps and to increase or decrease the value progressively at sampling intervals (Ts) when SV is changed. |
13 | PV Inertia Amount | It is the measurement added to the PID_2 version. The PV Inertia amount is detected by measuring the change in PV according to the MV output during the Auto Tuning process. The detected amount of inertia is automatically written here. The PV inertia amount is used for self-learning function to determine when to block the MV output. |
14 | ON/OFF Control Time | When using the ON/OFF control mode, the user specifies the control reference time here. The control time is specified in units of 10mS from 0 second to 60.00 seconds. When this feature is not in use, specify ‘0.’ According to the PID calculation result, the ON time is determined within the time range. The control output resolution can be calculated by (Sampling time) / (ON and OFF control time). When it is ON state, the value of MV is outputted as the maximum MV. When it is OFF state, the value of MV is outputted as the minimum MV. The recommended ON/OFF control time is sampling interval * 10 or above. |
15 | PID Operation Status (Error Code) | Indicates the status of error while PID operation is initialized. *Refer to the table below. |
Code | Error Name | Error Description | Range |
0 | No Error |
|
|
1 | Error in Number of Loops | When a value is out of the range (1 – 32) | For entire loops |
2 | Error in 1 Scan Loop No. | Though there is no error in the value, PID operation can be omitted if the setting value is too small. | |
3 | Error in Operation Type | When a value is neither 0 nor 1 |
For each loop
For each loop |
4 | Error in Sampling Interval (Ts) | When a value is out of the range (1 – 6,000) | |
5 | Error in Proportional Gain (Kp) | When a value is out of the range (1 – 10,000) | |
6 | Error in Integral Gain (Ki) | When a value is out of the range (0 – 30,000) | |
7 | Error in Derivative Gain (Kd) | When a value is out of the range (0 – 30,000) | |
8 | Error in Filter Coefficient (á) | When a value is out of the range (0 – 100) | |
9 | Error in Manipulated Value Low Limit (MVLL) | When a value is out of the range (0 – 16,000) | |
10 | Error in Manipulated Value High Limit (MVHL) | When a value is out of the range (0 – 16,000) | |
11 | Error in Variation Rate Limit of Manipulated Value (∆MVL) | When a value is out of the range (0 – 16,000) | |
12 | Error in MV Apply | When a value is neither 0 nor 1 | |
13 | Error in SV Transition Step | When a value is out of the range (0 – 1,000) |
16 | FLAGS | It displays the various PID operation status. |
PID Flags
Bit | Flag Item | Flag Description |
0 | PID-INIT OK | Indicates that the initialization of the loop is normally completed by the PIDINIT command. This flag begins the PLC operation and starts the initialization after the sampling time. (0 = error, 1 = normal) |
1 | PID CALC | This flag is used internally to determine the PID operation interval. |
2 | CALC DELAY | PID operation is conducted based on the number of loops executed per scan. If the number of loops that should be operated simultaneously exceeds this criterion, the exceeded loop operation is delayed and postponed to the next scan. When this happens, the CALC DELAY flag is set. If this flag is set too often, adjust the number of ‘1 SCAN Loop’ or ‘Sampling Interval.’ |
3 | ON/OFF STATUS | This flag is used internally to distinguish between ON and OFF output stage when the ‘ON/OFF control function’ is used. This flag is set in the ON output stage. However, do not use this function directly in the actual control output. The accurate control of the control output is possible when the MV output of the PIDCAL command is used. It is considered ON output when the MV output value is equal to the value specified in Manipulated Value High Limit (MVHL). It is considered OFF output when the MV output value is equal to the value specified in Manipulated Value Low Limit (MVLL). |
4 | WAIT LOOP INIT | Until the first PIDCAL command is executed, it is in the SET state. This flag is reset when the first PID operation (PIDCAL command) is performed based on the sampling cycle. |
5 | AUTO TUNE CMD | This flag is set when starting the Auto Tuning function. The target value (SV) must be specified before this flag is set. When the PV value reaches 63% of the target value (SV), PID gains are automatically calculated and written to the relevant areas and thus resets this flag. If the constant calculation fails, the AUTO-TUNE ERROR flag is set and the control is performed using the previous constant.
*When shutting down the Auto Tune Cmd, please reset Bit 5, 6 at the same time.
Precautions for Auto Tuning The appropriate target value must be specified for direct and reverse operation. For the direct action, a value higher than the PV is entered. For the reverse action, a value lower than the PV is entered. If the deviation between the PV and SV is small, an error may occur or the Auto Tuning does not work properly. |
6 | AUTO TUNING | This flag is automatically set when Auto Tuning is in progress. When Auto-Tuning is shut down, this flag is reset. Depending on the tuning outcome, AUTO-TUNE ERROR flag can be set (Auto Tuning fails) or the calculated constants are automatically recorded in the relevant areas (Auto Tuning succeeds). If a user wants to stop the operation of the Auto Tuning, which is in progress, the user must reset the bit for AUTO-TUNING and UTO-TUNING. |
15 | AUTO TUNE ERROR | This flag is set when the constant operation by the Auto Tuning fails. If an error occurs, AUTO-TUNE CMD and AUTO-TUNING bits are reset. |