Paper01 Sinik Despotovic Dobrilovic
Paper01 Sinik Despotovic Dobrilovic
Paper01 Sinik Despotovic Dobrilovic
net/publication/337367710
CITATION READS
1 9,203
3 authors, including:
All content following this page was uploaded by Dr Zeljko V Despotovic on 19 November 2019.
[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.
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.
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
-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
-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
-225
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
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
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)
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 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)
211
International conference on Applied Internet and Information Technologies
October 3-4, 2019, Zrenjanin, Republic of Serbia
indeed. Furthermore, the rise time is about one second, and 0.8
that will reduce the rise time, reduce the settling time, and 0.6
0.4
2) Proportional Control 0.3
0.2
From the table shown above, we see that the proportional 0.1
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
212
International conference on Applied Internet and Information Technologies
October 3-4, 2019, Zrenjanin, Republic of Serbia
213