MEMS Accelerometer Calibration using Gauss Newton Method

version (481 KB) by Balaji Kumar
Computes the Scale factor Matrix and the bias vector of a MEMS accelerometer


Updated Tue, 07 Apr 2015 13:55:01 +0000

View License

All you have to do is to place the accelerometer in 9 different static positions and record the x, y & z values.
The procedure exploits the fact that, in static conditions, the modulus of the accelerometer output vector matches that of the gravity acceleration. The calibration model incorporates the bias and scale factor for each axis and the cross-axis symmetrical
factors. The parameters are computed through Gauss-Newton nonlinear optimization.

The mathematical model used is A = M(V - B)
where M and B are scale factor matrix and bias vector respectively.
M = [ Mxx Mxy Mxz; Myx Myy Myz; Mzx Mzy Mzz ];
where Mxy = Myx; Myz = Mzy; Mxz = Mzx;
B = [ Bx; By; Bz ];
The diagonal elements of M represent the scale factors along the three axes, whereas the other elements of M are called cross-axis
factors. These terms allow describing both the axes’ misalignment and the crosstalk effect between different channels caused
by the sensor electronics. In an ideal world, M = 1; B = 0

The following files are provided in the package.

1. CalibAccel.m --> M-file to calculate the accelerometer sensor bias and scale factor.

2. data.txt --> Real test data

3. NunchuckDat.xls --> Data from a WII Nunchuck accelerometer. Shows you how to convert from bits to G values.

Please check my other related files here:

My LinkedIn page:

Cite As

Balaji Kumar (2022). MEMS Accelerometer Calibration using Gauss Newton Method (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!