Journal of Robotics, Networking and Artificial Life, Vol. 3, No. 3 (December 2016), 152-157

A Simulation Model of Hall Sensor Misalignment in BLDC Motors

Chung-Wen Hung

Department of Electrical Engineering, National Yunlin University of Science & Technology,
123, Sec. 3, University Road, Douliou, Yunlin, 64002, Taiwan
Chu-Lin Hsu

Department of Electrical Engineering, National Yunlin University of Science & Technology,
123, Sec. 3, University Road, Douliou, Yunlin, 64002, Taiwan
E-mail: wenhung@yuntech.edu.tw, B10100061@yuntech.edu.tw
www.yuntech.edu.tw

Abstract
A model for simulating the output signals of Hall sensors installed with misalignment in a brushless DC (BLDC)
motor is proposed in this paper. In the past, Hall sensors have been very widely adopted to evaluate thecommutation timing and rotation speed of a BLDC motor. However, no simulation model is yet available to take
into account the misalignment of Hall sensors in order to obtain correct sensor output signals for further postprocessing. How the model is developed will be discussed in detail, and the proposed model will be carefullyvalidated as well.
Keywords: simulation model, BLDC motor, Hall sensor, misalignment.

1. Introduction
Brushless DC (BLDC) motors are popularly used
nowadays due to its high power density, lowmaintenance requirement, and easy control. Most BLDC
motors are equipped with Hall sensors to evaluate themotor’s commutation timing and rotational speed.
However, the installed Hall sensors will more or lessdeviate from their desired positions in a BLDC motor.
This misalignment, if not properly taken into accountand compensated, will lead to torque rippling because ofwrong commutation timing and incorrect speed
feedback.
This phenomenon has been highlighted in theliterature with possible solutions [1]-[4]. Ref. [1]proposed a Hall-effect-sensor-based position observer tomitigate the torque ripple in permanent-magnet

synchronous machines, and the hardware and simulation
validation showed the proposed algorithm functions
well. However, this algorithm was proposed only for
PMSM motors but not for BLDC motors. Ref. [2]proposed an auxiliary circuit for BLDC motors to reject
the Hall sensor signal noise and capture the timeinterval. The circuit was implemented in a field
programmable gate array (FPGA), and the experimental
results showed that the circuit works as expected. This
study could be a good reference for BLDC motor
control integrated circuit, but the study did not discuss
any simulation about Hall Sensor Misalignment. Ref. [3]focused only on the commutation behavior of the BLDC
motor, and proposed a simulation model in
Matlab/Simulink. Ref. [4] presented an efficientsimulation model for a variable sampling system, which

Published by Atlantis Press
Copyright: the authors
152

Chung-Wen Hung, Chu-Lin Hsu

is caused by low resolution effect of Hall sensors.
However, this model did not take into account themisalignment of Hall sensors in a BLDC motor.
In this paper, a model that takes into account themisalignment of BLDC motors will be discussed andpresented. To carry out the simulation, the model is
integrated with a full BLDC motor driver systemsimulation plan. Results indicate that the proposedmodel is reliable.
2. The Simulation Method
To simulate the Hall sensors’ output signals in a BLDC
motor, we must know the rotor’s accumulated rotation
phase. However, most BLDC motor simulation models
output only the rotor’s rotational speed. Hence, anintegrator should be used to obtain the accumulated
rotation phase. As shown in Fig. 1, where forsimplification in explanation the number of pole pairs
has been set to one, and the rotor is assumed to rotate
clockwise with the three Hall sensors (i.e., Hall sensor
A, B, and C, respectively, called Ha, Hb, and Hc forbrevity, in sequence in the clockwise direction) mounted
120 degrees apart on the stator. In this figure, the solidline that is diametrically opposite to the positon of Ha
represents the reference direction with a spatial phase of0 degree. Hence, ideally, each position of Ha, Hb, andHc corresponds to a spatial phase of π, 5π/3, and π/3,respectively. When point O at the rotor’s pole interface
rotates across the solid line or the position of Ha, therotor’s rotation angle is said to pass 0 or π, respectively.
This will lead to a change of state in Hall sensor A’s
output at those two particular time instants, as illustratedin Fig. 2. If without truncation, the output of therotational angle is monotony increasing. However,because of the cyclic-symmetric property of the rotation
angle, we can always associate any rotation angle
beyond 0-2π to strictly within 0-2π. This can be done bytaking a modulo-operation on the rotation angle with adivisor of 2π and then extracting the remainder. In thatcase, Hall sensors A, B, and C will change their outputs
when the rotation angles pass (0 or π), (5π/3 or 2π/3),and (π/3 or 4π/3), respectively.

Fig. 1. Diagram of Hall-sensor and relative rotor positions

Fig. 2. The relationship between rotation angle and Hallsensor output

3. The Proposed Simulation Model
As discussed in the previous section, most BLDC
simulation models provide only the speed output, andthe rotational angle is the factor that can determine theoutput of a Hall sensor. An integrator can hence beadopted to integrate the rotational speed so as to obtain
the rotational angle. To obtain the modulus of therotation angle, a remainder block is needed, which
comprises a divider, a rounder, and an adder. Next, thedetermination of the Hall sensor’s output can rely on arelational operator. Fig. 3 shows the function blocks ofthe model for simulating the Hall sensor’s output withsensor A as an example. In this figure, only one
relational operator is needed, for which there are twoinputs. The first input is the normalized modulus of therotation angle (i.e., the modulus normalized with respectto 2π), and the second input is 0.5, which is thenormalized value of π (still normalized with respect to2π) used as a threshold in the relational operation.
Similarly, the output of Hall Sensor B (C) is one value
when rotational angle is greater than 5π/3 (π/3) or lessthan 2π/3 (4π/3), and is the other value otherwise.

Published by Atlantis Press
Copyright: the authors
153

A Simulation Model ofDetailed relational operations are dictated by (1)-(3),where the symbol % represents a modulo operation. For
completeness, functional blocks for the model
pertaining to the simulation of Hall sensors B and C aredemonstrated in Fig. 4. Comparison of Figs. 3 and 4
reveals that two relational operators are employed foreach of Hall sensors B and C, whereas only one isneeded for Hall sensor A. This drawback will beeliminated in the model proposed in the next section.
HallA(θ) = 0,= 1,HallB(θ) = 1,= 0,HallC(θ) = 1,= 0,if (θ % 2π) < πif (θ % 2π) ≧ πif (θ % 2π) < 2π/3, or (θ % 2π)≧5π/3o. w.
if (θ % 2π) ≧ π/3, and (θ % 2π) < 4π/3
o. w.

possible to implement the models such that they all need
the same number of relational operators. We hence
propose the equivalent one, as shown in Fig. 5, where
only one relational operator is needed for each sensor
output and all the three relational operators have thesame threshold value of 0.5. This simplification can beachieved because the accumulated rotational angle input
to the remainder block of Hall sensor B (C) has beenshifted by 4π/3 (2π/3).

(1)
(2)
(3)

Fig. 5. Equivalent simulation modelFig. 3. Simulation model of Hall-sensor

Fig. 4. Simulation model of Hall-sensor B and C

4. The Proposed Hall Sensor Misalignment
Effect Simulation
As indicated in Figs. 3 and 4, the number of relational
operators needed in the model for Hall sensor A isdifferent from that for Hall sensors B and C. In view of
the cyclic-symmetric property of the rotation angle, it isIdeally, Hall sensors should be installed at theirprescribed positions. In reality, the positions the Hallsensors installed in most BLDC motors may deviate
from those prescribed ones. The simulated output
signals of the misaligned Hall sensors should accuratelyreflect the misalignment; otherwise these simulatedsignals would not be useful for further processing when
the development of a BLDC motor and its associatedcontrol circuit heavily rely on a complete systemsimulation. In Fig. 6, dot lines represent the Hallsensors’ prescribed positions, and dash lines indicate theHall sensors’ actual positions. We have assumed that
Hall sensor A is well aligned and that Hall sensors B
and C deviate from their prescribed positions by Δθ andΔφ, respectively. The misalignment should be taken into
account in the simulation that provides Hall sensors’
output signals. The deviation angle Δθ, when taken into
account in the function blocks pertaining to Hall sensor
B, leads to a new model shown in Fig. 7, where thenormalized deviation angle is added to each threshold of
the two relational operators.

Published by Atlantis Press
Copyright: the authors
154

Chung-Wen Hung, Chu-Lin Hsu

5.

Fig. 6. Diagram of Hall-sensor with misalignment

Simulation Results

To validate the proposed Hall-sensor output model, we
use as an aid a Matlab built-in model, called Brushless
DC Motor Fed by Six-Step Inverter Model and to be runin the Matlab/Simulink environment. The upper half ofFig. 9 is this built-in model, and the bottom half is a
duplicated one but with the original Hall-sensor output
replaced by the proposed Hall-sensor output model(indicated by red circle in Fig. 9). As is understood, theinput of the proposed model is the rotation speed of therotor, and the output is connected to the same decoder inthe built-in model. Fig. 10 shows the Hall sensors’
output signals simulated using the upper half function
blocks of Fig. 9 and those using the lower half without
any misalignment. In this figure, the horizontal axis is
the time in second, and the three waveforms indicate thelogic-level output of Ha, Hb and Hc, respectively. TheseFig.7. Misalignment simulation model of Hall-sensor B

Although intuitively correct, the model shown in Fig.
7 can still be simplified in view of the model
development from Fig. 4 to Fig. 5. Because themovement between the rotor and each Hall sensor isrelative, the normalized deviation angle can besubtracted from the input accumulated rotation angle.
The latter choice is in fact easier to implement, and its
associated model is shown in Fig. 8. So far, we haveassumed that Hall sensor A is well installed without
position error. However, it is clear from Fig. 8, if there
is also a deviation angle for Hall sensor A, it can also be
subtracted from the input accumulated rotation angle.

