Gyroscope

Calibration Algorithm

Later in this tutorial, we will see how the Gyroscope can be calibrated based upon the Extended Kalman Filter (EKF). However, a basic calibration algorithm that can bring about decent gyroscope readings is easily summarized below:

$$ b^{-}_{g_x} = \frac{1}{N} \sum_{i=1}^{N}\left( g_{x_i} \right) \qquad b^{-}_{g_y} = \frac{1}{N} \sum_{i=1}^{N}\left( g_{y_i} \right) \qquad b^{-}_{g_z} = \frac{1}{N} \sum_{i=1}^{N}\left( g_{z_i} \right) $$

$$ g_{cal_x} = g_{meas_x} - b^{-}_{g_x} \qquad g_{cal_y} = g_{meas_y} - b^{-}_{g_y} \qquad g_{cal_z} = g_{meas_z} - b^{-}_{g_z} $$

Where $g_{cal}$ are the calibrated values of the gyroscope, and $g_{meas}$ are the raw sensor values from the gyroscope.