1

I'm working in a project that involves gyroscopes...

I'm using Arduino and an ITG 3200 to read the data from the gyroscope. I get 3 values in deg/s for each axis (x,y,z).

My question is: How can I know the actual (physical) position or direction of the device (let's say an airplane). There has to be a math formula or something like that.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user526645
  • 67
  • 4
  • If my answer is good, please mark it as accepted, by clicking to the "V" symbol on the left of it. – AVH Apr 05 '11 at 11:22
  • There is some non trivial noise filtering + integration to be done on the data. So "there has to be a math formula" will turn into "there are some ugly math to do and a lot of code to write". – Alexandre C. Apr 28 '11 at 16:59
  • @alexandre-c I supervised some students last year who had to implement exactly this and the math they used was extremely trivial in fact. – AVH Jul 05 '11 at 07:43
  • @Darhuuk: apart from the numerical integration (and drift correction ?), did your students have to filter the data from measurement noise ? If not, then I agree, this is not very difficult (but quite not trivial to be honest). – Alexandre C. Jul 05 '11 at 09:28
  • @alexandre-c They used a gyroscope & accelerometer with digital output, they didn't take into account any measurement noise. I forgot what circuit they used exactly (it was FPGA based), but it was something along the lines of 2-3 adders and 2-4 constant factor multipliers. – AVH Jul 05 '11 at 17:33
  • @alexandre-c Oh, forgot one thing: they only needed to measure very low angles, so didn't have any use for trigonometric functions, which made the circuit quite a bit simpler. – AVH Jul 05 '11 at 17:33
  • @Darhuuk: okay, so it is probably a simple integration scheme. With gyroscope *and* accelerometer, things are quite simple. Thanks for the feedback. – Alexandre C. Jul 05 '11 at 17:56

2 Answers2

6

Using only the gyroscope signal (which you have to integrate numerically), you'll eventually run into trouble, due to drift. What's normally done is combining an accelerometer (for low frequency signals, i.e. drift) with a gyroscope (for high frequency signals). Here's a link few links showing more or less exactly what you want:

Also, see these StackOverflow questions:

Community
  • 1
  • 1
AVH
  • 11,349
  • 4
  • 34
  • 43
3

We are working on a similar problem.

We found this video on YouTube especially helpful, as it came with a paper as well as an implementation (which runs on Arduino):

http://www.youtube.com/watch?v=fOSTOnQzZCI

The paper and source code:

http://code.google.com/p/imumargalgorithm30042010sohm/

In our case (getting the orientation of a remote-controlled ball), we also had to include an accelerometer and a magnetoscope.

hendrik
  • 121
  • 2