Fig. 8. Equivalent misalignment simulation modelFig. 9. The simulation of the "Brushless DC Motor Fed by
Six-Step Inverter model" with misalignment simulation(a) Matlab Simulink demonstration(b) proposed models
Fig.10. Hall sensor signal comparison without misalignment

Published by Atlantis Press
Copyright: the authors
155

A Simulation Model oftwo sets of results are identical, as expected. Obviously,
the proposed simulation model could simulate well theHall sensors’ output without misalignment.
Next, to further validate the proposed Hall-sensor
output model shown in Fig. 8, we consider the casewhere the misalignment is present in one of the Hallsensors, say, Hall sensor B. For that purpose, thesimulation model shown in Fig. 11 is adopted, whereonly a motor is used for simulation. In this simulation
model, the speed output is fed to the proposed Hallsensor output model with misalignment, and then theoutputs of the proposed Hall-sensor output model arecompared with those of the original Hall sensors. The
comparison is shown in Fig. 12. Again, the horizontal
axis is the time in second, and the vertical axis is thelogic level of the Hall sensor’s output. The solid lines inboth subfigures are the outputs of Hall sensor A without
misalignment, and the dash line in the upper subfigure
indicates the output of Hall sensor B without
misalignment as well. In contrast, the dot line in thelower subfigure shows Hall sensor B’ output with amisalignment of Δθ = π/6. When the motor runs in thesteady state, meaning that the speed is uniform in time,
the output pulse trains of the Hall sensors are symmetric(i.e., with a duty cycle of 50%), whether or not withmisalignment. In addition, as compared with the outputof Hall sensor A, the output of Hall sensor B without
misalignment is delayed by 2π/3, whereas that of Hallsensor B with misalignment indeed shows an additional
expected phase delay of π/6. Obviously, this delay willcause wrong commutation timing and speed estimation.

Fig. 12. Simulation result of Hall sensor B with misalignment

Finally, the speed output comparisons in Fig. 9 areshown in Fig. 13, where the dash line is the speed
response of the BLDC motor without Hall sensor
misalignment and the solid line presents the one withmisalignment. The simulated speed response for thecase without misalignment is obviously more stable
than the one for the case with misalignment. In addition,
there are always ripples in the speed response for thecase with misalignment. However, this does not meanthat the smoother response is our preferred one. This isbecause the simulated speed response without
misalignment can also be regarded the one with theexistence of the misalignment but without taking into
the misalignment in the simulation. From this point ofview, the simulated speed ripples that are due to theHall sensor’s misalignment and its resultant wrong
rotor’s commutation timing are the desired results. By
appropriately compensating the misalignment effect,these ripples can be eliminated by other techniques
implemented in the control circuit. If the misalignment
is not taken into account in the simulation, then theripples will not appear in simulated data and nostrategies can be sought to compensate themisalignment.

Fig. 11. The simulation of the "Brushless DC Motor Fed by
Six-Step Inverter model" with the proposed Hall sensor
modulePublished by Atlantis Press
Copyright: the authors
156

Chung-Wen Hung, Chu-Lin Hsu

Acknowledgements
This work is partially supported by the Ministry ofScience and Technology, ROC, under contract No. NSC
104-2622-E-224-016-CC3, 104-2221-E-224-012 andMOST 105-2622-E-224-017-CC3.
References

Fig. 13. Simulation result of Hall sensor B with misalignment

6. Conclusion
A simulation model of Hall sensor misalignment in
BLDC motors is proposed in this paper. For most
BLDC motors, it is very difficult and expensive to
install Hall sensors in prescribed position accurately.
And it will cause torque ripple and wrong speed
feedback. The proposed model could simulate exactly
this misalignment effect, and it is can provide a goodsimulation reference to engineers for designs of BLDC
motor controllers.

1. P. B. Beccue, S. D. Pekarek, B. J. Deken, and A. C.
Koenig, Compensation for Asymmetries and Misalignment in a Hall-Effect Position Observer Used in
PMSM Torque-Ripple Control, IEEE Transactions On
Industry Applications, Vol. 43, NO. 2, MARCH/APRIL
2007, pp. 560-570.
2. C.-W. Hung and J.-H. Chen, A Hall Sensor Auxiliary
Circuit with Noise Rejection and Time Interval Capture
Functions for BLDC Motors, Sensor Letters, Vol. 10,
2012, pp. 1178–1184.
3. B. Tibor, V. Fedák, and F. Ďurovský, Modeling andSimulation of the BLDC Motor in MATLAB GUI, inProc. 2011 IEEE International Symposium on Industrial
Electronics (ISIE), 27-30 June 2011 pp.1403-1407
4. C.-W. Hung, C.-T. Lin and C.-W. Liu, An Efficient
Simulation Technique for the Variable Sampling Effectof BLDG Motor Applications, in Proc.33rd Annual
Conference of the IEEE Industrial Electronics Society,Nov. 5-8, 2007 (Taipei, Taiwan, 2007), .pp. 1175 - 1179

Published by Atlantis Press
Copyright: the authors
157