Enum Class StaticFeedforwardSignValue

java.lang.Object
java.lang.Enum<StaticFeedforwardSignValue>
com.ctre.phoenix6.signals.StaticFeedforwardSignValue
All Implemented Interfaces:
Serializable, Comparable<StaticFeedforwardSignValue>, Constable

public enum StaticFeedforwardSignValue extends Enum<StaticFeedforwardSignValue>
Static feedforward sign during position closed loop.

This determines the sign of the applied kS during position closed-loop modes. The default behavior uses the velocity reference sign. This works well with velocity closed loop, Motion MagicĀ® controls, and position closed loop when velocity reference is specified (motion profiling).

However, when using position closed loop with zero velocity reference (no motion profiling), the application may want to apply static feedforward based on the sign of closed loop error instead. When doing so, we recommend using the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

  • Enum Constant Details

    • UseVelocitySign

      public static final StaticFeedforwardSignValue UseVelocitySign
      Use the velocity reference sign. This works well with velocity closed loop, Motion MagicĀ® controls, and position closed loop when velocity reference is specified (motion profiling).
    • UseClosedLoopSign

      public static final StaticFeedforwardSignValue UseClosedLoopSign
      Use the sign of closed loop error. This is useful when using position closed loop with zero velocity reference (no motion profiling). We recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
  • Field Details

    • value

      public final int value
      Unique integer value of this StaticFeedforwardSignValue.
  • Method Details

    • values

      public static StaticFeedforwardSignValue[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static StaticFeedforwardSignValue valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • valueOf

      public static StaticFeedforwardSignValue valueOf(int value)
      Gets StaticFeedforwardSignValue from specified value
      Parameters:
      value - Value of StaticFeedforwardSignValue
      Returns:
      StaticFeedforwardSignValue of specified value