I2Cdevlib Forums

# Kuba

Members

13

• #### Days Won

1

Kuba had the most liked content!

3

1. ## velocity from acceleration

Your code is very strange. The easiest way to do the integration is this: float velocity = 0; float currAccel; float prevAccel = 0; unsigned long prevTime = millis(); unsigned long currTime; void loop() { //other stuff //refresh currAccel currTime = millis(); velocity += (currAccel + prevAccel)/2*(currTime - prevTime)/1000; //1000 added to get the same units prevAccel = currAccel; prevTime = currTime; } But this will give you a "drift problem". The results won't be even close to good. That are my results. Sensor was not moving during data integration. As you can see the velocity is growing despite the fact that MPU was stationary.
2. ## velocity from acceleration

Unfortunately you cannot do much about it. It is a well known issue. A quote from wikipedia http://en.wikipedia.org/wiki/Inertial_navigation_system: You can find also useful information in this talk: Especially parts starting at 18:40 (single integration) and 23:40 (double integration).
3. ## Modifying Example DMP Code To Also Print Acceleration Data

It seems ok and you are getting OUTPUT_READABLE_REALACCEL. You are doing almost the same that is done by this functions: Your code contains the same logic, but written in slightly different order (but if you look closely you will see the same multiplications, shift operations, subtractions etc). I just think that my suggestions would make the code much easier to read.
4. ## Modifying Example DMP Code To Also Print Acceleration Data

One of these two is exactly what you want, because it should return 0 values when MPU is stationary. The only difference should be axes: If MPU6050 is stationary then it will return 0 (almost 0) in all three axes. You just have to use the code from lines 324-352 (or copy/modify it). If you want to have the teapot example and these values you can modify the code like this: Now you should be able to use world acceleration data inside teapot demo. Just be careful because teapot array structure has been slightly modified.
5. ## Will library support BMP180?

I know that this is an old topic but just the information for the future generations. I was using the same board GY-87 with BMP180 and I was able to use BMP85 library without any changes. BMP180 and BMP85 have the same "software" (probably also all the registers are the same, but I wasn't comparing them so accurately). BMP180 is just a later version that is more accurate.
6. ## Modifying Example DMP Code To Also Print Acceleration Data

Hi, I think that you want to get exaclty the same thing that is implemented in the example file You have to uncomment one of this definitions: and you will get acceleration without gravity. Check lines 324-352 to see what is exaclty happening.
7. ## MPU-6050 and i2cdevlib "slide" for a while on turn on

Hi! Did you manage to solve the problem? I have exaclty the same problem with one of my MPU6050 (breakboard GY-87). It slides for about 6 seconds and after that the readings are constant. On the other hand my second MPU6050 on GY-521 is working fine from the very begining right after start up. I am using DMP.
8. ## Multiple MPU6050's using DMP and interrupts

Regarding your first question: I don't have DUE but this site: http://arduino.cc/en/Reference/attachInterrupt says that it should be possibe. So just use another pin and change this fragment of code: attachInterrupt(0, dmpDataReady, RISING); To be honest I didn't understand the second question.
9. ## Changing Range of accelerometer and Gyroscope

You should call this functions once: accelGyroMag.setFullScaleGyroRange(MPU9150_GYRO_FS_1000); accelGyroMag.setFullScaleAccelRange(MPU9150_ACCEL_FS_4); You can put them at the end of setup(). Check out MPU9150.cpp for detailed description and more useful functions. BTW This is MPU6050 topic, so this should be theoretically moved to MPU9150.
10. ## MPU-6050 DMP with magnetometer fusion

Hi, I know that there are some eamples showing how to put magnetometer data into DMP. For example this one: http://www.i2cdevlib.com/forums/topic/111-arduino-example-sketch-to-read-magnetometer-while-dmp-is-on/ but it does not make any sensor fusion. I couldn't find any library which would make magnetometer fusion inside DMP. Does such library exist? Maybe code in this file MPU6050_9Axis_MotionApps41.h make DMP+magnetometer fusion? I couldn't find any tips in the code and right now I am not able to test it. So the question is: does such library exist or the only way to do this is to make own fiters (for example complementary filter)? Maybe there is some MPU9150 library that can be used with MPU6050+magnetometer?

×