View Single Post
  #12   Spotlight this post!  
Unread 15-02-2007, 22:42
gnirts gnirts is offline
Suspicious pointer conversion
AKA: Robinson Levin
FRC #1648 (The Gearbox Gangstaz)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: ATL
Posts: 116
gnirts will become famous soon enough
Re: Robot won't go straight

Quote:
Originally Posted by mluckham View Post
To solve this problem simply, just add a constant of 15-8 = 7 to the PWM on the slower side to make the motors spin the same.
Or center whatever function you use the scale the joysticks to PWMs on 131 and not 127. The loss at the ends doesn't really matter, the difference between a command of 250 and 254 is negligable.

The solution we took is to have a Set_Left_Motor() and Set_Right_Motor() function where if you pass in x, it sets (for example) pwm01 to pwm01_min_forward+x if x > 0 or pwm_min_reverse-x if x < 0, where pwm01_min_forward and _reverse are around 127+15 and 127-8. I don't have the actual values in front of me but we adjusted this to make min_forward and min_reverse the values that actually make the robot itself move, not just the wheels turn under no load.

Robinson Levin