Determining the Position of the Brushless DC Motor Rotor

In brushless direct current (or BLDC) motors with more than one pole pair, the status of standard shaft position sensors assumes the same distribution several times for its full mechanical rotation. As a result, a simple analysis of the signals reflecting their state does not allow any determination of the mechanical position of the shaft of such a machine. This paper presents a new method for determining the mechanical position of a BLDC motor rotor with a number of pole pairs greater than one. In contrast to the methods used so far, it allows us to determine the mechanical position using only the standard position sensors in which most BLDC motors are equipped. The paper describes a method of determining the mechanical position of the rotor by analyzing the distribution of errors resulting from the accuracy proposed by the BLDC motor’s Hall sensor system. Imprecise indications of the rotor position, resulting from the limited accuracy of the production process, offer a possibility of an indirect determination of the rotor’s angular position of such a machine.


Introduction
Compared to conventional DC brush motors, BLDC brushless motors using shaft position sensors are becoming increasingly popular in many applications, due to their relatively low cost, high performance and high reliability. The operating issues associated with the control of such machines have been extensively studied under the assumption of the correct operation of the shaft position sensor system, namely Hall sensors, and under the assumption of the symmetry of the signals generated by them [1][2][3][4].
Some industrial applications require that the position of the rotor is clearly defined and the information about the rotor is used by the control system during the operation cycle of the device. An example of this is the machine spindle, which must be properly positioned in relation to the cutter hopper, in order for the tools to be automatically picked and replaced.
A common solution to this problem of determining the rotor position is to equip the drive system with additional elements, namely, shaft position sensors, whose resolution is matched to the desired accuracy of its positioning. All kinds of encoders of the motor shaft's absolute position are used for this purpose [5]: absolute position encoders, and incremental encoders with an additional index "I" signal generated once per mechanical rotation.
The presence of Hall sensors, mounted in the motor, led the author to use them as an element defining the mechanical angle of the motor shaft. Determining the position of the BLDC motor rotor with an accuracy of 60 mechanical degrees for motors with one pair of poles is possible according to the formula: (where equals the number of pole pairs), and it is determined directly by the state of the shaft position sensors, as the change in the electrical angle is equal to the change in the mechanical angle of the motor shaft position - Figure 1a. However, in machines with the number of p>1 pole pairs (p=4 for most BLDC motors that are present on the market), equipped only with standard Hall sensors, it is not possible to determine the mechanical position of the shaft solely on the basis of the analysis of their state, because the Hall sequence repeats p times per one mechanical revolution, as shown in Figure 1b. Until now, the solution to this problem has been to install additional elements determining the position of the motor shaft. Unfortunately, this makes it necessary to mechanically modify the typical BLDC motors available on the market.
This article proposes a method that allows us to determine the mechanical position of the rotor with an accuracy equal to 60/p mechanical degrees for BLDC motors with the number of pole pairs greater than one, without the need for additional sensors. This accuracy value is sufficient for rotor positioning in many industrial applications.

Errors in the Positioning of Motor Sensors
The disadvantages resulting from the real, different from ideal, arrangement of shaft position sensors are known, and described in detail in the literature [6][7][8][9][10][11][12][13]. This problem is caused by the relatively low accuracy of the motor shaft position determination system during mass production. Researchersʹ efforts focus on compensating for sensor placement errors by assuming perfect symmetry of the rotating magnetic element (Figure 1 =0). This makes it possible to treat the multipolar machine as a machine with one pair of poles [14][15][16]. Defining the errors in the measurement of the speed and position of the motor shaft, resulting only from the incorrect arrangement of sensors, is a large simplification in the analysis of the operation of the real system for determining the position of the BLDC motor rotor. If the error concerned only the sensor location accuracy ( - Figure 2), the speed measurement errors could be uniquely determined for each combination of Hall sensor states. In fact, these errors result to the same extent from the accuracy of sensor placement ( ), as from the accuracy of making the magnetic ring rotating coaxially with the shaft ( ); see Figure2. The angular velocity of the shaft, measured by the microprocessor system as a value inversely proportional to the time of changing the state of the position sensor values, amounts to: However, in machines with the number of p > 1 pole pairs (p = 4 for most BLDC motors that are present on the market), equipped only with standard Hall sensors, it is not possible to determine the mechanical position of the shaft solely on the basis of the analysis of their state, because the Hall sequence repeats p times per one mechanical revolution, as shown in Figure 1b.
Until now, the solution to this problem has been to install additional elements determining the position of the motor shaft. Unfortunately, this makes it necessary to mechanically modify the typical BLDC motors available on the market.
This article proposes a method that allows us to determine the mechanical position of the rotor with an accuracy equal to 60/p mechanical degrees for BLDC motors with the number of pole pairs greater than one, without the need for additional sensors. This accuracy value is sufficient for rotor positioning in many industrial applications.

