Report
4 years, 9 months ago.

Getting errors in the yaw angles.

Hi, First tanks for portting the filttering algorithm, i tried to get it working with my MBED lpc1768, i just changed the I2C ports, the magnetic declination and commented all the code related to the LCD display, i'm getting a considerable Error in the yaw angle it appears to respond just at 0 deggres, here are some samples that your program is giving me:

  • Real yaw = 0°

q0 = 0.999996 q1 = 0.001028 q2 = 0.002471 q3 = 0.000427

Yaw, Pitch, Roll: -5.600804 0.283113 0.117880

  • Real yaw= -45°

q0 = 0.999446 q1 = 0.008853 q2 = 0.006723 q3 = -0.031379

Yaw, Pitch, Roll: -9.239670 0.801814 0.989882

  • Real yaw 90°

q0 = 0.936440 q1 = -0.014756 q2 = 0.009827 q3 = 0.350381

Yaw, Pitch, Roll: 35.360836 1.647245 -1.189479 List

  • Real yaw 135°

q0 = 0.646507 q1 = -0.015767 q2 = 0.005870 q3 = 0.762723

Yaw, Pitch, Roll: 93.768402 1.813246 -0.655318

  • Real Yaw 180°

q0 = 0.514353 q1 = -0.016941 q2 = 0.007942 q3 = 0.857374

Yaw, Pitch, Roll: 112.425468 2.133049 -0.218427

Anyway i'll be looking what's happening if you can give me any feedback i'll be pleased.

See you.

Question relating to:

Sorry i realized that the problem was actually due to some calibration problem or bias in the magnetometer readings.

posted by Iván Arias 02 Sep 2014

Ivan, how you fixed that problem?, i think that i have the same problem..

posted by Eduardo Ospina 25 Feb 2015

Hi eduardo, I've got better reading after doing some changes to the program,

first: I've incremented the gyroscope measurement drift ifrom 0.2 to 1 deg/s/s. Second: Because the lpc1768 doesn't have FPU, i used the fast inverse square root funciton in http://en.wikipedia.org/wiki/Fast_inverse_square_root, instead of the sqrt() function, to enhance the algorithm performace.

Third: You should change the magnetomether bias values for the three axis, or just suppress the bias correction when calculating the magnetometer values, you can play too with the magnetometer read rate to see if you get better readings.

Fouth:Suppress the step where the parameters beta and zeta are changed after filter stabilization.

Finally: You may change the magnetic declination value, for one related to your geographic location, when doing the quaternion to euler angles conversion.

I think that other change could be done let me know if you find something new.

bye.

posted by Iván Arias 25 Feb 2015
Comment on this question

2 Answers

3 years, 9 months ago.

I am not sure why the quaternions shouldn't update. Are you sure you are including the quaternion filter in your compile?

4 years ago.

Hi, I'm trying to use your library to work with 9150.

The chip seems to work but if I try to calculate yaw, pitch and roll I have some problems:

mx = -311.106   my = 276.389     mz = 888.591  mG 

q0 = 1.000000
q1 = 0.000000
q2 = 0.000000
q3 = 0.000000

yaw: 0.000000 | pitch: 0.000000  | roll: 0.000000 

mx, my, mz change well If I rotate the board, but q0,q1,q2,q3 always remain the same (as you can see).

Please help, I need heading for my project.


To post an answer, please log in.