Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Advances in Engineering Research, volume 208

Proceedings of the International Conference on Innovation in Science and


Technology (ICIST 2020)

Modelling and Control of DC Motor Speed and


Position for Wheel Mobile Robot Application

B. Supriyo*, A. Suharjono, K. W. Atmaja


Magister Terapan Teknik Telekomunikasi
Politeknik Negeri Semarang
Semarang, Indonesia
*[email protected]

Abstract—This paper presents the simulation works of PID prostitution controller works combine PID based controller
based speed and position controllers for the DC motor used in with other artificial intelligent method such as Fuzzy [7],
mobile robot applications. The mathematical model of the DC Genetic algorithm [8] and artificial neural Network [9] to
motor modelling is developed using Matlab System Identification improve its position accuracy.
Toolbox based on its input and output signals obtained during
open loop experiments under full load condition. The PID For this study, one of the DC motor of the two wheeled
controllers are proposed to regulate the speed of the motor for mobile robot is used as the plant. The mathematical model of
the maximum of 100rpm. The initial PID parameters are the DC Motor is carried out by first obtaining the input and
obtained using relay feedback experiment method and Ziegler- output signal from open loop experiment of the DC motor by
Nichols formula. These parameters are then further fine tuned applying the working voltage (+5V dc) of the DC motor
based on practical knowledge in tuning PID. The best PID speed system as input signal and measure its speed electronically as
controller is then selected and used in designing the DC motor output signal. The step response of the mathematical model
position controller which utilizes both speed and position feed resulted from the identification process is compared to that of
backs. The simulation results show that both speed and position the original one to evaluate its validity. The PID based speed
controllers have a very good performance. controller is proposed with its initial PID parameters obtained
from relay feedback experiment method and Ziegler-Nichols
Keywords—wheel mobile robot application, PID speed
formula. These parameters are then fine tuned manually based
controller, and two-wheel mobile robot
on practical knowledge in PID tuning to get the good results
with no overshoot and no steady state error. The best PID
I. INTRODUCTION based speed controller is then slightly modified and used in the
DC motors have been used extensively as actuators for DC motor based position controller by utilizing both speed and
wheel mobile robot. The wheel mobile robot is a kind robot position feedbacks. This position controller is tested for several
that uses wheel to move. It is controlled by programmed position set points. The controller performance is evaluated
embedded inside the microcontroller or computer to work based on the overshoot and steady state error values.
automatically by recognizing its environmental conditions
based on its sensor information and to navigate around its II. SYSTEM IDENTIFICATION
working area to carry out its programmed tasks. Generally, the
System identification is a way of developing a
robot can have two wheels [1], three wheels [2] or four wheels
mathematical model of the DC motor as a plant by analyzing
[3]. Each of the robot active wheels is driven by the DC motor.
the input and output signals of the process during experiment
The smooth maneuvering of the robot depends on its DC motor
or normal running. The construction of the model is primarily
controller. Two general control applications widely used for
based on the observed data. There is a discrepancy between the
the DC motor are speed and position controllers. The speed
real system and the mathematical model representation of the
controller is used to regulate how fast the robot to move, while
system, so a perfect mathematical model of the process cannot
the position controller is used to regulate how accurate the
be obtained. The system identification process needs
robot to move to its predetermined position.
experimental planning to obtain the input and output data as the
Various works related to the methods of controlling the DC observed data, selection of the model structure, a certain
motor speed have been introduced lately to stabilize. Some of criterion needed to measure how well a model fits the
these works combined the PID based controllers with other experiment data, parameter estimation, and model validation.
methods such as fuzzy logic controller [4]. Genetics algorithm This system identification is performed using identification tool
[5] and Particle swam optimization [6] to stabilize the DC in Matlab.
motor speed performance during operation. Some of the

Copyright © 2021 The Authors. Published by Atlantis Press International B.V.


This is an open access article distributed under the CC BY-NC 4.0 license -http://creativecommons.org/licenses/by-nc/4.0/. 80
Advances in Engineering Research, volume 208

In this study, the system identification process starts by (1)


obtaining the experimental input-output data from open loop
DC motor. The unit step input data is a 5 volts DC voltage used
TABLE I. ZIEGLER-NICHOLS FORMULA
to drive the DC motor. The output data is a measured rotational
speed of the DC motor shaft using encoder sensor. The Controller
PID Parameters
measurement process is performed by Arduino Uno Kp Ki Kd
microcontroller which reads both the 5 Volt unit step input and PID 0.33Kc 2Kp /Tc Kp Tc/8
encoder pulses which converted to its respective speed. Next,
the Arduino Uno transfers these experiment data to the B. PID Speed Controller
computer, then processed using Excel software. Finally, the The simulink program developed for PID speed controller
data is saved as a file consisting of time, input voltage and is shown in figure 3. The initial PID parameters consisting of
speed of the shaft motor. This file is used by system proportional gain (Kp), integral gain (Ki) and derivative gain
identification toolbox for obtaining mathematical model of the (Kc) are obtained from relay feedback experiment and
DC motor. calculated Ziegler Nichols formula. These initial values are
then tuned manually based on the practical knowledge in
III. CONTROLLER DESIGN tuning PID. Firstly we work on P controller and tune the
proportional gain (Kp) such that the output results in only one
A. Initial PID Parameters overshoot and smooth constant value without oscillation, but
Initial PID parameters of the speed controller are still having steady state error, for the rest of the simulation
determined based on Relay Feedback method and Ziegler- process. Next we work on PD controller using the selected Kp
Nichols formula. This method was originally proposed by and tune the derivative gain (Kd) such that the output produces
Åström and Hägglund [10]. The Simulink program for Relay no overshoot and no oscillation, but still having steady state
Feedback experiment is shown in figure 1. The resulted output error, for the rest of the simulation process. Finally, we work
on PID controller using the selected Kp and Kd, and tune
signals produce a stable oscillation of and relay output integral gain (Ki) such that the output produces no overshoot
amplitude of h as shown in figure 2. The values of critical and no steady state error, for the rest of the simulation process.
period (Tc) is obtained from the stable period time of the relay In this case, the PID parameters have been successfully tuned.
output. The critical gain (Kc) of the controller can be computed
using equation (1). While the proportional gain (Kp), integral
gain (Ki) and derivative gain (Kd) can be determined using,
Ziegler Nichols formula given in table 1.

Fig. 3. PID speed controller.

C. Position Controller
The simulink program for position controller is shown in
Fig. 1. Relay feedback experiment.
figure 4. The position controller is developed based on the
previous PID speed controller in which the speed output is
converted to its linear displacement by multiplying the speed
with the wheel circumference. The set point is the desired
position, while the output is actual position of the robot which
is the distance travelled by the wheel from its point of origin.
The difference between the set point and the actual position is
then multiply by the position gain. The output of this gain is
fed to the speed controller unit as the current speed set point.
Fig. 2. (a) Oscillation output, (b) Relay output.

81
Advances in Engineering Research, volume 208

120
Exp.
100

Speed (rpm)
80
SI
60
40
20
0
0 0.5 1 1.5 2
Time(s)
Fig. 4. Position controller.

Fig. 5. Step response of the open loop DC motor.


IV. RESULTS AND DISCUSSION

A. System Identification B. Initial PID Parameters


System identification process starts by collecting the input- The results of the relay feedback experiment consist of
output data from open loop DC motor experiment with the help oscillation output (y) and relay output, as shown in figure 6 and
of Arduino Uno microcontroller. The input data is a 5 volts DC figure 7, respectively.
voltage used to drive the DC motor, while the output data is a
120
rotational speed of the DC motor shaft measured using encoder sp
and processed and converted to its revolution per minute (rpm) 100
by Arduino Uno. These experiment data are transferred to
speed(rpm)

80
computer from Arduino Uno via serial USB and then processed y
60
using Excel software. The data consists of time, input voltage
and speed of the shaft motor. By using the system 40

identification toolbox in Matlab, the respected input-output 20


data which is saved as a file is loaded to the system for 0
identification purpose. By selecting the second order system in 0 5 10 15 20
the form of transfer function, the mathematical model obtained
time(s)
from system identification process is presented in (2), where
is the voltage input and is the speed output of the motor.
Fig. 6. Oscillation output.
The step input of 5 volts is fed to the input of the DC motor
plant resulted from the system identification process. The open
6
loop speed responses of the real DC motor (Exp.) and the
mathematical model one resulted from system identification 5
process (SI) is shown in figure 5. The real DC motor has the
voltage (v)

4
maximum speed of about 115 rpm, while the mathematical
3
model one has maximum speed of about 112 rpm. Based on
data in figure 5, the average percentage error of the open loop 2

performance between the real motor and the mathematical 1


model of the motor is about 4.55%. 0
0 5 10 15 20
(s) (2)
time (s)

Fig. 7. Relay output.

From the relay feedback experiment, the following


parameters are obtained:
 a= 4.27;
 h=5;

82
Advances in Engineering Research, volume 208

 Tc = 1.5. output of this controller is used to regulate the speed of the DC


motor, such that the actual position can reach the desired
While From Ziegler-Nichols formula these following initial position set point. The actual position of the robot will be
PID parameters are determined: calculated as the distance travelled by the wheel from its point
 Kp = 0.9; of origin.

 Ki = 1.2; By using the wheel having diameter of 6 cm, the


proportional gain of the position controller is fine tuned
 Kd = 0.17. manually. The best tuning was obtained with the proportional
gain position of 0.08. The simulation works perform the
C. Speed Controller Performance position controller based on the set points of 10, 50 and 100m.
After the fine tuning process it was found that the final Kp = The output response for position controls for these positions are
0.05; Ki = 0.034 and Kd = 0.026. The initial value of Kp = 0.9 very good. The response have no overshoot and no steady state
gives big oscillation output. The fine tuning is performed to errors as shown in figure 9, where X10, X50 and X100 are the
adjust the Kp , such that the P controller output results in only output response for set points (Sp) of 10cm, 50cm and 100cm
one overshoot and no oscillation, although steady state error is respectively.
still not zero. This final value of Kp is 0.05.
Next, the process continues with the PD controller with the
Kp = 0.05 and initial Kd = 0.17. The PD is fine tuned by
adjusting the Kd parameter, such that the PD controller output
results in no overshoot and no oscillation, although the steady
state error is still not zero. This final value of Kd is 0.026.
Finally, the process continues with the PID controller with
the Kp = 0.05, Kd = 0.026 and initial Ki = 1.2. The PID is fine
tuned by adjusting the Ki parameter, such that the PID
controller output results in no overshoot, no oscillation and
zero steady state error. This final value of Ki is 0.034. The
performance of the PID speed controller using the final
parameters can be shown in figure 8. The output of PID
controller reaches the 100 rpm set point in about 8 second, has Fig. 9. Position controller performance.
no overshoot and has very small (near zero) steady state error.
This PID speed controller is used as main component in V. CONCLUSION
developing the position controller.
The system identification process is carried out to obtain
120 the mathematical model of the DC motor for two-wheeled
sp mobile robot. This identification process has been performed
100
y satisfactorily which results in the second order system transfer
speed (rpm)

80 function representing the DC motor plant under studied. Based


60 on this plant mathematical model, the PID based speed
40
controller is designed. The initial PID parameters are obtained
from relay feedback process and calculated using Ziegler-
20
Nichols formula. Since the PID controller with its initial
0 parameters performs unsatisfactorily, then these parameters
0 5 10 15 20 were fine tuned manually with the help of practical knowledge
time(s) based in tuning PID. The results are very satisfactory in which
the speed response for 100 rpm has no overshoot and no steady
state error. Furthermore, the position controller which is
Fig. 8. Speed controller performance. derived from the speed controller with the proportional gain of
0.08 has performed satisfactorily for set points of 10cm, 50cm
and 100cm. The position output response mostly has no
D. Position Controller Performance overshoots and no steady state errors.
The position controller uses the previous PID speed
controller as main controller. However, in this case the speed REFERENCES
output is converted to its linear displacement or position by
multiplying the speed with the wheel circumference. The
difference between the position set point and the calculated [1] M. Deng, A. Inoue, A. Skiguchi, and L. Jiang, “Two-wheeled mobile
robot motion control in dynamic environments,” Robotics and
position is fed to the position Proportional controller. The

83
Advances in Engineering Research, volume 208

Computer-Integrated Manufacturing, vol. 26, no. (1), pp. 268–272, [6] R.G. Kanojiya and P.M. Meshram, “Optimal Tuning of PI Controller for
2010. Speed Control of DC motor drive using Particle Swarm Optimization,”
[2] M.A. Sharbafi, C. Lucas, and R. Daneshvar, “Motion Control of Omni- International Conference on Advances in Power Conversion and Energy
Directional Three-Wheel Robots by Brain-Emotional-Learning-Based Technologies (APCET), pp. 1-6, 2012.
Intelligent Controller,” IEEE transactions on systems, man, and [7] E. Natsheh and K.A. Buragga, “Comparison between Conventional and
cybernetics—part c: applications and reviews, vol. 40, no. (6), pp. 630- Fuzzy Logic PID Controllers for Controlling DC Motors,” JCSI
638, 2010. International Journal of Computer Science, vol. 7, no. (5), pp. 128-134,
[3] Y. Hao, J. Wang, S.A. Chepinskiy, A.J. Krasnov, and S. Liu, 2010.
“Backstepping Based Trajectory Tracking Control for a Four-Wheel [8] N.P. Adhikari, M. Choubey, and R. Singh, “Dc Motor Control Using
Mobile Robot with Differential-Drive Steering,” Proceedings of the Ziegler Nichols and Genetic Algorithm Technique,” International
36th Chinese Control Conference, pp. 4918-4923, 2017. Journal of Electrical, Electronics andComputer Engineering, vol. 1, no.
[4] U.K. Bansal and R. Narvey, “Speed Control of DC Motor Using Fuzzy (1), pp. 33-36, 2012.
PID Controlle,” Advance in Electronic and Electric Engineering, vol. 3, [9] M. Aamir, “On replacing PID controller with ANN controller for DC
no. (99), pp. 1209-1220, 2013. motor position control,” International Journal of Research Studies in
[5] V.K. Giri and S.K. Suman, “Speed control of dc motor using Computing, vol. 2, no. (1), pp. 21-29, 2013.
optimization techniques based PID controller,” The 2nd IEEE [10] K.J. Åström and T. Hägglund, “Automatic tuning of simple regulators
International Conference on Engineering and Technology (ICETECH), with specifications on phase andamplitude margins,” Automata, vol. 20,
pp. 581-587, 2016. no. (5), pp. 645-651, 1984.

84

You might also like