View Single Post
  #1   Spotlight this post!  
Unread 22-08-2004, 18:21
generalbrando's Avatar
generalbrando generalbrando is offline
Build, Break, Repeat
AKA: Brandon Mensing
FRC #0246 (Overclocked)
Team Role: College Student
 
Join Date: Nov 2002
Rookie Year: 2001
Location: Boston, MA
Posts: 366
generalbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to behold
Send a message via AIM to generalbrando
A Simple Improvement to Driving

This may be common knowledge, but I couldn't find it searching, so I post away.

Our drive train (basic tank drive, two joy sticks) is very powerful but unbalanced because it's us building it. We put a large caster on the back recently to make it drive on any demonstration surface. When driving it now, you have to be a good driver to control it because there's a bit of swerving, requiring lots of correction. I'm used to this because that's how all the bots I've driven have been, but I wanted to fix this.

My thought was to program it so it would go straight easier and be more intuitive for new drivers. Here's what I thought of: (in non-tech terms so all crowds can enjoy )

Find the average of the two y values of the joy sticks. This is half way between each of them, reguardless of which one is greater. Now average each y value with the average. Those two averages will be 1/4 way from the original values toward the other joy stick. The result, if you can visualize, is that if you push both sticks forward, but you don't do it in perfect sync, the program will minimize the difference and the robot will go straight forward instead of swerving a lot.

For the techies:
pwm01=(p1_y+((p1_y+p2_y)/2)/2)
pwm02=(p2_y+((p1_y+p2_y)/2)/2)

A fun result is that if you push one joy stick, both wheels move and you get a very smooth curve. I found in testing however that if you push one stick far enough, the other wheel will stay still because there is too much torque needed to push out of the spin(?). This may just be an oddity of our drive train though.
__________________
Lead Mentor of Team #246, Boston University Academy and Boston University, Overclocked
www.burobotics.org