SlewRateLimiter
class SlewRateLimiter @JvmOverloads constructor(var positiveRateLimit: Double, var negativeRateLimit: Double, initialValue: Double = 0.0)(source)
A class that limits the rate of change of an input value. Useful for implementing voltage, setpoint, and/or output ramps. A slew-rate limit is most appropriate when the quantity being controlled is a velocity or a voltage.
Parameters
positiveRateLimit
The rate-of-change limit in the positive direction, in units per second. This is expected to be positive.
negativeRateLimit
The rate-of-change limit in the negative direction, in units per second. This is expected to be negative.
initialValue
The initial value of the input.
Constructors
Functions
Link copied to clipboard
fun calculate(input: Double, timestamp: ComparableTimeMark = TimeSource.Monotonic.markNow()): Double
Filters the input to limit its slew rate.
Link copied to clipboard
Resets the slew rate limiter to the specified value; ignores the rate limit when doing so.