phoenix6.configs

Submodules

Package Contents

class phoenix6.configs.SupportsSerialization

Bases: Protocol

Base class for protocol classes.

Protocol classes are defined as:

class Proto(Protocol):
    def meth(self) -> int:
        ...

Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).

For example:

class C:
    def meth(self) -> int:
        return 0

def func(x: Proto) -> int:
    return x.meth()

func(C())  # Passes static type check

See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:

class GenProto[T](Protocol):
    def meth(self) -> T:
        ...
serialize() str
deserialize(to_deserialize: str) phoenix6.status_code.StatusCode
class phoenix6.configs.MagnetSensorConfigs

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

Includes sensor direction, the sensor discontinuity point, 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: phoenix6.units.rotation = 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_discontinuity_point: phoenix6.units.rotation = 0.5

The positive discontinuity point of the absolute sensor in rotations. This determines the point at which the absolute sensor wraps around, keeping the absolute position (after offset) in the range [x-1, x).

  • Setting this to 1 makes the absolute position unsigned [0, 1)

  • Setting this to 0.5 makes the absolute position signed [-0.5, 0.5)

  • Setting this to 0 makes the absolute position always negative [-1,

Many rotational mechanisms such as arms have a region of motion that is unreachable. This should be set to the center of that region of motion, in non-negative rotations. This affects the position of the device at bootup.

For example, consider an arm which can travel from -0.2 to 0.6 rotations with a little leeway, where 0 is horizontally forward. Since -0.2 rotations has the same absolute position as 0.8 rotations, we can say that the arm typically does not travel in the range (0.6, 0.8) rotations. As a result, the discontinuity point would be the center of that range, which is 0.7 rotations. This results in an absolute sensor range of [-0.3, 0.7) rotations.

Given a total range of motion less than 1 rotation, users can calculate the discontinuity point using mean(lowerLimit, upperLimit) + 0.5. If that results in a value outside the range [0, 1], either cap the value to [0, 1], or add/subtract 1.0 rotation from your lower and upper limits of motion.

On a Talon motor controller, this is only supported when using the PulseWidth sensor source.

  • Minimum Value: 0.0

  • Maximum Value: 1.0

  • Default Value: 0.5

  • Units: rotations

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: phoenix6.units.rotation) 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 (rotation) – Parameter to modify

Returns:

Itself

Return type:

MagnetSensorConfigs

with_absolute_sensor_discontinuity_point(new_absolute_sensor_discontinuity_point: phoenix6.units.rotation) MagnetSensorConfigs

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

The positive discontinuity point of the absolute sensor in rotations. This determines the point at which the absolute sensor wraps around, keeping the absolute position (after offset) in the range [x-1, x).

  • Setting this to 1 makes the absolute position unsigned [0, 1)

  • Setting this to 0.5 makes the absolute position signed [-0.5, 0.5)

  • Setting this to 0 makes the absolute position always negative [-1,

Many rotational mechanisms such as arms have a region of motion that is unreachable. This should be set to the center of that region of motion, in non-negative rotations. This affects the position of the device at bootup.

For example, consider an arm which can travel from -0.2 to 0.6 rotations with a little leeway, where 0 is horizontally forward. Since -0.2 rotations has the same absolute position as 0.8 rotations, we can say that the arm typically does not travel in the range (0.6, 0.8) rotations. As a result, the discontinuity point would be the center of that range, which is 0.7 rotations. This results in an absolute sensor range of [-0.3, 0.7) rotations.

Given a total range of motion less than 1 rotation, users can calculate the discontinuity point using mean(lowerLimit, upperLimit) + 0.5. If that results in a value outside the range [0, 1], either cap the value to [0, 1], or add/subtract 1.0 rotation from your lower and upper limits of motion.

On a Talon motor controller, this is only supported when using the PulseWidth sensor source.

  • Minimum Value: 0.0

  • Maximum Value: 1.0

  • Default Value: 0.5

  • Units: rotations

Parameters:

new_absolute_sensor_discontinuity_point (rotation) – Parameter to modify

Returns:

Itself

Return type:

MagnetSensorConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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: phoenix6.units.degree = 0

The mounting calibration yaw-component.

  • Minimum Value: -360

  • Maximum Value: 360

  • Default Value: 0

  • Units: deg

mount_pose_pitch: phoenix6.units.degree = 0

The mounting calibration pitch-component.

  • Minimum Value: -360

  • Maximum Value: 360

  • Default Value: 0

  • Units: deg

mount_pose_roll: phoenix6.units.degree = 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: phoenix6.units.degree) 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 (degree) – Parameter to modify

Returns:

Itself

Return type:

MountPoseConfigs

with_mount_pose_pitch(new_mount_pose_pitch: phoenix6.units.degree) 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 (degree) – Parameter to modify

Returns:

Itself

Return type:

MountPoseConfigs

with_mount_pose_roll(new_mount_pose_roll: phoenix6.units.degree) 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 (degree) – Parameter to modify

Returns:

Itself

Return type:

MountPoseConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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 as seen from the front of the motor.

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

control_timesync_freq_hz: phoenix6.units.hertz = 0

When a control request UseTimesync is enabled, this determines the time-sychronized frequency at which control requests are applied.

The application of the control request will be delayed until the next timesync boundary at the frequency defined by this config. When set to 0 Hz, timesync will never be used for control requests, regardless of the value of UseTimesync.

  • Minimum Value: 50

  • Maximum Value: 500

  • Default Value: 0

  • Units: Hz

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 as seen from the front of the motor.

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

with_control_timesync_freq_hz(new_control_timesync_freq_hz: phoenix6.units.hertz) MotorOutputConfigs

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

When a control request UseTimesync is enabled, this determines the time-sychronized frequency at which control requests are applied.

The application of the control request will be delayed until the next timesync boundary at the frequency defined by this config. When set to 0 Hz, timesync will never be used for control requests, regardless of the value of UseTimesync.

  • Minimum Value: 50

  • Maximum Value: 500

  • Default Value: 0

  • Units: Hz

Parameters:

new_control_timesync_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

MotorOutputConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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: phoenix6.units.ampere = 120

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

For torque current control, this is applied in addition to the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs.

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: 120

  • Units: A

stator_current_limit_enable: bool = True

Enable motor stator current limiting.

  • Default Value: True

supply_current_limit: phoenix6.units.ampere = 70

The absolute maximum amount of supply current allowed. Note this requires SupplyCurrentLimitEnable to be true. Use SupplyCurrentLowerLimit and SupplyCurrentLowerTime to reduce the supply current limit after the time threshold is exceeded.

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 scenarios where the robot experiences brownouts despite configuring stator current limits, a supply current limit can further help avoid brownouts. However, it is important to note that such brownouts may be caused by a bad battery or poor power wiring.

A reasonable starting point for a supply current limit is 70 A with a lower limit of 40 A after 1.0 second. Supply current limits commonly range from 20-80 A depending on the breaker used.

  • Minimum Value: 0.0

  • Maximum Value: 800.0

  • Default Value: 70

  • Units: A

supply_current_limit_enable: bool = True

Enable motor supply current limiting.

  • Default Value: True

supply_current_lower_limit: phoenix6.units.ampere = 40

The amount of supply current allowed after the regular SupplyCurrentLimit is active for longer than SupplyCurrentLowerTime. This allows higher current draws for a fixed period of time before reducing the current limit to protect breakers. This has no effect if SupplyCurrentLimit is lower than this value or SupplyCurrentLowerTime is 0.

  • Minimum Value: 0.0

  • Maximum Value: 500

  • Default Value: 40

  • Units: A

supply_current_lower_time: phoenix6.units.second = 1.0

Reduces supply current to the SupplyCurrentLowerLimit after limiting to SupplyCurrentLimit for this period of time. If this is set to 0, SupplyCurrentLowerLimit will be ignored.

  • Minimum Value: 0.0

  • Maximum Value: 2.5

  • Default Value: 1.0

  • Units: seconds

with_stator_current_limit(new_stator_current_limit: phoenix6.units.ampere) 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.

For torque current control, this is applied in addition to the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs.

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: 120

  • Units: A

Parameters:

new_stator_current_limit (ampere) – 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: True

Parameters:

new_stator_current_limit_enable (bool) – Parameter to modify

Returns:

Itself

Return type:

CurrentLimitsConfigs

with_supply_current_limit(new_supply_current_limit: phoenix6.units.ampere) CurrentLimitsConfigs

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

The absolute maximum amount of supply current allowed. Note this requires SupplyCurrentLimitEnable to be true. Use SupplyCurrentLowerLimit and SupplyCurrentLowerTime to reduce the supply current limit after the time threshold is exceeded.

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 scenarios where the robot experiences brownouts despite configuring stator current limits, a supply current limit can further help avoid brownouts. However, it is important to note that such brownouts may be caused by a bad battery or poor power wiring.

A reasonable starting point for a supply current limit is 70 A with a lower limit of 40 A after 1.0 second. Supply current limits commonly range from 20-80 A depending on the breaker used.

  • Minimum Value: 0.0

  • Maximum Value: 800.0

  • Default Value: 70

  • Units: A

Parameters:

new_supply_current_limit (ampere) – 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: True

Parameters:

new_supply_current_limit_enable (bool) – Parameter to modify

Returns:

Itself

Return type:

CurrentLimitsConfigs

with_supply_current_lower_limit(new_supply_current_lower_limit: phoenix6.units.ampere) CurrentLimitsConfigs

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

The amount of supply current allowed after the regular SupplyCurrentLimit is active for longer than SupplyCurrentLowerTime. This allows higher current draws for a fixed period of time before reducing the current limit to protect breakers. This has no effect if SupplyCurrentLimit is lower than this value or SupplyCurrentLowerTime is 0.

  • Minimum Value: 0.0

  • Maximum Value: 500

  • Default Value: 40

  • Units: A

Parameters:

new_supply_current_lower_limit (ampere) – Parameter to modify

Returns:

Itself

Return type:

CurrentLimitsConfigs

with_supply_current_lower_time(new_supply_current_lower_time: phoenix6.units.second) CurrentLimitsConfigs

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

Reduces supply current to the SupplyCurrentLowerLimit after limiting to SupplyCurrentLimit for this period of time. If this is set to 0, SupplyCurrentLowerLimit will be ignored.

  • Minimum Value: 0.0

  • Maximum Value: 2.5

  • Default Value: 1.0

  • Units: seconds

Parameters:

new_supply_current_lower_time (second) – Parameter to modify

Returns:

Itself

Return type:

CurrentLimitsConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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: phoenix6.units.second = 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: seconds

peak_forward_voltage: phoenix6.units.volt = 16

Maximum (forward) output during voltage based control modes.

  • Minimum Value: -16

  • Maximum Value: 16

  • Default Value: 16

  • Units: V

peak_reverse_voltage: phoenix6.units.volt

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: phoenix6.units.second) 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: seconds

Parameters:

new_supply_voltage_time_constant (second) – Parameter to modify

Returns:

Itself

Return type:

VoltageConfigs

with_peak_forward_voltage(new_peak_forward_voltage: phoenix6.units.volt) 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 (volt) – Parameter to modify

Returns:

Itself

Return type:

VoltageConfigs

with_peak_reverse_voltage(new_peak_reverse_voltage: phoenix6.units.volt) 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 (volt) – Parameter to modify

Returns:

Itself

Return type:

VoltageConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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: phoenix6.units.ampere = 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: phoenix6.units.ampere

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

  • Minimum Value: -800

  • Maximum Value: 800

  • Default Value: -800

  • Units: A

torque_neutral_deadband: phoenix6.units.ampere = 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: phoenix6.units.ampere) 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 (ampere) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentConfigs

with_peak_reverse_torque_current(new_peak_reverse_torque_current: phoenix6.units.ampere) 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 (ampere) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentConfigs

with_torque_neutral_deadband(new_torque_neutral_deadband: phoenix6.units.ampere) 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 (ampere) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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: phoenix6.units.rotation = 0.0

The offset 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

The ratio of sensor rotations to the mechanism’s output, where a ratio greater than 1 is a reduction.

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.

We recommend against using this config to perform onboard unit conversions. Instead, unit conversions should be performed in robot code using the units library.

If this is set to zero, the 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

The ratio of motor rotor rotations to remote sensor rotations, where a ratio greater than 1 is a reduction.

The 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 motor rotor and the remote sensor.

If this is set to zero, the 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.

Choose Remote* to use another sensor on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon will update its position and velocity whenever the remote sensor publishes its information on CAN bus, and the Talon internal rotor will not be used.

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

Choose Sync* (requires Phoenix Pro) and Talon will synchronize its internal rotor position against another sensor, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID). The Talon will report if its internal position differs significantly from the reported remote sensor position. This was developed for mechanisms where there is a risk of the sensor 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 will update its position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

Note: When the feedback source is changed to Fused* or Sync*, the Talon 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 remote sensor’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:

velocity_filter_time_constant: phoenix6.units.second = 0

The configurable time constant of the Kalman velocity filter. The velocity Kalman filter will adjust to act as a low-pass with this value as its time constant.

If the user is aiming for an expected cutoff frequency, the frequency is calculated as 1 / (2 * π * τ) with τ being the time constant.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: seconds

with_feedback_rotor_offset(new_feedback_rotor_offset: phoenix6.units.rotation) FeedbackConfigs

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

The offset 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 (rotation) – 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.

The ratio of sensor rotations to the mechanism’s output, where a ratio greater than 1 is a reduction.

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.

We recommend against using this config to perform onboard unit conversions. Instead, unit conversions should be performed in robot code using the units library.

If this is set to zero, the 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.

The ratio of motor rotor rotations to remote sensor rotations, where a ratio greater than 1 is a reduction.

The 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 motor rotor and the remote sensor.

If this is set to zero, the 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.

