public class PIDController extends Object
| Constructor and Description |
|---|
PIDController(String callerPath)
Allocate a PI object with the given constants for P, I
|
| Modifier and Type | Method and Description |
|---|---|
double |
getCoefD()
Get the Derivative coefficient
|
double |
getCoefI()
Get the Integral coefficient
|
double |
getCoefP()
Get the Proportional coefficient
|
double |
getError()
Returns the current difference of the input from the setpoint
|
double |
getInput()
Returns the current smoothed input
|
double |
getIntegral()
Returns the current error integral
|
double |
getSetpoint()
Returns the current setpoint of the PIDController
|
double |
getTimeConst()
Get the Integral coefficient
|
double |
performPID(double[] input,
double time)
Return the current PI result.
|
void |
reset()
Reset the previous error, the integral, and disable the controller.
|
void |
setBaseOutput(double value)
Sets the base output.
|
void |
setCoefD(double value)
Set the Derivative coefficient
|
void |
setCoefI(double value)
Set the Integral coefficient
|
void |
setCoefP(double value)
Set the Proportional coefficient
|
void |
setInputRange(double minimumInput,
double maximumInput)
Sets the maximum and minimum values expected from the input.
|
void |
setIntegral(double value)
Sets the error integral
|
void |
setOutputRange(double minimumOutput,
double maximumOutput)
Sets the minimum and maximum values to write.
|
void |
setSetpoint(double setpnt)
Set the setpoint for the PIDController
|
void |
setSmoothTime(double time)
Sets the smoothing time.
|
void |
setTimeConst(double time)
Set the time constant characterizing the integration
|
public PIDController(String callerPath)
public double performPID(double[] input,
double time)
input - The array of input valuestime - The measurement timepublic void setTimeConst(double time)
time - Integral coefficient (integration time constant)public void setSmoothTime(double time)
time - the smoothing timepublic void setCoefP(double value)
value - proportional coefficientpublic void setCoefI(double value)
value - integral coefficientpublic void setCoefD(double value)
value - derivative coefficientpublic double getCoefP()
public double getCoefI()
public double getCoefD()
public double getTimeConst()
public void setBaseOutput(double value)
value - the base output valuepublic void setInputRange(double minimumInput,
double maximumInput)
minimumInput - the minimum value expected from the inputmaximumInput - the maximum value expected from the outputpublic void setOutputRange(double minimumOutput,
double maximumOutput)
minimumOutput - the minimum value to write to the outputmaximumOutput - the maximum value to write to the outputpublic void setSetpoint(double setpnt)
setpnt - the desired setpointpublic double getSetpoint()
public double getError()
public double getIntegral()
public void setIntegral(double value)
value - the error integral value to setpublic double getInput()
public void reset()
Copyright © 2022 LSST. All rights reserved.