phoenix6.configs#

Submodules#

Package Contents#

class phoenix6.configs.MagnetSensorConfigs#

Configs that affect the magnet sensor and how to interpret it.

Includes sensor range, sensor direction, and the magnet offset.

sensor_direction: SensorDirectionValue#

Direction of the sensor to determine positive rotation, as seen facing the LED side of the CANcoder.

magnet_offset: float = 0#

This offset is added to the reported position, allowing the application to trim the zero position. When set to the default value of zero, position reports zero when magnet north pole aligns with the LED.

  • Minimum Value: -1

  • Maximum Value: 1

  • Default Value: 0

  • Units: rotations

absolute_sensor_range: AbsoluteSensorRangeValue#

The range of the absolute sensor in rotations, either [-0.5, 0.5) or [0, 1).

with_sensor_direction(new_sensor_direction: SensorDirectionValue) MagnetSensorConfigs#

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

Direction of the sensor to determine positive rotation, as seen facing the LED side of the CANcoder.

Parameters:

new_sensor_direction (SensorDirectionValue) – Parameter to modify

Returns:

Itself

Return type:

MagnetSensorConfigs

with_magnet_offset(new_magnet_offset: float) MagnetSensorConfigs#

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

This offset is added to the reported position, allowing the application to trim the zero position. When set to the default value of zero, position reports zero when magnet north pole aligns with the LED.

  • Minimum Value: -1

  • Maximum Value: 1

  • Default Value: 0

  • Units: rotations

Parameters:

new_magnet_offset (float) – Parameter to modify

Returns:

Itself

Return type:

MagnetSensorConfigs

with_absolute_sensor_range(new_absolute_sensor_range: AbsoluteSensorRangeValue) MagnetSensorConfigs#

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

The range of the absolute sensor in rotations, either [-0.5, 0.5) or [0, 1).

Parameters:

new_absolute_sensor_range (AbsoluteSensorRangeValue) – Parameter to modify

Returns:

Itself

Return type:

MagnetSensorConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.MountPoseConfigs#

Configs for Pigeon 2’s Mount Pose configuration.

These configs allow the Pigeon2 to be mounted in whatever orientation that’s desired and ensure the reported Yaw/Pitch/Roll is from the robot’s reference.

mount_pose_yaw: float = 0#

The mounting calibration yaw-component

  • Minimum Value: -360

  • Maximum Value: 360

  • Default Value: 0

  • Units: deg

mount_pose_pitch: float = 0#

The mounting calibration pitch-component

  • Minimum Value: -360

  • Maximum Value: 360

  • Default Value: 0

  • Units: deg

mount_pose_roll: float = 0#

The mounting calibration roll-component

  • Minimum Value: -360

  • Maximum Value: 360

  • Default Value: 0

  • Units: deg

with_mount_pose_yaw(new_mount_pose_yaw: float) MountPoseConfigs#

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

The mounting calibration yaw-component

  • Minimum Value: -360

  • Maximum Value: 360

  • Default Value: 0

  • Units: deg

Parameters:

new_mount_pose_yaw (float) – Parameter to modify

Returns:

Itself

Return type:

MountPoseConfigs

with_mount_pose_pitch(new_mount_pose_pitch: float) MountPoseConfigs#

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

The mounting calibration pitch-component

  • Minimum Value: -360

  • Maximum Value: 360

  • Default Value: 0

  • Units: deg

Parameters:

new_mount_pose_pitch (float) – Parameter to modify

Returns:

Itself

Return type:

MountPoseConfigs

with_mount_pose_roll(new_mount_pose_roll: float) MountPoseConfigs#

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

The mounting calibration roll-component

  • Minimum Value: -360

  • Maximum Value: 360

  • Default Value: 0

  • Units: deg

Parameters:

new_mount_pose_roll (float) – Parameter to modify

Returns:

Itself

Return type:

MountPoseConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.GyroTrimConfigs#

Configs to trim the Pigeon2’s gyroscope.

Pigeon2 allows the user to trim the gyroscope’s sensitivity. While this isn’t necessary for the Pigeon2, as it comes calibrated out-of-the-box, users can make use of this to make the Pigeon2 even more accurate for their application.

gyro_scalar_x: float = 0#

The gyro scalar component for the X axis

  • Minimum Value: -180

  • Maximum Value: 180

  • Default Value: 0

  • Units: deg per rotation

gyro_scalar_y: float = 0#

The gyro scalar component for the Y axis

  • Minimum Value: -180

  • Maximum Value: 180

  • Default Value: 0

  • Units: deg per rotation

gyro_scalar_z: float = 0#

The gyro scalar component for the Z axis

  • Minimum Value: -180

  • Maximum Value: 180

  • Default Value: 0

  • Units: deg per rotation

with_gyro_scalar_x(new_gyro_scalar_x: float) GyroTrimConfigs#

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

The gyro scalar component for the X axis

  • Minimum Value: -180

  • Maximum Value: 180

  • Default Value: 0

  • Units: deg per rotation

Parameters:

new_gyro_scalar_x (float) – Parameter to modify

Returns:

Itself

Return type:

GyroTrimConfigs

with_gyro_scalar_y(new_gyro_scalar_y: float) GyroTrimConfigs#

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

The gyro scalar component for the Y axis

  • Minimum Value: -180

  • Maximum Value: 180

  • Default Value: 0

  • Units: deg per rotation

Parameters:

new_gyro_scalar_y (float) – Parameter to modify

Returns:

Itself

Return type:

GyroTrimConfigs

with_gyro_scalar_z(new_gyro_scalar_z: float) GyroTrimConfigs#

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

The gyro scalar component for the Z axis

  • Minimum Value: -180

  • Maximum Value: 180

  • Default Value: 0

  • Units: deg per rotation

Parameters:

new_gyro_scalar_z (float) – Parameter to modify

Returns:

Itself

Return type:

GyroTrimConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.Pigeon2FeaturesConfigs#

Configs to enable/disable various features of the Pigeon2.

These configs allow the user to enable or disable various aspects of the Pigeon2.

enable_compass: bool = False#

Turns on or off the magnetometer fusing for 9-axis. FRC users are not recommended to turn this on, as the magnetic influence of the robot will likely negatively affect the performance of the Pigeon2.

  • Default Value: False

disable_temperature_compensation: bool = False#

Disables using the temperature compensation feature

  • Default Value: False

disable_no_motion_calibration: bool = False#

Disables using the no-motion calibration feature

  • Default Value: False

with_enable_compass(new_enable_compass: bool) Pigeon2FeaturesConfigs#

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

Turns on or off the magnetometer fusing for 9-axis. FRC users are not recommended to turn this on, as the magnetic influence of the robot will likely negatively affect the performance of the Pigeon2.

  • Default Value: False

Parameters:

new_enable_compass (bool) – Parameter to modify

Returns:

Itself

Return type:

Pigeon2FeaturesConfigs

with_disable_temperature_compensation(new_disable_temperature_compensation: bool) Pigeon2FeaturesConfigs#

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

Disables using the temperature compensation feature

  • Default Value: False

Parameters:

new_disable_temperature_compensation (bool) – Parameter to modify

Returns:

Itself

Return type:

Pigeon2FeaturesConfigs

with_disable_no_motion_calibration(new_disable_no_motion_calibration: bool) Pigeon2FeaturesConfigs#

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

Disables using the no-motion calibration feature

  • Default Value: False

Parameters:

new_disable_no_motion_calibration (bool) – Parameter to modify

Returns:

Itself

Return type:

Pigeon2FeaturesConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.MotorOutputConfigs#

Configs that directly affect motor output.

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

inverted: InvertedValue#

Invert state of the device.

neutral_mode: NeutralModeValue#

The state of the motor controller bridge when output is neutral or disabled.

duty_cycle_neutral_deadband: float = 0#

Configures the output deadband duty cycle during duty cycle and voltage based control modes.

  • Minimum Value: 0.0

  • Maximum Value: 0.25

  • Default Value: 0

  • Units: fractional

peak_forward_duty_cycle: float = 1#

Maximum (forward) output during duty cycle based control modes.

  • Minimum Value: -1.0

  • Maximum Value: 1.0

  • Default Value: 1

  • Units: fractional

peak_reverse_duty_cycle: float#

Minimum (reverse) output during duty cycle based control modes.

  • Minimum Value: -1.0

  • Maximum Value: 1.0

  • Default Value: -1

  • Units: fractional

with_inverted(new_inverted: InvertedValue) MotorOutputConfigs#

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

Invert state of the device.

Parameters:

new_inverted (InvertedValue) – Parameter to modify

Returns:

Itself

Return type:

MotorOutputConfigs

with_neutral_mode(new_neutral_mode: NeutralModeValue) MotorOutputConfigs#

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

The state of the motor controller bridge when output is neutral or disabled.

Parameters:

new_neutral_mode (NeutralModeValue) – Parameter to modify

Returns:

Itself

Return type:

MotorOutputConfigs

with_duty_cycle_neutral_deadband(new_duty_cycle_neutral_deadband: float) MotorOutputConfigs#

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

Configures the output deadband duty cycle during duty cycle and voltage based control modes.

  • Minimum Value: 0.0

  • Maximum Value: 0.25

  • Default Value: 0

  • Units: fractional

Parameters:

new_duty_cycle_neutral_deadband (float) – Parameter to modify

Returns:

Itself

Return type:

MotorOutputConfigs

with_peak_forward_duty_cycle(new_peak_forward_duty_cycle: float) MotorOutputConfigs#

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

Maximum (forward) output during duty cycle based control modes.

  • Minimum Value: -1.0

  • Maximum Value: 1.0

  • Default Value: 1

  • Units: fractional

Parameters:

new_peak_forward_duty_cycle (float) – Parameter to modify

Returns:

Itself

Return type:

MotorOutputConfigs

with_peak_reverse_duty_cycle(new_peak_reverse_duty_cycle: float) MotorOutputConfigs#

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

Minimum (reverse) output during duty cycle based control modes.

  • Minimum Value: -1.0

  • Maximum Value: 1.0

  • Default Value: -1

  • Units: fractional

Parameters:

new_peak_reverse_duty_cycle (float) – Parameter to modify

Returns:

Itself

Return type:

MotorOutputConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.CurrentLimitsConfigs#

Configs that directly affect current limiting features.

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

stator_current_limit: float = 0#

The amount of current allowed in the motor (motoring and regen current). Note this requires StatorCurrentLimitEnable to be true.

