PID
PID
PID(190)
Purpose
Executes PID control according to the specified parameters.
Ladder Symbol
Variations
Parameters
The following diagrams show the locations of the parameter data. For details on the parameters, refer to PID Parameter Settings in
this section.
mk:@MSITStore:C:\Program%20Files%20(x86)\OMRON\CX-One\CX-Programmer... 17/02/2023
PID(190) Page 2 of 11
Operand Specifications
Area S C D
CIO Area CIO 0 to CIO 6143 CIO 0 to CIO 6105 CIO 0 to CIO 6143
Description
When the execution condition is ON, PID(190) carries out target value filtered PID control with two degrees of freedom according to
the parameters designated by C (set value, PID constant, etc.). It takes the specified input range of binary data from the contents of
input word S and carries out the PID action according to the parameters that are set. The result is then stored as the manipulated
variable in output word D.
The parameters are obtained when the execution condition turns from OFF to ON, and the Error Flag will turn ON if the settings are
outside of the permissible range.
If the settings are within the permissible range, PID processing will be executed using the initial values. Bumpless operation is not
performed at this time. It will be used for manipulated variables in subsequent PID processing execution. (Bumpless operation is
processing that gradually and continuously changes the manipulated variable in order to avoid the adverse effects of sudden
changes.)
When the execution condition turns ON, the PV for the specified sampling period is entered and processing is performed.
The number of valid input data bits within the 16 bits of the PV input (S) is designated by the input range setting in C+6, bits 08 to
11. For example, if 12 bits (4 hex) is designated for the input range, the range from 0000 hex to 0FFF hex will be enabled as the PV.
(Values greater than 0FFF hex will be regarded as 0FFF hex.)
mk:@MSITStore:C:\Program%20Files%20(x86)\OMRON\CX-One\CX-Programmer... 17/02/2023
PID(190) Page 3 of 11
Measured values (PV) and set values (SV) are in binary without sign, from 0000 hex to the maximum value of the input range.
The number of valid output data bits within the 16 bits of the manipulated variable output is designated by the output range setting in
C+6, bits 00 to 03. For example, if 12 bits (4 hex) is designated for the output range, the range from 0000 hex to 0FFF hex will be
output as the manipulated variable.
For proportional operation only, the manipulated variable output when the PV equals the SV can be designated as follows:
0: Output 0%
1: Output 50%.
The upper and lower limits of the manipulated variable output can be designated.
The sampling period can be designated in units of 10 ms (0.01 to 99.99 s), but the actual PID action is determined by a combination
of the sampling period and the time of PID(190) instruction execution (with each cycle).
The timing of enabling changes made to PID constants can be set to either 1) the beginning of PID instruction execution or 2) the
beginning of PID instruction execution and each sampling period. Only the proportional band (P), integral constant (Tik), and
derivative constant (Tdk) can be changed each sampling cycle (i.e., during PID instruction execution). The timing is set in bit 1 of
C+5.
Of the PID parameters (C to C+38), only the set value (SV) can be changed when the execution condition is ON. When changing
other values, be sure to change the execution condition from OFF to ON.
Flags
Greater Than > ON if the manipulated variable after the PID action
Less Than Flag < ON if the manipulated variable after the PID action is
below the lower limit.
Precautions
PID(190) is executed as if the execution condition was a STOP-RUN signal. PID calculations are executed when the execution
condition remains ON for the next cycle after C+9 to C+38 are initialized. Therefore, when using the Always ON Flag (ON) as an
execution condition for PID(190), provide a separate process where C+9 to C+38 are initialized when operation is started.
If the C data is out of range, an error will occur and the Error Flag will turn ON.
If the actual sampling period is more than twice the designated sampling period, an error will occur and the Error Flag will turn ON.
PID control will still be executed, however.
The Greater Than Flag turns ON if the manipulated variable after the PID action exceeds the upper limit. At this time, the results are
mk:@MSITStore:C:\Program%20Files%20(x86)\OMRON\CX-One\CX-Programmer... 17/02/2023
PID(190) Page 4 of 11
The Less Than Flag turns ON if the manipulated variable after the PID action is below the lower limit. At this time, the results are
output at the lower limit.
Within the PID parameters (C to C+38), the only value that can be changed while the input condition is ON is the set value for C. If
any other value is changed, be sure to turn the input condition from OFF to ON to enable the new value.
Example
At the rising edge of CIO 0.00 (OFF to ON), the work area in D209 to D238 is initialized according to the parameters (shown below)
set in D200 to D208. After the work area has been initialized, PID control is executed and the manipulated variable is output to
CIO 2000.
When CIO 0.00 is turned ON, PID control is executed at the sampling period intervals according to the parameters set in D200 to
D208. The manipulated variable is output to CIO 2000.
The PID constants used in PID calculations will not be changed if the proportional band (P), integral constant (Tik), or derivative
constant is changed after CIO 0.00 turns ON.
C+6, bits 00 to 03
mk:@MSITStore:C:\Program%20Files%20(x86)\OMRON\CX-One\CX-Programmer... 17/02/2023
PID(190) Page 5 of 11
If the range of data handled by an Analog Input Unit or Analog Output Unit cannot be set accurately by setting the number of valid
bits, APR(069) (ARITHMETIC PROCESS) can be used to convert to the proper ranges before and after PID(190).
The following program section shows an example for a DRT1-AD04 Analog Input Unit and DRT1-DA02 Analog Output Unit
operating as DeviceNet slaves. The data ranges for these two Units is 0000 to 1770 hex, which cannot be specified merely by
setting the valid number of digits. APR(069) is thus used to convert the 0000 to 1770 hex range of the Analog Input Unit to 0000 to
FFFF hex for input to PID(190) and then the manipulated variable output from PID(190) is converted back to the range 0000 to 1770
hex, again using APR(069), for output from the Analog Output Unit.
Performance Specifications
Item Specifications
PID control method --- Target value filter-type two-degrees-of-freedom PID method
(forward/reverse)
Integral constant Tik 1 to 8191, 9999 (No integral action for sampling period multiple, 9999.)
Derivative constant Tdk 0 to 8191 (No derivative action for sampling period multiple, 0.)
Calculation Method
Calculations in PID control are performed by the target value filtered control with two degrees of freedom.
mk:@MSITStore:C:\Program%20Files%20(x86)\OMRON\CX-One\CX-Programmer... 17/02/2023
PID(190) Page 6 of 11
Block Diagram for Target Value PID with Two Degrees of Freedom
When overshooting is prevented with simple PID control, stabilization of disturbances is slowed (1). If stabilization of disturbances is
speeded up, on the other hand, overshooting occurs and response toward the target value is slowed (2).
When target-value PID control with two degrees of freedom is used, on the other hand, there is no overshooting, and response
toward the target value and stabilization of disturbances can both be speeded up (3).
C Set value (SV) The target value of the process Binary data (of the same number Allowed
C+1 Proportional band The parameter for P action 0001 to 270F hex (1 to 9999); Can be changed
bit 1 of C+5 is 1.
C+2 Tik A constant expressing the 0001 to 1FFF hex (1 to 8191);
Integral Constant strength of the integral action. As (9999 = Integral operation not
this value increases, the integral executed) (See note 1.)
strength decreases.
Derivative Constant strength of the derivative action. (0000 = Derivative operation not
As this value increases, the executed) (See note 1.)
C+4 Sampling period (t) Sets the period for executing the 0001 to 270F hex (1 to 9999); Not allowed
mk:@MSITStore:C:\Program%20Files%20(x86)\OMRON\CX-One\CX-Programmer... 17/02/2023
PID(190) Page 7 of 11
10 ms)
Bits 04 to 15 2-PID parameter (a) The input filter coefficient. 000 hex: a = 0.65
of C+5 Normally use 0.65 (i.e., a setting Setting from 100 to 163 hex
of 000). The filter efficiency means that the value of the
Bit 01 of C+5 PID constant change The timing of enabling changes 0: At start of PID instruction Allowed
enable setting made to the proportional band execution
(P), integral constant (Tik), and 1: At start of PID instruction
derivative constant (Tdk) for use execution and each sampling
in PID calculations. period
Bit 00 of C+5 PID forward/reverse Determines the direction of the 0: Reverse action Not allowed
Bit 12 of C+6 Manipulated variable Determines whether or not limit 0: Disabled (no limit control)
output limit control control will apply to the 1: Enabled (limit control)
Bits 08 to 11 Input range The number of input data bits. 0: 8 bits 5: 13 bits
of C+6 1: 9 bits 6: 14 bits
2: 10 bits 7: 15 bits
3: 11 bits 8: 16 bits
4: 12 bits
Bits 04 to 07 Integral and Determines the unit for 1: Sampling period multiple
of C+6 derivative unit expressing the integral and 9: Time (unit: 100 ms)
derivative constants.
Bits 00 to 03 Output range The number of output data bits. 0: 8 bits 5: 13 bits
of C+6 (The number of output bits is 1: 9 bits 6: 14 bits
4: 12 bits
C +7 Manipulated variable The lower limit for when the 0000 to FFFF (binary)
output lower limit manipulated variable output limit (See note 3.)
is enabled.
C +8 Manipulated variable The upper limit for when the 0000 to FFFF (binary)
output upper limit manipulated variable output limit (See note 3.)
is enabled.
Note
(1) When the unit is designated as 1, the range is from 1 to 8,191 times the period. When the unit is designated as 9, the range is
from 0.1 to 819.1 s. When 9 is designated, set the integral and derivative times to within a range of 1 to 8,191 times the
sampling period.
mk:@MSITStore:C:\Program%20Files%20(x86)\OMRON\CX-One\CX-Programmer... 17/02/2023
PID(190) Page 8 of 11
(2) Setting the 2-PID parameter (a) to 000 yields 0.65, the normal value.
(3) When the manipulated variable output limit control is enabled (i.e., set to "1"), set the values as follows:
0000 MV output lower limit MV output upper limit Max. value of output range
• If the sampling period is less than the cycle time, PID control is executed with each cycle and not with each sampling period.
• If the sampling period is greater than or equal to the cycle time, PID control is not executed with each cycle, but PID(190) is
executed when the cumulative value of the cycle time (the time between PID instructions) is greater than or equal to the
sampling period. The surplus portion of the cumulative value (i.e., the cycle time's cumulative value minus the sampling period)
is carried forward to the next cumulative value.
For example, suppose that the sampling period is 100 ms and that the cycle time is consistently 60 ms. For the first cycle after
the initial execution, PID(190) will not be executed because 60 ms is less than 100 ms. For the second cycle, 60 ms + 60 ms is
greater than 100 ms, so PID(190) will be executed. The surplus of 20 ms (i.e., 120 ms – 100 ms = 20 ms) will be carried forward.
For the third cycle, the surplus 20 ms is added to 60 ms. Because the sum of 80 ms is less than 100 ms, PID(190) will not be
executed. For the fourth cycle, the 80 ms is added to 60 ms. Because the sum of 140 ms is greater than 100 ms, PID(190) will
be executed and the surplus of 40 ms (i.e., 120 ms – 100 ms = 20 ms) will be carried forward. This procedure is repeated for
subsequent cycles.
Control Actions
Proportional Action (P)
Proportional action is an operation in which a proportional band is established with respect to the set value (SV), and within that
band the manipulated variable (MV) is made proportional to the deviation. An example for reverse operation is shown in the following
illustration.
If the proportional action is used and the present value (PV) becomes smaller than the proportional band, the manipulated variable
(MV) is 100% (i.e., the maximum value). Within the proportional band, the MV is made proportional to the deviation (the difference
between from SV and PV) and gradually decreased until the SV and PV match (i.e., until the deviation is 0), at which time the MV
will be at the minimum value of 0% (or 50%, depending on the setting of the manipulated variable output designation parameter).
The MV will also be 0% when the PV is larger than the SV.
The proportional band is expressed as a percentage of the total input range. The smaller the proportional band, the larger the
proportional constant and the stronger the corrective action will be. With proportional action an offset (residual deviation) generally
occurs, but the offset can be reduced by making the proportional band smaller. If it is made too small, however, hunting will occur.
mk:@MSITStore:C:\Program%20Files%20(x86)\OMRON\CX-One\CX-Programmer... 17/02/2023
PID(190) Page 9 of 11
Combining integral action with proportional action reduces the offset according to the time that has passed, so that the PV will match
the SV. The strength of the integral action is indicated by the integral time, which is the time required for the manipulated variable of
the integral action to reach the same level as the manipulated variable of the proportional action with respect to the step deviation,
as shown in the following illustration. The shorter the integral time, the stronger the correction by the integral action will be. If the
integral time is too short, the correction will be too strong and will cause hunting to occur.
Proportional action and integral action both make corrections with respect to the control results, so there is inevitably a response
delay. Derivative action compensates for that drawback. In response to a sudden disturbance it delivers a large manipulated variable
and rapidly restores the original status. A correction is executed with the manipulated variable made proportional to the incline
(derivative coefficient) caused by the deviation.
The strength of the derivative action is indicated by the derivative time, which is the time required for the manipulated variable of the
derivative action to reach the same level as the manipulated variable of the proportional action with respect to the step deviation, as
shown in the following illustration. The longer the derivative time, the stronger the correction by the derivative action will be.
mk:@MSITStore:C:\Program%20Files%20(x86)\OMRON\CX-One\CX-Programmer... 17/02/2023
PID(190) Page 10 of 11
PID Action
PID action combines proportional action (P), integral action (I), and derivative action (D). It produces superior control results even for
control objects with dead time. It employs proportional action to provide smooth control without hunting, integral action to
automatically correct any offset, and derivative action to speed up the response to disturbances.
Direction of Action
When using PID control, select either of the following two control directions. In either direction, the MV increases as the difference
between the SV and the PV increases.
mk:@MSITStore:C:\Program%20Files%20(x86)\OMRON\CX-One\CX-Programmer... 17/02/2023
PID(190) Page 11 of 11
• When it is not a problem if a certain amount of time is required for stabilization (settlement time), but it is important not to cause
overshooting, then enlarge the proportional band.
• When overshooting is not a problem but it is desirable to quickly stabilize control, then narrow the proportional band. If the
proportional band is narrowed too much, however, then hunting may occur.
• When there is broad hunting, or when operation is tied up by overshooting and undershooting, it is probably because integral
action is too strong. The hunting will be reduced if the integral time is increased or the proportional band is enlarged.
• If the period is short and hunting occurs, it may be that the control system response is quick and the derivative action is too
strong. In that case, set the derivative action lower.
mk:@MSITStore:C:\Program%20Files%20(x86)\OMRON\CX-One\CX-Programmer... 17/02/2023