*
* @author superuser
*
+ * setPoint (in the context of shooter) is the target value we want the
+ * PID controller to adjust the system to, for example, if we want the
+ * shooter wheels to run at 10in/s
+ *
*/
public class Shooter extends PIDSubsystem {
+ // Shooter PID Proportional Constants P, I, and D
private static double sp = 0.015, si = 0, sd = 0;
+
+ // PID Controller tolerance for the error
private static double encoderTolerance = 5.0;
private static double pidOutput = 5.0;
}
public double getSpeed() {
- return encoder.getRate();
+ return encoder.getRate(); // in/sec
}
// Use negative # for decrement. Positive for increment.
return sensorFeedback();
}
+ /*
+ * Method is a required method that the PID Subsystem uses to return the
+ * calculated PID value to the driver
+ *
+ * @param Gives the user the output from the PID algorithm that is calculated
+ * internally
+ */
@Override
protected void usePIDOutput(double output) {
shooter.set(output);
this.enable();
}
+ // Updates the PID constants
public void updatePID() {
this.getPIDController().setPID(sp, si, sd);
}