Wrong heading data from Core with Sparkfun IMU Shield

I am using Sparkfun IMU Shield with Core. Here is a link

Heading value from IMU sensor is needed, however the value is not correct.
It is not the same as the actual rotational angle.

When I rotate sensor from 0 degree to 45 degrees, heading value result is 60 or 70 degrees which is more than 45 degrees. This is wrong.

I used github from here. Only added code to change Core to manual mode not to use Core Cloud.

If anybody use this shield, plz tell me if there is no issue like above described.
I build Core in web ide with firmware of 0.5.0.

Thanks a lot

First I’d recommend to flash the code with a more recent system target (0.6.2 or even 0.7.0-rc.1)

I do have the same shields and I can have a check some time.

I flashed my code with target of 0.6.2, there is no success…
I want to get correct yaw data. Is it same concept between “yaw” and “heading”?
When rotating sensor from 360 to 270, the heading(yaw) value changes from 360 to 180 degrees. It is nonsense…

If you can try, plz check this.

Thanks.

I’ve tested this now, and I see what you might refer to, but I also consider these results as “by design”.

For the heading, you need to make sure that you have no interfering magnetic field around. My wireless mouse next to the IMU shield causes a divergence of 20+ degrees.

Calculating the real orientation of an object with a 9DOF IMU isn’t as trivial as it might seem to be. The sensor fusion logic in this demo works for a limited range of orientations, but not for all.
At some point the sensor fusion logic would have the choice of multiple results for one set of numbers.
If you look at the math you’ll see sqrt() which by definition will give you two results (+/-) and you have atan2() which also has some non-linear properties you might see that some sets of sensor values just won’t be able to give you a “nice” result.

You might also want to read about gimbal lock which plays a role in these edge case values that look (and probably) are worng, but are the best you can get from the physics used in these cheap sensors.

2 Likes

Thanks for your help, I also have Adafruit LSM9DS0.

This sensor gives me a correct heading(yaw) data. There are some divergences, but it is acceptable.
I don’t want ‘perfect’ value but correct data according to actual rotation of sensor.

I will ask Sparkfun whether they know this issue.

I fixed this issue from here. Thanks a lot

2 Likes