View Single Post
  #2   Spotlight this post!  
Unread 23-01-2008, 13:46
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
Re: steering wheel help FIRST Team 2044

There are a number of ways to work this. Here is one solution:

1. Install a gyro to give you heading.
2. Does your wheel really turn 180 degrees? No matter, moving it from neutral to full right or left will give you a value of 127 to 254, or 127 to 0. so you need to convert from the PWM value to degrees which will give a ratio of 127/180.
3. Now that your program knows what heading the steering wheel wants, put in a simple proportional control to turn to that heading (pseudo code):
error = (currentHeading - wheelHeading);
drive (RightSide-error/2, LeftSide+error/2);

As a first approximation this should work, but probably not very well. You wil have to fiddle with it and acount for gyro drift etc. to get it working well.