Magnetoresistive Angle Measurement
The circuit provides all necessary signal conditioning including instrumentation amplifiers, buffers, and a dual channel ADC that efficiently process the AMR sensor low level bridge outputs.
The result is an industry leading angle measurement solution suitable for machine tool speed control, crane angle control, motor speed measurement, and other industrial or automotive applications.
Figure 1. Magnetoresistive Angle Detection System (Simplified Schematic: Decoupling and All Connections Not Shown)
An AD8227 instrumentation amplifier amplifies the signal of interest while rejecting the Wheatstone bridge common-mode voltage of 2.5 V. The common-mode output voltage of the in-amp is set to 2.5 V by driving the VREF pin to 2.5 V. A 2.96 kΩ gain resistor sets the gain of 32. This creates an analog output voltage of 0.2 V to 4.8 V for a bridge output of 2.5 V ±70 mV.
The circuit signal bandwidth is determined by the AD8227 that has an approximate 100 kHz bandwidth for a gain of 32.
A unity gain AD8615 op amp buffers the in-amp output voltage and connects directly to the ADC. This buffer has a rail-to-rail output stage that swings to within 200 mV of the supply rails.
The AD7866 is a dual channel 12-bit 1 MSPS SAR ADC. The polarity of the RANGE pin determines the analog input range and output coding. If this pin is tied to a logic high when the chip select goes low, the analog input range of the next conversion is 0 V to 2VREF (0 V to 5 V), leaving approximately 200 mV headroom for the 0.2 V to 4.8 V input signal from the buffer amplifier.
Connecting the REFSEL pin low configures the ADC to use the internal 2.5 V reference voltage. This voltage is available on the VREF pin but requires a buffer before it can be used elsewhere in the system. The DCAPA pin and DCAPB pin are decoupled with 470 nF capacitors to ensure proper operation of the ADC. The reference voltage is buffered by the AD8615 and sets the common-mode output voltage of the AD8227 in-amp.
The AD7866 simultaneously samples both channels of the magnetoresistive sensor. The digital words are normally available on DOUTA and DOUTB. Each data stream consists of one leading zero followed by three status bits and then twelve bits of conversion data. However, by holding the chip select low for an additional 16 clock cycles, both digital words are read from one channel, DOUTA.
An SPI interface allows access to both channels on one data line.
Magnetoresistive (MR) Theory
Magnetoresistivity is the ability of a material to change the value of its resistance when subjected to an external magnetic field. The most commonly used MR sensors are based on the anisotropic magnetoresistive (AMR) effect.
Figure 2. Anisotropic Magnetoresistive Example
An example of the AMR effect is shown in Figure 2. A current (I), flowing through a conductor, is subject to an external magnetic field (HY). The resistance of the conductor changes as a function of the angle (Ø) between the magnetization vector (M) and the current flow vector (I). The magnetization vector is the net sum of the internal magnetic field (HX) and the applied external magnetic field (HY).
The maximum resistance occurs when the magnetization vector (M) is parallel to the current vector (I). The minimum resistance occurs when the magnetization vector (M) is perpendicular to the current vector (I).
Effective utilization of the AMR effect requires the conductor itself to be a material insensitive to mechanical stress but sensitive to magneto-restriction. For these reasons, permalloy (80% nickel, 20% iron) is the most commonly used alloy in AMR sensor manufacturing.
There are two properties of permalloy strips that provide design challenges when creating angular measurement systems.
First, permalloy has a narrow linear operating region (see Figure 3). Only when the angle (Ø) between the magnetization vector (M) and current flow vector (I) becomes larger, does the response become linear. Unfortunately, shortly after the response becomes linear, it will saturate.
Figure 3. Permalloy Resistance vs. Magnetic Field
Secondly, permalloy is insensitive to polarity. The resistance of a permalloy strip will decrease whether the angle (Ø) between the magnetization vector (M) and the current flow vector (I) is positive or negative.
Figure 4. Barber Pole Effect in a Permalloy Strip
Figure 5 shows the result of adding Barber Poles to a permalloy strip. The current flow vector shifts by 45°, but the magnetization vector remains unchanged. Notice the linear behavior now present in the middle of the graph.
Figure 5. Barber Pole Permalloy Resistance vs. Magnetic Field
Magnetic Field Strength
When selecting a magnet, consider the air gap between the sensor and the magnet as shown in Figure 6. If the magnet is not in close proximity to the sensor (the distance, d, is very large), a larger magnetic field strength may be necessary to ensure the magnetic field strength at the sensor location and maintain the minimum error specification.
Figure 6. Magnet Orientation and Air Gap for Rotating Shaft Angle Measurement.
Figure 7. AA747 Dual Wheatstone Bridge Configuration
The maximum peak signal amplitude of the AA747 is 70 mV (14 mV/VCC on a 5 V supply). The sensor offset voltage is ±10 mV (±2 mV/VCC on a 5 V supply) giving a useable 2.5 V ±0.70 mV output signal. A rotating magnetic field produces the sin (2ø) and cos (2ø) outputs seen in Figure 8. Both signals are periodic over a 180° range, making the detection of full 360° measurements impossible without additional circuitry and components
Figure 8. Magnetoresistive Sensor Output Voltage
Referring to Figure 8, channel one (the blue line) loses sensitivity as the magnetization vector angle nears 45° or 135°. Similarly, channel two (the red line) loses sensitivity around 0° and 90°. Fortunately, when one channel has reduced sensitivity, the other channel will be in a region of high sensitivity.
The software takes advantage of this, measuring the angle based on whichever sensor is most accurate at the time. If channel one is approaching 45°, channel two is used to calculate the angle and maintain the system accuracy.
System Bandwidth, Magnetic Field Rotation
The angular velocity of the magnetic field is an important component in understanding the bandwidth of the circuit. The ADC converts one sample every microsecond. In order to achieve a resolution of 1°, the magnetic field can only move one degree in one microsecond (2.778 kHz); otherwise, the ADC cannot sample fast enough to keep up with the magnetic field. This sets the maximum useable angular velocity of the magnetic field at 2.778 kHz for a 1 MSPS ADC.
The EVAL-CN0323-SDPZ PCB is tested by mounting a magnet to the end face of a rod capable of spinning freely through 360°. The EVAL-CN0323-SDPZ PCB sits in position with the face of the AA747 AMR sensor (U5) parallel to the face of the magnet. The EVAL-CN0189-SDPZ tilt sensor PCB attaches to the second end of the rod. Thus, as the rod spins, both CN-0189 and the magnet also spin through 360°. A functional diagram of the setup is shown in Figure 9, and a photo of the setup is shown in Figure 10.
Figure 9. Data Collection Test Setup
Figure 10. Photo of Bench Test Setup
The CN-0189 tilt measurement system provides a reference angle to test CN-0323. The center rod turns until the CN-0189 evaluation software reads 0°. The center rod is held in thiposition while the magnet is rotated to produce a 0° angle reading in the CN-0323 evaluation software.
It is important to align the center of the magnet with the center of the face of the IC. Any misalignment will shift the magnetic field with respect to the sensor and cause errors in the final angle calculation of the CN-0323 evaluation software.
Data is collected by turning the center rod and comparing the two evaluation software display readings. Figure 11 shows the output angle error recorded through a ±90° range. The error is ±0.4°over the entire range. The LabVIEW evaluation software can be seen in Figure 12.
Figure 11. Magnetic Field Angle Error
Figure 12. Screenshot of the CN-0323 Evaluation Software
The calibration tab determines the maximum and minimum voltage (VMAX and VMIN) output of each Wheatstone bridge. Knowing these values allows a more precise mapping of voltage to digital code. The user has two methods of determining the VMAX and VMIN values.
The first method is manually entering the values. The second method is to spin the magnet through a 180° range while the software automatically identifies the values. This method can be faster than manually identifying the values but can also introduce errors if the magnetic field is rotating too quickly.
PCB Layout Considerations
In any circuit where accuracy is crucial, it is important to consider the power supply and ground return layout on the board. The PCB should isolate the digital and analog sections as much as possible. The PCB for this system was constructed in a 4-layer stack up with large area ground plane layers and power plane polygons. See the MT-031 Tutorial for more discussion on layout and grounding, and the MT-101 Tutorial for information on decoupling techniques.
Decouple the power supply to all ICs with 1 μF and 0.1 μF capacitors to properly suppress noise and reduce ripple. Place the capacitors as close to the device as possible. Ceramic capacitors are advised for all high frequency decoupling.
Power supply lines should have as large a trace width as possible to provide low impedance paths and reduce glitch effects on the supply line. Shield clocks and other fast switching digital signals from other parts of the board by digital ground. Figure 13 is a photo of the PCB.
A complete design support package for this circuit note is at www.analog.com/CN0323-DesignSupport.
Figure 13. Photo of the EVAL-CN0323-SDPZ PCB
Figure 14. Linear Position Measurement Magnet, PCB, and Sensor
The AA745 comes in a horizontal package that mounts flush against the edge of the PCB. This allows optimization of the distance between the magnet and sensor, the ideal distance being one-half the pole length of the magnet.
As the sensor moves parallel to the magnet it detects the magnetic field which rotates 180° for every pole length travelled. The pole length of the magnet (P) and the angular accuracy of the sensor (ΔØ = 0.05°) determine the theoretical accuracy (Δx).
Δx = P × ΔØ/180°
This provides an absolute measurement system for only one pole length. If the magnet has more than one pole, counting the number of poles passed provides a more accurate reading. Additional electronics are required to implement this functionality, and traditionally a second magnet with different pole length provides a reference point for an additional sensor.
The EVAL-CN0323-SDPZ contains the circuit to be evaluated, as described in this note. The EVAL-SDP-CB1Z is used with the CN-0323 evaluation software to capture the data from the EVAL-CN0323-SDPZ evaluation board.
The following equipment is needed:
- PC with a USB port and Windows® XP or Windows Vista® (32-bit), or Windows® 7 (32-bit)
- EVAL-CN0323-SDPZ evaluation board
- EVAL-SDP-CB1Z evaluation board
- 6 V power supply or wall wart
- CN-0323 Evaluation Software
- Neodymium magnet with a minimum magnetic field strength of 25kA/m at the package of the sensor.
Functional Block Diagram
Figure 15 shows the functional block diagram of the test setup.
Figure 15. Test Setup Block Diagram
With power to the supply off, connect a 6.0 V DC barrel jack to connector J4. Connect the USB cable supplied with the EVAL-SDP-CB1Z to the USB port on the PC. Note: Do not connect the USB cable to the mini-USB connector on the SDP board at this time.
Place the neodymium magnet directly on top of the IC or in some fixture designed to spin the magnet, which minimizes the distance between the IC and magnet itself.
It is important to keep other sources of magnetic fields away from the IC as any stray magnetic field can cause errors in the output voltage of the sensor.
Apply power to the DC barrel jack, connector J4. Launch the CN-0323 evaluation software and connect the USB cable from the PC to the mini-USB connector on the EVAL-SDP-CB1Z.
Once USB communications are established, the EVAL-SDP-CB1Z can now be used to send, receive, and capture serial data from the EVAL-CN0323-SDPZ.
Information regarding the EVAL-SDP-CB1Z can be found in the SDP User Guide.
Information and details regarding test setup and calibration, and how to use the evaluation software for data capture can be found in the CN-0323 Software User Guide at: www.analog.com/CN0323-UserGuide .
|AD8615||Precision 20 MHz CMOS Single RRIO Operational Amplifier
|AD8227||Wide Supply Range, Rail-to-Rail Output Instrumentation Amplifier||
|AD7866||Dual 1MSPS, 12-Bit, 2-Channel SAR ADC with Serial Interface||