Saturday, 25 February 2012

9 Degrees of Freedom - Razor IMU - AHRS compatible made by Sparkfun

I am going to talk about Sparkfun IMUs. First of all I have tried just one of them, which is this.
I have read the code provided by spark fun for some of them as well.
First and main problem with all spark fun IMUs:
One does not simply gives an output through UART. (9gag)
UART is really slow.
The second issue is that, the output is so long. I have changed my output myself to make it shorter. Seriously, spark fun has used a 8 bit ascii code for each digit in every angle.
Second problem is that you can't be notified if new data is available. Therefore, if you are reading UART using buffer and interrupt, you have to make sure that you are not saving them in buffer when you do not need them. Then, the other bad thing about this is that while your IMU is doing calculation there is no way to read any data, even the old data. Which will help your control loop to run at an almost constant speed.
I changed the program myself, to make the IMU to give me outputs when I want them, but the sparkfun code gives the output regardless of any feedback from user.
The other issue with mine is that it runs at 50Hz which is now really good for UAVs, because one of gyros works at 50Hz but for new models the components except manometer can be used to at higher frequencies but Sparkfun is using a same code so they are running them at 50Hz as well. This is one example that Accelerometer and gyroscope can be used at much higher frequency.
This and the one that I have are the only one which they have a working code provided by sparkfun at this time. For this one, the code is totally wrong.
This things that I mentioned are applied to all IMUs made by sparkfun till now.
The other issue with mine is that the reading at steady condition fluctuate. In the following graph you can see angle measured by IMU in degree and each unit of x-axis represents 20ms.

The other issue with my IMU is that, it gets to much noise when there are some vibration. The filter by right should take care of that but it does not.
If I were in your shoes, I would buy a set of ADXL345 and ITG3200 and I would make them work with complimentary filter. I could be proud that I have made it myself and at the same time it works better and faster than these IMUs and therefore you can achieve a better control loop.
Anyway I have to mention that these IMUs are good for simple usages but for fast response are not good unless you make your own program for them.

No comments:

Post a Comment