Paper01 Sinik Despotovic Dobrilovic

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

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

net/publication/337367710

Design and Analysis of DC Motor Using Software Tool MATLAB Simulink

Conference Paper · November 2019

CITATION READS

1 9,203

3 authors, including:

Dr Zeljko V Despotovic D. Dobrilovic


Mihajlo Pupin Institute University of Novi Sad
676 PUBLICATIONS 932 CITATIONS 116 PUBLICATIONS 611 CITATIONS

SEE PROFILE SEE PROFILE

All content following this page was uploaded by Dr Zeljko V Despotovic on 19 November 2019.

The user has requested enhancement of the downloaded file.


International conference on Applied Internet and Information Technologies
October 3-4, 2019, Zrenjanin, Republic of Serbia

Design and Analysis of DC Motor Using


Softver Tool MATLAB Simulink
V. * ** and D. *
*University of Novi Sad, Technical Faculty Mihajlo Pupin Zrenjanin, Serbia
**

[email protected]
Abstract - Many industrial applications require high
performance rotating electric drives. A proposed DC drive
have a precise speed control, stable operation in complete
range of speed and good transient behavior with smooth and
step less control. In this paper, modeling of a DC motor is
performed by using generalized equation in MATLAB. The
speed control of the DC motor was realized using a PID
controller.

Key words: PID controller, DC motor, MATLAB


representation

I. INTRODUCTION
A DC motor is an electromechanical energy converter Figure 1. Free body diagram of armature of a DC motor [3]
which converts electrical energy into mechanical energy. It is
often used as an actuator in control systems. The basic equations of a DC motor (electric part) are
The DC motor acts as an energy conversion actuator that obtained from Maxwell's electromagnetic theory. For this
converts electrical energy (of source) into mechanical energy example, we will assume that the input of the system is the
(for load). These motors are extensively applied for robotic voltage source (V) applied to the motor's armature, while the
manipulations, cutting tools, electrical tractions, etc. The output is the rotational speed of the shaft d(theta)/dt. The
torque-speed characteristics of DC motors are most rotor and shaft are assumed to be rigid. We further assume a
compatible with most mechanical loads. Hence DC motors viscous friction model, that is, the friction torque is
are always a good ground for advanced control algorithm. proportional to shaft angular velocity.
The control characteristics of these motors have resulted to
their immense use and hence control of their speed is B. State Space Modelling
required. Speed of a DC motor depends on supply voltage,
armature resistance and field flux produced by the field For continuous linear time invariant (LTI) systems, the
current. The methods to control speed of these motors are standard state-space representation is given below:
armature voltage control, armature resistance control and
field flux control [1]. x Ax B u
The parameters of the PID controller Kp, Ki, and Kd (or y Cx D u (1)
Kp, Ti and Td) can be manipulated to produce various
response curves from a given process as we will see later. where x is the vector of state variables (nx1), is the time
[2]. derivative of state vector (nx1), u is the input or control
vector (px1), y is the output vector (qx1), A is the system
II. MODELING AND BLOCK DIAGRAMS OF A DC MOTOR matrix (nxn), B is the input matrix (nxp), C is the output
As The DC motor model is implemented by mathematical matrix (qxn), D is the feedforward matrix (qxp) [4].
expression. This implemented model is analysed by The output equation, is necessary because often there are
techniques of time domain and frequency domain analysis in state variables which are not directly observed or are
MATLAB simulation. otherwise not of interest. The output matrix, C, is used to
specify which state variables (or combinations thereof) are
A. Physical System available for use by the controller. Also often there is no
direct feedforward in which case D is the zero matrix
Figure 1 depicts the electrical circuit and free body of a
closed loop system of DC motor. In general, the torque generated by a DC motor is
proportional to the armature current and the strength of the
magnetic field. In this example we will assume that the
207
International conference on Applied Internet and Information Technologies
October 3-4, 2019, Zrenjanin, Republic of Serbia

magnetic field is constant and, therefore, that the motor C. Laplace Transform Expression
torque is proportional to only the armature current i by a
constant factor Kt as shown in the equation below. This is LTI systems have the extremely important property that
referred to as an armature-controlled motor if the input to the system is sinusoidal, then the output will
also be sinusoidal at the same frequency but in general with
T Kti (2) different magnitude and phase. These magnitude and phase
differences as a function of frequency are known as the
The back emf, e, is proportional to the angular velocity of
the shaft by a constant factor Ke frequency response of the system.

Using the Laplace transform, it is possible to convert a


e Ke (3) system's time-domain representation into a frequency-
domain output/input representation, known as the transfer
In SI units, the motor torque and back emf constants are function. In so doing, it also transforms the governing
equal, that is, Kt = Ke; therefore, we will use K to represent differential equation into an algebraic equation which is
both the motor torque constant and the back emf constant. often easier to analyze.
From the figure above, we can derive the following
Applying the Laplace transform, the above modeling
governing equations based on Newton's 2nd law and
Kirchhoff's voltage law equations can be expressed in terms of the Laplace variable
s.

J b Ki (4) s ( Js b ) ( s ) KI ( s ) (9)
di (5)
L Ri V K ( Ls R) I ( s) V ( s) Ks ( s ) (10)
dt
where J stands for moment of inertia, b stands for friction Here s -
coefficient, L is armature inductance, R stands for armature placement in s domain. From Equation (10) I(s) is given as:
resistance, V stands for input voltage, K stands for
electromotive force constant, stands for angular acceleration
[4]. In state-space form, the governing equations above can V ( s ) Ks ( s )
I ( s) (11)
be expressed by choosing the rotational speed and electric R sL
current as the state variables. Again the armature voltage is
treated as the input and the rotational speed is chosen as the The substituted in Equation (9) to obtain:
output.
b K V ( s ) Ks (s )
0 Js 2 ( ) s bs ( s ) K (12)
d J J R sL
1 V (6)
dt i K R i L We arrive at the following open-loop transfer function by
L L eliminating I(s) between the two above equations, where the
rotational speed is considered the output and the armature
voltage is considered the input.

y 1 0 (7) (s) K
i Wv ( s ) (13)
V ( s) ( Js b)( Ls R) K2

where
voltage V(s) ) is:

b K ( s) K
0 W ( s) (14)
A J J ,B 1 ,C 1 0 ,D 0 V ( s) s (( Js b)( Ls R) K 2 )
K R
L This Laplace Equation for the DC motor is implemented by
L L
(8) the block diagram in Figure 2.

208
International conference on Applied Internet and Information Technologies
October 3-4, 2019, Zrenjanin, Republic of Serbia

2) Frequency-Domain Responses
a) Drawing the original Bode plot
The main idea of frequency-based design is to use the
Bode plot of the open-loop transfer function to estimate the
closed-loop response. Adding a controller to the system
changes the open-loop Bode plot, thereby changing the
Figure 2. Modeled block diagram of a DC motor closed-loop response. It is our goal to design the controller to
shape the open-loop Bode plot in such a way that the closed-
loop system behaves in a desired manner. Let's first draw the
III. ANALYSIS OF DC MOTOR IN MATLAB Bode plot for the original open-loop plant transfer function.
Bode response of the transfer function Wv(s) and W (s) give
A. MATLAB Representation on Figure 5. and Figure 6.
In this paper, the dynamic modeling of DC motor is
implemented using Laplace transform expression. The transfer Bode Plot
function from Laplace transform expressions is put into -20

MATLAB m-file by defining the polynomial. The transfer -40

function is put in MATLAB using Voltage as input and velocity -60

and angle as output. -80

-100
1) Time-Domain Responses
-120
0
Here the step response, impulse response and maps zero and
pole of the modeled DC motor is depicted from Figure 3 to 4. -45

-90

Step Response -135


0.1

-180
0.05 -1 0 1 2 3
10 10 10 10 10
Frequency (rad/sec)
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (sec)

0.2
Impulse Response Figure 5. Bode response of the transfer function Wv(s)
0.1

Bode Diagram
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 50

Time (sec)
Pole-Zero Map 0
1
-50

0
-100

-1
-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 -150

Real Axis
-200
-90

Figure 3. Step response, impulse response and maps zero and pole of the -135

transfer function Wv(s) -180

-225

Step Response -270


0.5 -1 0 1 2 3
10 10 10 10 10
Frequency (rad/sec)

0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (sec)
Figure 6. Bode response of the transfer functionW (s)
Impulse Response
0.1

0.05 b) Adding proportional gain