This is only applicable for non-torque current control modes. For torque current control, set the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs instead.

Stator current is directly proportional to torque, so this limit can be used to restrict the torque output of the motor, such as preventing wheel slip for a drivetrain. Additionally, stator current limits can prevent brownouts during acceleration; supply current will never exceed the stator current limit and is often significantly lower than stator current.

A reasonable starting point for a stator current limit is 120 A, with values commonly ranging from 80-160 A. Mechanisms with a hard stop may need a smaller limit to reduce the torque applied when running into the hard stop.

  • Minimum Value: 0.0

  • Maximum Value: 800.0

  • Default Value: 0

  • Units: A

stator_current_limit_enable: bool = False#

Enable motor stator current limiting.

  • Default Value: False

supply_current_limit: float = 0#

The amount of supply current allowed. Note this requires SupplyCurrentLimitEnable to be true. Use SupplyCurrentThreshold and SupplyTimeThreshold to allow brief periods of high-current before limiting occurs.

This is only applicable for non-torque current control modes. For torque current control, set the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs instead.

Supply current is the current drawn from the battery, so this limit can be used to prevent breaker trips and improve battery longevity. Additionally, in the rare case where the robot experiences brownouts despite configuring stator current limits, a supply current limit can further help avoid brownouts. However, such brownouts are most commonly caused by a bad battery or poor power wiring.

A reasonable starting point for a supply current limit is 60 A with a threshold of 80 A for 0.1 seconds. Supply current limits commonly range from 20-80 A depending on the breaker used.

  • Minimum Value: 0.0

  • Maximum Value: 800.0

  • Default Value: 0

  • Units: A

supply_current_limit_enable: bool = False#

Enable motor supply current limiting.

  • Default Value: False

supply_current_threshold: float = 0#

Delay supply current limiting until current exceeds this threshold for longer than SupplyTimeThreshold. This allows current draws above SupplyCurrentLimit for a fixed period of time. This has no effect if SupplyCurrentLimit is greater than this value.

  • Minimum Value: 0.0

  • Maximum Value: 511

  • Default Value: 0

  • Units: A

supply_time_threshold: float = 0#

Allows unlimited current for a period of time before current limiting occurs. Current threshold is the maximum of SupplyCurrentThreshold and SupplyCurrentLimit.

  • Minimum Value: 0.0

  • Maximum Value: 1.275

  • Default Value: 0

  • Units: sec

with_stator_current_limit(new_stator_current_limit: float) CurrentLimitsConfigs#

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

The amount of current allowed in the motor (motoring and regen current). Note this requires StatorCurrentLimitEnable to be true.

This is only applicable for non-torque current control modes. For torque current control, set the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs instead.

Stator current is directly proportional to torque, so this limit can be used to restrict the torque output of the motor, such as preventing wheel slip for a drivetrain. Additionally, stator current limits can prevent brownouts during acceleration; supply current will never exceed the stator current limit and is often significantly lower than stator current.

A reasonable starting point for a stator current limit is 120 A, with values commonly ranging from 80-160 A. Mechanisms with a hard stop may need a smaller limit to reduce the torque applied when running into the hard stop.

  • Minimum Value: 0.0

  • Maximum Value: 800.0

  • Default Value: 0

  • Units: A

Parameters:

new_stator_current_limit (float) – Parameter to modify

Returns:

Itself

Return type:

CurrentLimitsConfigs

with_stator_current_limit_enable(new_stator_current_limit_enable: bool) CurrentLimitsConfigs#

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

Enable motor stator current limiting.

  • Default Value: False

Parameters:

new_stator_current_limit_enable (bool) – Parameter to modify

Returns:

Itself

Return type:

CurrentLimitsConfigs

with_supply_current_limit(new_supply_current_limit: float) CurrentLimitsConfigs#

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

The amount of supply current allowed. Note this requires SupplyCurrentLimitEnable to be true. Use SupplyCurrentThreshold and SupplyTimeThreshold to allow brief periods of high-current before limiting occurs.

This is only applicable for non-torque current control modes. For torque current control, set the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs instead.

Supply current is the current drawn from the battery, so this limit can be used to prevent breaker trips and improve battery longevity. Additionally, in the rare case where the robot experiences brownouts despite configuring stator current limits, a supply current limit can further help avoid brownouts. However, such brownouts are most commonly caused by a bad battery or poor power wiring.

A reasonable starting point for a supply current limit is 60 A with a threshold of 80 A for 0.1 seconds. Supply current limits commonly range from 20-80 A depending on the breaker used.

  • Minimum Value: 0.0

  • Maximum Value: 800.0

  • Default Value: 0

  • Units: A

Parameters:

new_supply_current_limit (float) – Parameter to modify

Returns:

Itself

Return type:

CurrentLimitsConfigs

with_supply_current_limit_enable(new_supply_current_limit_enable: bool) CurrentLimitsConfigs#

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

Enable motor supply current limiting.

  • Default Value: False

Parameters:

new_supply_current_limit_enable (bool) – Parameter to modify

Returns:

Itself

Return type:

CurrentLimitsConfigs

with_supply_current_threshold(new_supply_current_threshold: float) CurrentLimitsConfigs#

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

Delay supply current limiting until current exceeds this threshold for longer than SupplyTimeThreshold. This allows current draws above SupplyCurrentLimit for a fixed period of time. This has no effect if SupplyCurrentLimit is greater than this value.

  • Minimum Value: 0.0

  • Maximum Value: 511

  • Default Value: 0

  • Units: A

Parameters:

new_supply_current_threshold (float) – Parameter to modify

Returns:

Itself

Return type:

CurrentLimitsConfigs

with_supply_time_threshold(new_supply_time_threshold: float) CurrentLimitsConfigs#

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

Allows unlimited current for a period of time before current limiting occurs. Current threshold is the maximum of SupplyCurrentThreshold and SupplyCurrentLimit.

  • Minimum Value: 0.0

  • Maximum Value: 1.275

  • Default Value: 0

  • Units: sec

Parameters:

new_supply_time_threshold (float) – Parameter to modify

Returns:

Itself

Return type:

CurrentLimitsConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.VoltageConfigs#

Configs that affect Voltage control types.

Includes peak output voltages and other configs affecting voltage measurements.

supply_voltage_time_constant: float = 0#

The time constant (in seconds) of the low-pass filter for the supply voltage.

This impacts the filtering for the reported supply voltage, and any control strategies that use the supply voltage (such as voltage control on a motor controller).

  • Minimum Value: 0.0

  • Maximum Value: 0.1

  • Default Value: 0

  • Units: sec

peak_forward_voltage: float = 16#

Maximum (forward) output during voltage based control modes.

  • Minimum Value: -16

  • Maximum Value: 16

  • Default Value: 16

  • Units: V

peak_reverse_voltage: float#

Minimum (reverse) output during voltage based control modes.

  • Minimum Value: -16

  • Maximum Value: 16

  • Default Value: -16

  • Units: V

with_supply_voltage_time_constant(new_supply_voltage_time_constant: float) VoltageConfigs#

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

The time constant (in seconds) of the low-pass filter for the supply voltage.

This impacts the filtering for the reported supply voltage, and any control strategies that use the supply voltage (such as voltage control on a motor controller).

  • Minimum Value: 0.0

  • Maximum Value: 0.1

  • Default Value: 0

  • Units: sec

Parameters:

new_supply_voltage_time_constant (float) – Parameter to modify

Returns:

Itself

Return type:

VoltageConfigs

with_peak_forward_voltage(new_peak_forward_voltage: float) VoltageConfigs#

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

Maximum (forward) output during voltage based control modes.

  • Minimum Value: -16

  • Maximum Value: 16

  • Default Value: 16

  • Units: V

Parameters:

new_peak_forward_voltage (float) – Parameter to modify

Returns:

Itself

Return type:

VoltageConfigs

with_peak_reverse_voltage(new_peak_reverse_voltage: float) VoltageConfigs#

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

Minimum (reverse) output during voltage based control modes.

  • Minimum Value: -16

  • Maximum Value: 16

  • Default Value: -16

  • Units: V

Parameters:

new_peak_reverse_voltage (float) – Parameter to modify

Returns:

Itself

Return type:

VoltageConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.TorqueCurrentConfigs#

Configs that affect Torque Current control types.

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

peak_forward_torque_current: float = 800#

Maximum (forward) output during torque current based control modes.

  • Minimum Value: -800

  • Maximum Value: 800

  • Default Value: 800

  • Units: A

peak_reverse_torque_current: float#

Minimum (reverse) output during torque current based control modes.

  • Minimum Value: -800

  • Maximum Value: 800

  • Default Value: -800

  • Units: A

torque_neutral_deadband: float = 0.0#

Configures the output deadband during torque current based control modes.

  • Minimum Value: 0

  • Maximum Value: 25

  • Default Value: 0.0

  • Units: A

with_peak_forward_torque_current(new_peak_forward_torque_current: float) TorqueCurrentConfigs#

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

Maximum (forward) output during torque current based control modes.

  • Minimum Value: -800

  • Maximum Value: 800

  • Default Value: 800

  • Units: A

Parameters:

new_peak_forward_torque_current (float) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentConfigs

with_peak_reverse_torque_current(new_peak_reverse_torque_current: float) TorqueCurrentConfigs#

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

Minimum (reverse) output during torque current based control modes.

  • Minimum Value: -800

  • Maximum Value: 800

  • Default Value: -800

  • Units: A

Parameters:

new_peak_reverse_torque_current (float) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentConfigs

with_torque_neutral_deadband(new_torque_neutral_deadband: float) TorqueCurrentConfigs#

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

Configures the output deadband during torque current based control modes.

  • Minimum Value: 0

  • Maximum Value: 25

  • Default Value: 0.0

  • Units: A

Parameters:

new_torque_neutral_deadband (float) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.FeedbackConfigs#

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.

feedback_rotor_offset: float = 0.0#

This offset is applied to the absolute integrated rotor sensor. This can be used to zero the rotor in applications that are within one rotor rotation.

  • Minimum Value: -1

  • Maximum Value: 1

  • Default Value: 0.0

  • Units: rotations

sensor_to_mechanism_ratio: float = 1.0#

This is the ratio of sensor rotations to the mechanism’s output. This is equivalent to the mechanism’s gear ratio if the sensor is located on the input of a gearbox. If sensor is on the output of a gearbox, then this is typically set to 1. Note if this is set to zero, device will reset back to one.

  • Minimum Value: -1000

  • Maximum Value: 1000

  • Default Value: 1.0

  • Units: scalar

