Skip to content
Limiter.md

Limiter ​

Signal limiter that constrains input values between specified boundaries.

Implements a hard saturation that restricts the output signal to remain within the bounds specified by y_min and y_max. When the input signal is within these limits, it passes through unchanged; otherwise, the output is clamped to the nearest limit value. This is commonly used in control systems to prevent signals from exceeding safe operating ranges.

This component extends from SISO

Usage ​

BlockComponents.Limiter(y_max, y_min=-y_max)

Parameters: ​

NameDescriptionUnitsDefault value
y_maxMaximum allowed output value–
y_minMinimum allowed output value, defaults to negative of y_max–-y_max

Connectors ​

  • u - This connector represents a real signal as an input to a component (RealInput)

  • y - This connector represents a real signal as an output from a component (RealOutput)

Behavior ​

y(t)=clamp(u(t),y_min,y_max)

Source ​

dyad
"""
Signal limiter that constrains input values between specified boundaries.

Implements a hard saturation that restricts the output signal to remain within the bounds
specified by y_min and y_max. When the input signal is within these limits, it passes through
unchanged; otherwise, the output is clamped to the nearest limit value. This is commonly used
in control systems to prevent signals from exceeding safe operating ranges.
"""
component Limiter
  extends SISO
  "Maximum allowed output value"
  parameter y_max::Real
  "Minimum allowed output value, defaults to negative of y_max"
  parameter y_min::Real = -y_max
relations
  y = clamp(u, y_min, y_max)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/Limiter.svg"}
  }
}
end
Flattened Source
dyad
"""
Signal limiter that constrains input values between specified boundaries.

Implements a hard saturation that restricts the output signal to remain within the bounds
specified by y_min and y_max. When the input signal is within these limits, it passes through
unchanged; otherwise, the output is clamped to the nearest limit value. This is commonly used
in control systems to prevent signals from exceeding safe operating ranges.
"""
component Limiter
  "Input signal port"
  u = RealInput() {
    "Dyad": {
      "placement": {
        "icon": {"iconName": "input", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0},
        "diagram": {"iconName": "input", "x1": -100, "y1": 450, "x2": 0, "y2": 550, "rot": 0}
      }
    }
  }
  "Output signal port"
  y = RealOutput() {
    "Dyad": {
      "placement": {
        "icon": {"iconName": "output", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0},
        "diagram": {"iconName": "output", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0}
      }
    }
  }
  "Maximum allowed output value"
  parameter y_max::Real
  "Minimum allowed output value, defaults to negative of y_max"
  parameter y_min::Real = -y_max
relations
  y = clamp(u, y_min, y_max)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/Limiter.svg"}
  }
}
end


Test Cases ​

No test cases defined.