-
Notifications
You must be signed in to change notification settings - Fork 89
Question: mahony filter - how to ensure it runs 10-20 times before new readings? #56
Comments
Hi, there is no mechanism in this library to apply the same value to the filter over and over again. Does “iteration” mean applying the same value to a filter over and over again? I wondered that it means 10-20 iterations are required to converge to the correct value. If you have an information source, please let me know. |
Hi, I have read this multiple times in the Git issue discussions of Kris Winer - for example here kriswiner/MPU9250#420. or kriswiner/MPU9250#427 His code examples are not making this very explicit, he explained in some thread that by having a lower FIFO frequency the fusion filter automatically get's run multiple times (at least 5 times is apparently desirable) as there would be no interrupt and therefore no new readings wherefore the loop() essentially skips reading sensor value but instead runs the fusion filter one (mutliple) times with the old variables again. I believe my simplified code example above works but there might be a better way of doing it with your library. |
Oh really, I didn't know that. I'll add it as an option! But the default value is only one iteration. Because I think it's not so unstable as is. |
Add fixed iteration feature for filters #56
Added this feature in v0.4.6. Closing. mpu.setFilterIterations(10); |
Hello,
I adopted your library for a VR sensor project. What I understand from reading through Kris Winer's github and other sources is that the Filters should best run 10 to 20 iterations before new data is added.
I have not found out how to implement this with your library out of the box and therefore ended up introducing a do-while loop in update() to execute the filter 20 times.
Is there any other / better way of achieving this ?
Hardware:
Thanks
The text was updated successfully, but these errors were encountered: