AHRS calibration and qualification

V. Kulikovskiy

Draft 0.3

Accelerometers calibration

Used accelerometer STM LIS3LV02DL in AHRS-Catania has an offsets spread [-90,90] mg for X,Y axis and [-110,110] mg for Z axis. For the horizontal DOM orientation such offsets bring up to 5 degrees error on pitch & roll definition if the calibration is not performed. Additional worsening of up to 3 degrees is expected for tilted DOM at 10 degrees. A simple asin(offset) formula can be used for this estimation.

Moreover, the gain for the accelerometers of this model may vary up to +-11%. This brings about 1 degree more uncertainty for the horizontally placed AHRS due to unknown Z accelerometer gain and 1 degree more for the unknown X and Y accelerometer gains for tilted AHRS at 10 degrees. In total til 10degrees worsening can be seen for uncalibrated AHRS during normal DOM operation in water.

Two approaches are proposed to calibrate the accelerometers.

Calibration with A vector parallel/antiparallel to axis

For Az accelerometer calibration, the board needs to be places horizontally and Az measured. The value corresponds to the A vector antiparallel to the Z axis. Supposing the measurement is done in the “g” units, so A=1:

Az-1= -Zscale +Zoffset

Then the board is rotated upside-down and the Az is measured again (Az1).

Az1= Zscale +Zoffset

  • The offset is calculated as:
    Zoffset = (Az1+ Az-1)/2
  • The scaling (gain) is calculated as:
    Zscale = (Az1-Az-1)/2

This method has an advantage that the error in the horizontal position definition (error on the zenith angle of the board) enters to the offset error approximately as a square for the single measurement:

Az1 = Zscale *cos(θ1) +Zoffset≈Zscale (1-θ12/2)+Zoffset

Az-1 = -Zscale *cos(θ-1) + Zoffset ≈-Zscale (1-θ-12/2)+Zoffset

Zoffset* = Zoffset+(Az1+ Az-1)/2 ≈Zoffset+ Zscale(θ12-θ-12)/4

For example, if the zeniths are controlled with 3 degrees precision, then in the worst case scenario the offset error is:

ΔZoffset = (1-cos(3o))/2 = 0.00069 g

If other offsets would be perfectly defined, then this offset at worst would bring asin(ΔZoffset)=0.04 degrees. If all offsets are calibrated with this procedure (6 measurements in total), then maximum error on pitch/roll for the DOM with pitch & roll 10 degrees at max would be 0.045 degrees (obtained with Toy MC simulation).

As it can be seen, this method allows both offsets and scale definition. The drawback of this method is non-linearity of the sensors. The used 3-axis accelerometer sensor STM LIS3LV02DL (AHRS-Catania) has non-linearity 2% Full Scale (+-2 g) for X/Y accelerometers and 3% FS for Z accelerometer. This should correspond to the measurement error of 0.02-0.04 g is the measurement is done at 0 g (for X/Y accelerometers in horizontal CLB/DOM orientation) but the calibration was performed using measurements at +-1 g. Such error corresponds to 2.3 degrees error at maximum for pitch/roll. As it can be seen this error is much bigger than the error due to offset measurement.

Calibration with the board placed horizontally

The board is placed horizontally with a precision of 1 degree. The offsets for X and Y accelerometers are measured.

Such calibration brings offsets to X and Y accelerometers that correspond to initial horizontal position precision if the the accelerometer gain is perfectly known. For example, if initial true pitch and roll during the horizontal positioning were 0.5 degrees and -0.5 degrees correspondingly, this shift will remain constant for measurements at small tilts. For example, for true pitch 10 degrees the calculated pitch will be 10.5 degrees, for true roll 10 degrees the calculated roll will be 9.5 degrees (checked with simulation). For bigger tilts this error even gets smaller.

If only one horizontal calibration is done, default offset and gain can be used for the Z accelerometer. In this case about 4 degrees additional worsening is expected at 10 degrees tilt.

This can be improved if board is placed upside-down and the offset for Z accelerometer and the scaling factors are calculated. With this additional calibration gain for X and Y magnetometers is not calibrated with this method which brings about 1.1 degree uncertainty on pitch and roll at tilts of 10 degrees. It is suggested to use 1.02 default gain for X and Y magnetometers. More precise value should come from the massive gain calibrations. The suggested value was obtained on small accelerometers batch test and it seems to correspond to 1/9.8… did the producer considered g=10m/s2?!

The gains for X and Y magnetometers can be calibrated with previously describedmethod while offsets should be taken from this method to obtain the best calibration of both gains and offsets. In this case increase of the error from the initial uncertainty is due to non-linearity only.

Calibration tests

Calibration with the following method was performed at LNS using AHRS on the CLB 2.385.

The obtained results are the following:

Axis / Offset (g) / Offset hor (g) / Gain
X / -0.0023 / 0.0064 / 1.0207
Y / 0.0003 / 0.0119 / 1.0252
Z / -0.0273 / -0.0273 / 1.0212

While placed horizontally the board was showing pitch 0.4 degrees and roll -1.1 degrees, which is inside the estimated error due to non-linearity.

To test better the non-linearity effectthe modulus of acceleration field vector Afull was calculated in different CLB orientations. With perfect calibration and linear responds, the vector should be always 1.

Pitch cal1 (deg) / Roll cal1 (deg) / Afull (cal 1) / Pitch cal2 (deg) / Roll cal2 (deg) / Afull (cal 2)
88.7 / -113.2 / 1.0003 / 89.5 / -170+-30 / 0.9928
-89.0 / 89.1 / 1.0001 / -87.9 / 89.6 / 1.0079
1.2 / -91.1 / 1.0008 / 1.6 / -91 / 0.9811
-1.1 / 89.7 / 1.0002 / -1.5 / 89.7 / 1.0198
1.0 / -179.8 / 1.0002 / 0.6 / 179.1 / 1.0002
0.2 / -1.1 / 1.0002 / -0.2 / 0.0 / 1.0000
12.0 / -19.7 / 1.0041 / 11.7 / -18.6 / 0.9964
14.6 / -49.7 / 1.0087 / 14.4 / -49.0 / 0.9925
-40.4 / -15.7 / 0.9895 / -40.9 / -14.5 / 0.9903
-29.6 / -17.8 / 0.9899 / -30.1 / -16.5 / 0.9885
-21.7 / 39.3 / 1.0002 / -21.8 / 40.2 / 1.0144

As it can be seen, the first calibration is tuned to give A close to 1 for the 6 calibration positions, while for the random tilt it may give an offset of ~0.01 (bold in the table) which can be ascribed due to non-linearity (<2% of FS). The second measurement performs similar with the worst seen offset of about 0.02 which is still can be ascribed due to non-linearity only.

It can be seen that for the horizontal measurement (set up with an external device with a precision better than 1 degree) pitch and roll with the first calibration have about 1 degree difference for roll (upside) or pitch (upside down), while for the second calibration the have pitch and roll almost 0 (upside) as it is tuned for this measurement and 0.6 deg for pitch and 0.9 deg for roll (upside down) which can be ascribed due to imperfection of the horizontal positioning plus offset calculation.

Calibration qualification

The proposed qualification of the pitch & roll may consist in tilt with rotation table from the GreenBox placed on one of its side vertically. In this case the rotation mechanism changes pitch instead of the yaw angle in its normal operation mode.

Pitch true / Roll true / CLB 385
6 pos
pitch / CLB 385
6 pos
roll / CLB 385
hor
pitch / CLB 385
hor
roll / CLB 385
no-cal
pitch / CLB 385
no-cal
roll
0 / 0 / 0.3 / -0.3 / 0.2 / -0.3 / 0.6 / -0.9
2 / 0 / 2.1 / -0.3 / 2.1 / -0.3 / 2.4 / -0.9
5 / 0 / 5.1 / -0.2 / 5.0 / -0.2 / 5.3 / -0.9
10 / 0 / 10.1 / -0.2 / 9.8 / -0.2 / 10.2 / -0.9
15 / 0 / 15.1 / -0.2 / 14.7 / -0.2 / 15 / -0.9
30 / 0 / 30.0 / -0.4 / 29.2 / -0.4 / 29.5 / -1.1
45 / 0 / 45.0 / -0.6 / 43.9 / -0.6 / 44.1 / -1.5
0 / 0 / 0.2 / -0.3 / 0.2 / -0.3 / 0.6 / -0.9
-2 / 0 / -1.8 / -0.3 / -1.7 / -0.3 / -1.4 / -0.9
-5 / 0 / -4.8 / -0.3 / -4.6 / -0.3 / -4.3 / -1.0
-10 / 0 / -9.7 / -0.3 / -9.4 / -0.3 / -9.1 / -1.0
-15 / 0 / -14.8 / -0.4 / -14.4 / -0.3 / -14.1 / -1.0
-30 / 0 / -29.9 / -0.7 / -29.1 / -0.6 / -28.8 / -1.4
-45 / 0 / -45 / -1.2 / -43.9 / -1.2 / -43.7 / -2.1
0 / 0 / 0.0 / -0.1 / 0.0 / -0.1 / 0.4 / -0.7
0 / 2 / 0.0 / 2.0 / 0.0 / 1.9 / 0.3 / 1.3
0 / 5 / 0.0 / 5.0 / 0.0 / 4.9 / 0.3 / 4.2
0 / 10 / -0.1 / 9.9 / -0.1 / 9.7 / 0.2 / 9.0
0 / 15 / -0.2 / 14.9 / -0.2 / 14.5 / 0.2 / 13.9
0 / 30 / -0.5 / 29.9 / -0.5 / 29.2 / -0.2 / 28.7
0 / 45 / -0.9 / 45.0 / -0.9 / 44.0 / -0.6 / 43.6
0 / 0 / 0.0 / -0.0 / 0.0 / 0 / 0.4 / -0.7
-2 / 0 / 0.1 / -2.0 / 0.1 / -2.0 / 0.4 / -2.6
-5 / 0 / 0.1 / -5.0 / 0.1 / -4.9 / 0.5 / -5.6
-10 / 0 / 0.2 / -10.1 / 0.2 / -9.8 / 0.5 / -10.5
-15 / 0 / 0.2 / -15.0 / 0.2 / -14.7 / 0.5 / -15.3
-30 / 0 / 0.2 / -30.0 / 0.1 / -29.3 / 0.5 / -29.9
-45 / 0 / 0.0 / -45.0 / 0.0 / -44 / 0.4 / -44.5

As it can be seen, calibration with 6 positions has <0.3 degrees error on pitch and roll that does not grow till 45 degrees tilt (X and Y offsets were estimated in horizontal position, the rest is calculated from the 6 position). Horizontal position set provides < 1 degree precision for this board till 15 degrees tilt. Instead, not calibrated board has ~1.5 degrees tilt error at 0 degrees tilt and ~2 degrees tilt error at 15 degrees. Other two boards tested shows similar performance for horizontal calibration and no calibration.

Conclusions

Initially proposed calibration (calibration 1) suffers non-linearity of the sensors chosen for AHRS-LNS. This calibration should be used if the non-linearity of the sensor is better than 2% percent (or asin(1o) on the scale from -1 to 1 g.

The calibration 2 provides offsets, which produce fixed systematic error equal to initial positioning with the external tiltmeter. About 1o precision can be reached with traditional level meters placed on the CLB board. Also as the CLB is placed upside-down in the DOM, this calibration should be done when the CLB is also placed upside-down.

To obtain gains of the accelerometers with the calibration 2, calibration 1 can be used. For the default gains at maximum 4 deg precision worsening at 10 degrees tilt can be expected on the large selection of the boards.

Magnetometers calibration

In AHRS-LNS 3-axis magnetometer HMC5843. Magnetometer offsets are spread from in the range [-0.12,012] G, tested on about 50 CLB boards and DOMs (in the datasheet the offsets are not available). Simulation shows that such offsets can bring up to 30 degrees error on the yaw angle calculation if not compensated.

Figure 1 Maximum expected error on yaw calculation in dependence from the error on the offsets of each magnetometer, obtained with simulation.

Several calibrations are proposed to calculate the offsets.

Calibration with a horizontal rotation (rotation table)

TO BE WRITTEN

Procedures

Horizontal calibration with a rotation table

0. Table should not deviate external magnetic field (wooden or plastic tables are suggested). Environment should have uniform field (place the table >2 meters from power supplies and other magnetic field generators).

1.1 Qualify the rotation table by placing level close to the center and doing full rotation. Air bubble should stay at 1 degree tilt at maximum.

1.2 Qualify the magnetic field. Calibrated phone with “Compass” app may be used. Place it half meter from the rotation axis and

2. Place the DOM horizontally on the table.

Be sure that the stand on which DOM stays has enough friction to not slide during the rotation (putch black rubber tape on both stands of the stand to make it stickier).

Adjust the horizontal position of the by looking on the pitch/roll of the AHRS using CLBSwissKnife until both of them are below 0.5 degrees.

3. Start dumping CLBSwissKnife binary file with a horizontal rotation:

CLBSwissKnife –m –f dom_<ID>_zdown_calibration.csk

Note the name structure, suggested to have similar filenames above different integration teams.

4. Rotate table with at least one full rotation in 2 minutes

5. Analyze calibration file and find fit values:

svn co GreenBoxAnalyzer

./make.sh

./process_calibration.sh dom_<ID>_zdown_calibration.csk

Check the circle quality by eye (no elliptical distortions, no weird featured due to external fields).

Save the last two lines of the output:

DOM 808467569 -0.0142357, -0.0141715

Xmax, Ymax, Xmin, Ymin: 0.0955497, 0.0956139, -0.124021, -0.123957

6. Write the magnetic offsets with AHRSCalibrator:

svn co CLBv2_Remote

compile it with

ant

run as

sh ahrscalib

or

chmod a+x ahrscalib

./ahrscalib

Copy/paste Xmax, Ymax, Xmin, Ymin from the fit to the window “Set MagOffset”, check the the checkbox on the left and press “Set” (be sure that everything else is unchecked or set to “Keep”).

Qualify thehorizontal calibration

1. Place the DOM horizontally on the rotation table (no precise horizontal position is needed for this operation). Aligh DOM X axis to North if possible.

2. Start dumping CLBSwissKnife:
CLBSwissKnife –m –f dom_<ID>_zdown_monitor.csk