The CTRE ecosystem
CTR Electronics (CTRE) makes some of the most common FRC motors and controllers. The Talon FX is the integrated motor-controller portion that drives the Kraken X60, the Kraken X44, and the (now effectively discontinued) Falcon 500 — these are integrated motors where the controller is built into the motor. They run on the CAN bus and use the Phoenix 6 software library plus the Phoenix Tuner X desktop app for configuration and diagnostics.
Install Phoenix 6 via VS Code's "Manage Vendor Libraries" using CTRE's vendordep URL.
Creating and configuring a Talon FX
Phoenix 6 uses a declarative configuration model: build a configuration object and apply it.
TalonFX motor = new TalonFX(1); // CAN ID 1
TalonFXConfiguration config = new TalonFXConfiguration();
config.MotorOutput.NeutralMode = NeutralModeValue.Brake;
// Stator limit protects the mechanism; supply limit protects the breaker/battery
config.CurrentLimits.StatorCurrentLimit = 80;
config.CurrentLimits.StatorCurrentLimitEnable = true;
config.CurrentLimits.SupplyCurrentLimit = 40;
config.CurrentLimits.SupplyCurrentLimitEnable = true;
motor.getConfigurator().apply(config);
Key idea: you get the device's configurator with getConfigurator() and call apply(...).
Control requests
To command the motor you create a control request object and pass it to setControl(...):
// Simple open-loop: percent output via duty cycle
final DutyCycleOut openLoop = new DutyCycleOut(0);
motor.setControl(openLoop.withOutput(0.5)); // 50% output
This request-based design replaces the older "set mode then set value" style and makes advanced features (current limits, motion overrides) explicit.
Built-in closed-loop control
A major advantage of the Talon FX is that PID and feedforward can run on the motor controller itself (faster than the roboRIO's 50 Hz loop). You configure gains in a Slot0Configs and use control requests like VelocityVoltage or PositionVoltage. Note that Phoenix 6 works in rotations and rotations per second by default:
Slot0Configs slot0 = new Slot0Configs();
slot0.kP = 4.8; // proportional
slot0.kI = 0;
slot0.kD = 0.1;
slot0.kS = 0.25; // static friction feedforward (volts)
slot0.kV = 0.12; // velocity feedforward (volts per rps)
motor.getConfigurator().apply(slot0);
// Spin to 50 rotations/second using on-board velocity control
final VelocityVoltage velReq = new VelocityVoltage(0);
motor.setControl(velReq.withVelocity(50));
For smooth point-to-point moves, CTRE provides Motion Magic (its on-board motion profiling), commanded with MotionMagicVoltage.
Sensors and a gotcha
The Talon FX has a built-in encoder you read with motor.getPosition() and motor.getVelocity() (these return Phoenix 6 StatusSignal objects; call .getValueAsDouble() for the number). Note: the Talon FX does not have screw terminals for hardware limit switches — instead you use limit configs/overrides on the control request, or wire a CANcoder (CTRE's CAN magnetic encoder) as a remote sensor.
Phoenix Tuner X
Use Phoenix Tuner X to assign CAN IDs, update firmware, run self-tests, plot signals, and field-calibrate. Assigning unique CAN IDs to every device is essential — duplicate IDs cause silent, confusing failures.
Key takeaways
- The Talon FX controller drives the Kraken X60, Kraken X44, and legacy Falcon 500 over the CAN bus.
- Phoenix 6 is declarative: build a TalonFXConfiguration and getConfigurator().apply(it).
- Command motors with control requests via setControl() (e.g., DutyCycleOut, VelocityVoltage); units are rotations and rotations/second.
- PID + feedforward can run on the controller via Slot0Configs; Motion Magic adds on-board profiling.
- Talon FX lacks screw-terminal limit switches — use limit configs/overrides or a CANcoder; manage CAN IDs in Phoenix Tuner X.
Lesson quiz
RequiredAnswer all 4 questions correctly to complete this lesson.
01.In the CTRE Phoenix 6 ecosystem, what role does the Talon FX play with the Kraken X60, Kraken X44, and Falcon 500?
02.Under Phoenix 6's declarative model, how do you set up a Talon FX before running it?
03.The Talon FX has no screw terminals for hardware limit switches. What should you do instead to implement limit switch functionality?
04.By default, what units does the Phoenix 6 API use for Talon FX position and velocity?
Answer every question to submit.
All 51 lessons in Programming, Controls & Sensors
- Not started:Mini-Project: A Closed-Loop Elevator with Motion Magic
- Not started:Mini-Project: A Velocity-Controlled Shooter on REVLib
- Not started:Mini-Project: A Teleop Swerve Drive Subsystem
- Not started:Mini-Project: An Autonomous Routine with PathPlanner
- Not started:Mini-Project: Vision-Aligned Scoring with Limelight
- Not started:State-Space Control and Kalman Filtering
- Not started:Log Replay Architecture with AdvantageKit
- Not started:Advanced Pose Estimation: Multi-Tag Fusion and Standard Deviations
- Not started:Robot Coordination, Alerts, and Operator Feedback
- Not started:Case Study: Hardening Software Before an Event