Package yams.core.motorcontrollers.remote
This package contains adapters for CTRE TalonFX-family motor controllers. Because the Phoenix 6 firmware executes PID loops directly on the motor controller hardware, these wrappers are classified as remote: setpoints are sent over CAN and the device closes the loop autonomously at a high update rate without consuming roboRIO CPU cycles.
Core types
yams.core.motorcontrollers.remote.TalonFXWrapperadapter for the CTRE TalonFX motor controller, used in the Kraken X60 and Falcon 500 brushless motors. Supports all Phoenix 6 control modes (position, velocity, motion magic, torque current) through theSmartMotorControllerinterface.yams.core.motorcontrollers.remote.TalonFXSWrapperadapter for the CTRE TalonFXS motor controller, used with the Minion brushless motor. Functionally equivalent toTalonFXWrapperbut targets the TalonFXS CAN device type.
Phoenix 6 API
Both wrappers are built on the Phoenix 6
API. Configuration is applied via YAMS' own
SmartMotorControllerConfig fluent builder, which translates
YAMS settings into the appropriate TalonFXConfiguration or
TalonFXSConfiguration objects before pushing them to the device.
CANcoder discontinuity
When a CANcoder is fused as the remote sensor, specifying a discontinuity point via
SmartMotorControllerConfig.withExternalEncoderDiscontinuityPoint(Angle) is
optional. If omitted, the CTRE default sensor range ([0, 1)) is used.
Unlike the REV absolute encoder, the Phoenix 6 firmware handles the wrap transparently in most
configurations.
Construction
// TalonFX (Kraken X60) on CAN ID 2
SmartMotorControllerConfig config = new SmartMotorControllerConfig()
.withClosedLoopController(10.0,0,0.1).withStatorCurrentLimit(Amps.of(80));
SmartMotorController motor = new TalonFXWrapper(
new TalonFX(2), DCMotor.getKrakenX60(1), config);
// TalonFXS (Minion) on CAN ID 7
SmartMotorController miniMotor = new TalonFXSWrapper(
new TalonFXS(7), DCMotor.getMinion(1), config);
- See Also:
-
ClassesClassDescriptionTalonFXS wrapper for CTRE TalonFXS motor controllers.TalonFX wrapper for a CTRE TalonFX motor controller.