You are on page 1of 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/344402248

LabVIEW FPGA Based BLDC Motor Control by Using Field Oriented Control
Algorithm

Conference Paper · September 2020


DOI: 10.1109/SEST48500.2020.9203104

CITATION READS
1 635

4 authors, including:

Guner Tatar Hayriye Korkmaz


Fatih Sultan Mehmet Vakif Üniversitesi Marmara University
7 PUBLICATIONS   18 CITATIONS    43 PUBLICATIONS   88 CITATIONS   

SEE PROFILE SEE PROFILE

Kenan Toker
Marmara University
6 PUBLICATIONS   11 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

PhD Thesis View project

Development of decision support system using Mamdani type fuzzy logic clusters for metabolic syndrome risk assesment View project

All content following this page was uploaded by Guner Tatar on 30 September 2020.

The user has requested enhancement of the downloaded file.


LabVIEW FPGA Based BLDC Motor Control by
Using Field Oriented Control Algorithm
Guner TATAR Hayriye KORKMAZ N. Füsun Oyman SERTELLER
Electrical-Electronic Engineering Electrical and Electronic Engineering Electrical and Electronic Engineering
Fatih Sultan Mehmet Vakıf University Marmara University Marmara University
İstanbul, Turkey İstanbul, Turkey İstanbul, Turkey
gtatar@fsm.edu.tr hkorkmaz@marmara.edu.tr fserteller@marmara.edu.tr

Kenan TOKER
Electrical and Electronic Engineering
Marmara University
İstanbul, Turkey
ktoker@marmara.edu.tr

