SparkFun Forums 

Where electronics enthusiasts find answers.

Have a good idea for a new product for SFE or Olimex? Let us know!
By paul.c
#14201
When I came across the 6Dof imu v1 at sparkfun I thought all my prayers were answered but my joy was quickly squashed. In my naivety I thought it could measure reasonable accurate movements in 3d right off the shelf which it does - for a few seconds.

A few months down the line I have read up on the capabilities of imus and the problems with these devices. IMUs are inheritantly inaccurate - each component - accelerometer, gyro and 3 axis mag have huge disadvantages on their own so all three are stuck on a board and are supposed to compensate for the other components weakness. Here lies the problem - To join the the 3 gyros, 3 accelerometers and 3 axis magnetometer you need some kind of software filter that fuses all the readings together and comes up with a reasonably accurate estimation of orientation in real time- the one that is most useful is the kalman filter. Now, if you've ever looked at a paper "explaining" the Kalman filter you will quickly understand, this is not for a hobbyist. I spoke to a mathmatician who writes software tools for the Kalman filter and he informed me that people spend their entire lives getting them to work properly - Good luck!

There are useful sites rotomotion for example have had a Kalman filter in development for some while to use with their IMu for which the source code is available but again unless you've got a brain the size of a planet etc.

Finally to the point, I'm in no way complaining about Sparkfun or it's products because I think what they are doing is fantastic, my concern is with the IMU 6Dof V3 - even it sounds like a great product, without supplying some way of fusing the measurements, Imu V3 and earlier versions are kind of useless.

If someone has come with a way to get these working or implimented a simple filter of some kind - I love to hear about it.

best

Paul
User avatar
By leon_heller
#14202
paul.c wrote:When I came across the 6Dof imu v1 at sparkfun I thought all my prayers were answered but my joy was quickly squashed. In my naivety I thought it could measure reasonable accurate movements in 3d right off the shelf which it does - for a few seconds.

A few months down the line I have read up on the capabilities of imus and the problems with these devices. IMUs are inheritantly inaccurate - each component - accelerometer, gyro and 3 axis mag have huge disadvantages on their own so all three are stuck on a board and are supposed to compensate for the other components weakness. Here lies the problem - To join the the 3 gyros, 3 accelerometers and 3 axis magnetometer you need some kind of software filter that fuses all the readings together and comes up with a reasonably accurate estimation of orientation in real time- the one that is most useful is the kalman filter. Now, if you've ever looked at a paper "explaining" the Kalman filter you will quickly understand, this is not for a hobbyist. I spoke to a mathmatician who writes software tools for the Kalman filter and he informed me that people spend their entire lives getting them to work properly - Good luck!

There are useful sites rotomotion for example have had a Kalman filter in development for some while to use with their IMu for which the source code is available but again unless you've got a brain the size of a planet etc.

Finally to the point, I'm in no way complaining about Sparkfun or it's products because I think what they are doing is fantastic, my concern is with the IMU 6Dof V3 - even it sounds like a great product, without supplying some way of fusing the measurements, Imu V3 and earlier versions are kind of useless.

If someone has come with a way to get these working or implimented a simple filter of some kind - I love to hear about it.

best

Paul
Kalman filtering is one way to do it, but it isn't easy. I implemented a Kalman filter for people tracking on a DSP where I used to work, but didn't actually write the code, which was developed in C on a PC taking a couple of man years work; I just ported it to my hardware. That took six months before it was working properly, mainly because of bugs in the DSP development tools.

A neural net is another approach (they are sometimes used for sensor fusion), but still requires a lot of work and know-how.

Leon
By bungalow_steve
#14240
paul.c wrote: To join the the 3 gyros, 3 accelerometers and 3 axis magnetometer you need some kind of software filter that fuses all the readings together and comes up with a reasonably accurate estimation of orientation in real time- the one that is most useful is the kalman filter.
If someone has come with a way to get these working or implimented a simple filter of some kind - I love to hear about it.

best

Paul
Paul,

Kalman filters are not the answer, the purpose of Kalman filters is to optimally combine two independent sources (with independent error sources) of the same information into a single piece of information. Gyros and accelerometers provide different information, so you can't "fuse them together".

Kalman filters are most commonly used to fuse IMU and GPS data, each provides the same information but with different technologies and different error sources, a perfect combination that Kalman filters can take advantage of. In this case the Kalman filter will optimally blend the GPS slow but accurately updated velocites and positions with the IMU's fast but inaccurate velocites and positions. The Kalman filter really just resets the IMU data every time a new GPS piece of data is acquired, but smoothly.

Now back to your 6dof IMU, well, the parts on this IMU are good for a few seconds like you said. Gyros and accelerometers that are good for a few hours weight many pounds and cost thousands of dollars. If you need accuracy over long periods of time you need to add a GPS with Kalman filters