Errors in the Positioning of Motor Sensors
The disadvantages resulting from the real, different from ideal, arrangement of shaft position sensors are known, and described in detail in the literature [6][7][8][9][10][11][12][13]. This problem is caused by the relatively low accuracy of the motor shaft position determination system during mass production. Researchers' efforts focus on compensating for sensor placement errors by assuming perfect symmetry of the rotating magnetic element (Figure 1 δ mr = 0). This makes it possible to treat the multipolar machine as a machine with one pair of poles [14][15][16]. Defining the errors in the measurement of the speed and position of the motor shaft, resulting only from the incorrect arrangement of sensors, is a large simplification in the analysis of the operation of the real system for determining the position of the BLDC motor rotor. If the error concerned only the sensor location accuracy (δ ms - Figure 2), the speed measurement errors could be uniquely determined for each combination of Hall sensor states. In fact, these errors result to the same extent from the accuracy of sensor placement (δ ms ), as from the accuracy of making the magnetic ring rotating coaxially with the shaft (δ mr ); see Figure 2. The angular velocity δ r of the shaft, measured by the microprocessor system as a value inversely proportional to the time t s of changing the state of the position sensor values, amounts to: If non-zero errors or are assumed, the speed values for the individual sectors may vary despite the shaft rotating at a constant speed. This difference can be determined by comparing the measured value with a reference value, measured e.g., by an external measuring system.

79
In extreme cases, assuming that both the sensor system and the magnetic ring are made with       If non-zero errors δ ms or δ mr are assumed, the speed values for the individual sectors may vary despite the shaft rotating at a constant speed. This difference can be determined by comparing the measured value with a reference value, measured e.g., by an external measuring system.
In extreme cases, assuming that both the sensor system and the magnetic ring are made with limited accuracy, an error in shaft speed measurement can be calculated for each sector of the BLDC motor ( Figure 3), e.g., for a motor with four pole pairs, the number of sectors is 24 per full mechanical rotation of the shaft (Figure 3b).

79
In extreme cases, assuming that both the sensor system and the magnetic ring are made with    For a motor with one pair of poles six unique error values can be assigned to a specific state of Hall sensors (Figure 3a), while for a motor with the number of pole pairs greater than one, these errors cannot be assigned to a specific state of sensors ( Figure 3b).
Errors δ ms and δ mr result in switching the keys of the motor stator winding controller in a suboptimal position of the rotor, which in turn leads to the electromagnetic torque pulsation of the motor, increases the amplitude of its current ( Figure 4) and the noise level of the motor operation. Boosting the amplitude of the current results in an increase in electrical losses and electromagnetic interference, and forces the constructors of the controller to use in it transistors with a higher rated current, so that they do not suffer thermal and dynamic damage during long-term operation [17]. Energies 2020, 13, x FOR PEER REVIEW 4 of 9 interference, and forces the constructors of the controller to use in it transistors with a higher rated 94 current, so that they do not suffer thermal and dynamic damage during long-term operation [17].

