CAN Timeouts and CAN Bus Failure


#1

Problem:

Our team has had issues the last few days with CAN timeout errors. This began when our software team couldn’t instantiate the TalonSRX object without the robot code crashing. Soon we found that we couldn’t find the CAN hardware through the NI web interface. The CAN bus is connected to two TalonSRXs, the PDP, PCM, VRM and RoboIO.

Debugging:

We tried a number of fixes without much luck.
We rewired the CAN bus to contain only the PDP and RIO and still couldn’t find either through the NI web interface. At one time, we blew a 20 amp fuse and replaced it. We don’t know why and it probably has nothing to do with the CAN bus.

We even replaced the entire PDP.

Stats and Specifications:

Our CAN bus utilization: 14-16%
Resistance across the CAN bus: 120 Ohms
The CAN bus begins at the RIO and ends at the PDP.
In code, we can monitor the PDP’s voltage but still get timeout errors.
Firmware: We upgraded the RIO’s firmware to the 2018 version before we had these issues. We downgraded to the 2017 version and still had the same issues. We’ve also flashed the RIO multiple times using the reimaging tool.

Talon Test Code:


package org.usfirst.frc.team6619.robot;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
public class Robot extends IterativeRobot {
	private static final int kMotorPort = 0;
	private static final int kJoystickPort = 0;
	private WPI_TalonSRX m_motor;
	private Joystick m_joystick;
	@Override
	public void robotInit() {
		m_motor = new WPI_TalonSRX(kMotorPort);
		m_joystick = new Joystick(kJoystickPort);
	}
	@Override
	public void teleopPeriodic() {
		m_motor.set(m_joystick.getY());
	}
}

Thanks for your attention.


#2

When troubleshooting the CAN bus, you should be looking at the Talon LEDs (section 2.3 in the Talon User’s Guide) and roboRIO web-based config.

Before you wrote any software, did you follow these steps…

CAN bus should measure 60Ω, not 120Ω. This is because there should be one 120Ω resistor at each end (typically the RIO and the PDP).

Did you set the device ID’s of the Talons. If they are both set to 0 then the API will not function (regardless of what year API).


#3

Have you followed all the steps in the CTRE manual? https://github.com/CrossTheRoadElec/Phoenix-Documentation/blob/master/README.md#before-you-write-any-software

I didn’t see you mention running the lifeboat.


#4

We will try upgrading the RIO using lifeboat tomorrow when we have access to the robot. We can also reduce the resistance across the CAN bus. We were successfully running the Talons over CAN just two days ago …

Thanks for all your help.


#5

We figured it out. We reimaged the RIO, used the lifeboat utility, and re updated the firmware. This seemed to work.