Calibration Tables

Code uses M5stick library built-in IMU.getAhrsData() function which is built on the Mahony algorithm. Note that the Yaw values seem to fluctuate significantly and are thus unreliable.

#include <M5StickC.h>

float accX = 0.0F;
float accY = 0.0F;
float accZ = 0.0F;

float gyroX = 0.0F;
float gyroY = 0.0F;
float gyroZ = 0.0F;

float pitch = 0.0F;
float roll  = 0.0F;
float yaw   = 0.0F;

void setup() {
  // put your setup code here, to run once:
  M5.begin();
  M5.IMU.Init();
  M5.Lcd.setRotation(1);
  M5.Lcd.fillScreen(BLACK);
  M5.Lcd.setTextSize(1);
  M5.Lcd.setCursor(40, 0);
  M5.Lcd.println("IMU TEST");
  M5.Lcd.setCursor(0, 10);
  M5.Lcd.println("  X       Y       Z");
  M5.Lcd.setCursor(0, 50);
  M5.Lcd.println("  Pitch   Roll    Yaw");

  Serial.begin(9600);
}

float temp = 0;
/*****************************************
M5.IMU.getGyroData(&gyroX,&gyroY,&gyroZ);
M5.IMU.getAccelData(&accX,&accY,&accZ);
M5.IMU.getAhrsData(&pitch,&roll,&yaw);
M5.IMU.getTempData(&temp);
*****************************************/
void loop() {
  // put your main code here, to run repeatedly:
  M5.IMU.getGyroData(&gyroX,&gyroY,&gyroZ);
  M5.IMU.getAccelData(&accX,&accY,&accZ);
  M5.IMU.getAhrsData(&pitch,&roll,&yaw);
  M5.IMU.getTempData(&temp);
  
  M5.Lcd.setCursor(0, 20);
  M5.Lcd.printf("%6.2f  %6.2f  %6.2f      ", gyroX, gyroY, gyroZ);
  M5.Lcd.setCursor(140, 20);
  M5.Lcd.print("o/s");
  M5.Lcd.setCursor(0, 30);
  M5.Lcd.printf(" %5.2f   %5.2f   %5.2f   ", accX, accY, accZ);
  M5.Lcd.setCursor(140, 30);
  M5.Lcd.print("G");
  M5.Lcd.setCursor(0, 60);
  M5.Lcd.printf(" %5.2f   %5.2f   %5.2f   ", pitch, roll, yaw);

  M5.Lcd.setCursor(0, 70);
  M5.Lcd.printf("Temperature : %.2f C", temp);

  // Plotting
  Serial.print("pitch:");
  Serial.print(pitch);
  Serial.print(",");
  Serial.print("roll:");
  Serial.print(roll);
  Serial.print(",");
  Serial.print("yaw:");
  Serial.println(yaw);
  
  delay(100);
}

Screen Up

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/bdd28ed1-6ed7-4c7c-b34b-9cfc2bf72a39/Untitled.png

Pitch: ~-5

Roll: ~10

Yaw: unstable - steadily increased from ~25 - 60 over the course of several minutes

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/6f074cc4-61a9-4fd8-bda3-176706f246dc/Untitled.png

Tilt Right

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/310a0bcd-e5f4-46d5-b70d-cbf51d13c37a/IMG_20200501_1230072.jpg

Pitch: 75

Roll: 19

Yaw: Unsteady - jumps from ~-200 to ~175 randomly

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1d631b03-ff9c-4333-a566-3828d66ced87/Untitled.png

Tilt Left

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b618bb2d-c50a-4df2-9133-4b4c86b9a6f8/IMG_20200501_1236372.jpg

Pitch: ~-85

Roll: 150

Yaw: unsteady

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/fcce912c-5f11-48e6-bac3-32e8100e668d/Untitled.png

Logo Up

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c34a7e42-f305-4fb0-b1ab-bd512af3e01f/IMG_20200501_124357.jpg

Pitch: 0

Roll: 100

Yaw: Unstable

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/92936ff3-1ceb-4cf4-93cf-baa6dce971a6/Untitled.png

Logo Down

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8ba24e16-527d-43ae-8e86-5150475dc7d9/IMG_20200501_124926.jpg

Pitch: 0

Roll: -80

Yaw: unstable

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/87391580-97d3-4d93-b5f2-a6b4c64b3660/Untitled.png

Face Left

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/859c4eb5-e3b2-4458-be7e-21e4d730289f/IMG_20200501_1252082.jpg

Pitch: 0

Roll: -80

Yaw: unsteady

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/647aef8d-07f6-46d7-8380-407cba9d93bc/Untitled.png

Face Right

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/9d9b1afe-8cfc-46ee-ad17-c9f904ef366a/IMG_20200501_1258332.jpg

Pitch: 0

Roll: -80

Yaw: Unsteady

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ed43af4f-0f5f-4f52-b1a4-1034d6f030a1/Untitled.png