rotor_to_sensor_ratio: float = 1.0#

Talon FX is capable of fusing a remote CANcoder with its rotor sensor to produce a high-bandwidth sensor source. This feature requires specifying the ratio between the remote sensor and the motor rotor. Note if this is set to zero, device will reset back to one.

  • Minimum Value: -1000

  • Maximum Value: 1000

  • Default Value: 1.0

  • Units: scalar

feedback_sensor_source: FeedbackSensorSourceValue#

Choose what sensor source is reported via API and used by closed-loop and limit features. The default is RotorSensor, which uses the internal rotor sensor in the Talon FX.

Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon FX will update its position and velocity whenever CANcoder publishes its information on CAN bus.

Choose FusedCANcoder (requires Phoenix Pro) and Talon FX will fuse another CANcoder’s information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID). FusedCANcoder was developed for applications such as swerve-azimuth.

Choose SyncCANcoder (requires Phoenix Pro) and Talon FX will synchronize its internal rotor position against another CANcoder, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID). The TalonFX will report if its internal position differs significantly from the reported CANcoder position. SyncCANcoder was developed for mechanisms where there is a risk of the CANcoder failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.

Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll to use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon FX will update its position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon FX position will be in rotations and not degrees.

Note: When the feedback source is changed to FusedCANcoder, the Talon FX needs a period of time to fuse before sensor-based (soft-limit, closed loop, etc.) features are used. This period of time is determined by the update frequency of the CANcoder’s Position signal.

feedback_remote_sensor_id: int = 0#

Device ID of which remote device to use. This is not used if the Sensor Source is the internal rotor sensor.

  • Minimum Value: 0

  • Maximum Value: 62

  • Default Value: 0

  • Units:

with_feedback_rotor_offset(new_feedback_rotor_offset: float) FeedbackConfigs#

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

This offset is applied to the absolute integrated rotor sensor. This can be used to zero the rotor in applications that are within one rotor rotation.

  • Minimum Value: -1

  • Maximum Value: 1

  • Default Value: 0.0

  • Units: rotations

Parameters:

new_feedback_rotor_offset (float) – Parameter to modify

Returns:

Itself

Return type:

FeedbackConfigs

with_sensor_to_mechanism_ratio(new_sensor_to_mechanism_ratio: float) FeedbackConfigs#

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

This is the ratio of sensor rotations to the mechanism’s output. This is equivalent to the mechanism’s gear ratio if the sensor is located on the input of a gearbox. If sensor is on the output of a gearbox, then this is typically set to 1. Note if this is set to zero, device will reset back to one.

  • Minimum Value: -1000

  • Maximum Value: 1000

  • Default Value: 1.0

  • Units: scalar

Parameters:

new_sensor_to_mechanism_ratio (float) – Parameter to modify

Returns:

Itself

Return type:

FeedbackConfigs

with_rotor_to_sensor_ratio(new_rotor_to_sensor_ratio: float) FeedbackConfigs#

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

Talon FX is capable of fusing a remote CANcoder with its rotor sensor to produce a high-bandwidth sensor source. This feature requires specifying the ratio between the remote sensor and the motor rotor. Note if this is set to zero, device will reset back to one.

  • Minimum Value: -1000

  • Maximum Value: 1000

  • Default Value: 1.0

  • Units: scalar

Parameters:

new_rotor_to_sensor_ratio (float) – Parameter to modify

Returns:

Itself

Return type:

FeedbackConfigs

with_feedback_sensor_source(new_feedback_sensor_source: FeedbackSensorSourceValue) FeedbackConfigs#

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

Choose what sensor source is reported via API and used by closed-loop and limit features. The default is RotorSensor, which uses the internal rotor sensor in the Talon FX.

Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon FX will update its position and velocity whenever CANcoder publishes its information on CAN bus.

Choose FusedCANcoder (requires Phoenix Pro) and Talon FX will fuse another CANcoder’s information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID). FusedCANcoder was developed for applications such as swerve-azimuth.

Choose SyncCANcoder (requires Phoenix Pro) and Talon FX will synchronize its internal rotor position against another CANcoder, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID). The TalonFX will report if its internal position differs significantly from the reported CANcoder position. SyncCANcoder was developed for mechanisms where there is a risk of the CANcoder failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.

Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll to use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon FX will update its position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon FX position will be in rotations and not degrees.

Note: When the feedback source is changed to FusedCANcoder, the Talon FX needs a period of time to fuse before sensor-based (soft-limit, closed loop, etc.) features are used. This period of time is determined by the update frequency of the CANcoder’s Position signal.

Parameters:

new_feedback_sensor_source (FeedbackSensorSourceValue) – Parameter to modify

Returns:

Itself

Return type:

FeedbackConfigs

with_feedback_remote_sensor_id(new_feedback_remote_sensor_id: int) FeedbackConfigs#

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

Device ID of which remote device to use. This is not used if the Sensor Source is the internal rotor sensor.

  • Minimum Value: 0

  • Maximum Value: 62

  • Default Value: 0

  • Units:

Parameters:

new_feedback_remote_sensor_id (int) – Parameter to modify

Returns:

Itself

Return type:

FeedbackConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.DifferentialSensorsConfigs#

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

Includes the differential sensor sources and IDs.

differential_sensor_source: DifferentialSensorSourceValue#

Choose what sensor source is used for differential control of a mechanism. The default is Disabled. All other options require setting the DifferentialTalonFXSensorID, as the average of this Talon FX’s sensor and the remote TalonFX’s sensor is used for the differential controller’s primary targets.

Choose RemoteTalonFX_Diff to use another TalonFX on the same CAN bus. Talon FX will update its differential position and velocity whenever the remote TalonFX publishes its information on CAN bus. The differential controller will use the difference between this TalonFX’s sensor and the remote Talon FX’s sensor for the differential component of the output.

Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll to use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID). Talon FX will update its differential position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon FX differential position will be in rotations and not degrees.

Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting DifferentialRemoteSensorID). Talon FX will update its differential position and velocity to match the CANcoder whenever CANcoder publishes its information on CAN bus.

differential_talon_fx_sensor_id: int = 0#

Device ID of which remote Talon FX to use. This is used when the Differential Sensor Source is not disabled.

  • Minimum Value: 0

  • Maximum Value: 62

  • Default Value: 0

  • Units:

differential_remote_sensor_id: int = 0#

Device ID of which remote sensor to use on the differential axis. This is used when the Differential Sensor Source is not RemoteTalonFX_Diff.

  • Minimum Value: 0

  • Maximum Value: 62

  • Default Value: 0

  • Units:

with_differential_sensor_source(new_differential_sensor_source: DifferentialSensorSourceValue) DifferentialSensorsConfigs#

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

Choose what sensor source is used for differential control of a mechanism. The default is Disabled. All other options require setting the DifferentialTalonFXSensorID, as the average of this Talon FX’s sensor and the remote TalonFX’s sensor is used for the differential controller’s primary targets.

Choose RemoteTalonFX_Diff to use another TalonFX on the same CAN bus. Talon FX will update its differential position and velocity whenever the remote TalonFX publishes its information on CAN bus. The differential controller will use the difference between this TalonFX’s sensor and the remote Talon FX’s sensor for the differential component of the output.

Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll to use another Pigeon2 on the same CAN bus (this also requires setting DifferentialRemoteSensorID). Talon FX will update its differential position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon FX differential position will be in rotations and not degrees.

Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting DifferentialRemoteSensorID). Talon FX will update its differential position and velocity to match the CANcoder whenever CANcoder publishes its information on CAN bus.

Parameters:

new_differential_sensor_source (DifferentialSensorSourceValue) – Parameter to modify

Returns:

Itself

Return type:

DifferentialSensorsConfigs

with_differential_talon_fx_sensor_id(new_differential_talon_fx_sensor_id: int) DifferentialSensorsConfigs#

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

Device ID of which remote Talon FX to use. This is used when the Differential Sensor Source is not disabled.

  • Minimum Value: 0

  • Maximum Value: 62

  • Default Value: 0

  • Units:

Parameters:

new_differential_talon_fx_sensor_id (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialSensorsConfigs

with_differential_remote_sensor_id(new_differential_remote_sensor_id: int) DifferentialSensorsConfigs#

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

Device ID of which remote sensor to use on the differential axis. This is used when the Differential Sensor Source is not RemoteTalonFX_Diff.

  • Minimum Value: 0

  • Maximum Value: 62

  • Default Value: 0

  • Units:

Parameters:

new_differential_remote_sensor_id (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialSensorsConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.DifferentialConstantsConfigs#

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

Includes the differential peak outputs.

peak_differential_duty_cycle: float = 2#

Maximum differential output during duty cycle based differential control modes.

  • Minimum Value: 0.0

  • Maximum Value: 2.0

  • Default Value: 2

  • Units: fractional

peak_differential_voltage: float = 32#

Maximum differential output during voltage based differential control modes.

  • Minimum Value: 0.0

  • Maximum Value: 32

  • Default Value: 32

  • Units: V

peak_differential_torque_current: float = 1600#

Maximum differential output during torque current based differential control modes.

  • Minimum Value: 0.0

  • Maximum Value: 1600

  • Default Value: 1600

  • Units: A

with_peak_differential_duty_cycle(new_peak_differential_duty_cycle: float) DifferentialConstantsConfigs#

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

Maximum differential output during duty cycle based differential control modes.

  • Minimum Value: 0.0

  • Maximum Value: 2.0

  • Default Value: 2

  • Units: fractional

Parameters:

new_peak_differential_duty_cycle (float) – Parameter to modify

Returns:

Itself

Return type:

DifferentialConstantsConfigs

with_peak_differential_voltage(new_peak_differential_voltage: float) DifferentialConstantsConfigs#

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

Maximum differential output during voltage based differential control modes.

  • Minimum Value: 0.0

  • Maximum Value: 32

  • Default Value: 32

  • Units: V

Parameters:

new_peak_differential_voltage (float) – Parameter to modify

Returns:

Itself

Return type:

DifferentialConstantsConfigs

with_peak_differential_torque_current(new_peak_differential_torque_current: float) DifferentialConstantsConfigs#

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

Maximum differential output during torque current based differential control modes.

  • Minimum Value: 0.0

  • Maximum Value: 1600

  • Default Value: 1600

  • Units: A

Parameters:

new_peak_differential_torque_current (float) – Parameter to modify

Returns:

Itself

Return type:

DifferentialConstantsConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.OpenLoopRampsConfigs#

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

Open-loop ramp rates for the various control types.

duty_cycle_open_loop_ramp_period: float = 0#

If non-zero, this determines how much time to ramp from 0% output to 100% during open-loop modes.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: sec

voltage_open_loop_ramp_period: float = 0#

If non-zero, this determines how much time to ramp from 0V output to 12V during open-loop modes.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: sec

torque_open_loop_ramp_period: float = 0#

If non-zero, this determines how much time to ramp from 0A output to 300A during open-loop modes.

  • Minimum Value: 0

  • Maximum Value: 10

  • Default Value: 0

  • Units: sec

with_duty_cycle_open_loop_ramp_period(new_duty_cycle_open_loop_ramp_period: float) OpenLoopRampsConfigs#

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

If non-zero, this determines how much time to ramp from 0% output to 100% during open-loop modes.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: sec

Parameters:

new_duty_cycle_open_loop_ramp_period (float) – Parameter to modify

Returns:

Itself

Return type:

OpenLoopRampsConfigs

with_voltage_open_loop_ramp_period(new_voltage_open_loop_ramp_period: float) OpenLoopRampsConfigs#

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

If non-zero, this determines how much time to ramp from 0V output to 12V during open-loop modes.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: sec

Parameters:

new_voltage_open_loop_ramp_period (float) – Parameter to modify

Returns:

Itself

Return type:

OpenLoopRampsConfigs

with_torque_open_loop_ramp_period(new_torque_open_loop_ramp_period: float) OpenLoopRampsConfigs#

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

If non-zero, this determines how much time to ramp from 0A output to 300A during open-loop modes.

  • Minimum Value: 0

  • Maximum Value: 10

  • Default Value: 0

  • Units: sec

Parameters:

new_torque_open_loop_ramp_period (float) – Parameter to modify

Returns:

Itself

Return type:

OpenLoopRampsConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.ClosedLoopRampsConfigs#

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

Closed-loop ramp rates for the various control types.

duty_cycle_closed_loop_ramp_period: float = 0#

If non-zero, this determines how much time to ramp from 0% output to 100% during closed-loop modes.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: sec

voltage_closed_loop_ramp_period: float = 0#

If non-zero, this determines how much time to ramp from 0V output to 12V during closed-loop modes.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: sec

torque_closed_loop_ramp_period: float = 0#

If non-zero, this determines how much time to ramp from 0A output to 300A during closed-loop modes.

  • Minimum Value: 0

  • Maximum Value: 10

  • Default Value: 0

  • Units: sec

with_duty_cycle_closed_loop_ramp_period(new_duty_cycle_closed_loop_ramp_period: float) ClosedLoopRampsConfigs#

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

If non-zero, this determines how much time to ramp from 0% output to 100% during closed-loop modes.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: sec

Parameters:

new_duty_cycle_closed_loop_ramp_period (float) – Parameter to modify

Returns:

Itself

Return type:

ClosedLoopRampsConfigs

with_voltage_closed_loop_ramp_period(new_voltage_closed_loop_ramp_period: float) ClosedLoopRampsConfigs#

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

If non-zero, this determines how much time to ramp from 0V output to 12V during closed-loop modes.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: sec

Parameters:

new_voltage_closed_loop_ramp_period (float) – Parameter to modify

Returns:

Itself

Return type:

ClosedLoopRampsConfigs

with_torque_closed_loop_ramp_period(new_torque_closed_loop_ramp_period: float) ClosedLoopRampsConfigs#

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

If non-zero, this determines how much time to ramp from 0A output to 300A during closed-loop modes.

  • Minimum Value: 0

  • Maximum Value: 10

  • Default Value: 0

  • Units: sec

Parameters:

new_torque_closed_loop_ramp_period (float) – Parameter to modify

Returns:

Itself

Return type:

ClosedLoopRampsConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.HardwareLimitSwitchConfigs#

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.

forward_limit_type: ForwardLimitTypeValue#

Determines if the forward limit switch is normally-open (default) or normally-closed.

forward_limit_autoset_position_enable: bool = False#

If enabled, the position is automatically set to a specific value, specified by ForwardLimitAutosetPositionValue, when the forward limit switch is asserted.

  • Default Value: False

forward_limit_autoset_position_value: float = 0#

The value to automatically set the position to when the forward limit switch is asserted. This has no effect if ForwardLimitAutosetPositionEnable is false.

  • Minimum Value: -3.4e+38

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units: rotations

forward_limit_enable: bool = True#

If enabled, motor output is set to neutral when the forward limit switch is asserted and positive output is requested.

  • Default Value: True

forward_limit_source: ForwardLimitSourceValue#

Determines where to poll the forward limit switch. This defaults to the forward limit switch pin on the limit switch connector.

Choose RemoteTalonFX to use the forward limit switch attached to another Talon FX on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).

Choose RemoteCANifier to use the forward limit switch attached to another CANifier on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).

Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID). The forward limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).

forward_limit_remote_sensor_id: int = 0#

Device ID of the remote device if using remote limit switch features for the forward limit switch.

  • Minimum Value: 0

  • Maximum Value: 62

  • Default Value: 0

  • Units:

reverse_limit_type: ReverseLimitTypeValue#

Determines if the reverse limit switch is normally-open (default) or normally-closed.

reverse_limit_autoset_position_enable: bool = False#

If enabled, the position is automatically set to a specific value, specified by ReverseLimitAutosetPositionValue, when the reverse limit switch is asserted.

  • Default Value: False

reverse_limit_autoset_position_value: float = 0#

The value to automatically set the position to when the reverse limit switch is asserted. This has no effect if ReverseLimitAutosetPositionEnable is false.

  • Minimum Value: -3.4e+38

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units: rotations

reverse_limit_enable: bool = True#

If enabled, motor output is set to neutral when reverse limit switch is asseted and negative output is requested.

  • Default Value: True

reverse_limit_source: ReverseLimitSourceValue#

Determines where to poll the reverse limit switch. This defaults to the reverse limit switch pin on the limit switch connector.

Choose RemoteTalonFX to use the reverse limit switch attached to another Talon FX on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).

Choose RemoteCANifier to use the reverse limit switch attached to another CANifier on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).

Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID). The reverse limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).

reverse_limit_remote_sensor_id: int = 0#

Device ID of the remote device if using remote limit switch features for the reverse limit switch.

  • Minimum Value: 0

  • Maximum Value: 62

  • Default Value: 0

  • Units:

with_forward_limit_type(new_forward_limit_type: ForwardLimitTypeValue) HardwareLimitSwitchConfigs#

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

Determines if the forward limit switch is normally-open (default) or normally-closed.

Parameters:

new_forward_limit_type (ForwardLimitTypeValue) – Parameter to modify

Returns:

Itself

Return type:

HardwareLimitSwitchConfigs

with_forward_limit_autoset_position_enable(new_forward_limit_autoset_position_enable: bool) HardwareLimitSwitchConfigs#

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

If enabled, the position is automatically set to a specific value, specified by ForwardLimitAutosetPositionValue, when the forward limit switch is asserted.

  • Default Value: False

Parameters:

new_forward_limit_autoset_position_enable (bool) – Parameter to modify

Returns:

Itself

Return type:

HardwareLimitSwitchConfigs

with_forward_limit_autoset_position_value(new_forward_limit_autoset_position_value: float) HardwareLimitSwitchConfigs#

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

The value to automatically set the position to when the forward limit switch is asserted. This has no effect if ForwardLimitAutosetPositionEnable is false.

  • Minimum Value: -3.4e+38

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units: rotations

Parameters:

new_forward_limit_autoset_position_value (float) – Parameter to modify

Returns:

Itself

Return type:

HardwareLimitSwitchConfigs

with_forward_limit_enable(new_forward_limit_enable: bool) HardwareLimitSwitchConfigs#

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

If enabled, motor output is set to neutral when the forward limit switch is asserted and positive output is requested.

  • Default Value: True

Parameters:

new_forward_limit_enable (bool) – Parameter to modify

Returns:

Itself

Return type:

HardwareLimitSwitchConfigs

with_forward_limit_source(new_forward_limit_source: ForwardLimitSourceValue) HardwareLimitSwitchConfigs#

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

Determines where to poll the forward limit switch. This defaults to the forward limit switch pin on the limit switch connector.

Choose RemoteTalonFX to use the forward limit switch attached to another Talon FX on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).

Choose RemoteCANifier to use the forward limit switch attached to another CANifier on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).

Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID). The forward limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).

Parameters:

new_forward_limit_source (ForwardLimitSourceValue) – Parameter to modify

Returns:

Itself

Return type:

HardwareLimitSwitchConfigs

with_forward_limit_remote_sensor_id(new_forward_limit_remote_sensor_id: int) HardwareLimitSwitchConfigs#

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

Device ID of the remote device if using remote limit switch features for the forward limit switch.

  • Minimum Value: 0

  • Maximum Value: 62

  • Default Value: 0

  • Units:

Parameters:

new_forward_limit_remote_sensor_id (int) – Parameter to modify

Returns:

Itself

Return type:

HardwareLimitSwitchConfigs

with_reverse_limit_type(new_reverse_limit_type: ReverseLimitTypeValue) HardwareLimitSwitchConfigs#

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

Determines if the reverse limit switch is normally-open (default) or normally-closed.

Parameters:

new_reverse_limit_type (ReverseLimitTypeValue) – Parameter to modify

Returns:

Itself

Return type:

HardwareLimitSwitchConfigs

with_reverse_limit_autoset_position_enable(new_reverse_limit_autoset_position_enable: bool) HardwareLimitSwitchConfigs#

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

If enabled, the position is automatically set to a specific value, specified by ReverseLimitAutosetPositionValue, when the reverse limit switch is asserted.

  • Default Value: False

Parameters:

new_reverse_limit_autoset_position_enable (bool) – Parameter to modify

Returns:

Itself

Return type:

HardwareLimitSwitchConfigs

with_reverse_limit_autoset_position_value(new_reverse_limit_autoset_position_value: float) HardwareLimitSwitchConfigs#

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

The value to automatically set the position to when the reverse limit switch is asserted. This has no effect if ReverseLimitAutosetPositionEnable is false.

  • Minimum Value: -3.4e+38

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units: rotations

Parameters:

new_reverse_limit_autoset_position_value (float) – Parameter to modify

Returns:

Itself

Return type:

HardwareLimitSwitchConfigs

with_reverse_limit_enable(new_reverse_limit_enable: bool) HardwareLimitSwitchConfigs#

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

If enabled, motor output is set to neutral when reverse limit switch is asseted and negative output is requested.

  • Default Value: True

Parameters:

new_reverse_limit_enable (bool) – Parameter to modify

Returns:

Itself

Return type:

HardwareLimitSwitchConfigs

with_reverse_limit_source(new_reverse_limit_source: ReverseLimitSourceValue) HardwareLimitSwitchConfigs#

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

Determines where to poll the reverse limit switch. This defaults to the reverse limit switch pin on the limit switch connector.

Choose RemoteTalonFX to use the reverse limit switch attached to another Talon FX on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).

Choose RemoteCANifier to use the reverse limit switch attached to another CANifier on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).

Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID). The reverse limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).

Parameters:

new_reverse_limit_source (ReverseLimitSourceValue) – Parameter to modify

Returns:

Itself

Return type:

HardwareLimitSwitchConfigs

with_reverse_limit_remote_sensor_id(new_reverse_limit_remote_sensor_id: int) HardwareLimitSwitchConfigs#

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

Device ID of the remote device if using remote limit switch features for the reverse limit switch.

  • Minimum Value: 0

  • Maximum Value: 62

  • Default Value: 0

  • Units:

Parameters:

new_reverse_limit_remote_sensor_id (int) – Parameter to modify

Returns:

Itself

Return type:

HardwareLimitSwitchConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.AudioConfigs#

Configs that affect audible components of the device.

Includes configuration for the beep on boot.

beep_on_boot: bool = True#

If true, the TalonFX will beep during boot-up. This is useful for general debugging, and defaults to true. If rotor is moving during boot-up, the beep will not occur regardless of this setting.

  • Default Value: True

beep_on_config: bool = True#

If true, the TalonFX will beep during configuration API calls if device is disabled. This is useful for general debugging, and defaults to true. Note that if the rotor is moving, the beep will not occur regardless of this setting.

  • Default Value: True

allow_music_dur_disable: bool = False#

If true, the TalonFX will allow Orchestra and MusicTone requests during disabled state. This can be used to address corner cases when music features are needed when disabled. This setting defaults to false. Note that if the rotor is moving, music features are always disabled regardless of this setting.

  • Default Value: False

with_beep_on_boot(new_beep_on_boot: bool) AudioConfigs#

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

If true, the TalonFX will beep during boot-up. This is useful for general debugging, and defaults to true. If rotor is moving during boot-up, the beep will not occur regardless of this setting.

  • Default Value: True

Parameters:

new_beep_on_boot (bool) – Parameter to modify

Returns:

Itself

Return type:

AudioConfigs

with_beep_on_config(new_beep_on_config: bool) AudioConfigs#

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

If true, the TalonFX will beep during configuration API calls if device is disabled. This is useful for general debugging, and defaults to true. Note that if the rotor is moving, the beep will not occur regardless of this setting.

  • Default Value: True

Parameters:

new_beep_on_config (bool) – Parameter to modify

Returns:

Itself

Return type:

AudioConfigs

with_allow_music_dur_disable(new_allow_music_dur_disable: bool) AudioConfigs#

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

If true, the TalonFX will allow Orchestra and MusicTone requests during disabled state. This can be used to address corner cases when music features are needed when disabled. This setting defaults to false. Note that if the rotor is moving, music features are always disabled regardless of this setting.

  • Default Value: False

Parameters:

new_allow_music_dur_disable (bool) – Parameter to modify

Returns:

Itself

Return type:

AudioConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.SoftwareLimitSwitchConfigs#

Configs that affect how software-limit switches behave.

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

forward_soft_limit_enable: bool = False#

If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.

  • Default Value: False

reverse_soft_limit_enable: bool = False#

If enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.

  • Default Value: False

forward_soft_limit_threshold: float = 0#

Position threshold for forward soft limit features. ForwardSoftLimitEnable must be enabled for this to take effect.

  • Minimum Value: -3.4e+38

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units: rotations

reverse_soft_limit_threshold: float = 0#

Position threshold for reverse soft limit features. ReverseSoftLimitEnable must be enabled for this to take effect.

  • Minimum Value: -3.4e+38

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units: rotations

with_forward_soft_limit_enable(new_forward_soft_limit_enable: bool) SoftwareLimitSwitchConfigs#

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

If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.

  • Default Value: False

Parameters:

new_forward_soft_limit_enable (bool) – Parameter to modify

Returns:

Itself

Return type:

SoftwareLimitSwitchConfigs

with_reverse_soft_limit_enable(new_reverse_soft_limit_enable: bool) SoftwareLimitSwitchConfigs#

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

If enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.

  • Default Value: False

Parameters:

new_reverse_soft_limit_enable (bool) – Parameter to modify

Returns:

Itself

Return type:

SoftwareLimitSwitchConfigs

with_forward_soft_limit_threshold(new_forward_soft_limit_threshold: float) SoftwareLimitSwitchConfigs#

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

Position threshold for forward soft limit features. ForwardSoftLimitEnable must be enabled for this to take effect.

  • Minimum Value: -3.4e+38

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units: rotations

Parameters:

new_forward_soft_limit_threshold (float) – Parameter to modify

Returns:

Itself

Return type:

SoftwareLimitSwitchConfigs

with_reverse_soft_limit_threshold(new_reverse_soft_limit_threshold: float) SoftwareLimitSwitchConfigs#

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

Position threshold for reverse soft limit features. ReverseSoftLimitEnable must be enabled for this to take effect.

  • Minimum Value: -3.4e+38

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units: rotations

Parameters:

new_reverse_soft_limit_threshold (float) – Parameter to modify

Returns:

Itself

Return type:

SoftwareLimitSwitchConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.MotionMagicConfigs#

Configs for Motion Magic®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.

motion_magic_cruise_velocity: float = 0#

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

motion_magic_acceleration: float = 0#

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²

motion_magic_jerk: float = 0#

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³

motion_magic_expo_k_v: float = 0#

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

motion_magic_expo_k_a: float = 0#

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²

with_motion_magic_cruise_velocity(new_motion_magic_cruise_velocity: float) MotionMagicConfigs#

Modifies this configuration’s motion_magic_cruise_velocity 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:

new_motion_magic_cruise_velocity (float) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicConfigs

with_motion_magic_acceleration(new_motion_magic_acceleration: float) MotionMagicConfigs#

Modifies this configuration’s motion_magic_acceleration 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:

new_motion_magic_acceleration (float) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicConfigs

with_motion_magic_jerk(new_motion_magic_jerk: float) MotionMagicConfigs#

Modifies this configuration’s motion_magic_jerk 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:

new_motion_magic_jerk (float) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicConfigs

with_motion_magic_expo_k_v(new_motion_magic_expo_k_v: float) MotionMagicConfigs#

Modifies this configuration’s motion_magic_expo_k_v 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:

new_motion_magic_expo_k_v (float) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicConfigs

with_motion_magic_expo_k_a(new_motion_magic_expo_k_a: float) MotionMagicConfigs#

Modifies this configuration’s motion_magic_expo_k_a 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:

new_motion_magic_expo_k_a (float) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.CustomParamsConfigs#

Custom Params.

Custom paramaters that have no real impact on controller.

custom_param0: int = 0#

Custom parameter 0. This is provided to allow end-applications to store persistent information in the device.

  • Minimum Value: -32768

  • Maximum Value: 32767

  • Default Value: 0

  • Units:

custom_param1: int = 0#

Custom parameter 1. This is provided to allow end-applications to store persistent information in the device.

  • Minimum Value: -32768

  • Maximum Value: 32767

  • Default Value: 0

  • Units:

with_custom_param0(new_custom_param0: int) CustomParamsConfigs#

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

Custom parameter 0. This is provided to allow end-applications to store persistent information in the device.

  • Minimum Value: -32768

  • Maximum Value: 32767

  • Default Value: 0

  • Units:

Parameters:

new_custom_param0 (int) – Parameter to modify

Returns:

Itself

Return type:

CustomParamsConfigs

with_custom_param1(new_custom_param1: int) CustomParamsConfigs#

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

Custom parameter 1. This is provided to allow end-applications to store persistent information in the device.

  • Minimum Value: -32768

  • Maximum Value: 32767

  • Default Value: 0

  • Units:

Parameters:

new_custom_param1 (int) – Parameter to modify

Returns:

Itself

Return type:

CustomParamsConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.ClosedLoopGeneralConfigs#

Configs that affect general behavior during closed-looping.

Includes Continuous Wrap features.

continuous_wrap: bool = False#

Wrap position error within [-0.5,+0.5) mechanism rotations. Typically used for continuous position closed-loops like swerve azimuth.

This uses the mechanism rotation value. If there is a gear ratio between the sensor and the mechanism, make sure to apply a SensorToMechanismRatio so the closed loop operates on the full rotation.

  • Default Value: False

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.Slot0Configs#

Gains for the specified slot.

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

k_p: float = 0#

Proportional Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps of error, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_i: float = 0#

Integral Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_d: float = 0#

Derivative Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_s: float = 0#

Static Feedforward Gain

This is added to the closed loop output. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

The sign is typically determined by reference velocity when using position, velocity, and Motion Magic® closed loop modes. However, when using position closed loop with zero velocity reference (no motion profiling), the application can instead use the position closed loop error by setting the Static Feedforward Sign configuration parameter. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

k_v: float = 0#

Velocity Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_a: float = 0#

Acceleration Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_g: float = 0#

Gravity Feedforward/Feedback Gain

This is added to the closed loop output. The sign is determined by GravityType. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

gravity_type: GravityTypeValue#

Gravity Feedforward/Feedback Type

This determines the type of the gravity feedforward/feedback.

Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always have the same sign.

Choose Arm_Cosine for systems where the gravity feedback is dependent on the angular position of the mechanism, such as an arm. The gravity feedback output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor reports a position of 0 when the mechanism is horizonal (parallel to the ground), and the reported sensor position is 1:1 with the mechanism.

static_feedforward_sign: 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 closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

with_k_p(new_k_p: float) Slot0Configs#

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

Proportional Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps of error, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_p (float) – Parameter to modify

Returns:

Itself

Return type:

Slot0Configs

with_k_i(new_k_i: float) Slot0Configs#

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

