How to Calibrate MPU6050 sensor using MATLAB?

19 ビュー (過去 30 日間)
Haris Bin Yousaf
Haris Bin Yousaf 2022 年 2 月 27 日
編集済み: Walter Roberson 2022 年 9 月 8 日
I need to know is there any command to calibrate my MPU6050 sensor? Because from one video on youtube the person used "readCalibrationstatus()" this command for his 9-axis BNO055 sensor. Also I want to know how to apply complimentary filter on the angular velocity matrix in below code:
Code:
clc
clear all
%Setting up Arduino and making object
ard = arduino
%Setting up IMU Sensor and making object
my_sens = mpu6050(ard)
%Capturing IMU Data
imu_read = read(my_sens) %Collecting data from IMU Sensor
imu_matrix = imu_read{:,:} %Converting data into matrix form
imu_mean = mean(imu_matrix) %Computes mean of 10 sample values for each column
%Tabulating mean data for one instance (@10 smaples)
imu_table = array2table(imu_mean, 'VariableNames', {'Acc_x','Acc_y','Acc_z','Gyro_x','Gyro_y','Gyro_z'})
%Printing Accelration Values
acc_x = imu_mean(:,1);
acc_y = imu_mean(:,2);
acc_z = imu_mean(:,3);
%Creating Accelration Matrix
accelration_matrix = [acc_x, acc_y, acc_z]
%Printing Angular Velocity Values
angvel_x_rad = imu_mean(:,4);
angvel_y_rad = imu_mean(:,5);
angvel_z_rad = imu_mean(:,6);
%Creating Angular Velocity Matrix
angvel_matrix = [angvel_x_rad, angvel_y_rad, angvel_z_rad]
Now i am stuck after this.Its just I collected raw data from the sensor and put them in matrix. Also I need calibration for my sensor. Please help.
  3 件のコメント
Haris Bin Yousaf
Haris Bin Yousaf 2022 年 3 月 2 日
Thank u Sir Walter Roberson for the response, yeah i also observed this and I think my device doesnot support auto-callibration function for MATLAB. I think I have to do calculations manually and then fuse the data together.
Noor Amira Ilyanie
Noor Amira Ilyanie 2022 年 9 月 8 日
Haris, if you dont mind can you share how you calculate it?

サインインしてコメントする。

採用された回答

Gayatri Menon
Gayatri Menon 2022 年 3 月 1 日
Hi,
The below link contains an example of using Complementary filter with MPU-9250 sensor
Hope this helps.
Thanks
Gayatri
  1 件のコメント
Haris Bin Yousaf
Haris Bin Yousaf 2022 年 3 月 2 日
Thank u ma'am, I got this!

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by