MPU-6050 accelerometer reading of one direction

10 ビュー (過去 30 日間)
Nguyen Trieu
Nguyen Trieu 2020 年 4 月 11 日
編集済み: Muhammed Sadique 2024 年 9 月 5 日
Hi!
I am using these line of code to continuously read the real-time acceleration values from the IMU(MPU-6050):
clear;
a = arduino('COM5','Uno','Libraries',{'I2C','SPI'});
imu = mpu6050(a,'SampleRate',50,'SamplesPerRead',5,'ReadMode','Latest');
accelReadings = readAcceleration(imu);
display(accelReadings);
It will returns one sample of the acceleration data on x, y, and z axes read from the sensor in units of m/s2 like this:
accelReadings =
-2.3399 -0.5377 3.0201
Is there any possible way for me to retrive only the value of the x axis (the first value only)? I tried to treat it as an array but it is not working.
Also, can I fuse the data (estimate the orientation, quaternion, determine roll, pitch and yaw angles) of this type of this 6DOF sensor(MPU6050) as there is no magnetometer?
Thanks!

採用された回答

Gayatri Menon
Gayatri Menon 2020 年 4 月 21 日
Hi
accelReadings(1) should give you the x values. If you have a license for Sensor Fusion and Tracking toolbox or Navigation toolbox, try using read() for more capabilities. For usage and examples, please refer link for read() .
If you have the above-mentioned licenses, you can use imufilter to determine orientation.'imufilter' uses only accelerometer and gyroscope values. Refer to the example here.
Hope this helps
Thanks
Gayatri
  3 件のコメント
Gayatri Menon
Gayatri Menon 2020 年 4 月 23 日
編集済み: Gayatri Menon 2020 年 4 月 24 日
Please refer the below link.This link explains how the noise is calculated for MPU9250. A similar approach can be used for mpu6050 as well
Thanks
Gayatri
Muhammed Sadique
Muhammed Sadique 2024 年 9 月 5 日
編集済み: Muhammed Sadique 2024 年 9 月 5 日
Hi Gayatri Menon,
I am a new user of MPU 6050 (IMU). I do not know if I can ask question here. It is about non-zero value of acceleration even without moving the imu. Isn't it live accelration?
I do have a matlab code to read angle (from linear acceleration), angular velocity and linear accelration. The linear acceleration readings are non-zero values even when sensor is stationary. How I can solve this issue?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInertial Sensor Fusion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by