PIDFController

public class PIDFController

This is the PIDFController class. This class handles the running of PIDFs. PIDF stands for proportional, integral, derivative, and feedforward. PIDFs take the error of a system as an input. Coefficients multiply into the error, the integral of the error, the derivative of the error, and a feedforward value. Then, these values are added up and returned. In this way, error in the system is corrected.

Author

Anyi Lin - 10158 Scott's Bots

Aaron Yang - 10158 Scott's Bots

Harrison Womack - 10158 Scott's Bots

Constructors

Link copied to clipboard
This creates a new 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 PIDF.
Link copied to clipboard
public double F()
This returns the feedforward (F) constant of the PIDF.
Link copied to clipboard
This returns the PIDF's current coefficients.
Link copied to clipboard
public double getError()
This returns the current error of the PIDF.
Link copied to clipboard
public double getTargetPosition()
This returns the target position of the PIDF.
Link copied to clipboard
public double I()
This returns the integral (I) coefficient of the PIDF.
Link copied to clipboard
public double P()
This returns the proportional (P) coefficient of the PIDF.
Link copied to clipboard
public void reset()
This resets all the 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 PIDF on it.
Link copied to clipboard
This is used to set the coefficients of the PIDF.
Link copied to clipboard
public void setD(double set)
This sets the derivative (D) coefficient of the PIDF only.
Link copied to clipboard
public void setF(double set)
This sets the feedforward (F) constant of the PIDF only.
Link copied to clipboard
public void setI(double set)
This sets the integral (I) coefficient of the PIDF only.
Link copied to clipboard
public void setP(double set)
This sets the proportional (P) coefficient of the PIDF only.
Link copied to clipboard
public void setTargetPosition(double set)
This is used to set the target position if the PIDF is being run with current position and target position inputs rather than error inputs.
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 PIDF's current position when inputting a current position and a target position to calculate error.