Package ca.team3161.lib.robot.pid
Class PIDulum<V extends PIDAngleValueSrc<?>>
- java.lang.Object
- 
- ca.team3161.lib.robot.pid.AbstractPID<V,java.lang.Float>
- 
- ca.team3161.lib.robot.pid.PIDulum<V>
 
 
- 
- Type Parameters:
- V- the specific source type which provides angle measurements for this PIDulum.
 - All Implemented Interfaces:
- PID<V,java.lang.Float>,- ComposedComponent<PIDSrc<V,java.lang.Float>>
 
 public final class PIDulum<V extends PIDAngleValueSrc<?>> extends AbstractPID<V,java.lang.Float> implements ComposedComponent<PIDSrc<V,java.lang.Float>> A PID controller for inverted pendulum systems (PID pendulum... getPIDValue it?)
- 
- 
Field Summary- 
Fields inherited from class ca.team3161.lib.robot.pid.AbstractPIDdeadband, deadbandPeriod, deadbandUnit, deltaError, integralError, kD, kI, kP, lastTimeNotAtTarget, prevError, source
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<PIDSrc<V,java.lang.Float>>getComposedComponents()Get the composed components within this one.java.lang.Floatpid(java.lang.Float target)Iterate the PID loop.
 
- 
- 
- 
Constructor Detail- 
PIDulumpublic PIDulum(PIDSrc<V,java.lang.Float> source, float deadband, int deadbandPeriod, java.util.concurrent.TimeUnit deadbandUnit, float kP, float kI, float kD, float offsetAngle, float torqueConstant) - Parameters:
- source- the PIDSrc source sensor
- deadband- filter value - do not act when current error is within this bound
- deadbandPeriod- the amount of time to remain within acceptable error of the target value before claiming to actually be at the target
- deadbandUnit- the units for deadbandPeriod
- kP- P constant
- kI- I constant
- kD- D constant
- offsetAngle- the balance point of the inverted pendulum
- torqueConstant- "feed forward" term constant to allow the pendulum to hold position against gravity
 
 
- 
 - 
Method Detail- 
pidpublic java.lang.Float pid(java.lang.Float target) Iterate the PID loop.- Specified by:
- pidin interface- PID<V extends PIDAngleValueSrc<?>,java.lang.Float>
- Specified by:
- pidin class- AbstractPID<V extends PIDAngleValueSrc<?>,java.lang.Float>
- Parameters:
- target- the desired target value. Units depend on the context of this PID
- Returns:
- the output value to set to eg a SpeedController to reach the specified target
 
 - 
getComposedComponentspublic java.util.Collection<PIDSrc<V,java.lang.Float>> getComposedComponents() Get the composed components within this one.- Specified by:
- getComposedComponentsin interface- ComposedComponent<V extends PIDAngleValueSrc<?>>
- Returns:
- the composed components.
 
 
- 
 
-