arrow left BLOG

High rate IMU on Raspberry Pi with Navio

Hey guys!

We made a small demo of IMU with NAVIO to show real-time performance of the platform.  The algorithm is Mahony quaternion based. The sensor is MPU9150 connected over I2C.

The IMU runs well over thousand of Hertz and takes around 20 percent of CPU. When running on typical for autopilots 200Hz update rate the load falls down to 4-5%, and when pumped up to 3000Hz takes almost 50%.

Raspberry Pi is able to perform other tasks while running an IMU, in the video we demonstrate that such heavy tasks as compilation do not affect the rate of the real-time IMU. Also, there’s a PWM controller working simultaneously on the same bus, which can be seen by the LED changing colors.

In the final version of Navio we are using MPU9250 that is connected over SPI and can be polled at the full gyro update rate.

8 thoughts on “High rate IMU on Raspberry Pi with Navio

  1. Does it need to rebuild kernel to support RT to do this demo?

  2. EMLID says:

    Thank you. It is better to run this demo with RT kernel. We will release a compiled kernel.

  3. tejonbiker says:

    Good work, can you share the code used in the vídeo?, I have some troubles to get 1 ksps from mpu6050

      1. tejonbiker says:

        Thank you very much, I will try your modified kernel and see if I can get the 8 ksps (but I think I can’t disable the DLPF, so 1 ksps will be enough), I’m using the I2C port at 400 kHz, I can get close to 1 ksps, I don’t know if I can’t get the 1 ksps due to the I2C bottle neck or the CPU consumption.

  4. Nycholas says:

    Hey, very nice!

    I’m a master student at State University of Campinas (Brazil)

    I would like to connect 10 MPU-9250 over SPI using Raspberry Pi.

    How can I use the NAVIO library (github) to do my project?
    Is it possible?

    Please, send me a e-mail: nyckmaia@gmail.com

    Thank you very much,
    Nyck

    1. Hi Nyck,
      the MPU9250 code should work if you set the correct chipselect (spidev0.0 or spidev0.1) in MPU9250 driver according to your connection.

Leave a Reply

Your email address will not be published. Required fields are marked *