Class AngleArmFeedforward

java.lang.Object
com.stuypulse.stuylib.control.angle.AngleController
com.stuypulse.stuylib.control.angle.feedforward.AngleArmFeedforward

public class AngleArmFeedforward extends AngleController
A feedforward term to account for gravity for motorized arms that can move continuously (if not use `ArmFeedforward`)

The motor feedforward used in the context of an arm will not account for gravity that is acting on the arm.

Can be paired with MotorFeedforward or other controllers with .add

  • Constructor Details

    • AngleArmFeedforward

      public AngleArmFeedforward(Number kG)
      Create arm feedforward
      Parameters:
      kG - term to hold arm vertical against gravity (volts)
  • Method Details

    • calculate

      protected double calculate(Angle setpoint, Angle measurement)
      Calculates voltage to hold arm at the setpoint angle
      Specified by:
      calculate in class AngleController
      Parameters:
      setpoint - setpoint
      measurement - measurement
      Returns:
      kG * cos(setpoint)