CAN Bus - Troubleshooting Guide
CAN bus problems can make your robot behave strangely or not work at all. This guide helps you find and fix CAN issues fast.
What is CAN Bus?
Section titled “What is CAN Bus?”CAN Bus = Controller Area Network bus
It’s like a conversation where robot parts take turns talking on a shared wire. Instead of each device having its own wires, they all share one communication line.
Think of it like: A classroom where students raise their hands to speak. Only one person talks at a time, so everyone can understand.
Quick Check (2 minutes)
Section titled “Quick Check (2 minutes)”1 Check CAN Status
Section titled “1 Check CAN Status”In Phoenix Tuner (for CTRE devices):
- Open Phoenix Tuner.
- Look at the top bar.
- Check “CAN Bus Utilization” .
- Check “CAN Bus Status”.
What you want to see:
- ✅ Utilization: Under 80% (ideally under 60%)
- ✅ Status: “OK” or “Connected”.
- ✅ Devices: All your devices listed.
What indicates problems:
- ❌ Utilization: Over 80% (bus is congested)
- ❌ Status: “BUS OFF” or “Disconnected”.
- ❌ Devices: Missing devices or red X’s.
In OutlineViewer/SmartDashboard:
- Look for “/CAN” folder.
- Check device health.
- Look for error messages.
2 Check Device Connection
Section titled “2 Check Device Connection”Look at your devices:
- Count how many motor controllers/sensors you have.
- Compare to Phoenix Tuner list.
- Are any missing?
- Are any showing errors?
Quick device count:
- Swerve drive: 8-12 devices (4 Talon FX + 4 CANcoder + maybe more)
- Basic drivetrain: 4-6 devices.
- Shooter/intake: 2-4 devices.
3 Check for Error Messages
Section titled “3 Check for Error Messages”Look in RioLog for these errors:
- "CAN Receive Timeout"- "CAN Transmit Error"- "Device not responding"- "Invalid Device ID"- "CAN Bus Off"If you see these: You have CAN bus problems. Continue with this guide.
Common Problems and Solutions
Section titled “Common Problems and Solutions”Problem 1: Device Not Detected
Section titled “Problem 1: Device Not Detected”Symptoms:
- Device doesn’t appear in Phoenix Tuner.
- Device shows red X or error.
- Code can’t communicate with device.
Causes:
1. Wrong Device ID
Fix: Check device IDs match codeIn Phoenix Tuner:
- Select device.
- Look at “Device ID” .
- Compare to your code.
In your code:
// Make sure IDs match!private final TalonFX frontLeft = new TalonFX(1); // Device ID 1private final TalonFX frontRight = new TalonFX(2); // Device ID 22. Device Not Powered
Fix: Check power connections- Verify main power connection (12V)
- Check breaker hasn’t tripped.
- Measure voltage at device with multimeter.
- Look for LED indicators on device.
3. CAN Cable Loose/Disconnected
Fix: Check and reconnect cables- Follow CAN chain from robot to each device.
- Push cables in firmly.
- Check for damaged cables.
- Replace any suspect cables.
4. Wrong CAN Bus
Fix: Verify CAN bus connectionRoboRIO CAN ports:
CAN 0: Primary CAN bus.CAN 1: Secondary CAN bus (if using CANivore)
Make sure devices are on correct bus!
Problem 2: CAN Bus Utilization Too High
Section titled “Problem 2: CAN Bus Utilization Too High”Symptoms:
- Phoenix Tuner shows >80% utilization.
- Robot behaves randomly.
- Some devices work, others don’t.
- Performance issues.
Causes:
1. Update Rates Too High
Fix: Reduce update rates for non-critical signalsWhat to update fast (100Hz):
- Drivetrain motor positions/velocities.
- Gyro data
- Critical sensor feedback.
What to update slowly (10Hz or less):
- Motor temperatures.
- Supply current/voltage.
- Fault/status signals.
- Non-critical telemetry.
How to fix:
// Fast updates for drivetrain (100Hz)driveMotor.getPosition().setUpdateFrequency(100);driveMotor.getVelocity().setUpdateFrequency(100);
// Slow updates for temperature (4Hz)driveMotor.getDeviceTemp().setUpdateFrequency(4);driveMotor.getSupplyCurrent().setUpdateFrequency(4);2. Too Many Devices on One Bus
Fix: Use CANivore or reduce devicesSigns you have too many devices:
- More than 12 devices on one bus.
- Utilization consistently >70%.
- Random communication failures.
Solutions:
- Add CANivore device (splits into multiple CAN buses)
- Reduce update rates (see above)
- Remove unnecessary devices.
3. CANivore Not Working
Fix: Verify CANivore setupIn code:
// When using CANivore, specify bus nameprivate final TalonFX motor = new TalonFX(1, "CANivore"); // Specify bus!Check:
- CANivore powered (yellow LED)
- CANivore connected to RoboRIO.
- Devices daisy-chained to CANivore.
Problem 3: Intermittent CAN Errors
Section titled “Problem 3: Intermittent CAN Errors”Symptoms:
- Robot works sometimes, not others.
- Random “CAN Timeout” errors.
- Devices drop in and out.
- Performance varies.
Causes:
1. Poor Cable Quality
Fix: Replace bad cablesSigns of bad cables:
- Crimps not secure.
- Wires pulling out of connectors.
- Visible damage to insulation.
- Cables too long (>6 feet)
Use quality cables:
- Crimped properly (not soldered)
- Right length for each connection.
- Strain relief where needed.
- Shielded cables for long runs.
2. Chain Topology Wrong
Fix: Arrange CAN bus in proper daisy chainCorrect topology:
RoboRIO → Device 1 → Device 2 → Device 3 → ... → 120Ω terminatorWrong topologies:
❌ Star topology (all devices to one point)❌ Multiple terminators❌ Loops (don't connect ends together)❌ Missing terminator3. Loose Connections
Fix: Secure all connections- Check all CAN connectors.
- Add zip ties to prevent vibration loosening.
- Use strain relief on moving parts.
- Check for corrosion on contacts.
4. Electrical Interference
Fix: Route CAN away from power wires- Don’t run CAN next to motor power wires.
- Cross power wires at 90° if you must cross.
- Use shielded CAN cables.
- Keep CAN away from radio power leads.
Problem 4: CAN Bus Off Error
Section titled “Problem 4: CAN Bus Off Error”Symptoms:
- Phoenix Tuner says “BUS OFF”.
- All CAN devices stop working.
- Robot becomes unresponsive.
Causes:
1. Short Circuit on CAN Bus
Fix: Find and fix shortHow to find:
- Disconnect all devices.
- Add devices back one at a time.
- When problem returns, you found the bad device.
- Check that device’s CAN wiring.
2. Missing Termination Resistor
Fix: Add 120Ω terminator at end of chainEvery CAN bus needs exactly one 120Ω terminator at the end
Check:
- RoboRIO has built-in terminator (usually)
- CANivore has built-in terminator.
- Some devices have built-in terminators.
Verify:
RoboRIO --- Device1 --- Device2 --- 120Ω Terminator3. Too Many Devices
Fix: Reduce device count or add CANivore- More than ~15 devices on one bus.
- Add CANivore for more devices.
Problem 5: Motor Controller Not Responding
Section titled “Problem 5: Motor Controller Not Responding”Symptoms:
- Specific motor controller shows errors.
- Other devices work fine.
- Motor won’t move.
Diagnosis:
Step 1: Check Device ID
// Make sure ID matches what you set in Phoenix Tunerprivate final TalonFX motor = new TalonFX(deviceId);Step 2: Check for Firmware Updates
- Open Phoenix Tuner.
- Check if firmware update available.
- Update firmware (takes ~30 seconds per device)
Step 3: Check Configuration
// Verify configuration actually appliedStatusCode status = motor.getConfigurator().apply(config);if (!status.isOK()) { System.out.println("Config failed: " + status);}Step 4: Check Device Health
// Check if device is healthyStatusCode status = motor.getFaults();if (status != StatusCode.OK) { System.out.println("Device fault: " + status);}Testing CAN Bus
Section titled “Testing CAN Bus”Step 1: Visual Inspection
Section titled “Step 1: Visual Inspection”- Follow CAN chain from start to finish.
- Check all connections.
- Look for damaged cables.
- Verify terminator present.
- Note any issues.
Step 2: Phoenix Tuner Test
Section titled “Step 2: Phoenix Tuner Test”- Open Phoenix Tuner.
- Check device list.
- Verify all devices present.
- Check for error indicators.
- Test each device individually.
Step 3. Utilization Test
Section titled “Step 3. Utilization Test”- Enable all devices.
- Watch CAN utilization.
- Run robot at full speed.
- Check utilization stays under 80%.
- Note any spikes.
Step 4. Stress Test
Section titled “Step 4. Stress Test”- Run all systems at once.
- Check for errors.
- Monitor utilization.
- Verify all devices respond.
- Test for 5+ minutes.
Quick Fixes to Try
Section titled “Quick Fixes to Try”Fix 1: Reset CAN Bus
Section titled “Fix 1: Reset CAN Bus”- Disable robot.
- Power cycle RoboRIO.
- Check all cables.
- Re-enable robot.
Fix 2: Reduce Update Rates
Section titled “Fix 2: Reduce Update Rates”// Set all non-critical signals to 4Hzmotor.getSupplyCurrent().setUpdateFrequency(4);motor.getDeviceTemp().setUpdateFrequency(4);motor.getFault().setUpdateFrequency(4);Fix 3. Reconfigure Devices
Section titled “Fix 3. Reconfigure Devices”- Open Phoenix Tuner.
- Clear all configs.
- Reapply configurations.
- Verify settings saved.
Fix 4. Check CANivore
Section titled “Fix 4. Check CANivore”// Make sure you specify CANivore if using itprivate final TalonFX motor = new TalonFX(1, "CANivore");Prevention Tips
Section titled “Prevention Tips”During Build:
Section titled “During Build:”- ✅ Use quality CAN cables.
- ✅ Label each cable with device ID.
- ✅ Test each device as you install it.
- ✅ Secure cables with zip ties.
- ✅ Keep CAN away from power wires.
Before Competition:
Section titled “Before Competition:”- ✅ Test CAN utilization with all systems.
- ✅ Verify all devices connected.
- ✅ Check firmware up to date.
- ✅ Test stress conditions.
- ✅ Document CAN bus layout.
At Competition:
Section titled “At Competition:”- ✅ Have spare CAN cables.
- ✅ Bring Phoenix Tuner on laptop.
- ✅ Know CAN bus topology.
- ✅ Monitor utilization during matches.
- ✅ Quick fix plan ready.
CAN Bus Best Practices
Section titled “CAN Bus Best Practices”Update Rate Guidelines
Section titled “Update Rate Guidelines”100Hz (fast):
- Drivetrain motor positions.
- Drivetrain motor velocities.
- Gyro IMU data
- Critical sensor feedback.
50Hz (normal):
- Mechanism motor positions.
- Mechanism motor velocities.
- Important sensor data.
10Hz (slow):
- Motor temperatures.
- Battery voltage/current.
- Non-critical telemetry.
4Hz (very slow):
- Status signals.
- Fault indicators.
- Diagnostic data.
Physical Setup Tips
Section titled “Physical Setup Tips”Good Practices:
- Keep CAN cables as short as possible.
- Use right-angle connectors in tight spaces.
- Add strain relief to prevent pull-out.
- Label both ends of each cable.
- Test continuity before installing.
Bad Practices to Avoid:
- Don’t splice CAN cables.
- Don’t make cables longer than 6 feet.
- Don’t run CAN next to motor power.
- Don’t leave slack cables loose.
- Don’t use different colored cables (confusing)
Monitoring CAN Health
Section titled “Monitoring CAN Health”During Competition
Section titled “During Competition”// Add to your robot periodic()public void robotPeriodic() { // Check CAN bus health double utilization = PDP.getCANBusUtilization(); SmartDashboard.putNumber("CAN Utilization", utilization);
if (utilization > 0.8) { DriverStation.reportWarning("CAN utilization high: " + utilization, false); }}Logging CAN Errors
Section titled “Logging CAN Errors”// Log CAN errors for analysis@Overridepublic void periodic() { StatusCode status = motor.getFault_DeviceID(); if (status != StatusCode.OK) { System.out.println("Motor fault: " + status); // Log to file or send telemetry }}Common CAN Device Counts
Section titled “Common CAN Device Counts”Typical robot configurations:
Basic Kitbot:
- 4x Spark MAX/Talon SRX (drivetrain)
- Total: 4 devices (easy, one bus fine)
Competitive Drivetrain:
- 4x Talon FX (drive motors)
- 4x CANcoder (wheel encoders)
- 1x Pigeon2 (gyro)
- Total: 9 devices (still okay, one bus)
Full Competition Robot:
- 4x Talon FX (drivetrain)
- 4x CANcoder (drivetrain)
- 1x Pigeon2 (gyro)
- 2x Talon FX (shooter)
- 2x Talon FX (intake)
- 1x CANcoder (intake sensor)
- Total: 14 devices (use CANivore)
When to Get Help
Section titled “When to Get Help”If you’ve tried everything and CAN still doesn’t work:
Good Help Request:
Section titled “Good Help Request:”"Having CAN bus communication issues.
Robot setup:- 4x Talon FX for drivetrain (IDs 1-4)- 4x CANcoder for wheel sensors (IDs 5-8)- 1x Pigeon2 gyro (ID 9)- Connected to RoboRIO CAN 0- 120Ω terminator at end
Symptoms:- CAN utilization spikes to 95% when driving- Random "CAN Receive Timeout" errors- Devices 5-8 sometimes don't appear in Phoenix Tuner- Drivetrain motors work, encoders don't always
What I've tried:- Reduced all non-critical update rates to 4Hz- Checked all CAN connections (all secure)- Verified device IDs match code- Updated firmware on all devices- Tested with only drivetrain (works fine)- Tested with encoders only (fails with drivetrain)
Phoenix Tuner shows:- Utilization: 95% when driving, 20% when idle- All devices show green when they appear- Random device dropouts during motion
What should I check next?"Related Guides
Section titled “Related Guides”Remember: CAN bus is the nervous system of your robot. Keep it healthy and your robot will work reliably!
Still having CAN issues? Ask the community - describe your setup and symptoms!