DC Motor Speed Control Using Pid Controller
DC Motor Speed Control Using Pid Controller
net/publication/276279181
CITATIONS READS
0 723
1 author:
Tanjid M Syed
University of Greenwich
1 PUBLICATION 0 CITATIONS
SEE PROFILE
All content following this page was uploaded by Tanjid M Syed on 15 May 2015.
Abstract—In this paper, I present the findings of my research,
the purpose of which is to demonstrate the various open loop and
closed loop responses of the armature speed of a DC motor to
various types of input. The aim is to eventually design a control
system using a PID controller for a faster and more stable
response. The Ziegler Nichols tuning method is used to tune the
PID controller. The various responses were recorded
experimentally and graphs were produced for comparison and
discussion. A mathematical model of the motor is derived to be
used for theoretical analysis and simulation. The theoretical and Fig. 1. The DC motor speed controller circuit block diagram.
simulated results are compared to the experimental outcomes to
verify its reliability. rotation of the flywheel, which is then converted to a voltage
signal and passed on to the MBED. A 12V power is supplied
Index Terms— Control system, DC motor, disturbance, to the motor rig.
Matlab, PID control, Simulink, Transfer Function
B. Data Acquisition and Control
I. INTRODUCTION The MBED microcontroller along with a purpose built
Labview interface running on a computer is used for data
O NE of the ever existing challenges in control and
instrumentation engineering is the designing of a control
system that can respond very fast, with maximum stability, to
acquisition and control. The MBED microcontroller is a rapid
prototyping platform based on ARM microcontrollers. The
a dramatic change in the input and to maintain the desired MBED is programmed to collect data from the motor and
output in the presence of a disturbance. A simple example of a transmit it to a PC via a USB port. Labview is a graphical
system which requires a highly sensitive control system is the programming environment used primarily for data acquisition
control of the armature speed of a DC motors. DC motors are and control. A Labview interface is designed to collect this
of specific interest because they can be used in many fields data from the MBED and display a plot of armature speed in
such as robotics. It can also be found in many portable home against time. The Labview interface is also designed to allow
appliances, automobiles and industrial equipments. Therefore the user to input a desired speed of the motor and the
at the early stage of learning control and instrumentation parameter of the PID controller. Using these input values, the
engineering, the study of DC motors will be helpful in MBED controls the speed of the motor using pulse width
understanding more complex systems. modulation (PWM). To compare the experimental data,
In this paper, I demonstrate the various open loop and Matlab and Simulink is used to simulate a mathematical model
closed loop control system responses of the armature speed of of the system.
a permanent magnet DC motor for various types of inputs. The C. Structure of the report
aim is to eventually design a control system to obtain a stable A theoretical analysis of the system is included in the next
and faster output response from system. section, which is referred to during the discussion in the
A. Equipment following sections. Experimental values are collected and a
The motor rig circuit consisted of a small DC motor, an mathematical model of the system is constructed.
MBED microcontroller, a photo-interrupter and a few
microprocessors for signal conversion and manipulation. A II. THEORY
very light flywheel attached to motor armature. The photo- A. Mathematical Model
interrupter is used as a sensor to obtain the frequency of The purpose of this section is to take the dynamic system
and mathematically model it. The mathematical model is
Manuscript received December 14, 2014; revised January 7, 2014. constructed to be used to conduct a theoretical analysis and in
S. T. Mehedi, has finished GCSEs and A-Levels with science based
subjects at the Oxford International School. He is now studying MEng simulation. The simplest model of a DC motor can be obtained
Electrical and Electronic Engineering at the School of Engineering, University by applying a step input to the system and plot a output
of Greenwich, Medway, Central Avenue, Chatham Maritime, Chatham, Kent against time graph. The step response of the motor rig yields a
ME4 4TB, UK, (e-mail: [email protected]).
graph which can be approximated as an exponential decay
IEEE JOURNAL OF CONTROL ENGINEERING 2
For ramp input with proportional only controller, With proportional, integral and derivative controller,
1 1
s 2 Ts 1 eD 0 (20)
s Ki Ts 1
e lim (12) lim Kp sK d
s 0 Ts 1 Kp K s 0
s K
E. Motor Variables
For ramp input with proportional and integral controller,
In its simplest form, a DC motor consist an armature
1
s 2 2 Ts 1 winding that rotates in a magnetic field when a current is
e lim
s 1 (13) passed through it. The magnetic field is produced by a
s 0 s Ts 1 sKp K K ( Ki ) K
i separate winding, stator winding, around an electromagnet
which is supplied current in series or parallel with the
For ramp input with proportional, integral and derivative armature winding. The armature winding in a motor is
controller, responsible for its internal resistance R and inductance L
1
s 2 2 Ts 1
e lim
s 1 (14)
s 0
s Ts 1 sKp Ki s K d K ( Ki ) K
2
D. Steady-state Error for Disturbance
The steady-state error for a disturbance introduced to the
system can be shown to reduce when a tuned controller is where, R = armature resistance
used. Fig. 3 shows system block diagram with a disturbance L = armature Inductance
i = current through the armature
D(s) introduced to the motor. Vin = input voltage
Vb = back electromotive force (emf)
Tm = motor torque
= angular velocity
J = rotational inertia
B = viscous friction/damping
.
Fig. 4. The control equivalent circuit for the given system
modeled shown in Fig. 4. In the circuit diagram the back
Fig. 3. The control equivalent block diagram. electromotive force, emf, Vb produced by the motor winding
since it is rotating in a magnetic field. Back emf Vb is known
From Fig. 3, the transfer function of the system is,
to be directly proportional to the angular velocity of the
K
C s E s G s D(s) (15) motor armature with a constant of proportionality know as the
Ts 1 back emf constant kb.
Comparing (3) and (16), the steady-state error is, d t
K Vb kb kbout (21)
Ts 1 dt
E s
1
R s (16)
D( s) The relationship between angular velocity of the motor
K K
1 G s 1 G
s and Torque Tm is given in (23). It is the rotational version of
Ts 1 Ts 1
the second low of translational Newton’s second law. The
The second term of left hand side of (13) is the error due to constant of proportionality is the rotational moment of inertia
the disturbance Applying final value theorem to find the J.
steady-state error with disturbance a step disturbance (1/s),
d
1 Tm J J
eD (17) (22)
Ts 1 dt
lim G s
K
Using Kirchhoff's voltage law,
s 0
di t
With only proportional controller, Vin Ri t L Vb (23)
1 1 dt
eD (18)
Ts 1 1 The inductance L of a small motor that we are using has a
lim Kp K p
s 0
K K very low value as low as a few mH. Thus the inductance
component can be ignored in equation (24),
With proportional and integral controller,
1
eD 0 (19) Vin Ri t Vb (24)
K Ts 1
lim Kp i
K
Rearranging,
s 0
s
Vb Vin Ri t (25)
IEEE JOURNAL OF CONTROL ENGINEERING 4
record the current through the motor increase the voltage input
slowly. There is a saturation voltage where the current reaches TABLE 2
its maximum and voltage drops to that saturation voltage even ZIEGLER NICHOLS TABLE TO OPTIMIZE PID CONTROLLER
if the input voltage is increased. The various voltages are Type of
Kp Ki Kd
taken to be below that saturation voltage. Each pair of voltage Controller
and current reading should be repeated to obtain an average P 5.0 0 0
PI 4.5 2.667 0
value. Finally using Ohm law, the resistance can be PID 6.0 4.444 0.05625
determined for each pair of voltage and current obtained and
6
taking the average of all the values. Inductance L can be J 1.50 10
obtained by applying input voltage to the motor and observing We can now substitute these values to obtain the state space
the transient response of the output voltage. model of the DC motor.
iL 507 0.957 iL 667
Vin
957 0.197
i
y 0 1 L
This model can now be used for simulation using Matlab
and simulink.
C. Ziegler Nichols PID tuning
The Ziegler Nichols PID tuning method is used to tune the
Fig. 6. Actual response of the system to various step input values.
PID controller for faster response, minimum overshoot and
zero steady state error. The various test values are shown in
Fig. 7 to find the value of Kp from which the system starts to
oscillate. Kult and Tult was measured to be,
Kult 10
Tult 0.45
Table 2 shows the values of the three PID controller
elements calculated using the Ziegler Nichols tuning methods.
Fig. 9. Actual step response of the system as Kp is increased. Fig. 10. Stimulated step response of the system as Kp is increased.
IV. RESULTS ANALYSIS is expected from the theoretical analysis in (10). The system
slowly approaches the desired value with a small Ki but
The data obtained from the experiment and simulation are reaches the desired value with as Ki is increase, obviously with
presented as graphs using Matlab. The various open loop a small overshoot. However very high value of Ki also makes
responses of the DC motor to a step input is shown in Fig. 6. It the system unstable as can be seen in Fig. 11. A very
is clearly from the graphs that, as the step input is increased, interesting point to note in the graph is that for the same
the final value also increases. However, the time constant of combination of Kp and Ki but with a introduction of small
the response is approximately the same. As can be observed, value of Kd, the system seems to have no apparent change in
the response of the system is delayed by about 0.15s, showing its response. The simulated response for the same set of values
that there is a transport delay in the system. In fact it is clearly of Kp, Ki and Kd is shown in Fig. 12. It can be seen that the
not a first order system, as at the beginning the gradient is response are quit not so similar. The response are far more
increasing at a decreasing rate and eventually behaves as an oscillatory than the actual response.
exponential decay curve. Nevertheless for simplicity and for An attempt to manually find the right PID tune for a system
the purpose of this demonstration the first order approximation with minimal rise time, overshoot, settling time and steady-
is appropriate. state proved that it is far too difficult and not efficient. Fig. 13
From Fig. 8, we can see the effect of disturbance on the shows the results of some of the response which were
open loop system. As disturbance is introduced the speed of comparatively better. An attempt to tune the system based on
the armature fell drastically. To maintain this speed to a set
value, the input voltage has to be increased manually. Clearly
an closed loop control system is required to eliminate the error
due to the disturbance.
A closed loop PID control system is programmed using the
MBED microprocessor, Labview in the setup shown in Fig.1.
In order to find the value of Kult and Tult to construct the
Ziegler Nichols PID tuning table shown in Table 2, the various
step responses, as Kp is gradually increased, is shown in Fig. 9.
It is evident from the plots that as the value of Kp is increased,
the steady-state error and the rise time decreases, but the
overshoot and settling time of the system increases. The
system never reaches the desired output, in agreement with
(9), there will always be a steady-state error no matter how big
the value of Kp is. In fact when Kp is increased to 5, the system
tends to never settle down and gradually gets closer to an
oscillation as Kp is increased up to 10. Further increase in Kp
makes the system unstable. Thus it is concluded that for Fig. 11. Simulated step response of the system with various
combination of Kp, Ki and Kd.
Ziegler Nichols tuning the Kult is equal to 10. The simulated
results in Fig. 10, shows that the simulation matches the actual
response. However it only matches as long as the value of Kp
is small, in fact any larger value than shown in Fig 10 makes
the simulated response very unstable and oscillatory.
Fig. 13. Actual response of the system with values of Kp, Ki and Kd Fig. 14. Simulated response of the system with values of Kp, Ki and Kd
calculated using the Ziegler Nichols tuning method. calculated using the Ziegler Nichols tuning method.
previous response lead to some improvement but nothing With proportional only controller, the system stable and
significant. From the graph in Fig. 11, it was already observed settling time is improved but introduces a significant steady-
that the Ki and Kp values seemed to cause a significant state error. Using (9), the steady-state error for unit step input
instability or oscillation to the system when it is more than should be 0.1667, thus for a step input of 10000 rpm, the
about 5. Therefore keeping the values of Ki and Kp around 5 steady-state error is 1667 rpm. The actual response shows
and varying the value of Kd it is seen that as Kd is increased higher steady-state error than the theoretical value.
system tends to become unstable and it is apparent the system Nevertheless it is a quite correct given that it is assumed and
has better response without Kd. modeled to be a first order system. For the proportional and
Since the manual tuning is not as effective, the Ziegler integral combination the steady-state error is seen to become
Nichols tuning method was applied to compare its zero, as confirmed by (10). The introduction of the derivative
effectiveness. The PID controller parameter, given in Table 2, component of the controller does reduce the overshoot and
is used to set the controller. The step responses of the system settling time but the system is less steady and the output is
is shown in Fig. 13. With the introduction of the Ziegler noticeably struggling to stay at the set point. This for this case
Nichols PID tuned values, the dramatic change in the response it is the PI combination which is favorable over the PID in the
compared to Fig. 12 can be seen in Fig. 13.
Fig. 15. Actual response of the system with values of Kp, Ki and Kd calculated using the Ziegler Nichols tuning method. The upper graphs are for the Ziegler
Nichols PI combination and the lower graphs are for the PID combination. The first set of graph is for a step response with a disturbance, the second set is the
response for a ramp input (triangular input) and the third one is for a sine wave input response of the system.
Fig. 16. Simulated response of the system with values of Kp, Ki and Kd calculated using the Ziegler Nichols tuning method. The upper graphs are for the Ziegler
Nichols PI combination and the lower graphs are for the PID combination. The first set of graph is for a step response with a disturbance, the second set is the
response for a ramp input (triangular input) and the third one is for a sine wave input response of the system.
IEEE JOURNAL OF CONTROL ENGINEERING 8
SUMMARY
To summaries this paper has shown the power of closed
loop control system in maintaining its desired output in the
presence of various types of disturbance such as step, ramp
and sine wave input. It has demonstrated the difference
between an open loop and closed loop system and how the
various components of a PID controller effects the responses
of a system.
ACKNOWLEDGMENT
The completion of this paper would not have been possible
without the constant support of my tutor, Dr Terry Gorman,
lecturer at the University of Greenwich. He has guided me
through every problem I faced regarding this attempt to
demonstrate the power of closed loop PID control system. I
would also like to thank the authors of books I have refereed
to and the people who helped me understand concepts by
sharing their knowledge for free on the world wide web.