Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calibration Function #47

Open
NadaSaad-D8 opened this issue Oct 7, 2020 · 6 comments
Open

Calibration Function #47

NadaSaad-D8 opened this issue Oct 7, 2020 · 6 comments

Comments

@NadaSaad-D8
Copy link

hello Kiris, thank you so much for your great work i am new to MPU and it is really helpful , i have a question i cannot understand the algorithm of the calibration function , could you send me any paper that talks about calibration you followed in your code ?

@kriswiner
Copy link
Owner

kriswiner commented Oct 7, 2020 via email

@NadaSaad-D8
Copy link
Author

thanks for your reply ,
so i have many questions if you have time i will be thankfull if you explained this , i searched alot and the calibration functions are different from yours whatever i don't fully understand them , i got that the idea that i calculate many samples and got the average then subtract it from from subsequent data. but when i follow the code i didn't find it that way
FIRST : what are you reading here ? , why don't we say i read for example 1000 sample so i will divide by 1000 after reading them
readBytes(MPU6050_ADDRESS, FIFO_COUNTH, 2, &data[0]); // read FIFO sample count
fifo_count = ((uint16_t)data[0] << 8) | data[1];
packet_count = fifo_count/12;// How many sets of full gyro and accelerometer data for averaging
SECOND :
Next step is simple we are reading the data (Packet count number) then divided them by packet count to get average
till we reach this , i didn't get what is the meaning of removing sensor senstivity, how is this related to gravity
and then dividing by 4 , and in gyro dividing by 8
if(accel_bias[2] > 0L) {accel_bias[2] -= (int32_t) accelsensitivity;} // Remove gravity from the z-axis accelerometer bias calculation
else {accel_bias[2] += (int32_t) accelsensitivity;}

// Construct the gyro biases for push to the hardware gyro bias registers, which are reset to zero upon device startup
data[0] = (-gyro_bias[0]/4 >> 8) & 0xFF; // Divide by 4 to get 32.9 LSB per deg/s to conform to expected bias input format
data[1] = (-gyro_bias[0]/4) & 0xFF; // Biases are additive, so change sign on calculated average gyro biases
data[2] = (-gyro_bias[1]/4 >> 8) & 0xFF;
data[3] = (-gyro_bias[1]/4) & 0xFF;
data[4] = (-gyro_bias[2]/4 >> 8) & 0xFF;
data[5] = (-gyro_bias[2]/4) & 0xFF;

i am so sorry if the questions are trivial , thanks in advance

@kriswiner
Copy link
Owner

kriswiner commented Oct 7, 2020 via email

@maopal
Copy link

maopal commented Jun 8, 2021

Hi Kris, your simple method for calibration is very effective, however I wanted to implement an even more accurate calibration method that are suited for commercial applications of autonomous vehicles. Are there any you would recommend?

Thanks in advance!

@kriswiner
Copy link
Owner

kriswiner commented Jun 8, 2021 via email

@kriswiner
Copy link
Owner

kriswiner commented Jun 8, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants