View Single Post
  #3   Spotlight this post!  
Unread 30-12-2004, 19:41
krhs_programmer's Avatar
krhs_programmer krhs_programmer is offline
Programmer, Engineer, exDriver
#1247 (R.O.K.S.)
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2003
Location: Sutton, NH
Posts: 23
krhs_programmer is an unknown quantity at this point
Re: A Simple Improvement to Driving

My teams first robot used tank drive but with two drive wheels and two spining casters which made it very unstable at times and like you guys have said, it doesn't like to go in straight lines. Although this could be do inpart to the fact that one of the motors was slightly weaker that the other, but still that idea should work for us. After read the thread and seeing the drawbacks to it i came up with this idea:
If you were to designate one of the buttons on your joystick as a toggle switch and used it to toggle that function on and off depending on whether you want to be accurate or quick when driving.

first set up code so when you push the button it switches a variable between 2 values. (you'll have to do this on your own because i don't know how. sorry )
Then just use if statements:

if ( toggle == 1 ) /* toggle = var. controlled by button */
{
pwm01=(p1_y+((p1_y+p2_y)/2)/2);
pwm02=(p2_y+((p1_y+p2_y)/2)/2);
}

else
if ( toggle == 0 )
{
pwm01 = /* what ever your normal code is */ ;
pwm02 = /* what ever your normal code is */ ;
}

in theory that should work if you wanted to do that. thats what we did for our compressor last year to override the pressure sensor to build enough pressure to do the pull up on the bar.