Integral Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_i (float) – Parameter to modify

Returns:

Itself

Return type:

Slot0Configs

with_k_d(new_k_d: float) Slot0Configs#

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

Derivative Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_d (float) – Parameter to modify

Returns:

Itself

Return type:

Slot0Configs

with_k_s(new_k_s: float) Slot0Configs#

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

Static Feedforward Gain

This is added to the closed loop output. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

The sign is typically determined by reference velocity when using position, velocity, and Motion Magic® closed loop modes. However, when using position closed loop with zero velocity reference (no motion profiling), the application can instead use the position closed loop error by setting the Static Feedforward Sign configuration parameter. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

Parameters:

new_k_s (float) – Parameter to modify

Returns:

Itself

Return type:

Slot0Configs

with_k_v(new_k_v: float) Slot0Configs#

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

Velocity Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_v (float) – Parameter to modify

Returns:

Itself

Return type:

Slot0Configs

with_k_a(new_k_a: float) Slot0Configs#

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

Acceleration Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_a (float) – Parameter to modify

Returns:

Itself

Return type:

Slot0Configs

with_k_g(new_k_g: float) Slot0Configs#

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

Gravity Feedforward/Feedback Gain

This is added to the closed loop output. The sign is determined by GravityType. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

Parameters:

new_k_g (float) – Parameter to modify

Returns:

Itself

Return type:

Slot0Configs

with_gravity_type(new_gravity_type: GravityTypeValue) Slot0Configs#

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

Gravity Feedforward/Feedback Type

This determines the type of the gravity feedforward/feedback.

Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always have the same sign.

Choose Arm_Cosine for systems where the gravity feedback is dependent on the angular position of the mechanism, such as an arm. The gravity feedback output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor reports a position of 0 when the mechanism is horizonal (parallel to the ground), and the reported sensor position is 1:1 with the mechanism.

Parameters:

new_gravity_type (GravityTypeValue) – Parameter to modify

Returns:

Itself

Return type:

Slot0Configs

with_static_feedforward_sign(new_static_feedforward_sign: StaticFeedforwardSignValue) Slot0Configs#

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

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 closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

Parameters:

new_static_feedforward_sign (StaticFeedforwardSignValue) – Parameter to modify

Returns:

Itself

Return type:

Slot0Configs

classmethod from_other(value) Slot0Configs#
deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.Slot1Configs#

Gains for the specified slot.

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

k_p: float = 0#

Proportional Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_i: float = 0#

Integral Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_d: float = 0#

Derivative Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_s: float = 0#

Static Feedforward Gain

This is added to the closed loop output. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

The sign is typically determined by reference velocity when using position, velocity, and Motion Magic® closed loop modes. However, when using position closed loop with zero velocity reference (no motion profiling), the application can instead use the position closed loop error by setting the Static Feedforward Sign configuration parameter. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

k_v: float = 0#

Velocity Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_a: float = 0#

Acceleration Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_g: float = 0#

Gravity Feedforward/Feedback Gain

This is added to the closed loop output. The sign is determined by GravityType. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

gravity_type: GravityTypeValue#

Gravity Feedforward/Feedback Type

This determines the type of the gravity feedforward/feedback.

Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always be positive.

Choose Arm_Cosine for systems where the gravity feedback is dependent on the angular position of the mechanism, such as an arm. The gravity feedback output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor position is 0 when the mechanism is horizonal, and one rotation of the mechanism corresponds to one rotation of the sensor position.

static_feedforward_sign: 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 closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

with_k_p(new_k_p: float) Slot1Configs#

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

Proportional Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_p (float) – Parameter to modify

Returns:

Itself

Return type:

Slot1Configs

with_k_i(new_k_i: float) Slot1Configs#

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

Integral Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_i (float) – Parameter to modify

Returns:

Itself

Return type:

Slot1Configs

with_k_d(new_k_d: float) Slot1Configs#

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

Derivative Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_d (float) – Parameter to modify

Returns:

Itself

Return type:

Slot1Configs

with_k_s(new_k_s: float) Slot1Configs#

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

Static Feedforward Gain

This is added to the closed loop output. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

The sign is typically determined by reference velocity when using position, velocity, and Motion Magic® closed loop modes. However, when using position closed loop with zero velocity reference (no motion profiling), the application can instead use the position closed loop error by setting the Static Feedforward Sign configuration parameter. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

Parameters:

new_k_s (float) – Parameter to modify

Returns:

Itself

Return type:

Slot1Configs

with_k_v(new_k_v: float) Slot1Configs#

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

Velocity Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_v (float) – Parameter to modify

Returns:

Itself

Return type:

Slot1Configs

with_k_a(new_k_a: float) Slot1Configs#

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

Acceleration Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_a (float) – Parameter to modify

Returns:

Itself

Return type:

Slot1Configs

with_k_g(new_k_g: float) Slot1Configs#

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

Gravity Feedforward/Feedback Gain

This is added to the closed loop output. The sign is determined by GravityType. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

Parameters:

new_k_g (float) – Parameter to modify

Returns:

Itself

Return type:

Slot1Configs

with_gravity_type(new_gravity_type: GravityTypeValue) Slot1Configs#

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

Gravity Feedforward/Feedback Type

This determines the type of the gravity feedforward/feedback.

Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always be positive.

Choose Arm_Cosine for systems where the gravity feedback is dependent on the angular position of the mechanism, such as an arm. The gravity feedback output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor position is 0 when the mechanism is horizonal, and one rotation of the mechanism corresponds to one rotation of the sensor position.

Parameters:

new_gravity_type (GravityTypeValue) – Parameter to modify

Returns:

Itself

Return type:

Slot1Configs

with_static_feedforward_sign(new_static_feedforward_sign: StaticFeedforwardSignValue) Slot1Configs#

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

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 closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

Parameters:

new_static_feedforward_sign (StaticFeedforwardSignValue) – Parameter to modify

Returns:

Itself

Return type:

Slot1Configs

classmethod from_other(value) Slot1Configs#
deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.Slot2Configs#

Gains for the specified slot.

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

k_p: float = 0#

Proportional Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_i: float = 0#

Integral Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_d: float = 0#

Derivative Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_s: float = 0#

Static Feedforward Gain

This is added to the closed loop output. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

The sign is typically determined by reference velocity when using position, velocity, and Motion Magic® closed loop modes. However, when using position closed loop with zero velocity reference (no motion profiling), the application can instead use the position closed loop error by setting the Static Feedforward Sign configuration parameter. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

k_v: float = 0#

Velocity Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_a: float = 0#

Acceleration Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_g: float = 0#

Gravity Feedforward/Feedback Gain

This is added to the closed loop output. The sign is determined by GravityType. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

gravity_type: GravityTypeValue#

Gravity Feedforward/Feedback Type

This determines the type of the gravity feedforward/feedback.

Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always be positive.

Choose Arm_Cosine for systems where the gravity feedback is dependent on the angular position of the mechanism, such as an arm. The gravity feedback output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor position is 0 when the mechanism is horizonal, and one rotation of the mechanism corresponds to one rotation of the sensor position.

static_feedforward_sign: 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 closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

with_k_p(new_k_p: float) Slot2Configs#

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

Proportional Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_p (float) – Parameter to modify

Returns:

Itself

Return type:

Slot2Configs

with_k_i(new_k_i: float) Slot2Configs#

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

Integral Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_i (float) – Parameter to modify

Returns:

Itself

Return type:

Slot2Configs

with_k_d(new_k_d: float) Slot2Configs#

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

Derivative Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_d (float) – Parameter to modify

Returns:

Itself

Return type:

Slot2Configs

with_k_s(new_k_s: float) Slot2Configs#

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

Static Feedforward Gain

This is added to the closed loop output. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

The sign is typically determined by reference velocity when using position, velocity, and Motion Magic® closed loop modes. However, when using position closed loop with zero velocity reference (no motion profiling), the application can instead use the position closed loop error by setting the Static Feedforward Sign configuration parameter. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

Parameters:

new_k_s (float) – Parameter to modify

Returns:

Itself

Return type:

Slot2Configs

with_k_v(new_k_v: float) Slot2Configs#

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

Velocity Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_v (float) – Parameter to modify

Returns:

Itself

Return type:

Slot2Configs

with_k_a(new_k_a: float) Slot2Configs#

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

Acceleration Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_a (float) – Parameter to modify

Returns:

Itself

Return type:

Slot2Configs

with_k_g(new_k_g: float) Slot2Configs#

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

Gravity Feedforward/Feedback Gain

This is added to the closed loop output. The sign is determined by GravityType. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

Parameters:

new_k_g (float) – Parameter to modify

Returns:

Itself

Return type:

Slot2Configs

with_gravity_type(new_gravity_type: GravityTypeValue) Slot2Configs#

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

Gravity Feedforward/Feedback Type

This determines the type of the gravity feedforward/feedback.

Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always be positive.

Choose Arm_Cosine for systems where the gravity feedback is dependent on the angular position of the mechanism, such as an arm. The gravity feedback output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor position is 0 when the mechanism is horizonal, and one rotation of the mechanism corresponds to one rotation of the sensor position.

Parameters:

new_gravity_type (GravityTypeValue) – Parameter to modify

Returns:

Itself

Return type:

Slot2Configs

with_static_feedforward_sign(new_static_feedforward_sign: StaticFeedforwardSignValue) Slot2Configs#

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

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 closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

Parameters:

new_static_feedforward_sign (StaticFeedforwardSignValue) – Parameter to modify

Returns:

Itself

Return type:

Slot2Configs

classmethod from_other(value) Slot2Configs#
deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

class phoenix6.configs.SlotConfigs#

Gains for the specified slot.

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

slot_number = 0#

Chooses which slot these configs are for.

k_p: float = 0#

Proportional Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps of error, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_i: float = 0#

Integral Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_d: float = 0#

Derivative Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_s: float = 0#

Static Feedforward Gain

This is added to the closed loop output. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

The sign is typically determined by reference velocity when using position, velocity, and Motion Magic® closed loop modes. However, when using position closed loop with zero velocity reference (no motion profiling), the application can instead use the position closed loop error by setting the Static Feedforward Sign configuration parameter. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

k_v: float = 0#

Velocity Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_a: float = 0#

Acceleration Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

k_g: float = 0#

Gravity Feedforward/Feedback Gain

This is added to the closed loop output. The sign is determined by GravityType. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

gravity_type: GravityTypeValue#

Gravity Feedforward/Feedback Type

This determines the type of the gravity feedforward/feedback.

Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always have the same sign.

