CTRE Phoenix 6 C++ 25.4.0
|
Requires Phoenix Pro; Contains all FOC-exclusive control functions available for devices that support FOC. More...
#include <ctre/phoenix6/hardware/traits/SupportsFOC.hpp>
Public Member Functions | |
virtual | ~SupportsFOC ()=default |
virtual ctre::phoenix::StatusCode | SetControl (const controls::TorqueCurrentFOC &request)=0 |
Request a specified motor current (field oriented control). | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::PositionTorqueCurrentFOC &request)=0 |
Request PID to target position with torque current feedforward. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::VelocityTorqueCurrentFOC &request)=0 |
Request PID to target velocity with torque current feedforward. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::MotionMagicTorqueCurrentFOC &request)=0 |
Requests Motion Magic® to target a final position using a motion profile. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::MotionMagicVelocityTorqueCurrentFOC &request)=0 |
Requests Motion Magic® to target a final velocity using a motion profile. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::MotionMagicExpoTorqueCurrentFOC &request)=0 |
Requests Motion Magic® to target a final position using an exponential motion profile. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::DynamicMotionMagicTorqueCurrentFOC &request)=0 |
Requests Motion Magic® to target a final position using a motion profile. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::compound::Diff_TorqueCurrentFOC_Position &request)=0 |
Differential control with torque current average target and position difference target. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::compound::Diff_PositionTorqueCurrentFOC_Position &request)=0 |
Differential control with position average target and position difference target using torque current control. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::compound::Diff_VelocityTorqueCurrentFOC_Position &request)=0 |
Differential control with velocity average target and position difference target using torque current control. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::compound::Diff_MotionMagicTorqueCurrentFOC_Position &request)=0 |
Differential control with Motion Magic® average target and position difference target using torque current control. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::compound::Diff_TorqueCurrentFOC_Velocity &request)=0 |
Differential control with torque current average target and velocity difference target. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::compound::Diff_PositionTorqueCurrentFOC_Velocity &request)=0 |
Differential control with position average target and velocity difference target using torque current control. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::compound::Diff_VelocityTorqueCurrentFOC_Velocity &request)=0 |
Differential control with velocity average target and velocity difference target using torque current control. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::compound::Diff_MotionMagicTorqueCurrentFOC_Velocity &request)=0 |
Differential control with Motion Magic® average target and velocity difference target using torque current control. | |
virtual ctre::phoenix::StatusCode | SetControl (const controls::ControlRequest &request)=0 |
Control device with generic control request object. | |
Requires Phoenix Pro; Contains all FOC-exclusive control functions available for devices that support FOC.
|
virtualdefault |
|
pure virtual |
Differential control with Motion Magic® average target and position difference target using torque current control.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
Differential control with Motion Magic® average target and velocity difference target using torque current control.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
Differential control with position average target and position difference target using torque current control.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
Differential control with position average target and velocity difference target using torque current control.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
Differential control with torque current average target and position difference target.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
Differential control with torque current average target and velocity difference target.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
Differential control with velocity average target and position difference target using torque current control.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
Differential control with velocity average target and velocity difference target using torque current control.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
Control device with generic control request object.
User must make sure the specified object is castable to a valid control request, otherwise this function will fail at run-time and return the NotSupported StatusCode
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
Requests Motion Magic® to target a final position using a motion profile.
This dynamic request allows runtime changes to Cruise Velocity, Acceleration, and Jerk. Users can optionally provide a torque current feedforward. This control requires use of a CANivore.
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.
Jerk: 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.
IgnoreHardwareLimits: 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.
UseTimesync: 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.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
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.
IgnoreHardwareLimits: 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.
UseTimesync: 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.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
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.
IgnoreHardwareLimits: 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.
UseTimesync: 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.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
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.
EnableFOC: Set to true to use FOC commutation (requires Phoenix Pro), which increases peak power by ~15% on supported devices (see hardware::traits::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.
IgnoreHardwareLimits: 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.
UseTimesync: 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.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
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.
IgnoreHardwareLimits: 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.
UseTimesync: 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.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
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.
IgnoreHardwareLimits: 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.
UseTimesync: 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.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.
|
pure virtual |
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.
IgnoreHardwareLimits: 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.
UseTimesync: 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.
request | Control object to request of the device |
Implemented in ctre::phoenix6::hardware::core::CoreTalonFX, and ctre::phoenix6::hardware::traits::CommonTalonWithFOC.