Sunteți pe pagina 1din 4

International Conference on Advancement in Electrical and Electronic Engineering

P-020
22-24 November, 2018, Gazipur, Bangladesh

Design and Implementation of a FPGA Based


Closed Loop Speed Controller for DC Motor using
PWM Technique
Joni Barua Md. Anwarul Abedin
Dhaka Power Distribution Company Department of Electrical and Electronic Engineering
Limited Bidhyut Bhabon, 1, Abdul Goni Dhaka University of Engineering & Technology ,
Road , Dhaka – 1000 , Bangladesh Gazipur, Gazipur – 1700, Bangladesh
jonibarua.eee@gmail.com abedin@duet.ac.bd

Abstract − DC motors are used in many applications like in lathe In FPGA logic functions are implemented like
machines, centrifugal pumps, fans, blowers, conveyors, lifts, components connected in bread boards for testing. FPGAs are
weaving machine, spinning machines, etc. The speed controlling often used for prototyping because of their short time for
of a DC motor using FPGA as a digital controller provides an programing and insertion into board. Since high-end FPGAs
operational control using PWM technique. In the present work have millions of gates so they have significant advantages
Xilinx Spartan-6 Nexys3 FPGA board has been used as over ASICs. Designing a FPGA is not only easy but also, they
controller. FPGA’s flexible architecture reduces the processing have lower development costs and possibility to speed
speed, increases accuracy, robustness and hence increases the products to market. FPGAs are also superior to the software-
overall systems efficiency. The control system used in this work
based controllers due to their compactness, reduced power
is closed loop control system, so if the speed of the motor is
changed for any reason the controller changes the duty cycle of
consumption and high speed. Moreover, due to the parallel
the PWM and keep the speed of the motor constant to its input processing capabilities FPGAs are used for many complex
reference speed. For different speeds it generates different duty system implementations ranging from pattern recognition to
cycle of PWM signal. The system is tested for a 12 V DC motor security algorithms which have complex architecture.
for a reference speed of 15 and 17 rps respectively. The In [4] a speed controlling system of a DC motor has been
average percentage error of the measurement is only around 5.5 done based on AT89S51. It uses a mechanical switch to
percent. change the width of the PWM wave to control the speed of
Keywords — FPGA, PWM, DC Motor, VHDL
the DC motor. R. Mondal et. al. [5] proposed a speed control
skim of a DC motor using 8051 microcontroller. A DC motor
of 12 Volt, 1000 rpm, zero crossing detector and a
I. INTRODUCTION tachogenerator have been used in the above-mentioned paper.
Motors are used in different places of our livelihood like The control circuit of this system is very complex.
in houses, in computers and in cars. Since the supply voltage In this paper, design and implementation of a pulse width
is usually AC, DC motors have limited application in modulation (PWM) based DC motor controller using FPGA
ordinary works. However, in steel mills, mines, elevators, is presented. This system will be a closed loop system so, if
lathes, drills, cranes, boring mills, shapers, spinning & there is any change in the speed of a DC motor compared to
weaving machines, sewing machines, electric traction, air the reference speed the controller will automatically change
compressor, vacuum cleaner etc. DC motors are commonly the speed by changing the duty cycle of the PWM signal.
used converting alternating current [1]. The superiority of DC
motors over AC motors are the speed/torque characteristics
[2]. This is why for industrial applications DC motors are II. DC MOTOR CONTROL BY PWM TECHNIQUE
popular like three-phase induction motors. The speed The characteristics curve of a DC motor is shown in Fig
controlling of DC motors has much more importance due to 1. Here, power vs. speed and torque vs. speed curves are
their sophisticated applications. shown.
The speed of a DC motor can be controlled by designing
an analog speed control system or a digital speed control
system. Software based speed control of a DC motor has
much popularity but in order to run that software
microprocessor, programmable logic controller, digital signal
processor (DSP) are used. These software-based techniques
employ memory processor interaction. The programs are
usually stored in memory while the action of fetching,
decoding and execution is done by the processor itself [3].
The speed controlling process of DC motors using
microprocessor and DSPs is old and well known. With the
increase of system size and complexity; application specific
integrated circuits (ASIC) are utilized. Manufacturing
process of ASIC takes several months before it can be used
after testing. With the passage of time, digital controllers are
taking new shapes and in this connection field programmable Fig. 1: Characteristics Curve of DC Motor
gate array (FPGA) comes into action.

