My team is having trouble with our robot’s CAN bus, and I was wondering if anyone has any ideas on how to troubleshoot it.
See bottom for summary
- On one of our practice bots, the PDP was wired directly to the roboRIO, but the PDP claimed it did not have CAN communication (red lights).
- Some of our PDPs seem to randomly get a sticky fault (Orange lights), with an ID of 0 (…0x0)
Previously Working State
- CAN bus: NI roboRIO > cut up female PWM cable > 4 Spark MAXes (drive-train) > cut up male PWM cable > PDP > long CAN wire w/ no connectors (bare wires) > 2 Victor SPXes (Intake/outtake) > 1 Spark MAX (flywheel) Related Question: Does it matter which gender is on which end of the CAN bus?
- Both this code and the code later testing was done with worked well enough.
Current Issues and Troubleshooting:
- I tried to add an old, previously unused Victor SPX at the start of the CAN bus. It indicated no CAN communication (alternating blinking red lights). However, the daisy chain pass-through still worked.
- I tried it with a different Victor SPX, same result
- I tried again, placing an older Talon SRX after the 4 Spark Maxes and before the PDP, same result
- I moved the Victor SPX to the end of the CAN bus, after the PDP with the still enabled terminating resister, and it started working. I was able to update it in Phoenix Tuner.
- I decided to leave the controller on the end, and to do that I soldered cut up PWM connectors onto a long CAN cable (figured it would be good to have the twisted pair wire). Related Question: How much effect does the twisted pairing have on the CAN bus and performance?
- At some point, I had switched some of the cut up PWM cables for CAN wires with soldered Molex connectors (from the 2022 KOP). They seemed compatible, but would not quite fit in the retention clips we had (I think the insulation got messed up and then got in the way).
- [PENDING RE-TEST] The drive-train Spark MAXes started blinking magenta at some point (No signal). Except at least one of them would sometimes switch to a faint, rapid yellow strobe (Which isn’t a thing). However, connecting to one over USB with the Rev Hardware Client allowed me to see the entire bus (at that point just the roboRIO and 1 Spark MAX). I also just realized that I can’t remember if the driver station console was logging errors about the drive-train Spark MAXes. Looking at the most recent 1/8 of my most recent DS log, it seems that it was not, although they were missing at one point earlier. I will retest the drive-train tomorrow.
- At some point I had the CAN bus wired into the roboRIO backwards, but I fixed it and still experienced issues.
- The PDP status lights were green (CAN link) when only connected to other motor controllers
- The PDP worked correctly (green status lights / CAN link) when wired directly into the roboRIO with CAN wire that had not connectors (bare wire).
- I verified that I was unable to see the missing devices in Phoenix Tuner several times.
Things I have not tried yet and other considerations:
- Re-imaging the roboRIO
- The robot had this code on it. I remember getting error messages in the console about the unplugged shooter Spark MAX, but I can’t remember if the drive-train Spark MAXes were actually causing errors or not. I have not actually tried driving the robot to triple check that it’s not working.
- I have not tried placing the PDP closest to the roboRIO
- I have not disabled the PDP terminating resistor and installed my own at the end of the CAN bus. Related Question: How much of an effect does this have? Last year, my team put the PDP first with the terminating resistor enabled and it was fine. (except possibly high bus usage, I can’t remember).
Main Questions Summary:
- Why won’t CTRE motor controllers work when placed before the PDP?
- I need to verify whether or not the drive-train is working because everything except the easy to confuse status lights points to it working.
- Does anyone have any general CAN bus troubleshooting advice?
Related Questions Summary:
- Does it matter which gender is on which end of the CAN bus?
- How much effect does the twisted pairing have on the CAN bus and performance?
- How much of an effect does this have? Last year, my team put the PDP first with the terminating resistor enabled and it was fine (except possibly high bus usage, I can’t remember).
I will check more things after school and update this post accordingly.