When reading the MPU 6050 has accelerometer and gyro, I assumed it was linear acceleration, but now I second guess that. From this video https://www.youtube.com/watch?v=qmd6CVrlHOM it seems like they are using acceleration and gyro to make one rotation direction. I need to know what direction the mpu is moving, not just a rotational value. Is there a way to extract this information?
-
Please tell us more. Do you want to measure the acceleration and deacceleration in a direction, or the motion with a constant speed in a direction ?Jot– Jot2017年06月22日 17:04:29 +00:00Commented Jun 22, 2017 at 17:04
-
I am trying to find vertical velocity with mpu6050 but I failed. Did you find any benefical thing ? Thanks.Faruk Z.– Faruk Z.2020年08月27日 17:24:55 +00:00Commented Aug 27, 2020 at 17:24
2 Answers 2
The MPU6050 has an accelerometer and a rate gyro (which tells you how fast it is rotating). The accelerometer will tell you which direction is down and in a motionless situation, that is all the information you have.
You'll probably want something like the MPU9150, it has a compass, which will give you the directional information you're asking for.
-
A compass will not tell you direction of movement, only direction of (apparent) orientationChris Stratton– Chris Stratton2015年11月29日 08:41:13 +00:00Commented Nov 29, 2015 at 8:41
-
When you're motionless you're ok, no movement information to report :-) The bigger problem, I think, is that at a steady speed you also have 0 acceleration, but you are moving. A compass will tell you your heading, but that may or may not be your direction of movement. I think you're talking about building an INS (inertial navigation system), you'll need to be able to determine a starting state and then track changes (accelerations) from there. You may want a GPS.dlu– dlu2015年12月29日 09:54:33 +00:00Commented Dec 29, 2015 at 9:54
The MPU6050 has accelerometers in the x, y, and z axis. When placed on flat surface with no acceleration, you should get 0g (or whatever unit it uses, I cannot remember off the top of my head) in the x and Y directions, and 1g in the z axis. By continuously polling these values, you can find out the linear acceleration of each axis at a given moment in time.
What you saw is probably because the chip also has three Gyroscopes, for measuring rotational acceleration and speed. The chip can do both.