Timeline for Help with MPU-6050
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 4, 2016 at 16:51 | comment | added | Jesse | used atan2 which takes 2 args. Thanks. Nice learning from you. | |
Sep 4, 2016 at 16:37 | comment | added | Teja Allani | @Jesse Just updated it | |
Sep 4, 2016 at 16:36 | history | edited | Teja Allani | CC BY-SA 3.0 |
deleted 30 characters in body
|
Sep 4, 2016 at 16:24 | comment | added | Jesse | Hmmm, interesting to know that. My test on your original code showed (-45, 45). Have you updated your code? | |
Sep 4, 2016 at 16:17 | comment | added | Teja Allani | After testing this with my project I found out that this program is only helpful for roll and pitch < 90 degrees. So I decided to use Jeff Rowberg's library. After going through code, I found out that it was only way to get perfect values out of sensor. | |
Sep 4, 2016 at 14:41 | comment | added | Jesse | Thanks for the feedback. I did check that atan() takes one argument and the angle can be between [-90,90], leading me to think that some improvements are needed. Anyway, you got most of it in one sleepless night is quite impressive. Best wishes. | |
Sep 4, 2016 at 14:33 | vote | accept | Teja Allani | ||
Sep 4, 2016 at 14:32 | comment | added | Teja Allani | and for that angles use atan2() instead of atan() to change the limits of the angles. This code still needs some improvement because I found that when roll or pitch cross 90 degrees they seemed to effect each other( I can't explain this phenomenon clearly test it out after replacing atan() with atan2() ) maybe its because the values of Ax and Ay become negative after crossing 90 degrees and this sudden change from +ve to -ve and effects filter. _Also try changing gain value and observe results _ | |
Sep 4, 2016 at 14:32 | comment | added | Teja Allani | Hello :) @Jesse , The 2nd MPUread() because the first couple of readings are not stable it takes some time for MPU to give stable results, for this same reason I put i>100 in the loop so 1st 100 readings are not used for calibration. | |
Sep 3, 2016 at 11:40 | comment | added | Jesse | Further, it seems that the code yields angles that are limited to (-45, 45). Where do I need to change for angle computation extended to (-90, 90)? | |
Sep 3, 2016 at 4:05 | comment | added | Jesse | Hi, Teja Allani, Thanks for sharing the code. It works. One issue puzzles me though, in the offset subroutine, the code takes the 2nd MPUread() for the initialization. Is there any reason for doing so? I did some tests by marking the 2nd MPUread out and my tests do reveal different results. | |
Sep 2, 2016 at 14:44 | history | answered | Teja Allani | CC BY-SA 3.0 |