Intertial Sensor is not Accurate

After calibration using the dashboard what do the roll and pitch angles show if the inertial sensor is on a flat surface ? If they are off by more than a couple of degrees then a factory cal of the accelerometers may improve that, but understand that the inertial sensor should be mounted so that it is level before doing this.

That may improve rotational accuracy, but generally those errors are due to the gyro internal scaling not accurately converting internal raw values to degrees. Many things can impact that, for example temperature of the inertial sensor. For the IQ Generation 2 and EXP brains we added an additional calibration for the gyro section of the IMU, we have not (as yet) added that to the V5 IMU firmware. IQ2/EXP is much easier to perform this calibration by turning 360 degrees as the brain is rectangular and can easily be placed against a reference surface, that’s much more difficult for the V5 inertial sensor. However, using external scaling in your code would achieve exactly the same result. If your IMU reads 357 degrees after a physical 360 degree rotation, just scale (ie. multiply) all the rotation and heading values by 360.0/357.0