View Single Post
  #3   Spotlight this post!  
Unread 10-02-2016, 03:25
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 102
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: ITG3200 Gyroscope

Our team used the ITG3200 last season. It was a challenge to work with due to the following:
  • We typically wanted our measurements in degrees and the sensor reports readings in degrees/second (we ended up using a thread to accumulate values reported by the sensor).
  • The sensor did not tend to report zero when sitting idle. This error (bias) needed to be determined at start up while the robot was stationary and then taken into consideration with each reading.

In any case, here is the code we came up with that worked reasonably well for the ITG-3200 when we wanted to detect if the robot was tipping or needed to perform an operation like "make a 90 degree turn":

https://github.com/frc868/2015-FRC-R...roItg3200.java

As far as the answer to your original question, I think you can use the following to convert the raw 16 bit values to degrees/second (not degrees):

Code:
rawAxisValue / 14.375 - axisBias
Where rawAxisValue is the 16 bit signed integer (short) read from the sensor for your z axis and axisBias is the average error reported by the axis when the robot is stationary (when you wish that the sensor reported 0 but discover it does not).

Good luck and I hope that helps.
Reply With Quote