IMU Calibration Calculations – Introduction
So, now that all data is recorded, it’s time to calculate the calibration values for your. Reserve some time for it, it’s going to take some. A lot of screen captures are included in this guide. In the following guides we will perform the calculations on the calibration data.
Two methods will be outlined:
 Simplified dynamic calibration without temp compensation (simpler)
 Full static and dynamic calibration with temperature compensation (harder)
The simplified Dynamic calibration only requires a single dynamic file combined with a short calculation run to get GYO and ACC bias and scales. This is then combined with the omboard compass calibration. The whole procedure can be completed in under 1 hour.
The full procedure requires use of both static and dynamic logfiles, takes longer and is more succeptible to errors. But done right, it yields a very well calibrated and fully temperature compensated IMU. Doing the full procedure can take up to a full day.
Prerequisites

A decent and recent computer, the faster, with multiple cores, the better.

An installed AutoQuad ground control station.

Time! The calculations take everything they can from the computer but may still take 46 hours or longer to complete. But in most cases the calcs can be run in a few hours on a Quadcore PC.

The log files from the static and dynamic calibrations.
Calibration Software
The calibration software consists of two programs, Cal and Sim3. They are included in the QGroundControl AQ widget with a simple interface to choose the files and execute the calculations.
Cal program
The cal program is baically calculating 3rd order polynomials to describe the Temp vs Bias curves for each sensor and axis. This is expressed as bias params for the gyo, acc and mag sensors.
SIm3 program
The Sim3 program effectively tries to converge on a solution for scale and biases by adding random noise to the dataset and testing randomly selected time steps in a random order. There is actually no perfect solution possible, but instead an almost infinite number of good solutions for which it tries to get close to. Each run will be influenced by the random nature and approach the best solutions from a different “angle”.
If let run long enough, both programs should usually converge to an acceptable solution. Recent updates to both Cal and Sim3 means that solutions should converge much faster than in earlier versions.
How do I determine how calculations are proceeding?
Cal and Sim3 has 2 main indicators on how the calculations are proceeding:
MAE – Median Absolute Error
The main quality of the calculated params is expressed as Median Absolute Error – MAE.
MAE is not an absolute value that can be compared from board to board. MAE is purely a tool to see if the calibrations are proceeding as expected. What you are looking for is not a specific value, but instead you are looking for a nice steady drop of MAE as the calculations proceed. MAEs that jump up and down or make very big drops can be a sign of bad data.
AVG – Sensor magnitude averages
During CAL step the sensor magnitude average (AVG) for ACC and MAG sensors is displayed to help you judge if the calculations converged properly and to help you judge data quality.
Deciding when to stop calculation
For steps 1 and 2 (Rate and Acc), the program will finish on its own and produce a result. This usually happens inside a few minutes depending on data quality and the speed of the PC used to run calculations. If it doesnt stop there is a problem with your dataset or params.
For the 3rd step (cal – mag) the user has to abort the calculations based on MAE and AVG readings. More about this in the relevant section.
For the later Sim3 runs, there is a bit more to look out for, and the runtimes are longer (many hours) for each run. The Sim3 simulation will run until you stop it, so you need to look out for a few things in the beginning of each run and make adjustments if needed and keep an eye on the MAE as it runs. When the MAE is not dropping significantly on each loop it is time to move on to the next step.
Data quality and CPU speed matters
Ultimately the quality of the final solution depends highly on the quality of the logfiles you created and how much CPU time you can throw at it.
Step 1: Prepare & Run the calculations
Step 2: Upload the calcuations to the AutoQuad flightcontroller.