Ok, so after a bit of tinkering I changed these bits of code and managed even better numbers:
For the initial 'one-time' calibration:
To get a 3 decimal place offset:
And let that run for an hour (if I do it again, I'll leave it longer!), to get the final 3 numbers to plug into the sketch, so for me was:
So final numbers with the tracker stationary...
After 15 mins:
After 30 mins:
After 45 mins:
After 60 mins:
It looks like those gyro numbers drift up and down a fair amount over a longish period, so a longer calibration period (to get your three 'drift' compensation values) seems helpful.
Edit: just noticed I've still got it running, so the numbers after 2 full hours at rest:

Graph of gyro data drift (6.5 hours, time in minutes):
For the initial 'one-time' calibration:
Code:
int buffersize = 10000; //Originally 1000
int acel_deadzone = 8; // Any lower and it wouldn't complete calibration reliably
int giro_deadzone = 0; // Originally 1
To get a 3 decimal place offset:
Code:
Serial.print(dX/(float)driftSamples, 3 );
Serial.print("\t\t");
Serial.print(dY/(float)driftSamples, 3 );
Serial.print("\t\t");
Serial.println(dZ/(float)driftSamples, 3 );
Code:
float xDriftComp =-0.789;
float yDriftComp =-0.002;
float zDriftComp = 0.005;
After 15 mins:
Code:
[SIZE="1"]X/Y/Z -40.79 4.26 -8.26 -0.106 0.011 -0.025[/SIZE]
Code:
[SIZE="1"]X/Y/Z 51.19 3.44 -12.27 -0.017 0.006 -0.017[/SIZE]
Code:
[SIZE="1"]X/Y/Z 139.58 7.14 -18.26 0.017 0.005 -0.013[/SIZE]
Code:
[SIZE="1"]X/Y/Z 209.89 7.59 -20.59 0.032 0.004 -0.011[/SIZE]
Edit: just noticed I've still got it running, so the numbers after 2 full hours at rest:
Code:
[SIZE="1"]X/Y/Z 115.72 13.78 -41.86 0.004 0.003 -0.008[/SIZE]
Graph of gyro data drift (6.5 hours, time in minutes):
Last edited: