Skip to content
SlewRateLimiter.md

SlewRateLimiter ​

Limits the rate of change of a signal between specified rising and falling rates.

A slew rate limiter that constrains how quickly the output signal can change in response to input variations. It ensures the derivative of the output remains between the specified maximum rising and falling rates. The output initially equals the input, and thereafter changes at a rate determined by the difference between input and output, scaled by the time derivative constant, and limited by the rising and falling rate parameters.

dydt=clamp(u−ytd,falling,rising)

This component extends from SISO

Usage ​

BlockComponents.SlewRateLimiter(rising, falling=-rising, td)

Parameters: ​

NameDescriptionUnitsDefault value
risingMaximum allowable positive rate of change for the output signals-1
fallingMaximum allowable negative rate of change for the output signals-1-rising
tdTime constant that scales the response speed to input changess

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 ​

dy(t)dt=clamp(u(t)−y(t)td,falling,rising)

Source ​

dyad
"""
Limits the rate of change of a signal between specified rising and falling rates.

A slew rate limiter that constrains how quickly the output signal can change in response
to input variations. It ensures the derivative of the output remains between the specified
maximum rising and falling rates. The output initially equals the input, and thereafter
changes at a rate determined by the difference between input and output, scaled by the time
derivative constant, and limited by the `rising` and `falling` rate parameters.

math \frac{dy}{dt} = \text{clamp}\left(\frac{u-y}{td}, \text{falling}, \text{rising}\right)

"""
component SlewRateLimiter
  extends SISO
  "Maximum allowable positive rate of change for the output signal"
  parameter rising::DecayConstant
  "Maximum allowable negative rate of change for the output signal"
  parameter falling::DecayConstant = -rising
  "Time constant that scales the response speed to input changes"
  parameter td::Time
relations
  initial y = u
  der(y) = clamp((u - y) / td, falling, rising)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/SlewRateLimiter.svg"}
  }
}
end
Flattened Source
dyad
"""
Limits the rate of change of a signal between specified rising and falling rates.

A slew rate limiter that constrains how quickly the output signal can change in response
to input variations. It ensures the derivative of the output remains between the specified
maximum rising and falling rates. The output initially equals the input, and thereafter
changes at a rate determined by the difference between input and output, scaled by the time
derivative constant, and limited by the `rising` and `falling` rate parameters.

math \frac{dy}{dt} = \text{clamp}\left(\frac{u-y}{td}, \text{falling}, \text{rising}\right)

"""
component SlewRateLimiter
  "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 allowable positive rate of change for the output signal"
  parameter rising::DecayConstant
  "Maximum allowable negative rate of change for the output signal"
  parameter falling::DecayConstant = -rising
  "Time constant that scales the response speed to input changes"
  parameter td::Time
relations
  initial y = u
  der(y) = clamp((u - y) / td, falling, rising)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/SlewRateLimiter.svg"}
  }
}
end


Test Cases ​

No test cases defined.