java.lang.Object
org.firstinspires.ftc.teamcode.fy23.processors.TunablePID

public class TunablePID extends Object
A simple PID algorithm that allows its constants to be changed on the fly. Useful for tuning them in a TeleOp to instantly see the results of changes. It can also import a PIDConsts. Implementation based on this pseudocode from GM0. Positive error = positive correction.
  • Constructor Details

    • TunablePID

      public TunablePID(double kP, double kI, double maxI, double kD, com.qualcomm.robotcore.util.ElapsedTime stopwatch)
    • TunablePID

      public TunablePID(double kP, double kI, double maxI, double kD)
    • TunablePID

      public TunablePID(PIDConsts pidConsts, com.qualcomm.robotcore.util.ElapsedTime stopwatch)
    • TunablePID

      public TunablePID(PIDConsts pidConsts)
  • Method Details

    • clearIntegral

      public void clearIntegral()
    • correctFor

      public double correctFor(double error)
    • correctFor

      public int correctFor(int error)
    • kP

      public double kP()
    • setkP

      public void setkP(double kP)
    • kI

      public double kI()
    • setkI

      public void setkI(double kI)
    • maxI

      public double maxI()
    • setmaxI

      public void setmaxI(double maxI)
    • kD

      public double kD()
    • setkD

      public void setkD(double kD)
    • currentIntegralValue

      public double currentIntegralValue()