Sometimes while driving, our robot’s chassis encoders will reset to a very low value (around 25 usually) and the robot will freeze for a couple of seconds. Is this a mechanical issue or part of my code? My drive uses a “true speed” array of modified values, but that doesn’t seem like it could screw the robot up considering other people use it in the same way.
I guess you are running ROBOTC (although not specifically a ROBOTC issue). Static causes IME/cortex reset followed perhaps by watchdog timer reseting the cortex cpu.
I am running ROBOTC, yes.
Thank you so much! We’ll be sure to spray our wheels down with antistatic spray. We thought it couldn’t be static, because it was also happening at competitions.
By the way, those links lead to the same URL.
Fixed, cut & paste failure
Ohp, this is not a static problem. We coated our field in anti-static spray and covered the wheels for good measure. When our driver drove to the tube (not touching any metal), the robot turned off, the arm dropped, the cortex reset and set the encoders halfway up to 0, so when our driver tried to raise the arm it went way past its physical limit (or at least tried to and strained). Our robot doesn’t screw up when it crosses the bump anymore, so the static spray certainly helped with that, but this is still a serious issue. The encoders sometimes turn yellow, too, so I don’t know if that’s related.
Also, our pneumatics tend to fire when this happens.
Here is a video of the problem happening during a driver skill run:
Looks like a cortex reset to me. The pneumatics firing is a pretty big giveaway. Do you reset encoder values at the beginning of your code? If so, try taking that out and see if you still have the encoder issues.
(Max this question is for you)
nope, I don’t set the encoders to anything - I removed that earlier this season.
I wanna know what’s causing the cortex reset in the first place D:
Could be an intermittent battery connection.
So, we jiggled the battery connection and nothing happens. Plugging in a back up battery helped some, but it still happened in one out of the five runs we tried today. I don’t think that the cortex actually disconnects from the controller.