@PublicationReference(author="Control Tutorial for MATLAB",title="PID Tutorial",type=WebPage,year=1997,url="http://www.engin.umich.edu/group/ctm/PID/PID.html") @PublicationReference(author="Wikipedia",title="PID Controller",type=WebPage,year=2009,url="http://en.wikipedia.org/wiki/PID_controller",notes="This article pretty much sucks") public class PIDController extends AbstractStatefulEvaluator<java.lang.Double,java.lang.Double,PIDController.State>
Modifier and Type | Class and Description |
---|---|
static class |
PIDController.State
State of a PIDController
|
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_DERIVATIVE_GAIN
Default derivative-error gain, 0.25.
|
static double |
DEFAULT_INTEGRAL_GAIN
Default integral-error gain, 0.0.
|
static double |
DEFAULT_PROPORTIONAL_GAIN
Default proportional-error gain, 0.5.
|
Constructor and Description |
---|
PIDController()
Creates a new instance of PIDController
|
PIDController(double proportionalGain,
double integralGain,
double derivativeGain)
Creates a new instance of PIDController.
|
PIDController(double proportionalGain,
double integralGain,
double derivativeGain,
double targetInput)
Creates a new instance of PIDController.
|
Modifier and Type | Method and Description |
---|---|
PIDController.State |
createDefaultState()
Creates a new default state object.
|
java.lang.Double |
evaluate(java.lang.Double input)
Evaluates the object using the given input and current state objects,
returning the output.
|
double |
getDerivativeGain()
Getter for derivativeGain
|
double |
getIntegralGain()
Getter for integralGain.
|
double |
getProportionalGain()
Getter for proportionalGain
|
double |
getTargetInput()
Getter for targetInput.
|
void |
setDerivativeGain(double derivativeGain)
Setter for derivativeGain
|
void |
setIntegralGain(double integralGain)
Setter for integralGain
|
void |
setProportionalGain(double proportionalGain)
Setter for proportionalGain
|
void |
setTargetInput(double targetInput)
Setter for targetInput
|
clone, evaluate, getState, resetState, setState
public static final double DEFAULT_PROPORTIONAL_GAIN
public static final double DEFAULT_INTEGRAL_GAIN
public static final double DEFAULT_DERIVATIVE_GAIN
public PIDController()
public PIDController(double proportionalGain, double integralGain, double derivativeGain)
proportionalGain
- Proportional-error gain.integralGain
- Integral-error gain.derivativeGain
- Derivative-error gain.public PIDController(double proportionalGain, double integralGain, double derivativeGain, double targetInput)
proportionalGain
- Proportional-error gain.integralGain
- Integral-error gain.derivativeGain
- Derivative-error gain.targetInput
- Set point target to achieve at steady-state.public double getTargetInput()
public void setTargetInput(double targetInput)
targetInput
- Set point target to achieve at steady-state.public double getProportionalGain()
public void setProportionalGain(double proportionalGain)
proportionalGain
- Proportional-error gain.public double getIntegralGain()
public void setIntegralGain(double integralGain)
integralGain
- Integral-error gain.public double getDerivativeGain()
public void setDerivativeGain(double derivativeGain)
derivativeGain
- Derivative-error gain.public java.lang.Double evaluate(java.lang.Double input)
StatefulEvaluator
input
- The input to evaluate.public PIDController.State createDefaultState()
StatefulEvaluator