Quote:
Originally Posted by Demothesis
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.