kriswiner / MPU9250

Arduino sketches for MPU9250 9DoF with AHRS sensor fusion
1.04k stars 471 forks source link

Strange Data from GY-80 #168

Open afnan opened 7 years ago

afnan commented 7 years ago

Hi, I have been reading your libraries and envied your skills. I have managed to use your GY-80 code but data is strange erratic behavior with no sense of rotation. After search on your answers to others i came to conclusion that

  1. I have not calibrated Magnetometer
  2. I have not calculated Declination for where i live.

I came across this sweet article https://github.com/kriswiner/MPU6050/wiki/Simple-and-Effective-Magnetometer-Calibration by you and tried to implement the routine for my program.

So far the missing variable is MPU9250magCalibrationwhich you have calculated in your initAK8963 in MPU9250 code.

Questions:

  1. Is there any workaround for calibration ?
  2. Following link states that my Magnetometer has capability of self calibration i wonder if its worth https://github.com/helscream/HMC5883L_Header_Arduino_Auto_calibration/blob/master/Core/Compass_header_example_ver_0_2/Compass_header_example_ver_0_2.ino
  3. How to Calculate Declination ?

Thanks

kriswiner commented 7 years ago

No substitute for mag calibration, absolutely required.

Look up your declination in an atlas, it is not calculated.

On Thu, Aug 3, 2017 at 3:16 PM, afnan notifications@github.com wrote:

Hi, I have been reading your libraries and envied your skills. I have managed to use your GY-80 code but data is strange erratic behavior with no sense of rotation. After search on your answers to others i came to conclusion that

  1. I have not calibrated Magnetometer
  2. I have not calculated Declination for where i live.

I came across this sweet article https://github.com/kriswiner/ MPU6050/wiki/Simple-and-Effective-Magnetometer-Calibration by you and tried to implement the routine for my program.

So far the missing variable is MPU9250magCalibrationwhich you have calculated in your initAK8963 in MPU9250 code.

Questions:

  1. Is there any workaround for calibration ?
  2. Following link states that my Magnetometer has capability of self calibration i wonder if its worth https://github.com/helscream/ HMC5883L_Header_Arduino_Auto_calibration/blob/master/Core/ Compass_header_example_ver_0_2/Compass_header_example_ver_0_2.ino https://github.com/helscream/HMC5883L_Header_Arduino_Auto_calibration/blob/master/Core/Compass_header_example_ver_0_2/Compass_header_example_ver_0_2.ino
  3. How to Calculate Declination ?

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/168, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qlROP5uD-m2eXI9Qknrnx5V6MJ7Yks5sUka-gaJpZM4OtDmW .

afnan commented 7 years ago

What about missing last variable dest1[0] = (float) mag_bias[0]*MPU9250mRes*MPU9250magCalibration[0];? which is MPU9250magCalibration

kriswiner commented 7 years ago

Are you using an MPU9250?

On Thu, Aug 3, 2017 at 3:38 PM, afnan notifications@github.com wrote:

What about missing last variable dest1[0] = (float) mag_bias[0]MPU9250mResMPU9250magCalibration[0];? which is MPU9250magCalibration

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/168#issuecomment-320108819, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qkEIGPqpVxFWu12c1oGv-f3X1dsGks5sUkvigaJpZM4OtDmW .

afnan commented 7 years ago

No I am using GY-80 (HMC5883L) with NodeMCU running at 80MHz. What if I do not multiply MPU9250magCalibration?

kriswiner commented 7 years ago

Then set mpu9250 calibration to 1

On Thu, Aug 3, 2017 at 5:39 PM afnan notifications@github.com wrote:

No I am using GY-80 (HMC5883L) with NodeMCU running at 80MHz

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/168#issuecomment-320125967, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qu4WikW7G7Hkt70WgrqdoTMVlsd8ks5sUmgwgaJpZM4OtDmW .

afnan commented 7 years ago

So setting that variable to 1 and performing calibration and recording value while making 8 figure with device gives following images. Blue one is MX vs MY and Orange is MZ

After Calibration mag

Before Calibration magb

I am not sure if routine was success but problem is

  1. Rotate against YAW other two remains constant. Yaw does not show 180 to -180
  2. Rotate against any other all get changed.

What should i look next into?