Go for more the merry Should be the same or close to it. One of the things Kris does is iterate on the filter 10 times before the next update. Since the Madgwick and Mahoney filters are iterative to get to a solution it makes it more stable. He goes fun bore of course on the sampling. Another thing to consider in the future.Shall I add the original Mahony filter in as MARG 2? I have a version from the Madgwick site, which is what Kris was using as well I believe.
Yep I agree just wanted to throw the thought out there while I remembered.Not thinking it's really needed for a multi-filter library, or it could be added later...
I stand corrected I just went back into the GitHub code and its not there anymore. Think I need to update my copy.Not clear on what you mean by Kris iterates the filter 10 times before the next update. Does he set dt = 0, and then just loops through the filter 10 times?
I used a butterworth filter on the IMU data on accel and magnetometer data - didn't do it on the gryo for some reason - have to go back and check again. Know ardupilot uses filtering on the gyro data for sure. So yes at some point it would probably be good to do.On the sampling side, I need to get into that deeper. I suspect there's a lot to be gained by doing some smoothing of the IMU data before filtering
Sounds good. It will definitely be a good thing to do instead of running each filter individually.I'll create us a "final" MPU9250_Filters (version 8) that will allow the user to select some number (maybe 3?) of filters and then compare them using TelemetryViewer. How's that sound?
I use GitHub all the time - have tons of my project repositories plus others I cloned. You'll like it when you get use to it. Great tool for collaboration and getting changes incorporated.I've also just set myself up a github account
I agree completely on this one. By the number of views I think others like it as well. A good learning experience. Always wanted get into Kalman, just didn't think I would be doing now.P.S. This thread has been especially interesting to me, have really learned a lot from y'all about software, timing, hardware, and algorithms!!!
I'm also looking forward to integrating in GPS soon, which I think Brian is investigating options right now. My vote would be to start with a simple loosely-coupled KF running after the AHRS. Then later moving to a more tightly-coupled where the AHRS and GPS processing done in a single EKF.
If we do the loosely-coupled, we could pretty much use any of these 7 AHRS filters I guess. I'm thinking that the GPS KF would bring in accel readings from the IMU (transformed into NED-inertial) for the propagation step and then we blend that with both GPS position and velocity (both in NED-inertial) for the update step. If the transformations are done ahead of the KF, then the KF is linear and not even an EKF. Not sophisticated, but simple enough to start with. Or we could jump right into a more tightly-coupled EKF to start with...
Any other thoughts out there on this? The only trick I see for the loosely-coupled KF is getting IMU accel (Brian puts them out in NED-body) into NED-inertial. I tried this using a simple direction cosine matrix (using PRY values from the AHRS), but wasn't getting it to work well. So either I'm missing a step or the IMU accel values need intensive smoothing, or both. Any ideas on this? How have others done this? Do we kick off another thread for GPS Integration?
P.S. This thread has been especially interesting to me, have really learned a lot from y'all about software, timing, hardware, and algorithms!!!