kriswiner / MPU9250

Arduino sketches for MPU9250 9DoF with AHRS sensor fusion
1.03k stars 472 forks source link

Sensor read rate vs. filter update rate #81

Open frdfsnlght opened 7 years ago

frdfsnlght commented 7 years ago

In the sample code, MPU9250BasicAHRS_t3.ino, it appears the sensor is read about 200 times a second, but the filter is updated on every loop, or about 10-15 times as fast. Those extra filter updates are just reusing the sensor data previous read. Is that correct? What's the idea/advantage of updating the filter more often than the sensor is being read? I'm wondering if I can cut down on the filter update rate to save some cycles for other things the MCU needs to be doing. What am I sacrificing if I do that?

kriswiner commented 7 years ago

The mag calibration motion is to allow as much of the 2-pi solid angle response surface to be sampled as possible in the time allotted for mag calibration.

The Madgwick or Mahony filters are iterative so you want to iterate 4 - 6 times for each data sample to converge.

-----Original Message----- From: Tab Bennedum [mailto:notifications@github.com] Sent: October 24, 2016 10:53 AM To: kriswiner/MPU-9250 Subject: [kriswiner/MPU-9250] Sensor read rate vs. filter update rate (#81)

In the sample code, MPU9250BasicAHRS_t3.ino, it appears the sensor is read about 200 times a second, but the filter is updated on every loop, or about 10-15 times as fast. Those extra filter updates are just reusing the sensor data previous read. Is that correct? What's the idea/advantage of updating the filter more often than the sensor is being read? I'm wondering if I can cut down on the filter update rate to save some cycles for other things the MCU needs to be doing. What am I sacrificing if I do that?

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU-9250/issues/81 , or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qpjJFwZqUQhSSt57qiAkC hXUXfxNks5q3PBggaJpZM4KfFnD . https://github.com/notifications/beacon/AGY1qvaBbFVxCCavtfnrkz2bj38_-Hi6ks5 q3PBggaJpZM4KfFnD.gif