Abstract—BLDC (Brushless Direct Current) motors are widely the results. For the control of BLDC motors, the rotor position
used today due to its high reliability and high efficiency. Theseand the motor control mechanism must be known. Many meth-
motors are synchronous motors that have a linear relationship ods have been developed in this process. Some of these are
between voltage-speed and current-torque. To control these kinds
of motors, inverters are needed. Inverters create a rotational listed as Trapezoidal Drive Control, Sinusoidal Drive Control,
movement in the motor by switching at the appropriate time Simplified Vector Control, Vector Control (FOC), Sensorless
according to the rotor position information. Rotor position is Trapezoidal Drive Control, Sensorless Vector Control. These
obtained in two ways, with and without sensor. Sensor method methods are generally determined according to the position
uses encoders, resolvers or hall effect sensor. Hall-effect sensors
detection logic in the motor and it is possible to determine
are generally preferred for the control of BLDC motors in
terms of cost. In this study, the rotor position was obtained these positions with suitable software. Here, FOC with FFC
by using hall-effect sensor. Pulse Width Modulation (PWM) as the control method and LabVIEW graphical programming
is used to control the frequency and voltage of the inverters. language were chosen as the software language.
Today, Sinusoidal PWM (SPWM) and Space Vector Pulse Width Similar studies have been taken into account and differences
Modulation (SVPWM) techniques are frequently used in such have emerged. In [6], Speed control for permanent magnet syn-
applications. This study explains the development of a Field
Oriented Control Algorithm (FOC) based on SVPWM technique chronous motors was made using FOC algorithm. However,
by using the LabVIEW FPGA Module for a BLDC Motor. It also the FFC control algorithm was not used. The software part of
shows the effects of using PI and FFC (Feed Forward Control) the study was developed in LabVIEW and Compact-RIO was
algorithm together and separately in the controller for the control
used as the hardware part. Although the motor types used in
of Id and Iq reference currents. In addition, simulation of all this study and [6] are the same, the powers are different. The
project was developed and run in Matlab/Simulink.
Index Terms—BLDC, LabVIEW-FPGA, PI regulators, FFC, feedback sensors are also completely different. In a similar
FOC, hall effect sensors, SVPWM. study [7] Rapid Control Prototyping system has been discussed
which is based on Xilinx System Generator. In this study,
I. I NTRODUCTION FOC algorithm with FFC was discussed to drive the BLDC
motors. Although the study uses the same theoretical structure,
Most of the electrical motors used in industrial applications the software and hardware implementations are completely
are three-phase induction motors or Brushed Direct Current different. In [7], decoder was used as feedback sensor and
Motors. While these two type of motors have low efficiency, single drive inverter board was used as driver. The method-
BLDC and any similar motors have high efficiency and high ology of the study of [8] shows the highest similarity with
power to volume ratio [1]–[5]. Although BLDC motors have our study in terms of development platform. Some LabVIEW
significant advantages, their drive and control operations are code blocks were taken from there, because similar control
more complicated and difficult. Before starting any application method was used. However, the power of the motor used and
on a real system, working on a simulation will provide the user the driver board are different. In addition, the sensors used for
with considerable convenience. For this reason, a platform in the feedback signals are also different. On the other hand, used
LabVIEW FPGA Module was developed to test and monitor power electronic components shows a considerable difference.
the behavior of BLDC motors. In addition, a Matlab /Simulink During the study, NI LabVIEW graphical development
model of the same system was developed in order to compare platform was used to program the test platform, to develop
a user interface for monitoring and logging the results. The
978-1-7281-4701-7/20/$31.00 ©2020 IEEE
model was implemented on sbRIO-9637 development card. Here, np represents pole pairs. Since the rotation speed is the
In the project block diagram; first, software was created in derivative of the rotor position, the relationship between the
LabVIEW FPGA module and then transferred to the FPGA electrical and mechanical rotation speed can be given in (2).
core. This module is a software package that converts graph-
ical code blocks developed in the LabVIEW environment to ωe = ωm np (2)
VHDL and transfers them into the FPGA core. Simulation
in Matlab/Simulink of the test set-up was constructed in Velocity and rotor position are calculated by using feedback
order to evaluate the reliability of the real system. In order data (θ). Current values are calculated with the help of sensors.
to emphasize the positive effect of FFC on PI controller, Since the total amount of symmetric currents are zero ( Ia +
experimental results were given for different motor speeds Ib + Ic = 0), it is sufficient to measure any two of the stator
in no-load condition. The hardware components necessary phase currents.
for driving the electric motors must be selected according
to the torque, speed and the motor type. Each motor has its
own specifications given in the technical documents from the
manufacturers. Therefore, a driver developed for one motor
can not be used for any other motors. In this project, driver
and controller were designed for 1kw light electric vehicles.
The paper organisation is as follows; in Section II system
development and working principle were explained, in Section
III BLDC motor and its equations were given, in Section
IV hardware structure was introduced, in Section V SVPWM
technique was explained, in Section VI software design was
given, in Section VII system simulation was done, in Section
VIII simulation result and the last Section IX conclusion and Fig. 1. Overall Block Diagram of the Project [7]
discussion were announced.
PWM affects the performance of the driver and hence the
II. S YSTEM D EVELOPMENT AND W ORKING P RINCIPLE performance of the motor. The PWM controller is capable
In BLDC motors, control is undertaken by an electronic con- of generating the desired output waveform. While doing this
troller. The controller includes a micro controller that provides some harmonics can occur. These harmonics are produced
semiconductor circuit elements and switching related timing by the iron and copper as it causes the loses to increase
to carry out the high-current switching task. The controller which in turn leads to overheating of the motor. Furthermore,
must follow the rotor position at an appropriate speed so that power loses in the electric motor drive cause electromagnetic
there is no disruption of the motor rotation. For this reason, interference and impact torques.
the rotor position must be precisely determined. That’s why, In the switching circuits driven by the SVPWM method
motor parameters (such as sensitivity, cost, efficiency) and according to the conventional PWM, an output voltage with
speed should also be taken into consideration. In this project, less harmonic content is obtained due to the shape of the input
the closed loop torque control was considered and the Id voltage. Switching circuits are power electronic devices that
flux reference value was taken (assumed) as zero. Among the convert the voltage at the output to the AC voltage at the
existing control methods, FOC algorithm (fig.1) is widely used desired frequency and voltage at the output. Although it is
since it is more efficient than the others [9], [10]. The FOC desirable that the current or voltage curves at the inverter
method is based on the positioning of space vectors. The basic output be sinusoidal, it is inevitable that harmonics which
principal behind this and similar vector control algorithms is often distort the output sinus signal was generated. By using
to enable separate control of the current components forming high-frequency semiconductor circuit elements and switching
the magnetic flux and torque in synchronous or asynchronous techniques, it is ensured that the most of the harmonics gener-
motors. Stator current is required to perform independent ated at the output voltage can be reduced. The development of
control of torque and flux production as specified. The stator the semiconductor elements used in the power converters and
current vectors are projected to the static reference plane as αβ, the digital signal processors having fast processing capabilities
then to the rotational reference as dq [7], [8], [11]. In order to are used for complex conversion and control algorithms. The
understand the concepts mentioned, it is necessary to know the amplitude, phase and frequency of the voltage applied to
difference between the electrical and mechanical position of the motor windings can be changed by applying a suitable
the rotor. The mechanical position is the actual position of the PWM signal to the inverter using the techniques described
rotor shaft, and the electrical position is related to the rotation above. By comparing the control signal generated by the PWM
of the rotor’s magnetic field and it depends on the number of algorithms with the high frequency carrier signal, the inverter
pole pairs. Relationship between two terms is expressed as in sets the "on-off" duration of the semiconductor switching
(1). elements. In this way, a fundamental voltage is produced with
θe = θm np (1) a desired voltage value [11], [12].
III. DYNAMIC BLDC M OTOR E QUATIONS
For vector control of BLDC motors, the stator variables in
the fixed plane must be transformed into the rotating rotor
plane. In this way, it is possible to reduce the degree of the
equations to get a faster solutions [6], [13]–[15]. However,
the speed of the system to be discussed must be known in
the reference plane. The examination of the reference plane is
possible with Park and Clark transformations. In the equivalent
circuit, the current and voltage equations are converted from
three phases to two phases using Park transformations. In this
case, the stator voltage equations in the reference plane of the
BLDC motors are determined by Kirchhoff’s law [14], [16],
[18], [19]. Equivalent equations for d and q values of BLDC Fig. 2. Hardware Structure of the System
motors were given (3) and (4).
IV. H ARDWARE S TRUCTURE
d(Iqs+φ )
Vds = Rs Ids − ωr Lqs Iqs + Lds (3) Figure 2 shows the hardware structure of the system. 1 kW
dt
BLDC motor is fixed on the bicycle wheel. The system was
d(Iqs ) tested by using a 1 kW motor and the results were examined.
Vqs = Rs Iqs + ωr Lds Ids + Lqs + ωr φ (4) The motor parameters used was given in table I.
dt

