Robot Twitches Randomly

The robot will just be sitting there and will randomly the drive train will twitch a little what could cause this

Does it happen only while it’s enabled? If that’s the case, it’s possible that your controllers don’t have a deadband set, which might cause something of the sort. That’s my first thought. Otherwise, more information would be useful- When does it happen, is it enabled, etc

when its enabled and disabled it does

What kind of motor controllers are you using?

Sparks

Make sure that all of the PWM cables are properly seated in the roboRIO and SPARKs, there are no metal shavings in or around the ports, and the wires don’t have any nicks/cuts. It’s likely that the wires are momentarily shorting, causing the controller to think that the roboRIO is commanding it to move. If you notice which motor(s) moves each time, it may help narrow down where to look for shorts.

1 Like

my plan today is to clean up my electrical anyways so ill go thru and remove every wire and check is for cuts and the ports

1 Like

^^ what @AriMB said. Less likely is a broken wire in the PWM cable (try swapping for a new one). If none of this works, try calibrating the SPARKs as described on page 13 of the SPARK manual:

Watch the light on the spark when it twitches (when disabled to remove user code problems), does it go red/green? If so I’d expect a broken/damaged PWM wire as the culprit.

I’ll look tomorrow

Thanks

Did you check everything we said? Did you find any problems?

You can try unplugging each motor one at a a time and seeing when the robot stops twitching. When it does, the problem is somewhere in that motor path.

I see this is happening while the robot is enabled. You said it also happened while disabled, but double check that you’re correct on that. If it’s only when enabled, that would point to a code problem rather than an electrical one.

It happens when it’s enabled

Does it only happen when the robot is enabled, or both when enabled and disabled?

Only when it’s enabled

So as @AriMB said it is probably a code problem.
If you are controlling the motors with a joystick, make sure that you set a deadband for your joysticks because they might set a tiny value to the motors even if you don’t touch it.

1 Like

Alright thank you

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.