Detection of Rotor Position with MR Sensor TLE5309D

The rotor position is a key state in the closed-loop control system of the permanent magnet synchronous motor (PMSM). Its measurement accuracy has a significant effect on steady accuracy, dynamic response, and torque ripple. The magnetoresistance (MR) sensor is widely used in the rotor position detection due to its distinct advantages, such as simple structure, high sensitivity, and strong robustness. In this paper, a solution using the giant magnetoresistance (GMR) sensor in TLE5309D chip for angle measurement is introduced, and its feasibility is verified by finite element analysis (FEA) simulation and bench test. In the simulation, two schemes different in the sensor location and the number of permanent magnet poles, are evaluated according to the higher harmonic content and field direction stability near the sensor. The experiment from 1 rpm to 1000 rpm is implemented, and the measurement results after calibration based on discrete Fourier series (DFS) show that the GMR sensor has a good performance in the test.


Introduction
PMSM is widely used in several industrial fields such as medical equipment, electric and hybrid electric vehicles due to its high power density and small size. The rotor position is significant in the closed-loop motor control algorithms, such as field-oriented control (FOC) and direct torque control (DTC), the measurement accuracy of which influences steady accuracy, dynamic response and torque ripple.
Sensors based on different principles such as the optical encoder, resolver, and Hall sensor can be used to measure the rotor position. The optical encoder has the highest precision among these sensors, but its sensitivity to dust and vibration makes it unsuitable for the severe environment. The resolver is widely used in motor systems because of its high precision and robustness in the severe environment. However, it has some disadvantages such as high cost and large size. Besides, an extra application circuit is necessary to convert its original signals to the ones which the microcontroller can process directly.
In general, magnetic sensors are classified into several types according to their principles, such as Hall, anisotropic magnetoresistance (AMR), GMR, and tunnel magnetoresistance (TMR) sensor. The obvious difference between the Hall sensor and MR sensor is the relative orientation of the measured magnetic field vector to the sensor chip: for MRs -parallel; for Hall -perpendicular [1]. Compared to the MR sensor, the Hall sensor is considered less sensitive and less reliable at high temperature and performs well only in the strong magnetic field [1]- [4]. The AMR element has small hysteresis, high resolution, and high bandwidth, but easily saturates at a rather weak magnetic field [1]- [3]. Compared to the AMR element, the GMR sensor has lower but adequate resolution and obvious advantages in terms of dynamic range [1]- [4]. TMR sensor has the best sensitivity and resolution with a smaller size [4]. The comparison of these four types of magnetic sensors is given in table 1. MR sensors output signals directly processed by the microcontroller without extra decoding modules, having advantages such as low cost, simple structure, and reliability in the severe environment. It is suitable for systems with the demand for high speed and high precision, such as the traction motor and electric power steering (EPS) system. This paper introduces a solution to measure rotor position by the GMR sensor in Infineon TLE5309D chip, which provides a contactless, full 360° measurement. In the sequel, details including the calibration method, mechanical layout, hardware design, and software design are presented. Two schemes are evaluated by two-dimensional (2-D) FEA, one of which is not adopted in subsequent experiments due to its unsatisfied simulation results.

Principle and calibration method
The GMR sensor measures the rotor position by detecting the orientation of the rotating magnetic field. A permanent magnet is placed at the end of the rotor shaft, rotating synchronously with the rotor. The sensor fixed on the stator or housing of the motor is parallel to the flat surface of the magnet.
The field direction is measured by a full-bridge structure. This circuit could output signals doubled in amplitude and cancel out the effect of temperature variation as well. As shown in figure 1, the GMR sensor in TLE5309D combines two bridges. The measurement of 360° is achieved with two bridges oriented orthogonally to each other. Figure 1. Sensitive bridges of the GMR sensor in TLE5309D chip [5] In this paper, axes coplanar with the chip package in two perpendicular directions are defined as Xaxis and Y-axis. In principle, the voltages of cosine (COS) and sine (SIN) channel are in proportion to the magnetic components in the X-axis and Y-axis direction respectively, so that the absolute angle of the rotor is obtained by arc tangent calculation. AB are constant coefficients. Ideally, the following condition is satisfied. However, the above conditions are often unsatisfied due to several reasons, such as the installation deviation and the element mismatching between the real circuit and the design model. In addition to the above systematic errors, signal noises also have a bad effect on the calculation of the angle.
The field direction angle  depends only on the rotor angle when the sensor is fixed. Neglecting the influence of random errors, it is apparent that X U and Y U both vary periodically with  . The U  can be expressed as Fourier series in the following form: where BB are coefficients of DC and AC components. When voltages and coefficients are given, the sine and cosine of  cannot be obtained without solving the nonlinear equation.
When voltages are only composed of DC component and fundamental harmonic, the voltage locus is an ellipse strictly. It is significant to covert the ellipse locus into the circle whose center is at the origin by offset correction, amplitude normalization and non-orthogonality correction, which correspond to three kinds of nonstandard loci shown in figure 2. Offset correction helps the center return to the origin by subtracting the average value of raw signals. Amplitude normalization makes the peak-to-peak values of the two channels equal to each other. Non-orthogonality correction ensures the zero-crossing of the COS channel signal when the SIN channel outputs the maximum value. Finally, zero-point correction is done to adjust the zero-point of the sensor consistent with the absolute zero angle of the motor.
In practice, sensor signals are collected by the discrete control system e.g. microcontroller. The distribution of sampling points should be at equal intervals and have the same number in all four quadrants. The coefficients are determined as equation (5)-(10) [6]: where N is the number of sampling points, ,, are the reference rotor angle, the voltages of SIN and COS channel corresponding to the i th sampling point.

Simulation
In this paper, the simulations of two schemes shown in figure 3 are carried out by 2-D FEA. The parameters of the magnet are shown in table 2. In the simulation, the sensor is fixed while the permanent magnetic rotates around its central axis. In scheme #1, the chip is placed in the center of the bipolar annular magnet. Scheme #2 is that the chip is outside a same-sized octupole magnet. Two aspects are concerned in the simulation. One is the higher harmonic content of the function  (4). The other is the stability of the magnetic field direction in the area adjacent to the measurement point. There is slight relative displacement between the rotor and housing when the motor is in working condition, especially at the resonance speed. Besides, the sensitive area of the sensor is not equivalent to a point in practice, especially in a space where the direction of the magnetic field changes obviously. The scheme is difficult to apply in practice when the direction stability is not satisfied.
(a) Scheme #1 (b) Scheme #2 Figure 3. Overview of the magnet and sensor placement In scheme #1, it is obvious that two magnetic field components only have fundamental harmonic theoretically in principle due to the central measurement point. The frequency-domain analysis is analyzed with DFS, and the amplitude of higher harmonics no more than 15 are calculated. The results after normalization (the fundamental amplitude is adjusted from the original value to 1, and amplitudes of other components are enlarged or shrunken in the same gain) are represented in figure  4(a). The maximum amplitude of higher harmonics is less than 10 -2 , matching the theory that no higher harmonic exists with setting the central measurement point. The direction stability is evaluated by comparing the field direction of the original measurement point and other points. Three extra points are on a same diameter and 0.5, 1, and 2 mm off-center respectively. It is shown in figure 4(b) that the maximum residual errors are 0.0067°, 0.025°, and 0.14° in cases with an offset of 0.5, 1 and 2mm, meaning that the field direction at the three points is close to the measurement point. In conclusion, scheme #1 has little components in high frequency, satisfying the direction stability condition.  Figure 4. Simulation results of scheme #1 However, the electrical angle used for motor control is calculated by multiplying the mechanical angle by the number of pole-pairs, so the error of the electrical angle is amplified by the same factor. Multiple pole-pairs motors are widely used in automotive powertrain due to the demand for high torque density. To reduce the error of electrical angle, scheme #2 using a multipole permanent magnet is put forward. The field strength is zero on the central axis of the octupole magnet due to its central symmetry, so the measurement point is placed eccentrically. The measurement point is set 26.5mm off-center in consideration of the size of permanent magnet and sensor, as well as their safety gap. It is shown in figure 5(a) the amplitudes of higher harmonics are larger than those of scheme #1, and the maximum amplitude of about 0.021 corresponds to the second harmonic. Three extra points are set to evaluate the direction stability. One is moved 0.5mm perpendicular to the diameter from the original measurement point, while others are moved 0.5mm radially, in the direction towards and away from the center of the magnet respectively. It is shown in figure 5(b) that the field direction changes about 5.7° when the offset 0.5mm is in the direction perpendicular to the diameter. By contrast, figure 5(b) also points out an insignificant change of the field direction due to equal radial offset.
Other points are evaluated, and the simulation results show increscent higher harmonic amplitudes and worse directional stability with decreasing eccentric distance of the measurement point. Although the above problems would be alleviated if the measurement point is farther from the center, it is impracticable due to the layout limits and the field strength decreasing sharply with eccentric distance.
Above all, scheme #1 is adopted, while scheme #2 is abandoned mainly because of its directional instability. The pre-installed sensor in the motor used for experiments is the resolver YS J52XU9734A. It is preserved to provide the reference mechanical angle during the calibration. The original flat end cover is replaced by a redesigned one expanded along the axis so that there is enough space to place the magnet and sensor at the end of the shaft. As shown in figure 6, the bipolar, radial magnetizing magnet should be coaxial with the sensor, with its surface parallel to the sensor package. It is worthy of mention that fine gaskets are used to adjust the gap between magnet and sensor, ensuring that the sensor operates in a suitable magnetic field.