0
0 0.5 1 1.5 2 2.5
Time (sec)
3 3.5 4 4.5 5
From the Bode plot above, it appears that the gain margin
1
Pole-Zero Map
and phase margin of this system are currently infinite which
0 indicates the system is robust and has minimal overshoot.
-1
The problem with this is that the phase margin is infinite
-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0
Real Axis because the magnitude plot is below 0 dB at all frequencies.
This indicates that the system will have trouble tracking
Figure 4. Step response, impulse response and maps zero and pole of the various reference signals without excessive error. Therefore,
transfer functionW (s) we would like to increase the gain of the system while still
achieving enough phase margin [4].

209
International conference on Applied Internet and Information Technologies
October 3-4, 2019, Zrenjanin, Republic of Serbia

A phase margin of 60 degrees is generally sufficient for Consider the following lag compensator:
stability margin. From the above Bode plot, this phase
margin is achieved for a crossover frequency of s 1
approximately 10 rad/sec. The gain needed to raise the C ( s) (15)
magnitude plot so that the gain crossover frequency occurs at s 0.01
10 rad/sec appears to be approximately 40 dB. The exact This lag compensator has a DC gain of 1/0.01 = 100
phase and gain of the Bode plot at a given frequency can be which means it will increase the system's static position error
determined by clicking on the graph at the corresponding constant by a factor of 100 and will reduce the steady-state
frequency. The bode command, invoked with left-hand error associated with the system's closed-loop step response.
arguments, can also be used to provide the exact phase and In fact, it allows us to reduce the proportional gain of 72
magnitude at 10 rad/sec as shown below. With command used earlier, while still meeting the requirement on steady-
[mag,phase,w] we goving mag = 0.0139, phase = -123.6835, state error. We will employ a gain of 45. Furthermore, since
w =10 the corner frequencies of the pole and zero are a decade or
more below the current gain crossover frequency of 10
Therefore, the exact phase margin for a gain crossover rad/sec, the phase lag contributed by the compensator
frequency of 10 rad/sec is 180 - 123.7 = 56.3 degrees. Since shouldn't adversely affect performance much [4].
the exact magnitude at this frequency is 20 log 0.0139 = -
37.1 dB, 37.1 dB of gain must be added to the system. Step Response w ith kp Bode Plot
1.5 0
Otherwise stated, a proportional gain of 1/0.0139 = 72 will
-100
achieve an open-loop gain of 1 at 10 rad/sec. Add the 1
-200
following commands to your m-file to observe the effect of 0.5
0

this proportional controller on the system. In this case, we -90

0 -180
use the margin command instead of the bode command in 0 1 2 3 4 5 10
0 2
10
Time (sec)
order to explicitly see the new gain and phase margins and Bode Diagram
Frequency (rad/sec)

crossover frequencies [4].


Gm = Inf dB (at Inf rad/sec) , Pm = 62.3 deg (at 7.13 rad/sec) Bode Plot of the Lag Compensator
100 1.5

0
1
Bode Diagram
Gm = Inf dB (at Inf rad/sec) , Pm = 56.4 deg (at 9.99 rad/sec) -100
20 0
0.5
-90
0

-180 0
-20 0 0 5 10
10
Frequency (rad/sec) Time (sec)
-40

-60
Figure 8. (1)Plotting the closed-loop response, (2)adding proportional
-80
0 gain, (3)Bode plot of the lag compensator (4) step responce with lag
compensator
-45

-90

-135
Inspection of the above demonstrates that all of the given
requirements are now met when the lag compensator
-180
10
-1
10
0
10
1

Frequency (rad/sec)
10
2
10
3
described above is employed.

Figure 7. The exact phase and magnitude at 10 rad/sec B. PID controller Design
PID controllers are commonly used to regulate the time-
c) Plotting the closed-loop response and adding a lag domain behavior of many different types of dynamic plants.
compensator These controllers are extremely popular because they can
From the plot above we see that the resulting phase usually provide good closed-loop response characteristics,
margin and gain crossover frequency are as we expected. can be tuned using relatively simple design rules, and are
Let's see what the closed-loop response look like. easy to construct using either analog or digital components.
Consider the feedback system architecture that is shown in
Note that the settling time is fast enough, but the Figure 9. where it can be assumed that the plant is a DC
overshoot and the steady-state error are too high. The motor whose speed must be accurately regulated.
overshoot can be reduced by decreasing the gain in order to
r (t ) e(t ) u (t ) y (t )
achieve a larger phase margin, but this would cause the Gc ( s ) W (s )
steady-state error to become even larger. A lag compensator
could be helpful here in that it can decrease the gain
crossover frequency in order to increase the phase margin
without decreasing the system's DC gain. Figure 9. Feedback system architecture

