MPU 6050 Sensor Problem

Hi everybody,

I have a question about MPU 6050.

I found a lib about sensor on internet which is I2Cdev lib.

I opened the example sketch file which gives raw values like ;

a/g: 216 -288 14724 -440 -16 256
a/g: 184 -308 14888 -439 -2 255
a/g: 368 -236 14688 -416 -18 266
a/g: 240 -148 14832 -421 6 251
a/g: 160 -248 14932 -418 -31 273
a/g: 212 -288 14724 -430 -21 262

I need gyro data as a position to ground.

How can I do that?

Thanks

I need gyro data as a position to ground.

What is this sentence supposed to mean ? Try again, and explain what you want to do with the sensor.

I want to find the angle position to ground reference on x and y axis. I will make a robot and use it as feedback for system.

Thanks

Hobby-type gyros measure rotation rate, not absolute angles, and they drif so you can't make absolute measurements of orientation angles with them. You need a magnetic compass and an accelerometer in addition to a gyro (i.e. an IMU) to determine model orientation.

Hi jremington,

what you offer me as an IMU? I mean can you give me an name and similiar example to my need.

Thanks

I suggest that you study the data sheet and application notes for your MPU 6050 and learn what it can do. It has an accelerometer, and an mpu that will give you relative orientations, but not absolute orientations.

I did read the data sheet of MPU 6050 and it doesn't explain the data outputs exactly and I couldn't understand what it explains.

Thanks

You have a lot of research to do, then. Here is one possible place to start: Arduino Playground - MPU-6050
There are some useful user comments and links on the Spark Fun product page, too: https://www.sparkfun.com/products/11028
Finally, there are lots of web pages on IMU and AHRS modules for hobbyists.

The MPU-6050 has an accelerometer and gyro.
It does not have a compass (for earth orientation), not a gps (location), not a baromic pressure sensor (height).

You can use a filter that uses both the accelerometer and gyro data to identify the angle of the robot.
http://forum.arduino.cc/index.php?topic=58048.0

I think that quaternations are used for the 3D orientation in the i2cdev library.
http://www.i2cdevlib.com/devices/mpu6050

htekin:
I want to find the angle position to ground reference on x and y axis. I will make a robot and use it as feedback for system.

OK well the gyro numbers are going to not tell you anything about the "angle position to ground". Assuming that your robot is not performing high-speed gymnastics, you determine the orientation of the device with respect to the ground by considering the readings from the accelerometer device.

And if your robot IS going to be performing high-speed gymnastics, then you need the accelerometer and gyroscope output and also a lot more expertise with the math involved.

htekin:
I did read the data sheet of MPU 6050 and it doesn't explain the data outputs exactly and I couldn't understand what it explains.

Thanks

a/g:   216   -288   14724   -440   -16   256

These six numbers represent one reading from the device.

The first three numbers are from the accelerometer, and the last three numbers are from the gyro.

The first three numbers represent the apparent acceleration of the device in the x,y and z directions. When the device is not actually accelerating, you will see an apparent acceleration in the upwards direction. That is because the effect of the gravitational force on the sensor causes a deflection of the sensor equivalent to the deflection that occurs when the device is subjected to actual acceleration. These three numbers can be considered as a vector which shows the direction of "up". The vector is with respect to an apparent coordinate frame attached to the device ( and usually indicated with a marking on the pcb surface, although many of them are wrong ).

In the case of the reading which you have, the vector is ( 216, -288, 14724 ), which is predominantly in the Z direction. So you probably had your device almost flat on the table.

Hello everyone.

I'm new to this.

From where should I download library for MPU-6050 and how do I insert/copy library for MPU-6050 to my arduino software?

Use the i2c_scanner to test the I2C bus wiring:
http://playground.arduino.cc/Main/I2cScanner

This is a start page:
http://playground.arduino.cc/Main/MPU-6050
But that sketch is just a small test for the sensor.

For serious work, use the i2cdevlib with the MPU-6050 library.
http://www.i2cdevlib.com/
http://www.i2cdevlib.com/devices/mpu6050

This is the page about adding a library:

For serious work, try to understand this guide. It is really important.
http://forum.arduino.cc/index.php?topic=58048.0