robocre8
AboutContactSocial
  • robocre8
  • About
  • Contact
  • Social
  • DOCUMENTATIONS
    • MoboBot Documentation
    • EPMC Documentation
    • EIMU Documentation
  • EIMU TUTORIALS
    • How To Calibrate And Setup The EIMU
    • How To Use EIMU With ROS2
    • How To Use EIMU With Arduino
  • EPMC TUTORIALS
    • How To Setup DC Motor PID Speed Control With The EPMC
  • How To Use the EPMC With ROS2
  • How To Use EPMC With Arduino
  • TUTORIALS
    • How To Install ROS2 Humble Desktop On PC (FULL INSTALL)
    • How To Install ROS2 Humble Base On Raspberry Pi 4B (FULL INSTALL)
Powered by GitBook
On this page
  • Prerequisite
  • 1. Start The Application and Reset Parameters (if necessary)
  • 2. Calibrate The Magnetometer Sensor
  • 3. Calibrate The Gyroscope Sensor
  • 4. Calibrate Accelerometer Sensor
  • 5. Visualize Orientation, Change Filter Gain, and Reference Frame (as Necessary)
  • 6. Compute the Orientation, Gyroscope, and Accelerometer Sensor Variances
  • 7. Set I2C Address (If neccessary)
  • Reference
  1. EIMU TUTORIALS

How To Calibrate And Setup The EIMU

Learn how to calibrate the Easy IMU (EIMU) and setup its madgwick filter via its GUI Application

PreviousEIMU DocumentationNextHow To Use EIMU With ROS2

Last updated 2 months ago

The Easy IMU (EIMU) is an easy-to-use open-source advanced IMU compute system for the MPU9250 IMU, with configurable and ready-to-use orientation readings.

It has a GUI application that allows one to easily calibrate and setup its Madgwick filter. It also has libraries for easy interfacing with your preferred project (whether ROS2, Arduino, Python, or Cpp robotics projects).

It can easily be used by hobbyists, students, learners, researchers, etc.

But before you can use it in your preferred project, calibration and some filter setup needs to be done.

This tutorial aims to teach you how to calibrate and setup the EIMU so you can start using it in your preferred project.

Here are the steps we would be following to setup and calibrate the EIMU Module:

  1. Start The Application And Reset Parameters (if necessary)

  2. Calibrate The Magnetometer Sensor

  3. Calibrate The Gyroscope Sensor

  4. Calibrate The Accelerometer Sensor

  5. Visualize Orientation, Change Filter Gain, and Reference Frame (as Necessary)

  6. Compute the Orientation, Gyroscope, and Accelerometer Sensor Variances

  7. Set I2C Address (If neccessary)

Prerequisite

  • Ensure your PC is capable of communicating with Arduino boards - specifically Arduino Nano -(both code upload and serial communication) as the EIMU Module uses a super-mini arduino nano microcontroller.

  • Ensure to have the EIMU Module and a USB Cable for serial communication.

  • Download the EIMU Setup Application executable here and extract it.

NOTE: if you don't find the application for your operating system, you'll need to run the eimu setup application python code via a python virtual environment. check the github repo for that here (Windows, Linux [Ubuntu], and MacOS)

NOTE:

  • Please do not run on a micro-computer (e.g. Raspberry Pi), only a PC

1. Start The Application and Reset Parameters (if necessary)

  • Start the application

NOTE (For Linux-Ubuntu Users) you may need to add executable permission to the downloaded application. (see image below) preferably, start the start the application from terminal using - ./eimu_app_ubuntu_<OS Version>

  • Once you start the application and connect to the EIMU module to your PC, you will see a page that allows you to choose the USB port, select the right port, and click connect. Wait for about 10 seconds (you should see a green-blue LED sequence on the EIMU during this time) and you should have a successful connect dialog appear, click ok to continue. If not, refresh and try again to ensure you select the right port.

NOTE:

facing any issues, contact

  • You should now see a menu on the left-hand side. If you’re setting up for the first time, reset all parameters by selecting the RESET PARAMS menu option and clicking the RESET ALL PARAMS button to start the setup process with a clean slate. Once the reset is completed, close the application, disconnect and reconnect the EIMU Module, and start the application again.

  • Once that is done, let’s get into the real deal – calibrating, testing visualization, and computing covariances.

2. Calibrate The Magnetometer Sensor

  • This is the first step in the calibration process and the only calibration process that requires you to move and rotate the EIMU Module.

  • Select the CALIBRATE MAG menu and click the START button. You should see a Matplotlib plot appear plotting points of different colors – red, blue, and green. Start rotating the IMU (or the container – e.g. robot – on which the IMU is mounted) slowly about the different (x, y, z) axis and see the plot update of the uncalibrated magnetometer data. Continue doing this until you see something like three balls not aligned with each other.

  • After this, click on the plot and the plot will be paused (please do not close the plot). On the terminal, you would see some values printed out which are the calibration parameters for the magnetometer. These values are automatically saved to the microcontroller on the EIMU module (but you can copy the values somewhere else – e.g. a text editor – for reference or report purposes).

  • Then click on the plot again and it will begin to plot the calibrated magnetometer data. Rotate the EIMU Module about the different axis again and you should see three balls forming which are aligned with each other.

