Optical high-precision position sensing is often too expensive for simple applications. This particularly applies to setups with several measurement axes, necessary in automatic seat adjustment in cars or flow control of heating systems, which have separate regulators for different rooms, for example.
For applications such as these, integrated magnetic encoders based on Hall sensors are a viable alternative. They are non-contact, not sensitive to dirt, and permit operating temperatures which range from -40 to +125C. Just one integrated Hall sensor and a permanent magnet are needed per axis.
The principle of measurement for magnetic encoders is based on magnetic field measurement of a diametrically magnetized permanent magnet which is placed vertical to the IC (see figure below). The operating distance between the magnet and IC can be up to 3 mm. The four Hall sensors evaluate the gradient of the magnetic field so that with an ensuing amplification via two differential amplifiers the direction components of the magnetic field gradient are available as a sine and cosine signal. By connecting up three configuration inputs these analog values can either be output direct or in digital form via an analog/digital converter.
Four Hall-effect sensors at the corners of the IC (bottom) provide sine/cosine signals to determine rotating magnet position.
Besides the sine and cosine signals, which are kept at a constant amplitude, the IC also provides digital signals in the form of incremental pulses and ABZ quadrature signals with resolutions of 6, 7 and 8 bits per revolution. A further option is to generate sawtooth and delta signals which have a period of 360 by converting these digital signals back to analog. In this way the sensor can act as a substitute potentiometer as angles of rotation are converted to signal changes which are proportional to the angle.
By way of example, the figure below gives the configuration of the I/O ports for a periodic delta output signal (triangle). The amplitude of the output voltage can be set using reference voltage REFH at port B, with the actual triangle voltage VTRI occurring at port A. Output MSB at port C enables a distinction to be made between rising and falling delta edges so that voltage values, symmetrical up to an angle of 180, can be differentiated between.
Configuration of the Hall sensor (ic-MA) as a linear sensor
View A Full Size Image
For applications with several axes the magnetic encoder can be cascaded without the need for any additional components. Using just four shared lines, several measurement channels can be connected up to a microcomputer with digital I/O ports and an 8"10-bit A/D converter. Below is the block diagram for a triple axis application. The Hall sensor's (iC-MA's) 28 modes of operation can be set using three configuration inputs (CFG 1"3) with tri-level logic (high, low, and open).
View A Full Size Image
EEPROM function programming is thus avoided and the IC can be housed in a DFN10 package with external dimensions of just 4x4 mm. The switched mode of operation is accepted when the relevant iC-MA is activated via the NEN input.
The example circuit illustrated above (CFG1: open, CFG2: ground, CFG3: VDD) configures the as yet featureless I/O ports A, B, C, and D of each iC-MA in such a way that two ports (B = CLK, D = NENO) are used to control the cascade with the other two, A and C, responsible for the output of the axis signals (sine, cosine).
The CLK (clock) signal is generated either by the microcontroller via a preset timer port output or by software.
An iC-MA is activated by a positive CLK edge and a low at the NEN input. One readout cycle has two clock phases. During the first, iC-MA(1) provides a sine signal PSIN(1) at the A output and a cosine signal PCOS(1) at the C output. During the next clock phase, inverted sine and cosine signals NSIN(1) und NCOS(1) are output. At the end of the readout cycle, iC-MA(1) generates a low signal at NENO(1) on the negative CLK edge. This triggers iC-MA(2) on the next positive CLK edge, kicking off the read cycle. The third axis of measurement, iC-MA(3), is activated in the same way.
During the output of the complementary sine and cosine signals, the microcomputer logs these at two separate analog inputs. The iC-MA's internal signal amplification provides 2VSS as a signal swing around the reference voltage of 2.5V. With slow rotational movements, such as the repositioning of a car seat or the measurement of flow control, for examples, one measurement per readout cycle is sufficient. In the circuit above, the current absolute value is read out when each device is activated.
The cascade with its absolute value output described here is just one of the possible ways of logging positions and distances using Hall sensors. Non-contact measurement permits great freedom in the arrangement of the permanent magnet; measurements in liquids and gases (flow) or the position sensing of throttle valves are possible with this setup. The many varied modes of operation provided are flexible, keeping system costs down. Constant measurement of the magnetic field acts as a watchdog for a Hall sensor measurement system. This generates an error signal should the magnetic coupling not be sufficient to carry out correct measurements.
David Lin is an application engineer for iC-Haus, Bodenheim, Germany