Notifications
Clear all

LED level with SEEED XIAO SAMD21 and MPU6050

6 Posts
3 Users
0 Likes
360 Views
(@duster180)
Member
Joined: 1 year ago
Posts: 4
Topic starter  

   
Quote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

I'll take a WAG at your problem.  The gyroscope behaves pretty different from most sensors in that it has a lot of drift issues. 

It might be instructive if you if print out more intermediate values... say... the output from the initialization and for every loop.  You will fill up the print buffer, but it might be instructive to see the initial trends.  

You also might add your full program (the above is not complete).  I might have a MPU6050 want to try to see the problem on my equipment.  I don't have the SEEED, but I don't think this is an MPU or even an MPU6050 issue.

I don't know if this thread will be of help, but it might highlight some of the issues with gyros.

https://forum.dronebotworkshop.com/sensors-modules/inertial-navigation-system-ins-gyros-accelerometers-magnetometers/  

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
(@duster180)
Member
Joined: 1 year ago
Posts: 4
Topic starter  

Thanks for the reply! I will take a look at the other forum as well. As for the code, that is all I have and it is what I am running. I am not sure what you mean by incomplete. This is the first code I have ever modified/written ever so I am probably missing something for sure...


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

Posted by: @duster180

Thanks for the reply! I will take a look at the other forum as well. As for the code, that is all I have and it is what I am running. I am not sure what you mean by incomplete. This is the first code I have ever modified/written ever so I am probably missing something for sure...

It simply didn't have the end brace and I didn't look at the entire code closely enough to determine if it was complete.  Just assumed you abbreviated what you supplied us.  Before diving into all that other thread, I'd get some more output of the setup() and every loop() instead of after 1000 iterations.  Again... it'll probably blow up the serial output, but, you might find something helpful, pointing you to the problem.  I'm guessing that it's overflowing the float... that what NaN typically means.  It's rare since a float is 3.4E+/-38. 

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@duster180 When you see Not A Number, the most common cause is caused by mixing float and int. If you have to have int variables, then cast them to the correct float size. The easiest way to track this down is to print each step of the calculations.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@duster180)
Member
Joined: 1 year ago
Posts: 4
Topic starter  

Thanks everyone for helping! I was able to change the math around a bit and monitor each individual read out and track down the issues...Now I just need to get my solid model printed up and should be good to go.

 

Thanks again for the help!


   
ReplyQuote