CTRE Phoenix Pro C++ 23.0.12
|
Class description for the Talon FX integrated motor controller that runs on associated Falcon motors. More...
#include <ctre/phoenixpro/core/CoreTalonFX.hpp>
Public Member Functions | |
CoreTalonFX (int deviceId, std::string canbus="") | |
Constructs a new Talon FX motor controller object. More... | |
CoreTalonFX (CoreTalonFX const &)=delete | |
CoreTalonFX & | operator= (CoreTalonFX const &)=delete |
bool | HasResetOccurred () |
configs::TalonFXConfigurator & | GetConfigurator () |
Gets the configurator for this TalonFX. More... | |
configs::TalonFXConfigurator const & | GetConfigurator () const |
Gets the configurator for this TalonFX. More... | |
sim::TalonFXSimState & | GetSimState () |
Get the simulation state for this device. More... | |
StatusSignalValue< int > & | GetVersionMajor () |
App Major Version number. More... | |
StatusSignalValue< int > & | GetVersionMinor () |
App Minor Version number. More... | |
StatusSignalValue< int > & | GetVersionBugfix () |
App Bugfix Version number. More... | |
StatusSignalValue< int > & | GetVersionBuild () |
App Build Version number. More... | |
StatusSignalValue< int > & | GetVersion () |
Full Version. More... | |
StatusSignalValue< int > & | GetFaultField () |
Integer representing all faults. More... | |
StatusSignalValue< int > & | GetStickyFaultField () |
Integer representing all sticky faults. More... | |
StatusSignalValue< signals::ForwardLimitValue > & | GetForwardLimit () |
Forward Limit Pin. More... | |
StatusSignalValue< signals::ReverseLimitValue > & | GetReverseLimit () |
Reverse Limit Pin. More... | |
StatusSignalValue< signals::AppliedRotorPolarityValue > & | GetAppliedRotorPolarity () |
The applied rotor polarity. More... | |
StatusSignalValue< units::dimensionless::scalar_t > & | GetDutyCycle () |
The applied motor duty cycle. More... | |
StatusSignalValue< units::current::ampere_t > & | GetTorqueCurrent () |
Current corresponding to the torque output by the motor. More... | |
StatusSignalValue< units::current::ampere_t > & | GetStatorCurrent () |
Current corresponding to the stator windings. More... | |
StatusSignalValue< units::current::ampere_t > & | GetSupplyCurrent () |
Measured supply side current. More... | |
StatusSignalValue< units::voltage::volt_t > & | GetSupplyVoltage () |
Measured supply voltage to the TalonFX. More... | |
StatusSignalValue< units::temperature::celsius_t > & | GetDeviceTemp () |
Temperature of device. More... | |
StatusSignalValue< units::temperature::celsius_t > & | GetProcessorTemp () |
Temperature of the processor. More... | |
StatusSignalValue< units::angular_velocity::turns_per_second_t > & | GetRotorVelocity () |
Velocity of motor rotor. More... | |
StatusSignalValue< units::angle::turn_t > & | GetRotorPosition () |
Position of motor rotor. More... | |
StatusSignalValue< units::angular_velocity::turns_per_second_t > & | GetVelocity () |
Velocity of device. More... | |
StatusSignalValue< units::angle::turn_t > & | GetPosition () |
Position of device. More... | |
StatusSignalValue< signals::ControlModeValue > & | GetControlMode () |
The active control mode of the motor controller. More... | |
StatusSignalValue< signals::MotionMagicIsRunningValue > & | GetMotionMagicIsRunning () |
Check if Motion Magic® is running. More... | |
StatusSignalValue< signals::DeviceEnableValue > & | GetDeviceEnable () |
Indicates if device is actuator enabled. More... | |
StatusSignalValue< int > & | GetClosedLoopSlot () |
Closed loop slot in use. More... | |
StatusSignalValue< signals::BridgeOuputValue > & | GetBridgeOuput () |
The applied output of the bridge. More... | |
StatusSignalValue< bool > & | GetFault_Hardware () |
Hardware fault occurred. More... | |
StatusSignalValue< bool > & | GetStickyFault_Hardware () |
Hardware fault occurred. More... | |
StatusSignalValue< bool > & | GetFault_ProcTemp () |
Processor temperature exceeded limit. More... | |
StatusSignalValue< bool > & | GetStickyFault_ProcTemp () |
Processor temperature exceeded limit. More... | |
StatusSignalValue< bool > & | GetFault_DeviceTemp () |
Device temperature exceeded limit. More... | |
StatusSignalValue< bool > & | GetStickyFault_DeviceTemp () |
Device temperature exceeded limit. More... | |
StatusSignalValue< bool > & | GetFault_Undervoltage () |
Device supply voltage dropped to near brownout levels. More... | |
StatusSignalValue< bool > & | GetStickyFault_Undervoltage () |
Device supply voltage dropped to near brownout levels. More... | |
StatusSignalValue< bool > & | GetFault_BootDuringEnable () |
Device boot while detecting the enable signal. More... | |
StatusSignalValue< bool > & | GetStickyFault_BootDuringEnable () |
Device boot while detecting the enable signal. More... | |
StatusSignalValue< bool > & | GetFault_OverSupplyV () |
Supply Voltage has exceeded the maximum voltage rating of device. More... | |
StatusSignalValue< bool > & | GetStickyFault_OverSupplyV () |
Supply Voltage has exceeded the maximum voltage rating of device. More... | |
StatusSignalValue< bool > & | GetFault_UnstableSupplyV () |
Supply Voltage is unstable. More... | |
StatusSignalValue< bool > & | GetStickyFault_UnstableSupplyV () |
Supply Voltage is unstable. More... | |
StatusSignalValue< bool > & | GetFault_ReverseHardLimit () |
Reverse limit switch has been asserted. More... | |
StatusSignalValue< bool > & | GetStickyFault_ReverseHardLimit () |
Reverse limit switch has been asserted. More... | |
StatusSignalValue< bool > & | GetFault_ForwardHardLimit () |
Forward limit switch has been asserted. More... | |
StatusSignalValue< bool > & | GetStickyFault_ForwardHardLimit () |
Forward limit switch has been asserted. More... | |
StatusSignalValue< bool > & | GetFault_ReverseSoftLimit () |
Reverse soft limit has been asserted. More... | |
StatusSignalValue< bool > & | GetStickyFault_ReverseSoftLimit () |
Reverse soft limit has been asserted. More... | |
StatusSignalValue< bool > & | GetFault_ForwardSoftLimit () |
Forward soft limit has been asserted. More... | |
StatusSignalValue< bool > & | GetStickyFault_ForwardSoftLimit () |
Forward soft limit has been asserted. More... | |
StatusSignalValue< bool > & | GetFault_MissingRemoteSensor () |
The remote sensor is not present on CAN Bus. More... | |
StatusSignalValue< bool > & | GetStickyFault_MissingRemoteSensor () |
The remote sensor is not present on CAN Bus. More... | |
StatusSignalValue< bool > & | GetFault_FusedSensorOutOfSync () |
The remote sensor used for fusion has fallen out of sync to the local sensor. More... | |
StatusSignalValue< bool > & | GetStickyFault_FusedSensorOutOfSync () |
The remote sensor used for fusion has fallen out of sync to the local sensor. More... | |
StatusSignalValue< bool > & | GetFault_StatorCurrLimit () |
Stator current limit occured. More... | |
StatusSignalValue< bool > & | GetStickyFault_StatorCurrLimit () |
Stator current limit occured. More... | |
StatusSignalValue< bool > & | GetFault_SupplyCurrLimit () |
Supply current limit occured. More... | |
StatusSignalValue< bool > & | GetStickyFault_SupplyCurrLimit () |
Supply current limit occured. More... | |
StatusSignalValue< double > & | GetClosedLoopProportionalOutput () |
Closed loop proportional component. More... | |
StatusSignalValue< double > & | GetClosedLoopIntegratedOutput () |
Closed loop integrated component. More... | |
StatusSignalValue< double > & | GetClosedLoopFeedForward () |
Feed Forward passed by the user. More... | |
StatusSignalValue< double > & | GetClosedLoopDerivativeOutput () |
Closed loop derivative component. More... | |
StatusSignalValue< double > & | GetClosedLoopOutput () |
Closed loop total output. More... | |
StatusSignalValue< double > & | GetClosedLoopReference () |
Value that the closed loop is targeting. More... | |
StatusSignalValue< double > & | GetClosedLoopReferenceSlope () |
Derivative of the target that the closed loop is targeting. More... | |
StatusSignalValue< double > & | GetClosedLoopError () |
The difference between target reference and current measurement. More... | |
ctre::phoenix::StatusCode | SetControl (controls::DutyCycleOut &request) |
Request a specified motor duty cycle. More... | |
ctre::phoenix::StatusCode | SetControl (controls::DutyCycleOut &&request) |
Request a specified motor duty cycle. More... | |
ctre::phoenix::StatusCode | SetControl (controls::TorqueCurrentFOC &request) |
Request a specified motor current (field oriented control). More... | |
ctre::phoenix::StatusCode | SetControl (controls::TorqueCurrentFOC &&request) |
Request a specified motor current (field oriented control). More... | |
ctre::phoenix::StatusCode | SetControl (controls::VoltageOut &request) |
Request a specified voltage. More... | |
ctre::phoenix::StatusCode | SetControl (controls::VoltageOut &&request) |
Request a specified voltage. More... | |
ctre::phoenix::StatusCode | SetControl (controls::PositionDutyCycle &request) |
Request PID to target position with duty cycle feedforward. More... | |
ctre::phoenix::StatusCode | SetControl (controls::PositionDutyCycle &&request) |
Request PID to target position with duty cycle feedforward. More... | |
ctre::phoenix::StatusCode | SetControl (controls::PositionVoltage &request) |
Request PID to target position with voltage feedforward. More... | |
ctre::phoenix::StatusCode | SetControl (controls::PositionVoltage &&request) |
Request PID to target position with voltage feedforward. More... | |
ctre::phoenix::StatusCode | SetControl (controls::PositionTorqueCurrentFOC &request) |
Request PID to target position with torque current feedforward. More... | |
ctre::phoenix::StatusCode | SetControl (controls::PositionTorqueCurrentFOC &&request) |
Request PID to target position with torque current feedforward. More... | |
ctre::phoenix::StatusCode | SetControl (controls::VelocityDutyCycle &request) |
Request PID to target velocity with duty cycle feedforward. More... | |
ctre::phoenix::StatusCode | SetControl (controls::VelocityDutyCycle &&request) |
Request PID to target velocity with duty cycle feedforward. More... | |
ctre::phoenix::StatusCode | SetControl (controls::VelocityVoltage &request) |
Request PID to target velocity with voltage feedforward. More... | |
ctre::phoenix::StatusCode | SetControl (controls::VelocityVoltage &&request) |
Request PID to target velocity with voltage feedforward. More... | |
ctre::phoenix::StatusCode | SetControl (controls::VelocityTorqueCurrentFOC &request) |
Request PID to target velocity with torque current feedforward. More... | |
ctre::phoenix::StatusCode | SetControl (controls::VelocityTorqueCurrentFOC &&request) |
Request PID to target velocity with torque current feedforward. More... | |
ctre::phoenix::StatusCode | SetControl (controls::MotionMagicDutyCycle &request) |
Requests Motion Magic® to target a final position using a motion profile. More... | |
ctre::phoenix::StatusCode | SetControl (controls::MotionMagicDutyCycle &&request) |
Requests Motion Magic® to target a final position using a motion profile. More... | |
ctre::phoenix::StatusCode | SetControl (controls::MotionMagicVoltage &request) |
Requests Motion Magic® to target a final position using a motion profile. More... | |
ctre::phoenix::StatusCode | SetControl (controls::MotionMagicVoltage &&request) |
Requests Motion Magic® to target a final position using a motion profile. More... | |
ctre::phoenix::StatusCode | SetControl (controls::MotionMagicTorqueCurrentFOC &request) |
Requests Motion Magic® to target a final position using a motion profile. More... | |
ctre::phoenix::StatusCode | SetControl (controls::MotionMagicTorqueCurrentFOC &&request) |
Requests Motion Magic® to target a final position using a motion profile. More... | |
ctre::phoenix::StatusCode | SetControl (controls::Follower &request) |
Follow the motor output of another Talon. More... | |
ctre::phoenix::StatusCode | SetControl (controls::Follower &&request) |
Follow the motor output of another Talon. More... | |
ctre::phoenix::StatusCode | SetControl (controls::StrictFollower &request) |
Follow the motor output of another Talon while ignoring the master's invert setting. More... | |
ctre::phoenix::StatusCode | SetControl (controls::StrictFollower &&request) |
Follow the motor output of another Talon while ignoring the master's invert setting. More... | |
ctre::phoenix::StatusCode | SetControl (controls::NeutralOut &request) |
Request neutral output of actuator. More... | |
ctre::phoenix::StatusCode | SetControl (controls::NeutralOut &&request) |
Request neutral output of actuator. More... | |
ctre::phoenix::StatusCode | SetControl (controls::CoastOut &request) |
Request coast neutral output of actuator. More... | |
ctre::phoenix::StatusCode | SetControl (controls::CoastOut &&request) |
Request coast neutral output of actuator. More... | |
ctre::phoenix::StatusCode | SetControl (controls::StaticBrake &request) |
Applies full neutral-brake by shorting motor leads together. More... | |
ctre::phoenix::StatusCode | SetControl (controls::StaticBrake &&request) |
Applies full neutral-brake by shorting motor leads together. More... | |
ctre::phoenix::StatusCode | SetControl (controls::ControlRequest &request) |
Control motor with generic control request object. More... | |
ctre::phoenix::StatusCode | SetControl (controls::ControlRequest &&request) |
Control motor with generic control request object. More... | |
ctre::phoenix::StatusCode | SetRotorPosition (units::angle::turn_t newValue, units::time::second_t timeoutSeconds) |
The position to set the rotor position to right now. More... | |
ctre::phoenix::StatusCode | SetRotorPosition (units::angle::turn_t newValue) |
The position to set the rotor position to right now. More... | |
ctre::phoenix::StatusCode | ClearStickyFaults (units::time::second_t timeoutSeconds) |
Clear the sticky faults in the device. More... | |
ctre::phoenix::StatusCode | ClearStickyFaults () |
Clear the sticky faults in the device. More... | |
Public Member Functions inherited from ctre::phoenixpro::hardware::ParentDevice | |
ParentDevice (int deviceID, std::string model, std::string canbus) | |
int | GetDeviceID () const |
const std::string & | GetCANBus () const |
std::shared_ptr< const controls::ControlRequest > | GetAppliedControl () const |
Get the latest applied control. More... | |
std::shared_ptr< controls::ControlRequest > | GetAppliedControl () |
Get the latest applied control. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from ctre::phoenixpro::hardware::ParentDevice | |
static constexpr double | kDefaultControlRatePeriodsSec = 0.010 |
Protected Member Functions inherited from ctre::phoenixpro::hardware::ParentDevice | |
virtual void | ReportIfTooOld ()=0 |
virtual ctre::phoenix::StatusCode | SetControlPrivate (controls::ControlRequest &request) |
template<typename T > | |
StatusSignalValue< T > & | LookupStatusSignalValue (uint16_t spn, std::string signalName, bool reportOnConstruction) |
template<typename T > | |
StatusSignalValue< T > & | LookupStatusSignalValue (uint16_t spn, uint16_t mapper_iter, std::function< std::map< int, StatusSignalValue< T > >()> map_filler, std::string signalName, bool reportOnConstruction) |
template<typename T , typename U > | |
StatusSignalValue< T > | LookupDimensionlessStatusSignalValue (uint16_t spn, std::string signalName) |
Returns a unitless version of the StatusSignalValue by value. More... | |
void | ReportIfTooOld (int minMajor, int minMinor, int minBugfix, int minBuild) |
Protected Attributes inherited from ctre::phoenixpro::hardware::ParentDevice | |
DeviceIdentifier | deviceIdentifier |
Class description for the Talon FX integrated motor controller that runs on associated Falcon motors.
ctre::phoenixpro::hardware::core::CoreTalonFX::CoreTalonFX | ( | int | deviceId, |
std::string | canbus = "" |
||
) |
Constructs a new Talon FX motor controller object.
deviceId | ID of the device, as configured in Phoenix Tuner. |
canbus | Name of the CAN bus this device is on. Possible CAN bus strings are:
|
|
delete |
|
inline |
Clear the sticky faults in the device.
This typically has no impact on the device functionality. Instead, it just clears telemetry faults that are accessible via API and Tuner Self-Test.
This will wait up to 0.050 seconds (50ms) by default.
|
inline |
Clear the sticky faults in the device.
This typically has no impact on the device functionality. Instead, it just clears telemetry faults that are accessible via API and Tuner Self-Test.
timeoutSeconds | Maximum time to wait up to in seconds. |
StatusSignalValue< signals::AppliedRotorPolarityValue > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetAppliedRotorPolarity | ( | ) |
The applied rotor polarity.
This typically is determined by the Inverted config, but can be overridden if using Follower features.
Default Rates: CAN: 100.0 Hz
StatusSignalValue< signals::BridgeOuputValue > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetBridgeOuput | ( | ) |
The applied output of the bridge.
Default Rates: CAN: 100.0 Hz
StatusSignalValue< double > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetClosedLoopDerivativeOutput | ( | ) |
Closed loop derivative component.
The portion of the closed loop output that is the proportional to the deriviative the error. Alternatively, the d-Contribution of the closed loop output.
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< double > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetClosedLoopError | ( | ) |
The difference between target reference and current measurement.
This is the value that is treated as the error in the PID loop.
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< double > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetClosedLoopFeedForward | ( | ) |
Feed Forward passed by the user.
This is the general feed forward that the user provides for the closed loop.
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< double > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetClosedLoopIntegratedOutput | ( | ) |
Closed loop integrated component.
The portion of the closed loop output that is proportional to the integrated error. Alternatively, the i-Contribution of the closed loop output.
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< double > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetClosedLoopOutput | ( | ) |
Closed loop total output.
The total output of the closed loop output.
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< double > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetClosedLoopProportionalOutput | ( | ) |
Closed loop proportional component.
The portion of the closed loop output that is the proportional to the error. Alternatively, the p-Contribution of the closed loop output.
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< double > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetClosedLoopReference | ( | ) |
Value that the closed loop is targeting.
This is the value that the closed loop PID controller targets.
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< double > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetClosedLoopReferenceSlope | ( | ) |
Derivative of the target that the closed loop is targeting.
This is the change in the closed loop reference. This may be used in the feed-forward calculation, the derivative-error, or in application of the signage for kS. Typically, this represents the target velocity during Motion Magic®.
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< int > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetClosedLoopSlot | ( | ) |
Closed loop slot in use.
This is the slot that the closed loop PID is using.
Minimum Value: 0 Maximum Value: 2 Default Value: 0 Units:
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
|
inline |
|
inline |
StatusSignalValue< signals::ControlModeValue > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetControlMode | ( | ) |
The active control mode of the motor controller.
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< signals::DeviceEnableValue > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetDeviceEnable | ( | ) |
Indicates if device is actuator enabled.
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< units::temperature::celsius_t > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetDeviceTemp | ( | ) |
Temperature of device.
This is the temperature that the device measures itself to be at. Similar to Processor Temperature.
Minimum Value: 0.0 Maximum Value: 255.0 Default Value: 0 Units: ℃
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< units::dimensionless::scalar_t > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetDutyCycle | ( | ) |
The applied motor duty cycle.
Minimum Value: -2.0 Maximum Value: 1.9990234375 Default Value: 0 Units: fractional
Default Rates: CAN: 100.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_BootDuringEnable | ( | ) |
Device boot while detecting the enable signal.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_DeviceTemp | ( | ) |
Device temperature exceeded limit.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_ForwardHardLimit | ( | ) |
Forward limit switch has been asserted.
Output is set to neutral.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_ForwardSoftLimit | ( | ) |
Forward soft limit has been asserted.
Output is set to neutral.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_FusedSensorOutOfSync | ( | ) |
The remote sensor used for fusion has fallen out of sync to the local sensor.
A re-synchronization has occurred, which may cause a discontinuity. This typically happens if there is significant slop in the mechanism, or if the RotorToSensorRatio configuration parameter is incorrect.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_Hardware | ( | ) |
Hardware fault occurred.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_MissingRemoteSensor | ( | ) |
The remote sensor is not present on CAN Bus.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_OverSupplyV | ( | ) |
Supply Voltage has exceeded the maximum voltage rating of device.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_ProcTemp | ( | ) |
Processor temperature exceeded limit.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_ReverseHardLimit | ( | ) |
Reverse limit switch has been asserted.
Output is set to neutral.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_ReverseSoftLimit | ( | ) |
Reverse soft limit has been asserted.
Output is set to neutral.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_StatorCurrLimit | ( | ) |
Stator current limit occured.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_SupplyCurrLimit | ( | ) |
Supply current limit occured.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_Undervoltage | ( | ) |
Device supply voltage dropped to near brownout levels.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFault_UnstableSupplyV | ( | ) |
Supply Voltage is unstable.
Ensure you are using a battery and current limited power supply.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< int > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetFaultField | ( | ) |
Integer representing all faults.
This returns the fault flags reported by the device. These are device specific and are not used directly in typical applications. Use the signal specific GetFault_*() methods instead.
Minimum Value: 0 Maximum Value: 1048575 Default Value: 0 Units:
Default Rates: CAN: 4.0 Hz
StatusSignalValue< signals::ForwardLimitValue > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetForwardLimit | ( | ) |
Forward Limit Pin.
Default Rates: CAN: 100.0 Hz
StatusSignalValue< signals::MotionMagicIsRunningValue > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetMotionMagicIsRunning | ( | ) |
Check if Motion Magic® is running.
This is equivalent to checking that the reported control mode is a Motion Magic® based mode.
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< units::angle::turn_t > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetPosition | ( | ) |
Position of device.
Minimum Value: -16384.0 Maximum Value: 16383.999755859375 Default Value: 0 Units: rotations
Default Rates: CAN 2.0: 50.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< units::temperature::celsius_t > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetProcessorTemp | ( | ) |
Temperature of the processor.
This is the temperature that the processor measures itself to be at. Similar to Device Temperature.
Minimum Value: 0.0 Maximum Value: 255.0 Default Value: 0 Units: ℃
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< signals::ReverseLimitValue > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetReverseLimit | ( | ) |
Reverse Limit Pin.
Default Rates: CAN: 100.0 Hz
StatusSignalValue< units::angle::turn_t > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetRotorPosition | ( | ) |
Position of motor rotor.
Minimum Value: -16384.0 Maximum Value: 16383.999755859375 Default Value: 0 Units: rotations
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< units::angular_velocity::turns_per_second_t > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetRotorVelocity | ( | ) |
Velocity of motor rotor.
Minimum Value: -512.0 Maximum Value: 511.998046875 Default Value: 0 Units: rotations per second
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
|
inline |
Get the simulation state for this device.
This function reuses an allocated simulation state object, so it is safe to call this function multiple times in a robot loop.
StatusSignalValue< units::current::ampere_t > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStatorCurrent | ( | ) |
Current corresponding to the stator windings.
Similar to TorqueCurrent. Users will likely prefer TorqueCurrent over StatorCurrent.
Stator current where Positive current indicates motoring regardless of direction. Negative current indicates regenerative braking regardless of direction.
Minimum Value: -327.68 Maximum Value: 327.67 Default Value: 0 Units: A
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_BootDuringEnable | ( | ) |
Device boot while detecting the enable signal.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_DeviceTemp | ( | ) |
Device temperature exceeded limit.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_ForwardHardLimit | ( | ) |
Forward limit switch has been asserted.
Output is set to neutral.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_ForwardSoftLimit | ( | ) |
Forward soft limit has been asserted.
Output is set to neutral.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_FusedSensorOutOfSync | ( | ) |
The remote sensor used for fusion has fallen out of sync to the local sensor.
A re-synchronization has occurred, which may cause a discontinuity. This typically happens if there is significant slop in the mechanism, or if the RotorToSensorRatio configuration parameter is incorrect.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_Hardware | ( | ) |
Hardware fault occurred.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_MissingRemoteSensor | ( | ) |
The remote sensor is not present on CAN Bus.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_OverSupplyV | ( | ) |
Supply Voltage has exceeded the maximum voltage rating of device.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_ProcTemp | ( | ) |
Processor temperature exceeded limit.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_ReverseHardLimit | ( | ) |
Reverse limit switch has been asserted.
Output is set to neutral.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_ReverseSoftLimit | ( | ) |
Reverse soft limit has been asserted.
Output is set to neutral.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_StatorCurrLimit | ( | ) |
Stator current limit occured.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_SupplyCurrLimit | ( | ) |
Supply current limit occured.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_Undervoltage | ( | ) |
Device supply voltage dropped to near brownout levels.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< bool > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFault_UnstableSupplyV | ( | ) |
Supply Voltage is unstable.
Ensure you are using a battery and current limited power supply.
Default Value: False
Default Rates: CAN: 4.0 Hz
StatusSignalValue< int > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetStickyFaultField | ( | ) |
Integer representing all sticky faults.
This returns the persistent "sticky" fault flags reported by the device. These are device specific and are not used directly in typical applications. Use the signal specific GetStickyFault_*() methods instead.
Minimum Value: 0 Maximum Value: 1048575 Default Value: 0 Units:
Default Rates: CAN: 4.0 Hz
StatusSignalValue< units::current::ampere_t > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetSupplyCurrent | ( | ) |
Measured supply side current.
Minimum Value: -327.68 Maximum Value: 327.67 Default Value: 0 Units: A
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< units::voltage::volt_t > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetSupplyVoltage | ( | ) |
Measured supply voltage to the TalonFX.
Minimum Value: 4.0 Maximum Value: 16.75 Default Value: 4 Units: V
Default Rates: CAN 2.0: 5.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< units::current::ampere_t > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetTorqueCurrent | ( | ) |
Current corresponding to the torque output by the motor.
Similar to StatorCurrent. Users will likely prefer this current to calculate the applied torque to the rotor.
Stator current where positive current means torque is applied in the forward direction as determined by the Inverted setting
Minimum Value: -327.68 Maximum Value: 327.67 Default Value: 0 Units: A
Default Rates: CAN: 100.0 Hz
StatusSignalValue< units::angular_velocity::turns_per_second_t > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetVelocity | ( | ) |
Velocity of device.
Minimum Value: -512.0 Maximum Value: 511.998046875 Default Value: 0 Units: rotations per second
Default Rates: CAN 2.0: 50.0 Hz CAN FD: 100.0 Hz
StatusSignalValue< int > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetVersion | ( | ) |
Full Version.
The format is a four byte value.
Full Version of firmware in device. The format is a four byte value.
Minimum Value: 0 Maximum Value: 4294967295 Default Value: 0 Units:
Default Rates: CAN: 4.0 Hz
StatusSignalValue< int > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetVersionBugfix | ( | ) |
App Bugfix Version number.
Minimum Value: 0 Maximum Value: 255 Default Value: 0 Units:
Default Rates: CAN: 4.0 Hz
StatusSignalValue< int > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetVersionBuild | ( | ) |
App Build Version number.
Minimum Value: 0 Maximum Value: 255 Default Value: 0 Units:
Default Rates: CAN: 4.0 Hz
StatusSignalValue< int > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetVersionMajor | ( | ) |
App Major Version number.
Minimum Value: 0 Maximum Value: 255 Default Value: 0 Units:
Default Rates: CAN: 4.0 Hz
StatusSignalValue< int > & ctre::phoenixpro::hardware::core::CoreTalonFX::GetVersionMinor | ( | ) |
App Minor Version number.
Minimum Value: 0 Maximum Value: 255 Default Value: 0 Units:
Default Rates: CAN: 4.0 Hz
bool ctre::phoenixpro::hardware::core::CoreTalonFX::HasResetOccurred | ( | ) |
|
delete |
|
inline |
Request coast neutral output of actuator.
The bridge is disabled and the rotor is allowed to coast.
CoastOut Parameters:
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::CoastOut & | request | ) |
Request coast neutral output of actuator.
The bridge is disabled and the rotor is allowed to coast.
CoastOut Parameters:
request | Control object to request of the device |
|
inline |
Control motor 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 corresponding StatusCode
request | Control object to request of the device |
|
inline |
Control motor 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 |
|
inline |
Request a specified motor duty cycle.
This control mode will output a proportion of the supplied voltage which is supplied by the user.
DutyCycleOut Parameters: Output: Proportion of supply voltage to apply in fractional units between -1 and +1 EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::DutyCycleOut & | request | ) |
Request a specified motor duty cycle.
This control mode will output a proportion of the supplied voltage which is supplied by the user.
DutyCycleOut Parameters: Output: Proportion of supply voltage to apply in fractional units between -1 and +1 EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
|
inline |
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 percent supply output control, the duty cycle is matched. Motor direction either matches master's configured direction or opposes it based on OpposeMasterDirection.
Follower Parameters: MasterID: Device ID of the master to follow. OpposeMasterDirection: Set to false for motor invert to match the master's configured Invert - which is typical when master and follower are mechanically linked and spin in the same direction. Set to true for motor invert to oppose the master's configured Invert - this is typical where the the master and follower mechanically spin in opposite directions.
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::Follower & | request | ) |
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 percent supply output control, the duty cycle is matched. Motor direction either matches master's configured direction or opposes it based on OpposeMasterDirection.
Follower Parameters: MasterID: Device ID of the master to follow. OpposeMasterDirection: Set to false for motor invert to match the master's configured Invert - which is typical when master and follower are mechanically linked and spin in the same direction. Set to true for motor invert to oppose the master's configured Invert - this is typical where the the master and follower mechanically spin in opposite directions.
request | Control object to request of the device |
|
inline |
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 Jerk value specified via the Motion Magic® configuration values. Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is duty cycled based, so relevant closed-loop gains will use fractional duty cycle for the numerator: +1.0 represents full forward output.
MotionMagicDutyCycle Parameters: Position: Position to drive toward in rotations. EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. FeedForward: Feedforward to apply in fractional units between -1 and +1. Slot: 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]. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::MotionMagicDutyCycle & | request | ) |
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 Jerk value specified via the Motion Magic® configuration values. Target position can be changed on-the-fly and Motion Magic® will do its best to adjust the profile. This control mode is duty cycled based, so relevant closed-loop gains will use fractional duty cycle for the numerator: +1.0 represents full forward output.
MotionMagicDutyCycle Parameters: Position: Position to drive toward in rotations. EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. FeedForward: Feedforward to apply in fractional units between -1 and +1. Slot: 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]. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
|
inline |
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 Jerk value specified via the Motion Magic® configuration values. 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.
MotionMagicTorqueCurrentFOC Parameters: Position: Position to drive toward in rotations. FeedForward: Feedforward to apply in torque current in Amperes. User can use motor's kT to scale Newton-meter to Amperes. Slot: 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]. OverrideCoastDurNeutral: 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).
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::MotionMagicTorqueCurrentFOC & | request | ) |
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 Jerk value specified via the Motion Magic® configuration values. 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.
MotionMagicTorqueCurrentFOC Parameters: Position: Position to drive toward in rotations. FeedForward: Feedforward to apply in torque current in Amperes. User can use motor's kT to scale Newton-meter to Amperes. Slot: 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]. OverrideCoastDurNeutral: 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).
request | Control object to request of the device |
|
inline |
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 Jerk value specified via the Motion Magic® configuration values. 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.
MotionMagicVoltage Parameters: Position: Position to drive toward in rotations. EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. FeedForward: Feedforward to apply in volts Slot: 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]. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::MotionMagicVoltage & | request | ) |
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 Jerk value specified via the Motion Magic® configuration values. 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.
MotionMagicVoltage Parameters: Position: Position to drive toward in rotations. EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. FeedForward: Feedforward to apply in volts Slot: 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]. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
|
inline |
Request neutral output of actuator.
The applied brake type is determined by the NeutralMode configuration.
NeutralOut Parameters:
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::NeutralOut & | request | ) |
Request neutral output of actuator.
The applied brake type is determined by the NeutralMode configuration.
NeutralOut Parameters:
request | Control object to request of the device |
|
inline |
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.
PositionDutyCycle Parameters: Position: Position to drive toward in rotations. EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. FeedForward: Feedforward to apply in fractional units between -1 and +1. Slot: 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]. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::PositionDutyCycle & | request | ) |
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.
PositionDutyCycle Parameters: Position: Position to drive toward in rotations. EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. FeedForward: Feedforward to apply in fractional units between -1 and +1. Slot: 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]. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
|
inline |
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.
PositionTorqueCurrentFOC Parameters: Position: Position to drive toward in rotations. FeedForward: Feedforward to apply in torque current in Amperes. User can use motor's kT to scale Newton-meter to Amperes. Slot: 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]. OverrideCoastDurNeutral: 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).
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::PositionTorqueCurrentFOC & | request | ) |
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.
PositionTorqueCurrentFOC Parameters: Position: Position to drive toward in rotations. FeedForward: Feedforward to apply in torque current in Amperes. User can use motor's kT to scale Newton-meter to Amperes. Slot: 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]. OverrideCoastDurNeutral: 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).
request | Control object to request of the device |
|
inline |
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.
PositionVoltage Parameters: Position: Position to drive toward in rotations. EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. FeedForward: Feedforward to apply in volts Slot: 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]. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::PositionVoltage & | request | ) |
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.
PositionVoltage Parameters: Position: Position to drive toward in rotations. EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. FeedForward: Feedforward to apply in volts Slot: 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]. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
|
inline |
Applies full neutral-brake by shorting motor leads together.
StaticBrake Parameters:
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::StaticBrake & | request | ) |
Applies full neutral-brake by shorting motor leads together.
StaticBrake Parameters:
request | Control object to request of the device |
|
inline |
Follow the motor output of another Talon while ignoring the master's invert setting.
If Talon is in torque control, the torque is copied - which will increase the total torque applied. If Talon is in percent supply output control, the duty cycle is matched. Motor direction is strictly determined by the configured invert and not the master. If you want motor direction to match or oppose the master, use FollowerRequest instead.
StrictFollower Parameters: MasterID: Device ID of the master to follow.
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::StrictFollower & | request | ) |
Follow the motor output of another Talon while ignoring the master's invert setting.
If Talon is in torque control, the torque is copied - which will increase the total torque applied. If Talon is in percent supply output control, the duty cycle is matched. Motor direction is strictly determined by the configured invert and not the master. If you want motor direction to match or oppose the master, use FollowerRequest instead.
StrictFollower Parameters: MasterID: Device ID of the master to follow.
request | Control object to request of the device |
|
inline |
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.
TorqueCurrentFOC Parameters: Output: Amount of motor current in Amperes MaxAbsDutyCycle: 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: 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. OverrideCoastDurNeutral: 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).
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::TorqueCurrentFOC & | request | ) |
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.
TorqueCurrentFOC Parameters: Output: Amount of motor current in Amperes MaxAbsDutyCycle: 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: 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. OverrideCoastDurNeutral: 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).
request | Control object to request of the device |
|
inline |
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.
VelocityDutyCycle Parameters: Velocity: Velocity to drive toward in rotations per second. EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. FeedForward: Feedforward to apply in fractional units between -1 and +1. Slot: 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]. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::VelocityDutyCycle & | request | ) |
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.
VelocityDutyCycle Parameters: Velocity: Velocity to drive toward in rotations per second. EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. FeedForward: Feedforward to apply in fractional units between -1 and +1. Slot: 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]. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
|
inline |
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.
VelocityTorqueCurrentFOC Parameters: Velocity: Velocity to drive toward in rotations per second. FeedForward: Feedforward to apply in torque current in Amperes. User can use motor's kT to scale Newton-meter to Amperes. Slot: 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]. OverrideCoastDurNeutral: 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).
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::VelocityTorqueCurrentFOC & | request | ) |
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.
VelocityTorqueCurrentFOC Parameters: Velocity: Velocity to drive toward in rotations per second. FeedForward: Feedforward to apply in torque current in Amperes. User can use motor's kT to scale Newton-meter to Amperes. Slot: 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]. OverrideCoastDurNeutral: 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).
request | Control object to request of the device |
|
inline |
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.
VelocityVoltage Parameters: Velocity: Velocity to drive toward in rotations per second. EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. FeedForward: Feedforward to apply in volts Slot: 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]. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::VelocityVoltage & | request | ) |
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.
VelocityVoltage Parameters: Velocity: Velocity to drive toward in rotations per second. EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. FeedForward: Feedforward to apply in volts Slot: 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]. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
|
inline |
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.
VoltageOut Parameters: Output: Voltage to attempt to drive at EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
ctre::phoenix::StatusCode ctre::phoenixpro::hardware::core::CoreTalonFX::SetControl | ( | controls::VoltageOut & | request | ) |
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.
VoltageOut Parameters: Output: Voltage to attempt to drive at EnableFOC: Set to true to use FOC commutation, which increases peak power by ~15%. 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. OverrideBrakeDurNeutral: 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.
request | Control object to request of the device |
|
inline |
The position to set the rotor position to right now.
This will wait up to 0.050 seconds (50ms) by default.
newValue | Value to set to. |
|
inline |
The position to set the rotor position to right now.
newValue | Value to set to. |
timeoutSeconds | Maximum time to wait up to in seconds. |