Choose Remote* to use another sensor on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon will update its position and velocity whenever the remote sensor publishes its information on CAN bus, and the Talon internal rotor will not be used.

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

Choose Sync* (requires Phoenix Pro) and Talon will synchronize its internal rotor position against another sensor, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID). The Talon will report if its internal position differs significantly from the reported remote sensor position. This was developed for mechanisms where there is a risk of the sensor 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 will update its position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

Note: When the feedback source is changed to Fused* or Sync*, the Talon 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 remote sensor’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

with_velocity_filter_time_constant(new_velocity_filter_time_constant: phoenix6.units.second) FeedbackConfigs

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

The configurable time constant of the Kalman velocity filter. The velocity Kalman filter will adjust to act as a low-pass with this value as its time constant.

If the user is aiming for an expected cutoff frequency, the frequency is calculated as 1 / (2 * π * τ) with τ being the time constant.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: seconds

Parameters:

new_velocity_filter_time_constant (second) – Parameter to modify

Returns:

Itself

Return type:

FeedbackConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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.ExternalFeedbackConfigs

Configs that affect the external feedback sensor of this motor controller.

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

sensor_to_mechanism_ratio: float = 1.0

The ratio of sensor rotations to the mechanism’s output, where a ratio greater than 1 is a reduction.

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.

We recommend against using this config to perform onboard unit conversions. Instead, unit conversions should be performed in robot code using the units library.

If this is set to zero, the 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

The ratio of motor rotor rotations to remote sensor rotations, where a ratio greater than 1 is a reduction.

The 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 motor rotor and the remote sensor.

If this is set to zero, the device will reset back to one.

  • Minimum Value: -1000

  • Maximum Value: 1000

  • Default Value: 1.0

  • Units: scalar

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:

velocity_filter_time_constant: phoenix6.units.second = 0

The configurable time constant of the Kalman velocity filter. The velocity Kalman filter will adjust to act as a low-pass with this value as its time constant.

If the user is aiming for an expected cutoff frequency, the frequency is calculated as 1 / (2 * π * τ) with τ being the time constant.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: seconds

absolute_sensor_offset: phoenix6.units.rotation = 0.0

The offset applied to any absolute sensor connected to the Talon data port. This is only supported when using the PulseWidth sensor source.

This can be used to zero the sensor position in applications where the sensor is 1:1 with the mechanism.

  • Minimum Value: -1

  • Maximum Value: 1

  • Default Value: 0.0

  • Units: rotations

external_feedback_sensor_source: ExternalFeedbackSensorSourceValue

Choose what sensor source is reported via API and used by closed-loop and limit features. The default is Commutation, which uses the external sensor used for motor commutation.

Choose Remote* to use another sensor on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon will update its position and velocity whenever the remote sensor publishes its information on CAN bus, and the Talon commutation sensor will not be used.

Choose Fused* (requires Phoenix Pro) and Talon will fuse another sensor’s information with the commutation sensor, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID). This was developed for applications such as swerve-azimuth.

Choose Sync* (requires Phoenix Pro) and Talon will synchronize its commutation sensor position against another sensor, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID). The Talon will report if its internal position differs significantly from the reported remote sensor position. This was developed for mechanisms where there is a risk of the sensor 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 will update its position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

Choose Quadrature to use a quadrature encoder directly attached to the Talon data port. This provides velocity and relative position measurements.

Choose PulseWidth to use a pulse-width encoder directly attached to the Talon data port. This provides velocity and absolute position measurements.

Note: When the feedback source is changed to Fused* or Sync*, the Talon 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 remote sensor’s Position signal.

sensor_phase: SensorPhaseValue

The relationship between the motor controlled by a Talon and the external sensor connected to the data port. This does not affect the commutation sensor or remote sensors.

To determine the sensor phase, set this config to Aligned and drive the motor with positive output. If the reported sensor velocity is positive, then the phase is Aligned. If the reported sensor velocity is negative, then the phase is Opposed.

The sensor direction is automatically inverted along with motor invert, so the sensor phase does not need to be changed when motor invert changes.

quadrature_edges_per_rotation: int = 4096

The number of quadrature edges in one rotation for the quadrature sensor connected to the Talon data port.

This is the total number of transitions from high-to-low or low-to-high across both channels per rotation of the sensor. This is also equivalent to the Counts Per Revolution when using 4x decoding.

For example, the SRX Mag Encoder has 4096 edges per rotation, and a US Digital 1024 CPR (Cycles Per Revolution) quadrature encoder has 4096 edges per rotation.

On the Talon FXS, this can be at most 2,000,000,000 / Peak RPM.

  • Minimum Value: 1

  • Maximum Value: 1000000

  • Default Value: 4096

  • Units:

absolute_sensor_discontinuity_point: phoenix6.units.rotation = 0.5

The positive discontinuity point of the absolute sensor in rotations. This determines the point at which the absolute sensor wraps around, keeping the absolute position (after offset) in the range [x-1, x).

  • Setting this to 1 makes the absolute position unsigned [0, 1)

  • Setting this to 0.5 makes the absolute position signed [-0.5, 0.5)

  • Setting this to 0 makes the absolute position always negative [-1,

Many rotational mechanisms such as arms have a region of motion that is unreachable. This should be set to the center of that region of motion, in non-negative rotations. This affects the position of the device at bootup.

For example, consider an arm which can travel from -0.2 to 0.6 rotations with a little leeway, where 0 is horizontally forward. Since -0.2 rotations has the same absolute position as 0.8 rotations, we can say that the arm typically does not travel in the range (0.6, 0.8) rotations. As a result, the discontinuity point would be the center of that range, which is 0.7 rotations. This results in an absolute sensor range of [-0.3, 0.7) rotations.

Given a total range of motion less than 1 rotation, users can calculate the discontinuity point using mean(lowerLimit, upperLimit) + 0.5. If that results in a value outside the range [0, 1], either cap the value to [0, 1], or add/subtract 1.0 rotation from your lower and upper limits of motion.

On a Talon motor controller, this is only supported when using the PulseWidth sensor source.

  • Minimum Value: 0.0

  • Maximum Value: 1.0

  • Default Value: 0.5

  • Units: rotations

with_sensor_to_mechanism_ratio(new_sensor_to_mechanism_ratio: float) ExternalFeedbackConfigs

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

The ratio of sensor rotations to the mechanism’s output, where a ratio greater than 1 is a reduction.

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.

We recommend against using this config to perform onboard unit conversions. Instead, unit conversions should be performed in robot code using the units library.

If this is set to zero, the 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:

ExternalFeedbackConfigs

with_rotor_to_sensor_ratio(new_rotor_to_sensor_ratio: float) ExternalFeedbackConfigs

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

The ratio of motor rotor rotations to remote sensor rotations, where a ratio greater than 1 is a reduction.

The 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 motor rotor and the remote sensor.

If this is set to zero, the 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:

ExternalFeedbackConfigs

with_feedback_remote_sensor_id(new_feedback_remote_sensor_id: int) ExternalFeedbackConfigs

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:

ExternalFeedbackConfigs

with_velocity_filter_time_constant(new_velocity_filter_time_constant: phoenix6.units.second) ExternalFeedbackConfigs

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

The configurable time constant of the Kalman velocity filter. The velocity Kalman filter will adjust to act as a low-pass with this value as its time constant.

If the user is aiming for an expected cutoff frequency, the frequency is calculated as 1 / (2 * π * τ) with τ being the time constant.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: seconds

Parameters:

new_velocity_filter_time_constant (second) – Parameter to modify

Returns:

Itself

Return type:

ExternalFeedbackConfigs

with_absolute_sensor_offset(new_absolute_sensor_offset: phoenix6.units.rotation) ExternalFeedbackConfigs

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

The offset applied to any absolute sensor connected to the Talon data port. This is only supported when using the PulseWidth sensor source.

This can be used to zero the sensor position in applications where the sensor is 1:1 with the mechanism.

  • Minimum Value: -1

  • Maximum Value: 1

  • Default Value: 0.0

  • Units: rotations

Parameters:

new_absolute_sensor_offset (rotation) – Parameter to modify

Returns:

Itself

Return type:

ExternalFeedbackConfigs

with_external_feedback_sensor_source(new_external_feedback_sensor_source: ExternalFeedbackSensorSourceValue) ExternalFeedbackConfigs

Modifies this configuration’s external_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 Commutation, which uses the external sensor used for motor commutation.

Choose Remote* to use another sensor on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon will update its position and velocity whenever the remote sensor publishes its information on CAN bus, and the Talon commutation sensor will not be used.

Choose Fused* (requires Phoenix Pro) and Talon will fuse another sensor’s information with the commutation sensor, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID). This was developed for applications such as swerve-azimuth.

Choose Sync* (requires Phoenix Pro) and Talon will synchronize its commutation sensor position against another sensor, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID). The Talon will report if its internal position differs significantly from the reported remote sensor position. This was developed for mechanisms where there is a risk of the sensor 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 will update its position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

Choose Quadrature to use a quadrature encoder directly attached to the Talon data port. This provides velocity and relative position measurements.

Choose PulseWidth to use a pulse-width encoder directly attached to the Talon data port. This provides velocity and absolute position measurements.

Note: When the feedback source is changed to Fused* or Sync*, the Talon 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 remote sensor’s Position signal.

Parameters:

new_external_feedback_sensor_source (ExternalFeedbackSensorSourceValue) – Parameter to modify

Returns:

Itself

Return type:

ExternalFeedbackConfigs

with_sensor_phase(new_sensor_phase: SensorPhaseValue) ExternalFeedbackConfigs

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

The relationship between the motor controlled by a Talon and the external sensor connected to the data port. This does not affect the commutation sensor or remote sensors.

To determine the sensor phase, set this config to Aligned and drive the motor with positive output. If the reported sensor velocity is positive, then the phase is Aligned. If the reported sensor velocity is negative, then the phase is Opposed.

The sensor direction is automatically inverted along with motor invert, so the sensor phase does not need to be changed when motor invert changes.

Parameters:

new_sensor_phase (SensorPhaseValue) – Parameter to modify

Returns:

Itself

Return type:

ExternalFeedbackConfigs

with_quadrature_edges_per_rotation(new_quadrature_edges_per_rotation: int) ExternalFeedbackConfigs

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

The number of quadrature edges in one rotation for the quadrature sensor connected to the Talon data port.

This is the total number of transitions from high-to-low or low-to-high across both channels per rotation of the sensor. This is also equivalent to the Counts Per Revolution when using 4x decoding.

For example, the SRX Mag Encoder has 4096 edges per rotation, and a US Digital 1024 CPR (Cycles Per Revolution) quadrature encoder has 4096 edges per rotation.

On the Talon FXS, this can be at most 2,000,000,000 / Peak RPM.

  • Minimum Value: 1

  • Maximum Value: 1000000

  • Default Value: 4096

  • Units:

Parameters:

new_quadrature_edges_per_rotation (int) – Parameter to modify

Returns:

Itself

Return type:

ExternalFeedbackConfigs

with_absolute_sensor_discontinuity_point(new_absolute_sensor_discontinuity_point: phoenix6.units.rotation) ExternalFeedbackConfigs

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

The positive discontinuity point of the absolute sensor in rotations. This determines the point at which the absolute sensor wraps around, keeping the absolute position (after offset) in the range [x-1, x).

  • Setting this to 1 makes the absolute position unsigned [0, 1)

  • Setting this to 0.5 makes the absolute position signed [-0.5, 0.5)

  • Setting this to 0 makes the absolute position always negative [-1,

Many rotational mechanisms such as arms have a region of motion that is unreachable. This should be set to the center of that region of motion, in non-negative rotations. This affects the position of the device at bootup.

For example, consider an arm which can travel from -0.2 to 0.6 rotations with a little leeway, where 0 is horizontally forward. Since -0.2 rotations has the same absolute position as 0.8 rotations, we can say that the arm typically does not travel in the range (0.6, 0.8) rotations. As a result, the discontinuity point would be the center of that range, which is 0.7 rotations. This results in an absolute sensor range of [-0.3, 0.7) rotations.

Given a total range of motion less than 1 rotation, users can calculate the discontinuity point using mean(lowerLimit, upperLimit) + 0.5. If that results in a value outside the range [0, 1], either cap the value to [0, 1], or add/subtract 1.0 rotation from your lower and upper limits of motion.

On a Talon motor controller, this is only supported when using the PulseWidth sensor source.

  • Minimum Value: 0.0

  • Maximum Value: 1.0

  • Default Value: 0.5

  • Units: rotations

Parameters:

new_absolute_sensor_discontinuity_point (rotation) – Parameter to modify

Returns:

Itself

Return type:

ExternalFeedbackConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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: phoenix6.units.volt = 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: phoenix6.units.ampere = 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: phoenix6.units.volt) 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 (volt) – Parameter to modify

Returns:

Itself

Return type:

DifferentialConstantsConfigs

with_peak_differential_torque_current(new_peak_differential_torque_current: phoenix6.units.ampere) 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 (ampere) – Parameter to modify

Returns:

Itself

Return type:

DifferentialConstantsConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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: phoenix6.units.second = 0

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

This provides an easy way to limit the acceleration of the motor. However, the acceleration and current draw of the motor can be better restricted using current limits instead of a ramp rate.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: seconds

voltage_open_loop_ramp_period: phoenix6.units.second = 0

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

This provides an easy way to limit the acceleration of the motor. However, the acceleration and current draw of the motor can be better restricted using current limits instead of a ramp rate.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: seconds

torque_open_loop_ramp_period: phoenix6.units.second = 0

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

Since TorqueCurrent is directly proportional to acceleration, this ramp limits jerk instead of acceleration.

  • Minimum Value: 0

  • Maximum Value: 10

  • Default Value: 0

  • Units: seconds