If, on the other hand you need accuracy for, say, a minute, then you can calibrate the gyros and accelerometers and achieve this goal without a GPS. This requires buying a rate table (basically an accurate record player) and a shaker, and needs to be done over temperature, with this you can quickly increase the accuracy of the gyros and accelerometers by ten fold.

But you right the spark guys should really come out and say all this, there isn't going to be an off the shelf accurate cheap IMU built in the near future, the technology just isn't there. Analog devices offers a low noise gyro, for instance, but it cost over $600, see the bottom of this page

http://www.analog.com/en/subCat/0,2879, ... 5F,00.html

the part number is ADIS16120.

The parts on the 6dof are just not IMU grade, simple as that.
By Unterhausen
#15429
bungalow_steve wrote: Paul,

Kalman filters are not the answer, the purpose of Kalman filters is to optimally combine two independent sources (with independent error sources) of the same information into a single piece of information. Gyros and accelerometers provide different information, so you can't "fuse them together".
>>>
snip
<<<
The parts on the 6dof are just not IMU grade, simple as that.
This statement would really suprise the hundreds of engineering groups that successfully designed IMUs before the advent of GPS. When I learned Kalman Filtering in the mid 80's, GPS had just been invented, and was not yet being considered for IMU purposes. Two books that cover the KF and INU applications were written by Jaswinski and Maybeck. No GPS in either one, and often there are not redundant sensors in an INU. A Kalman filter will work as long as there is coupling between the axes, which is true in this case.

I believe that the components on the Sparkfun IMU are adequate to the task at hand. While you can make a living designing Kalman Filters, applying them is being done by undergraduate engineering students on a regular basis.

For my purposes, 20 minutes is enough. It probably will be very difficult to do more than that without a GPS. If you can incorporate GPS, life will be much easier.
By Go0bur
#15574
What are you trying to use IMUs for? To keep track of absolute values? or to keep track of relative values? It's a lot easier to do it with relative values. For example, to make sure your robot is going straight (gyro) because every time the robot stops to turn you can reset the heading offset value back to zero (and all associated cumulative errors). So you can basically keep resetting cumulative errors based on the assumption that when the robot goes to a known state when it shuts its motors off to stop before it turns.

You can also use it to try and maintain speed (first order integration of accelerometer readings) because you could also reset this every time the robot shuts its motors off under the assumption that the velocity is at a known value when it does so- zero again. Anything where you are able to periodically get to a known state to reset the readings will work.

But if you want to use it to keep track of absolute heading or distance travelled, the cumulative errors will kill you in the end.

Also, any value that can be obtained from differentiating IMU value can also be used- such as differentiating rate gyro readings to get angular acceleration since there are no cumulative errors present (each calculation is independent of the last).

Uhhh, if you are actually using it in a robot that is.
By bungalow_steve
#15704
Unterhausen wrote:
bungalow_steve wrote: Paul,

Kalman filters are not the answer, the purpose of Kalman filters is to optimally combine two independent sources (with independent error sources) of the same information into a single piece of information. Gyros and accelerometers provide different information, so you can't "fuse them together".
>>>
snip
<<<
The parts on the 6dof are just not IMU grade, simple as that.
This statement would really suprise the hundreds of engineering groups that successfully designed IMUs before the advent of GPS. When I learned Kalman Filtering in the mid 80's, GPS had just been invented, and was not yet being considered for IMU purposes. Two books that cover the KF and INU applications were written by Jaswinski and Maybeck. No GPS in either one, and often there are not redundant sensors in an INU. A Kalman filter will work as long as there is coupling between the axes, which is true in this case. .
really, if it's be done for decades and you learned Kalman filtering in the 80's then it should be a simple task for you to present the optimal Kalman filter given ax,ay,az,wx,wy,wz outputs of the IMU, assume any noise density you like
I believe that the components on the Sparkfun IMU are adequate to the task at hand. While you can make a living designing Kalman Filters, applying them is being done by undergraduate engineering students on a regular basis.


I would think if it's so commonplace sparkfun would simply call up an undergraduate for the filters and supply it with the IMU, it would add much value
For my purposes, 20 minutes is enough. It probably will be very difficult to do more than that without a GPS. If you can incorporate GPS, life will be much easier
20 minutes, egads, if you can get 20 seconds out of the uncalibrated IMU's sparkfun sells I would be impressed, but I don't know what accuracy you would be satisfied with
By QTAR
#15764
I know I should just be patient and wait for you Sparky guys to release the details on the website, however I'd really like to know what microcontroller you're using to do the A/D converting. Particularly if it has a 10 or 12-bit ADC?

A seperate peripherial ADC IC doing 14 or 16-bit conversion would be nice, but that would chew the BT bandwidth and increase the module cost.

Cheers,
Josh 8)
By helloseth
#16381
I haven't used any of these IMU related products, but found this one interesting. http://memsense.com/products/nimu.asp

Of course it is more than the Spark fun, (if I recall correctly it is aroung $1k), it does have temp & alignment compensation, and outputs digital data via I2C.

I was 'planning' on using one of them if I ever get my robot built. (Still learning electronics, cad, cam, machining, CNC ...)

Seth
By meengineer2006
#17506
I can't speak for every discipline but as an undergraduate I was taught basic Kalman filter design in my controls class. I semi-regularly use Kalman filters in the control systems I help design and while you can make them ridiculously complex, you can also make them usable, even for those of us lacking "planet sized brains". Go pick up a controls textbook, this should be adequate for any project folks in this forum are doing, unless your trying to build your own ICBM or something.
By jerad.simon
#18549
Accelerometers 3 axis device ($39)
http://www.sparkfun.com/commerce/produc ... cts_id=758

Gyro 1 axis (rotation about z axis) ($65)
http://www.sparkfun.com/commerce/produc ... cts_id=395

Gyro 2 axis (rotation about x and y axis) ($69)
http://www.sparkfun.com/commerce/produc ... cts_id=698

3 axis Mag ($59)
http://www.sparkfun.com/commerce/produc ... cts_id=244

Total aproximate cost... $260.. which also does not have the unneeded fluff like blue tooth.
By jerad.simon
#18550
For most IMU's drifting is going to be the bain of it. Binding the errors will be something you will probably have to do.

J
By Grimm Spector
#18587
Well how about this, those of us who are working on robots get together, start testing this hardware and help each other out in making a useable solution, preferably one not using Kalman filters, because there absolutely must be another way.

In fact here's a good start, XY scatter graphs based on readings taken at 1s intervals or 1/2s intervals on each part of your IMU or separate device, and observed measurements.

Yes, this means a controlled environment, but we should treat it like an experiment because that's effectively what it is. If some people who have the IMUs and other single components already would like to make up some such graphs properly, and send them my direction or post them here, I'll be more than happy to review them and see if I can come up with something.

It's funny, I was never good at listening to someone drone on about math, but I could walk into a class, look at what's on the board and give the answer to a matrices or complex algebraic question at a glance half the time. So this is one of my strengths that I can hopefully bring to the SFE community and we can all continue on with our robotic projects.
By reklipz
#18589
I can get my hands on the LIS and do some testing of some sort...
By fkatzenb
#18764
Kind of glad I stumbled upon this thread. I really hope I am not screwed. This is kind of disconcerting for my goals. So let me present, and maybe you can say yes/no and give recommendation.

I want to install one of these on a Baja desert vehicle so we could do some data collection for impacts and traction for acceleration both longitudinally and laterraly. I was first going to properlly mount very close to the vehicles CG and set the sensitivity to 1.5g for this part only. Then do a rap/hammer test to see what that natural frequency response of the mounting point was to determine was frequencies would be amplified, then a calibration while on rear jack stands only with the engine running and transmission engage sweeping the RPM range and gear range to get frequency data.

Since I dont think I could build an active filter and datalog accurately, we were going to run the car just pulling data to a file. Then i was going to bring in the data, run each access thru a filter taking out those frequencies we found, then start running thru the data.

Now here is where people had me concerned. I was going to run thru the data taking the tilts recorded, to determine tru vectors of acceleration, calculate velocities, and then distances for each direction. So in reality, we would see impact data from falling, we would see which setup provides more acceleration (in our case more acceleration means wheels are on the ground longer) and more acceleration laterally (aka making cornors). And I thought this device was awesome because of all the tilt and mag sensors BECAUSE on desert and/or ralley vehicles, you have both alot of suspension travel (so alot of pitching) and alot of yawing while sliding thru dirt. We would be useless without tilt/mag data.


So am I delusional? Or could I actually make this work? What am I missing?


Thanks!

Frank
User avatar
By ohararp
#18778
Frank,

In my previous life as a vibrations engineer I would recommend going with a professional tri-axis piezo accelerometer from www.pcb.com. Unfortunately, you will have to resolve the sample rate for your analysis and I guarantee that you will not be able to meet this with a 8 bit uP. I'd look into a professional data acquisition system (pc based and expensive).

Overall, to do this properly you will need to spend a lot of time and money. I recommend using matlab on the data analysis side of things.

As far as your harmonic analysis of natural frequencies goes you will more than likely not be able to provide enough force input with a small force transducer hammer (they make sledge hammer sized ones $$$). Also, a ping test should be done in/as close to a free-free boundary condition (suspend vehicle from frame using elastic bands). If not, now you are compounding your problem by introducing boundary condition that you cannot reasonably model.

Overall what is the problem you are trying to solve? If it is an evaluation of suspension performance I'd recommend using a lvdt to anaylze the linear travel of the suspension with respect to time. I have seen some example of this for suspension design on mtb's that is pretty cool. Long travel lvdt are expensive though. If you are analyzing all four wheels you will need to ensure that all the data channels are acquired/triggered simultaneously.

Phew. Hope that helps.