Thread: Gyro "set gain"
View Single Post
  #3   Spotlight this post!  
Unread 08-02-2012, 09:20
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Gyro "set gain"

As Palardy said, the Gain converts voltage of the sensor to engineering units (in this case, degrees per second). There are two reasons there is a SetGain vi: 1) so you can use a different gyro than the one in the kit; and 2) every sensor has it's own true gain. The reason every sensor has its own gain is due to differences in the manufacturing process. The manufacturers try their best to make every gyro exactly alike, but it's not completely possible. You can find the true gain of your gyro using something like the procedure below.

Here is what you should do:

1) Set your robot so that one side of the frame is flat against a wall.

2) Turn your robot on and wait for your code to start.

3) Read the gyro heading and write it down (it should be close to 0). Let's call it HeadingStart

4) Using your hands, gently turn your robot around so the opposite side of the frame is flat against the wall (you robot should have turned 180 degrees - it should now be facing the opposite direction).

5) Read the gyro heading and write it down. It should be close to 180 degrees. Let's call it HeadingEnd.

6) Subtract your gyro heading from step 3 from the heading in step 5: The result should be close to 180 degrees. Let's call it HeadingChange: HeadingChange = HeadingEnd - HeadingStart

7) If HeadingChange wasn't close enough to 180, you can calculate a new and improved Gain with the following formula: NewGain = OldGain * (HeadingChange / 180)

8) Put the new gain in your software and repeat this process to see if it improved your heading calculation.
__________________
-
An ounce of perception is worth a pound of obscure.

Last edited by Chris Hibner : 08-02-2012 at 09:36.