**Q: **

Do you have any further insights on how to observe and correct for hard and soft iron behaviors?

------------------------------------------------------------------------------------------------------------------------------------------

**A:**

The first version of the "Hard & Soft Iron Correction for Magnetometer Measurements" post offered some insights on how one might approach developing their own correction process. Since posting this, we have received a great deal of feedback and have updated a few things that might be helpful and also are working on a weakness that was identified during this process (more on that below).

Here are the three things that we have done, in order to offer additional help for those who are looking to develop their own hard/soft iron correction approaches:

- Updated the Hard and Soft Iron Computation Spreadsheet (
) to a format that is more suitable for copying data directly into it. In other words, all "simulation inputs" have been removed and the area for copying data to is more clearly marked.**Magnetometer_HardandSoftIron_CalculationSpreadsheet.xlsx** - Automated the register value computation, based on the correction matrix calculations.
- Tested this method in a number of scenarios with an ADIS16480 to validate the final register values
- Identified a weakness in the soft-iron correction formulas, which happens when the x and y scale factors are very close to each other.
- Offer a short-term approach for managing this weakness.

**The Method**

- Start with the ADIS16488 (or ADIS16480) in an orientation where the x-axis magnetometer reading will be at its maximum and the y-axis reading will be equal to zero, when all errors have been removed.
- Measure x-axis and y-axis magnetometer outputs at this position.
- Rotation the platform in a counter-clockwise direction, by 10 degrees.
- Measure x-axis and y-axis magnetometer outputs at this position.
- Repeat steps 2 and 3 through the 350 degree rotation point.
- Copy the data at all 36 angles, into Cells C16:D52 in the "2 Dimensional Model" sheet, located in the
file (see attachment).**Magnetometer_HardandSoftIron_CalculationSpreadsheet.xlsx** - Observe the 2x2 soft iron correction matrix in cells O12:P13
- Observe the hard iron correction factors in Q12:Q13
- Observed the "compensated" and "uncompensated" graphs in the spreadsheet
- Write the register values from the "Register_Worksheet" sheet from the same file into the device's registers to apply the correction factors.

**The Examples**

The second file attachment (* FAQ-HardSoftIron_UseExamples.xls*) contains some trial runs of this calibration process. In this file, each sheet corresponds to a specific run of x-y data.

**Initial** = Calibrated ADIS16480 magnetometer outputs

**Mag Field** = Magnet was placed in close proximity of the ADIS16480

**Mag Field Comp** = Post-compensation of the response, with the magnetic still in the same location

**Metal Blade** = A metal saw blade was placed in close proximity to the ADIS16480

**Metal Blade Comp** = Post-compensation response, with the saw blade still in place.

**The Videos**

The following three videos show the X-Y rotational sweep for the three conditions described in the * FAQ-HardSoftIron_UseExamples.xls* file.

**Initial Sweep**

**Magnetic Field Error (Notice the hand-clipped magnet attached the the disk-shaped PCB)**

**Metal Blade Error (Notice the thin saw blade resting on top of the ADIS16480) **

**The Weakness**

When the x-axis and y-axis scale factors are very close to each other, the eigenvalue calculation method is prone to introducing angle errors. We are in the process of experimenting with some more automated approaches to this issue, but for now, overcoming this will require an additional correction matrix. For starters, one can observe this error by using compensated and uncompensated x,y values at a particular measurement point.

After identifying the skew angle, one can develop a 2x2 correction matrix for removing it.

EQUATION EXAMPLE COMING SOON.

NOTE: While waiting for this example, please see the following link:

http://en.wikipedia.org/wiki/Rotation_matrix#In_two_dimensions

Hello

I use ADIS16488 and I want to use correction factor at the magnetometer output.

In this topic, I have some questions in calculating the correction factors.

1. I should rotate the sensor in a counter-clockwise direction. But in the video, the platform is rotating in clockwise direction. In addition, when measuring the magnetometer's output, the sin and cosine curve are shown in clockwise direction. Could you tell me which direction is correct?

2. In the attached spread sheet "HardSoftIron Examples", I copied the "Mag field" data into the "Magnetometer_HardandSoftIron_calculation spread sheet". As a result, I got Hard X,Y and Soft Iron correction factors.

But, S12 and S21 correction factor in "Magnetometer_HardandSoftIron_calculation spread sheet" is differ from the one written in "HardSoftIron Examples". Could you tell me how to calculate S12 and S21 accurately?

As a calculation result in the "Magnetometer_HardandSoftIron_calculation spread sheet", S12 is ED17 and S21 is 1361, but in the "HardSoftIron Examples", S12 is 12E9 and S21 is EC9F.