SqrtController

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

This is a Square Root Controller, which is a proportional controller that uses the square root of the error instead of just the error.

Parameters

pid

PID coefficients

kF

custom feedforward that depends on position

Constructors

Link copied to clipboard
constructor(kP: Double = 0.0, kI: Double = 0.0, kD: Double = 0.0, 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 override fun calculate(pv: Double, target: Double): Double
Link copied to clipboard
Link copied to clipboard
open override fun reset()

Resets the control loop