blockPID
Extends from Interfaces.PartialConverters.Policy_SO (Policy Block (Decision Making/Controller)).
Information
This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.
This element makes use of the →LimPID element in the Modelica Standard Library. The controller is a very flexible component which allows to model P, PI, PD, PID controllers as needed.
A PID controller continually calculates the error e(t) = u_desiredValue(t) - u_currentValuet(t) and then applies a correction based upon proportional (P), integral (I), and derivatice (D) terms as indicated in the standard form
The parameter k here denotes the total gain for the controller's output, i.e., the sum of the respective error terms. Ti can be thought of as the time span to correct the total accumulated error, while Td is the time to forecast the error into the future, i.e., the current rate of change for the error times Td.
See also
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| GainType | k | 1 | Gain of controller [GainType] |
| Time | Ti | 0.5 | Time constant of integrator (i.e., gain for integrator = 1/Ti) |
| Time | Td | 0.1 | Derivative gain (i.e., time span for error prediction) |
| OutputType | yMax | inf | Upper limit of output |
| OutputType | yMin | -yMax | Lower limit of output |
| Fraction | wp | 1 | Set-point weight for Proportional block (0..1) |
| Fraction | wd | 0 | Set-point weight for Derivative block (0..1) |
| Dimensionless | Ni | 0.9 | Ni*Ti is time constant of anti-windup compensation |
| Dimensionless | Nd | 10 | The higher Nd, the more ideal the derivative block |
| Dimensionless | kFF | 1 | Gain of feed-forward input |
| Structural Parameters | |||
| SimpleController | controllerType | SimpleController.PID | Type of controller |
| Boolean | hasFeedForward | false | Use feed-forward input? |
| Initialization | |||
| Init | initType | Init.NoInit | Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output) |
| Unspecified | xi_start | 0 | Initial or guess value for integrator output (= integrator state) |
| Unspecified | xd_start | 0 | Initial or guess value for state of derivative block |
| OutputType | y_start | 0 | Initial value of output |
| LimiterHomotopy | homotopyType | LimiterHomotopy.Linear | Simplified model for homotopy-based initialization |
| Advanced | |||
| Boolean | strict | false | = true, if strict limits with noEvent(..) |
| Dummy | |||
| Boolean | limitsAtInit | true | Has no longer an effect and is only kept for backwards compatibility (the implementation uses now the homotopy operator) |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Interfaces.Connectors.RealInput | u_desiredValue | The goal to meet (setpoint) | |
| Interfaces.Connectors.RealInput | u_currentValue | The measured state of the system under control | |
| Interfaces.Connectors.RealInput | u_feedForward | An optional feedforward input |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| RealOutput | y (from Policy_SO) | Policy output signal |
Contents
| Name | Description |
|---|---|
| GainTypeprotected |
Revisions
- Updated type definitions and documentation in v2.0.0.
- Class adapted as to be compliant with MSL 4.0.0 in v2.2.