phoenix6.controls¶

Subpackages¶

Submodules¶

Package Contents¶

class phoenix6.controls.DutyCycleOut(output: float, enable_foc: bool = True, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Request a specified motor duty cycle.

This control mode will output a proportion of the supplied voltage which is supplied by the user.

Parameters:
  • output (float) – Proportion of supply voltage to apply in fractional units between -1 and +1

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

output¶

Proportion of supply voltage to apply in fractional units between -1 and +1

  • Units: fractional

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_output(new_output: float) DutyCycleOut¶

Modifies this Control Request’s output parameter and returns itself for method-chaining and easier to use request API.

Proportion of supply voltage to apply in fractional units between -1 and +1

  • Units: fractional

Parameters:

new_output (float) – Parameter to modify

Returns:

Itself

Return type:

DutyCycleOut

with_enable_foc(new_enable_foc: bool) DutyCycleOut¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DutyCycleOut

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DutyCycleOut¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DutyCycleOut

with_limit_forward_motion(new_limit_forward_motion: bool) DutyCycleOut¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DutyCycleOut

with_limit_reverse_motion(new_limit_reverse_motion: bool) DutyCycleOut¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DutyCycleOut

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DutyCycleOut¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DutyCycleOut

with_ignore_software_limits(new_ignore_software_limits: bool) DutyCycleOut¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DutyCycleOut

with_use_timesync(new_use_timesync: bool) DutyCycleOut¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DutyCycleOut

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DutyCycleOut¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DutyCycleOut

class phoenix6.controls.TorqueCurrentFOC(output: phoenix6.units.ampere, max_abs_duty_cycle: float = 1.0, deadband: phoenix6.units.ampere = 0.0, override_coast_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requires Phoenix Pro; Request a specified motor current (field oriented control).

This control request will drive the motor to the requested motor (stator) current value. This leverages field oriented control (FOC), which means greater peak power than what is documented. This scales to torque based on Motor’s kT constant.

Parameters:
  • output (ampere) – Amount of motor current in Amperes

  • max_abs_duty_cycle (float) – The maximum absolute motor output that can be applied, which effectively limits the velocity. For example, 0.50 means no more than 50% output in either direction. This is useful for preventing the motor from spinning to its terminal velocity when there is no external torque applied unto the rotor. Note this is absolute maximum, so the value should be between zero and one.

  • deadband (ampere) – Deadband in Amperes. If torque request is within deadband, the bridge output is neutral. If deadband is set to zero then there is effectively no deadband. Note if deadband is zero, a free spinning motor will spin for quite a while as the firmware attempts to hold the motor’s bemf. If user expects motor to cease spinning quickly with a demand of zero, we recommend a deadband of one Ampere. This value will be converted to an integral value of amps.

  • override_coast_dur_neutral (bool) – Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

output¶

Amount of motor current in Amperes

  • Units: A

max_abs_duty_cycle = '1.0'¶

The maximum absolute motor output that can be applied, which effectively limits the velocity. For example, 0.50 means no more than 50% output in either direction. This is useful for preventing the motor from spinning to its terminal velocity when there is no external torque applied unto the rotor. Note this is absolute maximum, so the value should be between zero and one.

  • Units: fractional

deadband = '0.0'¶

Deadband in Amperes. If torque request is within deadband, the bridge output is neutral. If deadband is set to zero then there is effectively no deadband. Note if deadband is zero, a free spinning motor will spin for quite a while as the firmware attempts to hold the motor’s bemf. If user expects motor to cease spinning quickly with a demand of zero, we recommend a deadband of one Ampere. This value will be converted to an integral value of amps.

  • Units: A

override_coast_dur_neutral = 'False'¶

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_output(new_output: phoenix6.units.ampere) TorqueCurrentFOC¶

Modifies this Control Request’s output parameter and returns itself for method-chaining and easier to use request API.

Amount of motor current in Amperes

  • Units: A

Parameters:

new_output (ampere) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentFOC

with_max_abs_duty_cycle(new_max_abs_duty_cycle: float) TorqueCurrentFOC¶

Modifies this Control Request’s max_abs_duty_cycle parameter and returns itself for method-chaining and easier to use request API.

The maximum absolute motor output that can be applied, which effectively limits the velocity. For example, 0.50 means no more than 50% output in either direction. This is useful for preventing the motor from spinning to its terminal velocity when there is no external torque applied unto the rotor. Note this is absolute maximum, so the value should be between zero and one.

  • Units: fractional

Parameters:

new_max_abs_duty_cycle (float) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentFOC

with_deadband(new_deadband: phoenix6.units.ampere) TorqueCurrentFOC¶

Modifies this Control Request’s deadband parameter and returns itself for method-chaining and easier to use request API.

Deadband in Amperes. If torque request is within deadband, the bridge output is neutral. If deadband is set to zero then there is effectively no deadband. Note if deadband is zero, a free spinning motor will spin for quite a while as the firmware attempts to hold the motor’s bemf. If user expects motor to cease spinning quickly with a demand of zero, we recommend a deadband of one Ampere. This value will be converted to an integral value of amps.

  • Units: A

Parameters:

new_deadband (ampere) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentFOC

with_override_coast_dur_neutral(new_override_coast_dur_neutral: bool) TorqueCurrentFOC¶

Modifies this Control Request’s override_coast_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

Parameters:

new_override_coast_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentFOC

with_limit_forward_motion(new_limit_forward_motion: bool) TorqueCurrentFOC¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentFOC

with_limit_reverse_motion(new_limit_reverse_motion: bool) TorqueCurrentFOC¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentFOC

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) TorqueCurrentFOC¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentFOC

with_ignore_software_limits(new_ignore_software_limits: bool) TorqueCurrentFOC¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentFOC

with_use_timesync(new_use_timesync: bool) TorqueCurrentFOC¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentFOC

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) TorqueCurrentFOC¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

TorqueCurrentFOC

class phoenix6.controls.VoltageOut(output: phoenix6.units.volt, enable_foc: bool = True, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Request a specified voltage.

This control mode will attempt to apply the specified voltage to the motor. If the supply voltage is below the requested voltage, the motor controller will output the supply voltage.

Parameters:
  • output (volt) – Voltage to attempt to drive at

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

output¶

Voltage to attempt to drive at

  • Units: Volts

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_output(new_output: phoenix6.units.volt) VoltageOut¶

Modifies this Control Request’s output parameter and returns itself for method-chaining and easier to use request API.

Voltage to attempt to drive at

  • Units: Volts

Parameters:

new_output (volt) – Parameter to modify

Returns:

Itself

Return type:

VoltageOut

with_enable_foc(new_enable_foc: bool) VoltageOut¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

VoltageOut

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) VoltageOut¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

VoltageOut

with_limit_forward_motion(new_limit_forward_motion: bool) VoltageOut¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

VoltageOut

with_limit_reverse_motion(new_limit_reverse_motion: bool) VoltageOut¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

VoltageOut

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) VoltageOut¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

VoltageOut

with_ignore_software_limits(new_ignore_software_limits: bool) VoltageOut¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

VoltageOut

with_use_timesync(new_use_timesync: bool) VoltageOut¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

VoltageOut

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) VoltageOut¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

VoltageOut

class phoenix6.controls.PositionDutyCycle(position: phoenix6.units.rotation, velocity: phoenix6.units.rotations_per_second = 0.0, enable_foc: bool = True, feed_forward: float = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Request PID to target position with duty cycle feedforward.

This control mode will set the motor’s position setpoint to the position specified by the user. In addition, it will apply an additional duty cycle as an arbitrary feedforward value.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • velocity (rotations_per_second) – Velocity to drive toward in rotations per second. This is typically used for motion profiles generated by the robot program.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (float) – Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

velocity = '0.0'¶

Velocity to drive toward in rotations per second. This is typically used for motion profiles generated by the robot program.

  • Units: rotations per second

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) PositionDutyCycle¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

PositionDutyCycle

with_velocity(new_velocity: phoenix6.units.rotations_per_second) PositionDutyCycle¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Velocity to drive toward in rotations per second. This is typically used for motion profiles generated by the robot program.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

PositionDutyCycle

with_enable_foc(new_enable_foc: bool) PositionDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionDutyCycle

with_feed_forward(new_feed_forward: float) PositionDutyCycle¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

Parameters:

new_feed_forward (float) – Parameter to modify

Returns:

Itself

Return type:

PositionDutyCycle

with_slot(new_slot: int) PositionDutyCycle¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

PositionDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) PositionDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) PositionDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) PositionDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) PositionDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) PositionDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionDutyCycle

with_use_timesync(new_use_timesync: bool) PositionDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) PositionDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

PositionDutyCycle

class phoenix6.controls.PositionVoltage(position: phoenix6.units.rotation, velocity: phoenix6.units.rotations_per_second = 0.0, enable_foc: bool = True, feed_forward: phoenix6.units.volt = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Request PID to target position with voltage feedforward

This control mode will set the motor’s position setpoint to the position specified by the user. In addition, it will apply an additional voltage as an arbitrary feedforward value.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • velocity (rotations_per_second) – Velocity to drive toward in rotations per second. This is typically used for motion profiles generated by the robot program.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (volt) – Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

velocity = '0.0'¶

Velocity to drive toward in rotations per second. This is typically used for motion profiles generated by the robot program.

  • Units: rotations per second

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • Units: Volts

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) PositionVoltage¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

PositionVoltage

with_velocity(new_velocity: phoenix6.units.rotations_per_second) PositionVoltage¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Velocity to drive toward in rotations per second. This is typically used for motion profiles generated by the robot program.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

PositionVoltage

with_enable_foc(new_enable_foc: bool) PositionVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionVoltage

with_feed_forward(new_feed_forward: phoenix6.units.volt) PositionVoltage¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • Units: Volts

Parameters:

new_feed_forward (volt) – Parameter to modify

Returns:

Itself

Return type:

PositionVoltage

with_slot(new_slot: int) PositionVoltage¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

PositionVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) PositionVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) PositionVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) PositionVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) PositionVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) PositionVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionVoltage

with_use_timesync(new_use_timesync: bool) PositionVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) PositionVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

PositionVoltage

class phoenix6.controls.PositionTorqueCurrentFOC(position: phoenix6.units.rotation, velocity: phoenix6.units.rotations_per_second = 0.0, feed_forward: phoenix6.units.ampere = 0.0, slot: int = 0, override_coast_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requires Phoenix Pro; Request PID to target position with torque current feedforward.

This control mode will set the motor’s position setpoint to the position specified by the user. In addition, it will apply an additional torque current as an arbitrary feedforward value.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • velocity (rotations_per_second) – Velocity to drive toward in rotations per second. This is typically used for motion profiles generated by the robot program.

  • feed_forward (ampere) –

    Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

    User can use motor’s kT to scale Newton-meter to Amperes.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_coast_dur_neutral (bool) – Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

velocity = '0.0'¶

Velocity to drive toward in rotations per second. This is typically used for motion profiles generated by the robot program.

  • Units: rotations per second

feed_forward = '0.0'¶

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_coast_dur_neutral = 'False'¶

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) PositionTorqueCurrentFOC¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

PositionTorqueCurrentFOC

with_velocity(new_velocity: phoenix6.units.rotations_per_second) PositionTorqueCurrentFOC¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Velocity to drive toward in rotations per second. This is typically used for motion profiles generated by the robot program.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

PositionTorqueCurrentFOC

with_feed_forward(new_feed_forward: phoenix6.units.ampere) PositionTorqueCurrentFOC¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

Parameters:

new_feed_forward (ampere) – Parameter to modify

Returns:

Itself

Return type:

PositionTorqueCurrentFOC

with_slot(new_slot: int) PositionTorqueCurrentFOC¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

PositionTorqueCurrentFOC

with_override_coast_dur_neutral(new_override_coast_dur_neutral: bool) PositionTorqueCurrentFOC¶

Modifies this Control Request’s override_coast_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

Parameters:

new_override_coast_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionTorqueCurrentFOC

with_limit_forward_motion(new_limit_forward_motion: bool) PositionTorqueCurrentFOC¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionTorqueCurrentFOC

with_limit_reverse_motion(new_limit_reverse_motion: bool) PositionTorqueCurrentFOC¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionTorqueCurrentFOC

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) PositionTorqueCurrentFOC¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionTorqueCurrentFOC

with_ignore_software_limits(new_ignore_software_limits: bool) PositionTorqueCurrentFOC¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionTorqueCurrentFOC

with_use_timesync(new_use_timesync: bool) PositionTorqueCurrentFOC¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

PositionTorqueCurrentFOC

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) PositionTorqueCurrentFOC¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

PositionTorqueCurrentFOC

class phoenix6.controls.VelocityDutyCycle(velocity: phoenix6.units.rotations_per_second, acceleration: phoenix6.units.rotations_per_second_squared = 0.0, enable_foc: bool = True, feed_forward: float = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Request PID to target velocity with duty cycle feedforward.

This control mode will set the motor’s velocity setpoint to the velocity specified by the user. In addition, it will apply an additional voltage as an arbitrary feedforward value.

Parameters:
  • velocity (rotations_per_second) – Velocity to drive toward in rotations per second.

  • acceleration (rotations_per_second_squared) – Acceleration to drive toward in rotations per second squared. This is typically used for motion profiles generated by the robot program.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (float) – Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

velocity¶

Velocity to drive toward in rotations per second.

  • Units: rotations per second

acceleration = '0.0'¶

Acceleration to drive toward in rotations per second squared. This is typically used for motion profiles generated by the robot program.

  • Units: rotations per second²

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_velocity(new_velocity: phoenix6.units.rotations_per_second) VelocityDutyCycle¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Velocity to drive toward in rotations per second.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

VelocityDutyCycle

with_acceleration(new_acceleration: phoenix6.units.rotations_per_second_squared) VelocityDutyCycle¶

Modifies this Control Request’s acceleration parameter and returns itself for method-chaining and easier to use request API.

Acceleration to drive toward in rotations per second squared. This is typically used for motion profiles generated by the robot program.

  • Units: rotations per second²

Parameters:

new_acceleration (rotations_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

VelocityDutyCycle

with_enable_foc(new_enable_foc: bool) VelocityDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityDutyCycle

with_feed_forward(new_feed_forward: float) VelocityDutyCycle¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

Parameters:

new_feed_forward (float) – Parameter to modify

Returns:

Itself

Return type:

VelocityDutyCycle

with_slot(new_slot: int) VelocityDutyCycle¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

VelocityDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) VelocityDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) VelocityDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) VelocityDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) VelocityDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) VelocityDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityDutyCycle

with_use_timesync(new_use_timesync: bool) VelocityDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) VelocityDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

VelocityDutyCycle

class phoenix6.controls.VelocityVoltage(velocity: phoenix6.units.rotations_per_second, acceleration: phoenix6.units.rotations_per_second_squared = 0.0, enable_foc: bool = True, feed_forward: phoenix6.units.volt = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Request PID to target velocity with voltage feedforward.

This control mode will set the motor’s velocity setpoint to the velocity specified by the user. In addition, it will apply an additional voltage as an arbitrary feedforward value.

Parameters:
  • velocity (rotations_per_second) – Velocity to drive toward in rotations per second.

  • acceleration (rotations_per_second_squared) – Acceleration to drive toward in rotations per second squared. This is typically used for motion profiles generated by the robot program.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (volt) – Feedforward to apply in volts This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

velocity¶

Velocity to drive toward in rotations per second.

  • Units: rotations per second

acceleration = '0.0'¶

Acceleration to drive toward in rotations per second squared. This is typically used for motion profiles generated by the robot program.

  • Units: rotations per second²

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in volts This is added to the output of the onboard feedforward terms.

  • Units: Volts

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_velocity(new_velocity: phoenix6.units.rotations_per_second) VelocityVoltage¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Velocity to drive toward in rotations per second.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

VelocityVoltage

with_acceleration(new_acceleration: phoenix6.units.rotations_per_second_squared) VelocityVoltage¶

Modifies this Control Request’s acceleration parameter and returns itself for method-chaining and easier to use request API.

Acceleration to drive toward in rotations per second squared. This is typically used for motion profiles generated by the robot program.

  • Units: rotations per second²

Parameters:

new_acceleration (rotations_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

VelocityVoltage

with_enable_foc(new_enable_foc: bool) VelocityVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityVoltage

with_feed_forward(new_feed_forward: phoenix6.units.volt) VelocityVoltage¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in volts This is added to the output of the onboard feedforward terms.

  • Units: Volts

Parameters:

new_feed_forward (volt) – Parameter to modify

Returns:

Itself

Return type:

VelocityVoltage

with_slot(new_slot: int) VelocityVoltage¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

VelocityVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) VelocityVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) VelocityVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) VelocityVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) VelocityVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) VelocityVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityVoltage

with_use_timesync(new_use_timesync: bool) VelocityVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) VelocityVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

VelocityVoltage

class phoenix6.controls.VelocityTorqueCurrentFOC(velocity: phoenix6.units.rotations_per_second, acceleration: phoenix6.units.rotations_per_second_squared = 0.0, feed_forward: phoenix6.units.ampere = 0.0, slot: int = 0, override_coast_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requires Phoenix Pro; Request PID to target velocity with torque current feedforward.

This control mode will set the motor’s velocity setpoint to the velocity specified by the user. In addition, it will apply an additional torque current as an arbitrary feedforward value.

Parameters:
  • velocity (rotations_per_second) – Velocity to drive toward in rotations per second.

  • acceleration (rotations_per_second_squared) – Acceleration to drive toward in rotations per second squared. This is typically used for motion profiles generated by the robot program.

  • feed_forward (ampere) –

    Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

    User can use motor’s kT to scale Newton-meter to Amperes.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_coast_dur_neutral (bool) – Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

velocity¶

Velocity to drive toward in rotations per second.

  • Units: rotations per second

acceleration = '0.0'¶

Acceleration to drive toward in rotations per second squared. This is typically used for motion profiles generated by the robot program.

  • Units: rotations per second²

feed_forward = '0.0'¶

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_coast_dur_neutral = 'False'¶

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_velocity(new_velocity: phoenix6.units.rotations_per_second) VelocityTorqueCurrentFOC¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Velocity to drive toward in rotations per second.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

VelocityTorqueCurrentFOC

with_acceleration(new_acceleration: phoenix6.units.rotations_per_second_squared) VelocityTorqueCurrentFOC¶

Modifies this Control Request’s acceleration parameter and returns itself for method-chaining and easier to use request API.

Acceleration to drive toward in rotations per second squared. This is typically used for motion profiles generated by the robot program.

  • Units: rotations per second²

Parameters:

new_acceleration (rotations_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

VelocityTorqueCurrentFOC

with_feed_forward(new_feed_forward: phoenix6.units.ampere) VelocityTorqueCurrentFOC¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

Parameters:

new_feed_forward (ampere) – Parameter to modify

Returns:

Itself

Return type:

VelocityTorqueCurrentFOC

with_slot(new_slot: int) VelocityTorqueCurrentFOC¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

VelocityTorqueCurrentFOC

with_override_coast_dur_neutral(new_override_coast_dur_neutral: bool) VelocityTorqueCurrentFOC¶

Modifies this Control Request’s override_coast_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

Parameters:

new_override_coast_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityTorqueCurrentFOC

with_limit_forward_motion(new_limit_forward_motion: bool) VelocityTorqueCurrentFOC¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityTorqueCurrentFOC

with_limit_reverse_motion(new_limit_reverse_motion: bool) VelocityTorqueCurrentFOC¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityTorqueCurrentFOC

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) VelocityTorqueCurrentFOC¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityTorqueCurrentFOC

with_ignore_software_limits(new_ignore_software_limits: bool) VelocityTorqueCurrentFOC¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityTorqueCurrentFOC

with_use_timesync(new_use_timesync: bool) VelocityTorqueCurrentFOC¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

VelocityTorqueCurrentFOC

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) VelocityTorqueCurrentFOC¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

VelocityTorqueCurrentFOC

class phoenix6.controls.MotionMagicDutyCycle(position: phoenix6.units.rotation, enable_foc: bool = True, feed_forward: float = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final position using a motion profile. Users can optionally provide a duty cycle feedforward.

Motion Magic® produces a motion profile in real-time while attempting to honor the Cruise Velocity, Acceleration, and (optional) Jerk specified via the Motion Magic® configuration values. This control mode does not use the Expo_kV or Expo_kA configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is duty cycle based, so relevant closed-loop gains will use fractional duty cycle for the numerator: +1.0 represents full forward output.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (float) – Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) MotionMagicDutyCycle¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicDutyCycle

with_enable_foc(new_enable_foc: bool) MotionMagicDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicDutyCycle

with_feed_forward(new_feed_forward: float) MotionMagicDutyCycle¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

Parameters:

new_feed_forward (float) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicDutyCycle

with_slot(new_slot: int) MotionMagicDutyCycle¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) MotionMagicDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) MotionMagicDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) MotionMagicDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) MotionMagicDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) MotionMagicDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicDutyCycle

with_use_timesync(new_use_timesync: bool) MotionMagicDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) MotionMagicDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicDutyCycle

class phoenix6.controls.MotionMagicVoltage(position: phoenix6.units.rotation, enable_foc: bool = True, feed_forward: phoenix6.units.volt = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final position using a motion profile. Users can optionally provide a voltage feedforward.

Motion Magic® produces a motion profile in real-time while attempting to honor the Cruise Velocity, Acceleration, and (optional) Jerk specified via the Motion Magic® configuration values. This control mode does not use the Expo_kV or Expo_kA configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is voltage-based, so relevant closed-loop gains will use Volts for the numerator.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (volt) – Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • Units: Volts

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) MotionMagicVoltage¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVoltage

with_enable_foc(new_enable_foc: bool) MotionMagicVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVoltage

with_feed_forward(new_feed_forward: phoenix6.units.volt) MotionMagicVoltage¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • Units: Volts

Parameters:

new_feed_forward (volt) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVoltage

with_slot(new_slot: int) MotionMagicVoltage¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) MotionMagicVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) MotionMagicVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) MotionMagicVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) MotionMagicVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) MotionMagicVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVoltage

with_use_timesync(new_use_timesync: bool) MotionMagicVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) MotionMagicVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVoltage

class phoenix6.controls.MotionMagicTorqueCurrentFOC(position: phoenix6.units.rotation, feed_forward: phoenix6.units.ampere = 0.0, slot: int = 0, override_coast_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requires Phoenix Pro; Requests Motion Magic® to target a final position using a motion profile. Users can optionally provide a torque current feedforward.

Motion Magic® produces a motion profile in real-time while attempting to honor the Cruise Velocity, Acceleration, and (optional) Jerk specified via the Motion Magic® configuration values. This control mode does not use the Expo_kV or Expo_kA configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is based on torque current, so relevant closed-loop gains will use Amperes for the numerator.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • feed_forward (ampere) –

    Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

    User can use motor’s kT to scale Newton-meter to Amperes.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_coast_dur_neutral (bool) – Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

feed_forward = '0.0'¶

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_coast_dur_neutral = 'False'¶

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) MotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicTorqueCurrentFOC

with_feed_forward(new_feed_forward: phoenix6.units.ampere) MotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

Parameters:

new_feed_forward (ampere) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicTorqueCurrentFOC

with_slot(new_slot: int) MotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicTorqueCurrentFOC

with_override_coast_dur_neutral(new_override_coast_dur_neutral: bool) MotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s override_coast_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

Parameters:

new_override_coast_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicTorqueCurrentFOC

with_limit_forward_motion(new_limit_forward_motion: bool) MotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicTorqueCurrentFOC

with_limit_reverse_motion(new_limit_reverse_motion: bool) MotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicTorqueCurrentFOC

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) MotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicTorqueCurrentFOC

with_ignore_software_limits(new_ignore_software_limits: bool) MotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicTorqueCurrentFOC

with_use_timesync(new_use_timesync: bool) MotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicTorqueCurrentFOC

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) MotionMagicTorqueCurrentFOC¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicTorqueCurrentFOC

class phoenix6.controls.DifferentialDutyCycle(average_output: float, differential_position: phoenix6.units.rotation, enable_foc: bool = True, differential_slot: int = 1, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Request a specified motor duty cycle with a differential position closed-loop.

This control mode will output a proportion of the supplied voltage which is supplied by the user. It will also set the motor’s differential position setpoint to the specified position.

Parameters:
  • average_output (float) – Proportion of supply voltage to apply on the Average axis in fractional units between -1 and +1.

  • differential_position (rotation) – Differential position to drive towards in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • differential_slot (int) – Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

average_output¶

Proportion of supply voltage to apply on the Average axis in fractional units between -1 and +1.

  • Units: fractional

differential_position¶

Differential position to drive towards in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

differential_slot = '1'¶

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_average_output(new_average_output: float) DifferentialDutyCycle¶

Modifies this Control Request’s average_output parameter and returns itself for method-chaining and easier to use request API.

Proportion of supply voltage to apply on the Average axis in fractional units between -1 and +1.

  • Units: fractional

Parameters:

new_average_output (float) – Parameter to modify

Returns:

Itself

Return type:

DifferentialDutyCycle

with_differential_position(new_differential_position: phoenix6.units.rotation) DifferentialDutyCycle¶

Modifies this Control Request’s differential_position parameter and returns itself for method-chaining and easier to use request API.

Differential position to drive towards in rotations.

  • Units: rotations

Parameters:

new_differential_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialDutyCycle

with_enable_foc(new_enable_foc: bool) DifferentialDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialDutyCycle

with_differential_slot(new_differential_slot: int) DifferentialDutyCycle¶

Modifies this Control Request’s differential_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_differential_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DifferentialDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) DifferentialDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) DifferentialDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DifferentialDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) DifferentialDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialDutyCycle

with_use_timesync(new_use_timesync: bool) DifferentialDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialDutyCycle

class phoenix6.controls.DifferentialVoltage(average_output: phoenix6.units.volt, differential_position: phoenix6.units.rotation, enable_foc: bool = True, differential_slot: int = 1, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Request a specified voltage with a differential position closed-loop.

This control mode will attempt to apply the specified voltage to the motor. If the supply voltage is below the requested voltage, the motor controller will output the supply voltage. It will also set the motor’s differential position setpoint to the specified position.

Parameters:
  • average_output (volt) – Voltage to attempt to drive at on the Average axis.

  • differential_position (rotation) – Differential position to drive towards in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • differential_slot (int) – Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

average_output¶

Voltage to attempt to drive at on the Average axis.

  • Units: Volts

differential_position¶

Differential position to drive towards in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

differential_slot = '1'¶

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_average_output(new_average_output: phoenix6.units.volt) DifferentialVoltage¶

Modifies this Control Request’s average_output parameter and returns itself for method-chaining and easier to use request API.

Voltage to attempt to drive at on the Average axis.

  • Units: Volts

Parameters:

new_average_output (volt) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVoltage

with_differential_position(new_differential_position: phoenix6.units.rotation) DifferentialVoltage¶

Modifies this Control Request’s differential_position parameter and returns itself for method-chaining and easier to use request API.

Differential position to drive towards in rotations.

  • Units: rotations

Parameters:

new_differential_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVoltage

with_enable_foc(new_enable_foc: bool) DifferentialVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVoltage

with_differential_slot(new_differential_slot: int) DifferentialVoltage¶

Modifies this Control Request’s differential_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_differential_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DifferentialVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) DifferentialVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) DifferentialVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DifferentialVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) DifferentialVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVoltage

with_use_timesync(new_use_timesync: bool) DifferentialVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVoltage

class phoenix6.controls.DifferentialPositionDutyCycle(average_position: phoenix6.units.rotation, differential_position: phoenix6.units.rotation, enable_foc: bool = True, average_slot: int = 0, differential_slot: int = 1, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Request PID to target position with a differential position setpoint.

This control mode will set the motor’s position setpoint to the position specified by the user. It will also set the motor’s differential position setpoint to the specified position.

Parameters:
  • average_position (rotation) – Average position to drive toward in rotations.

  • differential_position (rotation) – Differential position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • average_slot (int) – Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • differential_slot (int) – Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

average_position¶

Average position to drive toward in rotations.

  • Units: rotations

differential_position¶

Differential position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

average_slot = '0'¶

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

differential_slot = '1'¶

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_average_position(new_average_position: phoenix6.units.rotation) DifferentialPositionDutyCycle¶

Modifies this Control Request’s average_position parameter and returns itself for method-chaining and easier to use request API.

Average position to drive toward in rotations.

  • Units: rotations

Parameters:

new_average_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionDutyCycle

with_differential_position(new_differential_position: phoenix6.units.rotation) DifferentialPositionDutyCycle¶

Modifies this Control Request’s differential_position parameter and returns itself for method-chaining and easier to use request API.

Differential position to drive toward in rotations.

  • Units: rotations

Parameters:

new_differential_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionDutyCycle

with_enable_foc(new_enable_foc: bool) DifferentialPositionDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionDutyCycle

with_average_slot(new_average_slot: int) DifferentialPositionDutyCycle¶

Modifies this Control Request’s average_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_average_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionDutyCycle

with_differential_slot(new_differential_slot: int) DifferentialPositionDutyCycle¶

Modifies this Control Request’s differential_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_differential_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DifferentialPositionDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) DifferentialPositionDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) DifferentialPositionDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DifferentialPositionDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) DifferentialPositionDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionDutyCycle

with_use_timesync(new_use_timesync: bool) DifferentialPositionDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialPositionDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionDutyCycle

class phoenix6.controls.DifferentialPositionVoltage(average_position: phoenix6.units.rotation, differential_position: phoenix6.units.rotation, enable_foc: bool = True, average_slot: int = 0, differential_slot: int = 1, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Request PID to target position with a differential position setpoint

This control mode will set the motor’s position setpoint to the position specified by the user. It will also set the motor’s differential position setpoint to the specified position.

Parameters:
  • average_position (rotation) – Average position to drive toward in rotations.

  • differential_position (rotation) – Differential position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • average_slot (int) – Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • differential_slot (int) – Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

average_position¶

Average position to drive toward in rotations.

  • Units: rotations

differential_position¶

Differential position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

average_slot = '0'¶

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

differential_slot = '1'¶

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_average_position(new_average_position: phoenix6.units.rotation) DifferentialPositionVoltage¶

Modifies this Control Request’s average_position parameter and returns itself for method-chaining and easier to use request API.

Average position to drive toward in rotations.

  • Units: rotations

Parameters:

new_average_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionVoltage

with_differential_position(new_differential_position: phoenix6.units.rotation) DifferentialPositionVoltage¶

Modifies this Control Request’s differential_position parameter and returns itself for method-chaining and easier to use request API.

Differential position to drive toward in rotations.

  • Units: rotations

Parameters:

new_differential_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionVoltage

with_enable_foc(new_enable_foc: bool) DifferentialPositionVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionVoltage

with_average_slot(new_average_slot: int) DifferentialPositionVoltage¶

Modifies this Control Request’s average_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_average_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionVoltage

with_differential_slot(new_differential_slot: int) DifferentialPositionVoltage¶

Modifies this Control Request’s differential_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_differential_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DifferentialPositionVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) DifferentialPositionVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) DifferentialPositionVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DifferentialPositionVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) DifferentialPositionVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionVoltage

with_use_timesync(new_use_timesync: bool) DifferentialPositionVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialPositionVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialPositionVoltage

class phoenix6.controls.DifferentialVelocityDutyCycle(average_velocity: phoenix6.units.rotations_per_second, differential_position: phoenix6.units.rotation, enable_foc: bool = True, average_slot: int = 0, differential_slot: int = 1, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Request PID to target velocity with a differential position setpoint.

This control mode will set the motor’s velocity setpoint to the velocity specified by the user. It will also set the motor’s differential position setpoint to the specified position.

Parameters:
  • average_velocity (rotations_per_second) – Average velocity to drive toward in rotations per second.

  • differential_position (rotation) – Differential position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • average_slot (int) – Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • differential_slot (int) – Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

average_velocity¶

Average velocity to drive toward in rotations per second.

  • Units: rotations per second

differential_position¶

Differential position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

average_slot = '0'¶

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

differential_slot = '1'¶

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_average_velocity(new_average_velocity: phoenix6.units.rotations_per_second) DifferentialVelocityDutyCycle¶

Modifies this Control Request’s average_velocity parameter and returns itself for method-chaining and easier to use request API.

Average velocity to drive toward in rotations per second.

  • Units: rotations per second

Parameters:

new_average_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityDutyCycle

with_differential_position(new_differential_position: phoenix6.units.rotation) DifferentialVelocityDutyCycle¶

Modifies this Control Request’s differential_position parameter and returns itself for method-chaining and easier to use request API.

Differential position to drive toward in rotations.

  • Units: rotations

Parameters:

new_differential_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityDutyCycle

with_enable_foc(new_enable_foc: bool) DifferentialVelocityDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityDutyCycle

with_average_slot(new_average_slot: int) DifferentialVelocityDutyCycle¶

Modifies this Control Request’s average_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_average_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityDutyCycle

with_differential_slot(new_differential_slot: int) DifferentialVelocityDutyCycle¶

Modifies this Control Request’s differential_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_differential_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DifferentialVelocityDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) DifferentialVelocityDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) DifferentialVelocityDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DifferentialVelocityDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) DifferentialVelocityDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityDutyCycle

with_use_timesync(new_use_timesync: bool) DifferentialVelocityDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialVelocityDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityDutyCycle

class phoenix6.controls.DifferentialVelocityVoltage(average_velocity: phoenix6.units.rotations_per_second, differential_position: phoenix6.units.rotation, enable_foc: bool = True, average_slot: int = 0, differential_slot: int = 1, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Request PID to target velocity with a differential position setpoint.

This control mode will set the motor’s velocity setpoint to the velocity specified by the user. It will also set the motor’s differential position setpoint to the specified position.

Parameters:
  • average_velocity (rotations_per_second) – Average velocity to drive toward in rotations per second.

  • differential_position (rotation) – Differential position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • average_slot (int) – Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • differential_slot (int) – Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

average_velocity¶

Average velocity to drive toward in rotations per second.

  • Units: rotations per second

differential_position¶

Differential position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

average_slot = '0'¶

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

differential_slot = '1'¶

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_average_velocity(new_average_velocity: phoenix6.units.rotations_per_second) DifferentialVelocityVoltage¶

Modifies this Control Request’s average_velocity parameter and returns itself for method-chaining and easier to use request API.

Average velocity to drive toward in rotations per second.

  • Units: rotations per second

Parameters:

new_average_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityVoltage

with_differential_position(new_differential_position: phoenix6.units.rotation) DifferentialVelocityVoltage¶

Modifies this Control Request’s differential_position parameter and returns itself for method-chaining and easier to use request API.

Differential position to drive toward in rotations.

  • Units: rotations

Parameters:

new_differential_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityVoltage

with_enable_foc(new_enable_foc: bool) DifferentialVelocityVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityVoltage

with_average_slot(new_average_slot: int) DifferentialVelocityVoltage¶

Modifies this Control Request’s average_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_average_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityVoltage

with_differential_slot(new_differential_slot: int) DifferentialVelocityVoltage¶

Modifies this Control Request’s differential_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_differential_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DifferentialVelocityVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) DifferentialVelocityVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) DifferentialVelocityVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DifferentialVelocityVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) DifferentialVelocityVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityVoltage

with_use_timesync(new_use_timesync: bool) DifferentialVelocityVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialVelocityVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialVelocityVoltage

class phoenix6.controls.DifferentialMotionMagicDutyCycle(average_position: phoenix6.units.rotation, differential_position: phoenix6.units.rotation, enable_foc: bool = True, average_slot: int = 0, differential_slot: int = 1, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final position using a motion profile, and PID to a differential position setpoint.

Motion Magic® produces a motion profile in real-time while attempting to honor the Cruise Velocity, Acceleration, and (optional) Jerk specified via the Motion Magic® configuration values. This control mode does not use the Expo_kV or Expo_kA configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is duty cycle based, so relevant closed-loop gains will use fractional duty cycle for the numerator: +1.0 represents full forward output.

Parameters:
  • average_position (rotation) – Average position to drive toward in rotations.

  • differential_position (rotation) – Differential position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • average_slot (int) – Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • differential_slot (int) – Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

average_position¶

Average position to drive toward in rotations.

  • Units: rotations

differential_position¶

Differential position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

average_slot = '0'¶

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

differential_slot = '1'¶

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_average_position(new_average_position: phoenix6.units.rotation) DifferentialMotionMagicDutyCycle¶

Modifies this Control Request’s average_position parameter and returns itself for method-chaining and easier to use request API.

Average position to drive toward in rotations.

  • Units: rotations

Parameters:

new_average_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicDutyCycle

with_differential_position(new_differential_position: phoenix6.units.rotation) DifferentialMotionMagicDutyCycle¶

Modifies this Control Request’s differential_position parameter and returns itself for method-chaining and easier to use request API.

Differential position to drive toward in rotations.

  • Units: rotations

Parameters:

new_differential_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicDutyCycle

with_enable_foc(new_enable_foc: bool) DifferentialMotionMagicDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicDutyCycle

with_average_slot(new_average_slot: int) DifferentialMotionMagicDutyCycle¶

Modifies this Control Request’s average_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_average_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicDutyCycle

with_differential_slot(new_differential_slot: int) DifferentialMotionMagicDutyCycle¶

Modifies this Control Request’s differential_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_differential_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DifferentialMotionMagicDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) DifferentialMotionMagicDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) DifferentialMotionMagicDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DifferentialMotionMagicDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) DifferentialMotionMagicDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicDutyCycle

with_use_timesync(new_use_timesync: bool) DifferentialMotionMagicDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialMotionMagicDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicDutyCycle

class phoenix6.controls.DifferentialMotionMagicVoltage(average_position: phoenix6.units.rotation, differential_position: phoenix6.units.rotation, enable_foc: bool = True, average_slot: int = 0, differential_slot: int = 1, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final position using a motion profile, and PID to a differential position setpoint.

Motion Magic® produces a motion profile in real-time while attempting to honor the Cruise Velocity, Acceleration, and (optional) Jerk specified via the Motion Magic® configuration values. This control mode does not use the Expo_kV or Expo_kA configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is voltage-based, so relevant closed-loop gains will use Volts for the numerator.

Parameters:
  • average_position (rotation) – Average position to drive toward in rotations.

  • differential_position (rotation) – Differential position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • average_slot (int) – Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • differential_slot (int) – Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

average_position¶

Average position to drive toward in rotations.

  • Units: rotations

differential_position¶

Differential position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

average_slot = '0'¶

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

differential_slot = '1'¶

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_average_position(new_average_position: phoenix6.units.rotation) DifferentialMotionMagicVoltage¶

Modifies this Control Request’s average_position parameter and returns itself for method-chaining and easier to use request API.

Average position to drive toward in rotations.

  • Units: rotations

Parameters:

new_average_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVoltage

with_differential_position(new_differential_position: phoenix6.units.rotation) DifferentialMotionMagicVoltage¶

Modifies this Control Request’s differential_position parameter and returns itself for method-chaining and easier to use request API.

Differential position to drive toward in rotations.

  • Units: rotations

Parameters:

new_differential_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVoltage

with_enable_foc(new_enable_foc: bool) DifferentialMotionMagicVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVoltage

with_average_slot(new_average_slot: int) DifferentialMotionMagicVoltage¶

Modifies this Control Request’s average_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_average_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVoltage

with_differential_slot(new_differential_slot: int) DifferentialMotionMagicVoltage¶

Modifies this Control Request’s differential_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_differential_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DifferentialMotionMagicVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) DifferentialMotionMagicVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) DifferentialMotionMagicVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DifferentialMotionMagicVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) DifferentialMotionMagicVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVoltage

with_use_timesync(new_use_timesync: bool) DifferentialMotionMagicVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialMotionMagicVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVoltage

class phoenix6.controls.DifferentialMotionMagicExpoDutyCycle(average_position: phoenix6.units.rotation, differential_position: phoenix6.units.rotation, enable_foc: bool = True, average_slot: int = 0, differential_slot: int = 1, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final position using an exponential motion profile, and PID to a differential position setpoint.

Motion Magic® Expo produces a motion profile in real-time while attempting to honor the Cruise Velocity (optional) and the mechanism kV and kA, specified via the Motion Magic® configuration values. Note that unlike the slot gains, the Expo_kV and Expo_kA configs are always in output units of Volts.

Setting Cruise Velocity to 0 will allow the profile to run to the max possible velocity based on Expo_kV. This control mode does not use the Acceleration or Jerk configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is duty cycle based, so relevant closed-loop gains will use fractional duty cycle for the numerator: +1.0 represents full forward output.

Parameters:
  • average_position (rotation) – Average position to drive toward in rotations.

  • differential_position (rotation) – Differential position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • average_slot (int) – Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • differential_slot (int) – Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

average_position¶

Average position to drive toward in rotations.

  • Units: rotations

differential_position¶

Differential position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

average_slot = '0'¶

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

differential_slot = '1'¶

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_average_position(new_average_position: phoenix6.units.rotation) DifferentialMotionMagicExpoDutyCycle¶

Modifies this Control Request’s average_position parameter and returns itself for method-chaining and easier to use request API.

Average position to drive toward in rotations.

  • Units: rotations

Parameters:

new_average_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoDutyCycle

with_differential_position(new_differential_position: phoenix6.units.rotation) DifferentialMotionMagicExpoDutyCycle¶

Modifies this Control Request’s differential_position parameter and returns itself for method-chaining and easier to use request API.

Differential position to drive toward in rotations.

  • Units: rotations

Parameters:

new_differential_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoDutyCycle

with_enable_foc(new_enable_foc: bool) DifferentialMotionMagicExpoDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoDutyCycle

with_average_slot(new_average_slot: int) DifferentialMotionMagicExpoDutyCycle¶

Modifies this Control Request’s average_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_average_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoDutyCycle

with_differential_slot(new_differential_slot: int) DifferentialMotionMagicExpoDutyCycle¶

Modifies this Control Request’s differential_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_differential_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DifferentialMotionMagicExpoDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) DifferentialMotionMagicExpoDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) DifferentialMotionMagicExpoDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DifferentialMotionMagicExpoDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) DifferentialMotionMagicExpoDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoDutyCycle

with_use_timesync(new_use_timesync: bool) DifferentialMotionMagicExpoDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialMotionMagicExpoDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoDutyCycle

class phoenix6.controls.DifferentialMotionMagicExpoVoltage(average_position: phoenix6.units.rotation, differential_position: phoenix6.units.rotation, enable_foc: bool = True, average_slot: int = 0, differential_slot: int = 1, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final position using an exponential motion profile, and PID to a differential position setpoint.

Motion Magic® Expo produces a motion profile in real-time while attempting to honor the Cruise Velocity (optional) and the mechanism kV and kA, specified via the Motion Magic® configuration values. Note that unlike the slot gains, the Expo_kV and Expo_kA configs are always in output units of Volts.

Setting Cruise Velocity to 0 will allow the profile to run to the max possible velocity based on Expo_kV. This control mode does not use the Acceleration or Jerk configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is voltage-based, so relevant closed-loop gains will use Volts for the numerator.

Parameters:
  • average_position (rotation) – Average position to drive toward in rotations.

  • differential_position (rotation) – Differential position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • average_slot (int) – Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • differential_slot (int) – Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

average_position¶

Average position to drive toward in rotations.

  • Units: rotations

differential_position¶

Differential position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

average_slot = '0'¶

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

differential_slot = '1'¶

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_average_position(new_average_position: phoenix6.units.rotation) DifferentialMotionMagicExpoVoltage¶

Modifies this Control Request’s average_position parameter and returns itself for method-chaining and easier to use request API.

Average position to drive toward in rotations.

  • Units: rotations

Parameters:

new_average_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoVoltage

with_differential_position(new_differential_position: phoenix6.units.rotation) DifferentialMotionMagicExpoVoltage¶

Modifies this Control Request’s differential_position parameter and returns itself for method-chaining and easier to use request API.

Differential position to drive toward in rotations.

  • Units: rotations

Parameters:

new_differential_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoVoltage

with_enable_foc(new_enable_foc: bool) DifferentialMotionMagicExpoVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoVoltage

with_average_slot(new_average_slot: int) DifferentialMotionMagicExpoVoltage¶

Modifies this Control Request’s average_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_average_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoVoltage

with_differential_slot(new_differential_slot: int) DifferentialMotionMagicExpoVoltage¶

Modifies this Control Request’s differential_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_differential_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DifferentialMotionMagicExpoVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) DifferentialMotionMagicExpoVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) DifferentialMotionMagicExpoVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DifferentialMotionMagicExpoVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) DifferentialMotionMagicExpoVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoVoltage

with_use_timesync(new_use_timesync: bool) DifferentialMotionMagicExpoVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialMotionMagicExpoVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicExpoVoltage

class phoenix6.controls.DifferentialMotionMagicVelocityDutyCycle(average_velocity: phoenix6.units.rotations_per_second, differential_position: phoenix6.units.rotation, enable_foc: bool = True, average_slot: int = 0, differential_slot: int = 1, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final velocity using a motion profile, and PID to a differential position setpoint. This allows smooth transitions between velocity set points.

Motion Magic® Velocity produces a motion profile in real-time while attempting to honor the specified Acceleration and (optional) Jerk. This control mode does not use the CruiseVelocity, Expo_kV, or Expo_kA configs.

Acceleration and jerk are specified in the Motion Magic® persistent configuration values. If Jerk is set to zero, Motion Magic® will produce a trapezoidal acceleration profile.

Target velocity can also be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is duty cycle based, so relevant closed-loop gains will use fractional duty cycle for the numerator: +1.0 represents full forward output.

Parameters:
  • average_velocity (rotations_per_second) – Average velocity to drive toward in rotations per second.

  • differential_position (rotation) – Differential position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • average_slot (int) – Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • differential_slot (int) – Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

average_velocity¶

Average velocity to drive toward in rotations per second.

  • Units: rotations per second

differential_position¶

Differential position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

average_slot = '0'¶

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

differential_slot = '1'¶

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_average_velocity(new_average_velocity: phoenix6.units.rotations_per_second) DifferentialMotionMagicVelocityDutyCycle¶

Modifies this Control Request’s average_velocity parameter and returns itself for method-chaining and easier to use request API.

Average velocity to drive toward in rotations per second.

  • Units: rotations per second

Parameters:

new_average_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityDutyCycle

with_differential_position(new_differential_position: phoenix6.units.rotation) DifferentialMotionMagicVelocityDutyCycle¶

Modifies this Control Request’s differential_position parameter and returns itself for method-chaining and easier to use request API.

Differential position to drive toward in rotations.

  • Units: rotations

Parameters:

new_differential_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityDutyCycle

with_enable_foc(new_enable_foc: bool) DifferentialMotionMagicVelocityDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityDutyCycle

with_average_slot(new_average_slot: int) DifferentialMotionMagicVelocityDutyCycle¶

Modifies this Control Request’s average_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_average_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityDutyCycle

with_differential_slot(new_differential_slot: int) DifferentialMotionMagicVelocityDutyCycle¶

Modifies this Control Request’s differential_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_differential_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DifferentialMotionMagicVelocityDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) DifferentialMotionMagicVelocityDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) DifferentialMotionMagicVelocityDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DifferentialMotionMagicVelocityDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) DifferentialMotionMagicVelocityDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityDutyCycle

with_use_timesync(new_use_timesync: bool) DifferentialMotionMagicVelocityDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialMotionMagicVelocityDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityDutyCycle

class phoenix6.controls.DifferentialMotionMagicVelocityVoltage(average_velocity: phoenix6.units.rotations_per_second, differential_position: phoenix6.units.rotation, enable_foc: bool = True, average_slot: int = 0, differential_slot: int = 1, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final velocity using a motion profile, and PID to a differential position setpoint. This allows smooth transitions between velocity set points.

Motion Magic® Velocity produces a motion profile in real-time while attempting to honor the specified Acceleration and (optional) Jerk. This control mode does not use the CruiseVelocity, Expo_kV, or Expo_kA configs.

Acceleration and jerk are specified in the Motion Magic® persistent configuration values. If Jerk is set to zero, Motion Magic® will produce a trapezoidal acceleration profile.

Target velocity can also be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is voltage-based, so relevant closed-loop gains will use Volts for the numerator.

Parameters:
  • average_velocity (rotations_per_second) – Average velocity to drive toward in rotations per second.

  • differential_position (rotation) – Differential position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • average_slot (int) – Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • differential_slot (int) – Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

average_velocity¶

Average velocity to drive toward in rotations per second.

  • Units: rotations per second

differential_position¶

Differential position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

average_slot = '0'¶

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

differential_slot = '1'¶

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_average_velocity(new_average_velocity: phoenix6.units.rotations_per_second) DifferentialMotionMagicVelocityVoltage¶

Modifies this Control Request’s average_velocity parameter and returns itself for method-chaining and easier to use request API.

Average velocity to drive toward in rotations per second.

  • Units: rotations per second

Parameters:

new_average_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityVoltage

with_differential_position(new_differential_position: phoenix6.units.rotation) DifferentialMotionMagicVelocityVoltage¶

Modifies this Control Request’s differential_position parameter and returns itself for method-chaining and easier to use request API.

Differential position to drive toward in rotations.

  • Units: rotations

Parameters:

new_differential_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityVoltage

with_enable_foc(new_enable_foc: bool) DifferentialMotionMagicVelocityVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityVoltage

with_average_slot(new_average_slot: int) DifferentialMotionMagicVelocityVoltage¶

Modifies this Control Request’s average_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the average controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_average_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityVoltage

with_differential_slot(new_differential_slot: int) DifferentialMotionMagicVelocityVoltage¶

Modifies this Control Request’s differential_slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied to the differential controller by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_differential_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DifferentialMotionMagicVelocityVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) DifferentialMotionMagicVelocityVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) DifferentialMotionMagicVelocityVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DifferentialMotionMagicVelocityVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) DifferentialMotionMagicVelocityVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityVoltage

with_use_timesync(new_use_timesync: bool) DifferentialMotionMagicVelocityVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialMotionMagicVelocityVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialMotionMagicVelocityVoltage

class phoenix6.controls.Follower(leader_id: int, motor_alignment: MotorAlignmentValue)¶

Follow the motor output of another Talon.

If Talon is in torque control, the torque is copied - which will increase the total torque applied. If Talon is in duty cycle output control, the duty cycle is matched. If Talon is in voltage output control, the motor voltage is matched. Motor direction either matches the leader’s configured direction or opposes it based on the MotorAlignment.

The leader must enable the status signal corresponding to its control output type (DutyCycle, MotorVoltage, TorqueCurrent). The update rate of the status signal determines the update rate of the follower’s output and should be no slower than 20 Hz.

Parameters:
  • leader_id (int) – Device ID of the leader to follow.

  • motor_alignment (MotorAlignmentValue) – Set to Aligned for motor invert to match the leader’s configured Invert - which is typical when leader and follower are mechanically linked and spin in the same direction. Set to Opposed for motor invert to oppose the leader’s configured Invert - this is typical where the leader and follower mechanically spin in opposite directions.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

leader_id¶

Device ID of the leader to follow.

motor_alignment¶

Set to Aligned for motor invert to match the leader’s configured Invert - which is typical when leader and follower are mechanically linked and spin in the same direction. Set to Opposed for motor invert to oppose the leader’s configured Invert - this is typical where the leader and follower mechanically spin in opposite directions.

with_leader_id(new_leader_id: int) Follower¶

Modifies this Control Request’s leader_id parameter and returns itself for method-chaining and easier to use request API.

Device ID of the leader to follow.

Parameters:

new_leader_id (int) – Parameter to modify

Returns:

Itself

Return type:

Follower

with_motor_alignment(new_motor_alignment: MotorAlignmentValue) Follower¶

Modifies this Control Request’s motor_alignment parameter and returns itself for method-chaining and easier to use request API.

Set to Aligned for motor invert to match the leader’s configured Invert - which is typical when leader and follower are mechanically linked and spin in the same direction. Set to Opposed for motor invert to oppose the leader’s configured Invert - this is typical where the leader and follower mechanically spin in opposite directions.

Parameters:

new_motor_alignment (MotorAlignmentValue) – Parameter to modify

Returns:

Itself

Return type:

Follower

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) Follower¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

Follower

class phoenix6.controls.StrictFollower(leader_id: int)¶

Follow the motor output of another Talon while ignoring the leader’s invert setting.

If Talon is in torque control, the torque is copied - which will increase the total torque applied. If Talon is in duty cycle output control, the duty cycle is matched. If Talon is in voltage output control, the motor voltage is matched. Motor direction is strictly determined by the configured invert and not the leader. If you want motor direction to match or oppose the leader, use Follower instead.

The leader must enable the status signal corresponding to its control output type (DutyCycle, MotorVoltage, TorqueCurrent). The update rate of the status signal determines the update rate of the follower’s output and should be no slower than 20 Hz.

Parameters:

leader_id (int) – Device ID of the leader to follow.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

leader_id¶

Device ID of the leader to follow.

with_leader_id(new_leader_id: int) StrictFollower¶

Modifies this Control Request’s leader_id parameter and returns itself for method-chaining and easier to use request API.

Device ID of the leader to follow.

Parameters:

new_leader_id (int) – Parameter to modify

Returns:

Itself

Return type:

StrictFollower

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) StrictFollower¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

StrictFollower

class phoenix6.controls.DifferentialFollower(leader_id: int, motor_alignment: MotorAlignmentValue)¶

Follow the differential motor output of another Talon.

If Talon is in torque control, the differential torque is copied - which will increase the total torque applied. If Talon is in duty cycle output control, the differential duty cycle is matched. If Talon is in voltage output control, the differential motor voltage is matched. Motor direction either matches leader’s configured direction or opposes it based on the MotorAlignment.

The leader must enable its DifferentialOutput status signal. The update rate of the status signal determines the update rate of the follower’s output and should be no slower than 20 Hz.

Parameters:
  • leader_id (int) – Device ID of the differential leader to follow.

  • motor_alignment (MotorAlignmentValue) – Set to Aligned for motor invert to match the leader’s configured Invert - which is typical when leader and follower are mechanically linked and spin in the same direction. Set to Opposed for motor invert to oppose the leader’s configured Invert - this is typical where the leader and follower mechanically spin in opposite directions.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

leader_id¶

Device ID of the differential leader to follow.

motor_alignment¶

Set to Aligned for motor invert to match the leader’s configured Invert - which is typical when leader and follower are mechanically linked and spin in the same direction. Set to Opposed for motor invert to oppose the leader’s configured Invert - this is typical where the leader and follower mechanically spin in opposite directions.

with_leader_id(new_leader_id: int) DifferentialFollower¶

Modifies this Control Request’s leader_id parameter and returns itself for method-chaining and easier to use request API.

Device ID of the differential leader to follow.

Parameters:

new_leader_id (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialFollower

with_motor_alignment(new_motor_alignment: MotorAlignmentValue) DifferentialFollower¶

Modifies this Control Request’s motor_alignment parameter and returns itself for method-chaining and easier to use request API.

Set to Aligned for motor invert to match the leader’s configured Invert - which is typical when leader and follower are mechanically linked and spin in the same direction. Set to Opposed for motor invert to oppose the leader’s configured Invert - this is typical where the leader and follower mechanically spin in opposite directions.

Parameters:

new_motor_alignment (MotorAlignmentValue) – Parameter to modify

Returns:

Itself

Return type:

DifferentialFollower

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialFollower¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialFollower

class phoenix6.controls.DifferentialStrictFollower(leader_id: int)¶

Follow the differential motor output of another Talon while ignoring the leader’s invert setting.

If Talon is in torque control, the differential torque is copied - which will increase the total torque applied. If Talon is in duty cycle output control, the differential duty cycle is matched. If Talon is in voltage output control, the differential motor voltage is matched. Motor direction is strictly determined by the configured invert and not the leader. If you want motor direction to match or oppose the leader, use DifferentialFollower instead.

The leader must enable its DifferentialOutput status signal. The update rate of the status signal determines the update rate of the follower’s output and should be no slower than 20 Hz.

Parameters:

leader_id (int) – Device ID of the differential leader to follow.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

leader_id¶

Device ID of the differential leader to follow.

with_leader_id(new_leader_id: int) DifferentialStrictFollower¶

Modifies this Control Request’s leader_id parameter and returns itself for method-chaining and easier to use request API.

Device ID of the differential leader to follow.

Parameters:

new_leader_id (int) – Parameter to modify

Returns:

Itself

Return type:

DifferentialStrictFollower

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DifferentialStrictFollower¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DifferentialStrictFollower

class phoenix6.controls.NeutralOut(use_timesync: bool = False)¶

Request neutral output of actuator. The applied brake type is determined by the NeutralMode configuration.

Parameters:

use_timesync (bool) –

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_use_timesync(new_use_timesync: bool) NeutralOut¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

NeutralOut

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) NeutralOut¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

NeutralOut

class phoenix6.controls.CoastOut(use_timesync: bool = False)¶

Request coast neutral output of actuator. The bridge is disabled and the rotor is allowed to coast.

Parameters:

use_timesync (bool) –

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_use_timesync(new_use_timesync: bool) CoastOut¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

CoastOut

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) CoastOut¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

CoastOut

class phoenix6.controls.StaticBrake(use_timesync: bool = False)¶

Applies full neutral-brake by shorting motor leads together.

Parameters:

use_timesync (bool) –

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_use_timesync(new_use_timesync: bool) StaticBrake¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

StaticBrake

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) StaticBrake¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

StaticBrake

class phoenix6.controls.MusicTone(audio_frequency: phoenix6.units.hertz)¶

Plays a single tone at the user specified frequency.

Parameters:

audio_frequency (hertz) – Sound frequency to play. A value of zero will silence the device. The effective frequency range is 10-20000 Hz. Any nonzero frequency less than 10 Hz will be capped to 10 Hz. Any frequency above 20 kHz will be capped to 20 kHz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

audio_frequency¶

Sound frequency to play. A value of zero will silence the device. The effective frequency range is 10-20000 Hz. Any nonzero frequency less than 10 Hz will be capped to 10 Hz. Any frequency above 20 kHz will be capped to 20 kHz.

  • Units: Hz

with_audio_frequency(new_audio_frequency: phoenix6.units.hertz) MusicTone¶

Modifies this Control Request’s audio_frequency parameter and returns itself for method-chaining and easier to use request API.

Sound frequency to play. A value of zero will silence the device. The effective frequency range is 10-20000 Hz. Any nonzero frequency less than 10 Hz will be capped to 10 Hz. Any frequency above 20 kHz will be capped to 20 kHz.

  • Units: Hz

Parameters:

new_audio_frequency (hertz) – Parameter to modify

Returns:

Itself

Return type:

MusicTone

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) MusicTone¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

MusicTone

class phoenix6.controls.MotionMagicVelocityDutyCycle(velocity: phoenix6.units.rotations_per_second, acceleration: phoenix6.units.rotations_per_second_squared = 0.0, enable_foc: bool = True, feed_forward: float = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final velocity using a motion profile. This allows smooth transitions between velocity set points. Users can optionally provide a duty cycle feedforward.

Motion Magic® Velocity produces a motion profile in real-time while attempting to honor the specified Acceleration and (optional) Jerk. This control mode does not use the CruiseVelocity, Expo_kV, or Expo_kA configs.

If the specified acceleration is zero, the Acceleration under Motion Magic® configuration parameter is used instead. This allows for runtime adjustment of acceleration for advanced users. Jerk is also specified in the Motion Magic® persistent configuration values. If Jerk is set to zero, Motion Magic® will produce a trapezoidal acceleration profile.

Target velocity can also be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is duty cycle based, so relevant closed-loop gains will use fractional duty cycle for the numerator: +1.0 represents full forward output.

Parameters:
  • velocity (rotations_per_second) – Target velocity to drive toward in rotations per second. This can be changed on-the fly.

  • acceleration (rotations_per_second_squared) – This is the absolute Acceleration to use generating the profile. If this parameter is zero, the Acceleration persistent configuration parameter is used instead. Acceleration is in rotations per second squared. If nonzero, the signage does not matter as the absolute value is used.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (float) – Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

velocity¶

Target velocity to drive toward in rotations per second. This can be changed on-the fly.

  • Units: rotations per second

acceleration = '0.0'¶

This is the absolute Acceleration to use generating the profile. If this parameter is zero, the Acceleration persistent configuration parameter is used instead. Acceleration is in rotations per second squared. If nonzero, the signage does not matter as the absolute value is used.

  • Units: rotations per second²

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_velocity(new_velocity: phoenix6.units.rotations_per_second) MotionMagicVelocityDutyCycle¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Target velocity to drive toward in rotations per second. This can be changed on-the fly.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityDutyCycle

with_acceleration(new_acceleration: phoenix6.units.rotations_per_second_squared) MotionMagicVelocityDutyCycle¶

Modifies this Control Request’s acceleration parameter and returns itself for method-chaining and easier to use request API.

This is the absolute Acceleration to use generating the profile. If this parameter is zero, the Acceleration persistent configuration parameter is used instead. Acceleration is in rotations per second squared. If nonzero, the signage does not matter as the absolute value is used.

  • Units: rotations per second²

Parameters:

new_acceleration (rotations_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityDutyCycle

with_enable_foc(new_enable_foc: bool) MotionMagicVelocityDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityDutyCycle

with_feed_forward(new_feed_forward: float) MotionMagicVelocityDutyCycle¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

Parameters:

new_feed_forward (float) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityDutyCycle

with_slot(new_slot: int) MotionMagicVelocityDutyCycle¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) MotionMagicVelocityDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) MotionMagicVelocityDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) MotionMagicVelocityDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) MotionMagicVelocityDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) MotionMagicVelocityDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityDutyCycle

with_use_timesync(new_use_timesync: bool) MotionMagicVelocityDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) MotionMagicVelocityDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityDutyCycle

class phoenix6.controls.MotionMagicVelocityTorqueCurrentFOC(velocity: phoenix6.units.rotations_per_second, acceleration: phoenix6.units.rotations_per_second_squared = 0.0, feed_forward: phoenix6.units.ampere = 0.0, slot: int = 0, override_coast_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final velocity using a motion profile. This allows smooth transitions between velocity set points. Users can optionally provide a torque feedforward.

Motion Magic® Velocity produces a motion profile in real-time while attempting to honor the specified Acceleration and (optional) Jerk. This control mode does not use the CruiseVelocity, Expo_kV, or Expo_kA configs.

If the specified acceleration is zero, the Acceleration under Motion Magic® configuration parameter is used instead. This allows for runtime adjustment of acceleration for advanced users. Jerk is also specified in the Motion Magic® persistent configuration values. If Jerk is set to zero, Motion Magic® will produce a trapezoidal acceleration profile.

Target velocity can also be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is based on torque current, so relevant closed-loop gains will use Amperes for the numerator.

Parameters:
  • velocity (rotations_per_second) – Target velocity to drive toward in rotations per second. This can be changed on-the fly.

  • acceleration (rotations_per_second_squared) – This is the absolute Acceleration to use generating the profile. If this parameter is zero, the Acceleration persistent configuration parameter is used instead. Acceleration is in rotations per second squared. If nonzero, the signage does not matter as the absolute value is used.

  • feed_forward (ampere) –

    Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

    User can use motor’s kT to scale Newton-meter to Amperes.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_coast_dur_neutral (bool) – Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

velocity¶

Target velocity to drive toward in rotations per second. This can be changed on-the fly.

  • Units: rotations per second

acceleration = '0.0'¶

This is the absolute Acceleration to use generating the profile. If this parameter is zero, the Acceleration persistent configuration parameter is used instead. Acceleration is in rotations per second squared. If nonzero, the signage does not matter as the absolute value is used.

  • Units: rotations per second²

feed_forward = '0.0'¶

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_coast_dur_neutral = 'False'¶

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_velocity(new_velocity: phoenix6.units.rotations_per_second) MotionMagicVelocityTorqueCurrentFOC¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Target velocity to drive toward in rotations per second. This can be changed on-the fly.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityTorqueCurrentFOC

with_acceleration(new_acceleration: phoenix6.units.rotations_per_second_squared) MotionMagicVelocityTorqueCurrentFOC¶

Modifies this Control Request’s acceleration parameter and returns itself for method-chaining and easier to use request API.

This is the absolute Acceleration to use generating the profile. If this parameter is zero, the Acceleration persistent configuration parameter is used instead. Acceleration is in rotations per second squared. If nonzero, the signage does not matter as the absolute value is used.

  • Units: rotations per second²

Parameters:

new_acceleration (rotations_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityTorqueCurrentFOC

with_feed_forward(new_feed_forward: phoenix6.units.ampere) MotionMagicVelocityTorqueCurrentFOC¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

Parameters:

new_feed_forward (ampere) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityTorqueCurrentFOC

with_slot(new_slot: int) MotionMagicVelocityTorqueCurrentFOC¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityTorqueCurrentFOC

with_override_coast_dur_neutral(new_override_coast_dur_neutral: bool) MotionMagicVelocityTorqueCurrentFOC¶

Modifies this Control Request’s override_coast_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

Parameters:

new_override_coast_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityTorqueCurrentFOC

with_limit_forward_motion(new_limit_forward_motion: bool) MotionMagicVelocityTorqueCurrentFOC¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityTorqueCurrentFOC

with_limit_reverse_motion(new_limit_reverse_motion: bool) MotionMagicVelocityTorqueCurrentFOC¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityTorqueCurrentFOC

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) MotionMagicVelocityTorqueCurrentFOC¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityTorqueCurrentFOC

with_ignore_software_limits(new_ignore_software_limits: bool) MotionMagicVelocityTorqueCurrentFOC¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityTorqueCurrentFOC

with_use_timesync(new_use_timesync: bool) MotionMagicVelocityTorqueCurrentFOC¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityTorqueCurrentFOC

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) MotionMagicVelocityTorqueCurrentFOC¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityTorqueCurrentFOC

class phoenix6.controls.MotionMagicVelocityVoltage(velocity: phoenix6.units.rotations_per_second, acceleration: phoenix6.units.rotations_per_second_squared = 0.0, enable_foc: bool = True, feed_forward: phoenix6.units.volt = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final velocity using a motion profile. This allows smooth transitions between velocity set points. Users can optionally provide a voltage feedforward.

Motion Magic® Velocity produces a motion profile in real-time while attempting to honor the specified Acceleration and (optional) Jerk. This control mode does not use the CruiseVelocity, Expo_kV, or Expo_kA configs.

If the specified acceleration is zero, the Acceleration under Motion Magic® configuration parameter is used instead. This allows for runtime adjustment of acceleration for advanced users. Jerk is also specified in the Motion Magic® persistent configuration values. If Jerk is set to zero, Motion Magic® will produce a trapezoidal acceleration profile.

Target velocity can also be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is voltage-based, so relevant closed-loop gains will use Volts for the numerator.

Parameters:
  • velocity (rotations_per_second) – Target velocity to drive toward in rotations per second. This can be changed on-the fly.

  • acceleration (rotations_per_second_squared) – This is the absolute Acceleration to use generating the profile. If this parameter is zero, the Acceleration persistent configuration parameter is used instead. Acceleration is in rotations per second squared. If nonzero, the signage does not matter as the absolute value is used.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (volt) – Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

velocity¶

Target velocity to drive toward in rotations per second. This can be changed on-the fly.

  • Units: rotations per second

acceleration = '0.0'¶

This is the absolute Acceleration to use generating the profile. If this parameter is zero, the Acceleration persistent configuration parameter is used instead. Acceleration is in rotations per second squared. If nonzero, the signage does not matter as the absolute value is used.

  • Units: rotations per second²

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • Units: Volts

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_velocity(new_velocity: phoenix6.units.rotations_per_second) MotionMagicVelocityVoltage¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Target velocity to drive toward in rotations per second. This can be changed on-the fly.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityVoltage

with_acceleration(new_acceleration: phoenix6.units.rotations_per_second_squared) MotionMagicVelocityVoltage¶

Modifies this Control Request’s acceleration parameter and returns itself for method-chaining and easier to use request API.

This is the absolute Acceleration to use generating the profile. If this parameter is zero, the Acceleration persistent configuration parameter is used instead. Acceleration is in rotations per second squared. If nonzero, the signage does not matter as the absolute value is used.

  • Units: rotations per second²

Parameters:

new_acceleration (rotations_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityVoltage

with_enable_foc(new_enable_foc: bool) MotionMagicVelocityVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityVoltage

with_feed_forward(new_feed_forward: phoenix6.units.volt) MotionMagicVelocityVoltage¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • Units: Volts

Parameters:

new_feed_forward (volt) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityVoltage

with_slot(new_slot: int) MotionMagicVelocityVoltage¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) MotionMagicVelocityVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) MotionMagicVelocityVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) MotionMagicVelocityVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) MotionMagicVelocityVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) MotionMagicVelocityVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityVoltage

with_use_timesync(new_use_timesync: bool) MotionMagicVelocityVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) MotionMagicVelocityVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicVelocityVoltage

class phoenix6.controls.MotionMagicExpoDutyCycle(position: phoenix6.units.rotation, enable_foc: bool = True, feed_forward: float = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final position using an exponential motion profile. Users can optionally provide a duty cycle feedforward.

Motion Magic® Expo produces a motion profile in real-time while attempting to honor the Cruise Velocity (optional) and the mechanism kV and kA, specified via the Motion Magic® configuration values. Note that unlike the slot gains, the Expo_kV and Expo_kA configs are always in output units of Volts.

Setting Cruise Velocity to 0 will allow the profile to run to the max possible velocity based on Expo_kV. This control mode does not use the Acceleration or Jerk configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is duty cycle based, so relevant closed-loop gains will use fractional duty cycle for the numerator: +1.0 represents full forward output.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (float) – Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) MotionMagicExpoDutyCycle¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoDutyCycle

with_enable_foc(new_enable_foc: bool) MotionMagicExpoDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoDutyCycle

with_feed_forward(new_feed_forward: float) MotionMagicExpoDutyCycle¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

Parameters:

new_feed_forward (float) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoDutyCycle

with_slot(new_slot: int) MotionMagicExpoDutyCycle¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) MotionMagicExpoDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) MotionMagicExpoDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) MotionMagicExpoDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) MotionMagicExpoDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) MotionMagicExpoDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoDutyCycle

with_use_timesync(new_use_timesync: bool) MotionMagicExpoDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) MotionMagicExpoDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoDutyCycle

class phoenix6.controls.MotionMagicExpoVoltage(position: phoenix6.units.rotation, enable_foc: bool = True, feed_forward: phoenix6.units.volt = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requests Motion Magic® to target a final position using an exponential motion profile. Users can optionally provide a voltage feedforward.

Motion Magic® Expo produces a motion profile in real-time while attempting to honor the Cruise Velocity (optional) and the mechanism kV and kA, specified via the Motion Magic® configuration values. Note that unlike the slot gains, the Expo_kV and Expo_kA configs are always in output units of Volts.

Setting Cruise Velocity to 0 will allow the profile to run to the max possible velocity based on Expo_kV. This control mode does not use the Acceleration or Jerk configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is voltage-based, so relevant closed-loop gains will use Volts for the numerator.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (volt) – Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • Units: Volts

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) MotionMagicExpoVoltage¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoVoltage

with_enable_foc(new_enable_foc: bool) MotionMagicExpoVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoVoltage

with_feed_forward(new_feed_forward: phoenix6.units.volt) MotionMagicExpoVoltage¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • Units: Volts

Parameters:

new_feed_forward (volt) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoVoltage

with_slot(new_slot: int) MotionMagicExpoVoltage¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) MotionMagicExpoVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) MotionMagicExpoVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) MotionMagicExpoVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) MotionMagicExpoVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) MotionMagicExpoVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoVoltage

with_use_timesync(new_use_timesync: bool) MotionMagicExpoVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) MotionMagicExpoVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoVoltage

class phoenix6.controls.MotionMagicExpoTorqueCurrentFOC(position: phoenix6.units.rotation, feed_forward: phoenix6.units.ampere = 0.0, slot: int = 0, override_coast_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requires Phoenix Pro; Requests Motion Magic® to target a final position using an exponential motion profile. Users can optionally provide a torque current feedforward.

Motion Magic® Expo produces a motion profile in real-time while attempting to honor the Cruise Velocity (optional) and the mechanism kV and kA, specified via the Motion Magic® configuration values. Note that unlike the slot gains, the Expo_kV and Expo_kA configs are always in output units of Volts.

Setting Cruise Velocity to 0 will allow the profile to run to the max possible velocity based on Expo_kV. This control mode does not use the Acceleration or Jerk configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is based on torque current, so relevant closed-loop gains will use Amperes for the numerator.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • feed_forward (ampere) –

    Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

    User can use motor’s kT to scale Newton-meter to Amperes.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_coast_dur_neutral (bool) – Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

feed_forward = '0.0'¶

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_coast_dur_neutral = 'False'¶

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) MotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoTorqueCurrentFOC

with_feed_forward(new_feed_forward: phoenix6.units.ampere) MotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

Parameters:

new_feed_forward (ampere) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoTorqueCurrentFOC

with_slot(new_slot: int) MotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoTorqueCurrentFOC

with_override_coast_dur_neutral(new_override_coast_dur_neutral: bool) MotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s override_coast_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

Parameters:

new_override_coast_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoTorqueCurrentFOC

with_limit_forward_motion(new_limit_forward_motion: bool) MotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoTorqueCurrentFOC

with_limit_reverse_motion(new_limit_reverse_motion: bool) MotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoTorqueCurrentFOC

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) MotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoTorqueCurrentFOC

with_ignore_software_limits(new_ignore_software_limits: bool) MotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoTorqueCurrentFOC

with_use_timesync(new_use_timesync: bool) MotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoTorqueCurrentFOC

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) MotionMagicExpoTorqueCurrentFOC¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

MotionMagicExpoTorqueCurrentFOC

class phoenix6.controls.DynamicMotionMagicDutyCycle(position: phoenix6.units.rotation, velocity: phoenix6.units.rotations_per_second, acceleration: phoenix6.units.rotations_per_second_squared, jerk: phoenix6.units.rotations_per_second_cubed = 0.0, enable_foc: bool = True, feed_forward: float = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requires Phoenix Pro and CANivore; Requests Motion Magic® to target a final position using a motion profile. This dynamic request allows runtime changes to Cruise Velocity, Acceleration, and (optional) Jerk. Users can optionally provide a duty cycle feedforward.

Motion Magic® produces a motion profile in real-time while attempting to honor the specified Cruise Velocity, Acceleration, and (optional) Jerk. This control mode does not use the Expo_kV or Expo_kA configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is duty cycle based, so relevant closed-loop gains will use fractional duty cycle for the numerator: +1.0 represents full forward output.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • velocity (rotations_per_second) – Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • acceleration (rotations_per_second_squared) – Acceleration for profiling. The signage does not matter as the device will use the absolute value for profile generation

  • jerk (rotations_per_second_cubed) –

    Jerk for profiling. The signage does not matter as the device will use the absolute value for profile generation.

    Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (float) – Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

velocity¶

Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • Units: rotations per second

acceleration¶

Acceleration for profiling. The signage does not matter as the device will use the absolute value for profile generation

  • Units: rotations per second²

jerk = '0.0'¶

Jerk for profiling. The signage does not matter as the device will use the absolute value for profile generation.

Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.

  • Units: rotations per second³

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_velocity(new_velocity: phoenix6.units.rotations_per_second) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_acceleration(new_acceleration: phoenix6.units.rotations_per_second_squared) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s acceleration parameter and returns itself for method-chaining and easier to use request API.

Acceleration for profiling. The signage does not matter as the device will use the absolute value for profile generation

  • Units: rotations per second²

Parameters:

new_acceleration (rotations_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_jerk(new_jerk: phoenix6.units.rotations_per_second_cubed) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s jerk parameter and returns itself for method-chaining and easier to use request API.

Jerk for profiling. The signage does not matter as the device will use the absolute value for profile generation.

Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.

  • Units: rotations per second³

Parameters:

new_jerk (rotations_per_second_cubed) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_enable_foc(new_enable_foc: bool) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_feed_forward(new_feed_forward: float) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

Parameters:

new_feed_forward (float) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_slot(new_slot: int) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_use_timesync(new_use_timesync: bool) DynamicMotionMagicDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DynamicMotionMagicDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicDutyCycle

class phoenix6.controls.DynamicMotionMagicVoltage(position: phoenix6.units.rotation, velocity: phoenix6.units.rotations_per_second, acceleration: phoenix6.units.rotations_per_second_squared, jerk: phoenix6.units.rotations_per_second_cubed = 0.0, enable_foc: bool = True, feed_forward: phoenix6.units.volt = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requires Phoenix Pro and CANivore; Requests Motion Magic® to target a final position using a motion profile. This dynamic request allows runtime changes to Cruise Velocity, Acceleration, and (optional) Jerk. Users can optionally provide a voltage feedforward.

Motion Magic® produces a motion profile in real-time while attempting to honor the specified Cruise Velocity, Acceleration, and (optional) Jerk. This control mode does not use the Expo_kV or Expo_kA configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is voltage-based, so relevant closed-loop gains will use Volts for the numerator.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • velocity (rotations_per_second) – Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • acceleration (rotations_per_second_squared) – Acceleration for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • jerk (rotations_per_second_cubed) –

    Jerk for profiling. The signage does not matter as the device will use the absolute value for profile generation.

    Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (volt) – Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

velocity¶

Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • Units: rotations per second

acceleration¶

Acceleration for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • Units: rotations per second²

jerk = '0.0'¶

Jerk for profiling. The signage does not matter as the device will use the absolute value for profile generation.

Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.

  • Units: rotations per second³

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • Units: Volts

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) DynamicMotionMagicVoltage¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_velocity(new_velocity: phoenix6.units.rotations_per_second) DynamicMotionMagicVoltage¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_acceleration(new_acceleration: phoenix6.units.rotations_per_second_squared) DynamicMotionMagicVoltage¶

Modifies this Control Request’s acceleration parameter and returns itself for method-chaining and easier to use request API.

Acceleration for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • Units: rotations per second²

Parameters:

new_acceleration (rotations_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_jerk(new_jerk: phoenix6.units.rotations_per_second_cubed) DynamicMotionMagicVoltage¶

Modifies this Control Request’s jerk parameter and returns itself for method-chaining and easier to use request API.

Jerk for profiling. The signage does not matter as the device will use the absolute value for profile generation.

Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.

  • Units: rotations per second³

Parameters:

new_jerk (rotations_per_second_cubed) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_enable_foc(new_enable_foc: bool) DynamicMotionMagicVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_feed_forward(new_feed_forward: phoenix6.units.volt) DynamicMotionMagicVoltage¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • Units: Volts

Parameters:

new_feed_forward (volt) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_slot(new_slot: int) DynamicMotionMagicVoltage¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DynamicMotionMagicVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) DynamicMotionMagicVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) DynamicMotionMagicVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DynamicMotionMagicVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) DynamicMotionMagicVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_use_timesync(new_use_timesync: bool) DynamicMotionMagicVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DynamicMotionMagicVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicVoltage

class phoenix6.controls.DynamicMotionMagicTorqueCurrentFOC(position: phoenix6.units.rotation, velocity: phoenix6.units.rotations_per_second, acceleration: phoenix6.units.rotations_per_second_squared, jerk: phoenix6.units.rotations_per_second_cubed = 0.0, feed_forward: phoenix6.units.ampere = 0.0, slot: int = 0, override_coast_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requires Phoenix Pro and CANivore; Requests Motion Magic® to target a final position using a motion profile. This dynamic request allows runtime changes to Cruise Velocity, Acceleration, and (optional) Jerk. Users can optionally provide a torque current feedforward.

Motion Magic® produces a motion profile in real-time while attempting to honor the specified Cruise Velocity, Acceleration, and (optional) Jerk. This control mode does not use the Expo_kV or Expo_kA configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is based on torque current, so relevant closed-loop gains will use Amperes for the numerator.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • velocity (rotations_per_second) – Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • acceleration (rotations_per_second_squared) – Acceleration for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • jerk (rotations_per_second_cubed) –

    Jerk for profiling. The signage does not matter as the device will use the absolute value for profile generation.

    Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.

  • feed_forward (ampere) –

    Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

    User can use motor’s kT to scale Newton-meter to Amperes.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_coast_dur_neutral (bool) – Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

velocity¶

Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • Units: rotations per second

acceleration¶

Acceleration for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • Units: rotations per second²

jerk = '0.0'¶

Jerk for profiling. The signage does not matter as the device will use the absolute value for profile generation.

Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.

  • Units: rotations per second³

feed_forward = '0.0'¶

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_coast_dur_neutral = 'False'¶

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) DynamicMotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

with_velocity(new_velocity: phoenix6.units.rotations_per_second) DynamicMotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

with_acceleration(new_acceleration: phoenix6.units.rotations_per_second_squared) DynamicMotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s acceleration parameter and returns itself for method-chaining and easier to use request API.

Acceleration for profiling. The signage does not matter as the device will use the absolute value for profile generation.

  • Units: rotations per second²

Parameters:

new_acceleration (rotations_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

with_jerk(new_jerk: phoenix6.units.rotations_per_second_cubed) DynamicMotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s jerk parameter and returns itself for method-chaining and easier to use request API.

Jerk for profiling. The signage does not matter as the device will use the absolute value for profile generation.

Jerk is optional; if this is set to zero, then Motion Magic® will not apply a Jerk limit.

  • Units: rotations per second³

Parameters:

new_jerk (rotations_per_second_cubed) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

with_feed_forward(new_feed_forward: phoenix6.units.ampere) DynamicMotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

Parameters:

new_feed_forward (ampere) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

with_slot(new_slot: int) DynamicMotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

with_override_coast_dur_neutral(new_override_coast_dur_neutral: bool) DynamicMotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s override_coast_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

Parameters:

new_override_coast_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

with_limit_forward_motion(new_limit_forward_motion: bool) DynamicMotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

with_limit_reverse_motion(new_limit_reverse_motion: bool) DynamicMotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DynamicMotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

with_ignore_software_limits(new_ignore_software_limits: bool) DynamicMotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

with_use_timesync(new_use_timesync: bool) DynamicMotionMagicTorqueCurrentFOC¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DynamicMotionMagicTorqueCurrentFOC¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicTorqueCurrentFOC

class phoenix6.controls.DynamicMotionMagicExpoDutyCycle(position: phoenix6.units.rotation, k_v: phoenix6.units.volts_per_rotation_per_second, k_a: phoenix6.units.volts_per_rotation_per_second_squared, velocity: phoenix6.units.rotations_per_second = 0, enable_foc: bool = True, feed_forward: float = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requires Phoenix Pro and CANivore; Requests Motion Magic® Expo to target a final position using an exponential motion profile. This dynamic request allows runtime changes to the profile kV, kA, and (optional) Cruise Velocity. Users can optionally provide a duty cycle feedforward.

Motion Magic® Expo produces a motion profile in real-time while attempting to honor the specified Cruise Velocity (optional) and the mechanism kV and kA. Note that unlike the slot gains, the Expo_kV and Expo_kA parameters are always in output units of Volts.

Setting the Cruise Velocity to 0 will allow the profile to run to the max possible velocity based on Expo_kV. This control mode does not use the Acceleration or Jerk configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is duty cycle based, so relevant closed-loop gains will use fractional duty cycle for the numerator: +1.0 represents full forward output.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • k_v (volts_per_rotation_per_second) –

    Mechanism kV for profiling. Unlike the kV slot gain, this is always in units of V/rps.

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

  • k_a (volts_per_rotation_per_second_squared) –

    Mechanism kA for profiling. Unlike the kA slot gain, this is always in units of V/rps².

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

  • velocity (rotations_per_second) – Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation. Setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (float) – Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

k_v¶

Mechanism kV for profiling. Unlike the kV slot gain, this is always in units of V/rps.

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

  • Units: V/rps

k_a¶

Mechanism kA for profiling. Unlike the kA slot gain, this is always in units of V/rps².

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

  • Units: V/rps²

velocity = '0'¶

Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation. Setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.

  • Units: rotations per second

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_k_v(new_k_v: phoenix6.units.volts_per_rotation_per_second) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s k_v parameter and returns itself for method-chaining and easier to use request API.

Mechanism kV for profiling. Unlike the kV slot gain, this is always in units of V/rps.

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

  • Units: V/rps

Parameters:

new_k_v (volts_per_rotation_per_second) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_k_a(new_k_a: phoenix6.units.volts_per_rotation_per_second_squared) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s k_a parameter and returns itself for method-chaining and easier to use request API.

Mechanism kA for profiling. Unlike the kA slot gain, this is always in units of V/rps².

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

  • Units: V/rps²

Parameters:

new_k_a (volts_per_rotation_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_velocity(new_velocity: phoenix6.units.rotations_per_second) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation. Setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_enable_foc(new_enable_foc: bool) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_feed_forward(new_feed_forward: float) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in fractional units between -1 and +1. This is added to the output of the onboard feedforward terms.

  • Units: fractional

Parameters:

new_feed_forward (float) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_slot(new_slot: int) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_limit_forward_motion(new_limit_forward_motion: bool) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_limit_reverse_motion(new_limit_reverse_motion: bool) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_ignore_software_limits(new_ignore_software_limits: bool) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_use_timesync(new_use_timesync: bool) DynamicMotionMagicExpoDutyCycle¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DynamicMotionMagicExpoDutyCycle¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoDutyCycle

class phoenix6.controls.DynamicMotionMagicExpoVoltage(position: phoenix6.units.rotation, k_v: phoenix6.units.volts_per_rotation_per_second, k_a: phoenix6.units.volts_per_rotation_per_second_squared, velocity: phoenix6.units.rotations_per_second = 0, enable_foc: bool = True, feed_forward: phoenix6.units.volt = 0.0, slot: int = 0, override_brake_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requires Phoenix Pro and CANivore; Requests Motion Magic® Expo to target a final position using an exponential motion profile. This dynamic request allows runtime changes to the profile kV, kA, and (optional) Cruise Velocity. Users can optionally provide a voltage feedforward.

Motion Magic® Expo produces a motion profile in real-time while attempting to honor the specified Cruise Velocity (optional) and the mechanism kV and kA. Note that unlike the slot gains, the Expo_kV and Expo_kA parameters are always in output units of Volts.

Setting the Cruise Velocity to 0 will allow the profile to run to the max possible velocity based on Expo_kV. This control mode does not use the Acceleration or Jerk configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is voltage-based, so relevant closed-loop gains will use Volts for the numerator.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • k_v (volts_per_rotation_per_second) –

    Mechanism kV for profiling. Unlike the kV slot gain, this is always in units of V/rps.

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

  • k_a (volts_per_rotation_per_second_squared) –

    Mechanism kA for profiling. Unlike the kA slot gain, this is always in units of V/rps².

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

  • velocity (rotations_per_second) – Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation. Setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.

  • enable_foc (bool) –

    Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

    FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

  • feed_forward (volt) – Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_brake_dur_neutral (bool) – Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

k_v¶

Mechanism kV for profiling. Unlike the kV slot gain, this is always in units of V/rps.

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

  • Units: V/rps

k_a¶

Mechanism kA for profiling. Unlike the kA slot gain, this is always in units of V/rps².

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

  • Units: V/rps²

velocity = '0'¶

Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation. Setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.

  • Units: rotations per second

enable_foc = 'True'¶

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

feed_forward = '0.0'¶

Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • Units: Volts

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_brake_dur_neutral = 'False'¶

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_k_v(new_k_v: phoenix6.units.volts_per_rotation_per_second) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s k_v parameter and returns itself for method-chaining and easier to use request API.

Mechanism kV for profiling. Unlike the kV slot gain, this is always in units of V/rps.

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

  • Units: V/rps

Parameters:

new_k_v (volts_per_rotation_per_second) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_k_a(new_k_a: phoenix6.units.volts_per_rotation_per_second_squared) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s k_a parameter and returns itself for method-chaining and easier to use request API.

Mechanism kA for profiling. Unlike the kA slot gain, this is always in units of V/rps².

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

  • Units: V/rps²

Parameters:

new_k_a (volts_per_rotation_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_velocity(new_velocity: phoenix6.units.rotations_per_second) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation. Setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_enable_foc(new_enable_foc: bool) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s enable_foc parameter and returns itself for method-chaining and easier to use request API.

Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see SupportsFOC). Set to false to use trapezoidal commutation.

FOC improves motor performance by leveraging torque (current) control. However, this may be inconvenient for applications that require specifying duty cycle or voltage. CTR-Electronics has developed a hybrid method that combines the performances gains of FOC while still allowing applications to provide duty cycle or voltage demand. This not to be confused with simple sinusoidal control or phase voltage control which lacks the performance gains.

Parameters:

new_enable_foc (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_feed_forward(new_feed_forward: phoenix6.units.volt) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in volts. This is added to the output of the onboard feedforward terms.

  • Units: Volts

Parameters:

new_feed_forward (volt) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_slot(new_slot: int) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_override_brake_dur_neutral(new_override_brake_dur_neutral: bool) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s override_brake_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to static-brake the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0V to the motor.

Parameters:

new_override_brake_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_limit_forward_motion(new_limit_forward_motion: bool) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_limit_reverse_motion(new_limit_reverse_motion: bool) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_ignore_software_limits(new_ignore_software_limits: bool) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_use_timesync(new_use_timesync: bool) DynamicMotionMagicExpoVoltage¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DynamicMotionMagicExpoVoltage¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoVoltage

class phoenix6.controls.DynamicMotionMagicExpoTorqueCurrentFOC(position: phoenix6.units.rotation, k_v: phoenix6.units.volts_per_rotation_per_second, k_a: phoenix6.units.volts_per_rotation_per_second_squared, velocity: phoenix6.units.rotations_per_second = 0, feed_forward: phoenix6.units.ampere = 0.0, slot: int = 0, override_coast_dur_neutral: bool = False, limit_forward_motion: bool = False, limit_reverse_motion: bool = False, ignore_hardware_limits: bool = False, ignore_software_limits: bool = False, use_timesync: bool = False)¶

Requires Phoenix Pro and CANivore; Requests Motion Magic® Expo to target a final position using an exponential motion profile. This dynamic request allows runtime changes to the profile kV, kA, and (optional) Cruise Velocity. Users can optionally provide a torque current feedforward.

Motion Magic® Expo produces a motion profile in real-time while attempting to honor the specified Cruise Velocity (optional) and the mechanism kV and kA. Note that unlike the slot gains, the Expo_kV and Expo_kA parameters are always in output units of Volts.

Setting the Cruise Velocity to 0 will allow the profile to run to the max possible velocity based on Expo_kV. This control mode does not use the Acceleration or Jerk configs.

Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is based on torque current, so relevant closed-loop gains will use Amperes for the numerator.

Parameters:
  • position (rotation) – Position to drive toward in rotations.

  • k_v (volts_per_rotation_per_second) –

    Mechanism kV for profiling. Unlike the kV slot gain, this is always in units of V/rps.

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

  • k_a (volts_per_rotation_per_second_squared) –

    Mechanism kA for profiling. Unlike the kA slot gain, this is always in units of V/rps².

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

  • velocity (rotations_per_second) – Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation. Setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.

  • feed_forward (ampere) –

    Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

    User can use motor’s kT to scale Newton-meter to Amperes.

  • slot (int) – Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

  • override_coast_dur_neutral (bool) – Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

  • limit_forward_motion (bool) – Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • limit_reverse_motion (bool) – Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

  • ignore_hardware_limits (bool) –

    Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

    This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

    The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

  • ignore_software_limits (bool) –

    Set to true to ignore software limits, instead allowing motion.

    This can be useful when calibrating the zero point of a mechanism such as an elevator.

    The software limit faults will still report the values of the software limits regardless of this parameter.

  • use_timesync (bool) –

    Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

    This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '100'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

position¶

Position to drive toward in rotations.

  • Units: rotations

k_v¶

Mechanism kV for profiling. Unlike the kV slot gain, this is always in units of V/rps.

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

  • Units: V/rps

k_a¶

Mechanism kA for profiling. Unlike the kA slot gain, this is always in units of V/rps².

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

  • Units: V/rps²

velocity = '0'¶

Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation. Setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.

  • Units: rotations per second

feed_forward = '0.0'¶

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

slot = '0'¶

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

override_coast_dur_neutral = 'False'¶

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

limit_forward_motion = 'False'¶

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

limit_reverse_motion = 'False'¶

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

ignore_hardware_limits = 'False'¶

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

ignore_software_limits = 'False'¶

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

use_timesync = 'False'¶

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

with_position(new_position: phoenix6.units.rotation) DynamicMotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s position parameter and returns itself for method-chaining and easier to use request API.

Position to drive toward in rotations.

  • Units: rotations

Parameters:

new_position (rotation) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

with_k_v(new_k_v: phoenix6.units.volts_per_rotation_per_second) DynamicMotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s k_v parameter and returns itself for method-chaining and easier to use request API.

Mechanism kV for profiling. Unlike the kV slot gain, this is always in units of V/rps.

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

  • Units: V/rps

Parameters:

new_k_v (volts_per_rotation_per_second) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

with_k_a(new_k_a: phoenix6.units.volts_per_rotation_per_second_squared) DynamicMotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s k_a parameter and returns itself for method-chaining and easier to use request API.

Mechanism kA for profiling. Unlike the kA slot gain, this is always in units of V/rps².

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

  • Units: V/rps²

Parameters:

new_k_a (volts_per_rotation_per_second_squared) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

with_velocity(new_velocity: phoenix6.units.rotations_per_second) DynamicMotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s velocity parameter and returns itself for method-chaining and easier to use request API.

Cruise velocity for profiling. The signage does not matter as the device will use the absolute value for profile generation. Setting this to 0 will allow the profile to run to the max possible velocity based on Expo_kV.

  • Units: rotations per second

Parameters:

new_velocity (rotations_per_second) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

with_feed_forward(new_feed_forward: phoenix6.units.ampere) DynamicMotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s feed_forward parameter and returns itself for method-chaining and easier to use request API.

Feedforward to apply in torque current in Amperes. This is added to the output of the onboard feedforward terms.

User can use motor’s kT to scale Newton-meter to Amperes.

  • Units: A

Parameters:

new_feed_forward (ampere) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

with_slot(new_slot: int) DynamicMotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

Select which gains are applied by selecting the slot. Use the configuration api to set the gain values for the selected slot before enabling this feature. Slot must be within [0,2].

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

with_override_coast_dur_neutral(new_override_coast_dur_neutral: bool) DynamicMotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s override_coast_dur_neutral parameter and returns itself for method-chaining and easier to use request API.

Set to true to coast the rotor when output is zero (or within deadband). Set to false to use the NeutralMode configuration setting (default). This flag exists to provide the fundamental behavior of this control when output is zero, which is to provide 0A (zero torque).

Parameters:

new_override_coast_dur_neutral (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

with_limit_forward_motion(new_limit_forward_motion: bool) DynamicMotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s limit_forward_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force forward limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_forward_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

with_limit_reverse_motion(new_limit_reverse_motion: bool) DynamicMotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s limit_reverse_motion parameter and returns itself for method-chaining and easier to use request API.

Set to true to force reverse limiting. This allows users to use other limit switch sensors connected to robot controller. This also allows use of active sensors that require external power.

Parameters:

new_limit_reverse_motion (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

with_ignore_hardware_limits(new_ignore_hardware_limits: bool) DynamicMotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s ignore_hardware_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore hardware limit switches and the LimitForwardMotion and LimitReverseMotion parameters, instead allowing motion.

This can be useful on mechanisms such as an intake/feeder, where a limit switch stops motion while intaking but should be ignored when feeding to a shooter.

The hardware limit faults and Forward/ReverseLimit signals will still report the values of the limit switches regardless of this parameter.

Parameters:

new_ignore_hardware_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

with_ignore_software_limits(new_ignore_software_limits: bool) DynamicMotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s ignore_software_limits parameter and returns itself for method-chaining and easier to use request API.

Set to true to ignore software limits, instead allowing motion.

This can be useful when calibrating the zero point of a mechanism such as an elevator.

The software limit faults will still report the values of the software limits regardless of this parameter.

Parameters:

new_ignore_software_limits (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

with_use_timesync(new_use_timesync: bool) DynamicMotionMagicExpoTorqueCurrentFOC¶

Modifies this Control Request’s use_timesync parameter and returns itself for method-chaining and easier to use request API.

Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro and CANivore). This eliminates the impact of nondeterministic network delays in exchange for a larger but deterministic control latency.

This requires setting the ControlTimesyncFreqHz config in MotorOutputConfigs. Additionally, when this is enabled, the UpdateFreqHz of this request should be set to 0 Hz.

Parameters:

new_use_timesync (bool) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) DynamicMotionMagicExpoTorqueCurrentFOC¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

DynamicMotionMagicExpoTorqueCurrentFOC

class phoenix6.controls.ModulateVBatOut(output: float)¶

Modulates the CANdle VBat output to the specified duty cycle. This can be used to control a single-color LED strip.

Note that CANdleFeaturesConfigs.VBatOutputMode must be set to VBatOutputModeValue.Modulated.

Parameters:

output (float) – Proportion of VBat to output in fractional units between 0.0 and 1.0.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '50'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

output¶

Proportion of VBat to output in fractional units between 0.0 and 1.0.

  • Units: fractional

with_output(new_output: float) ModulateVBatOut¶

Modifies this Control Request’s output parameter and returns itself for method-chaining and easier to use request API.

Proportion of VBat to output in fractional units between 0.0 and 1.0.

  • Units: fractional

Parameters:

new_output (float) – Parameter to modify

Returns:

Itself

Return type:

ModulateVBatOut

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) ModulateVBatOut¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

ModulateVBatOut

class phoenix6.controls.SolidColor(led_start_index: int, led_end_index: int, color: RGBWColor = RGBWColor())¶

Sets LEDs to a solid color.

Parameters:
  • led_start_index (int) – The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • led_end_index (int) – The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • color (RGBWColor) – The color to apply to the LEDs.

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

led_start_index¶

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

led_end_index¶

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

color¶

The color to apply to the LEDs.

with_led_start_index(new_led_start_index: int) SolidColor¶

Modifies this Control Request’s led_start_index parameter and returns itself for method-chaining and easier to use request API.

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_start_index (int) – Parameter to modify

Returns:

Itself

Return type:

SolidColor

with_led_end_index(new_led_end_index: int) SolidColor¶

Modifies this Control Request’s led_end_index parameter and returns itself for method-chaining and easier to use request API.

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_end_index (int) – Parameter to modify

Returns:

Itself

Return type:

SolidColor

with_color(new_color: RGBWColor) SolidColor¶

Modifies this Control Request’s color parameter and returns itself for method-chaining and easier to use request API.

The color to apply to the LEDs.

Parameters:

new_color (RGBWColor) – Parameter to modify

Returns:

Itself

Return type:

SolidColor

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) SolidColor¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

SolidColor

class phoenix6.controls.EmptyAnimation(slot: int)¶

An empty animation, clearing any animation in the specified slot.

Parameters:

slot (int) – The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '0'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

slot¶

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

with_slot(new_slot: int) EmptyAnimation¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

EmptyAnimation

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) EmptyAnimation¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

EmptyAnimation

class phoenix6.controls.ColorFlowAnimation(led_start_index: int, led_end_index: int, slot: int = 0, color: RGBWColor = RGBWColor(), direction: AnimationDirectionValue = AnimationDirectionValue.FORWARD, frame_rate: phoenix6.units.hertz = 25)¶

Animation that gradually lights the entire LED strip one LED at a time.

Parameters:
  • led_start_index (int) –

    The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip

    If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter.

  • led_end_index (int) –

    The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

    If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter.

  • slot (int) – The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

  • color (RGBWColor) – The color to use in the animation.

  • direction (AnimationDirectionValue) – The direction of the animation.

  • frame_rate (hertz) –

    The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

    A frame is defined as a transition in the state of the LEDs, turning one on or off.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

led_start_index¶

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip

If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter.

led_end_index¶

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter.

slot = '0'¶

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

color¶

The color to use in the animation.

direction¶

The direction of the animation.

frame_rate = '25'¶

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, turning one on or off.

  • Units: Hz

with_led_start_index(new_led_start_index: int) ColorFlowAnimation¶

Modifies this Control Request’s led_start_index parameter and returns itself for method-chaining and easier to use request API.

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip

If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter.

Parameters:

new_led_start_index (int) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

with_led_end_index(new_led_end_index: int) ColorFlowAnimation¶

Modifies this Control Request’s led_end_index parameter and returns itself for method-chaining and easier to use request API.

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter.

Parameters:

new_led_end_index (int) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

with_slot(new_slot: int) ColorFlowAnimation¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

with_color(new_color: RGBWColor) ColorFlowAnimation¶

Modifies this Control Request’s color parameter and returns itself for method-chaining and easier to use request API.

The color to use in the animation.

Parameters:

new_color (RGBWColor) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

with_direction(new_direction: AnimationDirectionValue) ColorFlowAnimation¶

Modifies this Control Request’s direction parameter and returns itself for method-chaining and easier to use request API.

The direction of the animation.

Parameters:

new_direction (AnimationDirectionValue) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

with_frame_rate(new_frame_rate: phoenix6.units.hertz) ColorFlowAnimation¶

Modifies this Control Request’s frame_rate parameter and returns itself for method-chaining and easier to use request API.

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, turning one on or off.

  • Units: Hz

Parameters:

new_frame_rate (hertz) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) ColorFlowAnimation¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

ColorFlowAnimation

class phoenix6.controls.FireAnimation(led_start_index: int, led_end_index: int, slot: int = 0, brightness: float = 1.0, direction: AnimationDirectionValue = AnimationDirectionValue.FORWARD, sparking: float = 0.6, cooling: float = 0.3, frame_rate: phoenix6.units.hertz = 60)¶

Animation that looks similar to a flame flickering.

Parameters:
  • led_start_index (int) –

    The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip

    If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter.

  • led_end_index (int) –

    The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

    If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter.

  • slot (int) – The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

  • brightness (float) – The brightness of the animation, as a scalar from 0.0 to 1.0.

  • direction (AnimationDirectionValue) – The direction of the animation.

  • sparking (float) – The proportion of time in which sparks reignite the fire, as a scalar from 0.0 to 1.0.

  • cooling (float) – The rate at which the fire cools along the travel, as a scalar from 0.0 to 1.0.

  • frame_rate (hertz) –

    The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

    A frame is defined as a transition in the state of the LEDs, advancing the animation of the fire.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

led_start_index¶

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip

If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter.

led_end_index¶

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter.

slot = '0'¶

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

brightness = '1.0'¶

The brightness of the animation, as a scalar from 0.0 to 1.0.

direction¶

The direction of the animation.

sparking = '0.6'¶

The proportion of time in which sparks reignite the fire, as a scalar from 0.0 to 1.0.

cooling = '0.3'¶

The rate at which the fire cools along the travel, as a scalar from 0.0 to 1.0.

frame_rate = '60'¶

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, advancing the animation of the fire.

  • Units: Hz

with_led_start_index(new_led_start_index: int) FireAnimation¶

Modifies this Control Request’s led_start_index parameter and returns itself for method-chaining and easier to use request API.

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip

If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter.

Parameters:

new_led_start_index (int) – Parameter to modify

Returns:

Itself

Return type:

FireAnimation

with_led_end_index(new_led_end_index: int) FireAnimation¶

Modifies this Control Request’s led_end_index parameter and returns itself for method-chaining and easier to use request API.

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter.

Parameters:

new_led_end_index (int) – Parameter to modify

Returns:

Itself

Return type:

FireAnimation

with_slot(new_slot: int) FireAnimation¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

FireAnimation

with_brightness(new_brightness: float) FireAnimation¶

Modifies this Control Request’s brightness parameter and returns itself for method-chaining and easier to use request API.

The brightness of the animation, as a scalar from 0.0 to 1.0.

Parameters:

new_brightness (float) – Parameter to modify

Returns:

Itself

Return type:

FireAnimation

with_direction(new_direction: AnimationDirectionValue) FireAnimation¶

Modifies this Control Request’s direction parameter and returns itself for method-chaining and easier to use request API.

The direction of the animation.

Parameters:

new_direction (AnimationDirectionValue) – Parameter to modify

Returns:

Itself

Return type:

FireAnimation

with_sparking(new_sparking: float) FireAnimation¶

Modifies this Control Request’s sparking parameter and returns itself for method-chaining and easier to use request API.

The proportion of time in which sparks reignite the fire, as a scalar from 0.0 to 1.0.

Parameters:

new_sparking (float) – Parameter to modify

Returns:

Itself

Return type:

FireAnimation

with_cooling(new_cooling: float) FireAnimation¶

Modifies this Control Request’s cooling parameter and returns itself for method-chaining and easier to use request API.

The rate at which the fire cools along the travel, as a scalar from 0.0 to 1.0.

Parameters:

new_cooling (float) – Parameter to modify

Returns:

Itself

Return type:

FireAnimation

with_frame_rate(new_frame_rate: phoenix6.units.hertz) FireAnimation¶

Modifies this Control Request’s frame_rate parameter and returns itself for method-chaining and easier to use request API.

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, advancing the animation of the fire.

  • Units: Hz

Parameters:

new_frame_rate (hertz) – Parameter to modify

Returns:

Itself

Return type:

FireAnimation

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) FireAnimation¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

FireAnimation

class phoenix6.controls.LarsonAnimation(led_start_index: int, led_end_index: int, slot: int = 0, color: RGBWColor = RGBWColor(), size: int = 3, bounce_mode: LarsonBounceValue = LarsonBounceValue.FRONT, frame_rate: phoenix6.units.hertz = 25)¶

Animation that bounces a pocket of light across the LED strip.

Parameters:
  • led_start_index (int) – The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • led_end_index (int) – The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • slot (int) – The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

  • color (RGBWColor) – The color to use in the animation.

  • size (int) – The number of LEDs in the pocket of light, up to 15.

  • bounce_mode (LarsonBounceValue) – The behavior of the pocket of light when it reaches the end of the strip.

  • frame_rate (hertz) –

    The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

    A frame is defined as a transition in the state of the LEDs, advancing the pocket of light by one LED.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

led_start_index¶

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

led_end_index¶

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

slot = '0'¶

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

color¶

The color to use in the animation.

size = '3'¶

The number of LEDs in the pocket of light, up to 15.

bounce_mode¶

The behavior of the pocket of light when it reaches the end of the strip.

frame_rate = '25'¶

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, advancing the pocket of light by one LED.

  • Units: Hz

with_led_start_index(new_led_start_index: int) LarsonAnimation¶

Modifies this Control Request’s led_start_index parameter and returns itself for method-chaining and easier to use request API.

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_start_index (int) – Parameter to modify

Returns:

Itself

Return type:

LarsonAnimation

with_led_end_index(new_led_end_index: int) LarsonAnimation¶

Modifies this Control Request’s led_end_index parameter and returns itself for method-chaining and easier to use request API.

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_end_index (int) – Parameter to modify

Returns:

Itself

Return type:

LarsonAnimation

with_slot(new_slot: int) LarsonAnimation¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

LarsonAnimation

with_color(new_color: RGBWColor) LarsonAnimation¶

Modifies this Control Request’s color parameter and returns itself for method-chaining and easier to use request API.

The color to use in the animation.

Parameters:

new_color (RGBWColor) – Parameter to modify

Returns:

Itself

Return type:

LarsonAnimation

with_size(new_size: int) LarsonAnimation¶

Modifies this Control Request’s size parameter and returns itself for method-chaining and easier to use request API.

The number of LEDs in the pocket of light, up to 15.

Parameters:

new_size (int) – Parameter to modify

Returns:

Itself

Return type:

LarsonAnimation

with_bounce_mode(new_bounce_mode: LarsonBounceValue) LarsonAnimation¶

Modifies this Control Request’s bounce_mode parameter and returns itself for method-chaining and easier to use request API.

The behavior of the pocket of light when it reaches the end of the strip.

Parameters:

new_bounce_mode (LarsonBounceValue) – Parameter to modify

Returns:

Itself

Return type:

LarsonAnimation

with_frame_rate(new_frame_rate: phoenix6.units.hertz) LarsonAnimation¶

Modifies this Control Request’s frame_rate parameter and returns itself for method-chaining and easier to use request API.

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, advancing the pocket of light by one LED.

  • Units: Hz

Parameters:

new_frame_rate (hertz) – Parameter to modify

Returns:

Itself

Return type:

LarsonAnimation

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) LarsonAnimation¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

LarsonAnimation

class phoenix6.controls.RainbowAnimation(led_start_index: int, led_end_index: int, slot: int = 0, brightness: float = 1.0, direction: AnimationDirectionValue = AnimationDirectionValue.FORWARD, frame_rate: phoenix6.units.hertz = 100)¶

Animation that creates a rainbow throughout all the LEDs.

Parameters:
  • led_start_index (int) –

    The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip

    If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter.

  • led_end_index (int) –

    The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

    If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter.

  • slot (int) – The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

  • brightness (float) – The brightness of the animation, as a scalar from 0.0 to 1.0.

  • direction (AnimationDirectionValue) – The direction of the animation.

  • frame_rate (hertz) –

    The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

    A frame is defined as a transition in the state of the LEDs, advancing the rainbow by about 3 degrees of hue (out of 360 degrees).

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

led_start_index¶

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip

If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter.

led_end_index¶

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter.

slot = '0'¶

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

brightness = '1.0'¶

The brightness of the animation, as a scalar from 0.0 to 1.0.

direction¶

The direction of the animation.

frame_rate = '100'¶

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, advancing the rainbow by about 3 degrees of hue (out of 360 degrees).

  • Units: Hz