Choose Arm_Cosine for systems where the gravity feedback is dependent on the angular position of the mechanism, such as an arm. The gravity feedback output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor reports a position of 0 when the mechanism is horizonal (parallel to the ground), and the reported sensor position is 1:1 with the mechanism.

static_feedforward_sign: 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 closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

with_k_p(new_k_p: float) SlotConfigs#

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

Proportional Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps of error, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_p (float) – Parameter to modify

Returns:

Itself

Return type:

SlotConfigs

with_k_i(new_k_i: float) SlotConfigs#

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

Integral Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_i (float) – Parameter to modify

Returns:

Itself

Return type:

SlotConfigs

with_k_d(new_k_d: float) SlotConfigs#

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

Derivative Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_d (float) – Parameter to modify

Returns:

Itself

Return type:

SlotConfigs

with_k_s(new_k_s: float) SlotConfigs#

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

Static Feedforward Gain

This is added to the closed loop output. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

The sign is typically determined by reference velocity when using position, velocity, and Motion Magic® closed loop modes. However, when using position closed loop with zero velocity reference (no motion profiling), the application can instead use the position closed loop error by setting the Static Feedforward Sign configuration parameter. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

Parameters:

new_k_s (float) – Parameter to modify

Returns:

Itself

Return type:

SlotConfigs

with_k_v(new_k_v: float) SlotConfigs#

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

Velocity Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_v (float) – Parameter to modify

Returns:

Itself

Return type:

SlotConfigs

with_k_a(new_k_a: float) SlotConfigs#

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

Acceleration Feedforward Gain

The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).

  • Minimum Value: 0

  • Maximum Value: 3.4e+38

  • Default Value: 0

  • Units:

Parameters:

new_k_a (float) – Parameter to modify

Returns:

Itself

Return type:

SlotConfigs

with_k_g(new_k_g: float) SlotConfigs#

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

Gravity Feedforward/Feedback Gain

This is added to the closed loop output. The sign is determined by GravityType. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.

  • Minimum Value: -512

  • Maximum Value: 511

  • Default Value: 0

  • Units:

Parameters:

new_k_g (float) – Parameter to modify

Returns:

Itself

Return type:

SlotConfigs

with_gravity_type(new_gravity_type: GravityTypeValue) SlotConfigs#

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

Gravity Feedforward/Feedback Type

This determines the type of the gravity feedforward/feedback.

Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always have the same sign.

Choose Arm_Cosine for systems where the gravity feedback is dependent on the angular position of the mechanism, such as an arm. The gravity feedback output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor reports a position of 0 when the mechanism is horizonal (parallel to the ground), and the reported sensor position is 1:1 with the mechanism.

Parameters:

new_gravity_type (GravityTypeValue) – Parameter to modify

Returns:

Itself

Return type:

SlotConfigs

with_static_feedforward_sign(new_static_feedforward_sign: StaticFeedforwardSignValue) SlotConfigs#

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

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 closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.

Parameters:

new_static_feedforward_sign (StaticFeedforwardSignValue) – Parameter to modify

Returns:

Itself

Return type:

SlotConfigs

deserialize(string: str) phoenix6.status_code.StatusCode#

Deserialize string and put values into this object

Parameters:

string (str) – String to deserialize

Returns:

OK if deserialization is OK

Return type:

StatusCode

serialize() str#

Serialize this object into a string

Returns:

This object’s data serialized into a string

Return type:

str

classmethod from_other(value) SlotConfigs#
class phoenix6.configs.TalonFXConfiguration#

Class description for the Talon FX integrated motor controller.

This handles the configurations for TalonFX

future_proof_configs: bool = True#

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.

motor_output: phoenix6.configs.config_groups.MotorOutputConfigs#

Configs that directly affect motor output.

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

current_limits: phoenix6.configs.config_groups.CurrentLimitsConfigs#

Configs that directly affect current limiting features.

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

voltage: phoenix6.configs.config_groups.VoltageConfigs#

Configs that affect Voltage control types.

Includes peak output voltages and other configs affecting voltage measurements.

torque_current: phoenix6.configs.config_groups.TorqueCurrentConfigs#

Configs that affect Torque Current control types.

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

feedback: phoenix6.configs.config_groups.FeedbackConfigs#

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.

differential_sensors: phoenix6.configs.config_groups.DifferentialSensorsConfigs#

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

Includes the differential sensor sources and IDs.

differential_constants: phoenix6.configs.config_groups.DifferentialConstantsConfigs#

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

Includes the differential peak outputs.

open_loop_ramps: phoenix6.configs.config_groups.OpenLoopRampsConfigs#

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

Open-loop ramp rates for the various control types.

closed_loop_ramps: phoenix6.configs.config_groups.ClosedLoopRampsConfigs#

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

Closed-loop ramp rates for the various control types.

hardware_limit_switch: phoenix6.configs.config_groups.HardwareLimitSwitchConfigs#

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.

audio: phoenix6.configs.config_groups.AudioConfigs#

Configs that affect audible components of the device.

Includes configuration for the beep on boot.

software_limit_switch: phoenix6.configs.config_groups.SoftwareLimitSwitchConfigs#

Configs that affect how software-limit switches behave.

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

motion_magic: phoenix6.configs.config_groups.MotionMagicConfigs#

Configs for Motion Magic®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.

custom_params: phoenix6.configs.config_groups.CustomParamsConfigs#

Custom Params.

Custom paramaters that have no real impact on controller.

closed_loop_general: phoenix6.configs.config_groups.ClosedLoopGeneralConfigs#

Configs that affect general behavior during closed-looping.

Includes Continuous Wrap features.

slot0: phoenix6.configs.config_groups.Slot0Configs#

Gains for the specified slot.

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

slot1: phoenix6.configs.config_groups.Slot1Configs#

Gains for the specified slot.

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

slot2: phoenix6.configs.config_groups.Slot2Configs#

Gains for the specified slot.

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

with_motor_output(new_motor_output: phoenix6.configs.config_groups.MotorOutputConfigs) TalonFXConfiguration#

Modifies this configuration’s motor_output 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.

Parameters:

new_motor_output (MotorOutputConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_current_limits(new_current_limits: phoenix6.configs.config_groups.CurrentLimitsConfigs) TalonFXConfiguration#

Modifies this configuration’s current_limits 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.

Parameters:

new_current_limits (CurrentLimitsConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_voltage(new_voltage: phoenix6.configs.config_groups.VoltageConfigs) TalonFXConfiguration#

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.

Parameters:

new_voltage (VoltageConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_torque_current(new_torque_current: phoenix6.configs.config_groups.TorqueCurrentConfigs) TalonFXConfiguration#

Modifies this configuration’s torque_current 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.

Parameters:

new_torque_current (TorqueCurrentConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_feedback(new_feedback: phoenix6.configs.config_groups.FeedbackConfigs) TalonFXConfiguration#

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.

Parameters:

new_feedback (FeedbackConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_differential_sensors(new_differential_sensors: phoenix6.configs.config_groups.DifferentialSensorsConfigs) TalonFXConfiguration#

Modifies this configuration’s differential_sensors 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.

Parameters:

new_differential_sensors (DifferentialSensorsConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_differential_constants(new_differential_constants: phoenix6.configs.config_groups.DifferentialConstantsConfigs) TalonFXConfiguration#

Modifies this configuration’s differential_constants 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.

Parameters:

new_differential_constants (DifferentialConstantsConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_open_loop_ramps(new_open_loop_ramps: phoenix6.configs.config_groups.OpenLoopRampsConfigs) TalonFXConfiguration#

Modifies this configuration’s open_loop_ramps 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.

Parameters:

new_open_loop_ramps (OpenLoopRampsConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_closed_loop_ramps(new_closed_loop_ramps: phoenix6.configs.config_groups.ClosedLoopRampsConfigs) TalonFXConfiguration#

Modifies this configuration’s closed_loop_ramps 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.

Parameters:

new_closed_loop_ramps (ClosedLoopRampsConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_hardware_limit_switch(new_hardware_limit_switch: phoenix6.configs.config_groups.HardwareLimitSwitchConfigs) TalonFXConfiguration#

Modifies this configuration’s hardware_limit_switch 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.

Parameters:

new_hardware_limit_switch (HardwareLimitSwitchConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_audio(new_audio: phoenix6.configs.config_groups.AudioConfigs) TalonFXConfiguration#

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.

Parameters:

new_audio (AudioConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_software_limit_switch(new_software_limit_switch: phoenix6.configs.config_groups.SoftwareLimitSwitchConfigs) TalonFXConfiguration#

Modifies this configuration’s software_limit_switch 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.

Parameters:

new_software_limit_switch (SoftwareLimitSwitchConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_motion_magic(new_motion_magic: phoenix6.configs.config_groups.MotionMagicConfigs) TalonFXConfiguration#

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

Configs for Motion Magic®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.

Parameters:

new_motion_magic (MotionMagicConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_custom_params(new_custom_params: phoenix6.configs.config_groups.CustomParamsConfigs) TalonFXConfiguration#

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

Custom Params.

Custom paramaters that have no real impact on controller.

Parameters:

new_custom_params (CustomParamsConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_closed_loop_general(new_closed_loop_general: phoenix6.configs.config_groups.ClosedLoopGeneralConfigs) TalonFXConfiguration#

Modifies this configuration’s closed_loop_general 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.

Parameters:

new_closed_loop_general (ClosedLoopGeneralConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_slot0(new_slot0: phoenix6.configs.config_groups.Slot0Configs) TalonFXConfiguration#

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.

Parameters:

new_slot0 (Slot0Configs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_slot1(new_slot1: phoenix6.configs.config_groups.Slot1Configs) TalonFXConfiguration#

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.

Parameters:

new_slot1 (Slot1Configs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

with_slot2(new_slot2: phoenix6.configs.config_groups.Slot2Configs) TalonFXConfiguration#

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.

Parameters:

new_slot2 (Slot2Configs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXConfiguration

serialize() str#

Get the serialized form of this configuration

Returns:

Serialized form of this config group

Return type:

str

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode#

Take a string and deserialize it to this configuration

Returns:

Return code of the deserialize method

Return type:

str

class phoenix6.configs.TalonFXConfigurator(id: phoenix6.hardware.device_identifier.DeviceIdentifier)#

Bases: phoenix6.configs.parent_configurator.ParentConfigurator

  • Class description for the Talon FX integrated motor controller.

    This handles the configurations for TalonFX

refresh(configs: phoenix6.configs.config_groups.SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Refreshes the values of the specified config group.

Call to refresh the selected configs from the device.

Parameters:
  • configs (name) – The configs to refresh

  • timeout_seconds (second) – Maximum amount of time to wait when performing configuration

Returns:

StatusCode of refreshing the configs

Return type:

StatusCode

apply(configs: phoenix6.configs.config_groups.SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Applies the contents of the specified config to the device.

Call to apply the selected configs.

Parameters:
  • configs (SupportsSerialization) – Configs to apply

  • timeout_seconds (second) – Maximum amount of time to wait when performing configuration

Returns:

StatusCode of the apply method

Return type:

StatusCode

set_position(new_value: phoenix6.units.rotation, timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Sets the mechanism position of the device in mechanism rotations.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:
  • new_value (rotation) – Value to set to. Units are in rotations.

  • timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_faults(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear the sticky faults in the device.

This typically has no impact on the device functionality. Instead, it just clears telemetry faults that are accessible via API and Tuner Self-Test.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_hardware(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Hardware fault occurred

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_proc_temp(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Processor temperature exceeded limit

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_device_temp(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Device temperature exceeded limit

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_undervoltage(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Device supply voltage dropped to near brownout levels

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_boot_during_enable(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Device boot while detecting the enable signal

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_bridge_brownout(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Bridge was disabled most likely due to supply voltage dropping too low.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_remote_sensor_reset(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: The remote sensor has reset.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_missing_differential_fx(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: The remote Talon FX used for differential control is not present on CAN Bus.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_remote_sensor_pos_overflow(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: The remote sensor position has overflowed. Because of the nature of remote sensors, it is possible for the remote sensor position to overflow beyond what is supported by the status signal frame. However, this is rare and cannot occur over the course of an FRC match under normal use.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_over_supply_v(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Supply Voltage has exceeded the maximum voltage rating of device.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_unstable_supply_v(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Supply Voltage is unstable. Ensure you are using a battery and current limited power supply.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_reverse_hard_limit(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Reverse limit switch has been asserted. Output is set to neutral.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_forward_hard_limit(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Forward limit switch has been asserted. Output is set to neutral.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_reverse_soft_limit(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Reverse soft limit has been asserted. Output is set to neutral.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_forward_soft_limit(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Forward soft limit has been asserted. Output is set to neutral.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_remote_sensor_data_invalid(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: The remote sensor’s data is no longer trusted. This can happen if the remote sensor disappears from the CAN bus or if the remote sensor indicates its data is no longer valid, such as when a CANcoder’s magnet strength falls into the “red” range.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_fused_sensor_out_of_sync(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: The remote sensor used for fusion has fallen out of sync to the local sensor. A re-synchronization has occurred, which may cause a discontinuity. This typically happens if there is significant slop in the mechanism, or if the RotorToSensorRatio configuration parameter is incorrect.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_stator_curr_limit(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Stator current limit occured.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_supply_curr_limit(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Supply current limit occured.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

class phoenix6.configs.CANcoderConfiguration#

Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along with filtered velocity.

This handles the configurations for CANcoder

future_proof_configs: bool = True#

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.

magnet_sensor: MagnetSensorConfigs#

Configs that affect the magnet sensor and how to interpret it.

Includes sensor range, sensor direction, and the magnet offset.

with_magnet_sensor(new_magnet_sensor: MagnetSensorConfigs) CANcoderConfiguration#

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

Configs that affect the magnet sensor and how to interpret it.

Includes sensor range, sensor direction, and the magnet offset.

Parameters:

new_magnet_sensor (MagnetSensorConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANcoderConfiguration

serialize() str#

Get the serialized form of this configuration

Returns:

Serialized form of this config group

Return type:

str

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode#

Take a string and deserialize it to this configuration

Returns:

Return code of the deserialize method

Return type:

str

class phoenix6.configs.CANcoderConfigurator(id: phoenix6.hardware.device_identifier.DeviceIdentifier)#

Bases: phoenix6.configs.parent_configurator.ParentConfigurator

  • Class for CANcoder, a CAN based magnetic encoder that provides absolute and

  • relative position along with filtered velocity.

    This handles the configurations for CANcoder

refresh(configs: SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Refreshes the values of the specified config group.

Call to refresh the selected configs from the device.

Parameters:
  • configs (name) – The configs to refresh

  • timeout_seconds (second) – Maximum amount of time to wait when performing configuration

Returns:

StatusCode of refreshing the configs

Return type:

StatusCode

apply(configs: SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Applies the contents of the specified config to the device.

Call to apply the selected configs.

Parameters:
  • configs (SupportsSerialization) – Configs to apply

  • timeout_seconds (second) – Maximum amount of time to wait when performing configuration

Returns:

StatusCode of the apply method

Return type:

StatusCode

set_position(new_value: phoenix6.units.rotation, timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Sets the current position of the device.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:
  • new_value (rotation) – Value to set to. Units are in rotations.

  • timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_faults(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear the sticky faults in the device.

This typically has no impact on the device functionality. Instead, it just clears telemetry faults that are accessible via API and Tuner Self-Test.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_hardware(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Hardware fault occurred

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_undervoltage(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Device supply voltage dropped to near brownout levels

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_boot_during_enable(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Device boot while detecting the enable signal

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_bad_magnet(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: The magnet distance is not correct or magnet is missing

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

class phoenix6.configs.Pigeon2Configuration#

Class description for the Pigeon 2 IMU sensor that measures orientation.

This handles the configurations for Pigeon2

future_proof_configs: bool = True#

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.

mount_pose: MountPoseConfigs#

Configs for Pigeon 2’s Mount Pose configuration.

These configs allow the Pigeon2 to be mounted in whatever orientation that’s desired and ensure the reported Yaw/Pitch/Roll is from the robot’s reference.

gyro_trim: GyroTrimConfigs#

Configs to trim the Pigeon2’s gyroscope.

Pigeon2 allows the user to trim the gyroscope’s sensitivity. While this isn’t necessary for the Pigeon2, as it comes calibrated out-of-the-box, users can make use of this to make the Pigeon2 even more accurate for their application.

pigeon2_features: Pigeon2FeaturesConfigs#

Configs to enable/disable various features of the Pigeon2.

These configs allow the user to enable or disable various aspects of the Pigeon2.

with_mount_pose(new_mount_pose: MountPoseConfigs) Pigeon2Configuration#

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

Configs for Pigeon 2’s Mount Pose configuration.

These configs allow the Pigeon2 to be mounted in whatever orientation that’s desired and ensure the reported Yaw/Pitch/Roll is from the robot’s reference.

Parameters:

new_mount_pose (MountPoseConfigs) – Parameter to modify

Returns:

Itself

Return type:

Pigeon2Configuration

with_gyro_trim(new_gyro_trim: GyroTrimConfigs) Pigeon2Configuration#

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

Configs to trim the Pigeon2’s gyroscope.

Pigeon2 allows the user to trim the gyroscope’s sensitivity. While this isn’t necessary for the Pigeon2, as it comes calibrated out-of-the-box, users can make use of this to make the Pigeon2 even more accurate for their application.

Parameters:

new_gyro_trim (GyroTrimConfigs) – Parameter to modify

Returns:

Itself

Return type:

Pigeon2Configuration

with_pigeon2_features(new_pigeon2_features: Pigeon2FeaturesConfigs) Pigeon2Configuration#

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

Configs to enable/disable various features of the Pigeon2.

These configs allow the user to enable or disable various aspects of the Pigeon2.

Parameters:

new_pigeon2_features (Pigeon2FeaturesConfigs) – Parameter to modify

Returns:

Itself

Return type:

Pigeon2Configuration

serialize() str#

Get the serialized form of this configuration

Returns:

Serialized form of this config group

Return type:

str

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode#

Take a string and deserialize it to this configuration

Returns:

Return code of the deserialize method

Return type:

str

class phoenix6.configs.Pigeon2Configurator(id: phoenix6.hardware.device_identifier.DeviceIdentifier)#

Bases: phoenix6.configs.parent_configurator.ParentConfigurator

  • Class description for the Pigeon 2 IMU sensor that measures orientation.

    This handles the configurations for Pigeon2

refresh(configs: SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Refreshes the values of the specified config group.

Call to refresh the selected configs from the device.

Parameters:
  • configs (name) – The configs to refresh

  • timeout_seconds (second) – Maximum amount of time to wait when performing configuration

Returns:

StatusCode of refreshing the configs

Return type:

StatusCode

apply(configs: SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Applies the contents of the specified config to the device.

Call to apply the selected configs.

Parameters:
  • configs (SupportsSerialization) – Configs to apply

  • timeout_seconds (second) – Maximum amount of time to wait when performing configuration

Returns:

StatusCode of the apply method

Return type:

StatusCode

set_yaw(new_value: phoenix6.units.degree, timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

The yaw to set the Pigeon2 to right now.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:
  • new_value (degree) – Value to set to. Units are in deg.

  • timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_faults(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear the sticky faults in the device.

This typically has no impact on the device functionality. Instead, it just clears telemetry faults that are accessible via API and Tuner Self-Test.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_hardware(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Hardware fault occurred

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_undervoltage(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Device supply voltage dropped to near brownout levels

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_boot_during_enable(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Device boot while detecting the enable signal

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_bootup_accelerometer(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Bootup checks failed: Accelerometer

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_bootup_gyroscope(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Bootup checks failed: Gyroscope

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_bootup_magnetometer(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Bootup checks failed: Magnetometer

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_boot_into_motion(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Motion Detected during bootup.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_data_acquired_late(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Motion stack data acquisition was slower than expected

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_loop_time_slow(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Motion stack loop time was slower than expected.

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_saturated_magnetometer(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Magnetometer values are saturated

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_saturated_accelerometer(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Accelerometer values are saturated

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode

clear_sticky_fault_saturated_gyroscope(timeout_seconds: phoenix6.units.second = 0.05) phoenix6.status_code.StatusCode#

Clear sticky fault: Gyroscope values are saturated

This is available in the configurator in case the user wants to initialize their device entirely without passing a device reference down to the code that performs the initialization. In this case, the user passes down the configurator object and performs all the initialization code on the object.

Parameters:

timeout_seconds (second) – Maximum time to wait up to in seconds.

Returns:

StatusCode of the set command

Return type:

StatusCode