blockRamp
Information
Block that limits the rate of change of the input u by a ramp
if the boolean input active is true,
otherwise the block outputs y = u.
This block computes a threshold for the rate of change between
input u and output y as
thr = (u-y)/Td, where Td > 0 is a parameter.
The output y is computed as follows:
-
If
thr < fallingSlewRate, thendy/dt = fallingSlewRate, -
if
thr > raisingSlewRate, thendy/dt = raisingSlewRate, -
otherwise,
dy/dt = thr.
A smaller time constant Td > 0 means a higher accuracy for the derivative approximation.
Note that the block limits the rate of change of the input u in the same
way as
Buildings.Controls.OBC.CDL.Reals.LimitSlewRate. However, the
Buildings.Controls.OBC.CDL.Reals.LimitSlewRate
has a boolean parameter to flag if the rate of change should be limited, while this
block has the boolean input activate to enable or disable the functionality.
When the input activate switches to false,
the output y can have a discontinuity.
Implementation
For the block to work with arbitrary inputs and in order to produce a differentiable output,
the input is numerically differentiated with derivative time constant Td.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real | raisingSlewRate | Maximum speed with which to increase the output | |
| Real | fallingSlewRate | -raisingSlewRate | Maximum speed with which to decrease the output |
| Real | Td | raisingSlewRate*0.001 | Derivative time constant |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.Controls.OBC.CDL.Interfaces.RealInput | u | Input that is being rate limited | |
| Buildings.Controls.OBC.CDL.Interfaces.BooleanInput | active | Set to true to enable rate limiter | |
| Buildings.Controls.OBC.CDL.Interfaces.RealOutput | y | Rate limited output if active is true, else output is equal to input |
Revisions
-
September 15, 2025, by Jianjun Hu:
Updated documentation to clarify the difference with the block Buildings.Controls.OBC.CDL.Reals.LimitSlewRate. -
February 15, 2024, by Michael Wetter:
Updated documentation. -
November 16, 2022, by Jianjun Hu:
First implementation.