Reputation: 355
So i am trying to get this new 6dof gyro and acceletomiter working, but i have tried everything, and it is not working. my final stop was the i2cdev library buy jeff, and it is even worse. I does not print normal caracters i get this(using his MPU6050_DMP6 example sketch on the uno)
ÛðÙT·DWá÷
and when i enter a letter this happens
ÛðÙT·DWá÷MÌÖkO`nþ
when i tried using his MPU6050_raw example this happens
ààüàààààü¨¬ ± -!-14¤¥5%µ$%¥¡0 ´¥Ç%µ!0 4¤!¡!%5´¥
and it keeps printing nonstop.
so i decided to try the examples from the arduino webside on the mpu6050 i wont put the code here since it is to long but here is a link to it (http://playground.arduino.cc/Main/MPU-6050 it is the last example down roughly 900 lines) here is what i got:
MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: -164, 4758, 17040
temperature: 30.865 degrees Celsius
gyro x,y,z : 343, 361, -143,
MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 16732, 746, -2242
temperature: 30.847 degrees Celsius
gyro x,y,z : 874, -131, -363,
MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 4510, -7420, 13774
temperature: 30.847 degrees Celsius
gyro x,y,z : 1822, 2928, 8526,
MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: -6016, -1678, -16304
temperature: 31.018 degrees Celsius
gyro x,y,z : 32767, -21928, -20069,
MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 3486, 10330, -5702
temperature: 30.894 degrees Celsius
gyro x,y,z : 32767, -31308, -15464,
MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 3308, -9292, 6200
temperature: 30.847 degrees Celsius
gyro x,y,z : 3166, -8144, 27748,
MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: -320, -13024, 11298
temperature: 30.776 degrees Celsius
gyro x,y,z : 376, 462, -143,
MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: -484, -13260, 10908
temperature: 30.771 degrees Celsius
gyro x,y,z : 342, 258, -319,
as you can see when i move it the numbers become incredibly huge(at least the temperature is right). so i then decided to give the other example roughly 40 lines long on the same page. and my out come was as strange:
AcX = -682 | AcY = 2178 | AcZ = 17698 | Tmp = 27.55 | GyX = 473 | GyY = 234 | GyZ = -219
AcX = -598 | AcY = 2224 | AcZ = 17580 | Tmp = 27.57 | GyX = 550 | GyY = -59 | GyZ = -680
AcX = -756 | AcY = 2196 | AcZ = 17680 | Tmp = 27.57 | GyX = 375 | GyY = 272 | GyZ = -164
AcX = 5578 | AcY = 13118 | AcZ = 13424 | Tmp = 27.57 | GyX = 32767 | GyY = -13348 | GyZ = -1000
AcX = 1846 | AcY = 14718 | AcZ = 7596 | Tmp = 27.55 | GyX = 875 | GyY = 362 | GyZ = -32
AcX = 2216 | AcY = 14504 | AcZ = 6930 | Tmp = 27.57 | GyX = 630 | GyY = 800 | GyZ = -1125
AcX = 2390 | AcY = 14968 | AcZ = 7338 | Tmp = 27.57 | GyX = 568 | GyY = 241 | GyZ = -92
AcX = 2338 | AcY = 14928 | AcZ = 7486 | Tmp = 27.54 | GyX = 561 | GyY = 158 | GyZ = -396
AcX = 2698 | AcY = 15038 | AcZ = 7466 | Tmp = 27.55 | GyX = 1231 | GyY = 341 | GyZ = -252
AcX = 7560 | AcY = 12958 | AcZ = 11980 | Tmp = 27.55 | GyX = -32768 | GyY = 19048 | GyZ = 7243
AcX = -106 | AcY = 876 | AcZ = 16868 | Tmp = 27.53 | GyX = 890 | GyY = -442 | GyZ = -1959
AcX = -114 | AcY = 1390 | AcZ = 17586 | Tmp = 27.55 | GyX = 1534 | GyY = -281 | GyZ = -665
it is the same issue as before i get really huge and odd numbers. i don't think this is deg/s nor deg/minute. can anyone assist?
Upvotes: 1
Views: 1526
Reputation: 3192
You might have Serial Monitor
's baud rate different to that of the coded one, check for that. If not there should be some issue in your code with the encoding.
The values you are getting as AcX = -682 | AcY = 2178 | AcZ = 17698 | Tmp = 27.55 | GyX = 473 | GyY = 234 | GyZ = -219
are not in standard metric units.
MPU-6050 features a user-programmable gyro full-scale range of ±250, ±500, ±1000,
and ±2000°/sec
(dps) and a user-programmable accelerometer full-scale range of ±2g, ±4g, ±8g, and ±16g
. This means if you set the sensitivity to ±2g full range of 16bit integer will used to store value of -2g
to +2g
.
There fore you may need to do some math simple as,
#define G_ 9.81
Az_metric = (AcZ * G_) / HALF_RANGE
Upvotes: 3