View Single Post
  #7   Spotlight this post!  
Unread 07-04-2008, 21:36
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: Gyro Sensor Questions

Quote:
Originally Posted by Demothesis View Post
As long as you're on the topic, where did you go to learn how to use the gyros? Is there another way besides using Kevin's code? Like always, the simplest solution will be the best and I find that Kevin kind of goes overboard with his code (hence the need to all but re-write the default code).

Demothesis
There is no need to rewrite the default code... kevin's code just requires an initialization call in the init function, and an ADC processing call in the fast loop. nothing really big.

To learn how to use a YRG, you need to mainly read the manual, and understand that every gyro is essentially different. Each gyro has its own 'zero' point, and this point varies with temperature. Thats why it is required to 'calibrate' the gyro's zero point when you turn the robot on. basically all this does is average all the zero samples together to get the absolute midpoint.

Next you have to understand its a RATE sensor, so in order to get an absolute position, you need to integrate. this means you have to esentially keep a running summation of all the values returned from the gyro (minus its midpoint) times time.

thats all there really is to it... kevin does a couple of other things like degrees-to-radians and sampling/deadzone modifications for different gyros, but thats just to deal with the consumers of his code that have different hardware.
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY