Class TalonFXConfiguration
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
ClosedLoopGeneral
Configs that affect general behavior during closed-looping.
Includes Continuous Wrap features. Parameter list:public ClosedLoopGeneralConfigs ClosedLoopGeneral
Field Value
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
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
CustomParams
Custom Params.
Custom paramaters that have no real impact on controller. Parameter list:public CustomParamsConfigs CustomParams
Field Value
DifferentialConstants
Configs related to constants used for differential control of a mechanism.
Includes the differential peak outputs. Parameter list:public DifferentialConstantsConfigs DifferentialConstants
Field Value
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
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
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
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
MotionMagic
Configs for Motion MagicĀ®.
Includes Velocity, Acceleration, Jerk, and Expo parameters. Parameter list:public MotionMagicConfigs MotionMagic
Field Value
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
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
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
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
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
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
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
Voltage
Configs that affect Voltage control types.
Includes peak output voltages and other configs affecting voltage measurements. Parameter list:public VoltageConfigs Voltage
Field Value
Methods
Clone()
Creates a copy of this configuration.
public TalonFXConfiguration Clone()
Returns
Deserialize(string)
Take a string and deserialize it to this configuration
public StatusCode Deserialize(string to_deserialize)
Parameters
to_deserializestring
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
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
newAudioAudioConfigsParameter 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
newClosedLoopGeneralClosedLoopGeneralConfigsParameter 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
newClosedLoopRampsClosedLoopRampsConfigsParameter 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
newCurrentLimitsCurrentLimitsConfigsParameter 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
newCustomParamsCustomParamsConfigsParameter 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
newDifferentialConstantsDifferentialConstantsConfigsParameter 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
newDifferentialSensorsDifferentialSensorsConfigsParameter 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
newFeedbackFeedbackConfigsParameter 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
newHardwareLimitSwitchHardwareLimitSwitchConfigsParameter 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
newMotionMagicMotionMagicConfigsParameter 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
newMotorOutputMotorOutputConfigsParameter 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
newOpenLoopRampsOpenLoopRampsConfigsParameter 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
newSlot0Slot0ConfigsParameter 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
newSlot1Slot1ConfigsParameter 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
newSlot2Slot2ConfigsParameter 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
newSoftwareLimitSwitchSoftwareLimitSwitchConfigsParameter 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
newTorqueCurrentTorqueCurrentConfigsParameter 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
newVoltageVoltageConfigsParameter to modify
Returns
- TalonFXConfiguration
Itself