blockPID
Discrete-time PID controller
Extends from Modelica_Synchronous.RealSignals.Interfaces.PartialClockedSISO (Block with clocked single input and clocked single output Real signals).
Information
This block defines a text-book version of a discrete-time PID controller by the formula:
// Transfer function form: G(z) = (b0*z^2 + b1*z + b2) / (z^2 - z); b0 = k*(1 + T/Ti + Td/T) b1 = -k*(1 + 2*Td/T) b2 = k*Td/T
where k is the gain of the controller, Ti is the time constant of the integrative part, Td is the time constant of the derivative part, and T is the sample period.
This discrete-time form has been derived from the continuous-time form of a PID controller by using the backward rectangular approximation (also called backward euler method or right-hand approximation) between the s- and z- domain:
s = (z - 1)/(h*z)
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real | k | 1 | Gain of PID controller |
| Real | Ti | 0.5 | Time constant of integrator part |
| Real | Td | 0.1 | Time constant of derivative part |
| Initialization | |||
| Real | y_start | 0 | Initial value of output |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealInput | u (from PartialClockedSISO) | Connector of clocked, Real input signal | |
| Modelica.Blocks.Interfaces.RealOutput | y (from PartialClockedSISO) | Connector of clocked, Real output signal |