functionpiStep

Performs one step of a time-discrete limited PI-control algorithm

Extends from Modelica.Icons.Function (Icon for functions).

Information

This is the algorithm of one step of a PI-controller with feed-forward and limited output. The anti-windup measure (either back-calculation or clamped) is formulated straight-forward to avoid iteration. Therefore the code can be:

  • called in a triggered block of a PI-controller
  • called in a clocked block of a PI-controller
  • transferred to a embedded controller

Integration is replaced by an explicit forward Euler.

Anti-Windup measure: A prediction of the output is calculated without limitation is calculated. If there is a difference between unlimited and limited result (i.e. protected variable cropped):

  • BackCalc: cropped multiplied by the inverse of proportional gain is subtracted from the integrator's input
  • Clamped : The integrator is stopped (i.e. the integrator's input set to zero).

    Inputs

    TypeNameDefaultDescription
    RealuReference signal
    Realu_mMeasured signal
    RealkpParameter proportional gain
    SI.TimeTiParameter integral time constant
    SI.TimeTsSample period
    RealkFFParameter proportional gain of feed-forward
    RealffFeed-forward signal
    AntiWindupantiWindupAnti-Windup measure
    RealyMinLower limit of output
    RealyMaxUpper limit of output
    Realpre_xPrevious state

    Outputs

    TypeNameDefaultDescription
    RealxState
    RealyResult