PID

Limited PID controller

Diagram

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

y(t) = ...

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

PID_Control

Parameters (19)

controllerType

Value: SimpleController.PID

Type: SimpleController

Description: Type of controller

k

Value: 1

Type: GainType (1/s)

Description: Gain of controller [GainType]

Ti

Value: 0.5

Type: Time (s)

Description: Time constant of integrator (i.e., gain for integrator = 1/Ti)

Td

Value: 0.1

Type: Time (s)

Description: Derivative gain (i.e., time span for error prediction)

yMax

Value: inf

Type: Rate (1/s)

Description: Upper limit of output

yMin

Value: -yMax

Type: Rate (1/s)

Description: Lower limit of output

wp

Value: 1

Type: Fraction

Description: Set-point weight for Proportional block (0..1)

wd

Value: 0

Type: Fraction

Description: Set-point weight for Derivative block (0..1)

Ni

Value: 0.9

Type: Dimensionless

Description: Ni*Ti is time constant of anti-windup compensation

Nd

Value: 10

Type: Dimensionless

Description: The higher Nd, the more ideal the derivative block

kFF

Value: 1

Type: Dimensionless

Description: Gain of feed-forward input

initType

Value: Init.NoInit

Type: Init

Description: Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)

xi_start

Value: 0

Type: Unspecified

Description: Initial or guess value for integrator output (= integrator state)

xd_start

Value: 0

Type: Unspecified

Description: Initial or guess value for state of derivative block

y_start

Value: 0

Type: Rate (1/s)

Description: Initial value of output

homotopyType

Value: LimiterHomotopy.Linear

Type: LimiterHomotopy

Description: Simplified model for homotopy-based initialization

hasFeedForward

Value: false

Type: Boolean

Description: Use feed-forward input?

strict

Value: false

Type: Boolean

Description: = true, if strict limits with noEvent(..)

limitsAtInit

Value: true

Type: Boolean

Description: Has no longer an effect and is only kept for backwards compatibility (the implementation uses now the homotopy operator)

Connectors (4)

y

Type: RealOutput

Description: Policy output signal

u_desiredValue

Type: RealInput

Description: The goal to meet (setpoint)

u_currentValue

Type: RealInput

Description: The measured state of the system under control

u_feedForward

Type: RealInput

Description: An optional feedforward input

Components (1)

PID

Type: LimPID

Description: P, PI, PD, and PID controller with limited output, anti-windup compensation, setpoint weighting and optional feed-forward

Revisions

  • Updated type definitions and documentation in v2.0.0.

  • Class adapted as to be compliant with MSL 4.0.0 in v2.2.