В момента ресурсът е наличен само на английски

Calibrating the MPU9255 Pro Preview

Before we start using the sensor, we must calibrate it so that it will perform nominaly.

To access the full video please subscribe to FLLCasts.com


  • #883
  • 01 Apr 2019

Before you continue with calibration you must have successfully interfaced the IMU to the raspberry and you should have ssh connection to the raspberry.

To start the calibration process navigate to '/home/student/Perfect_Programs', you can do so by running the following command:

cd ~/Perfect_Programs/

After that the terminal should show:

student@raspberrypi:~/Perfect_Programs $

Now run the command


You should see the following output:

RTIMULibCal - using RTIMULib.ini
Settings file not found. Using defaults and creating settings file
Detected MPU9255 at standard address
Using fusion algorithm RTQF
min/max compass calibration not in use
Ellipsoid compass calibration not in use
Accel calibration not in use
MPU-9255 init complete

Options are: 

  m - calibrate magnetometer with min/max
  e - calibrate magnetometer with ellipsoid (do min/max first)
  a - calibrate accelerometers
  x - exit

Enter option: 

We would calibrate only the accelerometer for now. So type a. Next you will see the instructions for callibrating the Accelerometers.

Accelerometer Calibration
The code normally ignores readings until an axis has been enabled.
The idea is to orient the IMU near the current extrema (+x, -x, +y, -y, +z, -z)
and then enable the axis, moving the IMU very gently around to find the
extreme value. Now disable the axis again so that the IMU can be inverted.
When the IMU has been inverted, enable the axis again and find the extreme
point. Disable the axis again and press the space bar to move to the next
axis and repeat. The software will display the current axis and enable state.
Available options are:
  e - enable the current axis.
  d - disable the current axis.
  space bar - move to the next axis (x then y then z then x etc.
  r - reset the current axis (if enabled).
  s - save the data once all 6 extrema have been collected.
  x - abort and discard the data.

Press any key to start...

We must calibrate each of the 3 accelerometers (one for each axis). To do so you need to follow the instructions bellow. When said to move the IMU, try to move in the direction stated as fast as possible and try to change the direction as sharply as possible.

We will start with the X axis. Press any key, then e to enable the accelerometer and start moving the IMU sideways as shown bellow. Continue doing so, until the values stop changing (The min and max values shown should be have absolute value greater than 2). Then press d to disable the accelerometer and press Space to move to the Y axis. Press e to enable and move the IMU forward and backward. Once again, continue to do so, until the values stop changing. Once you are finished, press d to disable and proceed with the last axis. Press Space and then e to enable the accelerometer for the Z axis. Start moving the sensor up and down until the values stop changing. Then press d followed by s to save the calibration.