kriswiner / MPU9250

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

Have you measured latency (response time) of sensors? #307

Open MiloMindbender opened 6 years ago

MiloMindbender commented 6 years ago

Hi @kriswiner,

I setup my test robot with both a BNO055 and MPU 9250. The BNO is doing its sensor fusion internally, the 9250 is running the 6dof fusion algorithm on its internal Digital Motion Processor.

I am reading both sensors at 100hz (10ms) and graphing the roll output. The 9250 appears to lag 50-100ms behind the BNO055. Also every run seems to have a different amount of lag.

I measure this by rocking the robot back and forth and then measuring the time between peaks on the graphs from both sensors.

I didn't see anything about response time latency in your wiki pages comparing sensors. Have you ever measured this? I'm just trying to get an idea if what I am seeing is normal or if I've maybe done something wrong setting up the chips.

kriswiner commented 6 years ago

I don;t use the DMP, so no idea...

On Tue, Sep 11, 2018 at 4:20 PM MiloMindbender notifications@github.com wrote:

Hi @kriswiner https://github.com/kriswiner,

I setup my test robot with both a BNO055 and MPU 9250. The BNO is doing its sensor fusion internally, the 9250 is running the 6dof fusion algorithm on its internal Digital Motion Processor.

I am reading both sensors at 100hz (10ms) and graphing the roll output. The 9250 appears to lag 50-100ms behind the BNO055. Also every run seems to have a different amount of lag.

I measure this by rocking the robot back and forth and then measuring the time between peaks on the graphs from both sensors.

I didn't see anything about response time latency in your wiki pages comparing sensors. Have you ever measured this? I'm just trying to get an idea if what I am seeing is normal or if I've maybe done something wrong setting up the chips.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/307, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qjPn3l46UgNTTvhr1HRQhuJ82pA0ks5uaEU5gaJpZM4WkYpm .

MiloMindbender commented 6 years ago

When you tested different sensors with your usual methods did you see any difference in lag?

I will test raw data today, if you have any data, even for raw sensors, it helps me make sure I'm not messing up something.

Thanks!

kriswiner commented 6 years ago

We never tested for latency. But we use the MPU9250 for robot navigation (rolling and flying) so I don;t think we would be able to do this well with 100 ms latency. I suspect this is an artifact of the DMP, which heavily filters the 6 DoF sensor data to get euler angles, likely introducing the delay you are seeing.

Why not try the 6DoF or 9 DoF Madgwick filter and test latency there, it is likely to be much less of you run your sample rates at 1 kHz and use a fast enough MCU to get fusion rates at a few kHz.

On Wed, Sep 12, 2018 at 11:59 AM MiloMindbender notifications@github.com wrote:

When you tested different sensors with your usual methods did you see any difference in lag?

I will test raw data today, if you have any data, even for raw sensors, it helps me make sure I'm not messing up something.

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU9250/issues/307#issuecomment-420760726, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qrm51lxOsNE2P4LDflz_Ev42ve3Fks5uaVmZgaJpZM4WkYpm .

MiloMindbender commented 6 years ago

Thanks! I'm thinking the most likely cause of my problem is data getting delayed in the 9250 FIFO maybe due to incorrect configuration. Since the BNO055 doesn't have one, no delay.