Class PIDGains


  • public class PIDGains
    extends java.lang.Object
    PIDGains allows for easily storing PID values in an object that can be pulled out and used against PID controllers. There are a slew of constructors but the values given are final; they cannot be changed.
    See Also:
    CTRE Closed Loop Tutorial, Chief Delphi 'Tuning a PID Loop'
    • Constructor Summary

      Constructors 
      Constructor Description
      PIDGains​(double p, double i, double d)
      PIDGains constructor with only the P, I, and D values provided
      PIDGains​(double p, double i, double d, double feedForward, double izone, double peakOutput)
      PIDGains constructor with all values but a mirrored peak value.
      PIDGains​(double p, double i, double d, double feedForward, double izone, double peakMinOutput, double peakMaxOutput)
      PIDGains constructor with all values potentially defined, including non-symmetrical values for the peak minimum and maximum values.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_PEAK_OUTPUT

        public static final double DEFAULT_PEAK_OUTPUT
        By default, let motors spin up to full speed. This should be adjusted using peak output parameters
        See Also:
        Constant Field Values
      • kP

        public double kP
      • kI

        public double kI
      • kD

        public double kD
      • kFF

        public double kFF
      • kIzone

        public double kIzone
      • kPeakMinOutput

        public double kPeakMinOutput
      • kPeakMaxOutput

        public double kPeakMaxOutput
    • Constructor Detail

      • PIDGains

        public PIDGains​(double p,
                        double i,
                        double d)
        PIDGains constructor with only the P, I, and D values provided
        Parameters:
        p - proportional control value
        i - integral control value
        d - derivative control value
      • PIDGains

        public PIDGains​(double p,
                        double i,
                        double d,
                        double feedForward,
                        double izone,
                        double peakOutput)
        PIDGains constructor with all values but a mirrored peak value. Pass a number 'x' and the peak outputs will be [-x, x]
        Parameters:
        p - proportional control value
        i - integral control value
        d - derivative control value
        feedForward - the feed forward that should be applied by default. This is added to the end result
        izone - the integral zone that allows for larger error tolerances
        peakOutput - a max value for the motors that will also be negated for the min peak output
      • PIDGains

        public PIDGains​(double p,
                        double i,
                        double d,
                        double feedForward,
                        double izone,
                        double peakMinOutput,
                        double peakMaxOutput)
        PIDGains constructor with all values potentially defined, including non-symmetrical values for the peak minimum and maximum values.
        Parameters:
        p - proportional control value
        i - integral control value
        d - derivative control value
        feedForward - the feed forward that should be applied by default. This is added to the end result
        izone - the integral zone that allows for larger error tolerances
        peakMinOutput - the minimum peak output allowed
        peakMaxOutput - the maximum peak output allowed