Class JRADController


  • public class JRADController
    extends java.lang.Object
    A flywheel velocity controller designed by team 254, adapted and ported for use by team 5024.

    To tune the controller, start with kLoadRatio at 1.0, kJ at a small non-zero number, and kF at 0.0 (this is used to get to the setpoint faster)
    • If voltage dips between balls decrease, increase kJ.
    • Voltage can be compensated up set kLoadRatio to (setpoint - lowestRPM)
    • Constructor Summary

      Constructors 
      Constructor Description
      JRADController​(double kJ, double kF, double kLoadRatio)
      Create a JRAD controller.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double calculate​(double voltage)
      Calculate a system output voltage
      void setSetpoint​(double voltageSetpoint)
      Set a voltage setpoint for the controller
      • Methods inherited from class java.lang.Object

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

      • JRADController

        public JRADController​(double kJ,
                              double kF,
                              double kLoadRatio)
        Create a JRAD controller.
        Parameters:
        kJ - Compensation factor for sequential balls (should be a small non-zero number)
        kF - Multiplier to get to setpoint faster (Can probably be 0.0)
        kLoadRatio - A load ratio multiplier. This should be larger than 1.0
    • Method Detail

      • setSetpoint

        public void setSetpoint​(double voltageSetpoint)
        Set a voltage setpoint for the controller
        Parameters:
        voltageSetpoint - Voltage controller setpoint
      • calculate

        public double calculate​(double voltage)
        Calculate a system output voltage
        Parameters:
        voltage - Current system voltage
        Returns:
        System output (in volts)