Jump to content
I2Cdevlib Forums

markalberti

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by markalberti

  1. Ok, so I now have reason to believe the setup I've working with has been faulty. I have more than one Arduino Pro Mini + MPU-6050 so here is new data that in my opinion is more trustworthy. MPU-6050 at baseline pointing straight (after waiting 10 seconds) quaternion_straight: 0.4355, 0.4761, 0.5391, 0.5412 MPU-6050 pointing 90 degrees downward (attitude/pitch =-90 degrees) quaternion_down: 0.4355, 0.4761, 0.5391, 0.5412 MPU-6050 pointing 90 degrees upward (attitude/pitch =+90 degrees) quaternion_up: 0.0142, 0.7282, 0.0013, 0.6852 MPU-6050 tilted 90 degrees right (banking/roll =+90 degrees) quaternion_right: -0.0285, 0.7866, 0.6168, 0.0032 MPU-6050 tilted -90 degrees left (banking/roll =-90 degrees) quaternion_left: 0.8310, 0.0016, -0.0294, 0.5554 Euler values using previous equation: MPU-6050 at baseline pointing straight (after waiting 10 seconds) euler_straight: 91.99, -2.62, 99.63 MPU-6050 pointing 90 degrees downward (attitude/pitch =-90 degrees) euler_down: -146.01, 88.20, -130.72 MPU-6050 pointing 90 degrees upward (attitude/pitch =+90 degrees) euler_up: 159.65, -86.28, 19.29 MPU-6050 tilted 90 degrees right (banking/roll =+90 degrees) euler_right: -177.65, -2.30, 76.16 MPU-6050 tilted -90 degrees left (banking/roll =-90 degrees) euler_left: -1.72, -2.90, 67.55 These above values do seem to correlate with the movements of the sensor described more so than in my previous post. Eg. φ pitch -2.62 -> 88.20 which is the 90 degrees angle I've been hoping to register. It will take me some time to figure out how and if I'm registering the banking/roll correctly. Comments and advice are still welcome. This updated dataset should, however, hopefully drive everyone a little less crazy than the numbers I sent previously.
  2. I was hoping someone in this forum could help me understand the quaternion data output from the MPU-6050 when using the MPU6050-DMP6 code by Jeff Rowberg. I'm working on a project that contiuously records 3D positioning. Previously I had been recording euler angles, however, I ran into problems with Gimbal lock. Now I've started recording quaternions to avoid Gimbal lock, but the math involved is a little beyond me at the moment. I'm having a hard time making sense of the quaternion values I get from the device and relating them to real world dimensions. I want to be able to tilt the device sensor 90 degrees and confirm in the device data that this was accurately recorded. Here is some recorded quaternion data using the Arduino Pro Mini 3.3V, 8MHz ATmega 328 board: MPU-6050 at baseline pointing straight (after waiting 10 seconds) quaternion_straight: .4337, .2398, -.4392, -.7495 MPU-6050 pointing 90 degrees downward (attitude/pitch =-90 degrees) quaternion_down: -.1815, .4730, -.1089, -.8553 MPU-6050 pointing 90 degrees upward (attitude/pitch =+90 degrees) quaternion_up: .8190, -.1508, -.4704, -.2919 MPU-6050 tilted 90 degrees right (banking/roll =+90 degrees)quaternion_right: .0665, .5426, -.8361, -.0451MPU-6050 tilted -90 degrees left (banking/roll =-90 degrees)quaternion_left: .5125, -.0204, -.0079, -.8584 In an attempt to make sense of the data I have tried to convert the quaternion values to euler angles by using the following formula (http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles): When I apply this formula I get euler values. As I believe the formula above gives me radian values all euler values below are already *(180/pi) to convert radian -> degrees. MPU-6050 at baseline pointing straight (after waiting 10 seconds) euler_straight: .60.04, -1.23, -120.61 MPU-6050 pointing 90 degrees downward (attitude/pitch =-90 degrees) euler_down: 1.58, 58.06, 156.92 MPU-6050 pointing 90 degrees upward (attitude/pitch =+90 degrees) euler_up: 3.087, -59.15, -40.98 MPU-6050 tilted 90 degrees right (banking/roll =+90 degrees) euler_right: 171.50, -3.57, -113.77 MPU-6050 tilted -90 degrees left (banking/roll =-90 degrees)euler_left: -0.42, -2.47, -118.31 The above values do not seem to correlate with the movements of the sensor described - e.g. the calculated euler values report movement in >1 dimensions (φ pitch -1.23 -> 58.06 and ψ roll -120.61 -> 156.92) In an attempt to calibrate the device to match up with real world dimensions I've tried: quaternion_straight*inverse(quaternion_straight)= 1, 0, 0, 0 quaternion_down*inverse(quaternion_straight)= 0.7236, 0.5427, -0.2764, -0.3254 euler conversion(quaternion_down*inverse(quaternion_straight))= 75.02, -2.68, -50.49 Once again 75.02, -2.68, -50.49 does not correspond to a 90 tilt in one direction/dimension. And I've also tried: euler_straight-euler_straight= 0, 0, 0 euler_down-euler_straight= -58.47, 59.30, 277.53 -58.47, 59.30, 277.53 does not correspond to a 90 tilt in one direction and does not match with the above mentioned 75.02, -2.68, -50.49 which I might have expected. As you might be able to see from what I have tried above, I have so far been unsuccessful in demonstrating that the device data is recorded accurately when I move the device 90 degrees in one direction. Do you have any suggestions of things to try and/or read up on? Does anyone see any obvious mistakes in my calculations above or how I'm approaching the problem? Let me know if my explanations above need further elaboration. I know everyone is very busy but any ideas or help would be greatly appreciated if you have time.
  3. Ok, so I figured it out. As many of you know Serial.print(1.23456) gives "1.23" and Serial.print(1.23456, 3) gives "1.234" which answers my question....
  4. Hi, First of all a thanks to Jeff Rowberg for putting in all the hard work to make this sensor more accessible. In an attempt to use the sensor output and avoid issues with gimbal lock I've been using the quaternion output from the MPU-6050_DMP6 code for my project. It seems however that the quaternion output with 2 significant digits is not as sensitive as the euler or ypr output. Is there anyone who has had success with changing the quaternion output to 3 or more significant digits?
×
×
  • Create New...