PID and Advanced Control Systems - Decatur-Robotics/Common-Library-And-Wiki GitHub Wiki
PID
It’s the special magic sauce of Mustard. It’s like Grey Poupon. Goes nice with ketchup.
To start, create PIDController object and variables to store the P, I, and D (either do testing and/or run SysID to get the values):
private static final double kP = 1.32;
private static final double kI = 0;
private static final double kD = .0185;
PIDController pid = new PIDController(kP, kI, kD);
Then, to calculate a power based on the PID, do (it returns the power/output):
pid.calculate(current, target);