![]()
This component represents a proportional integral derivative (PID) control. It inherits from the abstract component base_PID
| Percent_Scaling | BOOLEAN | TRUE | Percentage scaling or No Scaling |
| Out | PORTS_LIB.analog_signal | (n = 1) | OUT | output | |
| PV | PORTS_LIB.analog_signal | (n = 1) | IN | Process Value | |
| SP | PORTS_LIB.analog_signal | (n = 1) | IN | Set Point |
| AtOutH | REAL | 100 | Max range of output value | ||
| AtOutL | REAL | 0 | Min range of output value | ||
| AuSPoSp | REAL | 1 | Auto Setpoint speed (-/s) | -/s | |
| Kd | REAL | 0.5 | Differential gain for derivative action | ||
| Kp | REAL | 1 | Gain for PID | ||
| Out_init | REAL | 0 | Initial Output | ||
| PLC_connect | BOOLEAN | FALSE | set true if PLC connected to model | ||
| PMaxRan | REAL | 320 | Max range of process value | ||
| PMinRan | REAL | 0 | Min range of process value | ||
| RA | BOOLEAN | FALSE | Reverse Action enabled | ||
| TR_S | BOOLEAN | TRUE | Tracking mode set | ||
| Td | REAL | 0 | Derivative time for PID (ms) | ms | |
| Ti | REAL | 100000 | Integration time for PID (ms) | ms | |
| gamma | REAL | 0.1 | Ratio between the time constant for the antiwindup and the integration time (0..1) | 0..1 |
| AtSP | REAL | Active SetPoint | |||
| AtSPoSp | REAL | Active Set Point Speed | |||
| Kd_eff | REAL | ||||
| Out_over | REAL | Overshoot of Output | |||
| Outc | REAL | output before limitation | |||
| PVScaled | REAL | Process Value Scaled | |||
| PosR | REAL | Active Position Requested when tracking mode activated | |||
| SPR | REAL | Set Point Request | |||
| SPScaled | REAL | Setpoint Value Scaled | |||
| SPoDeSp | REAL | Setpoint Increase speed (-/s) | -/s | ||
| SPoInSp | REAL | Setpoint Increase speed (-/s) | -/s | ||
| TermD | REAL | Derivative Action | |||
| TermI | REAL | Integral Action | |||
| TermP | REAL | Integral Action | |||
| dev | REAL | deviation : error PV-SP | |||
| dev_filt | REAL | Process Value Scaled and filtered | |||
| sense | REAL | control setting, Reverse action |
The Base_PID component represents a control structure PI with implementation of reverse action. The controller has two working states available:
Regulation: The output signal
is driven by the PID function.
Tracking: The output signal is
set equal to the position request.
The two input signals to the controller are the setpoint and the controlled process variable:
PV.signal[1]
SP.signal[1]
The process input signal is normalized as a function of the maximum and minimum range of the process value defined by the user, and also the active setpoint signal:

The active setpoint is calculated as a function of the active setpoint speed:
![]()
An error signal, 'dev', is defined as the difference between these two normalized values.
![]()
The feedback into the integrator to avoid saturation is
![]()
The integral part of the output is calculated from

where:
����������� �
is the 'dev' variable calculated previously
�����������
is the gain of the integral action
�����������
is the time of integral action
�����������
�is the relation
between the time of integral action and the time constant of anti-windup
The proportional action is proportional to the error between the normalized setpoint and the normalized input signal from the process.
![]()
Differential action is implemented as follows:
![]()
where:
�is a differential term
that modiffies the value of the proportional gain.
The unlimited output is the sum of the proportional output, the integral output and the derivative output.
![]()
The variable 'sense' can be a positive number or a negative number. When 'sense'>0, the controller is direct-acting. In this case, the controller output decreases if the controlled variable increases. A typical case of direct-acting control is the temperature control of heat exchanger, i.e. if the outlet temperature increases, the controller closes the vapor inlet valve to reduce the heating power.
If 'sense'<0, the controller is inverse-acting, and the controller output increases if the controlled variable increases. A typical case is a level control where, if the level of liquid in a tank increases due to an increase of the inlet flow, the controller must increase the position of the tank exit valve to re-establish the level.
For more information, see http://j2eeps.cern.ch/wikis/display/EN/Controller+%28PID%29.
The algorithm of the PID is implemented in Base_PID. This component defines the velocity of the active setpoint speed and the value of PosR.
Auto setpoint speed is implemented by zone. On tracking mode this speed is implemented to minimize the difference between the process signal and the active setpoint and makes the active setpoint follow the process signal.
![]()
If the value of the active setpoint is less than or equal to the setpoint request plus the incremental value of the setpoint in a communication interval, then the speed is equal to the incremental speed.
![]()
If the auto setpoint request is less than the setpoint request but greater than the setpoint request plus the incremental value of the setpoint in a communication interval, then the speed is adjusted to reach the setpoint request at the end of the interval.
![]()
where:
CINT is the communication interval
If the active setpoint is greater than or equal to the setpoint request plus the decremented value of the setpoint in a communication interval, then the speed is equal to the decremental speed.
![]()
If the auto setpoint request is higher than the setpoint request but lower than setpoint request plus the decremented value of the setpoint in a communication interval, then the speed is adjusted to reach the setpoint request at the end of the interval.
![]()
where:
CINT is the communication interval
The value of SPoInSp and SpoDeSP is equal to the value of AuSPoSp determined by the user.
The value of the active position (PosR) is determined by the user in tracking mode. When the controller is not tracking, this signal is limited to the values defined by means of the variables AtOutL and AtOutH.
The value of the setpoint request is set by the port SP.
![]()