update

fun update(error: Double, dt: Double): Double

Updates the controller with an error value and time delta.

Return

Control output clamped to outputMin, outputMax

Parameters

error

The error (target - current)

dt

Time delta in seconds


fun update(target: Double, current: Double, dt: Double, normalizeRadians: Boolean = false): Double

Updates the controller with target and current values.

Return

Control output including feedforward

Parameters

target

The desired setpoint

current

The current measured value

dt

Time delta in seconds

normalizeRadians

Normalize angular error to -π, π


fun update(target: Double, current: Double, normalizeRadians: Boolean = false): Double

Auto-timestamped update using system time.