Class PID.Zone

  • Enclosing interface:
    PID

    public static class PID.Zone
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Zone​(double min, double max, double output, double range)
      Creates a PID Zone where PID control is disabled, with a manual output value used instead.
      Zone​(double min, double max, double P, double I, double D, double range)
      Creates a PID Zone where PID control is enabled with specified PID values.
      Zone​(org.json.JSONObject data)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getD()
      Returns the D value this zone is configured to use.
      double getI()
      Returns the I value this zone is configured to use.
      double getLimit()
      Returns the limit on the output to use for this zone.
      double getMax()
      Returns the maximum set-point value that this zone should be used for.
      double getMin()
      Returns the minimum set-point value that this zone should be used for.
      double getOutput()
      Returns the manual output value to be used for this zone, should PID control be disabled.
      double getP()
      Returns the P value this zone is configured to use.
      boolean isAuto()
      Returns whether PID control is to be use for this zone or not.
      boolean matches​(double value)
      Returns whether this zone should be used for a given set-point value.
      org.json.JSONObject toJSON()
      Converts this object into JSON representation.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Zone

        public Zone​(org.json.JSONObject data)
      • Zone

        public Zone​(double min,
                    double max,
                    double P,
                    double I,
                    double D,
                    double range)
        Creates a PID Zone where PID control is enabled with specified PID values.
        Parameters:
        min - Min set-point value
        max - Max set-point value
        P - P value
        I - I Value
        D - D value
        range - Output range
      • Zone

        public Zone​(double min,
                    double max,
                    double output,
                    double range)
        Creates a PID Zone where PID control is disabled, with a manual output value used instead.
        Parameters:
        min - Min set-point value
        max - Max set-point value
        output - Manual output value
        range - Output range
    • Method Detail

      • getMin

        public double getMin()
        Returns the minimum set-point value that this zone should be used for.
        Returns:
        Min set-point value
      • getMax

        public double getMax()
        Returns the maximum set-point value that this zone should be used for.
        Returns:
        Max set-point value
      • getP

        public double getP()
        Returns the P value this zone is configured to use.
        Returns:
        P value
      • getI

        public double getI()
        Returns the I value this zone is configured to use.
        Returns:
        I value
      • getD

        public double getD()
        Returns the D value this zone is configured to use.
        Returns:
        D value
      • getLimit

        public double getLimit()
        Returns the limit on the output to use for this zone.
        Returns:
        Output limit/range
      • isAuto

        public boolean isAuto()
        Returns whether PID control is to be use for this zone or not.
        Returns:
        Should PID control be enabled?
      • getOutput

        public double getOutput()
        Returns the manual output value to be used for this zone, should PID control be disabled.
        Returns:
        Manual output value
      • matches

        public boolean matches​(double value)
        Returns whether this zone should be used for a given set-point value.
        Parameters:
        value - Set-point value
        Returns:
        Should it be used?
      • toJSON

        public org.json.JSONObject toJSON()
        Converts this object into JSON representation.
        Returns:
        JSON representation of this object