978-1-5386-8252-4/18/$31.00 ©2018 IEEE


The concept of pulse width modulation is the variation The block diagram of the FPGA and PWM based DC motor
of average value of a signal by varying the duty cycle of control system is shown in Fig. 3. Here, FPGA is the main
pulse. PWM or duty-cycle variation is one of the techniques controller it takes the speed signal from the speed sensor and
for DC motor speed control. Duty cycle is nothing but the compares the signal with the reference. According to the error
ratio of pulse width to one cycle time of PWM signal. In it generates the modified PWM signal then feed to the motor
PWM signal 0% duty cycle represent the zero voltage, 25% drive to control the motor speed.
duty cycle means 1.25 V, for 50% and 75% duty cycle the
DC value will be 2.5 V and 3.75 V respectively if a 5 V DC The flow diagram of the system is shown in Fig. 4.
is taken as supply voltage and so on. Thus, by varying the
pulse width the average voltage supplied to the DC motor can
be varied and hence the speed.
In the present work, the speed of a 12V DC motor is
controlled by PWM technique. The PWM signals are
generated by using Xilinx Spartan-6 (Digilent Nexus 3)
FPGA board shown in Fig. 2. FPGA board is configured with
Very High Speed Integrated Circuit Hardware Description
Language (VHDL) program using ISE Design Suite 14.2.
Digilent Adept loader is used to configure the FPGA board
by transferring the program from computer to FPGA board.

Fig. 4: Flow diagram of the motor controller


Fig. 2: Digilent Nexys 3 Board

III. RESULTS AND DISCUSSION


FPGA behavioral design was done using Xilinx ISE
Design Suite 14.2 in VHDL language. The whole program
was written and synthesized in this software and finally
bitstream file was generated. This bitstream file is then loaded
to Digilent Nexys 3 FPGA board using Digilent Adept
software. Then the speed of the DC motor is controlled by the
FPGA according to the input reference speed. The output data
was taken using oscilloscope and the oscilloscope was
connected with computer using Easy Scope-3.0 interfacing
software. The speed of the DC motor calibrated by
oscilloscope and digital tachometer. Different graphs were
drawn using the output data obtained.
The implemented hardware is shown in Fig. 5. PWM
signals are generated by FPGA to feed the motor driver
circuit to control the speed of the DC motor. Since this is a
closed loop control system, initially the duty cycle of PWM
starts increasing from its zero value according to reference
input speed. The motor starts rotating and the speed of the
motor is fed back to the FPGA where it compares the speed
of the motor with the input reference speed. If the motor
Fig. 3: Block diagram of the DC motor controller
speed is lower than the reference speed, it increases the duty
cycle and hence motor speed is increased. If the motor speed
is higher than the reference speed then it decreases the duty Here the control system is closed loop hence the motor
cycle of PWM thus motor speed is decreased. In this way the speed is continuously read by sensor and feedback to FPGA.
controller will try to make the motor speed exactly equal to Sensor generates electrical pulse which gives as input to a
the input reference speed. counter inside the FPGA. It counts the pulse and gives the
speed in rps. Then the speed is compared with the reference
input speed. From the difference between the reference input
speed and feedback speed it decides which duty cycle of
PWM signal is required.
Before using the FPGA for closed loop control we have
checked the speed of the DC motor by manually changing the
duty cycle of the PWM signal. Fig. 7 shows the different
value of speed of the DC motor by varying the %duty cycle
of the PWM wave. After getting the value of %duty cycle
required for different speed we have set the value in the
FPGA for closed loop control.

