6dof imu with mag

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

paul.c:
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

paul.c:
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.

bungalow_steve:
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.

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.

Unterhausen:

bungalow_steve:
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

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)

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

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.

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.

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

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.

I can get my hands on the LIS and do some testing of some sort…

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

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.

I kind of expected the answers you just gave, which is appeciated. I knew my ideas, were half complete as they are based on just watching some of my coworks and fellow engineers do structures and fatique of our flight test aircraft. I do have access to matlab.

For my case, we are purely looking at shock designs (custom in development ones… side project for as I am an electrical guy with tons of aircraft testing experience and a huge love for all things mechanical from racing to engine building which I do.)

I had thought of linear transducers for this instead. I found 5" travel plunger style pots which when mounted near the pivit point of the control arms would provide enough resolution (with the known suspension geometry), we could sample them all at the same time and then just use time to determine suspension accel and deaccels for determining shock survivability. However the part that really matters is while we could determine shock travel and stuff, we can’t differentiate from bumps to surface contact to determine if we are faster and hold more lateral grip thru a turn of uneven surfaces. Yes we have start stop times, however its not like a road track where you are more consistant in driving because a lap may only take 1-2 mintues and the surface doesnt change.

Here the variables are huge, so we have to look at things differently.

Frank

Frank, I did mostly turbine engine related vibe issues. I forgot to mention that for traction you may want to place (encoders-ABS tone rings would work) on each wheel and at the drive shaft for traction analysis. Looking a wheel slip relative to the driveshaft could help isolate the problem there.

As far as testing goes its all about the test plan. You may want to look at a design of experiments type approach for a deterministic view of what’s going on. Overall though i’d recommend not just random sampling out in the desert but prescribed tests (quarter mile, single bump, whoops, g-pad) and draw from that.

Hope that helps. Sounds like everything you have been through before.

Did you see the filter thread? Does that make things more feasible? http://www.sparkfun.com/cgi-bin/phpbb/v … php?t=4273

Yep, been there done that, but just not on cars. :slight_smile: I know they wanted to go to a test site with the speed bumps, offset bumps, so that is no problem whether using wheel encoders with lvdts OR an accelerameter… things are alot more controlled, etc. So really it sounds like we shouldnt bother trying to datalog their Baja run as there is no comparison data… just g impact forces for failure point study. I wish I could just swip one of the aircraft’s EGI/IMU units for use. :slight_smile:

On a second note, the guy who has set me up with helping these shock guys get data wants to do something similar. He has a gyro we are going to start test flights on with a never before used motor. It is a pretty sweet engine setup and has an awesome torque curve. Anyway, we need to establish baseline accerations at various density altitudes and fuel loads. In of itself is easy, however gathering the data we were attempting to use accelerometers for as that is the only thing we can do. Because secondly is he wants to try different prop configurations and do the same testing to look for any improvements in acceleration and cruise conditions. The engine logging stuff is already there and it even records baro alt and OAT. All we would have to do then is no weight with and without fuel and record fuel flow or fuel quantities to know our weight at all times. What would you recommend?

Frank

Frank I always recommend keeping the raw voltages (or counts if you are using a coltage reference) and then post processing them in matlab. By doing this you can always recover your raw data and try a different filter. Generally software filters are one way (like a diode) and don’t allow you to recreate the test. Trust me the gov’t has wasted alot of money when some “smart” test engineer hasn’t done this.

If you are looking at accel rates couldn’t you just use a pitot tube and monitor velocity this way? I have seen some “drag strip” performance evaluators that use rapid gps updating to determine stuff. I think they were from a German company. They might be 10 hz output types. They were a little pricey at $1000. This would probably work in the air as well as on the ground.

ya i thought of pitot… undecided on that. For the gyro, I was thinking on my drive to work, that really I just need a high rate GPS and a vertical accel. For that we are just looking for level accels, but since its a gyro we have that moment about the disk since the thrust line is lower then the plain of lift, so we will start to climb some.

As for the vehicle using the filters with the accel, good point on using a soft filter by feeding the data into a Matlab process so we always have the raw data and can make changes, etc.

Even if we end up not doing any of this, I was thinking about purchasing it anyway, and just having some fun working with filters and such.

Frank

PS> Thanks for the conversation!