Observations on Ultimate GPS and 10-DOF IMU

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
tony_a
 
Posts: 29
Joined: Mon Feb 13, 2012 3:48 pm

Observations on Ultimate GPS and 10-DOF IMU

Post by tony_a »

I've learned a few things about these products that I thought I'd pass along in case it helps someone else.

The Ultimate GPS is silent when it comes to populating the Magnetic Deviation field in the $GPRMC sentence, and the manufacturer's data sheets confirm that it's missing but can be added in the firmware upon customer request. They didn't say why they left it out, and every other GPS I've used that has NMEA output includes it as a standard feature. I wonder if Adafruit could look into this to see the units they buy going forward could have this feature enabled?

The example sketches for the 10-DOF IMU include a comment that the Gyro sensor data fields have been scaled to send data in the units of radians/second. However the output from mine is actually pretty close to being in degrees per second (hugely different!). Easy to solve with math and something to keep in mind.

Speaking of math, in the Pitch and Roll example sketch the roll data is wrong when the 10-DOF is inverted. It reports 0 degrees when upside-down. However if the math in the .CPP is modified to make it symmetric with the Pitch calculations (just include the signOfZ parameter in the same way), it correctly shows a limit of + or - 180 degrees depending on which direction you rolled.

It was easy to calibrate the Gyro channels by means of giving the 10-DOF a ride on my phono turntable (anyone here remember vinyl LPs?) accompanied by an Arduino and a 9V battery. I collected data at a standstill, at 33-1/3 and 45 rpm in three orthogonal orientations. The scales and offsets were straightforward to calculate.

At the moment my calibrations are implemented entirely in my sketches using hard-coded constants. Is there a way to store the calibrations in the sensors themselves? If so, then this is a great opportunity :idea: for adding another example sketch.

A general comment on the physical designs of the breakouts: thank you, Adafruit, for providing the screw hole attachment points. It's great to have the option to use these secure and well defined features. This is especially relevant to the 10-DOF because we don't want it waggling cantilever-style which would kill the Z-Axis accelerometer data. May I offer one minor suggestion? I mounted the 10-DOF breakout in the uncommitted space in my Ultimate GPS / SD logger shield, and kept my fingers crossed that everything would still work after the dirty work with the drill was all done. If there were two little features added to the breakout there would be a super-easy new mounting option. Place two plated through holes in the corners opposite the row of signal connection points. If I had those two added pins in those spots I could have achieved the desired mechanical stability without drilling any holes at all.

Thanks for listening.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Observations on Ultimate GPS and 10-DOF IMU

Post by adafruit_support_mike »

tony_a wrote:The Ultimate GPS is silent when it comes to populating the Magnetic Deviation field in the $GPRMC sentence [...] I wonder if Adafruit could look into this to see the units they buy going forward could have this feature enabled?
I'll pass the suggestion along to the folks who work with that supplier. It may be a cost thing, but that's just a guess on my part.
tony_a wrote:The example sketches for the 10-DOF IMU include a comment that the Gyro sensor data fields have been scaled to send data in the units of radians/second. However the output from mine is actually pretty close to being in degrees per second (hugely different!).
I think I saw another thread about the same subject last night.. apparently a version made it to Github with the wrong constant. Check today's version and see if it's correct.
tony_a wrote:Speaking of math, in the Pitch and Roll example sketch the roll data is wrong when the 10-DOF is inverted. It reports 0 degrees when upside-down.
I'll pass that along too.
tony_a wrote:At the moment my calibrations are implemented entirely in my sketches using hard-coded constants. Is there a way to store the calibrations in the sensors themselves? If so, then this is a great opportunity :idea: for adding another example sketch.
I don't think any of those sensors have nonvolatile storage, but I'll check the datasheets.
tony_a wrote:Place two plated through holes in the corners opposite the row of signal connection points. If I had those two added pins in those spots I could have achieved the desired mechanical stability without drilling any holes at all.
That's a very interesting idea.. I'll check with the hardware team and see what we can do about that.

Thanks for the feedback! ;-)

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Observations on Ultimate GPS and 10-DOF IMU

Post by adafruit »

we can't have magnetic deviation as well as the logging function, we went with logging since thats what more people want

we'll check out the upside-down sensor , the radians bug was fixed yesterday i believe :)

User avatar
tony_a
 
Posts: 29
Joined: Mon Feb 13, 2012 3:48 pm

Re: Observations on Ultimate GPS and 10-DOF IMU

Post by tony_a »

[quote="adafruit"]we can't have magnetic deviation as well as the logging function, we went with logging since thats what more people want

That seems fair; thanks for checking.

One more thing I forgot to add about the GPS behavior - or maybe it's the limits of the SW Serial on the Arduino Uno? I have never been able to receive clean serial data at the 115.2 kbd rate. Luckily I can send out GPS commands and have them execute - including the all-important command to go back down to a slower NMEA serial rate. 56 k through SW Serial works very well in both directions.

User avatar
wethaguy
 
Posts: 54
Joined: Sun May 06, 2012 9:00 pm

Re: Observations on Ultimate GPS and 10-DOF IMU

Post by wethaguy »

adafruit wrote:we can't have magnetic deviation as well as the logging function, we went with logging since thats what more people want
I would +1 choosing deviation over logging. Determining deviation is far more difficult than implementing logging of data.

User avatar
jcgoodman
 
Posts: 107
Joined: Thu Jan 23, 2014 6:03 pm

Re: Observations on Ultimate GPS and 10-DOF IMU

Post by jcgoodman »

If you care about magnetic deviation, you're a fairly advanced user anyway, and can probably take care of it yourself in software. Easiest approach would be to store a coarse-resolution map of deviation and declination values and interpolate.

User avatar
tony_a
 
Posts: 29
Joined: Mon Feb 13, 2012 3:48 pm

Re: Observations on Ultimate GPS and 10-DOF IMU

Post by tony_a »

[quote="adafruit"]we can't have magnetic deviation as well as the logging function, we went with logging since thats what more people want

Another thought - the Ultimate GPS / SD logger shield for Arduino is tremendously superior for logging. When sold in this form factor the magnetic deviation data field feature would make sense.

1chicagodave
 
Posts: 564
Joined: Wed Jun 19, 2013 3:35 am

Re: Observations on Ultimate GPS and 10-DOF IMU

Post by 1chicagodave »

How do you wish to use this magnetic information?

Are you looking for magnetic "deviation" or magnetic "variation/declination"?
Deviation may incude any alteration or interference of the polar magnetic field such as that caused by structural beams, local iron deposits, or even the watch on your wrist.

If you are looking for the difference between magnetic north and geographic north, that's declination (aka: variation). Usually that information would be used to correct magnetic compass readings to be relative to true geodetic north. Since the GPS headings are already relative to true north....that conversion/correction is often unnecessary.

In GPS units which do report magnetic variation, everything I've seen supports the idea that it simply uses a look-up table and interpolation to report these values. Thus, why it's either report magnetic variation or have two-weeks of location logging built-in....memory space.

Theoretically, if one has a GPS and a magnetic compass, magnetic variation (even deviation) could be calculated by just subtracting the two reported headings. Since GPS heading relies on movement, this would be most accurate while the device is moving along a straight path outdoors. This value could then be stored as the most recent local deviation, and used for magnetic compass correction when the device stops moving.

**EDIT -
I just read a paper from '03 titled The Magnetic Compass and GPS. It's topic is very much inline with this thread. It also includes some useful techniques and formulae for determining and correcting for declination, inclination, and deviation. Thought I'd share it!

User avatar
tony_a
 
Posts: 29
Joined: Mon Feb 13, 2012 3:48 pm

Re: Observations on Ultimate GPS and 10-DOF IMU

Post by tony_a »

I did mean to say "variation", actually - good catch!

The purpose is for sensor fusion. The Ultimate GPS forgets which way it was just moving when it comes to a stop. I wanted to use a compass reading derived from the magnetometers in the 10DOF to stabilize the heading when the vehicle comes to a rest, or is traveling so slowly that the heading figure from the GPS becomes noisy. But I don't want to use a reference reading that has a substantial offset error.

One workaround could theoretically be to self-calibrate whenever the vehicle is traveling in a steady straight line. Or if the trips will be short, hard-code it and try to remember that the hard coding must be changed for different locations.

skyminer
 
Posts: 18
Joined: Sun Jul 07, 2013 11:49 am

Re: Observations on Ultimate GPS and 10-DOF IMU

Post by skyminer »

Since this is the only mention of finding magnetic variation in the Adafruit Forums I thought I would drop this here as a resource for anyone doing similar things in the future.

NOAA provides the C code for the World Magnetic Model (WMM) and the International Geomagnetic Reference Field (IGRF) on this page: http://www.ngdc.noaa.gov/geomag-web/#declination. If you have the space on your microcontroller you can calculate the magnetic variation using your GPS coordinates.

User avatar
mycobiont
 
Posts: 9
Joined: Sun Oct 02, 2016 12:28 am

Re: Observations on Ultimate GPS and 10-DOF IMU

Post by mycobiont »

I am interested in getting the magnetic variation from RMC. I am building a field data collector with an IMU and GPS combined. I want to be able to collect angle to true north, by combining the IMU magnetic north and the declination (magnetic variation), and am more than a little disappointed to find that the Ultimate GPS firmware is not set up to provide the data. Yes, I understand that I could build a table (a little work, but very limited... see below), or build in the NOAA model for a better calculation (a lot of work, and error would still increase over time as they recalibrate the model as needed). Getting the current value for my current location would be preferred because:

1. The table would be a little complex due to the variations in declination both over latitude and longitude, especially if you travel much.

2. The table would be static, unchanging. I still sometimes use a GPS unit that I got back around 2000, I would hope that my Adafruit project will have a similar or better lifespan. Since 2000, declination at my home location has changed more than 2 degrees.

3. Yes, 2 degrees may not seem like a big deal for many applications (perhaps including mine), but there may be other applications that would need it. And after all, the IMU outputs degrees in floating point values, so the potential may be there for sub-degree accuracy.

3. GPS heading is worthless for my needs - it is based on the change in position regardless of what angle your GPS may be rotated. One application I need this for is to get the direction a camera is pointed regardless of the direction I'm travelling. This includes on a river raft where there would be no option to run my GPS a hundred meters or so out in front of the camera to get a reasonable compass direction based on heading... splash splash.

Adafruit has the product documentation on the GPS, which refers us to www.gtop-tech.com for customization options, but that website is not responding. If it is simply a matter of replacing firmware that adds declination at a loss of data logging within the GPS, maybe the firmware replacement could be posted somewhere that folks like me can get it?

Thanks!

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”