public class PController extends PIDFController
Constructor and Description |
---|
PController(double p)
Default constructor, only takes a p-value.
|
PController(double p,
double sp,
double pv,
double period)
The extended constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
pControl(Motor affected,
double sp,
double pv)
Implements a p control calculation onto the affected motor.
|
void |
pControl(Motor affected,
double sp,
double pv,
double speed)
Implements a p control calculation onto the affected motor.
|
atSetPoint, calculate, calculate, calculate, getCoefficients, getPeriod, getPositionError, getSetPoint, getTolerance, getVelocityError, reset, setSetPoint, setTolerance, setTolerance
public PController(double p)
p
- The value of kP for the coefficients.public PController(double p, double sp, double pv, double period)
public void pControl(Motor affected, double sp, double pv, double speed)
affected
- The affected motor of the mechanism.sp
- The setpoint of the calculation.pv
- The previous value of the calculation.speed
- The maximum speed the motor should rotate.public void pControl(Motor affected, double sp, double pv)
affected
- The affected motor of the mechanism.sp
- The setpoint of the calculation.pv
- The previous value of the calculation.