PID
PID-controller in additive description form
Description
Connections
Parameters
The PID component models an ideal proportional-integral-derivative (PID) controller. This controller differs from the ones normally used in the industrial setup as the proportional gain, k, is decoupled from the system. This does not affect the integral and the derivative gain performance. For a more practically useful PID-controller, use the Lim PID component.
The equation of this controller is y=k⁢1+1Ti⁢s+Td⁢s⁢u where the derivative is estimated numerically based on the time step, Nd. The greater the value of Nd, the better the estimate of the derivative.
The Signal Size parameter allows the block to operate on a vector of signals rather than a single signal.
Initialization
The PID block can be initialized in different ways controlled by parameter initType. DoNotUse_InitialIntegratorState is added for backward compatibility reasons.
initType
Integrator initType
Derivative initType
NoInit
SteadyState
InitialState
InitialOutput and initial equation: y = y_start
DoNotUse_InitialIntegratorState
In many cases, the most useful initial condition is SteadyState because initial transients are no longer present. If initType=InitPID⋅SteadyState, then in some cases difficulties might occur. The reason is the equation of the integrator, y.=k⁢u. The steady state equation, x.=0 leads to the condition that the input to the integrator is 0. If the input u is already (directly or indirectly) defined by another initial condition, the initialization problem is singular (that is, has none or infinitely many solutions). This situation occurs often in mechanical systems, where, for example, u=desiredSpeed−measuredSpeed. Because speed is both a state and a derivative, it is natural to initialize it with 0. As sketched, this is not possible. The solution is to not initialize um or the variable that is used to compute um by an algebraic equation. If the parameter Limits At Initial is false, the limits at the output of this component are removed from the initialization problem, which leads to a much simpler equation system. After initialization has been performed, it is checked with an assert whether the output is in the defined limits.
Name
Modelica ID
u
Real input vector
y
Real output vector
Default
Units
Signal Size
1
Dimension of input and output signals
signalSize
k
Gain
Ti
0.5
s
Time Constant of Integrator
Td
0.1
Time Constant of Derivative block
Nd
10
The greater Nd, the more ideal the derivative component
Initial Values
Type of initialization; see Initialization section
xi0
0
Initial or guess value for the output of the integrator component
xi_start
xd0
Initial or guess value for state of derivative component
xd_start
y0
Initial value of output
y_start
See Also
Lim PID
Signal Blocks
Download Help Document