gov.sandia.cognition.math.signals
Class PIDController

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.evaluator.AbstractStatefulEvaluator<Double,Double,PIDController.State>
          extended by gov.sandia.cognition.math.signals.PIDController
All Implemented Interfaces:
Evaluator<Double,Double>, StatefulEvaluator<Double,Double,PIDController.State>, CloneableSerializable, Serializable, Cloneable

@PublicationReferences(references={@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<Double,Double,PIDController.State>

This class defines a Proportional-plus-Integral-plus-Derivative set-point controller. The goal of this PID controller is to minimize the difference between its target-value input and a given input by changing a control variable to implicitly change its given input at the next time step.

Since:
3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Nested Class Summary
static class PIDController.State
          State of a PIDController
 
Field Summary
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 Summary
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.
 
Method Summary
 PIDController.State createDefaultState()
          Creates a new default state object.
 Double evaluate(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
 
Methods inherited from class gov.sandia.cognition.evaluator.AbstractStatefulEvaluator
clone, evaluate, getState, resetState, setState
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PROPORTIONAL_GAIN

public static final double DEFAULT_PROPORTIONAL_GAIN
Default proportional-error gain, 0.5.

See Also:
Constant Field Values

DEFAULT_INTEGRAL_GAIN

public static final double DEFAULT_INTEGRAL_GAIN
Default integral-error gain, 0.0.

See Also:
Constant Field Values

DEFAULT_DERIVATIVE_GAIN

public static final double DEFAULT_DERIVATIVE_GAIN
Default derivative-error gain, 0.25.

See Also:
Constant Field Values
Constructor Detail

PIDController

public PIDController()
Creates a new instance of PIDController


PIDController

public PIDController(double proportionalGain,
                     double integralGain,
                     double derivativeGain)
Creates a new instance of PIDController.

Parameters:
proportionalGain - Proportional-error gain.
integralGain - Integral-error gain.
derivativeGain - Derivative-error gain.

PIDController

public PIDController(double proportionalGain,
                     double integralGain,
                     double derivativeGain,
                     double targetInput)
Creates a new instance of PIDController.

Parameters:
proportionalGain - Proportional-error gain.
integralGain - Integral-error gain.
derivativeGain - Derivative-error gain.
targetInput - Set point target to achieve at steady-state.
Method Detail

getTargetInput

public double getTargetInput()
Getter for targetInput.

Returns:
Set point target to achieve at steady-state.

setTargetInput

public void setTargetInput(double targetInput)
Setter for targetInput

Parameters:
targetInput - Set point target to achieve at steady-state.

getProportionalGain

public double getProportionalGain()
Getter for proportionalGain

Returns:
Proportional-error gain.

setProportionalGain

public void setProportionalGain(double proportionalGain)
Setter for proportionalGain

Parameters:
proportionalGain - Proportional-error gain.

getIntegralGain

public double getIntegralGain()
Getter for integralGain.

Returns:
Integral-error gain.

setIntegralGain

public void setIntegralGain(double integralGain)
Setter for integralGain

Parameters:
integralGain - Integral-error gain.

getDerivativeGain

public double getDerivativeGain()
Getter for derivativeGain

Returns:
Derivative-error gain.

setDerivativeGain

public void setDerivativeGain(double derivativeGain)
Setter for derivativeGain

Parameters:
derivativeGain - Derivative-error gain.

evaluate

public Double evaluate(Double input)
Description copied from interface: StatefulEvaluator
Evaluates the object using the given input and current state objects, returning the output. The current state may be modified by side effect.

Parameters:
input - The input to evaluate.
Returns:
output that results from the evaluation, state is modified by side effect

createDefaultState

public PIDController.State createDefaultState()
Description copied from interface: StatefulEvaluator
Creates a new default state object.

Returns:
A new default state object.