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
| Type | Name | Default | Description |
|---|---|---|---|
| Real | u | Reference signal | |
| Real | u_m | Measured signal | |
| Real | kp | Parameter proportional gain | |
| SI.Time | Ti | Parameter integral time constant | |
| SI.Time | Ts | Sample period | |
| Real | kFF | Parameter proportional gain of feed-forward | |
| Real | ff | Feed-forward signal | |
| AntiWindup | antiWindup | Anti-Windup measure | |
| Real | yMin | Lower limit of output | |
| Real | yMax | Upper limit of output | |
| Real | pre_x | Previous state |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | x | State | |
| Real | y | Result |