dφ TABLE I
=0 (5) M OTOR PARAMETERS
dt
Parameters Value Unit
Then; Applied Voltage 24-48 V
d(Iqs ) Rs (Stator Resistance) 0.16 ohm
Vds = Rs Ids − ωr Lqs Iqs + Lds (6) Ls (Stator Inductance) 2.716 mH
dt
T m (Load Torque) 12.12 Nm
Average Power 1 kW
dIqs Average input current 8.1009 A
Vqs = Rs Iqs + ωr Lds Ids + Lqs + ωr φ (7) Number of pole pairs 12
dt
Rated speed 300 rpm
The electromotive force is obtained by (8) Stator Flux Density 1.788 Tesla
J (Inertia) 0.0458604 kgm2
Te = 0.75np(Iqs φ + (Lds − Lqs )Iqs Ids ) (8) Ke (Ideal Back-EMF Constant) 1.36524 Vs/rad
KT (Rated Torque Constant) 1.4967 Nm/A
Since the magnetic flux in the rotor of BLDC motors is
generated by the permanent magnet and the rotor resistance
is very high, the magnetization component of the current V. SVPWM
becomes zero (Ids = 0). In addition, the motors where the In order to apply the correct phase voltage to the stator,
magnets are placed on the rotor surface have no oscillation. the inverter needs an appropriate pulse width modulation
Therefore, the d and q − axis inductance match each other. signal. These PWM signals are obtained by Space Vector
In this case, if the electromagnetic moment is re-arranged. Modulation. The SVPWM converts the two reference vectors
(Vαref , Vβref ) to the appropriate binary key patterns for driv-
Te = 0.75npIqs φ (9) ing the inverter using pulse width modulation. These switching
patterns lead to the induction of voltage in the stator phases
Electrical angular speed and position of the motor are obtained to obtain the stator currents that will produce the desired flux
by (10) and (11). vector [20]. For a better understanding of space vector pulse
width modulation, it is necessary to know the 3-phase inverter
dωr Te − Bωr − TL
= (10) structure.
dt J As fig.3 shows, each phase of the inverter consists of two
lower and upper switch groups. When the upper switch group
dθ (Q1, Q2, Q5) is connected to the positive DC line; the sub-
= ωr (11)
dt key group (Q2, Q4, Q6) is connected to the negative DC line.
Here; In the inverter circuits, there are 2 switches for each cable
Rs : Stator line resistance, Lsq and Lsd : Stator inductance, Isq and 6 switches in total, and those switches drive the motor
and Isd : Stator currents, ωr : Mechanical speed, φ: Magnetic according to the 23 = 8 possible combinations. 000 and 111
flux, Te : Electromagnetic moment, np: Number of pole pairs. of these combinations are not used.
A. PI Controller
Totally, two PI controllers were used. These PI controllers
were taken from the internal PID block running on the FPGA.
It is used by adjusting the PI from the PID block. They
were used to regulate and stabilize the Id and Iq currents
obtained from the Park transformation. Ideal continuous-time
and discrete-time PI controller equations were given in 12, 13.
The LabVIEW code part of the PI blocks was given in fig. 5.
Z
Fig. 3. Inverter Structure [1]
u(t) = Kp e(t) + Ki e(t)dt (12)
n
Kp T X
u[n] = Kp e[n] + e[k] (13)
VI. S OFTWARE D ESIGN Ti
k=0

In this motor control application, LabVIEW graphical devel-


opment platform was preferred. Three main VIs are operating
on two different platforms (PC and sbRIO) and three different
layers of operations (PC, RTOS and FPGA) running simultane-
ously. The study consists of main programs and subprograms
running in parallel. Project screen overview was given in fig.4.

Fig. 5. Internal LabVIEW PID code block

B. Feed Forward Control Algorithm


Another controller that runs parallel to PI controllers is
FFC. Since the feed forward controller can predetermine the
disturbing effects that will affect the throughput, when used
with the feedback control, it can significantly improve perfor-
mance over feedback only [17]. Therefore, feed forward and
feedback controllers were used together. The FFC algorithm
was also used to model the electrical dynamics of the motor
[8]. LabVIEW code block and mathematical equations of FFC
algorithm were given in fig.6 and equations 14, 15 respectively.
The block diagram of FFC algorithm was given in fig.7
together with all other programs.
disd
Vsd = Rs isd + Ld − ωs Lsq isq (14)
dt
Fig. 4. Project Explorer
disq
Vsq = ωs (Ls + disq ) + Lsq + Rs isq (15)
dt
As mentioned earlier, LabVIEW allows to run different
subprograms in parallel. Therefore, all programs run in the
same window. Block diagram including all components of
the FOC algorithm is shown in fig 4. Here, Clark, Park,
inverse Clark, inverse Park transformation, subprograms, feed-
forward control (FFC) algorithm and SVPWM were given
together. The FFC algorithm and PI controllers were described
as follows. Block RAM structure was used for communication
between FPGA and Real-Time operating system. DMA FIFO
(Direct Memory Access First In First Out) structure was used
for user interface and FPGA communication. Fig. 6. FFC algorithm LabVIEW code block [8]
application for one of three phase (U, V, W) was shown in
fig.13.

Fig. 7. Block diagrams of all programs running on FPGA

