Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mahony AHRS implement in IMU example is wrong. #125

Open
Menginventor opened this issue Nov 19, 2020 · 3 comments
Open

Mahony AHRS implement in IMU example is wrong. #125

Menginventor opened this issue Nov 19, 2020 · 3 comments

Comments

@Menginventor
Copy link

In MahonyAHRS.cpp specify update frequency to 25Hz but the example use delay of 1000 ms.
So the algorith is wrong and this code is useless.

@geiseri
Copy link

geiseri commented Nov 22, 2020

Ignore their copy, it uses hardcoded and global variables that are for the most part wrong. Just use the https://x-io.co.uk/open-source-imu-and-ahrs-algorithms/ version and save yourself tons of heartache. You can replace their MPU6886::getAhrsData. Also, note that samples will be a bit off unless you can ensure that the average sample rate is in fact what you put in the Mahony::begin(...). In my case, I ended up getting the average time for the "loop" call for a few seconds and then using that for the sampling frequency. Sadly you will find the numbers are pretty much garbage though due to #124.

@Menginventor
Copy link
Author

Hmm what the product.... I really hope some bugfix from the source.

@geiseri
Copy link

geiseri commented Nov 25, 2020

Oh, these guys have sweet hardware, but their code is a trainwreck :) I am actually working on consolidating them all right now. The StickC is awesome for ESPHome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants