11 Replies Latest reply on Oct 11, 2016 10:46 AM by joh9_1534041

    Madgwick IMU Filter: Define the Sample Rate / Freq. correctly

    joh9_1534041

      Hello,

         

      can someone explain me if Is it possible that the GyroRate and AccelerometerRate are larger than the updateIMU-Rate (i do not mean the readSensorData-Rate, this is equal to the updateIMU-Rate) or does the algorithm / code than not work?

         

      Thank you.

         

       

         

       

         

      General Implementation of the "Madgwick Open Source IMU algorithm" (http://x-io.co.uk/open-source-imu-and-ahrs-algorithms/)

         

      Pseudocode:

         

      1. Init IMU-Hardware () 

         

      - IMU Factory Reset

         

      - Set IMU-ACC/GYRO "LOW-PASS-FILTER" 

         

      - Set IMU-ACC/GYRO "Scale Range"

         

      - Set IMU-ACC/GYRO "Sample Rate"

         

      - Activate IMU-FIFO Buffer

         

      - Set/calibate IMU-ACC/GYRO "OffSet "

         

       

         

      2. While () //Limited to Madgwick() Sample Rate

         

      - get IMU Raw Data

         

      - calculate ACC-G-Values and GYRO-Rad/s-Values

         

      - MadgwickAHRSupdateIMU

         

      - calculate Angle

         

       

         

      Note: 

         

      -It is not strictly necessary for Accelerometer and Magnetometer measurements to be synchronised with Gyroscope measurements

         

      -You can find on Github (https://github.com/xioTechnologies/Fusion) the new "xioTechnologies-AHRS-Lib" from 8.10.2016.