NOTE:

If you do not see three balls forming or you see any of them forming a line (and not a ball or circle), you will have to repeat the magnetometer calibration process.

  • With this, I say congratulations because the magnetometer has successfully been calibrated. You can now close the plot (not the app).

3. Calibrate The Gyroscope Sensor

  • Calibrating the gyroscope is very easy. Firstly, ensure the IMU is stationary – i.e. not being moved or disturbed – on a flat surface (If the IMU is mounted on a robot for example, just place the robot on a flat surface – e.g. on the floor, or on a flat table).

  • Now select the CALIBRATE GYR menu and click the START button. You should see progress bar, wait until it is finished.

  • Once it is completed, you should see a Matplotlib graph showing the uncalibrated and calibrated gyroscope data. Also, the calibration offset parameters would be printed on the terminal.

    Remember that the gyroscope calibration offset values are automatically saved on the microcontroller on the EIMU module (but you can copy the values somewhere else – e.g. a text editor – for reference or report purposes).

  • With this, I say congratulations because the gyroscope has successfully been calibrated. You can now close the plot (not the app).

4. Calibrate Accelerometer Sensor

  • Calibrating the accelerometer is also easy. Just follow the same steps as the gyroscope calibration above.

  • You just need to select the CALIBRATE ACC menu and click the START button.

    Don’t forget to ensure the IMU is stationary – i.e. not being moved or disturbed – on a flat surface (If the IMU is mounted on a robot for example, place the robot on a flat surface – e.g. on the floor, or on a flat table).

  • With this, I say congratulations because the accelerometer has successfully been calibrated. You can now close the plot (not the app).

5. Visualize Orientation, Change Filter Gain, and Reference Frame (as Necessary)

  • You need to do this step before going to the computing variances steps.

  • Select the VIZUALIZE RPY menu. You should now see a page with option for changing Filter Gain and Reference Frame. Also, you'll the Roll, Pitch, and Yaw values displayed.

  • Click the VIZUALIZE IMU button, you should see a Matplotlib plot appear showing the IMU visual

  • Rotate the IMU (or your robot if it is mounted on it) and see the IMU visual transforms. Check if you are okay with the orientation convergence and noise. If you are not okay with it, adjust the Filter Gain value till you are satisfied.

NOTE:

A higher gain value leads to faster convergence and more noise while a lower gain value leads to slower convergence but smoother signal.

  • The default gain value (1.0) is generally okay for most applications but feel free to adjust as you see fit for your application.

  • Change the reference frame based on your application.

NOTE on Reference Frame Selection:

  • Use ENU frame if you are working on a ground robot (e.g mobile robot). This is Also the accepted frame for ROS2 development

  • Use NED frame for drones/aircrafts

  • Use NWU frame in place of the ENU frame if you like. it is also good for ground robots.

  • Once you are done, you can close the plot.

6. Compute the Orientation, Gyroscope, and Accelerometer Sensor Variances

The variences are the sensor noise in the orientation, gyroscope, and accelerometer readings. This is important when using the EIMU with sensor fusion algorithms like EKF.

  • First, ensure the IMU is stationary – i.e. not being moved or disturbed – on a flat surface (If the IMU is mounted on a robot for example, place the robot on a flat surface – e.g. on the floor, or on a flat table).

  • Select any of the RPY VARIANCE, GYR VARIANCE, and ACC VARIANCE menu button and click the START button. You should see the progress bar, wait until it is finished.

  • Once it is completed, you should see variance values printed on the terminal.

    Remember that these variance values are automatically saved on the microcontroller on the EIMU Module (but you can copy the values somewhere else – e.g. a text editor – for reference or report purposes).

  • Do this for computing the orientation (RPY), rate (GYR), and acceleration (ACC) variance.

7. Set I2C Address (If neccessary)

  • You can also set its i2c address for communication with Arduino microcontrollers.

  • Select the I2C SETUP menu and set your preferred address value (between 1 – 127). The default address value is 104 (i.e. 0x68).

Reference

  • Magnetometer Calibration with the Ellipsoid Fit Algorithm – Tesla Labs

  • 2D Graph Magnetometer visualization – Adafruit

  • Gyroscope Calibration with Jupyter – Adafruit

  • Reading Data From MPU9250 IMU – Bolder Flight

  • IMU Data Visualization with Vpython – Paul McWhorter

  • IMU Madgwick Filter Algorithm – CCNYRoboticsLab [Here’s a link to the Arduino Library I created from it – imu_madgwick_filter]