Some of the field effects can be compensated by way of calibrating the compass for a defined location in terms of magnetic interference. However, it is not always possible to compensate for time varying magnetic fields; for example, disturbances generated by the motion of magnetic metals, or unpredictable electrical current in a nearby power lines. Magnetic shielding can be used for large field disturbances from motors or audio speakers. The best way to reduce disturbances is distance. Also, never enclose the compass in a magnetically shielded metallic housing.
Compass Tilt Errors
Heading errors due to a tilt depend somewhat on geographic location. At the equator, tilt errors are less critical since the earth's field is strictly in the horizontal plane. This provides larger X and Y readings and little of the Z component correction near the magnetic poles, tilt errors are extremely important—since there is less X,Y field and more of the Z component. Tilt errors are also dependent on the heading.
Magnetic Field Distortions
Nearby Ferrous materials is another consideration for heading inaccuracy. Since heading is based on the direction of the earth's horizontal field a digital compass must be able to measure this field with lesser influence from other nearby magnetic sources or disturbances.
The amount of disturbance depends on the material content of the platform and connectors as well as ferrous objects moving nearby. When a ferrous object is placed in a uniform magnetic field it will create disturbances as shown in this figure. This object could be a steel bolt or bracket near the compass or an iron door latch close to the compass. The net result is a characteristic distortion, or anomaly to the earth’s magnetic field that is unique to the shape of the object.
Magnetic distortions can be categorized as two types—hard iron and soft iron effects. Hard iron distortions arise from permanent magnets and magnetized iron or steel on the compass platform. These distortions will remain constant and in a fixed location relative to the compass for all heading orientations. Hard iron effects add a constant magnitude field component along each axes of the sensor output.
This appears as a shift in the origin of the circle equal to the hard iron disturbance in the Xh and Yh axis
To compensate for hard iron distortion is usually done by rotating the compass and platform (your car) in a circle and measure enough points on the circle to determine this offset. Once found, the (X,Y) offset can be stored in memory and subtracted from every reading. The net result will be to eliminate the hard iron disturbance from the heading calculation.
The soft iron distortion arises from the interaction of the earth’s magnetic field and any magnetically soft material surrounding the compass. Like the hard iron materials, the soft metals also distort the earth’s magnetic field lines. The difference is the amount of distortion from the soft iron depends on the compass orientation.
What Is True North?
It is well known that the earth's magnetic poles and its axis of rotation are not at the same geographical location. They are about 11.5° rotation from each other. This creates a difference between the true north, or grid north, and the magnetic north, or direction a magnetic compass will point. Simply it is the angular difference between the magnetic and true north expressed as an Easterly or Westerly variation. This difference is defined as the variation angle and is dependent on the compass short duration, making a magnetic compass a useful navigation tool.
Each calibration method is associated with a specified physical movement of the compass platform in order to sample the magnetic space surrounding the compass. The Hard and Soft iron distortions will vary from location to location within the same platform. The compass has to be mounted permanently to its platform to get a valid calibration.
A particular calibration is only valid for that location of the compass. If the compass is re-oriented in the same location, then a new calibration is required. It is possible to use a compass without any calibration if the need is only for repeatability and not accuracy.