How to get calibration values for my accelerometer
5 次查看(过去 30 天)
显示 更早的评论
Hello all, I'm building my own flight controller and I'm using the mpu9250 IMU.
I'm sampelling the data at 1[khz].
I wasn't able to find if there is a function or app in Matlab that I can use to get the desigred bias and magnitude calibration values for my accelerometer.
I want to record the data from my IMU and than use it in some Matlab function to get the calibration values :)
Thank you for the help!
回答(1 个)
Bora Eryilmaz
2022-12-15
编辑:Bora Eryilmaz
2022-12-15
It looks like this IC has a 16-bit ADC. Depending on which acceleration range you select, the magnitude would be scaled as:
range = 2; % For a full-scale range of +/-2g.
magADC = 4096; % A 16-bit value read from the accelerometer.
magG = (magADC / 2^16) * range % Magnitude in g.
The bias correction would require reading a steady +1g from the accelerometer when it is at rest and adjusting the magADC value above as:
magADC0 = 35000; % Say you read this value for +1g, instead of the theoretical 32768.
delta = magADC0 - 2^15; % This is the bias correction needed.
magG = (magADC0 / 2^16) * range % This would be the uncalibrated value.
magADC = 35000; % The values you would read later during operation.
magG = (magADC - delta) / 2^16 * range % This is the calibrated value.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Robotics System Toolbox 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!