Table of Contents

Class TalonFXConfiguration

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

Class description for the Talon FX integrated motor controller.

This defines all configurations for the TalonFX.
public class TalonFXConfiguration : IParentConfiguration, ISerializable, ICloneable
Inheritance
TalonFXConfiguration
Implements
Inherited Members

Fields

Audio

Configs that affect audible components of the device.

Includes configuration for the beep on boot.

Parameter list:
public AudioConfigs Audio

Field Value

AudioConfigs

ClosedLoopGeneral

Configs that affect general behavior during closed-looping.

Includes Continuous Wrap features.

Parameter list:
public ClosedLoopGeneralConfigs ClosedLoopGeneral

Field Value

ClosedLoopGeneralConfigs

ClosedLoopRamps

Configs that affect the closed-loop control of this motor controller.

Closed-loop ramp rates for the various control types.

Parameter list:
public ClosedLoopRampsConfigs ClosedLoopRamps

Field Value

ClosedLoopRampsConfigs

CurrentLimits

Configs that directly affect current limiting features.

Contains the supply/stator current limit thresholds and whether to enable them.

Parameter list:
public CurrentLimitsConfigs CurrentLimits

Field Value

CurrentLimitsConfigs

CustomParams

Custom Params.

Custom paramaters that have no real impact on controller.

Parameter list:
public CustomParamsConfigs CustomParams

Field Value

CustomParamsConfigs

DifferentialConstants

Configs related to constants used for differential control of a mechanism.

Includes the differential peak outputs.

Parameter list:
public DifferentialConstantsConfigs DifferentialConstants

Field Value

DifferentialConstantsConfigs

DifferentialSensors

Configs related to sensors used for differential control of a mechanism.

Includes the differential sensor sources and IDs.

Parameter list:
public DifferentialSensorsConfigs DifferentialSensors

Field Value

DifferentialSensorsConfigs

Feedback

Configs that affect the feedback of this motor controller.

Includes feedback sensor source, any offsets for the feedback sensor, and various ratios to describe the relationship between the sensor and the mechanism for closed looping.

Parameter list:
public FeedbackConfigs Feedback

Field Value

FeedbackConfigs

FutureProofConfigs

True if we should factory default newer unsupported configs, false to leave newer unsupported configs alone.

This flag addresses a corner case where the device may have firmware with newer configs that didn't exist when this version of the API was built. If this occurs and this flag is true, unsupported new configs will be factory defaulted to avoid unexpected behavior.

This is also the behavior in Phoenix 5, so this flag is defaulted to true to match.
public bool FutureProofConfigs

Field Value

bool

HardwareLimitSwitch

Configs that change how the motor controller behaves under different limit switch states.

Includes configs such as enabling limit switches, configuring the remote sensor ID, the source, and the position to set on limit.

Parameter list:
public HardwareLimitSwitchConfigs HardwareLimitSwitch

Field Value

HardwareLimitSwitchConfigs

MotionMagic

Configs for Motion MagicĀ®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.

Parameter list:
public MotionMagicConfigs MotionMagic

Field Value

MotionMagicConfigs

MotorOutput

Configs that directly affect motor output.

Includes motor invert, neutral mode, and other features related to motor output.

Parameter list:
public MotorOutputConfigs MotorOutput

Field Value

MotorOutputConfigs

OpenLoopRamps

Configs that affect the open-loop control of this motor controller.

Open-loop ramp rates for the various control types.

Parameter list:
public OpenLoopRampsConfigs OpenLoopRamps

Field Value

OpenLoopRampsConfigs

Slot0

Gains for the specified slot.

If this slot is selected, these gains are used in closed loop control requests.

Parameter list:
public Slot0Configs Slot0

Field Value

Slot0Configs

Slot1

Gains for the specified slot.

If this slot is selected, these gains are used in closed loop control requests.

Parameter list:
public Slot1Configs Slot1

Field Value

Slot1Configs

Slot2

Gains for the specified slot.

If this slot is selected, these gains are used in closed loop control requests.

Parameter list:
public Slot2Configs Slot2

Field Value

Slot2Configs

SoftwareLimitSwitch

Configs that affect how software-limit switches behave.

Includes enabling software-limit switches and the threshold at which they are tripped.

Parameter list:
public SoftwareLimitSwitchConfigs SoftwareLimitSwitch

Field Value

SoftwareLimitSwitchConfigs

TorqueCurrent

Configs that affect Torque Current control types.

Includes the maximum and minimum applied torque output and the neutral deadband used during TorqueCurrentFOC requests.

Parameter list:
public TorqueCurrentConfigs TorqueCurrent

Field Value

TorqueCurrentConfigs

Voltage

Configs that affect Voltage control types.

Includes peak output voltages and other configs affecting voltage measurements.

Parameter list:
public VoltageConfigs Voltage

Field Value

VoltageConfigs

Methods

Clone()

Creates a copy of this configuration.

public TalonFXConfiguration Clone()

Returns

TalonFXConfiguration

Deserialize(string)

Take a string and deserialize it to this configuration

public StatusCode Deserialize(string to_deserialize)

Parameters

to_deserialize string

Returns

StatusCode

Return code of the deserialize method

Serialize()

Get the serialized form of this configuration

public string Serialize()

Returns

string

Serialized form of this config group

ToString()

Provides the string representation of this object

public override string ToString()

Returns

string

WithAudio(AudioConfigs)

Modifies this configuration's Audio parameter and returns itself for method-chaining and easier to use config API.

Configs that affect audible components of the device.

Includes configuration for the beep on boot.

Parameter list:
public TalonFXConfiguration WithAudio(AudioConfigs newAudio)

Parameters

newAudio AudioConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithClosedLoopGeneral(ClosedLoopGeneralConfigs)

Modifies this configuration's ClosedLoopGeneral parameter and returns itself for method-chaining and easier to use config API.

Configs that affect general behavior during closed-looping.

Includes Continuous Wrap features.

Parameter list:
public TalonFXConfiguration WithClosedLoopGeneral(ClosedLoopGeneralConfigs newClosedLoopGeneral)

Parameters

newClosedLoopGeneral ClosedLoopGeneralConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithClosedLoopRamps(ClosedLoopRampsConfigs)

Modifies this configuration's ClosedLoopRamps parameter and returns itself for method-chaining and easier to use config API.

Configs that affect the closed-loop control of this motor controller.

Closed-loop ramp rates for the various control types.

Parameter list:
public TalonFXConfiguration WithClosedLoopRamps(ClosedLoopRampsConfigs newClosedLoopRamps)

Parameters

newClosedLoopRamps ClosedLoopRampsConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithCurrentLimits(CurrentLimitsConfigs)

Modifies this configuration's CurrentLimits parameter and returns itself for method-chaining and easier to use config API.

Configs that directly affect current limiting features.

Contains the supply/stator current limit thresholds and whether to enable them.

Parameter list:
public TalonFXConfiguration WithCurrentLimits(CurrentLimitsConfigs newCurrentLimits)

Parameters

newCurrentLimits CurrentLimitsConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithCustomParams(CustomParamsConfigs)

Modifies this configuration's CustomParams parameter and returns itself for method-chaining and easier to use config API.

Custom Params.

Custom paramaters that have no real impact on controller.

Parameter list:
public TalonFXConfiguration WithCustomParams(CustomParamsConfigs newCustomParams)

Parameters

newCustomParams CustomParamsConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithDifferentialConstants(DifferentialConstantsConfigs)

Modifies this configuration's DifferentialConstants parameter and returns itself for method-chaining and easier to use config API.

Configs related to constants used for differential control of a mechanism.

Includes the differential peak outputs.

Parameter list:
public TalonFXConfiguration WithDifferentialConstants(DifferentialConstantsConfigs newDifferentialConstants)

Parameters

newDifferentialConstants DifferentialConstantsConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithDifferentialSensors(DifferentialSensorsConfigs)

Modifies this configuration's DifferentialSensors parameter and returns itself for method-chaining and easier to use config API.

Configs related to sensors used for differential control of a mechanism.

Includes the differential sensor sources and IDs.

Parameter list:
public TalonFXConfiguration WithDifferentialSensors(DifferentialSensorsConfigs newDifferentialSensors)

Parameters

newDifferentialSensors DifferentialSensorsConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithFeedback(FeedbackConfigs)

Modifies this configuration's Feedback parameter and returns itself for method-chaining and easier to use config API.

Configs that affect the feedback of this motor controller.

Includes feedback sensor source, any offsets for the feedback sensor, and various ratios to describe the relationship between the sensor and the mechanism for closed looping.

Parameter list:
public TalonFXConfiguration WithFeedback(FeedbackConfigs newFeedback)

Parameters

