We’ve been seeing a really weird issue with one of our swerve drive steering motors. Seemingly at random, when we power on or deploy code, sometimes our front left steering motor does not respond to commands. When this happens, we are able to read encoder values, bus voltage, velocity, etc from it, but it does not respond when we tell it to go to some position. The motor seems to be operating on the CAN network perfectly fine (it flashes amber when disabled, turns solid amber when enabled, and the status lights just stay solid amber regardless of what we tell the drivetrain to do).
What makes this especially weird is it is always the front left steering motor, and we have not seen this issue on any other motors (drivetrain or otherwise). Because this issue only happens on one of our modules, and not on any other modules (all of which run identical code), it doesn’t seem super likely to be a software issue from our end.
We replaced the motor and still saw the issue on the replacement, so it is unlikely to be a hardware issue. Also, every time this happens, if we reboot the robot or redeploy code, the issue goes away and just acts normally.
The only thing I can think of that could be special about this motor between swaps is that it’s the first device past the CANivore on our bus. I have no idea why that would matter but it’s the only thing I can think of that we have not yet accounted for.
It’s super frustrating to deal with this because the band-aid fix is so easy but we have not yet found out how to tell that this is happening before trying to drive. We are concerned that we will go on the field and won’t see this issue coming, and our match will be ruined as a result.
I believe the issue only started showing up after we switched to using a CANivore for our CAN bus, but I’m not sure about that. We regularly see CAN bus issues show up in our driver station console (CTR: CAN frame not received/too-stale) but these show up for random motors and no other motors seem to have their performance affected by this. I’m also not sure why these errors pop up – we have a lot of motors, but our CANivore bus usage on Phoenix tuner sits at below 50% all the time.
Has anyone seen any issues like this in the past, and if so, what can be done to resolve this?
Code is at https://github.com/team4099/RapidReact-2022