© 2020 | International Journal of Scientific Research in Science and Technology
IJSRST | Volume 7 | Issue 3 | Print ISSN: 2395-6011 | Online ISSN: 2395-602X
DOI : [Link]
Speed Control of DC Motor Using PID and Arduino
Zaw Ngwe*, Aye Aye Tun
Department of Electronic, Technological University, Maubin, Myanmar
ABSTRACT
This paper is aim to research the Proportional Integral Differential (PID) controller design and selection of
various Proportional, Integral and Differential control parameters. MATLAB is allows matrix manipulations,
plotting of functions and data, implementation of algorithms. An additional package, Simulink, adds
graphical multi-domain simulation and model-based design for dynamic and embedded systems. MATLAB is
used to implement the Proportional Integral Differential (PID) controller, it is used to control the speed of
DC motor and bring it at the desired speed. PID parameters Kp , Ki and Kd are finely tuned to optimal values.
And then a ARDUINO UNO microcontroller is programmed by adding the finely tuned PID algorithm to
control the speed of DC motor.
Keywords: PID, MATLAB, Arduino Uno, DC Motor
I. INTRODUCTION II. DC MOTOR
DC motor have been widely use in high-performance A direct current or DC motor, converts electrical
electrical drives. There are various differences DC energy into mechanical energy. It is one of two basic
motors in the market and all with it good and bad types of motors: the other type is the alternating
attributes. The bad motor is the lag of efficiency, and current or AC motor. Among DC motors, there are
therefore to solve this problem a Proportional– shunt-wound, series-wound, compound-wound and
Integral–Derivative (PID) controller is designed in permanent magnet motors.
this paper. PI controller is a generic control loop
feedback mechanism widely used in industrial control
systems. A PI controller attempts to correct the error
between a measured system variable and a desired set
point. It is calculate and then outputting a corrective
action that can adjust the system accordingly. So, by
integrating the PI controller to the DC motor were
able to correct the error made by the DC motor and
Figure 1. Electrical Circuit Diagram
control the speed of the DC motor to the desired
speed.
In this thesis, it will assume the following values for
the physical parameters of DC motor.
IJSRST2072103 | Accepted : 02 May 2020 | Published : 13 May 2020 | May-June-2020 [ 7 (3) : 33-37 ]
33
Zaw Ngwe et al Int J Sci Res Sci Technol. May-June-2020; 7 (3) : 33-37
θ/V = k /(( J x s + b ) x( L x s + R ) + k^2 )equation (3)
Armature resistance (Ra) = 1Ω
Armature inductance (La) = 0.4H P-motor=k/((j*s+b)*(L*s+R)+K^2)
Mechanical inertia (j) = 0.01 Kg .m
Friction coefficient (B m) = 0.2 N.m/rad/sec
Back emf constant (k) = 0.01 V/rad/sec
III. PID CONTROLLER
A PID controller is an instrument used in industrial
control applications to regulate temperature, flow,
pressure, speed and other process variables. PID
(proportional integral derivative) controllers use a
control loop feedback mechanism to control process
variables and are the most accurate and stable
controller.
PID control is a well-established way of driving a
system towards a desired speed. PID control uses
closed-loop control feedback to keep the actual
output from a process as close to the target or set
point output as possible.
Figure 3. Open Loop Response
IV. PROPORTIONAL CONTROL
A proportional controller is used to set ki=0,kd=0 in
program. And it takes different values of kp the
Figure 2. Simple Block Diagram of PID Controller
calculation results was assumed in Table 1, and the
corresponding plots was gathered in Fig. 4:
Using Laplace transforms, the above model equations
Table 1
can be expressed in terms of s.
Kp Rise Maximum Steady Peak
time overshoot state amplitude
S(J × s + b) ×θ (s) = k ×i(s) equation (1)
(L × s + R)×i(s) = V − k × s ×θ (s). equation (2) (sec) (%) error
100 0.114 6.83 0.833 0.89
by eliminating i(s), it get the following open-loop 200 0.0682 17.9 0.909 1.07
transfer function. 300 0.144 17.9 0.909 1.07
International Journal of Scientific Research in Science and Technology ( [Link]) | Volume 7 | Issue 3
34
Zaw Ngwe et al Int J Sci Res Sci Technol. May-June-2020; 7 (3) : 33-37
The proportional controller kp have the effect of
reducing the rise time; and will reduce and never
eliminate the steady state error. So, the response
becomes more and more faster by increasing the gain
kp. But will increase the maximum overshoot.
Figure 5. Closed Loop Response with Different Values
of ki.
The response is much faster than before; the settling
time becomes for ki=200, and the steady-state error
becomes very small and eliminated for ki=200.
VI. PROPORTIONAL-INTEGRAL DERIVATIVE
CONTROL (PID):
Figure 4. Closed Loop Response with Different Values
of kp It is need to increase the gain kd, with kp=200;ki=200.
All results are illustrated in the Table 3 and the
V. PROPORTIONAL INTEGRAL CONTROL(PI) corresponding plots are shown in Fig. 6.
The settling is time still too long, it is need to increase
Table 3
the gain ki with kp=200, all the results are shown in
the Table 2. And the corresponding plot is gathered in
Kd Setting Rise Maximum Steady Peak
Fig. 5.
time(sec) time overshoot state amplit
Table 2
(sec) (%) error ude
Ki Setting Rise Maximu Stead Peak
3 0.475 0.0848 4.76 0 1.05
time(sec time m y amplitud
7 0.478 0.0981 4.76 0 0.997
) (sec) overshoo state e
10 0.478 0.0111 4.76 0 1.05
t (%) error
10 2.86 0.075 10 1 1.1
0 4
20 1.13 0.073 10 1 1.1
0 6
30 0.419 0.073 10 1 1.1
0 6
International Journal of Scientific Research in Science and Technology ( [Link]) | Volume 7 | Issue 3
35
Zaw Ngwe et al Int J Sci Res Sci Technol. May-June-2020; 7 (3) : 33-37
Table 4
Closed Rise Maximu Setting Steady
loop time m time(sec state
respons (sec) overshoot ) error
e (%)
as the decreas increase Small decrease
increase e change
of kp
as the decreas increase increase eliminat
increase e e
of ki
as the Small decrease decrease Small
increase change change
Figure 6. Closed Loop Response with Different Values
of kd
of kd
The pid controller with: kp=200,ki=200 and kd=10; all
VII. SIMULATION AND TEST
are design requirements will be satisfied and the
response looks like:
The following figure 8 was designed with Arduino
Uno, DC motor, L298 and variable resistor to control
the motor speed in Proteus software. In order to do
that, the physical parameters of DC motor are firstly
identified. Plug these parameters value the transfer
functions, open-loop step response curve is obtained.
Then, PID controller was designed that will reduce
the rise time, time and steady-state error.
Figure 7. System Closed Loop Response with PID
control
Effects of PID controllers parameters kp, ki and kd on
a closed loop system are summarized in the table
bellow.
Figure 8. Simulation Test in Proteus
International Journal of Scientific Research in Science and Technology ( [Link]) | Volume 7 | Issue 3
36
Zaw Ngwe et al Int J Sci Res Sci Technol. May-June-2020; 7 (3) : 33-37
VIII. CONCLUSION
The proportional controller (kp) will have the effect of
reducing the rise time and will reduce; but never
eliminate the steady-state error, an integral control
(ki) will have the effect of eliminating the steady-state
error, but it may make the transient response worse .a
derivative control (kd) will have the effect of
increasing the stability of the system, reducing the
overshoot, and improving the transient response.
IX. REFERENCES
[1]. Zhen-yu zhao ,Masayoshi Tomizuka ,and Satoru
Isaka , “ Fuzzy gain of PID controller,”
Members,IEEE
[2]. Christopher [Link] “Modern control
technology: components and systems,” 2end
edition .
[3]. Robert [Link], “Modern control system
Analysis and Design Using MATLAB
Cite this article as :
Zaw Ngwe, Aye Aye Tun, "Speed Control of DC
Motor Using PID and Arduino", International Journal
of Scientific Research in Science and Technology
(IJSRST), Online ISSN : 2395-602X, Print ISSN : 2395-
6011, Volume 7 Issue 3, pp. 33-37, May-June 2020.
Available at
doi : [Link]
Journal URL : [Link]
International Journal of Scientific Research in Science and Technology ( [Link]) | Volume 7 | Issue 3
37