public class SynchronousPID extends PIDBase
Provides a calculate method for the user to call at their desired update rate.
PIDBase.AbsoluteTolerance, PIDBase.NullTolerance, PIDBase.PercentageTolerance, PIDBase.Tolerance
kDefaultPeriod, m_enabled, m_pidInput, m_pidOutput, m_pidWriteMutex, m_setpointTimer, m_thisMutex
Constructor and Description |
---|
SynchronousPID(double Kp,
double Ki,
double Kd,
double Kf,
PIDSource source,
PIDOutput output)
Allocate a PID object with the given constants for P, I, and D.
|
SynchronousPID(double Kp,
double Ki,
double Kd,
PIDSource source,
PIDOutput output)
Allocate a PID object with the given constants for P, I, and D.
|
Modifier and Type | Method and Description |
---|---|
void |
calculate()
Read the input, calculate the output accordingly, and write to the output.
|
void |
free()
Free the PID object.
|
calculateFeedForward, get, getAvgError, getContinuousError, getD, getDeltaSetpoint, getError, getF, getI, getP, getSetpoint, initSendable, onTarget, pidWrite, reset, setAbsoluteTolerance, setContinuous, setContinuous, setD, setF, setI, setInputRange, setOutputRange, setP, setPercentTolerance, setPID, setPID, setSetpoint, setTolerance, setToleranceBuffer
addChild, close, getName, getSubsystem, setName, setName, setName, setSubsystem
public SynchronousPID(double Kp, double Ki, double Kd, PIDSource source, PIDOutput output)
Kp
- the proportional coefficientKi
- the integral coefficientKd
- the derivative coefficientsource
- The PIDSource object that is used to get valuesoutput
- The PIDOutput object that is set to the output percentagepublic SynchronousPID(double Kp, double Ki, double Kd, double Kf, PIDSource source, PIDOutput output)
Kp
- the proportional coefficientKi
- the integral coefficientKd
- the derivative coefficientKf
- the feed forward termsource
- The PIDSource object that is used to get valuesoutput
- The PIDOutput object that is set to the output percentagepublic void free()
free
in class SendableBase