phoenix6.configs.config_groups
#
Module Contents#
- class phoenix6.configs.config_groups.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(Protocol[T]): def meth(self) -> T: ...
- serialize() str #
- deserialize(string: str) phoenix6.status_code.StatusCode #
- class phoenix6.configs.config_groups.MagnetSensorConfigs#
Configs that affect the magnet sensor and how to interpret it.
Includes sensor range, sensor direction, and the magnet offset.
- sensor_direction: SensorDirectionValue#
Direction of the sensor to determine positive rotation, as seen facing the LED side of the CANcoder.
- magnet_offset: float = 0#
This offset is added to the reported position, allowing the application to trim the zero position. When set to the default value of zero, position reports zero when magnet north pole aligns with the LED.
Minimum Value: -1
Maximum Value: 1
Default Value: 0
Units: rotations
- absolute_sensor_range: AbsoluteSensorRangeValue#
The range of the absolute sensor in rotations, either [-0.5, 0.5) or [0, 1).
- with_sensor_direction(new_sensor_direction: SensorDirectionValue) MagnetSensorConfigs #
Modifies this configuration’s sensor_direction parameter and returns itself for method-chaining and easier to use config API.
Direction of the sensor to determine positive rotation, as seen facing the LED side of the CANcoder.
- Parameters:
new_sensor_direction (SensorDirectionValue) – Parameter to modify
- Returns:
Itself
- Return type:
- with_magnet_offset(new_magnet_offset: float) MagnetSensorConfigs #
Modifies this configuration’s magnet_offset parameter and returns itself for method-chaining and easier to use config API.
This offset is added to the reported position, allowing the application to trim the zero position. When set to the default value of zero, position reports zero when magnet north pole aligns with the LED.
Minimum Value: -1
Maximum Value: 1
Default Value: 0
Units: rotations
- Parameters:
new_magnet_offset (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_absolute_sensor_range(new_absolute_sensor_range: AbsoluteSensorRangeValue) MagnetSensorConfigs #
Modifies this configuration’s absolute_sensor_range parameter and returns itself for method-chaining and easier to use config API.
The range of the absolute sensor in rotations, either [-0.5, 0.5) or [0, 1).
- Parameters:
new_absolute_sensor_range (AbsoluteSensorRangeValue) – Parameter to modify
- Returns:
Itself
- Return type:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class 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.
- mount_pose_yaw: float = 0#
The mounting calibration yaw-component
Minimum Value: -360
Maximum Value: 360
Default Value: 0
Units: deg
- mount_pose_pitch: float = 0#
The mounting calibration pitch-component
Minimum Value: -360
Maximum Value: 360
Default Value: 0
Units: deg
- mount_pose_roll: float = 0#
The mounting calibration roll-component
Minimum Value: -360
Maximum Value: 360
Default Value: 0
Units: deg
- with_mount_pose_yaw(new_mount_pose_yaw: float) MountPoseConfigs #
Modifies this configuration’s mount_pose_yaw parameter and returns itself for method-chaining and easier to use config API.
The mounting calibration yaw-component
Minimum Value: -360
Maximum Value: 360
Default Value: 0
Units: deg
- Parameters:
new_mount_pose_yaw (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_mount_pose_pitch(new_mount_pose_pitch: float) MountPoseConfigs #
Modifies this configuration’s mount_pose_pitch parameter and returns itself for method-chaining and easier to use config API.
The mounting calibration pitch-component
Minimum Value: -360
Maximum Value: 360
Default Value: 0
Units: deg
- Parameters:
new_mount_pose_pitch (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_mount_pose_roll(new_mount_pose_roll: float) MountPoseConfigs #
Modifies this configuration’s mount_pose_roll parameter and returns itself for method-chaining and easier to use config API.
The mounting calibration roll-component
Minimum Value: -360
Maximum Value: 360
Default Value: 0
Units: deg
- Parameters:
new_mount_pose_roll (float) – Parameter to modify
- Returns:
Itself
- Return type:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class 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.
- 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:
- 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:
- 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:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class 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.
- 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:
- 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:
- 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:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.MotorOutputConfigs#
Configs that directly affect motor output.
Includes motor invert, neutral mode, and other features related to motor output.
- inverted: InvertedValue#
Invert state of the device.
- neutral_mode: NeutralModeValue#
The state of the motor controller bridge when output is neutral or disabled.
- duty_cycle_neutral_deadband: float = 0#
Configures the output deadband duty cycle during duty cycle and voltage based control modes.
Minimum Value: 0.0
Maximum Value: 0.25
Default Value: 0
Units: fractional
- peak_forward_duty_cycle: float = 1#
Maximum (forward) output during duty cycle based control modes.
Minimum Value: -1.0
Maximum Value: 1.0
Default Value: 1
Units: fractional
- peak_reverse_duty_cycle: float#
Minimum (reverse) output during duty cycle based control modes.
Minimum Value: -1.0
Maximum Value: 1.0
Default Value: -1
Units: fractional
- with_inverted(new_inverted: InvertedValue) MotorOutputConfigs #
Modifies this configuration’s inverted parameter and returns itself for method-chaining and easier to use config API.
Invert state of the device.
- Parameters:
new_inverted (InvertedValue) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- 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:
- 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:
- 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:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.CurrentLimitsConfigs#
Configs that directly affect current limiting features.
Contains the supply/stator current limit thresholds and whether to enable them.
- stator_current_limit: float = 0#
The amount of current allowed in the motor (motoring and regen current). Note this requires StatorCurrentLimitEnable to be true.
This is only applicable for non-torque current control modes. For torque current control, set the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs instead.
Stator current is directly proportional to torque, so this limit can be used to restrict the torque output of the motor, such as preventing wheel slip for a drivetrain. Additionally, stator current limits can prevent brownouts during acceleration; supply current will never exceed the stator current limit and is often significantly lower than stator current.
A reasonable starting point for a stator current limit is 120 A, with values commonly ranging from 80-160 A. Mechanisms with a hard stop may need a smaller limit to reduce the torque applied when running into the hard stop.
Minimum Value: 0.0
Maximum Value: 800.0
Default Value: 0
Units: A
- stator_current_limit_enable: bool = False#
Enable motor stator current limiting.
Default Value: False
- supply_current_limit: float = 0#
The amount of supply current allowed. Note this requires SupplyCurrentLimitEnable to be true. Use SupplyCurrentThreshold and SupplyTimeThreshold to allow brief periods of high-current before limiting occurs.
This is only applicable for non-torque current control modes. For torque current control, set the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs instead.
Supply current is the current drawn from the battery, so this limit can be used to prevent breaker trips and improve battery longevity. Additionally, in the rare case where the robot experiences brownouts despite configuring stator current limits, a supply current limit can further help avoid brownouts. However, such brownouts are most commonly caused by a bad battery or poor power wiring.
A reasonable starting point for a supply current limit is 60 A with a threshold of 80 A for 0.1 seconds. Supply current limits commonly range from 20-80 A depending on the breaker used.
Minimum Value: 0.0
Maximum Value: 800.0
Default Value: 0
Units: A
- supply_current_limit_enable: bool = False#
Enable motor supply current limiting.
Default Value: False
- supply_current_threshold: float = 0#
Delay supply current limiting until current exceeds this threshold for longer than SupplyTimeThreshold. This allows current draws above SupplyCurrentLimit for a fixed period of time. This has no effect if SupplyCurrentLimit is greater than this value.
Minimum Value: 0.0
Maximum Value: 511
Default Value: 0
Units: A
- supply_time_threshold: float = 0#
Allows unlimited current for a period of time before current limiting occurs. Current threshold is the maximum of SupplyCurrentThreshold and SupplyCurrentLimit.
Minimum Value: 0.0
Maximum Value: 1.275
Default Value: 0
Units: sec
- with_stator_current_limit(new_stator_current_limit: float) CurrentLimitsConfigs #
Modifies this configuration’s stator_current_limit parameter and returns itself for method-chaining and easier to use config API.
The amount of current allowed in the motor (motoring and regen current). Note this requires StatorCurrentLimitEnable to be true.
This is only applicable for non-torque current control modes. For torque current control, set the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs instead.
Stator current is directly proportional to torque, so this limit can be used to restrict the torque output of the motor, such as preventing wheel slip for a drivetrain. Additionally, stator current limits can prevent brownouts during acceleration; supply current will never exceed the stator current limit and is often significantly lower than stator current.
A reasonable starting point for a stator current limit is 120 A, with values commonly ranging from 80-160 A. Mechanisms with a hard stop may need a smaller limit to reduce the torque applied when running into the hard stop.
Minimum Value: 0.0
Maximum Value: 800.0
Default Value: 0
Units: A
- Parameters:
new_stator_current_limit (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_stator_current_limit_enable(new_stator_current_limit_enable: bool) CurrentLimitsConfigs #
Modifies this configuration’s stator_current_limit_enable parameter and returns itself for method-chaining and easier to use config API.
Enable motor stator current limiting.
Default Value: False
- Parameters:
new_stator_current_limit_enable (bool) – Parameter to modify
- Returns:
Itself
- Return type:
- with_supply_current_limit(new_supply_current_limit: float) CurrentLimitsConfigs #
Modifies this configuration’s supply_current_limit parameter and returns itself for method-chaining and easier to use config API.
The amount of supply current allowed. Note this requires SupplyCurrentLimitEnable to be true. Use SupplyCurrentThreshold and SupplyTimeThreshold to allow brief periods of high-current before limiting occurs.
This is only applicable for non-torque current control modes. For torque current control, set the PeakForwardTorqueCurrent and PeakReverseTorqueCurrent in TorqueCurrentConfigs instead.
Supply current is the current drawn from the battery, so this limit can be used to prevent breaker trips and improve battery longevity. Additionally, in the rare case where the robot experiences brownouts despite configuring stator current limits, a supply current limit can further help avoid brownouts. However, such brownouts are most commonly caused by a bad battery or poor power wiring.
A reasonable starting point for a supply current limit is 60 A with a threshold of 80 A for 0.1 seconds. Supply current limits commonly range from 20-80 A depending on the breaker used.
Minimum Value: 0.0
Maximum Value: 800.0
Default Value: 0
Units: A
- Parameters:
new_supply_current_limit (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_supply_current_limit_enable(new_supply_current_limit_enable: bool) CurrentLimitsConfigs #
Modifies this configuration’s supply_current_limit_enable parameter and returns itself for method-chaining and easier to use config API.
Enable motor supply current limiting.
Default Value: False
- Parameters:
new_supply_current_limit_enable (bool) – Parameter to modify
- Returns:
Itself
- Return type:
- with_supply_current_threshold(new_supply_current_threshold: float) CurrentLimitsConfigs #
Modifies this configuration’s supply_current_threshold parameter and returns itself for method-chaining and easier to use config API.
Delay supply current limiting until current exceeds this threshold for longer than SupplyTimeThreshold. This allows current draws above SupplyCurrentLimit for a fixed period of time. This has no effect if SupplyCurrentLimit is greater than this value.
Minimum Value: 0.0
Maximum Value: 511
Default Value: 0
Units: A
- Parameters:
new_supply_current_threshold (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_supply_time_threshold(new_supply_time_threshold: float) CurrentLimitsConfigs #
Modifies this configuration’s supply_time_threshold parameter and returns itself for method-chaining and easier to use config API.
Allows unlimited current for a period of time before current limiting occurs. Current threshold is the maximum of SupplyCurrentThreshold and SupplyCurrentLimit.
Minimum Value: 0.0
Maximum Value: 1.275
Default Value: 0
Units: sec
- Parameters:
new_supply_time_threshold (float) – Parameter to modify
- Returns:
Itself
- Return type:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.VoltageConfigs#
Configs that affect Voltage control types.
Includes peak output voltages and other configs affecting voltage measurements.
- supply_voltage_time_constant: float = 0#
The time constant (in seconds) of the low-pass filter for the supply voltage.
This impacts the filtering for the reported supply voltage, and any control strategies that use the supply voltage (such as voltage control on a motor controller).
Minimum Value: 0.0
Maximum Value: 0.1
Default Value: 0
Units: sec
- peak_forward_voltage: float = 16#
Maximum (forward) output during voltage based control modes.
Minimum Value: -16
Maximum Value: 16
Default Value: 16
Units: V
- peak_reverse_voltage: float#
Minimum (reverse) output during voltage based control modes.
Minimum Value: -16
Maximum Value: 16
Default Value: -16
Units: V
- with_supply_voltage_time_constant(new_supply_voltage_time_constant: float) VoltageConfigs #
Modifies this configuration’s supply_voltage_time_constant parameter and returns itself for method-chaining and easier to use config API.
The time constant (in seconds) of the low-pass filter for the supply voltage.
This impacts the filtering for the reported supply voltage, and any control strategies that use the supply voltage (such as voltage control on a motor controller).
Minimum Value: 0.0
Maximum Value: 0.1
Default Value: 0
Units: sec
- Parameters:
new_supply_voltage_time_constant (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_peak_forward_voltage(new_peak_forward_voltage: float) VoltageConfigs #
Modifies this configuration’s peak_forward_voltage parameter and returns itself for method-chaining and easier to use config API.
Maximum (forward) output during voltage based control modes.
Minimum Value: -16
Maximum Value: 16
Default Value: 16
Units: V
- Parameters:
new_peak_forward_voltage (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_peak_reverse_voltage(new_peak_reverse_voltage: float) VoltageConfigs #
Modifies this configuration’s peak_reverse_voltage parameter and returns itself for method-chaining and easier to use config API.
Minimum (reverse) output during voltage based control modes.
Minimum Value: -16
Maximum Value: 16
Default Value: -16
Units: V
- Parameters:
new_peak_reverse_voltage (float) – Parameter to modify
- Returns:
Itself
- Return type:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class 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.
- peak_forward_torque_current: float = 800#
Maximum (forward) output during torque current based control modes.
Minimum Value: -800
Maximum Value: 800
Default Value: 800
Units: A
- peak_reverse_torque_current: float#
Minimum (reverse) output during torque current based control modes.
Minimum Value: -800
Maximum Value: 800
Default Value: -800
Units: A
- torque_neutral_deadband: float = 0.0#
Configures the output deadband during torque current based control modes.
Minimum Value: 0
Maximum Value: 25
Default Value: 0.0
Units: A
- with_peak_forward_torque_current(new_peak_forward_torque_current: float) TorqueCurrentConfigs #
Modifies this configuration’s peak_forward_torque_current parameter and returns itself for method-chaining and easier to use config API.
Maximum (forward) output during torque current based control modes.
Minimum Value: -800
Maximum Value: 800
Default Value: 800
Units: A
- Parameters:
new_peak_forward_torque_current (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_peak_reverse_torque_current(new_peak_reverse_torque_current: float) TorqueCurrentConfigs #
Modifies this configuration’s peak_reverse_torque_current parameter and returns itself for method-chaining and easier to use config API.
Minimum (reverse) output during torque current based control modes.
Minimum Value: -800
Maximum Value: 800
Default Value: -800
Units: A
- Parameters:
new_peak_reverse_torque_current (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_torque_neutral_deadband(new_torque_neutral_deadband: float) TorqueCurrentConfigs #
Modifies this configuration’s torque_neutral_deadband parameter and returns itself for method-chaining and easier to use config API.
Configures the output deadband during torque current based control modes.
Minimum Value: 0
Maximum Value: 25
Default Value: 0.0
Units: A
- Parameters:
new_torque_neutral_deadband (float) – Parameter to modify
- Returns:
Itself
- Return type:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class 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.
- feedback_rotor_offset: float = 0.0#
This offset is applied to the absolute integrated rotor sensor. This can be used to zero the rotor in applications that are within one rotor rotation.
Minimum Value: -1
Maximum Value: 1
Default Value: 0.0
Units: rotations
- sensor_to_mechanism_ratio: float = 1.0#
This is the ratio of sensor rotations to the mechanism’s output. This is equivalent to the mechanism’s gear ratio if the sensor is located on the input of a gearbox. If sensor is on the output of a gearbox, then this is typically set to 1. Note if this is set to zero, device will reset back to one.
Minimum Value: -1000
Maximum Value: 1000
Default Value: 1.0
Units: scalar
- rotor_to_sensor_ratio: float = 1.0#
Talon FX is capable of fusing a remote CANcoder with its rotor sensor to produce a high-bandwidth sensor source. This feature requires specifying the ratio between the remote sensor and the motor rotor. Note if this is set to zero, device will reset back to one.
Minimum Value: -1000
Maximum Value: 1000
Default Value: 1.0
Units: scalar
- feedback_sensor_source: FeedbackSensorSourceValue#
Choose what sensor source is reported via API and used by closed-loop and limit features. The default is RotorSensor, which uses the internal rotor sensor in the Talon FX.
Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon FX will update its position and velocity whenever CANcoder publishes its information on CAN bus.
Choose FusedCANcoder (requires Phoenix Pro) and Talon FX will fuse another CANcoder’s information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID). FusedCANcoder was developed for applications such as swerve-azimuth.
Choose SyncCANcoder (requires Phoenix Pro) and Talon FX will synchronize its internal rotor position against another CANcoder, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID). The TalonFX will report if its internal position differs significantly from the reported CANcoder position. SyncCANcoder was developed for mechanisms where there is a risk of the CANcoder failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.
Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll to use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon FX will update its position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon FX position will be in rotations and not degrees.
Note: When the feedback source is changed to FusedCANcoder, the Talon FX needs a period of time to fuse before sensor-based (soft-limit, closed loop, etc.) features are used. This period of time is determined by the update frequency of the CANcoder’s Position signal.
- feedback_remote_sensor_id: int = 0#
Device ID of which remote device to use. This is not used if the Sensor Source is the internal rotor sensor.
Minimum Value: 0
Maximum Value: 62
Default Value: 0
Units:
- with_feedback_rotor_offset(new_feedback_rotor_offset: float) FeedbackConfigs #
Modifies this configuration’s feedback_rotor_offset parameter and returns itself for method-chaining and easier to use config API.
This offset is applied to the absolute integrated rotor sensor. This can be used to zero the rotor in applications that are within one rotor rotation.
Minimum Value: -1
Maximum Value: 1
Default Value: 0.0
Units: rotations
- Parameters:
new_feedback_rotor_offset (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_sensor_to_mechanism_ratio(new_sensor_to_mechanism_ratio: float) FeedbackConfigs #
Modifies this configuration’s sensor_to_mechanism_ratio parameter and returns itself for method-chaining and easier to use config API.
This is the ratio of sensor rotations to the mechanism’s output. This is equivalent to the mechanism’s gear ratio if the sensor is located on the input of a gearbox. If sensor is on the output of a gearbox, then this is typically set to 1. Note if this is set to zero, device will reset back to one.
Minimum Value: -1000
Maximum Value: 1000
Default Value: 1.0
Units: scalar
- Parameters:
new_sensor_to_mechanism_ratio (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_rotor_to_sensor_ratio(new_rotor_to_sensor_ratio: float) FeedbackConfigs #
Modifies this configuration’s rotor_to_sensor_ratio parameter and returns itself for method-chaining and easier to use config API.
Talon FX is capable of fusing a remote CANcoder with its rotor sensor to produce a high-bandwidth sensor source. This feature requires specifying the ratio between the remote sensor and the motor rotor. Note if this is set to zero, device will reset back to one.
Minimum Value: -1000
Maximum Value: 1000
Default Value: 1.0
Units: scalar
- Parameters:
new_rotor_to_sensor_ratio (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_feedback_sensor_source(new_feedback_sensor_source: FeedbackSensorSourceValue) FeedbackConfigs #
Modifies this configuration’s feedback_sensor_source parameter and returns itself for method-chaining and easier to use config API.
Choose what sensor source is reported via API and used by closed-loop and limit features. The default is RotorSensor, which uses the internal rotor sensor in the Talon FX.
Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon FX will update its position and velocity whenever CANcoder publishes its information on CAN bus.
Choose FusedCANcoder (requires Phoenix Pro) and Talon FX will fuse another CANcoder’s information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID). FusedCANcoder was developed for applications such as swerve-azimuth.
Choose SyncCANcoder (requires Phoenix Pro) and Talon FX will synchronize its internal rotor position against another CANcoder, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID). The TalonFX will report if its internal position differs significantly from the reported CANcoder position. SyncCANcoder was developed for mechanisms where there is a risk of the CANcoder failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.
Choose RemotePigeon2_Yaw, RemotePigeon2_Pitch, and RemotePigeon2_Roll to use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon FX will update its position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon FX position will be in rotations and not degrees.
Note: When the feedback source is changed to FusedCANcoder, the Talon FX needs a period of time to fuse before sensor-based (soft-limit, closed loop, etc.) features are used. This period of time is determined by the update frequency of the CANcoder’s Position signal.
- Parameters:
new_feedback_sensor_source (FeedbackSensorSourceValue) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.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:
- 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:
- 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:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.DifferentialConstantsConfigs#
Configs related to constants used for differential control of a mechanism.
Includes the differential peak outputs.
- peak_differential_duty_cycle: float = 2#
Maximum differential output during duty cycle based differential control modes.
Minimum Value: 0.0
Maximum Value: 2.0
Default Value: 2
Units: fractional
- peak_differential_voltage: float = 32#
Maximum differential output during voltage based differential control modes.
Minimum Value: 0.0
Maximum Value: 32
Default Value: 32
Units: V
- peak_differential_torque_current: float = 1600#
Maximum differential output during torque current based differential control modes.
Minimum Value: 0.0
Maximum Value: 1600
Default Value: 1600
Units: A
- with_peak_differential_duty_cycle(new_peak_differential_duty_cycle: float) DifferentialConstantsConfigs #
Modifies this configuration’s peak_differential_duty_cycle parameter and returns itself for method-chaining and easier to use config API.
Maximum differential output during duty cycle based differential control modes.
Minimum Value: 0.0
Maximum Value: 2.0
Default Value: 2
Units: fractional
- Parameters:
new_peak_differential_duty_cycle (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_peak_differential_voltage(new_peak_differential_voltage: float) DifferentialConstantsConfigs #
Modifies this configuration’s peak_differential_voltage parameter and returns itself for method-chaining and easier to use config API.
Maximum differential output during voltage based differential control modes.
Minimum Value: 0.0
Maximum Value: 32
Default Value: 32
Units: V
- Parameters:
new_peak_differential_voltage (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_peak_differential_torque_current(new_peak_differential_torque_current: float) DifferentialConstantsConfigs #
Modifies this configuration’s peak_differential_torque_current parameter and returns itself for method-chaining and easier to use config API.
Maximum differential output during torque current based differential control modes.
Minimum Value: 0.0
Maximum Value: 1600
Default Value: 1600
Units: A
- Parameters:
new_peak_differential_torque_current (float) – Parameter to modify
- Returns:
Itself
- Return type:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class 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.
- duty_cycle_open_loop_ramp_period: float = 0#
If non-zero, this determines how much time to ramp from 0% output to 100% during open-loop modes.
Minimum Value: 0
Maximum Value: 1
Default Value: 0
Units: sec
- voltage_open_loop_ramp_period: float = 0#
If non-zero, this determines how much time to ramp from 0V output to 12V during open-loop modes.
Minimum Value: 0
Maximum Value: 1
Default Value: 0
Units: sec
- torque_open_loop_ramp_period: float = 0#
If non-zero, this determines how much time to ramp from 0A output to 300A during open-loop modes.
Minimum Value: 0
Maximum Value: 10
Default Value: 0
Units: sec
- with_duty_cycle_open_loop_ramp_period(new_duty_cycle_open_loop_ramp_period: float) OpenLoopRampsConfigs #
Modifies this configuration’s duty_cycle_open_loop_ramp_period parameter and returns itself for method-chaining and easier to use config API.
If non-zero, this determines how much time to ramp from 0% output to 100% during open-loop modes.
Minimum Value: 0
Maximum Value: 1
Default Value: 0
Units: sec
- Parameters:
new_duty_cycle_open_loop_ramp_period (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_voltage_open_loop_ramp_period(new_voltage_open_loop_ramp_period: float) OpenLoopRampsConfigs #
Modifies this configuration’s voltage_open_loop_ramp_period parameter and returns itself for method-chaining and easier to use config API.
If non-zero, this determines how much time to ramp from 0V output to 12V during open-loop modes.
Minimum Value: 0
Maximum Value: 1
Default Value: 0
Units: sec
- Parameters:
new_voltage_open_loop_ramp_period (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_torque_open_loop_ramp_period(new_torque_open_loop_ramp_period: float) OpenLoopRampsConfigs #
Modifies this configuration’s torque_open_loop_ramp_period parameter and returns itself for method-chaining and easier to use config API.
If non-zero, this determines how much time to ramp from 0A output to 300A during open-loop modes.
Minimum Value: 0
Maximum Value: 10
Default Value: 0
Units: sec
- Parameters:
new_torque_open_loop_ramp_period (float) – Parameter to modify
- Returns:
Itself
- Return type:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class 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.
- duty_cycle_closed_loop_ramp_period: float = 0#
If non-zero, this determines how much time to ramp from 0% output to 100% during closed-loop modes.
Minimum Value: 0
Maximum Value: 1
Default Value: 0
Units: sec
- voltage_closed_loop_ramp_period: float = 0#
If non-zero, this determines how much time to ramp from 0V output to 12V during closed-loop modes.
Minimum Value: 0
Maximum Value: 1
Default Value: 0
Units: sec
- torque_closed_loop_ramp_period: float = 0#
If non-zero, this determines how much time to ramp from 0A output to 300A during closed-loop modes.
Minimum Value: 0
Maximum Value: 10
Default Value: 0
Units: sec
- with_duty_cycle_closed_loop_ramp_period(new_duty_cycle_closed_loop_ramp_period: float) ClosedLoopRampsConfigs #
Modifies this configuration’s duty_cycle_closed_loop_ramp_period parameter and returns itself for method-chaining and easier to use config API.
If non-zero, this determines how much time to ramp from 0% output to 100% during closed-loop modes.
Minimum Value: 0
Maximum Value: 1
Default Value: 0
Units: sec
- Parameters:
new_duty_cycle_closed_loop_ramp_period (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_voltage_closed_loop_ramp_period(new_voltage_closed_loop_ramp_period: float) ClosedLoopRampsConfigs #
Modifies this configuration’s voltage_closed_loop_ramp_period parameter and returns itself for method-chaining and easier to use config API.
If non-zero, this determines how much time to ramp from 0V output to 12V during closed-loop modes.
Minimum Value: 0
Maximum Value: 1
Default Value: 0
Units: sec
- Parameters:
new_voltage_closed_loop_ramp_period (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_torque_closed_loop_ramp_period(new_torque_closed_loop_ramp_period: float) ClosedLoopRampsConfigs #
Modifies this configuration’s torque_closed_loop_ramp_period parameter and returns itself for method-chaining and easier to use config API.
If non-zero, this determines how much time to ramp from 0A output to 300A during closed-loop modes.
Minimum Value: 0
Maximum Value: 10
Default Value: 0
Units: sec
- Parameters:
new_torque_closed_loop_ramp_period (float) – Parameter to modify
- Returns:
Itself
- Return type:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class 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.
- forward_limit_type: ForwardLimitTypeValue#
Determines if the forward limit switch is normally-open (default) or normally-closed.
- forward_limit_autoset_position_enable: bool = False#
If enabled, the position is automatically set to a specific value, specified by ForwardLimitAutosetPositionValue, when the forward limit switch is asserted.
Default Value: False
- forward_limit_autoset_position_value: float = 0#
The value to automatically set the position to when the forward limit switch is asserted. This has no effect if ForwardLimitAutosetPositionEnable is false.
Minimum Value: -3.4e+38
Maximum Value: 3.4e+38
Default Value: 0
Units: rotations
- forward_limit_enable: bool = True#
If enabled, motor output is set to neutral when the forward limit switch is asserted and positive output is requested.
Default Value: True
- forward_limit_source: ForwardLimitSourceValue#
Determines where to poll the forward limit switch. This defaults to the forward limit switch pin on the limit switch connector.
Choose RemoteTalonFX to use the forward limit switch attached to another Talon FX on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Choose RemoteCANifier to use the forward limit switch attached to another CANifier on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID).
Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID). The forward limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).
- forward_limit_remote_sensor_id: int = 0#
Device ID of the remote device if using remote limit switch features for the forward limit switch.
Minimum Value: 0
Maximum Value: 62
Default Value: 0
Units:
- reverse_limit_type: ReverseLimitTypeValue#
Determines if the reverse limit switch is normally-open (default) or normally-closed.
- reverse_limit_autoset_position_enable: bool = False#
If enabled, the position is automatically set to a specific value, specified by ReverseLimitAutosetPositionValue, when the reverse limit switch is asserted.
Default Value: False
- reverse_limit_autoset_position_value: float = 0#
The value to automatically set the position to when the reverse limit switch is asserted. This has no effect if ReverseLimitAutosetPositionEnable is false.
Minimum Value: -3.4e+38
Maximum Value: 3.4e+38
Default Value: 0
Units: rotations
- reverse_limit_enable: bool = True#
If enabled, motor output is set to neutral when reverse limit switch is asseted and negative output is requested.
Default Value: True
- reverse_limit_source: ReverseLimitSourceValue#
Determines where to poll the reverse limit switch. This defaults to the reverse limit switch pin on the limit switch connector.
Choose RemoteTalonFX to use the reverse limit switch attached to another Talon FX on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Choose RemoteCANifier to use the reverse limit switch attached to another CANifier on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID).
Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID). The reverse limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).
- reverse_limit_remote_sensor_id: int = 0#
Device ID of the remote device if using remote limit switch features for the reverse limit switch.
Minimum Value: 0
Maximum Value: 62
Default Value: 0
Units:
- with_forward_limit_type(new_forward_limit_type: ForwardLimitTypeValue) HardwareLimitSwitchConfigs #
Modifies this configuration’s forward_limit_type parameter and returns itself for method-chaining and easier to use config API.
Determines if the forward limit switch is normally-open (default) or normally-closed.
- Parameters:
new_forward_limit_type (ForwardLimitTypeValue) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- with_forward_limit_autoset_position_value(new_forward_limit_autoset_position_value: float) HardwareLimitSwitchConfigs #
Modifies this configuration’s forward_limit_autoset_position_value parameter and returns itself for method-chaining and easier to use config API.
The value to automatically set the position to when the forward limit switch is asserted. This has no effect if ForwardLimitAutosetPositionEnable is false.
Minimum Value: -3.4e+38
Maximum Value: 3.4e+38
Default Value: 0
Units: rotations
- Parameters:
new_forward_limit_autoset_position_value (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- 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:
- 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:
- 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:
- 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:
- with_reverse_limit_autoset_position_value(new_reverse_limit_autoset_position_value: float) HardwareLimitSwitchConfigs #
Modifies this configuration’s reverse_limit_autoset_position_value parameter and returns itself for method-chaining and easier to use config API.
The value to automatically set the position to when the reverse limit switch is asserted. This has no effect if ReverseLimitAutosetPositionEnable is false.
Minimum Value: -3.4e+38
Maximum Value: 3.4e+38
Default Value: 0
Units: rotations
- Parameters:
new_reverse_limit_autoset_position_value (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- 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:
- 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:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.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:
- 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:
- 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:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class 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.
- forward_soft_limit_enable: bool = False#
If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.
Default Value: False
- reverse_soft_limit_enable: bool = False#
If enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.
Default Value: False
- forward_soft_limit_threshold: float = 0#
Position threshold for forward soft limit features. ForwardSoftLimitEnable must be enabled for this to take effect.
Minimum Value: -3.4e+38
Maximum Value: 3.4e+38
Default Value: 0
Units: rotations
- reverse_soft_limit_threshold: float = 0#
Position threshold for reverse soft limit features. ReverseSoftLimitEnable must be enabled for this to take effect.
Minimum Value: -3.4e+38
Maximum Value: 3.4e+38
Default Value: 0
Units: rotations
- with_forward_soft_limit_enable(new_forward_soft_limit_enable: bool) SoftwareLimitSwitchConfigs #
Modifies this configuration’s forward_soft_limit_enable parameter and returns itself for method-chaining and easier to use config API.
If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.
Default Value: False
- Parameters:
new_forward_soft_limit_enable (bool) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- with_forward_soft_limit_threshold(new_forward_soft_limit_threshold: float) SoftwareLimitSwitchConfigs #
Modifies this configuration’s forward_soft_limit_threshold parameter and returns itself for method-chaining and easier to use config API.
Position threshold for forward soft limit features. ForwardSoftLimitEnable must be enabled for this to take effect.
Minimum Value: -3.4e+38
Maximum Value: 3.4e+38
Default Value: 0
Units: rotations
- Parameters:
new_forward_soft_limit_threshold (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_reverse_soft_limit_threshold(new_reverse_soft_limit_threshold: float) SoftwareLimitSwitchConfigs #
Modifies this configuration’s reverse_soft_limit_threshold parameter and returns itself for method-chaining and easier to use config API.
Position threshold for reverse soft limit features. ReverseSoftLimitEnable must be enabled for this to take effect.
Minimum Value: -3.4e+38
Maximum Value: 3.4e+38
Default Value: 0
Units: rotations
- Parameters:
new_reverse_soft_limit_threshold (float) – Parameter to modify
- Returns:
Itself
- Return type:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.MotionMagicConfigs#
Configs for Motion Magic®.
Includes Velocity, Acceleration, Jerk, and Expo parameters.
- motion_magic_cruise_velocity: float = 0#
This is the maximum velocity Motion Magic® based control modes are allowed to use. Motion Magic® Velocity control modes do not use this config. When using Motion Magic® Expo control modes, setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.
Minimum Value: 0
Maximum Value: 9999
Default Value: 0
Units: rps
- motion_magic_acceleration: float = 0#
This is the target acceleration Motion Magic® based control modes are allowed to use. Motion Magic® Expo control modes do not use this config.
Minimum Value: 0
Maximum Value: 9999
Default Value: 0
Units: rot per sec²
- motion_magic_jerk: float = 0#
This is the target jerk (acceleration derivative) Motion Magic® based control modes are allowed to use. Motion Magic® Expo control modes do not use this config. This allows Motion Magic® support of S-Curves. If this is set to zero, then Motion Magic® will not apply a Jerk limit.
Minimum Value: 0
Maximum Value: 9999
Default Value: 0
Units: rot per sec³
- motion_magic_expo_k_v: float = 0#
This is the target kV used only by Motion Magic® Expo control modes, in units of V/rps. This represents the amount of voltage necessary to hold a velocity. In terms of the Motion Magic® Expo profile, a higher kV results in a slower maximum velocity. A kV of 0 will be promoted to a reasonable default of 0.12.
Minimum Value: 0.001
Maximum Value: 100
Default Value: 0
Units: V/rps
- motion_magic_expo_k_a: float = 0#
This is the target kA used only by Motion Magic® Expo control modes, in units of V/rps². This represents the amount of voltage necessary to achieve an acceleration. In terms of the Motion Magic® Expo profile, a higher kA results in a slower acceleration. A kA of 0 will be promoted to a reasonable default of 0.1.
Minimum Value: 1e-05
Maximum Value: 100
Default Value: 0
Units: V/rps²
- with_motion_magic_cruise_velocity(new_motion_magic_cruise_velocity: float) MotionMagicConfigs #
Modifies this configuration’s motion_magic_cruise_velocity parameter and returns itself for method-chaining and easier to use config API.
This is the maximum velocity Motion Magic® based control modes are allowed to use. Motion Magic® Velocity control modes do not use this config. When using Motion Magic® Expo control modes, setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.
Minimum Value: 0
Maximum Value: 9999
Default Value: 0
Units: rps
- Parameters:
new_motion_magic_cruise_velocity (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_motion_magic_acceleration(new_motion_magic_acceleration: float) MotionMagicConfigs #
Modifies this configuration’s motion_magic_acceleration parameter and returns itself for method-chaining and easier to use config API.
This is the target acceleration Motion Magic® based control modes are allowed to use. Motion Magic® Expo control modes do not use this config.
Minimum Value: 0
Maximum Value: 9999
Default Value: 0
Units: rot per sec²
- Parameters:
new_motion_magic_acceleration (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_motion_magic_jerk(new_motion_magic_jerk: float) MotionMagicConfigs #
Modifies this configuration’s motion_magic_jerk parameter and returns itself for method-chaining and easier to use config API.
This is the target jerk (acceleration derivative) Motion Magic® based control modes are allowed to use. Motion Magic® Expo control modes do not use this config. This allows Motion Magic® support of S-Curves. If this is set to zero, then Motion Magic® will not apply a Jerk limit.
Minimum Value: 0
Maximum Value: 9999
Default Value: 0
Units: rot per sec³
- Parameters:
new_motion_magic_jerk (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_motion_magic_expo_k_v(new_motion_magic_expo_k_v: float) MotionMagicConfigs #
Modifies this configuration’s motion_magic_expo_k_v parameter and returns itself for method-chaining and easier to use config API.
This is the target kV used only by Motion Magic® Expo control modes, in units of V/rps. This represents the amount of voltage necessary to hold a velocity. In terms of the Motion Magic® Expo profile, a higher kV results in a slower maximum velocity. A kV of 0 will be promoted to a reasonable default of 0.12.
Minimum Value: 0.001
Maximum Value: 100
Default Value: 0
Units: V/rps
- Parameters:
new_motion_magic_expo_k_v (float) – Parameter to modify
- Returns:
Itself
- Return type:
- with_motion_magic_expo_k_a(new_motion_magic_expo_k_a: float) MotionMagicConfigs #
Modifies this configuration’s motion_magic_expo_k_a parameter and returns itself for method-chaining and easier to use config API.
This is the target kA used only by Motion Magic® Expo control modes, in units of V/rps². This represents the amount of voltage necessary to achieve an acceleration. In terms of the Motion Magic® Expo profile, a higher kA results in a slower acceleration. A kA of 0 will be promoted to a reasonable default of 0.1.
Minimum Value: 1e-05
Maximum Value: 100
Default Value: 0
Units: V/rps²
- Parameters:
new_motion_magic_expo_k_a (float) – Parameter to modify
- Returns:
Itself
- Return type:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.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:
- 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:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.ClosedLoopGeneralConfigs#
Configs that affect general behavior during closed-looping.
Includes Continuous Wrap features.
- continuous_wrap: bool = False#
Wrap position error within [-0.5,+0.5) mechanism rotations. Typically used for continuous position closed-loops like swerve azimuth.
This uses the mechanism rotation value. If there is a gear ratio between the sensor and the mechanism, make sure to apply a SensorToMechanismRatio so the closed loop operates on the full rotation.
Default Value: False
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.Slot0Configs#
Gains for the specified slot.
If this slot is selected, these gains are used in closed loop control requests.
- k_p: float = 0#
Proportional Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps of error, or 1/rps.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_i: float = 0#
Integral Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_d: float = 0#
Derivative Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_s: float = 0#
Static Feedforward Gain
This is added to the closed loop output. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.
The sign is typically determined by reference velocity when using position, velocity, and Motion Magic® closed loop modes. However, when using position closed loop with zero velocity reference (no motion profiling), the application can instead use the position closed loop error by setting the Static Feedforward Sign configuration parameter. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
Minimum Value: -512
Maximum Value: 511
Default Value: 0
Units:
- k_v: float = 0#
Velocity Feedforward Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_a: float = 0#
Acceleration Feedforward Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_g: float = 0#
Gravity Feedforward/Feedback Gain
This is added to the closed loop output. The sign is determined by GravityType. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.
Minimum Value: -512
Maximum Value: 511
Default Value: 0
Units:
- gravity_type: GravityTypeValue#
Gravity Feedforward/Feedback Type
This determines the type of the gravity feedforward/feedback.
Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always have the same sign.
Choose Arm_Cosine for systems where the gravity feedback is dependent on the angular position of the mechanism, such as an arm. The gravity feedback output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor reports a position of 0 when the mechanism is horizonal (parallel to the ground), and the reported sensor position is 1:1 with the mechanism.
- static_feedforward_sign: StaticFeedforwardSignValue#
Static Feedforward Sign during position closed loop
This determines the sign of the applied kS during position closed-loop modes. The default behavior uses the velocity reference sign. This works well with velocity closed loop, Motion Magic® controls, and position closed loop when velocity reference is specified (motion profiling).
However, when using position closed loop with zero velocity reference (no motion profiling), the application may want to apply static feedforward based on the closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
- with_k_p(new_k_p: float) Slot0Configs #
Modifies this configuration’s k_p parameter and returns itself for method-chaining and easier to use config API.
Proportional Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps of error, or 1/rps.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- Parameters:
new_k_p (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- with_k_d(new_k_d: float) Slot0Configs #
Modifies this configuration’s k_d parameter and returns itself for method-chaining and easier to use config API.
Derivative Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- Parameters:
new_k_d (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- 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:
- with_k_a(new_k_a: float) Slot0Configs #
Modifies this configuration’s k_a parameter and returns itself for method-chaining and easier to use config API.
Acceleration Feedforward Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- Parameters:
new_k_a (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- 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:
- with_static_feedforward_sign(new_static_feedforward_sign: StaticFeedforwardSignValue) Slot0Configs #
Modifies this configuration’s static_feedforward_sign parameter and returns itself for method-chaining and easier to use config API.
Static Feedforward Sign during position closed loop
This determines the sign of the applied kS during position closed-loop modes. The default behavior uses the velocity reference sign. This works well with velocity closed loop, Motion Magic® controls, and position closed loop when velocity reference is specified (motion profiling).
However, when using position closed loop with zero velocity reference (no motion profiling), the application may want to apply static feedforward based on the closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
- Parameters:
new_static_feedforward_sign (StaticFeedforwardSignValue) – Parameter to modify
- Returns:
Itself
- Return type:
- classmethod from_other(value) Slot0Configs #
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.Slot1Configs#
Gains for the specified slot.
If this slot is selected, these gains are used in closed loop control requests.
- k_p: float = 0#
Proportional Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps, or 1/rps.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_i: float = 0#
Integral Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_d: float = 0#
Derivative Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_s: float = 0#
Static Feedforward Gain
This is added to the closed loop output. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.
The sign is typically determined by reference velocity when using position, velocity, and Motion Magic® closed loop modes. However, when using position closed loop with zero velocity reference (no motion profiling), the application can instead use the position closed loop error by setting the Static Feedforward Sign configuration parameter. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
Minimum Value: -512
Maximum Value: 511
Default Value: 0
Units:
- k_v: float = 0#
Velocity Feedforward Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_a: float = 0#
Acceleration Feedforward Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_g: float = 0#
Gravity Feedforward/Feedback Gain
This is added to the closed loop output. The sign is determined by GravityType. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.
Minimum Value: -512
Maximum Value: 511
Default Value: 0
Units:
- gravity_type: GravityTypeValue#
Gravity Feedforward/Feedback Type
This determines the type of the gravity feedforward/feedback.
Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always be positive.
Choose Arm_Cosine for systems where the gravity feedback is dependent on the angular position of the mechanism, such as an arm. The gravity feedback output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor position is 0 when the mechanism is horizonal, and one rotation of the mechanism corresponds to one rotation of the sensor position.
- static_feedforward_sign: StaticFeedforwardSignValue#
Static Feedforward Sign during position closed loop
This determines the sign of the applied kS during position closed-loop modes. The default behavior uses the velocity reference sign. This works well with velocity closed loop, Motion Magic® controls, and position closed loop when velocity reference is specified (motion profiling).
However, when using position closed loop with zero velocity reference (no motion profiling), the application may want to apply static feedforward based on the closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
- with_k_p(new_k_p: float) Slot1Configs #
Modifies this configuration’s k_p parameter and returns itself for method-chaining and easier to use config API.
Proportional Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps, or 1/rps.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- Parameters:
new_k_p (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- with_k_d(new_k_d: float) Slot1Configs #
Modifies this configuration’s k_d parameter and returns itself for method-chaining and easier to use config API.
Derivative Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- Parameters:
new_k_d (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- 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:
- with_k_a(new_k_a: float) Slot1Configs #
Modifies this configuration’s k_a parameter and returns itself for method-chaining and easier to use config API.
Acceleration Feedforward Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- Parameters:
new_k_a (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- 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:
- with_static_feedforward_sign(new_static_feedforward_sign: StaticFeedforwardSignValue) Slot1Configs #
Modifies this configuration’s static_feedforward_sign parameter and returns itself for method-chaining and easier to use config API.
Static Feedforward Sign during position closed loop
This determines the sign of the applied kS during position closed-loop modes. The default behavior uses the velocity reference sign. This works well with velocity closed loop, Motion Magic® controls, and position closed loop when velocity reference is specified (motion profiling).
However, when using position closed loop with zero velocity reference (no motion profiling), the application may want to apply static feedforward based on the closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
- Parameters:
new_static_feedforward_sign (StaticFeedforwardSignValue) – Parameter to modify
- Returns:
Itself
- Return type:
- classmethod from_other(value) Slot1Configs #
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.Slot2Configs#
Gains for the specified slot.
If this slot is selected, these gains are used in closed loop control requests.
- k_p: float = 0#
Proportional Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps, or 1/rps.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_i: float = 0#
Integral Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_d: float = 0#
Derivative Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_s: float = 0#
Static Feedforward Gain
This is added to the closed loop output. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.
The sign is typically determined by reference velocity when using position, velocity, and Motion Magic® closed loop modes. However, when using position closed loop with zero velocity reference (no motion profiling), the application can instead use the position closed loop error by setting the Static Feedforward Sign configuration parameter. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
Minimum Value: -512
Maximum Value: 511
Default Value: 0
Units:
- k_v: float = 0#
Velocity Feedforward Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_a: float = 0#
Acceleration Feedforward Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_g: float = 0#
Gravity Feedforward/Feedback Gain
This is added to the closed loop output. The sign is determined by GravityType. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.
Minimum Value: -512
Maximum Value: 511
Default Value: 0
Units:
- gravity_type: GravityTypeValue#
Gravity Feedforward/Feedback Type
This determines the type of the gravity feedforward/feedback.
Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always be positive.
Choose Arm_Cosine for systems where the gravity feedback is dependent on the angular position of the mechanism, such as an arm. The gravity feedback output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor position is 0 when the mechanism is horizonal, and one rotation of the mechanism corresponds to one rotation of the sensor position.
- static_feedforward_sign: StaticFeedforwardSignValue#
Static Feedforward Sign during position closed loop
This determines the sign of the applied kS during position closed-loop modes. The default behavior uses the velocity reference sign. This works well with velocity closed loop, Motion Magic® controls, and position closed loop when velocity reference is specified (motion profiling).
However, when using position closed loop with zero velocity reference (no motion profiling), the application may want to apply static feedforward based on the closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
- with_k_p(new_k_p: float) Slot2Configs #
Modifies this configuration’s k_p parameter and returns itself for method-chaining and easier to use config API.
Proportional Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps, or 1/rps.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- Parameters:
new_k_p (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- with_k_d(new_k_d: float) Slot2Configs #
Modifies this configuration’s k_d parameter and returns itself for method-chaining and easier to use config API.
Derivative Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- Parameters:
new_k_d (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- 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:
- with_k_a(new_k_a: float) Slot2Configs #
Modifies this configuration’s k_a parameter and returns itself for method-chaining and easier to use config API.
Acceleration Feedforward Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- Parameters:
new_k_a (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- 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:
- with_static_feedforward_sign(new_static_feedforward_sign: StaticFeedforwardSignValue) Slot2Configs #
Modifies this configuration’s static_feedforward_sign parameter and returns itself for method-chaining and easier to use config API.
Static Feedforward Sign during position closed loop
This determines the sign of the applied kS during position closed-loop modes. The default behavior uses the velocity reference sign. This works well with velocity closed loop, Motion Magic® controls, and position closed loop when velocity reference is specified (motion profiling).
However, when using position closed loop with zero velocity reference (no motion profiling), the application may want to apply static feedforward based on the closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
- Parameters:
new_static_feedforward_sign (StaticFeedforwardSignValue) – Parameter to modify
- Returns:
Itself
- Return type:
- classmethod from_other(value) Slot2Configs #
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- serialize() str #
Serialize this object into a string
- Returns:
This object’s data serialized into a string
- Return type:
str
- class phoenix6.configs.config_groups.SlotConfigs#
Gains for the specified slot.
If this slot is selected, these gains are used in closed loop control requests.
- slot_number = 0#
Chooses which slot these configs are for.
- k_p: float = 0#
Proportional Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps of error, or 1/rps.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_i: float = 0#
Integral Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_d: float = 0#
Derivative Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_s: float = 0#
Static Feedforward Gain
This is added to the closed loop output. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.
The sign is typically determined by reference velocity when using position, velocity, and Motion Magic® closed loop modes. However, when using position closed loop with zero velocity reference (no motion profiling), the application can instead use the position closed loop error by setting the Static Feedforward Sign configuration parameter. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
Minimum Value: -512
Maximum Value: 511
Default Value: 0
Units:
- k_v: float = 0#
Velocity Feedforward Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_a: float = 0#
Acceleration Feedforward Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- k_g: float = 0#
Gravity Feedforward/Feedback Gain
This is added to the closed loop output. The sign is determined by GravityType. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.
Minimum Value: -512
Maximum Value: 511
Default Value: 0
Units:
- gravity_type: GravityTypeValue#
Gravity Feedforward/Feedback Type
This determines the type of the gravity feedforward/feedback.
Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always have the same sign.
Choose Arm_Cosine for systems where the gravity feedback is dependent on the angular position of the mechanism, such as an arm. The gravity feedback output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor reports a position of 0 when the mechanism is horizonal (parallel to the ground), and the reported sensor position is 1:1 with the mechanism.
- static_feedforward_sign: StaticFeedforwardSignValue#
Static Feedforward Sign during position closed loop
This determines the sign of the applied kS during position closed-loop modes. The default behavior uses the velocity reference sign. This works well with velocity closed loop, Motion Magic® controls, and position closed loop when velocity reference is specified (motion profiling).
However, when using position closed loop with zero velocity reference (no motion profiling), the application may want to apply static feedforward based on the closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
- with_k_p(new_k_p: float) SlotConfigs #
Modifies this configuration’s k_p parameter and returns itself for method-chaining and easier to use config API.
Proportional Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps of error, or 1/rps.
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- Parameters:
new_k_p (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- with_k_d(new_k_d: float) SlotConfigs #
Modifies this configuration’s k_d parameter and returns itself for method-chaining and easier to use config API.
Derivative Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- Parameters:
new_k_d (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- 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:
- with_k_a(new_k_a: float) SlotConfigs #
Modifies this configuration’s k_a parameter and returns itself for method-chaining and easier to use config API.
Acceleration Feedforward Gain
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).
Minimum Value: 0
Maximum Value: 3.4e+38
Default Value: 0
Units:
- Parameters:
new_k_a (float) – Parameter to modify
- Returns:
Itself
- Return type:
- 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:
- 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:
- with_static_feedforward_sign(new_static_feedforward_sign: StaticFeedforwardSignValue) SlotConfigs #
Modifies this configuration’s static_feedforward_sign parameter and returns itself for method-chaining and easier to use config API.
Static Feedforward Sign during position closed loop
This determines the sign of the applied kS during position closed-loop modes. The default behavior uses the velocity reference sign. This works well with velocity closed loop, Motion Magic® controls, and position closed loop when velocity reference is specified (motion profiling).
However, when using position closed loop with zero velocity reference (no motion profiling), the application may want to apply static feedforward based on the closed loop error sign instead. When doing so, we recommend the minimal amount of kS, otherwise the motor output may dither when closed loop error is near zero.
- Parameters:
new_static_feedforward_sign (StaticFeedforwardSignValue) – Parameter to modify
- Returns:
Itself
- Return type:
- deserialize(string: str) phoenix6.status_code.StatusCode #
Deserialize string and put values into this object
- Parameters:
string (str) – String to deserialize
- Returns:
OK if deserialization is OK
- Return type:
- 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 #