o
Abstrakt
Diplomová práce je zaměřena na problematiku bezsenzorového řízení BLDC
motoru pomocí Rozšířeného Kálmánova filtru. V první části je popsán proces
implementace EKF pro odhad rychlosti a elektrického natočení rotoru. K určení
odhadovaných stavů používá EKF nelineární model BLDC motoru a měření některých
veličin zahrnujících šum. Druhá část práce se zabývá návrhem metodiky měření a
odhadem kvality bezsenzorového řízení BLDC motoru. Nejlepších výsledků bylo dosaženo
analýzou zvlnění celkového proudu vstupujícího do výkonové elektroniky motoru.
V závěru práce bylo ohodnoceno několik algoritmů pro bezsenzorové řízení BLDC
motoru.
Abstract
This thesis is focused on the sensorless control of BLDC motor using the Extended
Kalman filter. In the first section, process of EKF implementation for estimating rotor
speed and electrical angle is described. For this estimation, EKF uses non-linear BLDC
motor model and some measurement containing random noise. Second part deals with
designing methodology to measure and estimate the quality of BLDC motor sensorless
control. Best results were achieved with total current entering power electronics ripple
analyzation. In the last section, several BLDC sensorless control algorithms were
evaluated.
Bibliographic reference
HRBÁČ, Z. Bezsensorové řízení BLDC motoru. Brno: Vysoké učení technické v
Brně, Fakulta strojního inženýrství, 2014. 57 s. Vedoucí diplomové práce Ing. Václav
Sova.
Statutory declaration
I statutory declare, that I wrote master’s thesis “Sensorless control of BLDC motor”
by myself using references mentioned in the list annexed to this thesis.
In Brno: ……………… ……………………
Bc. Zbyněk Hrbáč
Acknowledgements
I would like to thank my supervisor Ing. Václav Sova for methodological,
pedagogical and technical support and valuable advices during the process of completing
this thesis.
List of figures
Figure 1: One slot on pole and phase [1] ............................................................................. 12
Figure 2: Two slots on pole and phase [1] .......................................................................... 13
Figure 3: BLDC motor used during experiments ................................................................ 14
Figure 4: Hall sensor position [2] ........................................................................................ 14
Figure 5: BLDC commutation logic .................................................................................... 15
Figure 6: Back-EMF integration: Zero crossing point [2] ................................................... 16
Figure 7: Kalman filter principle diagram [14] ................................................................... 17
Figure 8: Matlab Function used to calculate KF in Simulink ............................................. 21
Figure 9: Diagram of BLDC motor ..................................................................................... 24
Figure 10: Back-EMF and current ideal wave form ............................................................ 26
Figure 11: Back-EMF function derivation .......................................................................... 29
Figure 12: BLDC with EKF simulation .............................................................................. 30
Figure 13: EKF Matlab function ......................................................................................... 31
Figure 14: Estimated and “measured” speed with error displayed ...................................... 32
Figure 15: Estimated and “measured” rotor’s electrical angle with error displayed ........... 33
Figure 16: Simulated and “measured” Hall sensor output .................................................. 34
Figure 17: BLDC motor sensorless control block diagram ................................................. 35
Figure 18: Sensorless control Simulink model overview .................................................... 36
Figure 19: Control block overview ...................................................................................... 36
Figure 20: Sensorless start block ......................................................................................... 38
Figure 21: Sensorless start Stateflow diagram .................................................................... 39
Figure 22: Simulated and measured Hall position sensor signal comparison ..................... 40
Figure 23: dSPACE ControlDesk ........................................................................................ 41
Figure 24: BLDC signals waveform at 1000 rpm ............................................................... 42
Figure 25: Frequency spectrum of total current at 1000 rpm .............................................. 42
Figure 26: BLDC motor, torque meter and cylindrical break experimental setup .............. 44
Figure 27: Torque meter output ........................................................................................... 45
Figure 28: Torque meter output frequency spectrum .......................................................... 45
Figure 29: One phase current............................................................................................... 46
Figure 30: One phase current frequency spectrum .............................................................. 47
Figure 31: Total current ....................................................................................................... 48
Figure 32: Total current frequency spectrum ...................................................................... 48
Figure 33: Method comparison overview ............................................................................ 49
Figure 34: Torque meter output frequency spectrum .......................................................... 50
Figure 35: Calculated torque frequency spectrum ............................................................... 50
Figure 36: Methods performance comparison ..................................................................... 52
Contents
1 Introduction ................................................................................................................ 11
2 Research ..................................................................................................................... 12
2.1 BLDC motor principles ........................................................................................ 12
2.2 BLDC motor control ............................................................................................. 13
2.2.1 Sensor control ................................................................................................ 14
2.2.2 Sensorless control .......................................................................................... 15
2.3 Kalman Filtration .................................................................................................. 16
2.3.1 State space representation – continuous system ............................................ 17
2.3.2 State space representation – discrete system ................................................. 18
2.3.3 Covariance matrices ...................................................................................... 19
2.3.4 Algorithm steps ............................................................................................. 20
2.3.5 Extended Kalman filter .................................................................................. 21
3 Solution goals ............................................................................................................. 22
4 Solution procedures and results ................................................................................. 23
4.1 BLDC motor equations for Kalman filter ............................................................. 23
4.1.1 Electrical part ................................................................................................. 23
4.1.2 Mechanical part ............................................................................................. 26
4.1.3 State space representation .............................................................................. 27
4.1.4 Extension for EKF ......................................................................................... 28
4.1.5 Simulations using BLDC motor Simulink model ......................................... 29
4.2 Sensorless control using EKF ............................................................................... 34
4.2.1 Used hardware ............................................................................................... 35
4.2.2 Used software ................................................................................................ 35
4.2.3 Simulink algorithm ........................................................................................ 36
4.2.4 Algorithm performance ................................................................................. 39
4.2.5 dSPACE ControlDesk GUI ........................................................................... 40
4.3 Methodology of torque ripple evaluation ............................................................. 41
4.3.1 Torque sensor measurement .......................................................................... 43
4.3.2 Current sensor measurement ......................................................................... 46
4.3.3 Method comparison ....................................................................................... 49
4.4 BLDC motor sensorless control evaluation .......................................................... 51
5 Conclusion ................................................................................................................. 53
6 References .................................................................................................................. 54
7 Symbols and abbreviations ........................................................................................ 56
8 List of attachments ..................................................................................................... 57
11
1 Introduction
BLDC motors are becoming widely used in the industry, from small motors in PC
fans to high power traction ones in electric vehicles. The main advantages of BLDC motor
are high reliability, greater efficiency and longer operating life compared to DC motor.
One of the biggest disadvantages is output torque ripple. In applications, where there is a
need for accurate motor movement, precise position sensors have to be used. If lowest cost
is demanded, sensorless control techniques may be applied.
This thesis is called Sensorless control of BLDC motor, which may be somewhat
confusing. In all applications sensors need to be utilized to control the motor. Sensorless
control means using electrical measurements (phase current, phase voltage, etc.) instead of
Hall position sensors mounted on motor’s non driving side.
This thesis is divided into two main parts. First part (research) provides short
overview of basic BLDC motor principles with possibilities of its control and introduction
to Kalman filter. Second part (solution procedures and results) discusses implementation
of EKF into BLDC motor sensorless control. Also issues with output torque ripple and its
evaluation are described in this section.
12
2 Research
2.1 BLDC motor principles
Brushless direct current motor (BLDC), sometimes called electronically
commutated motor (EC), is structurally similar to synchronous motor with permanent
magnets on the rotor. From synchronous motor, BLDC motor varies by different back-
EMF waveform and distribution of windings in slots. Also, BLDC motor is designed to be
driven by a rectangular shape input voltage. Ideal back-EMF and current waveforms are
shown in Figure 10. At all times, there is one phase without current (commutating phase)
and at the two remaining, current in one is going in the opposite direction as in the other
one.
Three main types of winding distribution are: one slot per pole and phase, two slots
per pole and phase, segmental stator with one coil per pole and phase. All three types are
designed to work with rectangular shape voltages.
One slot per pole and pair is the simplest winding distribution (Figure 1).
Theoretically, output torque should be always constant, independent on rotor electrical
angle. Due to pole coverage, winding inductance and slot spacing (problems with
reluctance torque) output torque is changing with rotation.
Figure 1: One slot on pole and phase [1]
Two slots per pole and pair have lower output torque ripple, because slot spacing is
smaller. At the same number of poles, the number of slots is doubled (Figure 2).
13
Figure 2: Two slots on pole and phase [1]
Motors with segmental stator use different type of winding. Windings are three
separate coils with no crossing. Having constant motor construction volume, output torque
is higher by about 20% compared to the previous two types.
BLDC motor behaves similar to a DC motor, meaning it has a linear relationship
between voltage and rpm, current and torque. Main advantage of BLDC motor is that there
is no mechanical commutation, so the motor is low-maintenance and the lifetime is longer
compared to conventional DC motor. Commutation, or phase change, is done using
feedback signal from Hall position sensor. Based on how the rotor is turned, the converter
switches between phases and rotary motion is created (see Figure 5).
BLDC motor can be bought at a variety of sizes, shapes and power outputs. From
small motors in hard drives to high power traction motors. By shape, motors are divided
into cylindrical and disc-like. Both groups are also split to machines with inner and outer
rotor. More about theory of BLDC motors can be found in [1] and [5].
2.2 BLDC motor control
For correct BLDC motor commutation, it is not necessary to know the rotor’s
electrical angle exactly, but just in which of the six segments (each 60° (1/3π rad) wide) it
is located. This information can be obtained either by using position sensors (sensor
control) or electrical measurements (sensorless control).
14
Figure 3: BLDC motor used during experiments
2.2.1 Sensor control
In a majority of applications, where sensor BLDC control is used, position
information is obtained from a Hall sensors mounted on the motor’s non driving side.
Based on signals from the Hall sensors (Figure 4), transistors in the power electronics are
switched on at a correct sequence to drive the motor (Figure 5).
Figure 4: Hall sensor position [2]
15
Rotor el. angle
Hall sensor states Transistor states
A B C Top A Bot A Top B Bot B Top C Bot C
0π÷1/3π 1 1 0 Off On Off Off On Off
1/3π÷2/3π 1 0 0 Off On On Off Off Off
2/3π÷π 1 0 1 Off Off On Off Off On
π÷4/3π 0 0 1 On Off Off Off Off On
4/3π÷5/3π 0 1 1 On Off Off On Off Off
5/3π÷2π 0 1 0 Off Off Off On On Off Figure 5: BLDC commutation logic
2.2.2 Sensorless control
In cases, where position sensors are eliminated, several methods may be used to
obtain position information. These methods are based on back-EMF, phase voltage and
phase current sensing. Signal-to-noise ratio is rather low at lower speeds, which is a reason
that sensorless control techniques don’t work well at near zero speeds. There is a need for
open loop commutation to start-up the motor. All methods also have to deal with PWM
ripple induction, when PWM control strategies are used. Analog to digital converter should
be synchronized with the PWM frequency to obtain a signal with low noise. When
synchronization is not possible, a low-pass filter needs to be inserted into measuring
process.
Some of sensorless control approaches include: Back-EMF zero crossing detection,
Back-EMF integration, Model based and estimation methods. Detailed description of
BLDC motor sensorless control methods can be found in [2], [3] and [4].
Back-EMF zero crossing detection
Back-EMF zero crossing detection method is one of the simplest sensorless control
techniques. As stated in its name, this approach detects a point, where back-EMF crosses
zero. This happens exactly in half of a commutating phase period, 30° before desired
commutation (Figure 10). When zero crossing is detected, delay of 30° electrical is
realized and then the phases are commutated. This delay varies with rotor speed. Correct
delay is constantly maintained by the control algorithm (counter, etc.).
Back-EMF integration
This technique uses exactly the same zero crossing point as the Back-EMF zero
crossing detection method does. Difference is how the 30° delay is realized. Integration of
16
the back-EMF is used to indicate the correct commutation point. The integrated area stays
approximately the same at different speeds. When the integrator reaches a pre-defined
threshold value, phases are commutated and a reset signal is applied onto the integrator.
Integrator is held in reset state until next zero crossing point occurs. Phase switching
advance can be easily realized by changing the integrator threshold value.
Figure 6: Back-EMF integration: Zero crossing point [2]
Model based and estimation methods
These methods combine system’s model knowledge to produce some kind of
estimate which is then compared with measurement and corrected. These algorithms
include: Adaptive Observer, Extended Kalman Filter, Model Reference Adaptive System
or Artificial Neural Network. Sensorless control method based on Extended Kalman
Filtration, is thoroughly described in this thesis. Papers, also describing theory of EKF
sensorless BLDC motor control method: [7], [8], [9] and [10].
2.3 Kalman Filtration
Kalman filter (KF) is an algorithm for unknown states estimation of state space
system. It uses knowledge of the system and some state measurement containing random
noise. Simple Kalman filter is for linear systems only, for non-linear systems Extended
Kalman filter (EKF) has to be used.
In BLDC sensorless control Kalman filtration was applied to estimate rotor speed
and rotor electrical angle, the simulated Hall sensor signal is then determined from this
signal.
17
Figure 7: Kalman filter principle diagram [14]
2.3.1 State space representation – continuous system
Kalman filter calculates estimate x of state vector x, which cannot be measured
directly. This estimate is done based on the knowledge of the system (linear state space
representation in discrete time), taking into account model’s inaccuracy (covariance matrix
of state noise Q) and inaccuracy of measurement (covariance matrix of measurement R).
Linear state description of the system:
(1)
(2)
, where:
x … state vector
u … input vector
w … state noise vector
y … output vector
v … measurement noise vector
A … state matrix
B … input matrix
18
C … output matrix
D … feedforward matrix (usually = 0)
G … noise matrix
2.3.2 State space representation – discrete system
For KF state space representation in discrete time is needed. State matrix Φ, input
matrix Γ and noise matrix Λ in discrete time:
(3)
(4)
(5)
, where:
Ts … sample time
I … unit matrix
Taking equations (1) and (2) and transferring them to discrete time, we get
(neglecting feedforward matrix D):
(6)
(7)
Transfer from continuous to discrete system can also be easily done by the c2d
command in Matlab, where inputs are the continuous system, sample time Ts, and method
of discretization.
19
2.3.3 Covariance matrices
Covariance matrices set behavior of the filter. One matrix consists of variances and
covariance of two (or more) vectors. Variance defines how one vector is spread out.
Covariance says how much one vector changes with other.
Let’s say we have two vectors X and Y. Equations for mean, variance and
covariance are following (both vectors with finite measured length N):
∑
(8)
∑
(9)
∑
(10)
∑
(11)
∑
(12)
Covariance matrix Q is then:
[
] (13)
If the two vectors are independent, which we suppose they are, covariance equals
zero and covariance matrix simples out:
[
] (14)
Covariance matrices basically define weights of system’s model and measurement.
Matrix Q describes properties of state noise vector w, matrix R describes properties of
20
measurement noise vector v. The bigger the value on diagonals, the less I “trust”
model/measurement.
2.3.4 Algorithm steps
Inputs into Kalman filter are from previous step: state estimate x, covariance
estimate P and system input u. Measurement y is done in the actual step. In following,
notation k|k-1 means calculation in k-th time step considering measurement from k-1 time
step.
First step in the algorithm is prediction based on model, consisting of state estimate
and estimate error covariance matrix:
(15)
(16)
Next step is state and covariance correction based on measurement (output vector
update, output vector error, update covariance, Kalman gain, state estimate update,
covariance estimate update):
(17)
(18)
(19)
(20)
(21)
(22)
At this point, state and error covariance estimates are calculated for current time
step, which are also input for k+1 time step.
21
Figure 8: Matlab Function used to calculate KF in Simulink
2.3.5 Extended Kalman filter
Previous algorithm can be only applied on linear systems. By broadening simple
Kalman filter (Extended Kalman Filter – EKF), states of non-linear systems can be
estimated. State matrix Φ and input matrix Γ ale replaced by local linearization in current
state x, which is calculated in every time step. This linearization leads on using Jacobian
matrix.
Having non-linear system:
(23)
Replacing it with first two terms of Taylor series:
(24)
New equations for state estimate (using Euler integration) and state matrix:
(25)
( ) (26)
Other equations in the algorithm are same as in KF.
22
3 Solution goals
Officially set tasks:
1. Implement and verify advanced method of BLDC sensorless control based on
Extended Kalman Filter.
2. Design methodology to measure and estimate the quality of BLDC sensorless
control, focused on motor’s torque ripple.
3. Apply this designed methodology and compare several BLDC sensorless controls.
Implementation and verification of sensorless control of BLDC motor method
based on Extended Kalman Filter is the first task described in solution procedures and
results. In the beginning, simulations were done to see how EKF behaves with BLDC
motor non-linear model. EKF sensorless control method was then implemented into the
dSPACE Real-time hardware and fine-tuned for best performance.
Methodology to measure and estimate the quality of BLDC sensorless control is
presented in the second part. Torque of a motor can be measured by two main methods:
direct torque sensing and current sensing. Current is then recalculated to torque. Torque
ripple is evaluated from both of these methods. Both methods are also compared to each
other.
Application of proposed methodology and comparison of some BLDC sensorless
control algorithms is shown at the end of the solution procedures and results.
23
4 Solution procedures and results
4.1 BLDC motor equations for Kalman filter
4.1.1 Electrical part
Electrical circuit of a wye wound BLDC motor can be described by following
equations (according to Figure 9):
(27)
(28)
(29)
, where:
u … phase voltage
i … phase current
R … winding resistance
L … winding inductance
M … mutual inductance
e … back-EMF
24
Figure 9: Diagram of BLDC motor
Kirchhoff’s first circuit law:
(30)
If symmetrical motor is supposed:
(31)
(32)
(33)
Considering symmetrical motor (equations 31÷33), Kirchhoff’s first law (equation
30), total inductance substitution Ls = L – M and equations for BLDC motor (27÷29) lead
to following:
25
( )
( )
(34)
(35)
(36)
Back-EMF of each phase is depending on rotor’s speed. The shape is trapezoidal
(Figure 10), with immediate value:
(37)
(38)
(39)
, where:
e … back-EMF
λ … voltage constant depending on motor’s design
ωm … rotor speed (mechanical)
f(φel) … back-EMF prototype function, depending on rotor’s electrical angle
(similar as on Figure 10, but with amplitude of 1)
26
Figure 10: Back-EMF and current ideal wave form
4.1.2 Mechanical part
BLDC motor torque equation:
(40)
, where:
Mi … motor’s inner torque
J … rotor inertia
B … viscous friction coefficient
Mz … torque load
27
Inner torque:
(41)
Equivalence between rotor’s speed and rotor’s electrical angle:
(42)
, where:
p … number of pole pairs
4.1.3 State space representation
Equations 34 ÷ 42 rewritten for state space representation:
(43)
(44)
(45)
(46)
(47)
28
First state equation ẋ = Ax + Bu:
[
]
[
]
[
]
[
]
[
]
(48)
Second state equation y = Cx + Du:
[
] [
]
[
]
[
] [
] (49)
4.1.4 Extension for EKF
Non-linear system representation ẋ = f(x,u):
[
]
[
]
(50)
29
Jacobian matrix:
[
]
[
]
(51)
(52)
Derivations ∂f(x5)/ ∂ x5 are described in Figure 11.
φel ∂fa/dx5 ∂fb/dx5 ∂fc/dx5
0π÷1/3π 6/π 0 0
1/3π÷2/3π 0 0 -6/π
2/3π÷π 0 6/π 0
π÷4/3π -6/π 0 0
4/3π÷5/3π 0 0 6/π
5/3π÷2π 0 -6/π 0
Figure 11: Back-EMF function derivation
4.1.5 Simulations using BLDC motor Simulink model
Main purpose of doing Simulink simulation was to check how the EKF behaves
with BLDC motor system and if it is possible to calculate unknown states from BLDC
motor non-linear model and measurements provided. Simulation with simple KF was done
as well, but KF output signals weren’t corresponding well with BLDC outputs. This was
because KF works with linear models only and cannot fully represent non-linear system as
BLDC motor.
30
Simulations were done with BLDC motor model used in [3]. Outputs of this model
were all necessary signals for EKF (phase voltages, phase currents and torque load), Hall
signals and also rotor speed and rotor electrical angle which were compared with signals
leaving EKF. Simulation layout is shown in Figure 12. Input signals to Kalman are vector
of measured signals y with white noise and input vector u. Output vector is state estimate
x_est.
Figure 12: BLDC with EKF simulation
Main part of whole algorithm, the EKF Matlab function, is shown in Figure 13.
Inputs of this function are: measurement y at current time step, system input u, state
estimate xest and estimate error covariance matrix P from the previous time step, output
matrix C, covariance matrices Q and R, BLDC motor parameters (winding resistance R,
winding inductance L, rotor inertia J, viscous friction coefficient B, voltage constant λ,
number of pole pairs p), time step Ts, back-EMF prototype function f(φel) and its
derivation.
Function was divided into three parts: calculation of linearized matrix Φ, prediction
step and correction step. State matrix was calculated according to equation 26, prediction
step according to equations 25 and 16 and correction step according to 17÷22.
31
Figure 13: EKF Matlab function
Simulation results are shown in Figure 14 and Figure 15. Ripple, in shown
waveforms, is due to the nature of EKF as it is just the best estimate, based on model and
actual inputs.
32
Figure 14: Estimated and “measured” speed with error displayed
33
Figure 15: Estimated and “measured” rotor’s electrical angle with error displayed
Simulated Hall position sensor output was derived out of estimated rotor’s
electrical angle information. Depending on, in which one of six segments (according to
Figure 5) rotor was located, logical signal was sent to the output. This signal was then
compared with “measured” Hall signal (Figure 16).
34
Figure 16: Simulated and “measured” Hall sensor output
4.2 Sensorless control using EKF
After successful simulation shown previously, EKF was implemented into real
BLDC motor control algorithm. The motor was driven sensorlessly using non-linear BLDC
motor model combined with phase current and phase voltage measurements. Sensorless
control algorithm was designed in Matlab/Simulink, then compiled and sent to dSPACE.
ControlDesk functioned as the control environment for model, while compiled and
running. Block diagram showing sensorless control in Figure 17.
35
Figure 17: BLDC motor sensorless control block diagram
Algorithm was running at a frequency of 10 kHz. Better performance couldn’t be
achieved due to EKF high computational requirements.
4.2.1 Used hardware
List of hardware used during experiments:
dSPACE modular hardware (DS2202 HIL I/O Board, DS1006 Processor board)
Three phase Low voltage power module (Microchip MC1L)
BLDC motor (Fulling Motor FL86BLS125)
Torque meter (Burster 8645-5005)
DC motor for torque load
4.2.2 Used software
List of software used during experiments:
Matlab 2011b with Simulink
dSPACE Real-Time Interface
dSPACE ControlDesk
36
4.2.3 Simulink algorithm
BLDC motor sensorless control algorithm in Simulink is split into two main parts
called BLDC motor and Control (Figure 18).
Figure 18: Sensorless control Simulink model overview
BLDC motor block incorporates all inputs and outputs from and to motor and the
Three phase low voltage power module. Transistor logic, Duty and Reset signals were sent
to the power module microcontroller. Fault signal was the fault detection read out of power
module microcontroller. Voltage was sensed directly on dSPACE ADC input terminal.
Phase currents were the Isolated Phase current feedback signals out of power module H-
bridge. Motor load was calculated from the current sensor, reading total current
consumption of power electronics, and the data-sheet torque constant. Hall signal is the
rotor electrical angle indicator from Hall position sensors mounted on motor’s non driving
side.
BLDC motor was driven by a pulse width modulation (PWM). Because of lack of
ADC with PWM synchronization possibility in our dSPACE hardware, digital low pass
filters had to be applied to filter both voltage and current inputs. This led to some
difficulties which are described later.
The control block is a bit more diverse, as shown in Figure 19.
Figure 19: Control block overview
37
EKF Hall sim block is very much similar to one described in 4.1.5. When
initializing the open-loop starting sequence, the EKF occasionally started to approximate to
the opposite direction as the rotor was turning, which led to fault states. That is why a
direction signal was added to the EKF Matlab function (1 indicating stop state and forward
rotation, -1 backward rotation). Outputs of this block were simulated Hall position sensor
logical signal and rotor speed.
Rotor speed is one of two estimated states from EKF used in sensorless control.
Due to use of a low-pass filter, some signal delay was introduced, but more significantly
the sensorless control algorithm wasn’t working well with BLDC motor data sheet
parameters anymore. There was a need for some experimental fine-tuning of parameters to
achieve better performance. Simulated Hall position sensor signals had to exactly
correspond with the measured ones. Simulated Hall position sensor signals were derived
from rotor’s electrical angle, which is an integral of rotor speed. So, when fine-tuning the
parameters of BLDC motor in the model, the main emphasis was on precise match of
simulated and real Hall position sensor signal, not on estimated rotor speed. This is a
reason why the speed output had to be calibrated using a third degree polynomial, to equal
the real rotor speed. Phase switching advance can be easily adjusted by either adding or
subtracting constant out of estimated rotor electrical angle.
Hall signal and direction switch block is a block where simulated and real Hall
position sensor signals were switched between. On the output, there was the Hall logical
signal, sensorless control indicator (0 indicating sensor control, 1 sensorless control) and
direction indicators (1/-1 as described previously and 1 indicating forward rotation, 0 stop
state and -1 backward rotation).
Speed regulator block is just a simple PI regulator to maintain demanded speed,
with duty cycle as an output.
Sensorless start block takes care of open loop initial starting sequence. The main
part is Stateflow chart shown in Figure 21, which then switches between inputs of Hall
switch and Duty switch. Initial state is sensor running state. From here, states can be
switched between sensorless running state and stop state. If stop state and sensorless input
1 are valid, sensorless start open loop sequence is initiated. Rotor turns into certain
position, waits for 0,4 sec and starts to rotate with open loop commutation. When rotor
speed rises above pre-defined value, states change to sensorless running and rotor runs in
closed loop using EKF estimations.
38
Figure 20: Sensorless start block
39
Figure 21: Sensorless start Stateflow diagram
Commutation logic block transferred Hall position sensor signal into transistor
logic signal. Commutation table shown in Figure 5.
4.2.4 Algorithm performance
BLDC sensorless control algorithm presented in this thesis was able to run from
approximately 50 rpm to 3100 rpm (power supply maximum voltage limit). When using
load, algorithm was working without problems up to around 2 Nm of load, then stalled
because of power supply current limit.
Finding covariance matrices was an iteration process to accomplish best EKF
performance. Increasing Q and R meant more noise in process and higher uncertainty in
model or measurement.
40
As stated before, EKF was used to estimate rotor speed and rotor electrical angle,
from which the simulated Hall position sensor signal, used to drive the motor, was derived.
Comparison of real measured and simulated Hall position sensor signal shown in Figure
22.
Figure 22: Simulated and measured Hall position sensor signal comparison
4.2.5 dSPACE ControlDesk GUI
dSPACE ControlDesk was used to control algorithm while compiled and running.
In this algorithm, ControlDesk includes switches to demand rotation direction, speed
demand, sensor or sensorless control and reset button. Hall states indicators, sensorless
indicator and speed display are also incorporated. dSPACE ControlDesk works as an
oscilloscope, with sampling frequency set by Simulink model. Waveforms of any kind can
be displayed and recorded, in Figure 23 phase current and phase voltage shown.
41
Figure 23: dSPACE ControlDesk
4.3 Methodology of torque ripple evaluation
Output torque ripple is one of the biggest issues when using BLDC motor drives. If
torque ripple is significant, it can reduce life-time of accessories connected to BLDC
motor, such as gearbox, etc.
Torque ripple (output torque in general) can be measured by two main transducing
methods: torque sensor or current sensor, current is then recalculated to torque by the
torque constant. In this thesis both methods are described and compared.
Figure 24 provides an overview of BLDC motor signals in time: phase voltage and
phase current on phase A, one of three Hall position sensor signals and total current (total
current measured with the external LEM current sensor). Crosses indicate moment of
phase commutation. This waveform was captured when using sensor control. Frequency
spectrum of total current is in Figure 25.
42
Figure 24: BLDC signals waveform at 1000 rpm
Figure 25: Frequency spectrum of total current at 1000 rpm
43
The most significant frequency is the one at approximately 400Hz, which is the
commutating frequency of BLDC motor:
(53)
, where:
fCOM … commutating frequency
fω … rotor speed in [Hz]
n … number of phase commutations per electrical revolution
p … number of pole pairs
Since the commutating frequency was the most significant element of frequency
spectrum, this was the most focused on frequency, when evaluating output torque ripple.
Mean squared error (MSE) was the method used to evaluate the actual torque
ripple. MSE is a performance function, which measures how much a vector spreads out.
∑
(54)
, where:
N … number of samples
xk …k-th sample of signal
μx … mean
At all methods described subsequently, torque ripple evaluation is shown at 1000
RPM (commutating frequency of 400Hz) to easily compare one technique to another.
Detailed analysis of torque ripple is in [11], [12] and [13].
4.3.1 Torque sensor measurement
Experimental setup can be seen in Figure 26 with BLDC motor, cylindrical break
and torque meter in the middle. When evaluating torque ripple out of torque meter, no
phase switching ripple appears with no load connected. Some loading device has to be
44
attached at all times. Also the breaking device has to rotate as smoothly as possible. When,
for example, a DC motor is linked, the transducer is showing DC motor commutation and
reluctance moment instead of BLDC motor phase switching. This information would be
useless for our purposes.
Figure 26: BLDC motor, torque meter and cylindrical break experimental setup
Figure 27 displays waveform of torque meter output with DC motor acting as a
break, BLDC motor commutation moments are marked. Frequency spectrum is shown in
Figure 28. The most significant frequency is the DC motor commutation at 133 Hz.
Torque meter output with smoother load shown later in this thesis (in Figure 33 and Figure
34).
45
Figure 27: Torque meter output
Figure 28: Torque meter output frequency spectrum
46
4.3.2 Current sensor measurement
When assessing torque ripple out of current sensor measurement, no load needs to
be connected. Ripple is clearly visible from low to high speeds.
Torque ripple can be evaluated by two different current measurements: phase
current and total current. Phase current would be more suitable, since phase current sensors
are already utilized in EKF sensorless control algorithm. Waveform of this measurement
(measured without load) is demonstrated in Figure 29 frequency spectrum in Figure 30.
Figure 29: One phase current
47
Figure 30: One phase current frequency spectrum
As we can see on the figures above, commutation torque ripple cannot be clearly
visible. This method is therefore useless for our purposes.
Measuring total current entering power electronics demonstrated best results.
Commutation torque ripple is clearly visible in waveform in Figure 31 and also in
frequency spectrum in Figure 32.
48
Figure 31: Total current
Figure 32: Total current frequency spectrum
49
4.3.3 Method comparison
Method comparison was done to see how the total current method is compared with
torque meter output. Series of measurement was done at different rotor speeds with and
without load. Waveform shown below is at 500RPM. Smooth cylindrical break connected
to torque meter (Figure 26) acted as a breaking mechanism. Figure 33 shows both methods
compared in time. Frequency spectrum of torque sensor measurement is in Figure 34,
torque measurement using current sensor frequency spectrum in Figure 35.
Waveforms of both methods are similar at lower speeds. From about 800 RPM
commutation ripple on torque meter output begins to be less visible. This is due to high
mechanical time constant of BLDC motor, torque meter and cylindrical break system.
Cutoff frequency of the transducer is 1 kHz, which shouldn’t influence output at these
speeds.
Figure 33: Method comparison overview
50
Figure 34: Torque meter output frequency spectrum
Figure 35: Calculated torque frequency spectrum
51
4.4 BLDC motor sensorless control evaluation
Taking into account all methods described above, technique using total current
entering power electronics was chosen as the best one to evaluate sensorless control. This
method does not need any measuring device or load connected to BLDC motor output
shaft, so the ripple assessed is the one that is really caused by phase commutation. For
better ADC scaling, the external Hall current sensor was connected to the FPGA card
incorporated in the dSPACE modular hardware and then processed. Sampling frequency of
the input signal was 10 kHz. No filter was applied to smooth out or adjust the signal. Mean
squared error was the performance criteria.
Several BLDC sensorless controlling techniques were evaluated: sensorless method
using EKF described in this thesis, sensorless method using EKF with phase switching
advance of -0.1 rad, sensorless method described in [4] and a commercially accessible
controller (RC speed regulator). Also the sensor control method was compared.
Sensorless methods using EKF and described in [4] behaved similar with sensor
control. Second mentioned stopped working at about 1350 RPM. Commercially accessible
controller showed the worst performance. Lastly evaluated was the EKF method with
phase switching advance. At lower speeds, this method performed better than the one
without phase advance. At higher speeds, both variations were the same. Figure 36 shows
performance of all methods evaluated.
52
Figure 36: Methods performance comparison
0,00
0,20
0,40
0,60
0,80
1,00
1,20
1,40
100 300 500 700 900 1100 1300 1500
MSE
[N
m2 ]
Rotor speed [RPM]
Method comparison
Sensors
EKF
Sensorless [4]
Commercial
EKF - Phase adv.
53
5 Conclusion
The thesis thoroughly described implementation of Extended Kalman filter into
brushless direct current motor sensorless control algorithm. This control method was
working well from low to high speeds with or without load. Open loop commutation was
needed to start-up the motor.
First part (research) delivered an overview of BLDC motor principles and described
some methods used to control the motor (both with position sensors and sensorlessly).
Also, short introduction to Kalman filter was provided here.
Second section (solution procedures and results) described application of EKF into
BLDC motor sensorless control. After simulations, EKF was implemented into real BLDC
motor control algorithm. Control technique presented in this thesis was able to run from
approximately 50 rpm to 3100 rpm (power supply maximum voltage limit). When using
load, algorithm was working without problems up to around 2 Nm of load, then stalled
because of power supply current limit.
Possible methodologies to measure and estimate the quality of BLDC sensorless
control (with focus on output torque ripple) were discussed in the last part of this thesis.
Technique using total current entering power electronics provided best results during
experiments. Mean squared error was the performance criteria. At the end, several BLDC
motor control algorithms were evaluated. Sensorless method using EKF behaved similar as
the sensor control.
54
6 References
[1] VOREL, P.: Synchronní stroje s permanentními magnety. Brno: Akademické
nakladatelství CERM, s.r.o., 2005. 80-7204-417-6.
[2] GAMAZO, J.C.; VÁZQUEZ, E.; GÓMEZ, J.: Position and Speed Control of Brushless
DC. Valladolid, Spain: University of Valladolid, 2010.
[3] KRIŽAN, J.: Bezsenzorové řízení BLDC motoru. Brno: Vysoké učení technické v Brně,
Fakulta strojního inženýrství, 2012. str. 70. Vedoucí diplomové práce doc. Ing. Robert
Grepl, Ph.D.
[4] SOVA, V.: Využití FPGA pro řízení a modelování BLDC motoru. Brno: Vysoké učení
technické v Brně, Fakulta strojního inženýrství, 2013. str. 67. Vedoucí diplomové
práce doc. Ing. Robert Grepl, Ph.D.
[5] SKALICKÝ, J.: Elektrické servopohony. Brno: Vysoké učení technické v Brně, Fakulta
elektrotechniky a komunikačních technologií, 2002. 80-214-1978-4.
[6] GREPL, R.: Podklady a příklady k předmětu RPO: Pohonové soustavy. Brno: Vysoké
učení technické v Brně, Fakulta strojního inženýrství, 2013.
[7] VESELÝ, L. Algoritmy bezsnímačového řízení synchronního motoru s permanentními
magnety. Brno: Vysoké učení technické v Brně, Fakulta elektrotechniky a
komunikačních technologií, 2013. 122s. Vedoucí disertační práce doc. Ing. Pavel
Václavek, Ph.D.
[8] LENINE, D.; RAMI REDDY, B.; VIJAY KUMAR, S.: Estimation of speed and rotor
position of BLDC motor using Extended Kalman filter. International Conference on
Information and Communication Technology in Electrical Sciences. 2007.
[9] DHAOUADI, R.; MOHAN, N.; NORUM, L.: Design and implementation of an
extended Kalman filter for the state estimation of a permanent magnet synchronous
motor. IEEE Transactions on Power Electronics. 1991.
[10] TERZIC, B.; JADRIC, M.: Design and implementation of the extended Kalman filter
for the speed and rotor position estimation of brushless DC motor. IEEE Transactions
on Industrial Electronics. 2001.
[11] ZIAEINEJAD, S.; SANGSEFIDI, Y.; SHOULAIE, A.: Analysis of commutation
torque ripple of BLDC motors and a simple method for its reduction. International
Conference on Electrical Engineering and Informatics (ICEEI). 2011.
55
[12] BYOUNG-HEE, K.; CHOEL-JU, K.; HZUNG-SU, M,; GYU-HA C.: Analysis of
torque ripple in BLDC motor with commutation time. IEEE International Symposium
on Industrial Electronics, 2001.
[13] RANSARA, H.K.S.; MADAWALA, U.K.: A technique for torque ripple
compensation of a low cost BLDC motor drive. IEEE International Conference on
Industrial Technology. 2013.
[14] EM, veidt.: General State Estimation Techniques. [Online] 12. August 2013. [Citace:
4. May 2014.] http://wiki.ldv.ei.tum.de/tiki-
index.php?page=2.+General+State+Estimation+Techniques.
[15] Matlab/Simulink, Mathworks, Inc.: http://www.mathworks.com, 2014
[16] Modular Hardware, dSPACE GmbH: http://www.dspace.com, 2014.
[17] BLDC motor FL86BLS125, Smart Motor Devices OÜ: http://www.stepmotor.biz,
2014
[18] Three phase Low voltage power module MC1L, Microchip Technology, Inc.:
http://www.microchip.com, 2014
[19] Torque meter 86445-5005, burster praezisionsmesstechnik gmbh & co kg,
http://www.burster.com, 2014
56
7 Symbols and abbreviations
Symbol Meaning
A State matrix
ADC Analog to digital converter
B Input matrix
B Viscous friction coefficient
C Output matrix
D Feedforward matrix
e Back-EMF
EKF Extended Kalman filter
f(φel) Back-EMF prototype function
fCOM Commutating frequency
fω Rotor speed
G Noise matrix
I Unit matrix
i Phase current
J Jacobian matrix
J Rotor inertia
K Kalman gain
KF Kalman filter
L Winding inductance
Ls Inductance substitution
M Mutual inductance
Mi Motor inner torque
Mz Torque load
n No. of phase commutations
N Number of samples
P Covariance estimate
p Number of pole pairs
Q Model covariance matrix
R Measurement covariance matrix
R Phase resistance
S Covariance update
Ts Sample time
u Input vector
u Phase voltage
v Measurement noise vector
w State noise vector
x State vector
y Output vector
Γ Input matrix (discrete time)
Λ Noise matrix (discrete time)
λ Voltage constant
Φ State matrix (discrete time)
φel Rotor electrical angle
ωm Mechanical rotor speed
57
8 List of attachments
EKF simulation with BLDC motor files:
(1) Simulation_EKF_BLDC.m
(2) Simulation_BLDC_EKF.mdl
EKF sensorless BLDC motor control files:
(3) dSPACE_EKF_BLDC.m
(4) dSPACE_BLDC_EKF.mdl
Datasheets:
(5) BLDC_FL86BLS125.pdf
(6) Power_module_MC1L.pdf
(7) Torque_meter_8645-5005.pdf