Modern brushless motors and CAN devices include encoders, so often you do not wire a separate sensor at all.
Integrated motor encoders
- REV NEO / NEO Vortex brushless motors have a built-in hall-effect encoder read by the Spark MAX / Spark Flex controller. You access it via the controller's
RelativeEncoder(SparkMax.getEncoder()), in motor rotations by default; set a conversion factor for real units. - CTRE Falcon 500 / Kraken X60 integrate the encoder into the Talon FX. Phoenix 6 exposes it as the motor's internal rotor sensor with
getPosition()andgetVelocity()status signals.
Integrated encoders are convenient and high-resolution, but they measure the motor shaft, so you must account for the gear ratio to get mechanism units, and they are relative unless fused with an absolute sensor.
The CTRE CANcoder
The CANcoder is a magnetic rotary encoder that reports absolute position and velocity over the CAN bus (CAN FD and CAN 2.0). Because it is absolute and on the bus, it is a standard azimuth sensor for swerve modules. You read it in Phoenix 6 with getAbsolutePosition() and configure a magnet offset and sensor direction in Phoenix Tuner X.
Sensor fusion in firmware: FusedCANcoder
Phoenix 6 offers FusedCANcoder, a Talon FX feedback mode that fuses a CANcoder's absolute reading with the motor's internal rotor signal. You get the absolute knowledge of the CANcoder plus the high bandwidth and resolution of the rotor — ideal for swerve steering, where you want a correct boot angle and crisp control. This fusion happens on the device, not in robot code, so it is fast and consistent.
Important licensing caveat: FusedCANcoder (and the related SyncCANcoder) require a Phoenix 6 Pro license on the Talon FX. Without a Pro license the controller falls back to RemoteCANcoder (reading the CANcoder over the bus, without rotor fusion) and reports a UsingFusedCANcoderWhileUnlicensed fault. RemoteCANcoder still works for absolute feedback; you just lose the on-device fusion bandwidth benefit.
Choosing an encoder
- Drivetrain wheels: integrated motor encoder (relative is fine; you zero odometry at start).
- Swerve azimuth: CANcoder (FusedCANcoder if Pro-licensed, otherwise RemoteCANcoder) or a Through Bore for absolute boot angle.
- Arms/wrists: an absolute encoder for boot position, optionally fused with the motor encoder.
Always verify your unit conversions on the bench: command a known move and confirm the reported distance/angle matches reality before trusting it in autonomous.
Key takeaways
- NEO/Vortex (Spark MAX/Flex) and Falcon/Kraken (Talon FX) include relative encoders on the motor shaft — account for gear ratio.
- The CTRE CANcoder is an absolute, CAN-based encoder, ideal for swerve azimuth.
- Phoenix 6 FusedCANcoder fuses absolute CANcoder data with the rotor on-device but requires a Pro license; unlicensed it falls back to RemoteCANcoder.
Go deeper
Lesson quiz
RequiredAnswer all 3 questions correctly to complete this lesson.
01.Why must you account for the gear ratio when using an integrated motor encoder like the NEO's or the Falcon/Kraken's?
02.In Phoenix 6, what units does a Falcon 500 or Kraken X60 (Talon FX) report its integrated encoder position in by default?
03.The CTRE CANcoder is commonly used as the absolute steering sensor on swerve modules. Which description of the CANcoder is correct?
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