|
RoboJDETM v2.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ridgesoft.robotics.PIDController
public class PIDController
Implements a Proportional-Integral-Differential (PID) controller.
This class implements a controller that, when passed a target value and the current sample of the controlled variable, calculates an output based on the PID control algorithm and the gain constants specified.
Constructor Summary | |
---|---|
PIDController(float pGain,
float iGain,
float dGain,
float iTermMax,
boolean doErrorPrediction)
Constructs a PID controller |
Method Summary | |
---|---|
float |
control(float target,
float sample)
Calculates the controller output given a target and current sample of the controlled variable. |
void |
setConstants(float pGain,
float iGain,
float dGain,
float iTermMax)
Sets the controller constants. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait |
Constructor Detail |
---|
public PIDController(float pGain, float iGain, float dGain, float iTermMax, boolean doErrorPrediction)
pGain
- proportional gainiGain
- integral gaindGain
- differential gainiTermMax
- cap on the value of the integral termdoErrorPrediction
- true if the controller should predict the integral term when
the target changesMethod Detail |
---|
public float control(float target, float sample)
Invoke this method at a regular interval to calculate updates to the controller output.
control
in interface Controller
target
- target value of the sampled quantitysample
- value of most recent sample
public void setConstants(float pGain, float iGain, float dGain, float iTermMax)
pGain
- proportional gainiGain
- integral gaindGain
- differential gainiTermMax
- cap on the value of the integral term
|
RoboJDETM v2.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |