Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15374

MPU calibration -> code values matching problem

$
0
0

Hello everyone. First post.
I've recently been working with the MPU9250 and a library given by jremington in the post here. As stated by the code I need to use the Magneto 1.2 calibration program to properly calibrate the sensor. However after obtaining the values, I'm at a loss for how to actually match them into my code:

// vvvvvvvvvvvvvvvvvv  VERY VERY IMPORTANT vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//These are the previously determined offsets and scale factors for accelerometer and magnetometer, using MPU9250_cal and Magneto 1.2
//
//The scale constants should *approximately* normalize the vector magnitude for accel and mag to 1.0
//The AHRS will NOT work well or at all if these are not correct
MPU9250 accelgyro;
I2Cdev   I2C_M;
float A_cal[6] = {515.0, 279.0, 751.0, 5.96e-5, 6.26e-5, 6.06e-5}; // 0..2 offset xyz, 3..5 scale xyz
float M_cal[6] = {28.585708, 33.453226, -36.173858, 0.01403, 0.01414, 0.01387}; // can make both 3x3 to handle off-diagonal corrections
float G_off[3] = { -310.4, 135.7, 278.0}; //raw offsets
// ^^^^^^^^^^^^^^^^^^^ VERY VERY IMPORTANT ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Much Obliged,
Ian

9 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 15374

Trending Articles