210
International conference on Applied Internet and Information Technologies
October 3-4, 2019, Zrenjanin, Republic of Serbia

The PID controller is placed in the forward path, so that and compared to the reference to find the new error signal e
its output becomes the voltage applied to the motor's (t). The controller takes this new error signal and computes
armature the feedback signal is a velocity, measured by a its derivative and its integral again, ad infinitum.
tachometer .the output velocity signal y (t) is summed with a
reference or command signal r (t) to form the error signal e A proportional controller (Kp) will have the effect of
(t). Finally, the error signal is the input to the PID controller. reducing the rise time and will reduce but never eliminate the
Before examining the input-output relationships and design steady-state error. An integral control (Ki) will have the
methods for the PID controller, it is helpful to review typical effect of eliminating the steady-state error for a constant or
characteristics observed for the velocity response of a DC step input, but it may make the transient response slower. A
motor to a step voltage input. Different characteristics of the derivative control (Kd) will have the effect of increasing the
motor response (steady-state error, peak overshoot, rise time, stability of the system, reducing the overshoot, and
settling time, etc) are controlled by selection of the three
improving the transient response.
gains of the PID controller. This is discussed in detail below
the PID controller is defined by the following relationship The effects of each of controller parameters, (Kp) , (Kd) ,
between the controller input e (t) and the controller output
and (Ki) on a closed-loop system are summarized in the
u(t) that is applied to the motor armature:
table below.
de (16)
u (t ) K p e(t ) K i e(t ) dt Kd Table 1. Influence of controller parameters
dt
Taking the Laplace transform of this equation gives the Cl Response Rise time Overshoot Settling time S-S Error
transfer function G c(s):
Kp Decrease Increase Small Change Decrease
U (s) Ki Kd s2 K p s Ki
GC ( s ) Kp Kd s (17) Ki Decrease Increase Increase Eliminate
E ( s) s s
Kd Small Change Decrease Decrease No Change
The block diagram of PID controller with closed loop is
depicted in Figure 10.
Note that these correlations may not be exactly accurate,
because Kp, Ki, and Kd are dependent on each other. In fact,
changing one of these variables can change the effect of the
other two. For this reason, the table should only be used as a
reference when you are determining the values for Kp, Ki,
and Kd .

The goal of this problem is to show you how each of Kp,


Ki, and Kd contributes to obtain : fast rise time, minimum
overshoot, no steady-state error.
Figure 10. Block diagram of closed loop PID controller 1) Open-Loop Step Response
Here, U = controller output, E = controller input, Kp = Let's first view the open-loop step response.
proportional gain, Ki = integral gain, Kd= derivative gain
Step Response
0.1
First, let's take a look at how the PID controller works in 0.09

a closed-loop system using the schematic shown on Figure 9. 0.08

The variable e (t) represents the tracking error, the difference 0.07

between the desired input value r (t) and the actual output y 0.06

(t) .This error signal e (t) will be sent to the PID controller, 0.05

and the controller computes both the derivative and the 0.04

integral of this error signal. The control signal u(t) to the 0.03

0.02
plant is equal to the proportional gain (Kp) times the 0.01

magnitude of the error plus the integral gain (Ki) times the 0
0 0.5 1 1.5 2 2.5 3
integral of the error plus the derivative gain (Kd) times the Time (sec)

derivative of the error.


Figure 11. Open-loop step response. of DC motor
This control signal u(t) is sent to the plant, and the new
output y (t) is obtained. The new output y (t) is then fed back

211
International conference on Applied Internet and Information Technologies
October 3-4, 2019, Zrenjanin, Republic of Serbia

The DC gain of the plant transfer function is 1/10, so 0.1


PID Control w ith Small Ki and Small Kd
is the final value of the output to an unit step input. This 1

corresponds to the steady-state error of 0.90, quite large 0.9

indeed. Furthermore, the rise time is about one second, and 0.8

the settling time is about 3 seconds. Let's design a controller 0.7

that will reduce the rise time, reduce the settling time, and 0.6

eliminate the steady-state error. 0.5

0.4
2) Proportional Control 0.3

0.2
From the table shown above, we see that the proportional 0.1

controller (Kp) reduces the rise time, increases the overshoot, 0


0 20 40 60 80 100 120 140 160 180 200
and reduces the steady-state error. Time (sec)

Let's first try using a proportional controller with a gains


Figure 13. PID Control with Small Ki and Small Kd
Kp1 = 100, Kp2 = 200, Kp3 = 50, Kp4 = 10; so we set Ki=0,
Kd=0, the corresponding plots was gathered in Figure 12: Inspection of the above indicates that the steady-state
error does indeed go to zero for a step input. However, the
Proportional control w ith diferent Kp: Kp=100,Kp=200,Kp=50,Kp=10 time it takes to reach steady-state is far larger than the
1.4
sys_clKp100 required settling time of 2 seconds.
sys_c2Kp200
1.2 sys_c3Kp50 In this case, the long tail on the step response graph is
sys_c4Kp10

1
due to the fact that the integral gain is small and, therefore, it
takes a long time for the integral action to build up and
0.8
eliminate the steady-state error. This process can be sped up
by increasing the value of Ki.
0.6
System: sys_cl
Peak amplitude: 1.23
Overshoot (%): 23 PID Control w ith Large Ki and Small Kd
0.4 1.5 0.24
At time (sec): System: sys_cl
Final Value: 1
1
0.2
System: sys_cl
Settling Time (sec): 0.588
0.5
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (sec) 0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (sec)

Figure 12. Closed loop response with different values of Kp PID Control w ith Large Ki and large Kd
1.5
System: sys_c2
Settling Time (sec): 0.257
1
From the plot above we see that both the steady-state System: sys_c2 System: sys_c2
Peak amplitude: 1.01 Final Value: 1
error and the overshoot are too large. Recall from the Table 1 0.5 Overshoot (%): 1.03
At time (sec): 0.59
page that increasing the proportional gain Kp will reduce the 0
steady-state error. However, also recall that increasing Kp 0 0.2 0.4 0.6 0.8 1
Time (sec)
1.2 1.4 1.6 1.8 2

often results in increased overshoot, therefore, it appears that


not all of the design requirements can be met with a simple Figure 14. a) PID Control with Large Ki and Small Kd, b) PID Control
proportional controller. A little experimentation verifies what with Large Ki and large Kd
we anticipated, a proportional controller is insufficient for
meeting the given design requirements; derivative and/or As expected, the steady-state error is now eliminated
integral terms must be added to the controller. much more quickly than before. However, the large Ki has
greatly increased the overshoot (Figure 14 a). Let's increase
3) Proportional-integral-derivative control (PID) Kd in an attempt to reduce the overshoot. As we had hoped,
the increased Kd reduced the resulting overshoot (Figure 14
Recall from the Table 1 page adding an integral term will b). Now we know that if we use a PID controller with Kp =
eliminate the steady-state error to a step reference and a 100, Ki = 200, and Kd = 10, all of our design requirements
derivative term will often reduce the overshoot. Let's try a will be satisfied.
PID controller with small Ki and Kd.
IV. CONCLUSION
This paper presents DC motor modeling using generalized
equation in MATLAB simulation and to analysis the

212
International conference on Applied Internet and Information Technologies
October 3-4, 2019, Zrenjanin, Republic of Serbia

performance of this modeled DC motor using PID controller. REFERENCES


Here the time domain analysis for both step and impulse signal [1] Pratyusha Biswas Deb, Oindrila Saha, Sajan Saha, Shaon Paul ,
is discussed. The frequency domain analysis is made by bode Dynamic Model Analysis of a DC Motor in MATLAB, International
plot. From the results we know that the proportional Journal of Scientific & Engineering Research, Volume 8, Issue 3,
controller (Kp) will have the effect of reducing the rise time March-2017 57 ISSN 2229-5518, http://www.ijser.org
and will reduce; but never eliminate the steady-state error, an [2] Fatiha Loucif , DC motor speed control using pid controller,
integral control (Ki) will have the effect of eliminating the Department of Electrical Engineering and information, Hunan
University, ChangSha, Hunan, China, June 2-5, 2005, KINTEX,
steady-state error, but it may make the transient response Gyeonggi-Do, Korea
worse .a derivative control (Kd) will have the effect of [3] http://ctms.engin.umich.edu/CTMS/index.php?example=MotorSpeed
increasing the stability of the system, reducing the overshoot, &section=SystemModeling, DC Motor Speed:System Modeling
and improving the transient response. [4] http://ctms.engin.umich.edu/CTMS/index.php?example=Introduction
&section=SystemModeling, Control Tutorials for MATLAB &
Simulink

213

View publication stats

You might also like