with_led_start_index(new_led_start_index: int) RainbowAnimation¶

Modifies this Control Request’s led_start_index parameter and returns itself for method-chaining and easier to use request API.

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip

If the start index is greater than the end index, the direction will be reversed. The direction can also be changed using the Direction parameter.

Parameters:

new_led_start_index (int) – Parameter to modify

Returns:

Itself

Return type:

RainbowAnimation

with_led_end_index(new_led_end_index: int) RainbowAnimation¶

Modifies this Control Request’s led_end_index parameter and returns itself for method-chaining and easier to use request API.

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

If the end index is less than the start index, the direction will be reversed. The direction can also be changed using the Direction parameter.

Parameters:

new_led_end_index (int) – Parameter to modify

Returns:

Itself

Return type:

RainbowAnimation

with_slot(new_slot: int) RainbowAnimation¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

RainbowAnimation

with_brightness(new_brightness: float) RainbowAnimation¶

Modifies this Control Request’s brightness parameter and returns itself for method-chaining and easier to use request API.

The brightness of the animation, as a scalar from 0.0 to 1.0.

Parameters:

new_brightness (float) – Parameter to modify

Returns:

Itself

Return type:

RainbowAnimation

with_direction(new_direction: AnimationDirectionValue) RainbowAnimation¶

Modifies this Control Request’s direction parameter and returns itself for method-chaining and easier to use request API.

The direction of the animation.

Parameters:

new_direction (AnimationDirectionValue) – Parameter to modify

Returns:

Itself

Return type:

RainbowAnimation

with_frame_rate(new_frame_rate: phoenix6.units.hertz) RainbowAnimation¶

Modifies this Control Request’s frame_rate parameter and returns itself for method-chaining and easier to use request API.

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, advancing the rainbow by about 3 degrees of hue (out of 360 degrees).

  • Units: Hz

Parameters:

new_frame_rate (hertz) – Parameter to modify

Returns:

Itself

Return type:

RainbowAnimation

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) RainbowAnimation¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

RainbowAnimation

class phoenix6.controls.RgbFadeAnimation(led_start_index: int, led_end_index: int, slot: int = 0, brightness: float = 1.0, frame_rate: phoenix6.units.hertz = 100)¶

Animation that fades all the LEDs of a strip simultaneously between Red, Green, and Blue.

Parameters:
  • led_start_index (int) – The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • led_end_index (int) – The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • slot (int) – The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

  • brightness (float) – The brightness of the animation, as a scalar from 0.0 to 1.0.

  • frame_rate (hertz) –

    The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

    A frame is defined as a transition in the state of the LEDs, adjusting the brightness of the LEDs by 1%.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

led_start_index¶

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

led_end_index¶

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

slot = '0'¶

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

brightness = '1.0'¶

The brightness of the animation, as a scalar from 0.0 to 1.0.

frame_rate = '100'¶

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, adjusting the brightness of the LEDs by 1%.

  • Units: Hz

with_led_start_index(new_led_start_index: int) RgbFadeAnimation¶

Modifies this Control Request’s led_start_index parameter and returns itself for method-chaining and easier to use request API.

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_start_index (int) – Parameter to modify

Returns:

Itself

Return type:

RgbFadeAnimation

with_led_end_index(new_led_end_index: int) RgbFadeAnimation¶

Modifies this Control Request’s led_end_index parameter and returns itself for method-chaining and easier to use request API.

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_end_index (int) – Parameter to modify

Returns:

Itself

Return type:

RgbFadeAnimation

with_slot(new_slot: int) RgbFadeAnimation¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

RgbFadeAnimation

with_brightness(new_brightness: float) RgbFadeAnimation¶

Modifies this Control Request’s brightness parameter and returns itself for method-chaining and easier to use request API.

The brightness of the animation, as a scalar from 0.0 to 1.0.

Parameters:

new_brightness (float) – Parameter to modify

Returns:

Itself

Return type:

RgbFadeAnimation

with_frame_rate(new_frame_rate: phoenix6.units.hertz) RgbFadeAnimation¶

Modifies this Control Request’s frame_rate parameter and returns itself for method-chaining and easier to use request API.

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, adjusting the brightness of the LEDs by 1%.

  • Units: Hz

Parameters:

new_frame_rate (hertz) – Parameter to modify

Returns:

Itself

Return type:

RgbFadeAnimation

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) RgbFadeAnimation¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

RgbFadeAnimation

class phoenix6.controls.SingleFadeAnimation(led_start_index: int, led_end_index: int, slot: int = 0, color: RGBWColor = RGBWColor(), frame_rate: phoenix6.units.hertz = 100)¶

Animation that fades into and out of a specified color.

Parameters:
  • led_start_index (int) – The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • led_end_index (int) – The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • slot (int) – The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

  • color (RGBWColor) – The color to use in the animation.

  • frame_rate (hertz) –

    The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

    A frame is defined as a transition in the state of the LEDs, adjusting the brightness of the LEDs by 1%.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

led_start_index¶

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

led_end_index¶

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

slot = '0'¶

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

color¶

The color to use in the animation.

frame_rate = '100'¶

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, adjusting the brightness of the LEDs by 1%.

  • Units: Hz

with_led_start_index(new_led_start_index: int) SingleFadeAnimation¶

Modifies this Control Request’s led_start_index parameter and returns itself for method-chaining and easier to use request API.

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_start_index (int) – Parameter to modify

Returns:

Itself

Return type:

SingleFadeAnimation

with_led_end_index(new_led_end_index: int) SingleFadeAnimation¶

Modifies this Control Request’s led_end_index parameter and returns itself for method-chaining and easier to use request API.

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_end_index (int) – Parameter to modify

Returns:

Itself

Return type:

SingleFadeAnimation

with_slot(new_slot: int) SingleFadeAnimation¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

SingleFadeAnimation

with_color(new_color: RGBWColor) SingleFadeAnimation¶

Modifies this Control Request’s color parameter and returns itself for method-chaining and easier to use request API.

The color to use in the animation.

Parameters:

new_color (RGBWColor) – Parameter to modify

Returns:

Itself

Return type:

SingleFadeAnimation

with_frame_rate(new_frame_rate: phoenix6.units.hertz) SingleFadeAnimation¶

Modifies this Control Request’s frame_rate parameter and returns itself for method-chaining and easier to use request API.

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, adjusting the brightness of the LEDs by 1%.

  • Units: Hz

Parameters:

new_frame_rate (hertz) – Parameter to modify

Returns:

Itself

Return type:

SingleFadeAnimation

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) SingleFadeAnimation¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

SingleFadeAnimation

class phoenix6.controls.StrobeAnimation(led_start_index: int, led_end_index: int, slot: int = 0, color: RGBWColor = RGBWColor(), frame_rate: phoenix6.units.hertz = 4)¶

Animation that strobes the LEDs a specified color.

Parameters:
  • led_start_index (int) – The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • led_end_index (int) – The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • slot (int) – The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

  • color (RGBWColor) – The color to use in the animation.

  • frame_rate (hertz) –

    The frame rate of the animation, from [1, 500] Hz. This determines the speed of the animation.

    A frame is defined as a transition in the state of the LEDs, turning all LEDs on or off.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

led_start_index¶

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

led_end_index¶

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

slot = '0'¶

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

color¶

The color to use in the animation.

frame_rate = '4'¶

The frame rate of the animation, from [1, 500] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, turning all LEDs on or off.

  • Units: Hz

with_led_start_index(new_led_start_index: int) StrobeAnimation¶

Modifies this Control Request’s led_start_index parameter and returns itself for method-chaining and easier to use request API.

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_start_index (int) – Parameter to modify

Returns:

Itself

Return type:

StrobeAnimation

with_led_end_index(new_led_end_index: int) StrobeAnimation¶

Modifies this Control Request’s led_end_index parameter and returns itself for method-chaining and easier to use request API.

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_end_index (int) – Parameter to modify

Returns:

Itself

Return type:

StrobeAnimation

with_slot(new_slot: int) StrobeAnimation¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

StrobeAnimation

with_color(new_color: RGBWColor) StrobeAnimation¶

Modifies this Control Request’s color parameter and returns itself for method-chaining and easier to use request API.

The color to use in the animation.

Parameters:

new_color (RGBWColor) – Parameter to modify

Returns:

Itself

Return type:

StrobeAnimation

with_frame_rate(new_frame_rate: phoenix6.units.hertz) StrobeAnimation¶

Modifies this Control Request’s frame_rate parameter and returns itself for method-chaining and easier to use request API.

The frame rate of the animation, from [1, 500] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, turning all LEDs on or off.

  • Units: Hz

Parameters:

new_frame_rate (hertz) – Parameter to modify

Returns:

Itself

Return type:

StrobeAnimation

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) StrobeAnimation¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

StrobeAnimation

class phoenix6.controls.TwinkleAnimation(led_start_index: int, led_end_index: int, slot: int = 0, color: RGBWColor = RGBWColor(), max_leds_on_proportion: float = 0.5, frame_rate: phoenix6.units.hertz = 100)¶

Animation that randomly turns LEDs on and off to a certain color.

Parameters:
  • led_start_index (int) – The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • led_end_index (int) – The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • slot (int) – The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

  • color (RGBWColor) – The color to use in the animation.

  • max_leds_on_proportion (float) – The max proportion of LEDs that can be on, in the range [0.1, 1.0].

  • frame_rate (hertz) –

    The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

    A frame is defined as a transition in the state of the LEDs, turning one on or off.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

led_start_index¶

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

led_end_index¶

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

slot = '0'¶

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

color¶

The color to use in the animation.

max_leds_on_proportion = '0.5'¶

The max proportion of LEDs that can be on, in the range [0.1, 1.0].

frame_rate = '100'¶

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, turning one on or off.

  • Units: Hz

with_led_start_index(new_led_start_index: int) TwinkleAnimation¶

Modifies this Control Request’s led_start_index parameter and returns itself for method-chaining and easier to use request API.

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_start_index (int) – Parameter to modify

Returns:

Itself

Return type:

TwinkleAnimation

with_led_end_index(new_led_end_index: int) TwinkleAnimation¶

Modifies this Control Request’s led_end_index parameter and returns itself for method-chaining and easier to use request API.

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_end_index (int) – Parameter to modify

Returns:

Itself

Return type:

TwinkleAnimation

with_slot(new_slot: int) TwinkleAnimation¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

TwinkleAnimation

with_color(new_color: RGBWColor) TwinkleAnimation¶

Modifies this Control Request’s color parameter and returns itself for method-chaining and easier to use request API.

The color to use in the animation.

Parameters:

new_color (RGBWColor) – Parameter to modify

Returns:

Itself

Return type:

TwinkleAnimation

with_max_leds_on_proportion(new_max_leds_on_proportion: float) TwinkleAnimation¶

Modifies this Control Request’s max_leds_on_proportion parameter and returns itself for method-chaining and easier to use request API.

The max proportion of LEDs that can be on, in the range [0.1, 1.0].

Parameters:

new_max_leds_on_proportion (float) – Parameter to modify

Returns:

Itself

Return type:

TwinkleAnimation

with_frame_rate(new_frame_rate: phoenix6.units.hertz) TwinkleAnimation¶

Modifies this Control Request’s frame_rate parameter and returns itself for method-chaining and easier to use request API.

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, turning one on or off.

  • Units: Hz

Parameters:

new_frame_rate (hertz) – Parameter to modify

Returns:

Itself

Return type:

TwinkleAnimation

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) TwinkleAnimation¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

TwinkleAnimation

class phoenix6.controls.TwinkleOffAnimation(led_start_index: int, led_end_index: int, slot: int = 0, color: RGBWColor = RGBWColor(), max_leds_on_proportion: float = 1.0, frame_rate: phoenix6.units.hertz = 25)¶

Animation that randomly turns on LEDs until it reaches the maximum count, and then turns them all off.

Parameters:
  • led_start_index (int) – The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • led_end_index (int) – The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

  • slot (int) – The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

  • color (RGBWColor) – The color to use in the animation.

  • max_leds_on_proportion (float) – The max proportion of LEDs that can be on, in the range [0.1, 1.0].

  • frame_rate (hertz) –

    The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

    A frame is defined as a transition in the state of the LEDs, turning one LED on or all LEDs off.

property name: str¶

Gets the name of this control request.

Returns:

Name of the control request

Return type:

str

property control_info: dict¶

Gets information about this control request.

Returns:

Dictonary of control parameter names and corresponding applied values

Return type:

dict

update_freq_hz: phoenix6.units.hertz = '20'¶

The frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

led_start_index¶

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

led_end_index¶

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

slot = '0'¶

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

color¶

The color to use in the animation.

max_leds_on_proportion = '1.0'¶

The max proportion of LEDs that can be on, in the range [0.1, 1.0].

frame_rate = '25'¶

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, turning one LED on or all LEDs off.

  • Units: Hz

with_led_start_index(new_led_start_index: int) TwinkleOffAnimation¶

Modifies this Control Request’s led_start_index parameter and returns itself for method-chaining and easier to use request API.

The index of the first LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_start_index (int) – Parameter to modify

Returns:

Itself

Return type:

TwinkleOffAnimation

with_led_end_index(new_led_end_index: int) TwinkleOffAnimation¶

Modifies this Control Request’s led_end_index parameter and returns itself for method-chaining and easier to use request API.

The index of the last LED this animation controls (inclusive). Indices 0-7 control the onboard LEDs, and 8-399 control an attached LED strip.

Parameters:

new_led_end_index (int) – Parameter to modify

Returns:

Itself

Return type:

TwinkleOffAnimation

with_slot(new_slot: int) TwinkleOffAnimation¶

Modifies this Control Request’s slot parameter and returns itself for method-chaining and easier to use request API.

The slot of this animation, within [0, 7]. Each slot on the CANdle can store and run one animation.

Parameters:

new_slot (int) – Parameter to modify

Returns:

Itself

Return type:

TwinkleOffAnimation

with_color(new_color: RGBWColor) TwinkleOffAnimation¶

Modifies this Control Request’s color parameter and returns itself for method-chaining and easier to use request API.

The color to use in the animation.

Parameters:

new_color (RGBWColor) – Parameter to modify

Returns:

Itself

Return type:

TwinkleOffAnimation

with_max_leds_on_proportion(new_max_leds_on_proportion: float) TwinkleOffAnimation¶

Modifies this Control Request’s max_leds_on_proportion parameter and returns itself for method-chaining and easier to use request API.

The max proportion of LEDs that can be on, in the range [0.1, 1.0].

Parameters:

new_max_leds_on_proportion (float) – Parameter to modify

Returns:

Itself

Return type:

TwinkleOffAnimation

with_frame_rate(new_frame_rate: phoenix6.units.hertz) TwinkleOffAnimation¶

Modifies this Control Request’s frame_rate parameter and returns itself for method-chaining and easier to use request API.

The frame rate of the animation, from [2, 1000] Hz. This determines the speed of the animation.

A frame is defined as a transition in the state of the LEDs, turning one LED on or all LEDs off.

  • Units: Hz

Parameters:

new_frame_rate (hertz) – Parameter to modify

Returns:

Itself

Return type:

TwinkleOffAnimation

with_update_freq_hz(new_update_freq_hz: phoenix6.units.hertz) TwinkleOffAnimation¶

Sets the frequency at which this control will update. This is designated in Hertz, with a minimum of 20 Hz (every 50 ms) and a maximum of 1000 Hz (every 1 ms). Some update frequencies are not supported and will be promoted up to the next highest supported frequency.

If this field is set to 0 Hz, the control request will be sent immediately as a one-shot frame. This may be useful for advanced applications that require outputs to be synchronized with data acquisition. In this case, we recommend not exceeding 50 ms between control calls.

Parameters:

new_update_freq_hz (hertz) – Parameter to modify

Returns:

Itself

Return type:

TwinkleOffAnimation