Skip to content

IMU Sensor Model Instructions

David Hanley edited this page Sep 29, 2017 · 20 revisions

Introduction

This work was initially completed because it is desirable to properly model the stochastic nature of the sensors in an inertial measurement unit (or IMU). This is done by using data from an IMU (sitting stationary for several hours) to generate Allan variance and power spectral density plots. From these plots we can extract information that is used by our model to replicate the Allan variance and power spectral density of the data. That model can then be used in simulation (either in Matlab or in C++). The sections below walk you through how to do this. Our simulation also has the ability to include certain types of deterministic-based errors (in particular a scale factor and fixed bias).

Creating Allan Variance Plots and Power Spectral Densities from Data

To generate an Allan variance plot with data collected at a roughly fixed frequency, simply use the allan.m function in the Matlab Data Analysis Tools folder. Then simply input the entire set of measurements, the frequency at which the data was collected, and the number of discrete points desired on the Allan variance plot. To plot simply generate a log-log plot of the time window and square of the standard deviation output. See the example below and the first few lines of main.m under the Matlab Example folder.

[T,sigma] = allan(meas,fs,pts);

figure(1)
loglog(T,sigma.^2)
xlabel('Time Window, \tau (sec)')
ylabel('Allan Variance')
grid on;

To generate a one-sided power spectral density plot with data collected at a roughly fixed frequency, simply use the computePowerSpectralDensities.m function in the Matlab Data Analysis Tools folder. The simply input the entire set of measurements and the frequency at which the data was collected. To plot simply generate a log-log plot of the frequency and power spectral density output. See the example below and the first few lines of main.m under the Matlab Example folder.

[Pxx,f] = computePowerSpectralDensities( meas,fs );

figure(1)
loglog(f,Pxx)
xlabel('Frequency (Hz)')
ylabel('Power')
title('PSD Plot')
grid on;

Creating a model from Allan Deviation and Power Spectral Density Plots

The Allan deviation plot provides quite a bit of information about the stochastic noise of a sensor. Those contributors to the noise in the sensor and their manifestation on the Allan deviation plot are shown in the figure below [1]. Our model considers only the angle random walk, bias instability, and rate random walk.

Ultimately, we say that:

                     noise = Angle Random Walk + Bias Instability + Rate Random Walk.

The descriptions of each of these terms are described in [2] and coefficients are ultimately taken from both power spectral density and Allan variance plots as can be seen below. See the example main.m under the Matlab Example folder for a description of how to find the appropriate coefficients given a set of data. A practice set of data (Data002.mat) is provided in the Matlab Example folder.

Kalibr IMU Model now available

In the Matlab and C++ Stochastic IMU model, we also include a file SensorStocModel_Kalibr.m (and a corresponding option in our C++ SensorModel class), which contains a much simpler IMU model used in the ETH Zurich ASL Kalibr package (https://github.com/ethz-asl/kalibr/wiki). This model considers only the IMU sampling rate, angle (velocity) random walk, and the rate random walk of an IMU.

Simulating the model

Given the appropriate set of coefficients, the sensor model can be run using either the C++ class, SensorModel, or the Matlab functions SensorStocModel.m and SensorDetModel.m. For the Matlab case, an example is provided in the main.m file in the Matlab Example folder. For the C++ case, an example is provided in the SensorModel folder.

A Note on Deterministic Error Sources

Our C++ class and Matlab function both account for two types of deterministic errors: scale factor and turn-on bias. See [3] for more details on deterministic IMU sensor errors.

References

[1] H. Hou. "Modeling Inertial Sensors Errors Using Allan Variance." M.S. Thesis. Department of Geomatics Engineering. University of Calgary. Calgary, AB. 2004.

[2] P. Petkov and T. Slavov. "Stochastic Modeling of MEMS Inertial Sensors." Cybernetics and Information Technologies. Vol. 10. No. 2. pp. 31-40. 2010.

[3] D. H. Titterton and J. L. Weston. Strapdown Inertial Navigation Technology. Institution of Engineering and Technology. 2nd Edition. 2004.