Rate Limiter
Moves the output toward the input while limiting its per-second rising and falling rates.
Behavior
Section titled “Behavior”With prev = ic at n = 0 and prev = y(n-1) afterward, y(n) = limit(u(n), prev + dt*falling_rate, prev + dt*rising_rate).
| Direction | Name | Type |
|---|---|---|
| Input | u |
T |
| Output | y |
T |
Parameters
Section titled “Parameters”| Name | Type | Default | Meaning |
|---|---|---|---|
T |
type (default f64) |
f64 |
Float scalar or float array type |
rising_rate |
T |
1.0 |
Maximum rise per second |
falling_rate |
T |
-1.0 |
Maximum fall per second |
ic |
T |
ZERO |
First output and starting state |
T may be a float scalar or float array; limiting is element-wise for arrays. Use a positive rising rate and negative falling rate.
Example
Section titled “Example”With dt = 0.1, ic = 0, rising_rate = 2, falling_rate = -1, and inputs 1, 1, -1, outputs are 0.2, 0.4, 0.3.