Application Note Magnetic Angle Sensor KMT32 B Precise Angle Measurement utilizing AMR Sensor KMT32B This application note provides a very basic introduction to the fundamentals of magnetic angle sensors based on the anisotropic magnetoresistive (AMR) effect. It focuses to those users who may be unfamiliar with their characteristics and modes of operation. MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 1 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B Contents 1 Introduction .................................................................................................................... 3 2 Angle measurements utilizing magnetoresistive sensors ................................................ 3 3 Wheatstone bridges ....................................................................................................... 4 4 Error contributions .......................................................................................................... 5 5 6 7 4.1 Important facts........................................................................................................6 4.2 Some rules of thumb ..............................................................................................7 4.3 Geometrical tolerances...........................................................................................8 4.4 Temperature effects ...............................................................................................9 Choosing the correct magnet ......................................................................................... 9 5.1 Example: Choosing a magnet ...............................................................................11 5.2 Magnetic units ......................................................................................................11 Application circuits.........................................................................................................12 6.1 General microcontroller based solution................................................................. 12 6.2 Interpolator chip based solution ............................................................................ 12 Additional Information ....................................................................................................14 MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 2 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B 1 Introduction A strong feature of the magneto-resistive sensor technology is its dependence on the magnetic field direction, almost independently on the actual magnetic field strength. This is related to the excellent soft magnetic properties of the sensor material that completely saturates at very small applied magnetic fields strengths of a few kA/m. ‘Complete saturation’ means that (almost) all magnetic domains are aligned in the same direction parallel to the applied field, i.e. all magnetic domains generate the same signal! A further increase of the magnetic field change will only marginally alter the alignment of the magnetic domains and therefore will only lead to a marginal change in the signal. In summary: the magneto-resistive effect depends only on the field direction and therefore becomes independent on the magnetic field strength if the magnetic field is above a certain limit. Magneto resistive angle sensors work in this regime. It takes small and simple magnets to create the required field strengths. 2 Angle measurements utilizing magnetoresistive sensors Magneto-resistive sensors are very well suited for measuring angles and rotations contactless on a very precise scale. A magnetic field is used to transform the mechanical motion into an electrical signal. A typical measurement set up is shown in figure 1: a magnet fixed on a rotation shaft is placed in front of the sensor. Rotation shaft Permanent magnet MR-sensor die Packaged MR sensor Figure 1: A typical arrangement of sensor and magnet for an angular measurement MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 3 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B 3 Wheatstone bridges In the case of MR sensors, 4 resistors are commonly arranged in a Wheatstone bridge: Its output voltage can be written as: Va ,cos (α ) = V0 ∆R ⋅ ⋅ cos(2 ⋅ α ) 2 R Figure. 2: Wheatstone bridge 1 In case of rotational sensors, a second Wheatstone bridge is usually used, which is rotated by 45°. Its output voltage becomes: Va ,sin (α ) = V0 ∆R ⋅ ⋅ sin (2 ⋅ α ) 2 R Figure 3: Wheatstone bridge 2 15 10 5 Uo/Ucc [mV/V] Both characteristic curves are shown in figure 4: The output signal amplitudes depend on the supply voltage, as MR sensors are passive components. That is the reason why MR signals are usually specified in mV/V. 0 0 45 90 135 180 225 270 315 360 -5 -10 -15 α [deg] bridge1 (sin) bridge2 (cos) Figure 4: The characteristic sine and cosine output signals of a conventional angular MR sensor After removing the bridge offsets, angles can be measured and evaluated easily within a range of 180° via a geometric relationship between sine and cosine: Va ,sin Va ,cos and therefore V0 = 2 V0 2 ∆R (T ) ⋅ sin (2 ⋅ α ) sin (2 ⋅ α ) R = = tan (2 ⋅ α ) ∆R cos(2 ⋅ α ) ⋅ (T ) ⋅ cos(2 ⋅ α ) R ⋅ ⇒α = Va ,sin 1 arctan 2 Va ,cos MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 4 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B Be sure that you consider the different cases for the arctan (x;y) : y arctan( ) → x > 0 x y π arctan( + ) → x > 0; y ≤ 0 x 2 arctan( y − π ) → x < 0; y < 0 arctan( x; y ) = x 2 π + → x = 0; y > 0 2 π − → x = 0; y < 0 2 0 → x = 0; y = 0 The two measured signals can be used to calculate the ‘MR amplitude’ ∆R 2 2 = Va ,sin + Va ,cos = const. R 4 Error contributions α will ∆α : In general, the measured angle value ϕ0 and an angular error differ from the original field angle α0 by an constant offset α = α 0 + ϕ 0 + ∆α The angular error is caused only to a certain extent by intrinsic sensor error sources, as long as the sensor is used in saturation. Very often, people have a different understanding of accuracy ∆α of the measurement: for some, it is the difference between actual and measured value. For others, it is the error which is obtained when the measurement is repeated several times or the measurement is done with different rotational directions. The latter case is called hysteresis or repeatability error, while the first case describes the true measurement error. Two classes of angular error contributions can be distinguished: those which distort the homogeneity of the magnetic field at the sensor (distance variations in the xy plane, misalignment with respect to the rotational axis, disturbing fields and objects, inhomogeneous magnets etc. ) and on the other hand, those which deteriorate the quality of the sensor performance (like temperature). MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 5 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B Objects Disturbing fields Environment Angular error Voff, TKVoff Currents Earth Hysteresis Temperature Intrinsic Amplitude synchronism Phase errors System electronics Error contributions Noise Drifts Resolution Conversion Floating processor 29.07.2009 - v10 Size Material Magnet Eccentric magnet X,Y plane Inhomogeneities Tolerances Magnet staggers Sensor off center Z (distance magnet-sensor) Figure 5: Major contributions that affect the accuracy of a MR angular measurement 4.1 Important facts The field strength of the applied magnet at the sensor has to be strong enough to saturate the soft magnetic sensor material. This will ensure that the magnetization vector in the sensor will always be (almost) parallel to the direction of the applied field. This is the condition where AMR sensors are preferably operated for accurate angle measurements. The specified field strength is H≥25 kA/m for MEAS’ MR angular sensors. This is the minimum required field strength for the KMT32B sensor in order to achieve the specified performance. Magnetic field strength for different materials Field strength H in kA/m 70 M 1mm 9mm 60 Hartferrit (10/24p) AlNiCo (35/5) Neofer (55/50p) NdFeB (N38) Sm2Co7 (S240) H0 limit 50 40 30 20 10 0 0 1 2 3 4 5 Air gap distance z in mm Figure 6: The z dependence of the magnetic field strength for different magnet materials The sensor will work properly down to 10 kA/m, but with a reduced accuracy of ≈ ±0.5° and increased hysteresis. MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 6 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B Figure 6 displays the magnetic field variation as a function of air gap distance z for different magnet materials for a small disc magnet with 9mm diameter and 1mm thickness. Hard Ferrite (HF) and Neofer are plastic bonded materials, while AlNiCo (grade 35/5), SmCo (grade S240) and NdFeB (grade N38) are sintered materials, which have much higher remanences. To decide which magnet material is best for the application is one important target in the design of a magnetic measurement system. As can be seen in figure 6, the magnetic field strength drops exponentially with the distance. But as long as the magnetic field strength is well above the specified minimum value and the magnetic field vector does not change, a possible distance variation between magnet and sensor is not of great importance . This MR specific characteristic is also of importance for the temperature behaviour of magnets, as magnets show reversible and irreversible losses with temperature. The calculation of the MR amplitude ∆R 2 2 = Va ,sin + Va ,cos > Limit can be used to check if the R sensor is saturated at any time. In summary: variations in the magnetic field strength due to mechanical tolerances or temperature will have no effect on the measurement accuracy as long as the sensor is saturated. A recommended working field strength is 32-40 kA/m (resp. 40-50 mT) over temperature. 4.2 Some rules of thumb The following relationship of the accuracy on the applied field strength holds for the KMT32B: ∆α max ≈ 4 kA / m° H appl The applied field strength has to be strong enough so that the influence of disturbing fields is less than the demanded accuracy. As a rule of thumb, the maximum error from a disturbing field H disturb is ∆α max ≈ 57° ⋅ H disturb H appl ∆α max is measured in °. For example, the earth magnetic field will cause a maximum error of 0.04 ∆α max ≈ 57° ⋅ = 0.09° at the specified field H appl = 25 kA / m . 25 where MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 7 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B 4.3 Geometrical tolerances The main error contributions to the measurement accuracy are caused by field inhomogeneities of the rotating magnet used. It is therefore very important to look at the system sensor – magnet and to place the right magnet at the correct position. The alignment between sensor and magnet is also of importance, see figure 7. Figure 8 depicts the error resulting from an off centre alignment of a KMT32B with respect to the magnet. The maximum error resulting from (∆x,∆y) displacement can be estimated to ∆α max = C (w + l ) 2 ( ⋅ ∆x 2 + ∆y 2 ) where w and l are the width resp. length of the magnet, and C ranges between 250 – 350, depending on the magnet geometry used. ∆x, ∆y are the displacements from origin in mm. The observed error originates basically from field inhomogeneities. Therefore, the size of the magnet in combination with assembly tolerances creates the error contribution. An eccentric mounting of the magnet with respect to the axis of rotation is less critical for small displacements. Figure 7: Off centre alignment of the sensor with respect to the axis of rotation M 9mm Figure 8: Maximum displacement error for KMT32B for a disc shaped magnet of 9 mm diameter within +/-1mm displacement tolerances dx, dy It is therefore very important for the application engineer to recognize the relationship between the sensor and the magnet. Only very well aligned and matched arrangements will allow very precise and accurate measurement of angles. MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 8 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B 4.4 Temperature effects Both ohmic resistance and magneto-resistance originate from scattering processes of the conducting electrons. As all scatter processes are temperature dependent, the bridge resistance and MR effect ∆R/R show a temperature dependence as well. Temperature coefficients are usually referred to two temperatures via TCX = X (T2 ) − X (T1 ) 1 ⋅ ⋅ 100% X (T1 ) (T2 − T1 ) for X= bridge resistance (BR) resp. signal voltage (SV). If not otherwise stated, usually T1 = -25 °C and T2 = 125 °C. As long as the arc tan method is used to calculate the angle, temperature effects are cancelled out in first approximation. Another important value is the temperature coefficient of the offset, which is very small, but present. This temperature coefficient is caused by small differences in the temperature behavior of the four bridge resistors. In practice, a drift in the output voltage is observed, which can not be separated from the regular output signal caused by magnetic fields and will need to be calibrated for very precise measurements. The temperature coefficient of the offset will thus limit the measurement accuracy. With a specified offset temperature coefficient of TCVoff <4 µV/V/K, a maximum of ∆Voff Hub ≈2% is expected for KMT32B for a temperature difference of ∆T =125°C, resulting in a maximal offset related error of ∆α max ≈ 1° (i.e. no offset temperature compensation applied). 5 Choosing the correct magnet Two rule of thumbs can directly be derived from the error discussion above: • in general, the applied field strength should be as strong as possible • the magnetic field has to be homogenous, i.e. the magnets should be as large as possible Therefore, before picking the correct magnet , some important criteria should be identified, like • • • what are the measurement conditions (temperature, disturbing fields, etc.) ? what is the acceptable maximal angular error ? what will be typical geometrical tolerances of magnet with respect to the sensor in x, y and z direction ? • what will be the typical mounting tolerances ∆x and ∆y of the sensor with respect to the axis of rotation ? All these quantities will have some influence on the quality of the angle measurement and will also have an impact on the choice of the magnet. Table 1 depicts the major properties of several commonly traded magnetic materials. MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 9 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B Name Material Sprox Oxide ceramic 11/22p hard ferrit HF22/15 Fe-Ba-O Br (BH)max mT kJ/m 225 10,5 3 TCBr Tmax %/°C °C -0.20 140 L/D Remark <1 Geometry by injection moulding; chemical inert 360 22 -0.20 250 <1 Geometry by pressing and sintering / injection moulding; chemical inert Neofer Nd-Fe-B 580 55 -0.12 120 Sm2Co17 Sm-Co 1080 195 -0.03 300 N38 Nd-Fe-B 1260 >0.5 Geometry by injection moulding 55/100 p 120 >1 Low temperature; highly corrosive Table 1: Survey of commonly used magnet materials Magnetic field strength at 1 mm distance of a magnet with dimensions L x L/2 x L/2 H in kA/m 100 10 5 10 15 20 25 Magnet size L in mm HF22/15 Neofer 55/100p Sm2Co7 Figure 9: The variation of the magnetic field strength at a distance of 1 mm for a cube with dimension Lx(L/2)x(L/2) MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 10 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B 5.1 Example: Choosing a magnet In the following section, it will be shown how to estimate the correct magnet size (with length l and width w) for a maximum tolerated angular error of ∆ω=1° and two alignment tolerances R=0.5 mm and R=1 mm, using formula ∆α max = case 1: C (w + l )2 ⋅ R2 alignment tolerance R= 1 mm 2 2 The formula estimates the geometrical size of the magnet to be at least (w+l) >C*1 mm , i.e. (w+l) > 18 mm with C=320°. As can be taken from figure 10, a ferrite magnet (HF22/11) 3 with geometrical dimensions of at least 20 x 10 x 10 mm will provide the specified magnetic field strength at a distance of 1 mm (magnet to sensor chip surface). case 2: alignment tolerance R= 0.5 mm The formula estimates the geometrical size of the magnet to be at least 2 2 (w+l) >C*0.25 mm , i.e. (w+l) > 9 mm. A NdFeB magnet (Neofer 55/100) with geometrical 3 dimensions of 6 x 3 x 3 mm will fulfill the desired conditions at a distance of 1 mm (magnet to sensor chip surface), as can be seen in figure 10. The use of sintered NdFeB material will increase the field strength at sensor furthermore, allowing larger tolerances for the distance sensor surface – magnet. Obviously, many other magnet geometries and materials will lead to the same results in both cases. 5.2 Magnetic units A fairly confusing situation on magnetic units appears to the normal reader, who is not a specialist in magnetism. The following table shall help to find conversion factors quickly between the different units used. Unit 1 multiply = Unit 2 Remark by 4 Tesla 10 Gauss Oerstedt 1 Gauss µr = 1 ! Oerstedt 79,58 A/m 10 /(4xπ) For the correct reference, please refer to the corresponding website at NIST / Boulder, CO www.boulder.nist.gov/div818/81803/PDFs/magnetic_units.pdf 3 Table 2: Conversion factors for magnetic units MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 11 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B 6 Application circuits 6.1 General microcontroller based solution This solution is a simple system with medium accuracy. The accuracy depends on the ADC resolution of the used microcontroller. The ADC must have a input voltage range of 0V to VCC. With the Wheatstone bridge a DC voltage of ½ VCC is generated to set the ADC in correct input voltage span. The proposed system uses a simple amplifier to enable the sensor signals to be read into the ADC of the microcontroller. Figure 10: Schematic of a microcontroller based MR system 6.2 Interpolator chip based solution The interpolator chip iC-NQC from IC-HAUS (http://www.ichaus.de/NQC) is a monolithic A/D converter which, by applying a count-safe vector follower principle, converts sine/cosine sensor signals with a selectable resolution and hysteresis into angle position data. This absolute value is output via a bidirectional, synchronous-serial I/O interface in BiSS C protocol and trails a master clock rate of up to 10 Mbit/s. Alternatively, this value can be output so that it is compatible with SSI in Gray or binary code, with or without error bits. The device also supports double transmission in SSI ring mode. Signal periods are logged quickly by a 24-bit period counter that can supplement the output data with an upstream multiturn position value. At the same time any changes in angle are converted into incremental A QUAD B encoder signals. Here, the minimum transition distance can be stipulated and adapted to suit the system on hand (cable length, external counter). A synchronized zero index Z is generated if enabled by PZERO and NZERO The front-end amplifiers are configured as instrumentation amplifiers, permitting sensor bridges to be directly connected without the need for external resistors. Various programmable D/A converters are available for the conditioning of sine/cosine sensor signals with regard to offset, amplitude ratio and phase errors (offset compensation by 8-bit DAC, gain ratio by 5-bit DAC, phase compensation by 6-bit DAC). The front-end gain can be set in stages graded to suit all common differential sensor signals from approximately 20mVpp to 1.5Vpp, and also non-complementary sensor signals from 40 mVpp to 3 Vpp respectively. MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 12 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B Figure 11: Schematic of an incremental system with NQ-Chip and line driver from IC- Haus The device can be configured using two bidirectional interfaces, the EEPROM interface from a serial EEPROM with I2C interface, or the I/O interface in BiSS C protocol. Free storage space on the EEPROM can be accessed via BiSS for the storage of additional data. After a low voltage reset, iC-NQC reads in the config- uration data including the check sum (CRC) from the EEPROM and repeats the process if a CRC error is detected. MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 13 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20 Application Note Magnetic Angle Sensor KMT32 B 7 Additional Information NORTH AMERICA EUROPE ASIA Measurement Specialties, Inc. 1000 Lucas Way Hampton, VA 23666 United States Phone: +1-800-745-8008 Fax: +1-757-766-4297 Email: [email protected] Web: www.meas-spec.com MEAS Deutschland GmbH Hauert 13 D-44227 Dortmund Germany Phone: +49-(0)231-9740-0 Fax: +49-(0)231-9740-20 Email: [email protected] Web: www.meas-spec.com Measurement Specialties China Ltd. No. 26, Langshan Road High-tech Park (North) Nanshan District, Shenzhen 518057 China Phone: +86-755-33305088 Fax: +86-755-33305099 Email: [email protected] Web: www.meas-spec.com The information in this sheet has been carefully reviewed and is believed to be accurate; however, no responsibility is assumed for inaccuracies. Furthermore, this information does not convey to the purchaser of such devices any license under the patent rights to the manufacturer. Measurement Specialties, Inc. reserves the right to make changes without further notice to any product herein. Measurement Specialties, Inc. makes no warranty, representation or guarantee regarding the suitability of its product for any particular purpose, nor does Measurement Specialties, Inc. assume any liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability, including without limitation consequential or incidental damages. Typical parameters can and do vary in different applications. All operating parameters must be validated for each customer application by customer’s technical experts. Measurement Specialties, Inc. does not convey any license under its patent rights nor the rights of others. MEAS Deutschland GmbH Hauert 13, D-44227 Dortmund, Germany www.meas-spec.com 14 of 14 August 2014 phone: +49-(0)231-9740-0 fax: +49-(0)231-9740-20