Class TelescopingArmExtensionFeedForward

java.lang.Object
lib.subsystems.motor.TelescopingArmExtensionFeedForward

public class TelescopingArmExtensionFeedForward extends Object
Computes feed-forward values for an elevator motor, which is mounted on a varying angle. Internally composes a wpilib ElevatorFeedForward.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
     
    final double
     
    final double
     
    final double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TelescopingArmExtensionFeedForward(double ks, double vertical_kg, double kv, double ka)
    Computes elevator feed-forward values with a varying cg based on rotation.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    calculate(double posRads, double velMetersPerSec)
     
    double
    maxAchievableAcceleration(double maxVoltage, double posRads, double velocity)
    Calculates the maximum achievable acceleration given a maximum voltage supply and a velocity.
    double
    maxAchievableVelocity(double maxVoltage, double posRads, double acceleration)
    Calculates the maximum achievable velocity given a maximum voltage supply and an acceleration.
    double
    minAchievableAcceleration(double maxVoltage, double posRads, double velocity)
    Calculates the minimum achievable acceleration given a minimum voltage supply and a velocity.
    double
    minAchievableVelocity(double maxVoltage, double posRads, double acceleration)
    Calculates the minimum achievable velocity given a minimum voltage supply and an acceleration.

    Methods inherited from class java.lang.Object

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

    • ks

      public final double ks
    • kg_vertical

      public final double kg_vertical
    • kv

      public final double kv
    • ka

      public final double ka
  • Constructor Details

    • TelescopingArmExtensionFeedForward

      public TelescopingArmExtensionFeedForward(double ks, double vertical_kg, double kv, double ka)
      Computes elevator feed-forward values with a varying cg based on rotation.
      Parameters:
      ks - Static gain: volts needed to overcome static friction
      vertical_kg - Gravity gain: usually found by characterizing the arm as an elevator in the vertical orientation, equals volts needed to hold the arm up against gravity when orinteted vertically (max cg).
      kv - Velocity gain
      ka - Acceleration gain. Zero is usually an okay default.
  • Method Details

    • calculate

      public double calculate(double posRads, double velMetersPerSec)
      Parameters:
      posRads - Position of the arm, in radians from horizontal. 0 = horizontal, PI/2 = vertical.
      velMetersPerSec - Velocity setpoint
    • maxAchievableVelocity

      public double maxAchievableVelocity(double maxVoltage, double posRads, double acceleration)
      Calculates the maximum achievable velocity given a maximum voltage supply and an acceleration. Useful for ensuring that velocity and acceleration constraints for a trapezoidal profile are simultaneously achievable - enter the acceleration constraint, and this will give you a simultaneously-achievable velocity constraint.
    • minAchievableVelocity

      public double minAchievableVelocity(double maxVoltage, double posRads, double acceleration)
      Calculates the minimum achievable velocity given a minimum voltage supply and an acceleration. Useful for ensuring that velocity and acceleration constraints for a trapezoidal profile are simultaneously achievable - enter the acceleration constraint, and this will give you a simultaneously-achievable velocity constraint.
    • maxAchievableAcceleration

      public double maxAchievableAcceleration(double maxVoltage, double posRads, double velocity)
      Calculates the maximum achievable acceleration given a maximum voltage supply and a velocity. Useful for ensuring that velocity and acceleration constraints for a trapezoidal profile are simultaneously achievable - enter the velocity constraint, and this will give you a simultaneously-achievable acceleration constraint.
    • minAchievableAcceleration

      public double minAchievableAcceleration(double maxVoltage, double posRads, double velocity)
      Calculates the minimum achievable acceleration given a minimum voltage supply and a velocity. Useful for ensuring that velocity and acceleration constraints for a trapezoidal profile are simultaneously achievable - enter the velocity constraint, and this will give you a simultaneously-achievable acceleration constraint.