Circuit Note CN-0323 Devices Connected/Referenced Circuits from the Lab™ reference circuits are engineered and tested for quick and easy system integration to help solve today’s analog, mixed-signal, and RF design challenges. For more information and/or support, visit www.analog.com/CN0323. AD7866 Dual Channel, 1MSPS, 12-bit, Simultaneous Sampling SAR ADC AD8227 Wide Supply Range, Rail-to-Rail, Instrumentation Amplifier AD8615 Low Offset, Low Noise, Precision Amplifier Magnetoresistive Angle Measurement EVALUATION AND DESIGN SUPPORT 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. Circuit Evaluation Boards CN-0323 Circuit Evaluation Board (EVAL-CN0323-SDPZ) System Demonstration Platform (EVAL-SDP-CB1Z) Design and Integration Files Schematics, Layout Files, Bill of Materials 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. CIRCUIT FUNCTION AND BENEFITS The circuit shown in Figure 1 provides a contactless, AMR (anisotropic magnetoresistive) angle measurement solution with 1° angular accuracy over a 180° range. The circuit is ideal for applications where high speed, accurate, non-contact angle measurements are critical. 5V 0.1µF 5V 5V REF 0.1µF 10µF 2.96kΩ 10µF 2.5V 3.3V 5V DVDD AVDD REFSEL RANGE AD8615 VDRIVE VA1 VCC SCLK +VO1 AA747 5V AD7866 2.5V DOUTA –VO1 +VO2 –VO2 GND1 SDP AD8227 REF 2.96kΩ 5V CS AD8227 AD8615 VB1 DGND AGND DCAP A 470nF DCAP B 470nF VREF 5V 100nF 2.5V 11916-001 AD8615 Figure 1. Magnetoresistive Angle Detection System (Simplified Schematic: Decoupling and All Connections Not Shown) Rev. 0 Circuits from the Lab™ circuits from Analog Devices have been designed and built by Analog Devices engineers. Standard engineering practices have been employed in the design and construction of each circuit, and their function and performance have been tested and verified in a lab environment at room temperature. However, you are solely responsible for testing the circuit and determining its suitability and applicability for your use and application. Accordingly, in no event shall Analog Devices be liable for direct, indirect, special, incidental, consequential or punitive damages due to any cause whatsoever connected to the use of any Circuits from the Lab circuits. (Continued on last page) One Technology Way, P.O. Box 9106, Norwood, MA 02062-9106, U.S.A. Tel: 781.329.4700 www.analog.com Fax: 781.461.3113 ©2013 Analog Devices, Inc. All rights reserved. CN-0323 Circuit Note The Sensitec AA747 is an AMR-based angular sensor containing two galvanically separated Wheatstone bridges at a relative angle of 45° to each other. The AA747 offers minimal offset voltage (±2 mV) and high signal amplitude (65 mV). A rotating magnetic field stimulates the sensor, creating an output voltage of ±65 mV. 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 inamp 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. 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. Permalloy Properties 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. 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. M Ø HY I R R0 + ΔR R0 HY –1.0 –0.5 0 0.5 1.0 H0 Figure 3. Permalloy Resistance vs. Magnetic Field Secondly, permalloy is insensitive to polarity. The resistance of a permalloy strip decreases whether the angle (Ø) between the magnetization vector (M) and the current flow vector (I) is positive or negative. Barber Poles A common method used to improve both the linearity and polar insensitivity of the permalloy strip is to add aluminum stripes angled at 45° to the strip axis called barber poles, as shown in Figure 4. Any current flowing between barber poles takes the shortest path—the perpendicular path, and the angle between the current flow vector (I) and magnetization vector (M) shifts by 45°. ALUMINUM STRIPES HY 11916-002 I M Figure 2. Anisotropic Magnetoresistive Example HX HY = 0 11916-004 HX 11916-003 CIRCUIT DESCRIPTION Figure 4. Barber Pole Effect in a Permalloy Strip Rev. 0 | Page 2 of 6 Circuit Note CN-0323 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. –VO1 VCC1 GND1 +VO1 –VO2 VCC2 R GND2 +VO2 11916-007 R0 + ΔR Figure 7. AA747 Dual Wheatstone Bridge Configuration HY –1.0 –0.5 0 0.5 H0 1.0 11916-005 R0 Figure 5. Barber Pole Permalloy Resistance vs. Magnetic Field Magnetic Field Strength The AA747 magnetoresistive sensor requires a minimum magnetic field strength of 25 kA/m to ensure the error specification found in the data sheet. This stimulating magnetic field must intersect the center of the sensor package. 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. 2.57 2.55 OUTPUT VOLTAGE (V) 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. 2.53 2.51 COS (2Ø) SIN (2Ø) 2.49 2.47 2.43 0 90 ANGLE (°) 135 180 Figure 8. Magnetoresistive Sensor Output Voltage MAGNET Channel Sensitivity 11916-006 d SENSOR 45 11916-008 2.45 Figure 6. Magnet Orientation and Air Gap for Rotating Shaft Angle Measurement. Sensor Basics The standard AMR sensor consists of two Wheatstone bridges, with one bridge at a relative angle of 45° with respect to the other. Permalloy strips comprise each element of both bridges and have nominal resistance values of 3.2 kΩ. The sensor has a nominal sensitivity of 2.35 mV/° for each channel. This means each degree of change between the magnetization vector and the sensor orientation produces an output voltage change of 2.35 mV. The sensitivity is not constant with respect to the angle. The areas of decreased sensitivity are the portions of each output where the slope of the line approaches zero. 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 is 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. Rev. 0 | Page 3 of 6 CN-0323 Circuit Note 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. Test Results 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. position 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 shifts 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. 0.5 0.4 0.3 0.2 ERROR (°) System Bandwidth, Magnetic Field Rotation EVAL-SDP-CB1Z 0.1 0 –0.1 –0.2 USB –0.3 –0.4 EVAL-SDP-CB1Z USB –0.5 ANGLE (°) +6V 11916-011 MAGNET 90 82 74 66 58 50 42 34 26 18 10 2 –6 –14 –22 –30 –38 –46 –54 –62 –70 –78 –86 MR SENSOR Figure 11. Magnetic Field Angle Error +6V EVAL-CN0189-SDPZ 11916-009 CN-CN0323-SDPZ 11916-010 11916-012 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 this 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. Rev. 0 | Page 4 of 6 Circuit Note CN-0323 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 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. D= SENSOR 1 POLE LENGTH 2 11916-014 D P P = POLE LENGTH Figure 14. Linear Position Measurement Magnet, PCB, and Sensor 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. 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. 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. 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). A complete design support package for this circuit note is at www.analog.com/CN0323-DesignSupport. 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. Δx = P × ΔØ/180° CIRCUIT EVALUATION AND TEST This circuit uses the EVAL-SDP-CB1Z System Demonstration Platform (SDP) evaluation board and the EVAL-CN0323-SDPZ circuit board. The two boards have 120-pin mating connectors, allowing for the quick setup and evaluation of the performance of the circuit. 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. Equipment Needed 11916-013 The following equipment is needed: Figure 13. Photo of the EVAL-CN0323-SDPZ PCB COMMON VARIATIONS Two changes are required to create a linear position measurement system. First, replace the AA747 AMR sensor with the AA745. This sensor specifically senses linear movement and has identical electrical characteristics as the AA747. Second, replace the magnet with a multi-pole bar magnet consisting of a series of alternating north and south poles as shown in Figure 14. • 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. Rev. 0 | Page 5 of 6 CN-0323 Circuit Note Getting Started Test Load the evaluation software by placing the CN-0323 evaluation software CD into the PC. Using My Computer, locate the drive that contains the evaluation software CD and open the Readme file. Follow the instructions contained in the Readme file for installing and using the evaluation software. 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. Functional Block Diagram Figure 15 shows the functional block diagram of the test setup. 6V POWER SUPPLY J4 LEARN MORE EVAL-SDP-CB1Z 120-PIN CONNECTOR CN-0323 Design Support Package: http://www.analog.com/CN0323-DesignSupport 11916-015 J1 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/CN0323UserGuide . PC EVAL-CN0323-SDPZ 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. MT-031 Tutorial, Grounding Data Converters and Solving the Mystery of “AGND” and “DGND”, Analog Devices. Figure 15. Test Setup Block Diagram Setup MT-101 Tutorial, Decoupling Techniques, Analog Devices. Connect the 120-pin connector on the EVAL-CN0323-SDPZ to the connector on the EVAL-SDP-CB1Z. Use nylon hardware to firmly secure the two boards, using the holes provided at the ends of the 120-pin connectors. AN-688 Application Note, Phase and Frequency Response of iMEMS Accelerometers and Gyros, Analog Devices With power to the supply off, connect a 6.0 V DC barrel jack to connector J4. Connect the USB cable supplied with the EVALSDP-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. AA700 Application Note, AMR Freepitch Sensors for Angle and Length Measurement, Sensitec Data Sheets and Evaluation Boards CN-0323 Circuit Evaluation Board (EVAL-CN0323-SDPZ) System Demonstration Platform (EVAL-SDP-CB1Z) AD7866 Data Sheet AD8227 Data Sheet AD8615 Data Sheet REVISION HISTORY 10/13—Rev. 0: Initial Version (Continued from first page) Circuits from the Lab circuits are intended only for use with Analog Devices products and are the intellectual property of Analog Devices or its licensors. While you may use the Circuits from the Lab circuits in the design of your product, no other license is granted by implication or otherwise under any patents or other intellectual property by application or use of the Circuits from the Lab circuits. Information furnished by Analog Devices is believed to be accurate and reliable. However, Circuits from the Lab circuits are supplied "as is" and without warranties of any kind, express, implied, or statutory including, but not limited to, any implied warranty of merchantability, noninfringement or fitness for a particular purpose and no responsibility is assumed by Analog Devices for their use, nor for any infringements of patents or other rights of third parties that may result from their use. Analog Devices reserves the right to change any Circuits from the Lab circuits at any time without notice but is under no obligation to do so. ©2013 Analog Devices, Inc. All rights reserved. Trademarks and registered trademarks are the property of their respective owners. CN11916-0-10/13(0) Rev. 0 | Page 6 of 6