Fig. 5: Implemented hardware

Figure 6 shows PWM signal of different duty cycle


generated by FPGA. When a certain reference input speed is
given to the FPGA, PWM signal of different duty cycle are
obtained. Initially the duty cycle of the PWM signal was zero
percent which is the first wave shape of Fig. 6. Then the duty
cycle of the PWM signal is increased gradually. Finally, after
a certain time the duty cycle of PWM is around a constant
value when the motor speed is exactly equal to the input
reference speed.

Fig. 7: %Duty cycle of PWM versus speed of the DC motor

Fig. 6: PWM signals of different duty cycle generated by FPGA Fig. 8: Comparison between real speed and measured speed
We have also checked whether the FPGA showing the IV. CONCLUSION
correct speed of the DC motor in its LCD display. The signal
of speed is coming from the speed sensor placed adjacent to FPGA based PWM controller for speed control of DC
the DC motor. To get the correct reading of the speed we have motor is fast, accurate, and robust. Our proposed system for
connected a small plastic fan in the shaft of the motor. To get controlling the speed of the DC motor worked accurately.
the real speed value of the DC motor Extech 461895 FPGA based controller succeeded to generate desired duty
optical/contact tachometer have been used. The comparison cycle of PWM signal to control the speed of the DC motor as
the reference input speed. Finally, we compare the speed
value of speed taken from the tachometer and FPGA are
displayed on the seven-segment display of FPGA board with
shown in Fig. 8.
the speed measured by a digital tachometer. The average
We have also calculated the percentage error of the percentage error of the measurement is only around 5.5%.
measurement by FPGA using the optical sensor. The real and Therefore, it can be concluded that the FPGA based PWM
measured value of the speed of the DC motor along with controller can control the speed of a DC motor perfectly.
%Error of the measurement is shown in Table I.

Table I: The real and measured value of the speed of the DC motor along REFERENCES
with %Error of the measurement
[1] P. J. Cheng, C. H. Cheng and C. C. Tung, “Design of DC motor's torque
control using DSP,” Journal of Information and Optimization
Real Measured Sciences, Vol. 30, Issue 6, pp. 1197 – 1207, 2009.
Sl. Speed Speed %Error
(rps) (rps) [2] N. Tripathi, R. Singh and R. Yadav, “Analysis of Speed Control of DC
Motor – A review study,” International Research Journal of
1 14.42 15 3.86 Engineering and Technology (IRJET), Vol. 02 Issue 08, pp.
2 16.35 17 3.82 1616 – 1621, Nov 2015.
3 20.84 22 5.27 [3] V. Gupta, K. Khare and R. P. Singh, “Efficient Design and Fpga
4 24.45 25 2.20 Implementation of Digital Controller Using Xilinx SysGen,”
International Journal of Electronics Engineering, Vol. 2, Issue 1, pp.
5 27.03 28 3.46 99-102, 2010.
6 29.50 32 7.81 [4] Z. Liu and L. Jiang, “PWM Speed Control System of DC motor Based
7 35.17 37 4.95 on AT89S51,” International Conference on Electronic & Mechanical
8 43.00 46 6.52 Engineering and Information Technology, pp. 1301-1303, August
2011.
9 47.17 50 5.66
[5] R. Mondal, A. Mukhopadhyay and D. Basak, “Embedded System of
10 50.00 54 7.41
DC Motor Closed Loop Speed Control based on 8051
11 54.34 57 4.67 Microcontroller,” Procedia Technology, Vol. 10, pp. 840-848,
12 55.00 60 8.33 December 2013.
13 59.67 64 6.76
14 63.34 69 8.20
15 69.34 72 3.69
Average %Error 5.51

S-ar putea să vă placă și