Class FeedforwardConfig

java.lang.Object
frc.robot.shared.config.AbstractConfig
frc.robot.shared.config.FeedforwardConfig

public class FeedforwardConfig extends AbstractConfig
Configuration bundle for feedforward gains used by motor control subsystems.

Holds the gains that the subsystem consumes directly (kS, kV, kA, kG). Since SysIdHelper pre-multiplies position and velocity by 2pi before logging, the SysId analysis tool reports gains in per-radian units that can be entered here directly without correction.

  • Field Details

    • kS

      public double kS
      Static feedforward gain in volts.
    • kV

      public double kV
      Velocity feedforward gain in volts per radian per second.
    • kA

      public double kA
      Acceleration feedforward gain in volts per radian per second squared.
    • kG

      public double kG
      Gravity feedforward gain in volts.

      This is the voltage needed to hold an arm-type mechanism stationary against gravity when horizontal. Set to 0 for non-arm mechanisms (flywheels, belts, turrets). WPILib's ArmFeedforward multiplies kG by the cosine of the angle from horizontal.

  • Constructor Details

    • FeedforwardConfig

      public FeedforwardConfig()
  • Method Details

    • getkS

      public double getkS()
      Returns the static feedforward gain, tuned via SmartDashboard.
      Returns:
      kS in volts
    • getkV

      public double getkV()
      Returns the velocity feedforward gain, tuned via SmartDashboard.
      Returns:
      kV in volts per radian per second
    • getkA

      public double getkA()
      Returns the acceleration feedforward gain, tuned via SmartDashboard.
      Returns:
      kA in volts per radian per second squared
    • getkG

      public double getkG()
      Returns the gravity feedforward gain, tuned via SmartDashboard.
      Returns:
      kG in volts (voltage to hold the mechanism horizontal against gravity)