**1. 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–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:

$$
\theta\_{\mathfrak{e}} = p \cdot \theta\_{\mathfrak{m}} \tag{1}
$$

(where *p* 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 δ*<sup>e</sup>* is equal to the change in the mechanical angle δ*<sup>m</sup>* of the motor shaft position – Figure 1a.

**Figure 1.** Relationships between the values of mechanical angle θ*m*, electrical angle θ*e* and the state of Hall sensors for brushless direct current (or BLDC) motors for: (**a**) 1; (**b**) 4 pairs of poles.

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.

#### **2. 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–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–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 δ*<sup>r</sup>* of the shaft, measured by the microprocessor system as a value inversely proportional to the time *ts* of changing the state of the position sensor values, amounts to:

$$
\omega\_{\tau} = \frac{\pi \pm \delta\_{ms} \pm \delta\_{mr}}{p \cdot t\_s} \tag{2}
$$

**Figure 2.** Visualisation of sensor (δ*ms*) and magnet (δ*mr* ) misalignment in a BLDC shaft sensing system.

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).

**Figure 3.** Relationships between the values of mechanical angle θ*m*, electrical angle θ*e* and the state of Hall sensors for brushless direct current (or BLDC) motors for: (**a**) 1; (**b**) 4 pairs of poles for δ*ms* - 0 and δ*mr* -0.

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].

**Figure 4.** Measurement of phase currents of a BLDC motor (four pole pairs, nominal speed = 3000 rpm/min, nominal power = 380 W) during full mechanical rotation.

#### **3. 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 *esec*, 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.

**Figure 5.** Research set-up.

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 *nn* 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.

**Figure 6.** Actual and measured speed of a BLDC motor with factory nonsymmetrical Hall sensor array, for a BLDC motor with four pairs of poles.

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 *esec* 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.

**Figure 7.** Rotational speed computation error "*esec*" in particular sectors of the tested motors.

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 *ee* sensors, which ranged from a few to over 25◦ of the electric angle, with respect to the optimal location according to the formula *ee* = *esec*·60◦.

### **4. 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 8.** Rotational speed computation errors determined at different rotational speeds of motor D (four pole pairs, nominal speed = 3000 rpm/min, nominal power = 380W).

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).

**Figure 9.** Distribution of errors in determining the *esec* speed of the BLDC motor, for motor "D", determined at 2000 rpm.

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 *ere 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).

**Figure 10.** Possible error distributions for determining the rotor speed for the Hall sensor state for different initial rotor positions: (**a**–**c**); (**d**) for H1 = 0; H2 = 0; H3 = 1; (**d**) reference distribution stored in the memory of the motor controller.

#### **5. Example Implementation**

The procedure for determining the absolute position of the rotor is, in the simplest possible implementation, to search for the largest *esec* 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 searching for similarity between measured values and reference values stored in the EEPROM memory. The minimum error value and even all errors in all sectors can also be analysed.

**Figure 11.** Algorithm for determining the position of the BLDC motor rotor on the basis of the comparison of *esec* errors with the reference value of the error distribution *ere f* , for a given state of the Hall sensors (H1 = 0; H2 = 0; H3 = 1).

#### **6. 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.

**Conflicts of Interest:** The authors declare no conflict of interest.
