The compass has 4 components mounted on a rigid base:

- a small board featuring an ATmega128A microprocessor operating at 3.3V and 8 MHz
- a MicroMag 3-axis magnetometer
- an SCA3000 3-axis accelerometer
- an NCP1400-5V Step-Up board acting as a power supply to the SCA3000.

Four flexible wires connect the compass to a remote 3.3 V power supply, a remote serial-to-USB converter, and a remote momentary-contact button. This configuration corresponds to the intended installation on the boat.

In accelerometer calibration mode, when the button is pressed, 64 consecutive raw measurements are sent to the serial port. A remote laptop running Hyperterminal continually saves these measurements in a text file. The compass assembly is rotated step by step around X axis and measurements are taken after each small rotation. Then the procedure is repeated around Y axis.

The following figure illustrates the first set of measurements taken with this arrangement, as rendered in Google Sketchup.

The resulting text file is then processed by the Magneto software to find the calibration parameters.

The compass base is then placed completely horizontal, and a set of measurements (64 consecutive values) is taken at this position. The average of these 64 raw measurements is:

ar

_{x}= -93.7656 ar

_{y}= 61.56813 ar

_{z}= 1420.344

After applying the calibration correction,

we obtain:

aa

_{x}= -0.2244 aa

_{y}= 68.61544 aa

_{z}= 1332.229 (vector v1)

and the norm for these calibrated values is calculated at 1333.995, which is a comforting result.

These calibrated values describe the orientation of the accelerometer reference frame in the gravitational field.

From the calibrated values, the heel and pitch values are calculated at -2.95 deg (heel) and 0.010 deg (pitch). These angles reflect the orientation of the accelerometer vs the rigid base.

At this same horizontal position, we conclude that the orientation of the rigid base in the gravitational field is described as:

ab

_{x}= 0.0 ab

_{y}= 0.0 ab

_{z}= 1333.995 (vector v2)

From the values of vectors v1 and v2, it is now possible to calculate the rotation matrix that can be applied to any calibrated vector v1 (accelerometer orientation) to get the associated vector v2 (rigid base orientation) :

The technique to calculate a rotation matrix from 2 vectors is documented here.

We will need this rotation matrix later on for the tilt compensation corrections.

The next step is to apply the same calibration procedure to the magnetometer.

My cousin recommended this blog and she was totally right keep up the fantastic work!

ReplyDeleteCalibration

ReplyDeleteGreat post.Really informative.Once again me and my cousin watch this today.Hope to see more similar blog.