Class MotionMagicConfigs

java.lang.Object
com.ctre.phoenix6.configs.MotionMagicConfigs
All Implemented Interfaces:
ParentConfiguration, ISerializable

public class MotionMagicConfigs
extends Object
implements ParentConfiguration
Configs for Motion Magic®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.

  • Field Details

    • MotionMagicCruiseVelocity

      This is the maximum velocity Motion Magic® based control modes are allowed to use. Motion Magic® Velocity control modes do not use this config. When using Motion Magic® Expo control modes, setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.
      • Minimum Value: 0
      • Maximum Value: 9999
      • Default Value: 0
      • Units: rps
    • MotionMagicAcceleration

      public double MotionMagicAcceleration
      This is the target acceleration Motion Magic® based control modes are allowed to use. Motion Magic® Expo control modes do not use this config.
      • Minimum Value: 0
      • Maximum Value: 9999
      • Default Value: 0
      • Units: rot per sec²
    • MotionMagicJerk

      public double MotionMagicJerk
      This is the target jerk (acceleration derivative) Motion Magic® based control modes are allowed to use. Motion Magic® Expo control modes do not use this config. This allows Motion Magic® support of S-Curves. If this is set to zero, then Motion Magic® will not apply a Jerk limit.
      • Minimum Value: 0
      • Maximum Value: 9999
      • Default Value: 0
      • Units: rot per sec³
    • MotionMagicExpo_kV

      public double MotionMagicExpo_kV
      This is the target kV used only by Motion Magic® Expo control modes, in units of V/rps. This represents the amount of voltage necessary to hold a velocity. In terms of the Motion Magic® Expo profile, a higher kV results in a slower maximum velocity. A kV of 0 will be promoted to a reasonable default of 0.12.
      • Minimum Value: 0.001
      • Maximum Value: 100
      • Default Value: 0
      • Units: V/rps
    • MotionMagicExpo_kA

      public double MotionMagicExpo_kA
      This is the target kA used only by Motion Magic® Expo control modes, in units of V/rps². This represents the amount of voltage necessary to achieve an acceleration. In terms of the Motion Magic® Expo profile, a higher kA results in a slower acceleration. A kA of 0 will be promoted to a reasonable default of 0.1.
      • Minimum Value: 1e-05
      • Maximum Value: 100
      • Default Value: 0
      • Units: V/rps²
  • Constructor Details

  • Method Details

    • withMotionMagicCruiseVelocity

      public MotionMagicConfigs withMotionMagicCruiseVelocity​(double newMotionMagicCruiseVelocity)
      Modifies this configuration's MotionMagicCruiseVelocity parameter and returns itself for method-chaining and easier to use config API.

      This is the maximum velocity Motion Magic® based control modes are allowed to use. Motion Magic® Velocity control modes do not use this config. When using Motion Magic® Expo control modes, setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.

      • Minimum Value: 0
      • Maximum Value: 9999
      • Default Value: 0
      • Units: rps
      Parameters:
      newMotionMagicCruiseVelocity - Parameter to modify
      Returns:
      Itself
    • withMotionMagicAcceleration

      public MotionMagicConfigs withMotionMagicAcceleration​(double newMotionMagicAcceleration)
      Modifies this configuration's MotionMagicAcceleration parameter and returns itself for method-chaining and easier to use config API.

      This is the target acceleration Motion Magic® based control modes are allowed to use. Motion Magic® Expo control modes do not use this config.

      • Minimum Value: 0
      • Maximum Value: 9999
      • Default Value: 0
      • Units: rot per sec²
      Parameters:
      newMotionMagicAcceleration - Parameter to modify
      Returns:
      Itself
    • withMotionMagicJerk

      public MotionMagicConfigs withMotionMagicJerk​(double newMotionMagicJerk)
      Modifies this configuration's MotionMagicJerk parameter and returns itself for method-chaining and easier to use config API.

      This is the target jerk (acceleration derivative) Motion Magic® based control modes are allowed to use. Motion Magic® Expo control modes do not use this config. This allows Motion Magic® support of S-Curves. If this is set to zero, then Motion Magic® will not apply a Jerk limit.

      • Minimum Value: 0
      • Maximum Value: 9999
      • Default Value: 0
      • Units: rot per sec³
      Parameters:
      newMotionMagicJerk - Parameter to modify
      Returns:
      Itself
    • withMotionMagicExpo_kV

      public MotionMagicConfigs withMotionMagicExpo_kV​(double newMotionMagicExpo_kV)
      Modifies this configuration's MotionMagicExpo_kV parameter and returns itself for method-chaining and easier to use config API.

      This is the target kV used only by Motion Magic® Expo control modes, in units of V/rps. This represents the amount of voltage necessary to hold a velocity. In terms of the Motion Magic® Expo profile, a higher kV results in a slower maximum velocity. A kV of 0 will be promoted to a reasonable default of 0.12.

      • Minimum Value: 0.001
      • Maximum Value: 100
      • Default Value: 0
      • Units: V/rps
      Parameters:
      newMotionMagicExpo_kV - Parameter to modify
      Returns:
      Itself
    • withMotionMagicExpo_kA

      public MotionMagicConfigs withMotionMagicExpo_kA​(double newMotionMagicExpo_kA)
      Modifies this configuration's MotionMagicExpo_kA parameter and returns itself for method-chaining and easier to use config API.

      This is the target kA used only by Motion Magic® Expo control modes, in units of V/rps². This represents the amount of voltage necessary to achieve an acceleration. In terms of the Motion Magic® Expo profile, a higher kA results in a slower acceleration. A kA of 0 will be promoted to a reasonable default of 0.1.

      • Minimum Value: 1e-05
      • Maximum Value: 100
      • Default Value: 0
      • Units: V/rps²
      Parameters:
      newMotionMagicExpo_kA - Parameter to modify
      Returns:
      Itself
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • deserialize

      public StatusCode deserialize​(String to_deserialize)
      Specified by:
      deserialize in interface ParentConfiguration
    • serialize

      public String serialize()
      Specified by:
      serialize in interface ISerializable