Package yams.core.motorcontrollers.remote


package yams.core.motorcontrollers.remote
CTRE motor controller wrappers whose closed-loop control runs on the motor controller itself.

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.TalonFXWrapper adapter 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 the SmartMotorController interface.
  • yams.core.motorcontrollers.remote.TalonFXSWrapper adapter for the CTRE TalonFXS motor controller, used with the Minion brushless motor. Functionally equivalent to TalonFXWrapper but 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 range

With SmartMotorControllerConfig.withContinuousWrapping(Angle, Angle), a CANcoder or CANdi PWM encoder on the mechanism reads the wrapping range, from [-1, 0) to [0, 1) rotations. Without it, the encoder keeps its own range.

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: