View Single Post
  #10   Spotlight this post!  
Unread 31-01-2009, 15:51
ellisk ellisk is offline
Registered User
FRC #1540
 
Join Date: Dec 2008
Location: Vancouver, WA
Posts: 41
ellisk is on a distinguished road
Re: Using encoders for traction control help

I've figured something out about traction control which actually is really obvious, but I didn't realize until now: You DON'T want to only have your traction control kick in when it's slipping. Otherwise, you would have your robot at rest (no slipping). The driver goes all the way forward, the drive code says ok because there's no slip, and then you're spinning out hugely, and then have to compensate hugely, etc.

So here's the algorithm that I've come up with, and it seems to work OK:

1. Get the desired PWM value and convert it to a desired velocity (multiply it by the maximum velocity of the robot)
2. If the desired velocity is outside of some maximum range of the current velocity (according to the omni wheels), then clamp it to within that range
3. Convert desired velocity back into desired PWM value by dividing by the maximum velocity of the robot

The problem is this: the maximum range that works best for pushing seems to be different for driving... It seems that it would help to dynamically calculate the best maximum velocity change, but I'm not sure how.