Design and Implementation of PID Controller For Motor Position Control
Design and Implementation of PID Controller For Motor Position Control
ISSN 2229-5518
Abstract— This research describes the design, simulation and implementation of PID controller for a DC motor position control on FPGA. Recently
“Field Programmable Gate Array” has become an alternative solution for the realization of Digital PID controllers. DC motor is controlled by the PID con-
troller. The main duty of PID controller is to obtain a desired response using the characteristics of Proportional (P), Integral (I) and Derivative (D) control.
Each control has its own specifications. So, the motor position could vary depending on a different control effects. Mostly, the motor position can be con-
trolled by changing rotation signal that contains Pulse Width Modulation (PWM). This paper presents the comparative study of P, PI and PID controllers
for the position control of the DC motor. PID controllers require exact system modeling if the system has parameter verification. In this paper, the chang-
es of output of DC motor will be described with MATLAB using PID controller. And then, according to the MATLAB result, the DC motor is implemented in
FPGA board with PID controller by hardware programming method.
Index Terms— PID controller, DC motor position control, FPGA board, Pulse Width Modulation (PWM), System modelling, Parameter
verification, MATLAB.
—————————— ——————————
1 INTRODUCTION
IJSER
T oday, there are many factories in the world in this era of tech-
nology and high technologies are developing to produce the best
quality products. Therefore, good performance machines are
2 OVERVIEW OF THE SYSTEM
also necessary. To get good performance, modern control systems The main object of this paper is to control the position of the DC
are needed. The idea of the position control system is to maintain the motor to get the desired angle. The angle of motor is variable when
position of the DC motor at the desired value under various condi- input voltage is applied. To get only the desired set-point angle of
tions. A number of control scheme such as proportional (P), propor- motor when input voltage is applied, the PID controller will really
tional integral (PI), proportional integral derivative (PID), adaptive need for that. PID attempts to correct the error between a measured
and fuzzy logic controller (FLCs) are used for control of position of process variable and a desired response. In this system, the PID algo-
DC motors. The proposed controller system uses the PID control for rithm that is added to the system becomes a closed loop system. A
position control of DC motor due to its simplicity, clear functionali- simulation using MATLAB software is implemented to tune PID
ty, applicability and PID controllers are used in more than 95% of algorithm by changing the value of Proportional gain (KP), Integral
the industrial process control applications. gain (KI) and Derivative gain (KD) to get desired response for DC
With technological advancement in the field of microelectronics, motor which is less overshoot and increase settling time.
new digital solutions such as FPGAs (Field Programmable Gate Ar-
ray) are available and can be used as targets for the implementation
of digital control algorithms. FPGA-based controllers offer ad-
vantages like high speed, complex functionality, low power con-
sumption and reducing the design cost of the system. Another
advantage of FPGA based platforms is their capability to execute
concurrent operations, allowing parallel architectural design of
digital controllers. Therefore, the FPGA based PID controller is
more flexible than general MCU such as PIC, ARDUINO etc.
————————————————
• Nu Nu Ye is currently serving in Faculty of Electronic Engineering in Fig. 1. Block Diagram of Overall System
University of Technology(Yadanarpon cyber City), Myanmar, E-mail: za-
woo.sp@gmail.com To verify the PID controller on FPGA, the value of PID gains
will also need. The motor parameters cannot get easily even from its
manufacturing factory. Therefore, the motor’s parameters have to
estimate to evaluate the PID gains from MATLAB Tuning. At the
end of the thesis, the position of the DC motor should be maintained
at the desire angle even the supply voltage is varied.
IJSER © 2019
http://www.ijser.org
International Journal of Scientific & Engineering Research Volume 10, Issue 8, August-2019 430
ISSN 2229-5518
In this proposed system, the degrees that the user selects will run
to the DC motor with the help of PID controller and the block dia-
gram for overall system can be seen in Fig. 1. This research provides
a detailed hardware design and procedure to build the system. DC
motor position is controlled by using FPGA Board with modern con-
trol system (PID). In this system, the quadrature encoder provides
the output signal of the DC motor.
IJSER
motor’s parameters cannot get easily from online and even manufac-
turing factory, Therefore, the Motor parameters will have to estimate
using MATLAB Simulink and ARDUINO Board since that parame- 3.2 Testing for Motor Parameter Estimation with
ters are needed when the PID gains are evaluated. In this design, Arduino and MATLAB
Pololu Gear Motor is mainly used.
Arduino UNO is used to drive the DC motor and to read the en-
coder outputs. Any microcontroller with 2 interrupt pins and 2 digital
outputs can be used instead.
IJSER © 2019
http://www.ijser.org
International Journal of Scientific & Engineering Research Volume 10, Issue 8, August-2019 431
ISSN 2229-5518
IJSER
4.2 PI-Controller Control Result
Running MATLAB m-file in the command window for closed
Fig. 6. Simulink Model for Motor Parameter Estimation Process loop PI-controller with motor transfer function is shown in Fig. 9 and
KP=4.2 and KI=6.3. It shows that the rise time becomes 0.873 and
the overshoot is 3.57% and the settling time is 2.82 by small amount
of change. By using final value theorem, the steady state error is
reduced to 1-1=0 since the final value of the output is 1. So ess is
eliminated.1.
TABLE 1
Output Result and Error Analysis for Four Set Points
Set Current P- I- D- Error
point Value Gain Gain Gain
Fig. 10. PID-Controller Step Response
By comparing the results of P, PI and PID controllers in manual
45 44 4 5 0 2.2%
tuning result, PID controller is suited to implement this system.
Therefore KP=4, KI=5 and KD=0 are used in program for implemen- 90 89 4 5 0 1.2%
tation. 180 180 4 5 0 0%
270 269 4 5 0 0.4%
5 HARDWARE TEST AND RESULT OF MOTOR AND
FPGA BOARD 6 CONCLUSION
The hardware program for the implementation of motor control The proposed system has benefits. Since motor modeling is gen-
system with PID controller includes five sub modules in one main eral type, any type of motor can be modeled by knowing its parame-
IJSER
program. That sub modules are pid fsm module, display module, ters. The difficulties of the PID gain can be reduced because the de-
quadrature decoder, pwm module, frequency divisor module and tail facts of PID tuning methods are presented. The methods of im-
ROM for LCD display module. The program is testing with Quartus plementing PID controller with hardware programming method can
II software and implements the program with FPGA DE2-115 Board be known and easily implemented in real world. The FPGA based
and the result is shown in Fig. 11. implementation system is flexible than general MCU and it has rapid
prototyping. The usages of MATLAB software and Quartus II soft-
ware are studied for control systems.
ACKNOWLEDGEMENT
I am grateful to my teachers for providing me an opportunity to
do this research work. I am also special thanks for my pupils for their
help. I am deeply indebted to my parents and my husband, for their
support through out the period of work.
REFERENCES
[1] Allen Houng. “Interfacing a DC Motor with an FPGA”. Terasic Technolo-
gies.Aug10,2011
Fig. 11. Testing the Overall Program in Quartus II Software
https://www.scribd.com/document/213624403/Implementation-of-a-Pid-
Controller-Embedded-in-a-Fpga-for-Positioning-a-Dc-Motor.
[2] BM. Chen. Personal Course Website EG1108 Electrical Engineering Part 2-
Chapter 4:http://vlab.ee.nus.edu.sg/bmchen/courses/EG1108_DCmotors.pdf.
[3] Jose Carlos Gamozo-Real, Ernesto Vazquez-Sanchez and Jaime Gomez-Gil,
“Position and Speed Control of Brushless DC Motors Using Sensor less
Techniques and Application Trends”,
https://www.mdpi.com/1424-8220/10/7/6901/pdf.
[4] K.B.T.M. Khali, “PID controllers”.
http://ospid.com/blog/what-is-pid-control.
[5] Kemal ARI,Faik Tekin ASAL and Mert COSGUN,“P, PI, PID Controller”.
https://pdfs.semanticscholar.org/d149/c7ad9deba6d0f3a7a615a48fbd11fc16a
1a8.pdf.
Fig. 12. Result of 45 Degree Setpoint [6] Su Su Yi (Nov, 2015). “DESIGN AND SIMULATION OF SERVO MOTOR
IJSER © 2019
http://www.ijser.org
International Journal of Scientific & Engineering Research Volume 10, Issue 8, August-2019 433
ISSN 2229-5518
IJSER
IJSER © 2019
http://www.ijser.org