Laboratory Measurements Taken on Real Motors
In order to confirm the universality of this phenomenon in motors available on the market, it was decided to purchase four types of BLDC motors from four different manufacturers, and to analyze the performance of their shaft positioning systems. For this purpose, an experiment was developed to compare the actual ω re f speed measured by the incremental encoder, with the speed measured using the signal generated by the motor's Hall sensors in an open loop drive system. The measuring functions were executed by the dSpace GmbH (Paderborn, Germany) dSpace MicroLabBox system supported by the Tektronix (Beaverton, Oregon United States) Digital Phosphor Oscilloscope 5054-B ( Figure 5). As a measure of the error in determining the speed in individual sectors e sec , a percentage ratio of the ω sec calculated speed to the actual ω re f measured by the reference element, i.e. the incremental encoder, was proposed. Additionally, the values of phase currents of the BLDC motor were measured during the tests. interference, and forces the constructors of the controller to use in it transistors with a higher rated 94 current, so that they do not suffer thermal and dynamic damage during long-term operation [17].    One of the aims of the experiment was to determine the influence of sensor distribution error on the pulsation of the actual rotational speed. It was predicted that significant oscillations of the motor phase current amplitude, caused by the premature or delayed activation of the controller transistors, may significantly increase this pulsation. During laboratory tests, it was found that in a wide range of speeds (from 10% to 100% of the n n rated speed), and for wide ranges of load torque changes (from idle to rated load), the actual speed pulsation is imperceptible (Figure 6), despite significant (up to 80%; Figure 4) phase current fluctuations of the motor. Energies 2020, 13, x FOR PEER REVIEW 5 of 9 of speeds (from 10% to 100% of the rated speed), and for wide ranges of load torque changes (from idle to rated load), the actual speed pulsation is imperceptible (Figure 6), despite significant (up to 80%; Figure 4) phase current fluctuations of the motor.

122
The measurements showed that the accuracy of speed determination in the experiment, position measurement system, we can assume that its average steady state rotational speed can be  The measurements showed that the accuracy of speed determination in the experiment, assumed at 0.5%, was not exceeded. This means that, regardless of errors in the BLDC motor position measurement system, we can assume that its average steady state rotational speed can be considered constant, regardless of the phase current amplitude fluctuations of the motor. This is a very important conclusion, allowing the thesis that, in the steady state the average actual speed for individual motor sectors is equal to the average speed measured during the full mechanical rotation of the shaft. The actual average speed of a full revolution can be measured correctly by any single Hall sensor. This results in the possibility of not using an additional reference speed measurement system (i.e. an additional encoder) in favor of using averaged full revolution speed, which is independent of the sensor placement error [12]. Figure 7 shows the calculated speed error values for the individual e sec sectors for four different BLDC motors with powers ranging from 60 W to 1500 W. All motors had four pairs of poles each, for which 24 sectors of speed measurement can be defined per one mechanical revolution. Each of them corresponds to a mechanical rotation angle equal to π/(3·p), which gives an angle value for each sector equal to 15 mechanical degrees.
Energies 2020, 13, x FOR PEER REVIEW 5 of 9 of speeds (from 10% to 100% of the rated speed), and for wide ranges of load torque changes 117 (from idle to rated load), the actual speed pulsation is imperceptible (Figure 6  It can be seen that the values of these errors are significant, and strongly influence the accuracy of motor speed calculation. It is worth emphasizing that all of the tested motors were characterized by a significant error in the arrangement of e e sensors, which ranged from a few to over 25 • of the electric angle, with respect to the optimal location according to the formula e e = e sec ·60 • .

Determination of the Absolute Position of the BLDC Motor Rotor
In the course of the work described above, errors in determining the rotational speed for individual sectors of the motors, tested at different rotational speeds, were determined. It was shown that for a wide range of rotational speeds, these errors are almost constant, and what is worth underlining, unique for the specific motor used in the test. This is illustrated in Figure 8 for the motor marked as "D".
Energies 2020, 13, x FOR PEER REVIEW 6 of 9 characterized by a significant error in the arrangement of sensors, which ranged from a few to over 25° of the electric angle, with respect to the optimal location according to the formula = ·60°.

Determination of the Absolute Position of the BLDC Motor Rotor
In the course of the work described above, errors in determining the rotational speed for individual sectors of the motors, tested at different rotational speeds, were determined. It was shown that for a wide range of rotational speeds, these errors are almost constant, and what is worth underlining, unique for the specific motor used in the test. This is illustrated in Figure 8 for the motor marked as "D".  Figure 9 shows the error distribution of the speed determination for motor "D". Using a standard Hall sensor system causes that during the full rotation of the shaft, the sequence of sensor states is repeated depending on the number of pole pairs of the motor (here, four times). It can be seen that the value of the speed determination errors for individual sectors varies greatly, creating a sequence unique for a specific motor. This makes it possible to identify the position of the rotor using information about the states of the sensors, with the support of an algorithm that looks for a specific pattern of error distribution. Determination of the rotor position  Figure 9 shows the error distribution of the speed determination for motor "D". Using a standard Hall sensor system causes that during the full rotation of the shaft, the sequence of sensor states is repeated depending on the number of pole pairs of the motor (here, four times).
Energies 2020, 13, x FOR PEER REVIEW 6 of 9 It can be seen that the values of these errors are significant, and strongly influence the 140 accuracy of motor speed calculation. It is worth emphasizing that all of the tested motors were 141 characterized by a significant error in the arrangement of sensors, which ranged from a few to 142 over 25° of the electric angle, with respect to the optimal location according to the formula 143 = ·60°.

145
In the course of the work described above, errors in determining the rotational speed for 146 individual sectors of the motors, tested at different rotational speeds, were determined. It was 147 shown that for a wide range of rotational speeds, these errors are almost constant, and what is worth 148 underlining, unique for the specific motor used in the test. This is illustrated in Figure 8 for the 149 motor marked as "D".

159
It can be seen that the value of the speed determination errors for individual sectors varies It can be seen that the value of the speed determination errors for individual sectors varies greatly, creating a sequence unique for a specific motor. This makes it possible to identify the position of the rotor using information about the states of the sensors, with the support of an algorithm that looks for a specific pattern of error distribution. Determination of the rotor position can be done in relation to the reference value of the e re f error distribution, stored in the electrically erasable programmable read-only -EEPROM memory of the motor control device. The sequence of errors is repeated with the frequency corresponding to the time of full rotation of the shaft by the motor. This sequence can start from different values, which depends only on the initial position of the motor shaft at the moment of starting the drive system.
To simplify the procedure for determining the motor shaft position, only the error distributions corresponding to the same combination of the Hall sensor states can be analyzed, which in the case of the motor under test reduces the number of errors analysed from 24 to only 4. Figure 10 shows possible error distributions for the selected sensor states (H1 = 0, H2 = 0, H3 = 1). For a motor with four pairs of poles, four different sequences of assigning the error distribution to the absolute position of the motor rotor are possible (depending on the initial position of the rotor after power-up).

192
The operation of this algorithm allowed to unambiguously assign the BLDC motor sector

Example Implementation
The procedure for determining the absolute position of the rotor is, in the simplest possible implementation, to search for the largest e sec error for the same selected sequence of their state, and to assign its sector number to the sector number of the maximum error of the reference distribution. For example, sectors 1, 7, 13 and 19 ( Figure 10) correspond to the sequence (H1 = 0; H2 = 0; H3 = 1). After determining the speed calculation errors, the algorithm compares the results obtained with the reference values stored in the controller's non-volatile EEPROM memory. If the reference error values stored for specific sensor signals reached the maximum value, e.g. for Sector 7, then after searching the newly obtained error distribution, and finding the maximum error value, e.g., for sector 13, one should change the sector number in which the greatest error of speed measurement was found. In this particular case, sector number 13 will be changed by the algorithm determining the position of the shaft to number 7, and the remaining sector numbers will be automatically assigned to the following sectors of Figure 11 by means of software incrementation.
The operation of this algorithm allowed to unambiguously assign the BLDC motor sector number to the angle of the mechanical rotor position by analyzing the reference pattern of error distribution, stored e.g., in the EEPROM memory.
When the differences between the errors of individual sectors are small, i.e., when the shaft position detection system was made precisely at the factory, it is possible to expand the algorithm of

Conclusions
During the research, four BLDC motors with four pairs of poles each were analysed. Thanks to the proposed method, it was possible to find the mechanical position of a multi-pole BLDC motor, despite the fact that the sequence of the Hall sensor states changes in the same sequence p-times per mechanical revolution. What is very important is that theoretically, if the shaft position monitoring system was made very accurately at the factory, it would not be possible to achieve motor diagnostics results characteristic enough to assign a specific position of the motor rotor to them. Hence, the conclusion that applying the method described in the article can correct a factory's inaccurate fixing of motor components, and result in the possibility of using such machines in drive systems, where the absolute position of the shaft must be determined for the correct operation of the whole system. Another interesting issue is the possibility of identifying a specific electrical machine by analyzing the distribution of errors in speed measurement, using its shaft position sensors. This gives the possibility of the quick, simple and cost-free detection of the replacement of the drive motor, even if it is characterized by the same nominal data. Determination of the angular position of the BLDC motor shaft on the basis of the analysis of the error spectrum allows the application of advanced algorithms for the correction of commutation errors, which result from errors in the position of sensors in multi-pole BLDC motors [3]. This contributes to the reduction of the noise emitted by the drive as well as the use of semiconductor connectors with a lower rated current for the controller.
Funding: This research received no external funding.