Table of Contents

Class MotionMagicConfigs

Namespace
CTRE.Phoenix6.Configs
Assembly
Phoenix6.Hardware.dll

Configs for Motion Magic®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.
public class MotionMagicConfigs : IParentConfiguration, ISerializable, ICloneable
Inheritance
MotionMagicConfigs
Implements
Inherited Members

Fields

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 Value0
  • Maximum Value9999
  • Default Value0
  • Unitsrot per sec²
public double MotionMagicAcceleration

Field Value

double

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 Value0
  • Maximum Value9999
  • Default Value0
  • Unitsrot per sec
public double MotionMagicCruiseVelocity

Field Value

double

MotionMagicExpo_kA

This is the target kA used only by Motion Magic® Expo control modes. Unlike the kA slot gain, this is always 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.
  • Minimum Value1e-05
  • Maximum Value100
  • Default Value0.1
  • UnitsV/rps²
public double MotionMagicExpo_kA

Field Value

double

MotionMagicExpo_kV

This is the target kV used only by Motion Magic® Expo control modes. Unlike the kV slot gain, this is always 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.
  • Minimum Value0.001
  • Maximum Value100
  • Default Value0.12
  • UnitsV/rps
public double MotionMagicExpo_kV

Field Value

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® to generate S-Curve profiles.

Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.
  • Minimum Value0
  • Maximum Value9999
  • Default Value0
  • Unitsrot per sec³
public double MotionMagicJerk

Field Value

double

Methods

Clone()

Creates a copy of this config group.

public MotionMagicConfigs Clone()

Returns

MotionMagicConfigs

Deserialize(string)

Deserialize string and put values into this object

public StatusCode Deserialize(string to_deserialize)

Parameters

to_deserialize string

String to deserialize

Returns

StatusCode

OK if deserialization is OK

Serialize()

Serialize this object into a string

public string Serialize()

Returns

string

This object's data serialized into a string

ToString()

Provides the string representation of this object

public override string ToString()

Returns

string

WithMotionMagicAcceleration(double)

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 Value0
  • Maximum Value9999
  • Default Value0
  • Unitsrot per sec²
public MotionMagicConfigs WithMotionMagicAcceleration(double newMotionMagicAcceleration)

Parameters

newMotionMagicAcceleration double

Parameter to modify

Returns

MotionMagicConfigs

Itself

WithMotionMagicCruiseVelocity(double)

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 Value0
  • Maximum Value9999
  • Default Value0
  • Unitsrot per sec
public MotionMagicConfigs WithMotionMagicCruiseVelocity(double newMotionMagicCruiseVelocity)

Parameters

newMotionMagicCruiseVelocity double

Parameter to modify

Returns

MotionMagicConfigs

Itself

WithMotionMagicExpo_kA(double)

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. Unlike the kA slot gain, this is always 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.
  • Minimum Value1e-05
  • Maximum Value100
  • Default Value0.1
  • UnitsV/rps²
public MotionMagicConfigs WithMotionMagicExpo_kA(double newMotionMagicExpo_kA)

Parameters

newMotionMagicExpo_kA double

Parameter to modify

Returns

MotionMagicConfigs

Itself

WithMotionMagicExpo_kV(double)

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. Unlike the kV slot gain, this is always 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.
  • Minimum Value0.001
  • Maximum Value100
  • Default Value0.12
  • UnitsV/rps
public MotionMagicConfigs WithMotionMagicExpo_kV(double newMotionMagicExpo_kV)

Parameters

newMotionMagicExpo_kV double

Parameter to modify

Returns

MotionMagicConfigs

Itself

WithMotionMagicJerk(double)

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® to generate S-Curve profiles.

Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.
  • Minimum Value0
  • Maximum Value9999
  • Default Value0
  • Unitsrot per sec³
public MotionMagicConfigs WithMotionMagicJerk(double newMotionMagicJerk)

Parameters

newMotionMagicJerk double

Parameter to modify

Returns

MotionMagicConfigs

Itself