ProfiledPIDController

Implements a PID control loop whose setpoint is constrained by a trapezoid profile. Source

Since

3.5.0

Constructors

Link copied to clipboard
constructor(Kp: Double, Ki: Double, Kd: Double, @NonNull constraints: TrapezoidProfile.Constraints)
Allocates a ProfiledPIDController with the given constants for Kp, Ki, and Kd.

Properties

Link copied to clipboard
The underlying PID controller used for ProfiledPID.
Link copied to clipboard
Link copied to clipboard

Inherited properties

Link copied to clipboard
A null controller that does nothing.

Functions

Link copied to clipboard
open fun atGoal(): Boolean
Returns true if the error is within the tolerance of the error.
Link copied to clipboard
open fun atSetpoint(): Boolean
Returns true if the error is within the tolerance of the error.
Link copied to clipboard
open fun calculate(measurement: Double): Double
open fun calculate(measurement: Double, @NonNull newGoal: TrapezoidProfile.State): Double
open fun calculate(measurement: Double, @NonNull newGoal: TrapezoidProfile.State, @NonNull newConstraints: TrapezoidProfile.Constraints): Double
Returns the next output of the PID controller.
open fun calculate(measurement: Double, newGoal: Double): Double
Returns the next output of the PIDController.
Link copied to clipboard
Gets the current coefficients for this controller.
Link copied to clipboard
open fun getD(): Double
Gets the differential coefficient.
Link copied to clipboard
open fun getI(): Double
Gets the integral coefficient.
Link copied to clipboard
open fun getP(): Double
Gets the proportional coefficient.
Link copied to clipboard
open fun getPeriod(): Double
Gets the period of this controller.
Link copied to clipboard
Returns the difference between the setpoint and the measurement.
Link copied to clipboard
Returns the change in error per second.
Link copied to clipboard
Get the PIDF controller associated with this controller, if applicable.
Link copied to clipboard
open fun reset()
Reset the previous error, the integral term, and disable the controller.
open fun reset(measuredPosition: Double): ProfiledPIDController
open fun reset(measuredPosition: Double, measuredVelocity: Double): ProfiledPIDController
Reset the previous error and the integral term.
Link copied to clipboard
open fun setCoefficients(@NonNull coeffs: Array<Double>)
Sets the coefficients for this controller.
Link copied to clipboard
Set velocity and acceleration constraints for goal.
Link copied to clipboard
Sets the differential coefficient of the PID controller gain.
Link copied to clipboard
Sets the goal for the ProfiledPIDController.
Link copied to clipboard
Sets the integral coefficient of the PID controller gain.
Link copied to clipboard
Sets the proportional coefficient of the PID controller gain.
Link copied to clipboard
Sets the PID Controller gain parameters.
Link copied to clipboard
open fun setTolerance(positionTolerance: Double): ProfiledPIDController
open fun setTolerance(positionTolerance: Double, velocityTolerance: Double): ProfiledPIDController
Sets the error which is considered tolerable for use with atSetpoint().

Inherited functions

Link copied to clipboard
Composes this controller with another controller, returning a new controller that is the composition of the two.
Link copied to clipboard
open fun setCoefficients(@NonNull coeffs: Array<Double>)
Sets the coefficients for this controller.