newFeedback FeedbackConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithHardwareLimitSwitch(HardwareLimitSwitchConfigs)

Modifies this configuration's HardwareLimitSwitch parameter and returns itself for method-chaining and easier to use config API.

Configs that change how the motor controller behaves under different limit switch states.

Includes configs such as enabling limit switches, configuring the remote sensor ID, the source, and the position to set on limit.

Parameter list:
public TalonFXConfiguration WithHardwareLimitSwitch(HardwareLimitSwitchConfigs newHardwareLimitSwitch)

Parameters

newHardwareLimitSwitch HardwareLimitSwitchConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithMotionMagic(MotionMagicConfigs)

Modifies this configuration's MotionMagic parameter and returns itself for method-chaining and easier to use config API.

Configs for Motion MagicĀ®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.

Parameter list:
public TalonFXConfiguration WithMotionMagic(MotionMagicConfigs newMotionMagic)

Parameters

newMotionMagic MotionMagicConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithMotorOutput(MotorOutputConfigs)

Modifies this configuration's MotorOutput parameter and returns itself for method-chaining and easier to use config API.

Configs that directly affect motor output.

Includes motor invert, neutral mode, and other features related to motor output.

Parameter list:
public TalonFXConfiguration WithMotorOutput(MotorOutputConfigs newMotorOutput)

Parameters

newMotorOutput MotorOutputConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithOpenLoopRamps(OpenLoopRampsConfigs)

Modifies this configuration's OpenLoopRamps parameter and returns itself for method-chaining and easier to use config API.

Configs that affect the open-loop control of this motor controller.

Open-loop ramp rates for the various control types.

Parameter list:
public TalonFXConfiguration WithOpenLoopRamps(OpenLoopRampsConfigs newOpenLoopRamps)

Parameters

newOpenLoopRamps OpenLoopRampsConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithSlot0(Slot0Configs)

Modifies this configuration's Slot0 parameter and returns itself for method-chaining and easier to use config API.

Gains for the specified slot.

If this slot is selected, these gains are used in closed loop control requests.

Parameter list:
public TalonFXConfiguration WithSlot0(Slot0Configs newSlot0)

Parameters

newSlot0 Slot0Configs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithSlot1(Slot1Configs)

Modifies this configuration's Slot1 parameter and returns itself for method-chaining and easier to use config API.

Gains for the specified slot.

If this slot is selected, these gains are used in closed loop control requests.

Parameter list:
public TalonFXConfiguration WithSlot1(Slot1Configs newSlot1)

Parameters

newSlot1 Slot1Configs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithSlot2(Slot2Configs)

Modifies this configuration's Slot2 parameter and returns itself for method-chaining and easier to use config API.

Gains for the specified slot.

If this slot is selected, these gains are used in closed loop control requests.

Parameter list:
public TalonFXConfiguration WithSlot2(Slot2Configs newSlot2)

Parameters

newSlot2 Slot2Configs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithSoftwareLimitSwitch(SoftwareLimitSwitchConfigs)

Modifies this configuration's SoftwareLimitSwitch parameter and returns itself for method-chaining and easier to use config API.

Configs that affect how software-limit switches behave.

Includes enabling software-limit switches and the threshold at which they are tripped.

Parameter list:
public TalonFXConfiguration WithSoftwareLimitSwitch(SoftwareLimitSwitchConfigs newSoftwareLimitSwitch)

Parameters

newSoftwareLimitSwitch SoftwareLimitSwitchConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithTorqueCurrent(TorqueCurrentConfigs)

Modifies this configuration's TorqueCurrent parameter and returns itself for method-chaining and easier to use config API.

Configs that affect Torque Current control types.

Includes the maximum and minimum applied torque output and the neutral deadband used during TorqueCurrentFOC requests.

Parameter list:
public TalonFXConfiguration WithTorqueCurrent(TorqueCurrentConfigs newTorqueCurrent)

Parameters

newTorqueCurrent TorqueCurrentConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself

WithVoltage(VoltageConfigs)

Modifies this configuration's Voltage parameter and returns itself for method-chaining and easier to use config API.

Configs that affect Voltage control types.

Includes peak output voltages and other configs affecting voltage measurements.

Parameter list:
public TalonFXConfiguration WithVoltage(VoltageConfigs newVoltage)

Parameters

newVoltage VoltageConfigs

Parameter to modify

Returns

TalonFXConfiguration

Itself