Robot boot check CAN Buss

Back Story… During build and tests of our robot we had a few test when after downloading to the robot it didn’t respond to any motion commands. In a panic we didn’t spend much time to try and nail it down. We just knew a reboot would fix the problem. The problem seemed to be attached to a scenario where we used Test mode on the driverstation before enabling the bot in one of the other Auto/Teliop modes Fortunately we didn’t ever have troubles at our regional.

Today we fired up the bot again to test and prepare for a off season event. Not trying we again found the robot as non responsive and again a Test mode was used just after downloading. This time we stopped and said “Lets take a closer look.”
Step one Check all subsystems. -Only subsystem affected seem to be using CAN Talons.
Step Two Log onto the Roborio Web Dashboard we self-test the CAN Talons. They all report Mode 15 No Mode. Seems by design our drive subsystem sets the mode [TalonControlMode.Speed] of the motors when the robot Initializes. But our Flywheel motor is set when the RobotMap.ini is called as designed by the Command based robot system.

Is it possible the robots CAN Buss is not fully booted up when the robot program is started?

Further testing while in this condition we where able to enter the Robot Mode Test and looking at each effected CAN motor. They all reported “Speed” as we would suspect but do not respond to the speed commands. While in Test we selected PercentVbus and slid the slider and got a response from the motor. Still no response in Teliop.

I can’t seem to reproduce the sequence to get the robot back into this failed state and we have reset to continue testing some new functions. Would it be wise to check the CAN Bus before configuring each drive. Seems Checking it later like in disabledPeriodic() or disabledInit() maybe not be reliable since “Test” mode shows the Drive as set to Speed.

BUTTTTTT self-test in the web dashboard does report no mode.

We had this same issue on the 2016 robot. Sometimes, (usually on a cold start) the CANbus wouldn’t initialize. IIRC a roboRIO reboot from the DS would fix it, as well as a breaker restart. The PWM speed controllers were fine, just the SRXes wouldn’t do anything.

I hadn’t considered Test mode, so I can’t report similar findings there.

We use PWM connectors to connect sections of CAN. I don’t think this is the problem, because we used the exact same method this year and had no issues. Otherwise, the wiring is all standard, in-series, with a terminating resistor on the PDP.

If I get the time, I might switch our spare roboRIO into that robot to see if that’s the problem.

I’m at least happy to here we are not the only one. We soldered and shrink-rap all our CAN connection other than the Roborio and PDP connections.

As for now we are testing each SRX for their current mode when the robot enters Disabled and reporting their mode to the Driverstation. Hopefully we will fall into this condition again and get supporting data in the program so we can react and report. Possibly try to re-configure the modes if required.

nickbrickmaster what mode where you using the SRXes in? I’m wondering if the closed loop is a common parameter.

For what it’s worth, we used SRXs in Open Loop (%VBus) on our drive train this year. Every so often, one or both sides of the drivetrain would cut out. This happened a lot at the feeder station so it might just be a wireless thing. I have no idea what was happening but it was pretty frustrating as the driver because the robot just would not move for 3-4 seconds or so.

PercentVBus in all cases, although we were getting feedback from encoders connected to the Talons. It is unclear whether this was working, because we never moved the flywheels while this problem was active (of course, we couldn’t power them up.)

I’m curious to know whether this issue affects other CAN devices, or just the SRXes? Does the PDP report current?

The PDP does report the current that is being drawn from each port. However we did not use that feature.

I just checked our drive logs during the event. As I suspected YES the non CAN devices DID report current draw. Thinking back to my original post. While in Test Mode I could change the SRX to PercentVBus and control the speed. I think I even set one SRX back to Speed and tried again in Teliop but still not teliop responce. Next time I will definitely test that again.

I think you and us are talking a different sinareo all together. Yours seems to be intermittent because of many factors ie wiring, brown outs, solar fairs who knows. We are entering a condition where there is no CAN SRX responses.

Have you asked CTRE? If the CTRE library was setting the mode to 15 when exiting test mode, your code would have to set the desired mode after test mode is run, just setting it at boot wouldn’t be sufficient.

It’s not every time. The test mode was more of a ?What did we just do to get us in this condition? Test Mode seems to be a common action/observation.

Oh and usually after a download

It’s probably unrelated. I had logging in the program to output the speed commanded to the SRX. However the SRX would sometimes disappear from the CAN bus for a few seconds. Not sure if that is similar to what you are experiencing (but more temporary). I don’t think it’s brown outs because our battery voltage wasn’t dropping below 10V at that time (according to the logs)

I can’t speak for nickbrickmaster but for me the Web Dashboard shows the SRXes as connected but the Mode = 15 “No Mode” when we did in fact set them to “Speed”. Also With the robot in Test I can change the mode to PercentVbuss and control the motor. I’m no expert in CAN but is there not a counter that will show when a device falls off the buss?

We had again the CAN devices quit responding last night. Unfortunately the PC on line and available did not have Microsoft Silverlight installed. New condition this time it was mid practice. That make it MORE SCARY. Today Looking closer to some of the logs we placed into the code I observed a new sequence to when the Drives are set and when/ where they report status.
We booted the robot and connected to it with the PC. Looked at the Webdashboard and seen the CAN drives still where set to No Mode. After starting the driverstation the driverstations console reported mode 2 "Close Loop"when entered disabled, but the Web dashboard Test still reported No mode. And remained till the robot was put into Teliop.
Here is the current code: https://github.com/GraniteCiyGearheads3244/2017SteamWorks/tree/master/HungryVonHippo