OpenLog Artemis IMU to Madgwick

Hi,

I would like to know if the IMU outputs are correct values for Madgwick’s algorithm.

The API I use is from here - https://github.com/xioTechnologies/Open … ickAHRS.cs

It expects the following data order - Update(float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz).

Do I just fill it with the values from the OpenLog or I need to consider some replacements for coordinates?

Thanks

Our advice is to check the output of the OpenLog, and if you need to re-order the par4ameters you can via the OpenLog’s config file(s)

Best of luck!

It looks like AHRS Update function is expecting the gyro readings in radians/sec:

https://github.com/xioTechnologies/Open … cs#L61-L68

You will need to convert the degrees/sec you get from the OLA into radians/sec. The OLA IMU units are defined here:

https://github.com/sparkfun/OpenLog_Art … -20948-IMU

Best wishes,

Paul

Hi thanks all to your answers. The radians is a good point, I will take a look.

I see now that the algorithm also expects accelerometer and magnetometer in calibrated units. Do you guys know if I need to do something special there - calibration, conversion for the values from the OpenLog?

It says “any calibrated units” so I’m guessing it will be fine with milli-g and micro-Tesla.

Good luck with your project,

Paul

Thank you :slight_smile:

I see now that the algorithm also expects accelerometer and magnetometer in calibrated units.

No, the actual units output by the magnetometer and accelerometer are irrelevant. Normalized vectors (magnitude = 1) are fine.

However, the filter algorithm will just output nonsense unless the magnetometer and accelerometer are calibrated properly, with axial offsets removed and relative scale factors normalized. You also need to ensure a right handed coordinate system and MOST IMPORTANTLY that the magnetometer X, Y and Z axes are swapped to agree with the accelerometer X, Y and Z axes (see below, from the IMU datasheet). Example at https://github.com/jremington/LSM9DS1-AHRS

See this calibration tutorial https://thecavepearlproject.org/2015/05 … r-arduino/

download/file.php?id=6496