FilteredPIDFController

This is the FilteredPIDFController class. This class handles the running of filtered filtered PIDFs. This behaves very similarly to a regular filtered PIDF controller, but the derivative portion is filtered with a low pass filter to reduce high frequency noise that could affect results.

Author

Anyi Lin - 10158 Scott's Bots

Constructors

Link copied to clipboard
This creates a new filtered PIDFController from a CustomPIDFCoefficients.

Properties

Link copied to clipboard
Link copied to clipboard
public double error
Link copied to clipboard
public double targetPosition

Functions

Link copied to clipboard
public double D()
This returns the derivative (D) coefficient of the filtered PIDF.
Link copied to clipboard
public double F()
This returns the feedforward (F) constant of the filtered PIDF.
Link copied to clipboard
This returns the filtered PIDF's current coefficients.
Link copied to clipboard
public double getError()
This returns the current error of the filtered PIDF.
Link copied to clipboard
public double getTargetPosition()
This returns the target position of the filtered PIDF.
Link copied to clipboard
public double I()
This returns the integral (I) coefficient of the filtered PIDF.
Link copied to clipboard
public double P()
This returns the proportional (P) coefficient of the filtered PIDF.
Link copied to clipboard
public void reset()
This resets all the filtered PIDF's error and position values, as well as the time stamps.
Link copied to clipboard
public double runPIDF()
This takes the current error and runs the filtered PIDF on it.
Link copied to clipboard
This is used to set the coefficients of the filtered PIDF.
Link copied to clipboard
public void setD(double set)
This sets the derivative (D) coefficient of the filtered PIDF only.
Link copied to clipboard
public void setF(double set)
This sets the feedforward (F) constant of the filtered PIDF only.
Link copied to clipboard
public void setI(double set)
This sets the integral (I) coefficient of the filtered PIDF only.
Link copied to clipboard
public void setP(double set)
This sets the proportional (P) coefficient of the filtered PIDF only.
Link copied to clipboard
public void setT(double set)
This sets the time constant (T) of the filtered PIDF only.
Link copied to clipboard
public void setTargetPosition(double set)
This is used to set the target position if the filtered PIDF is being run with current position and target position inputs rather than error inputs.
Link copied to clipboard
public double T()
This returns the time constant (T) of the filtered PIDF.
Link copied to clipboard
public void updateError(double error)
As opposed to updating position against a target position, this just sets the error to some specified value.
Link copied to clipboard
public void updateFeedForwardInput(double input)
This can be used to update the feedforward equation's input, if applicable.
Link copied to clipboard
public void updatePosition(double update)
This can be used to update the filtered PIDF's current position when inputting a current position and a target position to calculate error.