SensorFusion icon indicating copy to clipboard operation
SensorFusion copied to clipboard

How to calibrate the IMU?

Open shujaatak opened this issue 7 years ago • 7 comments

Can you mention how to calibrate the IMU please?

shujaatak avatar Jan 21 '19 11:01 shujaatak

Hi @shujaatak the IMU calibration is something that relies on the library you are using for the IMU not to the filter to get the data

This is an example of the calibration you could use for the MPU9250 with the library i use https://github.com/bolderflight/MPU9250/blob/master/README.md#calibration-functions

aster94 avatar Jan 21 '19 12:01 aster94

Hi, can you explain a little bit further how do you obtain the graphics for the filtered data. Are you using Processing? if so, which is the sketch?

Also, what is the output of the "Euler Data"? For example, is the YAW measured in angles?

lcipolina avatar Nov 26 '19 01:11 lcipolina

The function get*() returns angles, meanwhile the functions get*Radiant() returns radiants

Which graphics do you mean?

aster94 avatar Nov 26 '19 08:11 aster94

Hi, thanks for the reply. Several questions here if you don't mind...

  1. So I guess one has to run a magnetometer calibration function before running your script? As you suggested above. We should add this function at the beginning of the script:

int calibrateMag()

  1. For "graphics" I meant the video you posted. Did you just copy and pasted the code in the software "Processing" to see the object in 3D? or how do I reproduce your video?

Thank you so much!

PD> By the way, I am using your library with Wire, so I've changed these lines: const int mpuAddress = 0x68; //usually 0x68 or 0x69 MPU9250 IMU(Wire, mpuAddress); //#define SS_PIN PB12 //MPU9250 IMU(mySPI, SS_PIN);

lcipolina avatar Nov 26 '19 15:11 lcipolina

  1. the calibration should be run only once, and as i said before " is something that relies on the library you are using for the IMU"

  2. yes you can just copy and paste it into processing

aster94 avatar Nov 26 '19 21:11 aster94

ok, I just wanted to confirm that your script doesnt come with a calibration routine. I am new to Processing if you don't mind, I am getting an error when Processing tries to find these libraries, as it doesn't know where to look for.

How do I include them? thanks!

#include "MPU9250.h" #include "Streaming.h" #include "SensorFusion.h"

lcipolina avatar Nov 26 '19 21:11 lcipolina

you are trying to run the same code for the MCU to a computer, run the code in the extra folder, how it is explained in the readme

aster94 avatar Nov 26 '19 23:11 aster94