Hardware design
There are two printed circuit boards (PCB) in the hardware system represented in figure 7. PCB #1 only contains the connecting terminal and the sensor chip due to mechanical layout limits. It is emphasized that the sensor is placed at the center of round PCB #1 so that the magnetic strength stays consistently in the 360° range theoretically.
The buck circuit and low-pass filter (LPF) circuit are arranged on PCB #2. The values of resistors and capacitors in LPF is determined on the basis of the maximum speed of the motor and drive capability of the sensor. The purpose of the reversed operational amplifier circuit is increasing the conversion accuracy by amplifying signals closer to the operating region of analog-digital conversion (ADC).

Software design
It is necessary to measure voltages of four pins with the differential output mode of TLE5309D. These voltages are measured with 12-bit precision through the ADC module in AURIX microcontroller, and measuring results are used to calculate the angle following the process shown in figure 8. In the process after subtraction, the absolute value of two values are compared and the larger one is set as the divisor in subsequent calculations to ensure the numerical stability.

Experiment result
TLE5309D combines a GMR sensor for the range of full 360° and an AMR sensor with higher precision for the range of 180° in one package. The main control chip AURIX TC275 in the motor controller acquires data when the motor is driven by dynamometer at 10 rpm. In this experiment, only signals from the GMR sensor are collected. The sensor and magnet parameters for the experiment are shown in table 3 and 4.   Figure 9. Data acquisition and monitor display interface Figure 10. A picture taken during the experiment Raw signals are collected when the dynamometer drags the motor at 10 rpm, and partial data corresponding to five cycles are used to calibrate. The loci of sampling points before and after calibration are represented in figure 11. The projection of the tracing point onto the X-axis means the differential value of the COS channel, and that onto the Y-axis corresponds to the SIN channel.
(a) Before calibration (b) After calibration Figure 11. Locus diagram at 10 rpm It is observed in figure 11 (a) that the locus before calibration approximates an ellipse without obvious non-orthogonality error. But its center on the negative axis of Y and its long axis on the Yaxis means offset error and amplitude error respectively. The tracing points are all around the unit circle after calibration. As shown in figure 11(b), the sample points after calibration are distributed around the unit circle whose center is at the origin.
The root mean square error (RMSE) of the mechanical angle after calibration is 0.970°, decreasing by 68.2% compared to that after only zero-point adjustment. In figure 12, the results of the resolver show good linear vibration with time, consistent with uniform rotation of the motor, while the results of GMR fluctuates slightly around the former. The amplitudes of components no more than 15 are shown in figure 13. It is indicated that the major components of higher harmonics are second, third, eleventh, and thirteenth harmonic. As for higher harmonics, the third harmonic of the COS channel has a maximum amplitude of about 0.0104.
(a) Logarithm expression (b) Linear expression Figure 13. Frequency analysis after calibration The RMSE values of the mechanical angle at other speeds are calculated. They are 0.951°, 0.974°, 0.971° and 0.970° corresponding to 1, 100, 500 and 1000 rpm, respectively.
In the experiment, analog signal transmission on long Dupont lines between the sensor and motor controller can easily get interference. In practical use, high-qualified shielding measure is significant to the reduction of measuring error.

Conclusion
In this paper, a solution using the MR sensor TLE5309D to detect the rotor position of PMSM is introduced. Based on simulation results, the scheme that the sensor is placed on the axis of the bipolar permanent magnet is adopted. Besides, the hardware design and software calibration based on DFS is presented. Finally, the performance of the above system within the speed range from 1 rpm to 1000 rpm is verified with the bench experiment. With the trend of integration between the motor and controller，the sensor directly outputting analog signals will be more widely used in the rotor position detection.