PIDFController

open class PIDFController @JvmOverloads constructor(var kP: Double, var kI: Double, var kD: Double, kF: Feedforward = StaticFeedforward(0.0), var setPointTolerance: Double = 10.0) : Controller

PID controller with various feedforward components.

Author

Originally from Roadrunner 0.5, ported to Kotlin & NextFTC by Zach.Waffle

Inheritors

Constructors

Link copied to clipboard
constructor(kP: Double, kI: Double, kD: Double, kF: Feedforward = StaticFeedforward(0.0), setPointTolerance: Double = 10.0)

Properties

Link copied to clipboard
var kD: Double
Link copied to clipboard
var kI: Double
Link copied to clipboard
var kP: Double
Link copied to clipboard
open override var setPointTolerance: Double

The tolerance for being "at the target"

Link copied to clipboard
open override var target: Double

The target for the reference to converge to.

Functions

Link copied to clipboard
open fun atTarget(pv: Double): Boolean

Whether the controller is within a tolerable distance of the target

Link copied to clipboard
open override fun calculate(pv: Double): Double

Given a reference, calculates how to best match the target.

open fun calculate(pv: Double, target: Double): Double
Link copied to clipboard
Link copied to clipboard
open override fun reset()

Resets the control loop