|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Gyro "set gain"
We have been using the gyro sensor for a few years now, and we always use "set gain" 0.0125 in the BEGIN VI as shown in the example code, but we have no idea what it means and what it is good for. We are really curious about it, so if anyone knows what the "set gain" means, what it does or what it is good for, can you please tell us?
|
|
#2
|
|||||
|
|||||
|
Re: Gyro "set gain"
A gyro outputs a specific change in voltage proportional to the rotational speed, the FPGA then integrates this change to get a heading.
The gain just tells the software how to scale volts to engineering units. |
|
#3
|
||||||
|
||||||
|
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. Last edited by Chris Hibner : 08-02-2012 at 09:36. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|