Jump to content
I2Cdevlib Forums

Leaderboard

Popular Content

Showing content with the highest reputation on 09/03/2015 in Posts

  1. Hi everyone, After searching in forums i found out that people have different values for the "setXGyroOffset/setYGyroOffset/setZGyroOffset/setZAccelOffset" functions. But i can't understand how i can find what values i need to use. Can somebody explain me how do i choose the parameters for those functions? Thanks in advance.
    1 point
  2. parag

    Stand Still readings

    Hello I'm using GY-80(ADXL345, L3G4200D, HMC5883L) module in my project. I have some queries for setting offsets. As the case in accelerometer when the device is kept stand still on a flat surface ,ideally it should read X : 0, Y : 0, Z : 980. Similarly what are the values I should get for Gyroscope and Magnetometer. Are X : 0, Y : 0, Z : 0 for Gyroscope and Magnetometer. ??
    1 point
  3. Hi, I just implemented the DMP portion of the i2c dev library in a piece of Software on my Beaglebone to use the DMP of the MPU6050. I am especially interestet in pitch and roll values. The issue I habe is that the values calculated via the function dmpGetYawPitchRoll() are not very stable. a slight movement results in overshots in pos/neg. directions. After a while of leaving the sensor static at the rached angle the value settles, but as soon as I move the sensor the values jump around again until I keep the sensor static and then they settle based on the actually reached position. I also tried to calculate pitch and roll (and yaw) from the quaternions directly, but with the same result. … pIMU->getFIFOBytes(fifoBuffer, packetSize); pIMU->dmpGetQuaternion(&q, fifoBuffer); pIMU->dmpGetGravity(&gravity, &q); // sensor based ypr pIMU->dmpGetYawPitchRoll(ypr, &q, &gravity); // ypr from quaternions qroll = atan2(2.0*(q.y*q.z + q.w*q.x), q.w*q.w – q.x*q.x – q.y*q.y + q.z*q.z); qpitch = -1.0 * asin(-2.0*(q.x*q.z – q.w*q.y)); qyaw = atan2(2.0*(q.x*q.y + q.w*q.z), q.w*q.w + q.x*q.x – q.y*q.y – q.z*q.z); … Whenever I move the sensor it is very very sensitive to changes (using both methods of pitch/roll calculation). When I e.g. move the sensor from horizontal postion slightly up to an angle of 45° pitch (3-4 seconds to reach the 45° angle) I get overshoots to +80° and -60°. After approx 2-3 seconds the value settles to the expected 45°. Previously I used the raw acc/gyro values provided via the (adapted) i2c library and applied either a kalman or complementary filter to get pitch and roll. I thought when using the DMP I get better values due to the IMU internal fusion of IMU data, but the raw-method looks still better (even that it does not yet satisfy me for the application I am working with, where I have a moving and acclerating object and want to measure pitch and roll independent of the object acceleration -> pitch/roll only based on gravity). Am I missing something in regard to the use of the DMP? I followed 1:1 the (6 axis-)demo in regard how to set up the IMU and how to read the FIFO. I do this in a 10ms loop in my software and have not envountered issues reading the FIFO data, but when I use the read data. The sampling rate of the DMP is set to 200/(1+9)Hz = 20Hz (DMP_FIFO_RATE = 9). I appreciate any feedback on this! Thanks a lot in advance! Maybe it is only a little piece that I am missing on my side ... Regards, Tom Attachement: Attached are logs using dmpGetYawPitchRoll() where I move the sensor 3 times from horizontal to 45°. first=slow second=faster third=fast I only used a value each second to print capture values for the graph (kind of "filter"), while in the background the 10ms task runs to retrieve FIFO data and continuosly calculating pintch and roll (it only reports an actually calculated value every second), pitch__roll.pdf
    1 point
  4. rbds

    Trouble Compiling

    I am trying to get the MPU6050 example to compile and I can't seem to do it. I am using Arduino 1.0.5 on a Windows computer. So far, I have confirmed that the I2Cdev and the MPU6050 libraries are located in C:/Program Files (x86)/Arduino/Libraries. I have included the helper_3dmath library at the top of the example sketch, but I still cannot get it to compile. There is a long list of errors, but below are a couple. This seems to be an issue with the libraries I have included. C:\Users\Randy\Documents\Arduino\libraries\MPU6050/helper_3dmath.h: In member function 'float Quaternion::getMagnitude()': C:\Users\Randy\Documents\Arduino\libraries\MPU6050/helper_3dmath.h:74: error: 'sqrt' was not declared in this scope .... and: C:\Users\Randy\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:596: error: 'class VectorInt16' has no member named 'x' C:\Users\Randy\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:597: error: 'class VectorInt16' has no member named 'y' Please let me know if I am missing something obvious or if you will need more information to help. Thanks.
    1 point
  5. Last day, I found a blog which cites that how magnetometers are used for the archaeological exploration. Is that true? Can anyone could give me a detailed account of it. I'm very much curious to know more about it.
    1 point
  6. Hi group, iam hoping someone can enlighten me regarding an issue iam having with my MPU6050 on by balancing robot. Ive tore the web apart pulled data sheets apart and also forums for an answer and done numerous tests but maybe iam missing something: in brief, the MPU module is fitted with the the Y axis facing the direction of travel, Below is a few lines of code used to fuse the accelerometer and gyro using the complimentary filter, for reference: Accel_result[0] is X axis Accel_result[1] is Y axis Accel_result[2] is Z axis Gyro_result[0] is X axis Gyro_result[1] is Y axis code: //GET PITCH AND ROLL CONVERTED TO DEGREES * 180/PI Pitch = atan2(Accel_result[0],Accel_result[2])*57.2957; Roll = atan2(Accel_result[1],Accel_result[2])*57.2957; //FUSE GYRO AND ACCELEROMETER USING COMP FILTER Angle_x = 0.97*(Angle_x +(Gyro_result[0]*0.01) +(0.03*Pitch)); Angle_y = 0.97*(Angle_y +(Gyro_result[1]*0.01) +(0.03*Roll)); Looking at the Pitch and Roll values on a terminal program and looking at it on a graphical program, when the bot it tilted forward, i get the Y angle value, when its tilted sideways i get the X angle, also Pitch and Roll shown are correct, so i know the sensor is functioning ok. Fusing it into the comp filter seems to be where iam baffled at its behaviour. Using the code as is above, the bot will stand up as planned but gradually leans over as the zero point changes. If i swap the Pitch and Roll round: Angle_x = 0.97*(Angle_x +(Gyro_result[0]*0.01) +(0.03*Roll)); Angle_y = 0.97*(Angle_y +(Gyro_result[1]*0.01) +(0.03*Pitch)); the bot functions as normal and stays vertical with no drift or leaning as it should. I was under the belief that X was the Pitch and Y was the Roll. Q) Why changing them round could this make a difference to the changing vertical zero point?? secondly, if i turn the module 90deg so the X axis is now facing forward and use Angle_y in the PID routine in place of Angle_x, the bot will not stand, even if switching the Pitch and Roll back as before, it behaves totally different but will never stand up. nothing i do will make the bot work with the module in this orientation, Q) Any ideas?? as the X axis is kind of defunc. Tried a second module but just the same Q) Again i was under the belief that the MPU6050 should be able to be used with either axis, but clearly something is not adding up, Anyone come accross this or have any idea why??? Am i missing something in regards to Pitch and Roll on gyroscopes? Extensive reading seems to prove nothing. Appologies its a long post but hoping that the more detail i can give, the better the hope some light may be shed on it. Many thanks John
    1 point
  7. Hello everybody, We should connect two mpu6050 to an Arduino mega but we don't know how to connect them physically. We know that we have to turn the i2c adress from 0x68 to 0x69 in order to have 2 different adress, one for each sensor. Someone says that it must connect them in parallel but other thinks that it is usefull to set two digital pins high or low to "swich on/off" a sensor in order to read information alternated. moreover we would like to read quarternion or euler data but now we are only able to receive raw data. May anyone help us? thanks
    1 point
×
×
  • Create New...