__figure 1__.) As the magnetic strip passes the Hall sensors, they switch in response to the changing magnetic field, producing a square wave output that indicates the number of magnetic poles that have passed. If the width of the magnetic poles is known, this square wave indicates the distance the magnetic strip has been displaced. To determine the direction of motion, a second Hall switch can be placed half a pole length from the first so that it produces the same output signal but phase shifted by 90° electrically. This phase shift can be used to determine the direction of movement by evaluating which signal has a rising edge while the other signal is low – commonly known as a quadrature signal. In

__figure 1__, a movement of the magnetic strip from left to right would generate a rising edge on signal A, while signal B is low. Moving the strip from right to left would generate a rising edge on signal B while signal A is low. Looking at each quadrature signal (A and B) separately, the achievable resolution is one pulse per cycle, or one pulse per pole pair on the magnetic strip. This is referred to as a 1x quadrature signal. By applying an XOR function (A=B=0, A<>B = 1) to the combination of signals A and B, the number of pulses per cycle can be doubled, which is known as 2x decoding. A further increase of resolution can be achieved by generating a pulse from both rising and falling edges of each signal, which produces four pulses per cycle and is known as 4x decoding. Although 2x and 4x decoding can be used to produce more pulses per pole pair, resolution is still limited by the length of these pole pairs – in practice approximately 0.5mm. Overcoming the limitation in resolution imposed by the physical nature of magnetic pole strips requires the use of an interpolation technique. This technique benefits from the application of advanced analogue engineering techniques, whereas the basic magnetic sensor described above is limited by the digital nature of its output. An interpolated magnetic sensor uses linear Hall sensors instead of Hall switches. Linear Hall sensors provide an analogue output proportional to the strength of the magnetic field perpendicular to the Hall sensor. Sliding a multipole magnetic strip over a linear Hall sensor generates a sinusoidal signal at the output of the sensor, as opposed to the square wave generated by a Hall switch. By placing four Hall sensors exactly half a pole length apart, four sinusoidal signals are generated as the magnetic strip slides over the sensors. Each signal is phase shifted by 90° from its neighbouring sensor, as shown in

__figure 2__. In mathematical terms, the four signals generated (H1, H2, H3 and H4) represent sine, cosine, inverted sine and inverted cosine. Combining sine with inverted sine, and cosine with inverted cosine, provides another sine and cosine signal of double amplitude. This combination requires one input signal to be inverted, which therefore inverts interference from external magnetic fields. Any common mode interference is therefore cancelled out when sine and inverted sine are combined, and when cosine and inverted cosine are combined. This prevents extraneous magnetic fields in the vicinity of the sensor from degrading its output. The two resulting signals can then be used as inputs for a signal processor (consisting of an a/d converter and a dsp), which can convert sine and cosine signals to a high resolution digital angle and magnitude output.

**Interpolation in practice**A major advantage of using Hall sensors with interpolators is that they can be combined on a single silicon chip using standard cmos processing methods. Perhaps the most important feature of such devices is their ability to digitise and process at very high resolution the precise analogue output from Hall sensors. Devices in austriamicrosystems' family of linear and rotary magnetic encoders use a CORDIC (coordinate to rotation digital computer) to achieve high performance processing of the position signal. First, the differential sine and cosine signals are digitised by high resolution a/d converters. The CORDIC converts two dimensional coordinates from one format to another. The input format is a rectangular coordinate system in which sine and cosine represent the X and Y axis respectively. The output format is a polar coordinate system with phase and magnitude outputs. Using the sine and cosine inputs from the Hall sensors as shown in figure 2, the output phase information produced by the CORDIC represents a proportion of one pole pair length with a value of between 0 and 360°. Depending on the resolution of the CORDIC, one 360° phase can be broken into multiple steps. The number of steps CORDIC can resolve is called the interpolation factor. Since one phase corresponds to one pole pair length, breaking the phase into multiple steps generates high resolution motion detection. As an example, the interpolation factor shown in figure 2 is 48 steps within one pole pair. In practice, much higher interpolation factors can be achieved. For instance, the AS5306 from austriamicrosystems achieves an interpolation factor of 160 steps per pole pair. Based on 40 pulses per pole pair, with a pole length of 1.2mm, this device offers a resolution of 15µm: resolution = pole pair length/interpolation factor = 2.4mm/160 = 15µm

**Conclusion**While the interpolation technique described above is complex, its implementation – such as in the AS5036 – integrates the analogue electronics and signal processing, giving the system designer simple digital outputs which can be interfaced directly to a microcontroller. As a result, the design engineer can now use a robust, contactless motion sensor which is immune to dirt and other contaminants, and which achieves very high resolutions.