Skip to main content

PID Control Calculation

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

Operation Data Location
OffsetItemDescription & RangeNote
0Set Value (SV)0 ~ 16,000For each loop
+1Process Value (PV)0 ~ 16,000
+2Manipulation Value (MV)0 ~ 16,000
+3Process Value after Filtering (PVnf)0 ~ 16,000
+4Manual Manipulation Value (MVMAN)0 ~ 16,000
+5Function 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
+6Reserved-
+7
+8
+9
+10StatusStatus
+11Reserved-
+12
+13
+14
+15
+16
+17
+18
+19

Setting Data For Each Loop

Setting Data For Each Loop
OffsetItemDescription
0Set Value (SV)
  • Desired target value to control.
+1Process 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.
+2Manipulation 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.
+3Process 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.
+4Manual Manipulation Value (MVMAN)
  • When in manual mode, the value set as the manual manipulation value (MVMAN) is output as the manipulation value (MV).
+5Function 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:
    • Added in the PID2 version.
    • 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 &#215 100
    • Added in the PID2 version.
    • 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:
    • Added in the PID2 version.
    • 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.
+15Status
  • Displays the status of the relevant loop.
  • Refer to the status table below.

Status Table

Status Description For Each Loop
BitFunctionDescription
0Reserved
1
2
3
4Applying Self-Learning DataStatus when the control is performed by using the collected self-learning data.
5Collecting Self-Learning DataThis status is activated when the self-learning data is being collected.
Activated when the set value (SV) is changed.
6StabilityStatus 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.
7Self-Learning RetentionStatus in which the self-learning data is stored in memory.
8Process Value Inertia Amount Data RetentionThis status is set when a non-zero value is stored in the process value (PV) inertia amount memory.
9Reserved
10
11
12
13
14
15

Additional Information

  1. Prior to the PIDCAL instruction operation, the PIDINIT instruction must be operated first.
  2. The PID instructions (PIDCAL and PIDINIT) can only be used once in the entire CICON project.
  3. For the use of multiple loops, the PIDINIT and PIDCAL areas should not be overlapped.
  4. 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.
  5. 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

  1. Ensure that the PIDINIT starting address and PIDCAL starting address do NOT overlap.
  2. 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) = 20250 + 202 = 252
      • PIDCAL starting address should be set as 202 or above.