I2Cdevlib Forums

# Incline of the sensor

## Recommended Posts

Hello,

I am beginning with the MPU-6050.
To understand what are the data we get, I have read this topic : http://www.i2cdevlib.com/forums/topic/4-understanding-raw-values-of-accelerometer-and-gyrometer/.

What I would like to do is know how tilted is the sensor in relation to the three axes.
In french, we say that a "gyroscope" is used to get this, and a "gyromètre" do to get the angular velocity.
Here, this sensor enables the user to read the angular velocity.
Perhaps I should often read the angular velocity and try to determine the incline depending on the time... But it might be quite imprecise, mightn't it ?

May you explain me how could I solve this problem ?

Soaocohoa

##### Share on other sites

Angular velocity is not enough to determine the incline, because its integrate will become imprecise over time,

usually use Accelerometer to adjust the result after a period of time.

you can check this blog for detail information:

http://www.geekmomprojects.com/gyroscopes-and-accelerometers-on-a-chip/

##### Share on other sites

I was thinking that I could also check the acceleration on the three axes, which would depend of standard gravity.
But there are probably other problems.

I am going to read : http://www.geekmompr...ters-on-a-chip/

##### Share on other sites

Using an accelerometer by itself to determine incline works perfectly and is very accurate, but only as long as the sensor is not moving linearly. If it is only rotating, then the only acceleration will be due to gravity, and you can determine the orientation based on gravity. But if it starts moving, then there will be more than just gravity involved, and it is impossible to tell which acceleration is because of gravity and which is not. That's why you need another sensor; one of them estimates the orientation over time, and the other one is used to provide a gravity reference to compensate for gyro drift and errors in the rotational velocity estimations.

Of course, the math that actually does this is beyond my level of understanding... :-)

Hello

##### Share on other sites

fine .. I want to calculate the yawing from the MPU6050 ... but it is drifting as it is known... so is there any code with Kalman filter that fixes this drifting if not I thought about flipping the sensor and consider my pitch or roll angle as the yaw as I have a code that makes Kalman filter but with only Pitch and Roll angles

You will find the mentioned code in the attachments and the .ino file at this directory

\Example-Sketch-for-IMU-including-Kalman-filter-master\Example-Sketch-for-IMU-including-Kalman-filter-master\IMU\MPU6050

Example-Sketch-for-IMU-including-Kalman-filter-master.rar

##### Share on other sites

Hello,

I am not sure that my data from the mpu6050 is correct. Could you please write what data you get if you do read the register 0x43 when the gyro is in rest.

Thanks a lot

Eric

##### Share on other sites

My second question is if It ist possible and how to read a single Bit of a Register.

Thanks

## Create an account

Register a new account