VII. S YSTEM S IMULATION


To verify the functionality of the application, the system was
simulated in a Matlab / Simulink environment and the results
were obtained. These results were compared with real time
application. Figure 8 shows the Matlab model of the project.
To simulate the system, relatively similar motor equations were
used. Basically in this study, the system was made by using
FFC algorithm and PI controllers and changing PI reference Fig. 9. Matlab/Simulink Simulation Results
parameter values Iq. In the section VIII, the simulation and
real-time application results were given.

Fig. 8. Matlab Model

VIII. S IMULATION R ESULTS


Both fig. 9 and 10 show the Matlab/Simulink and LabVIEW
application results. Different proportional and integral coef-
ficients were tried and simulation results at different speeds
were discussed. As can be seen from the figures 9 and 10,
system response is more reliable when FFC algorithm and PI
controller were used together. In this study, Iq ref = 1 − 5A
and PI parameters for the speeds in the range of 20-120 rpm
were determined as 5.2 and 0.2, respectively. For this case, Fig. 10. LabVIEW-based Real-Time Application Results
Matlab simulation results were given in fig. 11 and 12. Figure
11 shows that three-phase stator currents. Transients response IX. C ONCLUSION AND D ISCUSSION
of the motor in the range of 0-0.04 sec seems unstable. The As a result, the control of the BLDC motor was realized
reason for this is that, like every motor, it draws current above with LabVIEW graphical development platform by using
the desired current at the first start. After 0.04 sec, it changed FOC algorithm. PI controllers and FFC algorithm were used
to the steady state. Figure12 shows that the electromagnetic together in order to keep the reference current at the desired
moment generated by the motor and Isq current. Real time value. For the feedback current data, any two phases of
the motor were used. Hall-effect sensors were used for the CHILEAN Conference on Electrical, Electronics Engineering, Informa-
electrical angle. The results were compared according to the tion and Communication Technologies (CHILECON), 18-20 Oct. 2017.
[2] Ö. Türksoy, Ü. Yılmaz, A. Tan, A. Teke, ‘A Comparison Study of
P I and Iqref parameter values and Matlab simulation results Sinusoidal PWM and Space Vector PWM Techniques for Voltage Source
showed more optimized results than real-time application in Inverter,’ Natural and Engineering Sciences, NESciences, 2017.
fig.9 and fig.10. When the simulation and real-time application [3] Topaloglu, F. Korkmaz, H. Mamur, R. Gurbuz, ’Closed-Loop Speed
Control of PM-BLDC Motor Fed by Six Step Inverter and Effects of
results are compared, the use of both PI and FFC algorithms Inertia Changes for Desktop CNC Machine’, elektronıka ır elektrotech-
instead of PI alone reduced the error rate. The determined PI nıka, ıssn 1392-1215, vol. 19, no. 1, 2013.
parameters and Iqref current values worked well in the range [4] S. Mandal, ‘Speed Control of SVPWM Inverter Fed BLDC Motor
Drive,’ Master Thesis, National Institute of Technology, Rourkela, 2014.
of 20-120 rpm. Motor control can be made at higher speeds [5] Ling Xu, Jian-Guo Song, Qiang-Qiang Lin, "Brushless DC Motor
by using different PI parameter values. Speed Control System Simulink Simulation", 2016 IEEE International
Conference on Power and Renewable Energy, College of Electronic
Information and Control Engineering Beijing University of Technology,
Beijing, China, March 2017.
[6] M. Bevilaqua, A. Nied, J. D. Oliveira, ’Labview FPGA FOC Imple-
mentation for Synchronous Permanent Magnet Motor Speed Control’,
IEEE/IAS International Conference on Industry Applications, 16 March
2015.
[7] M. BORGSTRÖM "Case study of a Rapid Control Prototyping system
based on Xilinx System Generator," Master’s Thesis at KTH/ICT and
ABB AB, Royal Institute of Technology, January 2009.
[8] J. Eriksson and L. Hermansen: ’Rapid prototyping development and
evaluation of Field Oriented Control using LabVIEW FPGA’. Master
Thesis, Mäladalen University, IDT, 2011.
[9] Y. Li, P. Zhang, J. Hang, S. Ding, L. Liu and Q. Wang, "Comparison of
dynamic characteristics of field oriented control and model predictive
control for permanent magnet synchronous motor," 2018 13th IEEE
Fig. 11. Matlab/Simulink simulation result of stator currents at 120 rpm
Conference on Industrial Electronics and Applications (ICIEA), Wuhan,
2018, pp. 2431-2434, doi: 10.1109/ICIEA.2018.
[10] B. K. Nishad and R. Sharma, "Induction Motor Control using Modified
Indirect Field Oriented Control," 2018 8th IEEE India International
Conference on Power Electronics (IICPE), JAIPUR, India, 2018, pp.
1-5, doi: 10.1109/IICPE.2018.
[11] V. Fachbereich: ’Rapid Prototyping System for Control of Inverters and
Electrical Drives’. PhD thesis, Elektrotechnik, Informationstechnik und
Medientechnik der Bergischen Universität, 2008.
[12] S. Khan, R. M. Botez and T. L. Grigorie, "A New Method for Tuning
PI Gains for Position Control of BLDC Motor Based Wing Morphing
Actuators", École de Technologie Supérieure, Montréal, Québec H3C
1K3, Canada, 18 June 2015.
[13] S. B. Özturk, “Modelling, Simulation and Analysis of Low-cost Direct
Torque Control of PMSM using Hall-effect Sensors”, Submitted to the
Office of Graduate Studies of Texas AM University in partial fulfillment
of the requirements for the degree of Master of Science, December 2005.
Fig. 12. Matlab/Simulink simulation results of Isq and Te [N m] [14] Ç. GENÇER, “vektör kontrollü fırçasız da motorun iki seviyeli evirici ile
uzay vektör modülasyonu”, Doğu Anadolu Araştırmaları, Gazi Üniver-
sitesi Fen Bilimleri Enstitüsü, Ankara, 2015.
[15] Manish S Trivedi, Ritesh Kumar Keshri, "Trajectory based predictive
current control for Permanent Magnet Brushless DC motor", 2016
IEEE International Conference on Power Electronics, Drives and Energy
Systems (PEDES), 2016.
[16] Vahid Behjat , Mehrdad Hamrahi, “Dynamic modeling and performance
evaluation of axial flux PMSG based wind turbine system with MPPT
control” Department of Electrical Engineering, Engineering Faculty,
Azarbaijan Shahid Madani University, Tabriz, Iran. Ain Shams Engi-
neering Journal 5, 1157–1166, 2014.
[17] C. Brosilow, B. Joseph, "Feedforward Control,"in Techniques of Model-
Based Control. New Jersey 07458, USA: PH PTR, 2002, pp. 221-240.
[18] S. S. Pate, B.A. Botre, Krishan K., Kausha K., Samarth S., S.A. Akbar,
Y. Biradar, Prabhu K.R., "Modeling and Implementation of Intelligent
Commutation System for BLDC Motor in Underwater Robotic Applica-
tions", IEEE International Conference on Power Electronics. Intelligent
Control and Energy Systems (ICPEICES-2016), 2016.
[19] E Elakkia, S Anita, R Girish Ganesan, S Saikiran, "Design and
Modelling of BLDC Motor For Automotie Applications", International
Journal of Electrical and Electronic Engineering Telecommunications,
Fig. 13. Test Result of stator voltage for one phase Special Issue, Vo1, 1, No. 1, March 2015.
[20] A. Kronberg: ’Salient Pole Motor Inverter Design with Implementation
of Space Vector Modulation’. Master Thesis, Uppsala Universitet, De-
R EFERENCES cember 2012.
[1] G. Tatar, K. Toker, N.F.O. Serteller, H. Korkmaz, ‘A Dynamic Analysis
of BLDC Motor by Using Matlab/Simulink and Mathematica,’ 2017

View publication stats

You might also like