PID Control Calculation
- The PIDCAL performs a PID calculation based on the set value (SV) and process value (PV) values.
- The result of the calculation is stored in the manipulation value (MV) area of the WORD data register.
- Refer to the table below for operation data locations:
Operation Data Location
| Offset | Item | Description & Range |
|---|---|---|
| 0 | Set Value (SV) | 0 ~ 16,000 |
| +1 | Process Value (PV) | 0 ~ 16,000 |
| +2 | Manipulation Value (MV) | 0 ~ 16,000 |
| +3 | Process Value after Filtering (PVnf) | 0 ~ 16,000 |
| +4 | Manual Manipulation Value (MVMAN) | 0 ~ 16,000 |
| +5 | Function Selection Flag | – Bit 0: Automatic (0) Manual (1) – Bit 1: Enable Self-Learning – Bit 2: Kp × 100 – Bit 15: Request to delete self-learned data |
| +6 | Reserved | – |
| +7 | Reserved | – |
| +8 | Reserved | – |
| +9 | Reserved | – |
| +10 | Status | Status |
| +11 | Reserved | – |
| +12 | Reserved | – |
| +13 | Reserved | – |
| +14 | Reserved | – |
| +15 | Reserved | – |
| +16 | Reserved | – |
| +17 | Reserved | – |
| +18 | Reserved | – |
| +19 | Reserved | – |
Setting Data for Each Loop
| Offset | Item | Description |
|---|---|---|
| 0 | Set Value (SV) | – Desired target value to control. |
| +1 | Process Value (PV) | – The current value of the controlled unit read by the analog-to-digital (AD) module. – The process value (PV) being read from the analog-to-digital (AD) module must be updated regularly using the FROM instruction or update other measurement values using the MOV instruction. |
| +2 | Manipulation Value (MV) | – This is the result value of the PID operation that is output to the control unit by using a digital-to-analog or I/O module. |
| +3 | Process Value After Filtering (PVnf) | – Filtering is used to prevent instantaneous deviation caused by the process value noise. – The filtered process value is stored in the PVnf area. – When the filter coefficient, α, is 0, the filtering is not applied to the process value. – This area can only be monitored. |
| +4 | Manual Manipulation Value (MVMAN) | – When in manual mode, the value set as the manual manipulation value (MVMAN) is output as the manipulation value (MV). |
| +5 | Function Selection Flag | 1. Automatic/Manual Mode Selection: – The control unit can be controlled automatically by using the PID function or to output the value specified in the manual manipulation value (MVMAN) to the controlled unit. 2. Enable Self-Learning Function: – The self-learning function calculates the most suitable manipulation value (MV) output level for the set value (SV) based on the result of the previously executed PID control and the control operation on the basis of the existing PID control algorithm. – This feature obtains a faster system response. 3. Kp × 100 – Proportional gain (Kp) can maximize the setting range (1 ~ 65,535) up to 100 times. – When the flag is set, the Kp value range can be expanded from 1 ~ 6,5535,500. – If this flag was forcefully reset, [Kp × 100] must be reconfigured as the Kp constant in order to obtain the same control effect. 4. Delete Self-Learned Data: – When this flag is set, the PLC is initialized to delete all of the self-learning data that has been collected and build new learning data. – Because the self-learning data is composed of files that are internal-use-only, they cannot be used for reference. |
| +15 | Status | – Displays the status of the relevant loop. – Refer to the status table below. |
Status Table
| Bit | Function | Description |
|---|---|---|
| 0 | Reserved | Reserved |
| 1 | Reserved | Reserved |
| 2 | Reserved | Reserved |
| 3 | Reserved | Reserved |
| 4 | Applying Self-Learning Data | Status when the control is performed by using the collected self-learning data. |
| 5 | Collecting Self-Learning Data | This status is activated when the self-learning data is being collected. Activated when the set value (SV) is changed. |
| 6 | Stability | Status in which the control system is stable. Process value (PV) and set value (SV) are the same, and the manipulation value (MV) output is fixed with no change. |
| 7 | Self-Learning Retention | Status in which the self-learning data is stored in memory. |
| 8 | Process Value Inertia Amount Data Retention | This status is set when a non-zero value is stored in the process value (PV) inertia amount memory. |
| 9 | Reserved | Reserved |
| 10 | Reserved | Reserved |
| 11 | Reserved | Reserved |
| 12 | Reserved | Reserved |
| 13 | Reserved | Reserved |
| 14 | Reserved | Reserved |
| 15 | Reserved | Reserved |
Additional Information
- Prior to the PIDCAL instruction operation, the PIDINIT instruction must be operated first.
- The PID instructions (PIDCAL and PIDINIT) can only be used once in the entire MapleLogic project.
- For the use of multiple loops, the PIDINIT and PIDCAL areas should not be overlapped.
- Because the PIDINIT area and some areas of the PIDCAL instruction are used for PID operation, if they were set as a latch area, the PID function may not work properly.
- An error occurs when auto tuning is running in manual mode.
- The auto tuning function should only be running in automatic mode.
Configure Starting Addresses for PIDINIT and PIDCAL
- Ensure that the PIDINIT starting address and PIDCAL starting address do NOT overlap.
- One of the two following calculations must be satisfied:
- [PIDCAL starting address] ≥ [PIDINIT starting address] + [Total number of loops] × 20 + 2
- [PIDINIT starting address] ≥ [PIDCAL starting address] + [Total number of loops ] × 20
- Example: If the total number of loops is 10 and the *PIDINIT starting address is 100:
- 10 loops × 20 WORDs + 2 (common area) = 202 → 50 + 202 = 252
- PIDCAL starting address should be set as 202 or above.
- 10 loops × 20 WORDs + 2 (common area) = 202 → 50 + 202 = 252