with_duty_cycle_open_loop_ramp_period(new_duty_cycle_open_loop_ramp_period: phoenix6.units.second) 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 the open-loop DutyCycleOut control mode.

This provides an easy way to limit the acceleration of the motor. However, the acceleration and current draw of the motor can be better restricted using current limits instead of a ramp rate.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: seconds

Parameters:

new_duty_cycle_open_loop_ramp_period (second) – Parameter to modify

Returns:

Itself

Return type:

OpenLoopRampsConfigs

with_voltage_open_loop_ramp_period(new_voltage_open_loop_ramp_period: phoenix6.units.second) 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 the open-loop VoltageOut control mode.

This provides an easy way to limit the acceleration of the motor. However, the acceleration and current draw of the motor can be better restricted using current limits instead of a ramp rate.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: seconds

Parameters:

new_voltage_open_loop_ramp_period (second) – Parameter to modify

Returns:

Itself

Return type:

OpenLoopRampsConfigs

with_torque_open_loop_ramp_period(new_torque_open_loop_ramp_period: phoenix6.units.second) 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 the open-loop TorqueCurrent control mode.

Since TorqueCurrent is directly proportional to acceleration, this ramp limits jerk instead of acceleration.

  • Minimum Value: 0

  • Maximum Value: 10

  • Default Value: 0

  • Units: seconds

Parameters:

new_torque_open_loop_ramp_period (second) – Parameter to modify

Returns:

Itself

Return type:

OpenLoopRampsConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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: phoenix6.units.second = 0

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

If the goal is to limit acceleration, it is more useful to ramp the closed-loop setpoint instead of the output. This can be achieved using Motion Magic® controls.

The acceleration and current draw of the motor can also be better restricted using current limits instead of a ramp rate.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: seconds

voltage_closed_loop_ramp_period: phoenix6.units.second = 0

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

If the goal is to limit acceleration, it is more useful to ramp the closed-loop setpoint instead of the output. This can be achieved using Motion Magic® controls.

The acceleration and current draw of the motor can also be better restricted using current limits instead of a ramp rate.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: seconds

torque_closed_loop_ramp_period: phoenix6.units.second = 0

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

Since TorqueCurrent is directly proportional to acceleration, this ramp limits jerk instead of acceleration.

If the goal is to limit acceleration or jerk, it is more useful to ramp the closed-loop setpoint instead of the output. This can be achieved using Motion Magic® controls.

The acceleration and current draw of the motor can also be better restricted using current limits instead of a ramp rate.

  • Minimum Value: 0

  • Maximum Value: 10

  • Default Value: 0

  • Units: seconds

with_duty_cycle_closed_loop_ramp_period(new_duty_cycle_closed_loop_ramp_period: phoenix6.units.second) 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 the closed-loop DutyCycle control modes.

If the goal is to limit acceleration, it is more useful to ramp the closed-loop setpoint instead of the output. This can be achieved using Motion Magic® controls.

The acceleration and current draw of the motor can also be better restricted using current limits instead of a ramp rate.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: seconds

Parameters:

new_duty_cycle_closed_loop_ramp_period (second) – Parameter to modify

Returns:

Itself

Return type:

ClosedLoopRampsConfigs

with_voltage_closed_loop_ramp_period(new_voltage_closed_loop_ramp_period: phoenix6.units.second) 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 the closed-loop Voltage control modes.

If the goal is to limit acceleration, it is more useful to ramp the closed-loop setpoint instead of the output. This can be achieved using Motion Magic® controls.

The acceleration and current draw of the motor can also be better restricted using current limits instead of a ramp rate.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0

  • Units: seconds

Parameters:

new_voltage_closed_loop_ramp_period (second) – Parameter to modify

Returns:

Itself

Return type:

ClosedLoopRampsConfigs

with_torque_closed_loop_ramp_period(new_torque_closed_loop_ramp_period: phoenix6.units.second) 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 the closed-loop TorqueCurrent control modes.

Since TorqueCurrent is directly proportional to acceleration, this ramp limits jerk instead of acceleration.

If the goal is to limit acceleration or jerk, it is more useful to ramp the closed-loop setpoint instead of the output. This can be achieved using Motion Magic® controls.

The acceleration and current draw of the motor can also be better restricted using current limits instead of a ramp rate.

  • Minimum Value: 0

  • Maximum Value: 10

  • Default Value: 0

  • Units: seconds

Parameters:

new_torque_closed_loop_ramp_period (second) – Parameter to modify

Returns:

Itself

Return type:

ClosedLoopRampsConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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: phoenix6.units.rotation = 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: phoenix6.units.rotation = 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: phoenix6.units.rotation) 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 (rotation) – 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: phoenix6.units.rotation) 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 (rotation) – 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(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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: phoenix6.units.rotation = 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: phoenix6.units.rotation = 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: phoenix6.units.rotation) 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 (rotation) – Parameter to modify

Returns:

Itself

Return type:

SoftwareLimitSwitchConfigs

with_reverse_soft_limit_threshold(new_reverse_soft_limit_threshold: phoenix6.units.rotation) 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 (rotation) – Parameter to modify

Returns:

Itself

Return type:

SoftwareLimitSwitchConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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: phoenix6.units.rotations_per_second = 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: rot per sec

motion_magic_acceleration: phoenix6.units.rotations_per_second_squared = 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: phoenix6.units.rotations_per_second_cubed = 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® to generate S-Curve profiles.

Jerk is optional; 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: phoenix6.units.volts_per_rotation_per_second = 0.12

This is the target kV used only by Motion Magic® Expo control modes. Unlike the kV slot gain, this is always in units of V/rps.

This represents the amount of voltage necessary to hold a velocity. In terms of the Motion Magic® Expo profile, a higher kV results in a slower maximum velocity.

  • Minimum Value: 0.001

  • Maximum Value: 100

  • Default Value: 0.12

  • Units: V/rps

motion_magic_expo_k_a: phoenix6.units.volts_per_rotation_per_second_squared = 0.1

This is the target kA used only by Motion Magic® Expo control modes. Unlike the kA slot gain, this is always in units of V/rps².

This represents the amount of voltage necessary to achieve an acceleration. In terms of the Motion Magic® Expo profile, a higher kA results in a slower acceleration.

  • Minimum Value: 1e-05

  • Maximum Value: 100

  • Default Value: 0.1

  • Units: V/rps²

with_motion_magic_cruise_velocity(new_motion_magic_cruise_velocity: phoenix6.units.rotations_per_second) 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: rot per sec

Parameters:

new_motion_magic_cruise_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicConfigs

with_motion_magic_acceleration(new_motion_magic_acceleration: phoenix6.units.rotations_per_second_squared) 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 (rotations_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicConfigs

with_motion_magic_jerk(new_motion_magic_jerk: phoenix6.units.rotations_per_second_cubed) 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® to generate S-Curve profiles.

Jerk is optional; 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 (rotations_per_second_cubed) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicConfigs

with_motion_magic_expo_k_v(new_motion_magic_expo_k_v: phoenix6.units.volts_per_rotation_per_second) 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. Unlike the kV slot gain, this is always in units of V/rps.

This represents the amount of voltage necessary to hold a velocity. In terms of the Motion Magic® Expo profile, a higher kV results in a slower maximum velocity.

  • Minimum Value: 0.001

  • Maximum Value: 100

  • Default Value: 0.12

  • Units: V/rps

Parameters:

new_motion_magic_expo_k_v (volts_per_rotation_per_second) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicConfigs

with_motion_magic_expo_k_a(new_motion_magic_expo_k_a: phoenix6.units.volts_per_rotation_per_second_squared) 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. Unlike the kA slot gain, this is always in units of V/rps².

This represents the amount of voltage necessary to achieve an acceleration. In terms of the Motion Magic® Expo profile, a higher kA results in a slower acceleration.

  • Minimum Value: 1e-05

  • Maximum Value: 100

  • Default Value: 0.1

  • Units: V/rps²

Parameters:

new_motion_magic_expo_k_a (volts_per_rotation_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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

with_continuous_wrap(new_continuous_wrap: bool) ClosedLoopGeneralConfigs

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

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

Parameters:

new_continuous_wrap (bool) – Parameter to modify

Returns:

Itself

Return type:

ClosedLoopGeneralConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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.ToFParamsConfigs

Configs that affect the ToF sensor

Includes Update mode and frequency

update_mode: UpdateModeValue

Update mode of the CANrange. The CANrange supports short-range and long-range detection at various update frequencies.

update_frequency: phoenix6.units.hertz = 50

Rate at which the CANrange will take measurements. A lower frequency may provide more stable readings but will reduce the data rate of the sensor.

  • Minimum Value: 5

  • Maximum Value: 50

  • Default Value: 50

  • Units: Hz

with_update_mode(new_update_mode: UpdateModeValue) ToFParamsConfigs

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

Update mode of the CANrange. The CANrange supports short-range and long-range detection at various update frequencies.

Parameters:

new_update_mode (UpdateModeValue) – Parameter to modify

Returns:

Itself

Return type:

ToFParamsConfigs

with_update_frequency(new_update_frequency: phoenix6.units.hertz) ToFParamsConfigs

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

Rate at which the CANrange will take measurements. A lower frequency may provide more stable readings but will reduce the data rate of the sensor.

  • Minimum Value: 5

  • Maximum Value: 50

  • Default Value: 50

  • Units: Hz

Parameters:

new_update_frequency (hertz) – Parameter to modify

Returns:

Itself

Return type:

ToFParamsConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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.ProximityParamsConfigs

Configs that affect the ToF Proximity detection

Includes proximity mode and the threshold for simple detection

proximity_threshold: phoenix6.units.meter = 0.4

Threshold for object detection.

  • Minimum Value: 0

  • Maximum Value: 4

  • Default Value: 0.4

  • Units: m

proximity_hysteresis: phoenix6.units.meter = 0.01

How far above and below the threshold the distance needs to be to trigger undetected and detected, respectively. This is used to prevent bouncing between the detected and undetected states for objects on the threshold.

If the threshold is set to 0.1 meters, and the hysteresis is 0.01 meters, then an object needs to be within 0.09 meters to be detected. After the object is first detected, the distance then needs to exceed 0.11 meters to become undetected again.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0.01

  • Units: m

min_signal_strength_for_valid_measurement: float = 2500

The minimum allowable signal strength before determining the measurement is valid.

If the signal strength is particularly low, this typically means the object is far away and there’s fewer total samples to derive the distance from. Set this value to be below the lowest strength you see when you’re detecting an object with the CANrange; the default of 2500 is typically acceptable in most cases.

  • Minimum Value: 1

  • Maximum Value: 15000

  • Default Value: 2500

  • Units:

with_proximity_threshold(new_proximity_threshold: phoenix6.units.meter) ProximityParamsConfigs

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

Threshold for object detection.

  • Minimum Value: 0

  • Maximum Value: 4

  • Default Value: 0.4

  • Units: m

Parameters:

new_proximity_threshold (meter) – Parameter to modify

Returns:

Itself

Return type:

ProximityParamsConfigs

with_proximity_hysteresis(new_proximity_hysteresis: phoenix6.units.meter) ProximityParamsConfigs

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

How far above and below the threshold the distance needs to be to trigger undetected and detected, respectively. This is used to prevent bouncing between the detected and undetected states for objects on the threshold.

If the threshold is set to 0.1 meters, and the hysteresis is 0.01 meters, then an object needs to be within 0.09 meters to be detected. After the object is first detected, the distance then needs to exceed 0.11 meters to become undetected again.

  • Minimum Value: 0

  • Maximum Value: 1

  • Default Value: 0.01

  • Units: m

Parameters:

new_proximity_hysteresis (meter) – Parameter to modify

Returns:

Itself

Return type:

ProximityParamsConfigs

with_min_signal_strength_for_valid_measurement(new_min_signal_strength_for_valid_measurement: float) ProximityParamsConfigs

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

The minimum allowable signal strength before determining the measurement is valid.

If the signal strength is particularly low, this typically means the object is far away and there’s fewer total samples to derive the distance from. Set this value to be below the lowest strength you see when you’re detecting an object with the CANrange; the default of 2500 is typically acceptable in most cases.

  • Minimum Value: 1

  • Maximum Value: 15000

  • Default Value: 2500

  • Units:

Parameters:

new_min_signal_strength_for_valid_measurement (float) – Parameter to modify

Returns:

Itself

Return type:

ProximityParamsConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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.FovParamsConfigs

Configs that affect the ToF Field of View

Includes range and center configs

fov_center_x: phoenix6.units.degree = 0

Specifies the target center of the Field of View in the X direction.

The exact value may be different for different CANrange devices due to imperfections in the sensing silicon.

  • Minimum Value: -11.8

  • Maximum Value: 11.8

  • Default Value: 0

  • Units: deg

fov_center_y: phoenix6.units.degree = 0

Specifies the target center of the Field of View in the Y direction.

The exact value may be different for different CANrange devices due to imperfections in the sensing silicon.

  • Minimum Value: -11.8

  • Maximum Value: 11.8

  • Default Value: 0

  • Units: deg

fov_range_x: phoenix6.units.degree = 27

Specifies the target range of the Field of View in the X direction. This is the full range of the FOV.

The magnitude of this is capped to abs(27 - 2*FOVCenterX).

The exact value may be different for different CANrange devices due to imperfections in the sensing silicon.

  • Minimum Value: 6.75

  • Maximum Value: 27

  • Default Value: 27

  • Units: deg

fov_range_y: phoenix6.units.degree = 27

Specifies the target range of the Field of View in the Y direction. This is the full range of the FOV.

The magnitude of this is capped to abs(27 - 2*FOVCenterY).

The exact value may be different for different CANrange devices due to imperfections in the sensing silicon.

  • Minimum Value: 6.75

  • Maximum Value: 27

  • Default Value: 27

  • Units: deg

with_fov_center_x(new_fov_center_x: phoenix6.units.degree) FovParamsConfigs

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

Specifies the target center of the Field of View in the X direction.

The exact value may be different for different CANrange devices due to imperfections in the sensing silicon.

  • Minimum Value: -11.8

  • Maximum Value: 11.8

  • Default Value: 0

  • Units: deg

Parameters:

new_fov_center_x (degree) – Parameter to modify

Returns:

Itself

Return type:

FovParamsConfigs

with_fov_center_y(new_fov_center_y: phoenix6.units.degree) FovParamsConfigs

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

Specifies the target center of the Field of View in the Y direction.

The exact value may be different for different CANrange devices due to imperfections in the sensing silicon.

  • Minimum Value: -11.8

  • Maximum Value: 11.8

  • Default Value: 0

  • Units: deg

Parameters:

new_fov_center_y (degree) – Parameter to modify

Returns:

Itself

Return type:

FovParamsConfigs

with_fov_range_x(new_fov_range_x: phoenix6.units.degree) FovParamsConfigs

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

Specifies the target range of the Field of View in the X direction. This is the full range of the FOV.

The magnitude of this is capped to abs(27 - 2*FOVCenterX).

The exact value may be different for different CANrange devices due to imperfections in the sensing silicon.

  • Minimum Value: 6.75

  • Maximum Value: 27

  • Default Value: 27

  • Units: deg

Parameters:

new_fov_range_x (degree) – Parameter to modify

Returns:

Itself

Return type:

FovParamsConfigs

with_fov_range_y(new_fov_range_y: phoenix6.units.degree) FovParamsConfigs

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

Specifies the target range of the Field of View in the Y direction. This is the full range of the FOV.

The magnitude of this is capped to abs(27 - 2*FOVCenterY).

The exact value may be different for different CANrange devices due to imperfections in the sensing silicon.

  • Minimum Value: 6.75

  • Maximum Value: 27

  • Default Value: 27

  • Units: deg

Parameters:

new_fov_range_y (degree) – Parameter to modify

Returns:

Itself

Return type:

FovParamsConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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.CommutationConfigs

Configs that determine motor selection and commutation.

Set these configs to match your motor setup before commanding motor output.

advanced_hall_support: AdvancedHallSupportValue

Requires Phoenix Pro; Improves commutation and velocity measurement for motors with hall sensors. Talon can use advanced features to improve commutation and velocity measurement when using a motor with hall sensors. This can improve peak efficiency by as high as 2% and reduce noise in the measured velocity.

motor_arrangement: MotorArrangementValue

Selects the motor and motor connections used with Talon.

This setting determines what kind of motor and sensors are used with the Talon. This also determines what signals are used on the JST and Gadgeteer port.

Motor drive will not function correctly if this setting does not match the physical setup.

brushed_motor_wiring: BrushedMotorWiringValue

If a brushed motor is selected with Motor Arrangement, this config determines which of three leads to use.

with_advanced_hall_support(new_advanced_hall_support: AdvancedHallSupportValue) CommutationConfigs

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

Requires Phoenix Pro; Improves commutation and velocity measurement for motors with hall sensors. Talon can use advanced features to improve commutation and velocity measurement when using a motor with hall sensors. This can improve peak efficiency by as high as 2% and reduce noise in the measured velocity.

Parameters:

new_advanced_hall_support (AdvancedHallSupportValue) – Parameter to modify

Returns:

Itself

Return type:

CommutationConfigs

with_motor_arrangement(new_motor_arrangement: MotorArrangementValue) CommutationConfigs

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

Selects the motor and motor connections used with Talon.

This setting determines what kind of motor and sensors are used with the Talon. This also determines what signals are used on the JST and Gadgeteer port.

Motor drive will not function correctly if this setting does not match the physical setup.

Parameters:

new_motor_arrangement (MotorArrangementValue) – Parameter to modify

Returns:

Itself

Return type:

CommutationConfigs

with_brushed_motor_wiring(new_brushed_motor_wiring: BrushedMotorWiringValue) CommutationConfigs

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

If a brushed motor is selected with Motor Arrangement, this config determines which of three leads to use.

Parameters:

new_brushed_motor_wiring (BrushedMotorWiringValue) – Parameter to modify

Returns:

Itself

Return type:

CommutationConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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.DigitalInputsConfigs

Configs related to the CANdi™ branded device’s digital I/O settings

Contains float-state settings and when to assert the S1/S2 inputs.

s1_float_state: S1FloatStateValue

The floating state of the Signal 1 input (S1IN).

s2_float_state: S2FloatStateValue

The floating state of the Signal 2 input (S2IN).

s1_close_state: S1CloseStateValue

What value the Signal 1 input (S1IN) needs to be for the CTR Electronics’ CANdi™ to detect as Closed.

Devices using the S1 input as a remote limit switch will treat the switch as closed when the S1 input is this state.

s2_close_state: S2CloseStateValue

What value the Signal 2 input (S2IN) needs to be for the CTR Electronics’ CANdi™ to detect as Closed.

Devices using the S2 input as a remote limit switch will treat the switch as closed when the S2 input is this state.

with_s1_float_state(new_s1_float_state: S1FloatStateValue) DigitalInputsConfigs

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

The floating state of the Signal 1 input (S1IN).

Parameters:

new_s1_float_state (S1FloatStateValue) – Parameter to modify

Returns:

Itself

Return type:

DigitalInputsConfigs

with_s2_float_state(new_s2_float_state: S2FloatStateValue) DigitalInputsConfigs

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

The floating state of the Signal 2 input (S2IN).

Parameters:

new_s2_float_state (S2FloatStateValue) – Parameter to modify

Returns:

Itself

Return type:

DigitalInputsConfigs

with_s1_close_state(new_s1_close_state: S1CloseStateValue) DigitalInputsConfigs

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

What value the Signal 1 input (S1IN) needs to be for the CTR Electronics’ CANdi™ to detect as Closed.

Devices using the S1 input as a remote limit switch will treat the switch as closed when the S1 input is this state.

Parameters:

new_s1_close_state (S1CloseStateValue) – Parameter to modify

Returns:

Itself

Return type:

DigitalInputsConfigs

with_s2_close_state(new_s2_close_state: S2CloseStateValue) DigitalInputsConfigs

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

What value the Signal 2 input (S2IN) needs to be for the CTR Electronics’ CANdi™ to detect as Closed.

Devices using the S2 input as a remote limit switch will treat the switch as closed when the S2 input is this state.

Parameters:

new_s2_close_state (S2CloseStateValue) – Parameter to modify

Returns:

Itself

Return type:

DigitalInputsConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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.QuadratureConfigs

Configs related to the CANdi™ branded device’s quadrature interface using both the S1IN and S2IN inputs

All the configs related to the quadrature interface for the CANdi™ branded device , including encoder edges per revolution and sensor direction.

quadrature_edges_per_rotation: int = 4096

The number of quadrature edges in one rotation for the quadrature sensor connected to the Talon data port.

This is the total number of transitions from high-to-low or low-to-high across both channels per rotation of the sensor. This is also equivalent to the Counts Per Revolution when using 4x decoding.

For example, the SRX Mag Encoder has 4096 edges per rotation, and a US Digital 1024 CPR (Cycles Per Revolution) quadrature encoder has 4096 edges per rotation.

On the Talon FXS, this can be at most 2,000,000,000 / Peak RPM.

  • Minimum Value: 1

  • Maximum Value: 1000000

  • Default Value: 4096

  • Units:

sensor_direction: bool = False

Direction of the quadrature sensor to determine positive rotation. Invert this so that forward motion on the mechanism results in an increase in quadrature position.

  • Default Value: False

with_quadrature_edges_per_rotation(new_quadrature_edges_per_rotation: int) QuadratureConfigs

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

The number of quadrature edges in one rotation for the quadrature sensor connected to the Talon data port.

This is the total number of transitions from high-to-low or low-to-high across both channels per rotation of the sensor. This is also equivalent to the Counts Per Revolution when using 4x decoding.

For example, the SRX Mag Encoder has 4096 edges per rotation, and a US Digital 1024 CPR (Cycles Per Revolution) quadrature encoder has 4096 edges per rotation.

On the Talon FXS, this can be at most 2,000,000,000 / Peak RPM.

  • Minimum Value: 1

  • Maximum Value: 1000000

  • Default Value: 4096

  • Units:

Parameters:

new_quadrature_edges_per_rotation (int) – Parameter to modify

Returns:

Itself

Return type:

QuadratureConfigs

with_sensor_direction(new_sensor_direction: bool) QuadratureConfigs

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

Direction of the quadrature sensor to determine positive rotation. Invert this so that forward motion on the mechanism results in an increase in quadrature position.

  • Default Value: False

Parameters:

new_sensor_direction (bool) – Parameter to modify

Returns:

Itself

Return type:

QuadratureConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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.PWM1Configs

Configs related to the CANdi™ branded device’s PWM interface on the Signal 1 input (S1IN)

All the configs related to the PWM interface for the CANdi™ branded device on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction.

absolute_sensor_offset: phoenix6.units.rotation = 0.0

The offset applied to the PWM sensor.

This can be used to zero the sensor position in applications where the sensor is 1:1 with the mechanism.

  • Minimum Value: -1

  • Maximum Value: 1

  • Default Value: 0.0

  • Units: rotations

absolute_sensor_discontinuity_point: phoenix6.units.rotation = 0.5

The positive discontinuity point of the absolute sensor in rotations. This determines the point at which the absolute sensor wraps around, keeping the absolute position (after offset) in the range [x-1, x).

  • Setting this to 1 makes the absolute position unsigned [0, 1)

  • Setting this to 0.5 makes the absolute position signed [-0.5, 0.5)

  • Setting this to 0 makes the absolute position always negative [-1,

Many rotational mechanisms such as arms have a region of motion that is unreachable. This should be set to the center of that region of motion, in non-negative rotations. This affects the position of the device at bootup.

For example, consider an arm which can travel from -0.2 to 0.6 rotations with a little leeway, where 0 is horizontally forward. Since -0.2 rotations has the same absolute position as 0.8 rotations, we can say that the arm typically does not travel in the range (0.6, 0.8) rotations. As a result, the discontinuity point would be the center of that range, which is 0.7 rotations. This results in an absolute sensor range of [-0.3, 0.7) rotations.

Given a total range of motion less than 1 rotation, users can calculate the discontinuity point using mean(lowerLimit, upperLimit) + 0.5. If that results in a value outside the range [0, 1], either cap the value to [0, 1], or add/subtract 1.0 rotation from your lower and upper limits of motion.

On a Talon motor controller, this is only supported when using the PulseWidth sensor source.

  • Minimum Value: 0.0

  • Maximum Value: 1.0

  • Default Value: 0.5

  • Units: rotations

sensor_direction: bool = False

Direction of the PWM sensor to determine positive rotation. Invert this so that forward motion on the mechanism results in an increase in PWM position.

  • Default Value: False

with_absolute_sensor_offset(new_absolute_sensor_offset: phoenix6.units.rotation) PWM1Configs

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

The offset applied to the PWM sensor.

This can be used to zero the sensor position in applications where the sensor is 1:1 with the mechanism.

  • Minimum Value: -1

  • Maximum Value: 1

  • Default Value: 0.0

  • Units: rotations

Parameters:

new_absolute_sensor_offset (rotation) – Parameter to modify

Returns:

Itself

Return type:

PWM1Configs

with_absolute_sensor_discontinuity_point(new_absolute_sensor_discontinuity_point: phoenix6.units.rotation) PWM1Configs

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

The positive discontinuity point of the absolute sensor in rotations. This determines the point at which the absolute sensor wraps around, keeping the absolute position (after offset) in the range [x-1, x).

  • Setting this to 1 makes the absolute position unsigned [0, 1)

  • Setting this to 0.5 makes the absolute position signed [-0.5, 0.5)

  • Setting this to 0 makes the absolute position always negative [-1,

Many rotational mechanisms such as arms have a region of motion that is unreachable. This should be set to the center of that region of motion, in non-negative rotations. This affects the position of the device at bootup.

For example, consider an arm which can travel from -0.2 to 0.6 rotations with a little leeway, where 0 is horizontally forward. Since -0.2 rotations has the same absolute position as 0.8 rotations, we can say that the arm typically does not travel in the range (0.6, 0.8) rotations. As a result, the discontinuity point would be the center of that range, which is 0.7 rotations. This results in an absolute sensor range of [-0.3, 0.7) rotations.

Given a total range of motion less than 1 rotation, users can calculate the discontinuity point using mean(lowerLimit, upperLimit) + 0.5. If that results in a value outside the range [0, 1], either cap the value to [0, 1], or add/subtract 1.0 rotation from your lower and upper limits of motion.

On a Talon motor controller, this is only supported when using the PulseWidth sensor source.

  • Minimum Value: 0.0

  • Maximum Value: 1.0

  • Default Value: 0.5

  • Units: rotations

Parameters:

new_absolute_sensor_discontinuity_point (rotation) – Parameter to modify

Returns:

Itself

Return type:

PWM1Configs

with_sensor_direction(new_sensor_direction: bool) PWM1Configs

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

Direction of the PWM sensor to determine positive rotation. Invert this so that forward motion on the mechanism results in an increase in PWM position.

  • Default Value: False

Parameters:

new_sensor_direction (bool) – Parameter to modify

Returns:

Itself

Return type:

PWM1Configs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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.PWM2Configs

Configs related to the CANdi™ branded device’s PWM interface on the Signal 2 input (S2IN)

All the configs related to the PWM interface for the CANdi™ branded device on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction.

absolute_sensor_offset: phoenix6.units.rotation = 0.0

The offset applied to the PWM sensor.

This can be used to zero the sensor position in applications where the sensor is 1:1 with the mechanism.

  • Minimum Value: -1

  • Maximum Value: 1

  • Default Value: 0.0

  • Units: rotations

absolute_sensor_discontinuity_point: phoenix6.units.rotation = 0.5

The positive discontinuity point of the absolute sensor in rotations. This determines the point at which the absolute sensor wraps around, keeping the absolute position (after offset) in the range [x-1, x).

  • Setting this to 1 makes the absolute position unsigned [0, 1)

  • Setting this to 0.5 makes the absolute position signed [-0.5, 0.5)

  • Setting this to 0 makes the absolute position always negative [-1,

Many rotational mechanisms such as arms have a region of motion that is unreachable. This should be set to the center of that region of motion, in non-negative rotations. This affects the position of the device at bootup.

For example, consider an arm which can travel from -0.2 to 0.6 rotations with a little leeway, where 0 is horizontally forward. Since -0.2 rotations has the same absolute position as 0.8 rotations, we can say that the arm typically does not travel in the range (0.6, 0.8) rotations. As a result, the discontinuity point would be the center of that range, which is 0.7 rotations. This results in an absolute sensor range of [-0.3, 0.7) rotations.

Given a total range of motion less than 1 rotation, users can calculate the discontinuity point using mean(lowerLimit, upperLimit) + 0.5. If that results in a value outside the range [0, 1], either cap the value to [0, 1], or add/subtract 1.0 rotation from your lower and upper limits of motion.

On a Talon motor controller, this is only supported when using the PulseWidth sensor source.

  • Minimum Value: 0.0

  • Maximum Value: 1.0

  • Default Value: 0.5

  • Units: rotations

sensor_direction: bool = False

Direction of the PWM sensor to determine positive rotation. Invert this so that forward motion on the mechanism results in an increase in PWM position.

  • Default Value: False

with_absolute_sensor_offset(new_absolute_sensor_offset: phoenix6.units.rotation) PWM2Configs

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

The offset applied to the PWM sensor.

This can be used to zero the sensor position in applications where the sensor is 1:1 with the mechanism.

  • Minimum Value: -1

  • Maximum Value: 1

  • Default Value: 0.0

  • Units: rotations

Parameters:

new_absolute_sensor_offset (rotation) – Parameter to modify

Returns:

Itself

Return type:

PWM2Configs

with_absolute_sensor_discontinuity_point(new_absolute_sensor_discontinuity_point: phoenix6.units.rotation) PWM2Configs

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

The positive discontinuity point of the absolute sensor in rotations. This determines the point at which the absolute sensor wraps around, keeping the absolute position (after offset) in the range [x-1, x).

  • Setting this to 1 makes the absolute position unsigned [0, 1)

  • Setting this to 0.5 makes the absolute position signed [-0.5, 0.5)

  • Setting this to 0 makes the absolute position always negative [-1,

Many rotational mechanisms such as arms have a region of motion that is unreachable. This should be set to the center of that region of motion, in non-negative rotations. This affects the position of the device at bootup.

For example, consider an arm which can travel from -0.2 to 0.6 rotations with a little leeway, where 0 is horizontally forward. Since -0.2 rotations has the same absolute position as 0.8 rotations, we can say that the arm typically does not travel in the range (0.6, 0.8) rotations. As a result, the discontinuity point would be the center of that range, which is 0.7 rotations. This results in an absolute sensor range of [-0.3, 0.7) rotations.

Given a total range of motion less than 1 rotation, users can calculate the discontinuity point using mean(lowerLimit, upperLimit) + 0.5. If that results in a value outside the range [0, 1], either cap the value to [0, 1], or add/subtract 1.0 rotation from your lower and upper limits of motion.

On a Talon motor controller, this is only supported when using the PulseWidth sensor source.

  • Minimum Value: 0.0

  • Maximum Value: 1.0

  • Default Value: 0.5

  • Units: rotations

Parameters:

new_absolute_sensor_discontinuity_point (rotation) – Parameter to modify

Returns:

Itself

Return type:

PWM2Configs

with_sensor_direction(new_sensor_direction: bool) PWM2Configs

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

Direction of the PWM sensor to determine positive rotation. Invert this so that forward motion on the mechanism results in an increase in PWM position.

  • Default Value: False

Parameters:

new_sensor_direction (bool) – Parameter to modify

Returns:

Itself

Return type:

PWM2Configs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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.LEDConfigs

Configs related to CANdle LED control.

All the configs related to controlling LEDs with the CANdle, including LED strip type and brightness.

strip_type: StripTypeValue

The type of LEDs that are being controlled.

brightness_scalar: float = 1.0

The brightness scalar for all LEDs controlled. All LED values sent to the CANdle will be scaled by this config.

  • Minimum Value: 0.0

  • Maximum Value: 1.0

  • Default Value: 1.0

  • Units: scalar

loss_of_signal_behavior: LossOfSignalBehaviorValue

The behavior of the LEDs when the control signal is lost.

with_strip_type(new_strip_type: StripTypeValue) LEDConfigs

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

The type of LEDs that are being controlled.

Parameters:

new_strip_type (StripTypeValue) – Parameter to modify

Returns:

Itself

Return type:

LEDConfigs

with_brightness_scalar(new_brightness_scalar: float) LEDConfigs

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

The brightness scalar for all LEDs controlled. All LED values sent to the CANdle will be scaled by this config.

  • Minimum Value: 0.0

  • Maximum Value: 1.0

  • Default Value: 1.0

  • Units: scalar

Parameters:

new_brightness_scalar (float) – Parameter to modify

Returns:

Itself

Return type:

LEDConfigs

with_loss_of_signal_behavior(new_loss_of_signal_behavior: LossOfSignalBehaviorValue) LEDConfigs

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

The behavior of the LEDs when the control signal is lost.

Parameters:

new_loss_of_signal_behavior (LossOfSignalBehaviorValue) – Parameter to modify

Returns:

Itself

Return type:

LEDConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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.CANdleFeaturesConfigs

Configs related to general CANdle features.

This includes configs such as disabling the 5V rail and the behavior of VBat output.

enable5_v_rail: Enable5VRailValue

Whether the 5V rail is enabled. Disabling the 5V rail will also turn off the onboard LEDs.

v_bat_output_mode: VBatOutputModeValue

The behavior of the VBat output. CANdle supports modulating VBat output for single-color LED strips.

status_led_when_active: StatusLedWhenActiveValue

Whether the Status LED is enabled when the CANdle is actively being controlled.

with_enable5_v_rail(new_enable5_v_rail: Enable5VRailValue) CANdleFeaturesConfigs

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

Whether the 5V rail is enabled. Disabling the 5V rail will also turn off the onboard LEDs.

Parameters:

new_enable5_v_rail (Enable5VRailValue) – Parameter to modify

Returns:

Itself

Return type:

CANdleFeaturesConfigs

with_v_bat_output_mode(new_v_bat_output_mode: VBatOutputModeValue) CANdleFeaturesConfigs

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

The behavior of the VBat output. CANdle supports modulating VBat output for single-color LED strips.

Parameters:

new_v_bat_output_mode (VBatOutputModeValue) – Parameter to modify

Returns:

Itself

Return type:

CANdleFeaturesConfigs

with_status_led_when_active(new_status_led_when_active: StatusLedWhenActiveValue) CANdleFeaturesConfigs

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

Whether the Status LED is enabled when the CANdle is actively being controlled.

Parameters:

new_status_led_when_active (StatusLedWhenActiveValue) – Parameter to modify

Returns:

Itself

Return type:

CANdleFeaturesConfigs

deserialize(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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 rot per sec², which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rot per sec²).

  • 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 rot per sec², or 1/(rot per sec²).

  • 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 sign of closed loop error instead. When doing so, we recommend using 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 rot per sec², which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rot per sec²).

  • 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 rot per sec², or 1/(rot per sec²).

  • 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 sign of closed loop error instead. When doing so, we recommend using 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(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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 rot per sec², which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rot per sec²).

  • 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 rot per sec², or 1/(rot per sec²).

  • 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 using 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 rot per sec², which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rot per sec²).

  • 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 rot per sec², or 1/(rot per sec²).

  • 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 using 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(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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 rot per sec², which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rot per sec²).

  • 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 rot per sec², or 1/(rot per sec²).

  • 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 using 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 rot per sec², which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rot per sec²).

  • 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 rot per sec², or 1/(rot per sec²).

  • 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 using 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(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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 rot per sec², which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rot per sec²).

  • 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 rot per sec², or 1/(rot per sec²).

  • 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 sign of closed loop error instead. When doing so, we recommend using 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 rot per sec², which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rot per sec²).

  • 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 rot per sec², or 1/(rot per sec²).

  • 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 sign of closed loop error instead. When doing so, we recommend using 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(to_deserialize: str) phoenix6.status_code.StatusCode

Deserialize string and put values into this object

Parameters:

to_deserialize (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.

Parameter list:

  • MotorOutputConfigs.inverted

  • MotorOutputConfigs.neutral_mode

  • MotorOutputConfigs.duty_cycle_neutral_deadband

  • MotorOutputConfigs.peak_forward_duty_cycle

  • MotorOutputConfigs.peak_reverse_duty_cycle

  • MotorOutputConfigs.control_timesync_freq_hz

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.

Parameter list:

  • CurrentLimitsConfigs.stator_current_limit

  • CurrentLimitsConfigs.stator_current_limit_enable

  • CurrentLimitsConfigs.supply_current_limit

  • CurrentLimitsConfigs.supply_current_limit_enable

  • CurrentLimitsConfigs.supply_current_lower_limit

  • CurrentLimitsConfigs.supply_current_lower_time

voltage: phoenix6.configs.config_groups.VoltageConfigs

Configs that affect Voltage control types.

Includes peak output voltages and other configs affecting voltage measurements.

Parameter list:

  • VoltageConfigs.supply_voltage_time_constant

  • VoltageConfigs.peak_forward_voltage

  • VoltageConfigs.peak_reverse_voltage

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.

Parameter list:

  • TorqueCurrentConfigs.peak_forward_torque_current

  • TorqueCurrentConfigs.peak_reverse_torque_current

  • TorqueCurrentConfigs.torque_neutral_deadband

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.

Parameter list:

  • FeedbackConfigs.feedback_rotor_offset

  • FeedbackConfigs.sensor_to_mechanism_ratio

  • FeedbackConfigs.rotor_to_sensor_ratio

  • FeedbackConfigs.feedback_sensor_source

  • FeedbackConfigs.feedback_remote_sensor_id

  • FeedbackConfigs.velocity_filter_time_constant

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.

Parameter list:

  • DifferentialSensorsConfigs.differential_sensor_source

  • DifferentialSensorsConfigs.differential_talon_fx_sensor_id

  • DifferentialSensorsConfigs.differential_remote_sensor_id

differential_constants: phoenix6.configs.config_groups.DifferentialConstantsConfigs

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

Includes the differential peak outputs.

Parameter list:

  • DifferentialConstantsConfigs.peak_differential_duty_cycle

  • DifferentialConstantsConfigs.peak_differential_voltage

  • DifferentialConstantsConfigs.peak_differential_torque_current

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.

Parameter list:

  • OpenLoopRampsConfigs.duty_cycle_open_loop_ramp_period

  • OpenLoopRampsConfigs.voltage_open_loop_ramp_period

  • OpenLoopRampsConfigs.torque_open_loop_ramp_period

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.

Parameter list:

  • ClosedLoopRampsConfigs.duty_cycle_closed_loop_ramp_period

  • ClosedLoopRampsConfigs.voltage_closed_loop_ramp_period

  • ClosedLoopRampsConfigs.torque_closed_loop_ramp_period

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.

Parameter list:

  • HardwareLimitSwitchConfigs.forward_limit_type

  • HardwareLimitSwitchConfigs.forward_limit_autoset_position_enable

  • HardwareLimitSwitchConfigs.forward_limit_autoset_position_value

  • HardwareLimitSwitchConfigs.forward_limit_enable

  • HardwareLimitSwitchConfigs.forward_limit_source

  • HardwareLimitSwitchConfigs.forward_limit_remote_sensor_id

  • HardwareLimitSwitchConfigs.reverse_limit_type

  • HardwareLimitSwitchConfigs.reverse_limit_autoset_position_enable

  • HardwareLimitSwitchConfigs.reverse_limit_autoset_position_value

  • HardwareLimitSwitchConfigs.reverse_limit_enable

  • HardwareLimitSwitchConfigs.reverse_limit_source

  • HardwareLimitSwitchConfigs.reverse_limit_remote_sensor_id

audio: phoenix6.configs.config_groups.AudioConfigs

Configs that affect audible components of the device.

Includes configuration for the beep on boot.

Parameter list:

  • AudioConfigs.beep_on_boot

  • AudioConfigs.beep_on_config

  • AudioConfigs.allow_music_dur_disable

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.

Parameter list:

  • SoftwareLimitSwitchConfigs.forward_soft_limit_enable

  • SoftwareLimitSwitchConfigs.reverse_soft_limit_enable

  • SoftwareLimitSwitchConfigs.forward_soft_limit_threshold

  • SoftwareLimitSwitchConfigs.reverse_soft_limit_threshold

motion_magic: phoenix6.configs.config_groups.MotionMagicConfigs

Configs for Motion Magic®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.

Parameter list:

  • MotionMagicConfigs.motion_magic_cruise_velocity

  • MotionMagicConfigs.motion_magic_acceleration

  • MotionMagicConfigs.motion_magic_jerk

  • MotionMagicConfigs.motion_magic_expo_k_v

  • MotionMagicConfigs.motion_magic_expo_k_a

custom_params: phoenix6.configs.config_groups.CustomParamsConfigs

Custom Params.

Custom paramaters that have no real impact on controller.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

closed_loop_general: phoenix6.configs.config_groups.ClosedLoopGeneralConfigs

Configs that affect general behavior during closed-looping.

Includes Continuous Wrap features.

Parameter list:

  • ClosedLoopGeneralConfigs.continuous_wrap

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.

Parameter list:

  • Slot0Configs.k_p

  • Slot0Configs.k_i

  • Slot0Configs.k_d

  • Slot0Configs.k_s

  • Slot0Configs.k_v

  • Slot0Configs.k_a

  • Slot0Configs.k_g

  • Slot0Configs.gravity_type

  • Slot0Configs.static_feedforward_sign

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.

Parameter list:

  • Slot1Configs.k_p

  • Slot1Configs.k_i

  • Slot1Configs.k_d

  • Slot1Configs.k_s

  • Slot1Configs.k_v

  • Slot1Configs.k_a

  • Slot1Configs.k_g

  • Slot1Configs.gravity_type

  • Slot1Configs.static_feedforward_sign

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.

Parameter list:

  • Slot2Configs.k_p

  • Slot2Configs.k_i

  • Slot2Configs.k_d

  • Slot2Configs.k_s

  • Slot2Configs.k_v

  • Slot2Configs.k_a

  • Slot2Configs.k_g

  • Slot2Configs.gravity_type

  • Slot2Configs.static_feedforward_sign

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.

Parameter list:

  • MotorOutputConfigs.inverted

  • MotorOutputConfigs.neutral_mode

  • MotorOutputConfigs.duty_cycle_neutral_deadband

  • MotorOutputConfigs.peak_forward_duty_cycle

  • MotorOutputConfigs.peak_reverse_duty_cycle

  • MotorOutputConfigs.control_timesync_freq_hz

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.

Parameter list:

  • CurrentLimitsConfigs.stator_current_limit

  • CurrentLimitsConfigs.stator_current_limit_enable

  • CurrentLimitsConfigs.supply_current_limit

  • CurrentLimitsConfigs.supply_current_limit_enable

  • CurrentLimitsConfigs.supply_current_lower_limit

  • CurrentLimitsConfigs.supply_current_lower_time

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.

Parameter list:

  • VoltageConfigs.supply_voltage_time_constant

  • VoltageConfigs.peak_forward_voltage

  • VoltageConfigs.peak_reverse_voltage

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.

Parameter list:

  • TorqueCurrentConfigs.peak_forward_torque_current

  • TorqueCurrentConfigs.peak_reverse_torque_current

  • TorqueCurrentConfigs.torque_neutral_deadband

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.

Parameter list:

  • FeedbackConfigs.feedback_rotor_offset

  • FeedbackConfigs.sensor_to_mechanism_ratio

  • FeedbackConfigs.rotor_to_sensor_ratio

  • FeedbackConfigs.feedback_sensor_source

  • FeedbackConfigs.feedback_remote_sensor_id

  • FeedbackConfigs.velocity_filter_time_constant

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.

Parameter list:

  • DifferentialSensorsConfigs.differential_sensor_source

  • DifferentialSensorsConfigs.differential_talon_fx_sensor_id

  • DifferentialSensorsConfigs.differential_remote_sensor_id

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.

Parameter list:

  • DifferentialConstantsConfigs.peak_differential_duty_cycle

  • DifferentialConstantsConfigs.peak_differential_voltage

  • DifferentialConstantsConfigs.peak_differential_torque_current

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.

Parameter list:

  • OpenLoopRampsConfigs.duty_cycle_open_loop_ramp_period

  • OpenLoopRampsConfigs.voltage_open_loop_ramp_period

  • OpenLoopRampsConfigs.torque_open_loop_ramp_period

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.

Parameter list:

  • ClosedLoopRampsConfigs.duty_cycle_closed_loop_ramp_period

  • ClosedLoopRampsConfigs.voltage_closed_loop_ramp_period

  • ClosedLoopRampsConfigs.torque_closed_loop_ramp_period

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.

Parameter list:

  • HardwareLimitSwitchConfigs.forward_limit_type

  • HardwareLimitSwitchConfigs.forward_limit_autoset_position_enable

  • HardwareLimitSwitchConfigs.forward_limit_autoset_position_value

  • HardwareLimitSwitchConfigs.forward_limit_enable

  • HardwareLimitSwitchConfigs.forward_limit_source

  • HardwareLimitSwitchConfigs.forward_limit_remote_sensor_id

  • HardwareLimitSwitchConfigs.reverse_limit_type

  • HardwareLimitSwitchConfigs.reverse_limit_autoset_position_enable

  • HardwareLimitSwitchConfigs.reverse_limit_autoset_position_value

  • HardwareLimitSwitchConfigs.reverse_limit_enable

  • HardwareLimitSwitchConfigs.reverse_limit_source

  • HardwareLimitSwitchConfigs.reverse_limit_remote_sensor_id

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.

Parameter list:

  • AudioConfigs.beep_on_boot

  • AudioConfigs.beep_on_config

  • AudioConfigs.allow_music_dur_disable

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.

Parameter list:

  • SoftwareLimitSwitchConfigs.forward_soft_limit_enable

  • SoftwareLimitSwitchConfigs.reverse_soft_limit_enable

  • SoftwareLimitSwitchConfigs.forward_soft_limit_threshold

  • SoftwareLimitSwitchConfigs.reverse_soft_limit_threshold

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.

Parameter list:

  • MotionMagicConfigs.motion_magic_cruise_velocity

  • MotionMagicConfigs.motion_magic_acceleration

  • MotionMagicConfigs.motion_magic_jerk

  • MotionMagicConfigs.motion_magic_expo_k_v

  • MotionMagicConfigs.motion_magic_expo_k_a

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.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

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.

Parameter list:

  • ClosedLoopGeneralConfigs.continuous_wrap

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.

Parameter list:

  • Slot0Configs.k_p

  • Slot0Configs.k_i

  • Slot0Configs.k_d

  • Slot0Configs.k_s

  • Slot0Configs.k_v

  • Slot0Configs.k_a

  • Slot0Configs.k_g

  • Slot0Configs.gravity_type

  • Slot0Configs.static_feedforward_sign

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.

Parameter list:

  • Slot1Configs.k_p

  • Slot1Configs.k_i

  • Slot1Configs.k_d

  • Slot1Configs.k_s

  • Slot1Configs.k_v

  • Slot1Configs.k_a

  • Slot1Configs.k_g

  • Slot1Configs.gravity_type

  • Slot1Configs.static_feedforward_sign

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.

Parameter list:

  • Slot2Configs.k_p

  • Slot2Configs.k_i

  • Slot2Configs.k_d

  • Slot2Configs.k_s

  • Slot2Configs.k_v

  • Slot2Configs.k_a

  • Slot2Configs.k_g

  • Slot2Configs.gravity_type

  • Slot2Configs.static_feedforward_sign

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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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_unlicensed_feature_in_use(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: An unlicensed feature is in use, device may not behave as 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_bridge_brownout(timeout_seconds: phoenix6.units.second = 0.1) 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.1) 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.1) phoenix6.status_code.StatusCode

Clear sticky fault: The remote Talon 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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_missing_soft_limit_remote(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: The remote soft limit device 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_missing_hard_limit_remote(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: The remote limit switch device 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_data_invalid(timeout_seconds: phoenix6.units.second = 0.1) 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.1) 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.1) 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.1) 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

clear_sticky_fault_using_fused_cancoder_while_unlicensed(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: Using Fused CANcoder feature while unlicensed. Device has fallen back to remote CANcoder.

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_static_brake_disabled(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: Static brake was momentarily disabled due to excessive braking current while disabled.

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 direction, the sensor discontinuity point, and the magnet offset.

Parameter list:

  • MagnetSensorConfigs.sensor_direction

  • MagnetSensorConfigs.magnet_offset

  • MagnetSensorConfigs.absolute_sensor_discontinuity_point

custom_params: CustomParamsConfigs

Custom Params.

Custom paramaters that have no real impact on controller.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

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 direction, the sensor discontinuity point, and the magnet offset.

Parameter list:

  • MagnetSensorConfigs.sensor_direction

  • MagnetSensorConfigs.magnet_offset

  • MagnetSensorConfigs.absolute_sensor_discontinuity_point

Parameters:

new_magnet_sensor (MagnetSensorConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANcoderConfiguration

with_custom_params(new_custom_params: CustomParamsConfigs) CANcoderConfiguration

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.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

Parameters:

new_custom_params (CustomParamsConfigs) – 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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_unlicensed_feature_in_use(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: An unlicensed feature is in use, device may not behave as 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_bad_magnet(timeout_seconds: phoenix6.units.second = 0.1) 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: phoenix6.configs.config_groups.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.

Parameter list:

  • MountPoseConfigs.mount_pose_yaw

  • MountPoseConfigs.mount_pose_pitch

  • MountPoseConfigs.mount_pose_roll

gyro_trim: phoenix6.configs.config_groups.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.

Parameter list:

  • GyroTrimConfigs.gyro_scalar_x

  • GyroTrimConfigs.gyro_scalar_y

  • GyroTrimConfigs.gyro_scalar_z

pigeon2_features: phoenix6.configs.config_groups.Pigeon2FeaturesConfigs

Configs to enable/disable various features of the Pigeon2.

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

Parameter list:

  • Pigeon2FeaturesConfigs.enable_compass

  • Pigeon2FeaturesConfigs.disable_temperature_compensation

  • Pigeon2FeaturesConfigs.disable_no_motion_calibration

custom_params: phoenix6.configs.config_groups.CustomParamsConfigs

Custom Params.

Custom paramaters that have no real impact on controller.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

with_mount_pose(new_mount_pose: phoenix6.configs.config_groups.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.

Parameter list:

  • MountPoseConfigs.mount_pose_yaw

  • MountPoseConfigs.mount_pose_pitch

  • MountPoseConfigs.mount_pose_roll

Parameters:

new_mount_pose (MountPoseConfigs) – Parameter to modify

Returns:

Itself

Return type:

Pigeon2Configuration

with_gyro_trim(new_gyro_trim: phoenix6.configs.config_groups.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.

Parameter list:

  • GyroTrimConfigs.gyro_scalar_x

  • GyroTrimConfigs.gyro_scalar_y

  • GyroTrimConfigs.gyro_scalar_z

Parameters:

new_gyro_trim (GyroTrimConfigs) – Parameter to modify

Returns:

Itself

Return type:

Pigeon2Configuration

with_pigeon2_features(new_pigeon2_features: phoenix6.configs.config_groups.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.

Parameter list:

  • Pigeon2FeaturesConfigs.enable_compass

  • Pigeon2FeaturesConfigs.disable_temperature_compensation

  • Pigeon2FeaturesConfigs.disable_no_motion_calibration

Parameters:

new_pigeon2_features (Pigeon2FeaturesConfigs) – Parameter to modify

Returns:

Itself

Return type:

Pigeon2Configuration

with_custom_params(new_custom_params: phoenix6.configs.config_groups.CustomParamsConfigs) Pigeon2Configuration

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.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

Parameters:

new_custom_params (CustomParamsConfigs) – 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: phoenix6.configs.config_groups.SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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_unlicensed_feature_in_use(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: An unlicensed feature is in use, device may not behave as 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_bootup_accelerometer(timeout_seconds: phoenix6.units.second = 0.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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

class phoenix6.configs.TalonFXSConfiguration

Class description for the Talon FXS motor controller.

This handles the configurations for TalonFXS

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.

Parameter list:

  • MotorOutputConfigs.inverted

  • MotorOutputConfigs.neutral_mode

  • MotorOutputConfigs.duty_cycle_neutral_deadband

  • MotorOutputConfigs.peak_forward_duty_cycle

  • MotorOutputConfigs.peak_reverse_duty_cycle

  • MotorOutputConfigs.control_timesync_freq_hz

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.

Parameter list:

  • CurrentLimitsConfigs.stator_current_limit

  • CurrentLimitsConfigs.stator_current_limit_enable

  • CurrentLimitsConfigs.supply_current_limit

  • CurrentLimitsConfigs.supply_current_limit_enable

  • CurrentLimitsConfigs.supply_current_lower_limit

  • CurrentLimitsConfigs.supply_current_lower_time

voltage: phoenix6.configs.config_groups.VoltageConfigs

Configs that affect Voltage control types.

Includes peak output voltages and other configs affecting voltage measurements.

Parameter list:

  • VoltageConfigs.supply_voltage_time_constant

  • VoltageConfigs.peak_forward_voltage

  • VoltageConfigs.peak_reverse_voltage

external_feedback: phoenix6.configs.config_groups.ExternalFeedbackConfigs

Configs that affect the external feedback sensor of this motor controller.

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

Parameter list:

  • ExternalFeedbackConfigs.sensor_to_mechanism_ratio

  • ExternalFeedbackConfigs.rotor_to_sensor_ratio

  • ExternalFeedbackConfigs.feedback_remote_sensor_id

  • ExternalFeedbackConfigs.velocity_filter_time_constant

  • ExternalFeedbackConfigs.absolute_sensor_offset

  • ExternalFeedbackConfigs.external_feedback_sensor_source

  • ExternalFeedbackConfigs.sensor_phase

  • ExternalFeedbackConfigs.quadrature_edges_per_rotation

  • ExternalFeedbackConfigs.absolute_sensor_discontinuity_point

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.

Parameter list:

  • DifferentialSensorsConfigs.differential_sensor_source

  • DifferentialSensorsConfigs.differential_talon_fx_sensor_id

  • DifferentialSensorsConfigs.differential_remote_sensor_id

differential_constants: phoenix6.configs.config_groups.DifferentialConstantsConfigs

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

Includes the differential peak outputs.

Parameter list:

  • DifferentialConstantsConfigs.peak_differential_duty_cycle

  • DifferentialConstantsConfigs.peak_differential_voltage

  • DifferentialConstantsConfigs.peak_differential_torque_current

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.

Parameter list:

  • OpenLoopRampsConfigs.duty_cycle_open_loop_ramp_period

  • OpenLoopRampsConfigs.voltage_open_loop_ramp_period

  • OpenLoopRampsConfigs.torque_open_loop_ramp_period

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.

Parameter list:

  • ClosedLoopRampsConfigs.duty_cycle_closed_loop_ramp_period

  • ClosedLoopRampsConfigs.voltage_closed_loop_ramp_period

  • ClosedLoopRampsConfigs.torque_closed_loop_ramp_period

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.

Parameter list:

  • HardwareLimitSwitchConfigs.forward_limit_type

  • HardwareLimitSwitchConfigs.forward_limit_autoset_position_enable

  • HardwareLimitSwitchConfigs.forward_limit_autoset_position_value

  • HardwareLimitSwitchConfigs.forward_limit_enable

  • HardwareLimitSwitchConfigs.forward_limit_source

  • HardwareLimitSwitchConfigs.forward_limit_remote_sensor_id

  • HardwareLimitSwitchConfigs.reverse_limit_type

  • HardwareLimitSwitchConfigs.reverse_limit_autoset_position_enable

  • HardwareLimitSwitchConfigs.reverse_limit_autoset_position_value

  • HardwareLimitSwitchConfigs.reverse_limit_enable

  • HardwareLimitSwitchConfigs.reverse_limit_source

  • HardwareLimitSwitchConfigs.reverse_limit_remote_sensor_id

audio: phoenix6.configs.config_groups.AudioConfigs

Configs that affect audible components of the device.

Includes configuration for the beep on boot.

Parameter list:

  • AudioConfigs.beep_on_boot

  • AudioConfigs.beep_on_config

  • AudioConfigs.allow_music_dur_disable

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.

Parameter list:

  • SoftwareLimitSwitchConfigs.forward_soft_limit_enable

  • SoftwareLimitSwitchConfigs.reverse_soft_limit_enable

  • SoftwareLimitSwitchConfigs.forward_soft_limit_threshold

  • SoftwareLimitSwitchConfigs.reverse_soft_limit_threshold

motion_magic: phoenix6.configs.config_groups.MotionMagicConfigs

Configs for Motion Magic®.

Includes Velocity, Acceleration, Jerk, and Expo parameters.

Parameter list:

  • MotionMagicConfigs.motion_magic_cruise_velocity

  • MotionMagicConfigs.motion_magic_acceleration

  • MotionMagicConfigs.motion_magic_jerk

  • MotionMagicConfigs.motion_magic_expo_k_v

  • MotionMagicConfigs.motion_magic_expo_k_a

custom_params: phoenix6.configs.config_groups.CustomParamsConfigs

Custom Params.

Custom paramaters that have no real impact on controller.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

closed_loop_general: phoenix6.configs.config_groups.ClosedLoopGeneralConfigs

Configs that affect general behavior during closed-looping.

Includes Continuous Wrap features.

Parameter list:

  • ClosedLoopGeneralConfigs.continuous_wrap

commutation: phoenix6.configs.config_groups.CommutationConfigs

Configs that determine motor selection and commutation.

Set these configs to match your motor setup before commanding motor output.

Parameter list:

  • CommutationConfigs.advanced_hall_support

  • CommutationConfigs.motor_arrangement

  • CommutationConfigs.brushed_motor_wiring

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.

Parameter list:

  • Slot0Configs.k_p

  • Slot0Configs.k_i

  • Slot0Configs.k_d

  • Slot0Configs.k_s

  • Slot0Configs.k_v

  • Slot0Configs.k_a

  • Slot0Configs.k_g

  • Slot0Configs.gravity_type

  • Slot0Configs.static_feedforward_sign

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.

Parameter list:

  • Slot1Configs.k_p

  • Slot1Configs.k_i

  • Slot1Configs.k_d

  • Slot1Configs.k_s

  • Slot1Configs.k_v

  • Slot1Configs.k_a

  • Slot1Configs.k_g

  • Slot1Configs.gravity_type

  • Slot1Configs.static_feedforward_sign

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.

Parameter list:

  • Slot2Configs.k_p

  • Slot2Configs.k_i

  • Slot2Configs.k_d

  • Slot2Configs.k_s

  • Slot2Configs.k_v

  • Slot2Configs.k_a

  • Slot2Configs.k_g

  • Slot2Configs.gravity_type

  • Slot2Configs.static_feedforward_sign

with_motor_output(new_motor_output: phoenix6.configs.config_groups.MotorOutputConfigs) TalonFXSConfiguration

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.

Parameter list:

  • MotorOutputConfigs.inverted

  • MotorOutputConfigs.neutral_mode

  • MotorOutputConfigs.duty_cycle_neutral_deadband

  • MotorOutputConfigs.peak_forward_duty_cycle

  • MotorOutputConfigs.peak_reverse_duty_cycle

  • MotorOutputConfigs.control_timesync_freq_hz

Parameters:

new_motor_output (MotorOutputConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_current_limits(new_current_limits: phoenix6.configs.config_groups.CurrentLimitsConfigs) TalonFXSConfiguration

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.

Parameter list:

  • CurrentLimitsConfigs.stator_current_limit

  • CurrentLimitsConfigs.stator_current_limit_enable

  • CurrentLimitsConfigs.supply_current_limit

  • CurrentLimitsConfigs.supply_current_limit_enable

  • CurrentLimitsConfigs.supply_current_lower_limit

  • CurrentLimitsConfigs.supply_current_lower_time

Parameters:

new_current_limits (CurrentLimitsConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_voltage(new_voltage: phoenix6.configs.config_groups.VoltageConfigs) TalonFXSConfiguration

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

Configs that affect Voltage control types.

Includes peak output voltages and other configs affecting voltage measurements.

Parameter list:

  • VoltageConfigs.supply_voltage_time_constant

  • VoltageConfigs.peak_forward_voltage

  • VoltageConfigs.peak_reverse_voltage

Parameters:

new_voltage (VoltageConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_external_feedback(new_external_feedback: phoenix6.configs.config_groups.ExternalFeedbackConfigs) TalonFXSConfiguration

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

Configs that affect the external feedback sensor of this motor controller.

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

Parameter list:

  • ExternalFeedbackConfigs.sensor_to_mechanism_ratio

  • ExternalFeedbackConfigs.rotor_to_sensor_ratio

  • ExternalFeedbackConfigs.feedback_remote_sensor_id

  • ExternalFeedbackConfigs.velocity_filter_time_constant

  • ExternalFeedbackConfigs.absolute_sensor_offset

  • ExternalFeedbackConfigs.external_feedback_sensor_source

  • ExternalFeedbackConfigs.sensor_phase

  • ExternalFeedbackConfigs.quadrature_edges_per_rotation

  • ExternalFeedbackConfigs.absolute_sensor_discontinuity_point

Parameters:

new_external_feedback (ExternalFeedbackConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_differential_sensors(new_differential_sensors: phoenix6.configs.config_groups.DifferentialSensorsConfigs) TalonFXSConfiguration

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.

Parameter list:

  • DifferentialSensorsConfigs.differential_sensor_source

  • DifferentialSensorsConfigs.differential_talon_fx_sensor_id

  • DifferentialSensorsConfigs.differential_remote_sensor_id

Parameters:

new_differential_sensors (DifferentialSensorsConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_differential_constants(new_differential_constants: phoenix6.configs.config_groups.DifferentialConstantsConfigs) TalonFXSConfiguration

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.

Parameter list:

  • DifferentialConstantsConfigs.peak_differential_duty_cycle

  • DifferentialConstantsConfigs.peak_differential_voltage

  • DifferentialConstantsConfigs.peak_differential_torque_current

Parameters:

new_differential_constants (DifferentialConstantsConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_open_loop_ramps(new_open_loop_ramps: phoenix6.configs.config_groups.OpenLoopRampsConfigs) TalonFXSConfiguration

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.

Parameter list:

  • OpenLoopRampsConfigs.duty_cycle_open_loop_ramp_period

  • OpenLoopRampsConfigs.voltage_open_loop_ramp_period

  • OpenLoopRampsConfigs.torque_open_loop_ramp_period

Parameters:

new_open_loop_ramps (OpenLoopRampsConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_closed_loop_ramps(new_closed_loop_ramps: phoenix6.configs.config_groups.ClosedLoopRampsConfigs) TalonFXSConfiguration

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.

Parameter list:

  • ClosedLoopRampsConfigs.duty_cycle_closed_loop_ramp_period

  • ClosedLoopRampsConfigs.voltage_closed_loop_ramp_period

  • ClosedLoopRampsConfigs.torque_closed_loop_ramp_period

Parameters:

new_closed_loop_ramps (ClosedLoopRampsConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_hardware_limit_switch(new_hardware_limit_switch: phoenix6.configs.config_groups.HardwareLimitSwitchConfigs) TalonFXSConfiguration

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.

Parameter list:

  • HardwareLimitSwitchConfigs.forward_limit_type

  • HardwareLimitSwitchConfigs.forward_limit_autoset_position_enable

  • HardwareLimitSwitchConfigs.forward_limit_autoset_position_value

  • HardwareLimitSwitchConfigs.forward_limit_enable

  • HardwareLimitSwitchConfigs.forward_limit_source

  • HardwareLimitSwitchConfigs.forward_limit_remote_sensor_id

  • HardwareLimitSwitchConfigs.reverse_limit_type

  • HardwareLimitSwitchConfigs.reverse_limit_autoset_position_enable

  • HardwareLimitSwitchConfigs.reverse_limit_autoset_position_value

  • HardwareLimitSwitchConfigs.reverse_limit_enable

  • HardwareLimitSwitchConfigs.reverse_limit_source

  • HardwareLimitSwitchConfigs.reverse_limit_remote_sensor_id

Parameters:

new_hardware_limit_switch (HardwareLimitSwitchConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_audio(new_audio: phoenix6.configs.config_groups.AudioConfigs) TalonFXSConfiguration

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

Configs that affect audible components of the device.

Includes configuration for the beep on boot.

Parameter list:

  • AudioConfigs.beep_on_boot

  • AudioConfigs.beep_on_config

  • AudioConfigs.allow_music_dur_disable

Parameters:

new_audio (AudioConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_software_limit_switch(new_software_limit_switch: phoenix6.configs.config_groups.SoftwareLimitSwitchConfigs) TalonFXSConfiguration

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.

Parameter list:

  • SoftwareLimitSwitchConfigs.forward_soft_limit_enable

  • SoftwareLimitSwitchConfigs.reverse_soft_limit_enable

  • SoftwareLimitSwitchConfigs.forward_soft_limit_threshold

  • SoftwareLimitSwitchConfigs.reverse_soft_limit_threshold

Parameters:

new_software_limit_switch (SoftwareLimitSwitchConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_motion_magic(new_motion_magic: phoenix6.configs.config_groups.MotionMagicConfigs) TalonFXSConfiguration

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.

Parameter list:

  • MotionMagicConfigs.motion_magic_cruise_velocity

  • MotionMagicConfigs.motion_magic_acceleration

  • MotionMagicConfigs.motion_magic_jerk

  • MotionMagicConfigs.motion_magic_expo_k_v

  • MotionMagicConfigs.motion_magic_expo_k_a

Parameters:

new_motion_magic (MotionMagicConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_custom_params(new_custom_params: phoenix6.configs.config_groups.CustomParamsConfigs) TalonFXSConfiguration

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.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

Parameters:

new_custom_params (CustomParamsConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_closed_loop_general(new_closed_loop_general: phoenix6.configs.config_groups.ClosedLoopGeneralConfigs) TalonFXSConfiguration

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.

Parameter list:

  • ClosedLoopGeneralConfigs.continuous_wrap

Parameters:

new_closed_loop_general (ClosedLoopGeneralConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_commutation(new_commutation: phoenix6.configs.config_groups.CommutationConfigs) TalonFXSConfiguration

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

Configs that determine motor selection and commutation.

Set these configs to match your motor setup before commanding motor output.

Parameter list:

  • CommutationConfigs.advanced_hall_support

  • CommutationConfigs.motor_arrangement

  • CommutationConfigs.brushed_motor_wiring

Parameters:

new_commutation (CommutationConfigs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_slot0(new_slot0: phoenix6.configs.config_groups.Slot0Configs) TalonFXSConfiguration

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

Gains for the specified slot.

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

Parameter list:

  • Slot0Configs.k_p

  • Slot0Configs.k_i

  • Slot0Configs.k_d

  • Slot0Configs.k_s

  • Slot0Configs.k_v

  • Slot0Configs.k_a

  • Slot0Configs.k_g

  • Slot0Configs.gravity_type

  • Slot0Configs.static_feedforward_sign

Parameters:

new_slot0 (Slot0Configs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_slot1(new_slot1: phoenix6.configs.config_groups.Slot1Configs) TalonFXSConfiguration

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

Gains for the specified slot.

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

Parameter list:

  • Slot1Configs.k_p

  • Slot1Configs.k_i

  • Slot1Configs.k_d

  • Slot1Configs.k_s

  • Slot1Configs.k_v

  • Slot1Configs.k_a

  • Slot1Configs.k_g

  • Slot1Configs.gravity_type

  • Slot1Configs.static_feedforward_sign

Parameters:

new_slot1 (Slot1Configs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

with_slot2(new_slot2: phoenix6.configs.config_groups.Slot2Configs) TalonFXSConfiguration

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

Gains for the specified slot.

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

Parameter list:

  • Slot2Configs.k_p

  • Slot2Configs.k_i

  • Slot2Configs.k_d

  • Slot2Configs.k_s

  • Slot2Configs.k_v

  • Slot2Configs.k_a

  • Slot2Configs.k_g

  • Slot2Configs.gravity_type

  • Slot2Configs.static_feedforward_sign

Parameters:

new_slot2 (Slot2Configs) – Parameter to modify

Returns:

Itself

Return type:

TalonFXSConfiguration

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.TalonFXSConfigurator(id: phoenix6.hardware.device_identifier.DeviceIdentifier)

Bases: phoenix6.configs.parent_configurator.ParentConfigurator

  • Class description for the Talon FXS motor controller.

    This handles the configurations for TalonFXS

refresh(configs: phoenix6.configs.config_groups.SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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_unlicensed_feature_in_use(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: An unlicensed feature is in use, device may not behave as 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_bridge_brownout(timeout_seconds: phoenix6.units.second = 0.1) 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.1) 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.1) phoenix6.status_code.StatusCode

Clear sticky fault: The remote Talon 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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.1) 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_missing_soft_limit_remote(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: The remote soft limit device 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_missing_hard_limit_remote(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: The remote limit switch device 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_data_invalid(timeout_seconds: phoenix6.units.second = 0.1) 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.1) 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.1) 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.1) 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

clear_sticky_fault_using_fused_cancoder_while_unlicensed(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: Using Fused CANcoder feature while unlicensed. Device has fallen back to remote CANcoder.

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_static_brake_disabled(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: Static brake was momentarily disabled due to excessive braking current while disabled.

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_short(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: Bridge was disabled most likely due to a short in the motor leads.

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_hall_sensor_missing(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: Hall sensor signals are invalid. Check hall sensor and cabling. This fault can be used to detect when hall cable is unplugged.

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_drive_disabled_hall_sensor(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: Hall sensor signals are invalid during motor drive, so motor was disabled. Check hall sensor and cabling.

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_motor_temp_sensor_missing(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: Motor temperature signal appears to not be connected.

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_motor_temp_sensor_too_hot(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: Motor temperature signal indicates motor is too hot.

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.CANrangeConfiguration

Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front of the device.

This handles the configurations for CANrange

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.

custom_params: phoenix6.configs.config_groups.CustomParamsConfigs

Custom Params.

Custom paramaters that have no real impact on controller.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

to_f_params: phoenix6.configs.config_groups.ToFParamsConfigs

Configs that affect the ToF sensor

Includes Update mode and frequency

Parameter list:

  • ToFParamsConfigs.update_mode

  • ToFParamsConfigs.update_frequency

proximity_params: phoenix6.configs.config_groups.ProximityParamsConfigs

Configs that affect the ToF Proximity detection

Includes proximity mode and the threshold for simple detection

Parameter list:

  • ProximityParamsConfigs.proximity_threshold

  • ProximityParamsConfigs.proximity_hysteresis

  • ProximityParamsConfigs.min_signal_strength_for_valid_measurement

fov_params: phoenix6.configs.config_groups.FovParamsConfigs

Configs that affect the ToF Field of View

Includes range and center configs

Parameter list:

  • FovParamsConfigs.fov_center_x

  • FovParamsConfigs.fov_center_y

  • FovParamsConfigs.fov_range_x

  • FovParamsConfigs.fov_range_y

with_custom_params(new_custom_params: phoenix6.configs.config_groups.CustomParamsConfigs) CANrangeConfiguration

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.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

Parameters:

new_custom_params (CustomParamsConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANrangeConfiguration

with_to_f_params(new_to_f_params: phoenix6.configs.config_groups.ToFParamsConfigs) CANrangeConfiguration

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

Configs that affect the ToF sensor

Includes Update mode and frequency

Parameter list:

  • ToFParamsConfigs.update_mode

  • ToFParamsConfigs.update_frequency

Parameters:

new_to_f_params (ToFParamsConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANrangeConfiguration

with_proximity_params(new_proximity_params: phoenix6.configs.config_groups.ProximityParamsConfigs) CANrangeConfiguration

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

Configs that affect the ToF Proximity detection

Includes proximity mode and the threshold for simple detection

Parameter list:

  • ProximityParamsConfigs.proximity_threshold

  • ProximityParamsConfigs.proximity_hysteresis

  • ProximityParamsConfigs.min_signal_strength_for_valid_measurement

Parameters:

new_proximity_params (ProximityParamsConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANrangeConfiguration

with_fov_params(new_fov_params: phoenix6.configs.config_groups.FovParamsConfigs) CANrangeConfiguration

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

Configs that affect the ToF Field of View

Includes range and center configs

Parameter list:

  • FovParamsConfigs.fov_center_x

  • FovParamsConfigs.fov_center_y

  • FovParamsConfigs.fov_range_x

  • FovParamsConfigs.fov_range_y

Parameters:

new_fov_params (FovParamsConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANrangeConfiguration

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.CANrangeConfigurator(id: phoenix6.hardware.device_identifier.DeviceIdentifier)

Bases: phoenix6.configs.parent_configurator.ParentConfigurator

  • Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the

  • distance to the front of the device.

    This handles the configurations for CANrange

refresh(configs: phoenix6.configs.config_groups.SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.1) 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.1) 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

clear_sticky_faults(timeout_seconds: phoenix6.units.second = 0.1) 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.1) 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.1) 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.1) 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_unlicensed_feature_in_use(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: An unlicensed feature is in use, device may not behave as 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

class phoenix6.configs.CANdiConfiguration

Class for CTR Electronics’ CANdi™ branded device, a device that integrates digital signals into the existing CAN bus network.

This handles the configurations for CANdi

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.

custom_params: phoenix6.configs.config_groups.CustomParamsConfigs

Custom Params.

Custom paramaters that have no real impact on controller.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

digital_inputs: phoenix6.configs.config_groups.DigitalInputsConfigs

Configs related to the CANdi™ branded device’s digital I/O settings

Contains float-state settings and when to assert the S1/S2 inputs.

Parameter list:

  • DigitalInputsConfigs.s1_float_state

  • DigitalInputsConfigs.s2_float_state

  • DigitalInputsConfigs.s1_close_state

  • DigitalInputsConfigs.s2_close_state

quadrature: phoenix6.configs.config_groups.QuadratureConfigs

Configs related to the CANdi™ branded device’s quadrature interface using both the S1IN and S2IN inputs

All the configs related to the quadrature interface for the CANdi™ branded device , including encoder edges per revolution and sensor direction.

Parameter list:

  • QuadratureConfigs.quadrature_edges_per_rotation

  • QuadratureConfigs.sensor_direction

pwm1: phoenix6.configs.config_groups.PWM1Configs

Configs related to the CANdi™ branded device’s PWM interface on the Signal 1 input (S1IN)

All the configs related to the PWM interface for the CANdi™ branded device on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction.

Parameter list:

  • PWM1Configs.absolute_sensor_offset

  • PWM1Configs.absolute_sensor_discontinuity_point

  • PWM1Configs.sensor_direction

pwm2: phoenix6.configs.config_groups.PWM2Configs

Configs related to the CANdi™ branded device’s PWM interface on the Signal 2 input (S2IN)

All the configs related to the PWM interface for the CANdi™ branded device on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction.

Parameter list:

  • PWM2Configs.absolute_sensor_offset

  • PWM2Configs.absolute_sensor_discontinuity_point

  • PWM2Configs.sensor_direction

with_custom_params(new_custom_params: phoenix6.configs.config_groups.CustomParamsConfigs) CANdiConfiguration

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.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

Parameters:

new_custom_params (CustomParamsConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANdiConfiguration

with_digital_inputs(new_digital_inputs: phoenix6.configs.config_groups.DigitalInputsConfigs) CANdiConfiguration

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

Configs related to the CANdi™ branded device’s digital I/O settings

Contains float-state settings and when to assert the S1/S2 inputs.

Parameter list:

  • DigitalInputsConfigs.s1_float_state

  • DigitalInputsConfigs.s2_float_state

  • DigitalInputsConfigs.s1_close_state

  • DigitalInputsConfigs.s2_close_state

Parameters:

new_digital_inputs (DigitalInputsConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANdiConfiguration

with_quadrature(new_quadrature: phoenix6.configs.config_groups.QuadratureConfigs) CANdiConfiguration

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

Configs related to the CANdi™ branded device’s quadrature interface using both the S1IN and S2IN inputs

All the configs related to the quadrature interface for the CANdi™ branded device , including encoder edges per revolution and sensor direction.

Parameter list:

  • QuadratureConfigs.quadrature_edges_per_rotation

  • QuadratureConfigs.sensor_direction

Parameters:

new_quadrature (QuadratureConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANdiConfiguration

with_pwm1(new_pwm1: phoenix6.configs.config_groups.PWM1Configs) CANdiConfiguration

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

Configs related to the CANdi™ branded device’s PWM interface on the Signal 1 input (S1IN)

All the configs related to the PWM interface for the CANdi™ branded device on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction.

Parameter list:

  • PWM1Configs.absolute_sensor_offset

  • PWM1Configs.absolute_sensor_discontinuity_point

  • PWM1Configs.sensor_direction

Parameters:

new_pwm1 (PWM1Configs) – Parameter to modify

Returns:

Itself

Return type:

CANdiConfiguration

with_pwm2(new_pwm2: phoenix6.configs.config_groups.PWM2Configs) CANdiConfiguration

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

Configs related to the CANdi™ branded device’s PWM interface on the Signal 2 input (S2IN)

All the configs related to the PWM interface for the CANdi™ branded device on S1, including absolute sensor offset, absolute sensor discontinuity point and sensor direction.

Parameter list:

  • PWM2Configs.absolute_sensor_offset

  • PWM2Configs.absolute_sensor_discontinuity_point

  • PWM2Configs.sensor_direction

Parameters:

new_pwm2 (PWM2Configs) – Parameter to modify

Returns:

Itself

Return type:

CANdiConfiguration

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.CANdiConfigurator(id: phoenix6.hardware.device_identifier.DeviceIdentifier)

Bases: phoenix6.configs.parent_configurator.ParentConfigurator

  • Class for CTR Electronics’ CANdi™ branded device, a device that integrates

  • digital signals into the existing CAN bus network.

    This handles the configurations for CANdi

refresh(configs: phoenix6.configs.config_groups.SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.1) 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.1) 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_quadrature_position(new_value: phoenix6.units.rotation, timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Sets the position of the quadrature input.

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.1) 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.1) 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.1) 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.1) 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_unlicensed_feature_in_use(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: An unlicensed feature is in use, device may not behave as 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_5_v(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: The CTR Electronics’ CANdi™ branded device has detected a 5V fault. This may be due to overcurrent or a short-circuit.

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.CANdleConfiguration

Class for CTR Electronics’ CANdle® branded device, a device that controls LEDs over the CAN bus.

This handles the configurations for CANdle

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.

custom_params: CustomParamsConfigs

Custom Params.

Custom paramaters that have no real impact on controller.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

led: LEDConfigs

Configs related to CANdle LED control.

All the configs related to controlling LEDs with the CANdle, including LED strip type and brightness.

Parameter list:

  • LEDConfigs.strip_type

  • LEDConfigs.brightness_scalar

  • LEDConfigs.loss_of_signal_behavior

candle_features: CANdleFeaturesConfigs

Configs related to general CANdle features.

This includes configs such as disabling the 5V rail and the behavior of VBat output.

Parameter list:

  • CANdleFeaturesConfigs.enable5_v_rail

  • CANdleFeaturesConfigs.v_bat_output_mode

  • CANdleFeaturesConfigs.status_led_when_active

with_custom_params(new_custom_params: CustomParamsConfigs) CANdleConfiguration

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.

Parameter list:

  • CustomParamsConfigs.custom_param0

  • CustomParamsConfigs.custom_param1

Parameters:

new_custom_params (CustomParamsConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANdleConfiguration

with_led(new_led: LEDConfigs) CANdleConfiguration

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

Configs related to CANdle LED control.

All the configs related to controlling LEDs with the CANdle, including LED strip type and brightness.

Parameter list:

  • LEDConfigs.strip_type

  • LEDConfigs.brightness_scalar

  • LEDConfigs.loss_of_signal_behavior

Parameters:

new_led (LEDConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANdleConfiguration

with_candle_features(new_candle_features: CANdleFeaturesConfigs) CANdleConfiguration

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

Configs related to general CANdle features.

This includes configs such as disabling the 5V rail and the behavior of VBat output.

Parameter list:

  • CANdleFeaturesConfigs.enable5_v_rail

  • CANdleFeaturesConfigs.v_bat_output_mode

  • CANdleFeaturesConfigs.status_led_when_active

Parameters:

new_candle_features (CANdleFeaturesConfigs) – Parameter to modify

Returns:

Itself

Return type:

CANdleConfiguration

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.CANdleConfigurator(id: phoenix6.hardware.device_identifier.DeviceIdentifier)

Bases: phoenix6.configs.parent_configurator.ParentConfigurator

  • Class for CTR Electronics’ CANdle® branded device, a device that controls

  • LEDs over the CAN bus.

    This handles the configurations for CANdle

refresh(configs: SupportsSerialization, timeout_seconds: phoenix6.units.second = 0.1) 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.1) 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

clear_sticky_faults(timeout_seconds: phoenix6.units.second = 0.1) 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.1) 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.1) 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.1) 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_unlicensed_feature_in_use(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: An unlicensed feature is in use, device may not behave as 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_overvoltage(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: Device supply voltage is too high (above 30 V).

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_5_v_too_high(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: Device 5V line is too high (above 6 V).

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_5_v_too_low(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: Device 5V line is too low (below 4 V).

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_thermal(timeout_seconds: phoenix6.units.second = 0.1) 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_software_fuse(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: CANdle output current exceeded the 6 A 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_short_circuit(timeout_seconds: phoenix6.units.second = 0.1) phoenix6.status_code.StatusCode

Clear sticky fault: CANdle has detected the output pin is shorted.

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