Quote:
Originally Posted by Gmercer
What is the range of values the getAngle function will return? The gyro updates correctly, but starts at a very small angle and only increment by maybe .15 at a time.
If we have an example angle of 6.8 degrees, and the gyro stays at such a small number, the robot goes into a death spin until reaching 6.8 degrees(which is a long time).
|
getAngle requires that the sensitivity of the gyro is set correctly with the setSensitivity method. For the ADW22307 gyro available on FIRST Choice, the sensitivity is 0.007 V/°/s. If you are using a different gyro, you will need to find the sensitivity from the data sheet of the gyro.
If you are using Robot Builder version 619 or earlier, there is a bug that defaults the sensitivity to 1.25 V/°/s. See the post by Alex Henning above. This would cause an issue similar to what you saw. It would take approximately 3.4 full revolutions before the robot measured 6.8 degrees. You should make sure that the sensitivity matches your gyro.
Edit: sorry, I see that you are setting sensitivity. I'll leave this here in case it helps someone in the future.
With a DMM, what is the voltage on the rate and +5v pins of the gyro?