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.
This component extends from SISO
Usage ​
BlockComponents.SlewRateLimiter(rising, falling=-rising, td)
Parameters: ​
| Name | Description | Units | Default value |
|---|---|---|---|
rising | Maximum allowable positive rate of change for the output signal | s-1 | |
falling | Maximum allowable negative rate of change for the output signal | s-1 | -rising |
td | Time constant that scales the response speed to input changes | s |
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 ​
Source ​
"""
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"}
}
}
endFlattened Source
"""
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"}
}
}
endTest Cases ​
No test cases defined.
Related ​
Examples
Experiments
Analyses
Tests