The PIDController object simulates the Proportional-Integral-Differential (PID) type controller that is widely used in electronic control systems.
error = SetPoint – x
integral = INTEGRAL + (error – ERROR)*(t – T)
derivative = (error – ERROR)/(t – T)
y’ = ProportionalGain/SetPointScale * (error + integral/IntegralTime +
derivative*DerivativeTime)
y = min( max( y’, OutputLow ), OutputHigh )
where:
y = present output value for the PID controller
x = present ProcessVariable input to the PID controller
t = present simulation time
Y = output value for the PID controller at the last update time
X = ProcessVariable input to the PID controller at the last update time
T = simulation time at the last update
ERROR = value for error at the last update time
INTEGRAL = value for integral at the last update time
The value returned by the PIDController is calculated on demand. The update signal received from the Controller is used only to record the values Y, X, T, ERROR, and INTEGRAL used in the calculation.