Jecet.v3i3c 7

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

JECET; June 2014-August 2014; Sec. C, Vol.3.No.3, 1653-1663.

E-ISSN: 2278179X

Journal of Environmental Science, Computer Science and


Engineering & Technology
An International Peer Review E-3 Journal of Sciences and Technology

Available online at www.jecet.org


Section C: Engineering & Technology
Review Article

Closed Loop Angular Position Control of Stepper Motor


Using Parallel Port on PC
1 Antara

Mukherjee, 2 Reetam Mondal, 3 Sagarika Pal

Department of Electronics & Communication Engineering, Bengal Institute Of Engineers, Techno India
Group, Bantala,24-Parganas (South), India.
2

Department of Electrical Engineering, JIS College of Engineering (Autonomous), Block-A, Phase- III,
Kalyani-741235, West Bengal, India.

Department of Electrical Engineering, National Institute of Technical Teachers Training and Research,
Kolkata Block-FC, Sector-III, Salt Lake City, Kolkata-700 106, India.

Received: 18 May 2014; Revised: 08 July 2014; Accepted: 15 July 2014

Abstract: Stepper motors find wide applications in sophisticated manufacturing


machines for positioning of work-piece into a predefined location upon which some
operations may be performed. They are commonly used in open loop position control
systems and various automation system applications. But open loop control of stepper
motor may cause loss of steps or slip of steps. Acceleration and deceleration are also
limited. To overcome these problems, computer controlled flexible positioning system as
well as an error checker circuit has been developed to show, if any wrong position (i.e.
due to loss of steps or slip of steps) of stepper motors have been achieved. So in the
JECET; June 2014-August 2014; Sec. C, Vol.3.No.3, 1653-1663.

1653

Closed ...

Mukherjee et al.

present paper, a programming method in Visual Basic has been described to control the
angular position of a stepper motor using Parallel port on PC where the Stepper Motor
has been connected to the Line Printer Terminal (LPT) of the Computer to achieve
accurate position of stepper motor, within a considerable step angle limit. Experimental
results indicate that the proposed system has high performance and efficiency with
percentage error within tolerable limits.
Keywords: Computer controlled, Error Checker Circuit, Parallel Port on PC, Position
control, Stepper Motor.

1. INTRODUCTION
Stepper Motor based positioning system is very much useful and popular requirement in the industry. The
principal aim of this motion control is to design control systems which are able to make automatic
movement of a machine. In recent times thus PC based digital control is also becoming convenient and
popular for research and development in quite a lot of fields. The combination of motion and position
control technology with PC gives developers and end users a very useful tool with much greater
flexibility because PC has a lot of programming languages with powerful debugging tools and useful
drawing applications with which users are much familiar. Many schemes on the present problem have
been proposed in past couple of years. Bianculli and J.Anthony1 has explained a computer controlled
positioning system where stepper motor has been used to create sophisticated manufacturing equipments
via closed-or open-loop motor-driven system each offering distinct advantages. Economical stepper motor
for speed control applications has been presented by J.T.Boys 2 . The application of Microcomputer for
speed control of stepper motor with a digital driving circuit has been described by C.Chen3 . C.T.Chin4 has
provided us with a microstepping technique for the rotation of the rotor of the Stepper Motor which
provides high accuracy than open loop control of stepper motor, which suffers from disadvantages of
unstable oscillation in certain speed ranges. A precision stepper motor controller capable of both
independent and and synchronized control of multiple number of stepper motors has been discussed by
D.P.Mital5 where a 16-Bit Microprocessor has been used as a controller to provide fast and reliable
control operations. M.Bodson, J.N.Chiasson,R.T.Novotnak and R.B Rekowski6 has studied a high
performance non-linear feedback control of permanent magnet stepper motor where line encoders, PWM
amplifiers and Motorala as digital signal processor has been implemented. A new methodology using a
single microprocessor to control the speed, direction and rotation angle of DC Stepper Motor has been
implemented by Z.L.Kang7 . The main elements of Stepper Motor Control System have been presented by
Rhine8 and a comparison of open loop and closed loop control has been also briefly discussed.
E.T.Ososanya 9 has described the full implementation of a low cost real time digital control system of a
stepper motor where a PC or a single board computer has been used to monitor and control mechanical
equipments. A digital control of a multi-axis-system has been developed by A.S.Zein El Din10 using
Programmable Logic Controllers (PLC) for controlling the rotor position, direction and speed of stepper
motors. K.G.Adams and M.Van Reenen11 has developed a work based on a low cost stepper motor
positioning system with closed loop control where two different closed loop positional controllers have
been designed. Motion Control of Stepper Motors with the Parallel Port on PC and its applications has
been described by T.H.Woo,G.S.Zhang, M.Wang, B.Z.Xu, B.Gang, C.Li12 . Digital position control
JECET; June 2014-August 2014; Sec. C, Vol.3.No.3, 1653-1663.

1654

Closed ...

Mukherjee et al.

scheme of a motorized valve using microcontroller for controlling the stepper motor as an actuator has
been designed by Subrata Chattopadhyay and Sagarika Pal13 . A Stepper Motor Drive Control based on
MCU has been proposed by Shi Rongrong14 . B.Aranjo15 has presented an efficient and versatile drive
system for stepper motors using MATLAB Simulink Software to provide precise control with smallest
possible step angle. Controlling of Stepper Motor by Parallel Port Controller using MATLAB has been
described by Darshana K.Sayre, Dipaknanada B.Mane 16 . Stepper Motor Position Control using 8051
Microcontroller has been developed by Kausik Chakraborty, Nisarga Chand, Bappaditya Roy, Pabitra
Kumar Nandi1 7 . Indira Mazumdar, Reetam Mondal and Sagarika Pal18 have explored an approach and
application of constructing a simple low cost color sensor in angular position Control System of a Stepper
Motor. An Embedded System of DC Motor Closed Loop speed control of DC Motor based on 8051
Microcontroller has been discussed by Reetam Mondal, Arumay Mukhopadhyay and Debdoot Basak19 to
study the reaction of controlled variable to set-point changes.
In the present investigation attempts has been made to design and develop closed loop angular position
control of stepper motor using software technique through computers parallel port. So, a set point
angular position value is given through the computer parallel port to the stepper motor via the stepper
motor driver ULN 2003 to form an open loop system. Now to achieve a desired angular position, the
mechanical movement of the Stepper Motor is converted into digital pulse by use of optical sensor like
incremental encoder attached with the Motor Shaft. Then this signal from the sensor is fed back to the
computer through the input terminal of the parallel port. By using suitable software the instantaneous
angular position of the stepper motor is compared with the set-point value. The error obtained due to loss
of steps would be nullified by the software programming using Visual Basic, thus achieving the exact
angular position of the stepper motor either in clockwise or anticlockwise direction.
2. METHODOLOGY AND BLOCK DIAGRAM
The overall block diagram of the proposed system shown in Fig.1. consists of a Stepper Motor Driver
ULN2003 which has been interfaced with the parallel port of the PC or the LPT Terminal. By using
software programming in Visual Basic four bit patterns are generated and provided to energize the four
coils of the Stepper Motor simultaneously so that the motor rotates according to the wave stepping
sequence, thus converting these electrical pulses into mechanical movements. Many electrically driven
mechanical systems such as machining devices and paper feeds are dependent upon such a conversion.
Between the computer and the stepper motor the driver ULN 2003 is required so that the output signal
from it can supply sufficient driving current to energize the coils of the stepper motor for proper rotation.
As the motor shaft rotates the incremental encoder attached with the shaft coverts the mechanical
movement of the Stepper Motor into electrical pulses by means of an optical sensor. In the optical sensor
circuit the transmitter is an LED with a particular color which transmits a beam of light through the white
transparent slots on the incremental encoder which falls on the receiver i.e. a phototransistor at the other
end. Thus it generates a pulse train corresponding to the number of steps rotated by the Stepper Motor,
which is fed back to the input terminal of the parallel port of the PC. With a suitable software the
controller compares these feedback signal pulses with the given input set-point data and regenerates bit
pattern to nullify the error if any due to slip of steps, to achieve an accurate angular position of the
Stepper Motor. In this present development Stepper Motor with Step Angle of 1.8 has been used. Two
JECET; June 2014-August 2014; Sec. C, Vol.3.No.3, 1653-1663.

1655

Closed ...

Mukherjee et al.

sets of display units are designed, one to display the set-point value and the other to display the feedback
value. So, the error can be seen at a glance from the hardware system itself. Thus, Closed Loop Motion
and Position Control of Stepper Motor Using Parallel Port on PC have been achieved.

Fig.1. Basic Block Diagram of the Proposed System

2. INTERFACING OF THE STEPPER MOTOR DRIVER WITH PC PARALLEL PORT


The parallel port is an excellent interfacing mechanism, allowing all sorts of devices to be connected to
and controlled by the PC. The primary use of these parallel ports is to connect printers to the computer
and therefore it is often called as printer port. It is a 25 pin female (DB 25) connector to which the printer
is connected. The parallel port has several I/O lines which can be partitioned into three groups which are
data lines (8-bit Data Bus), control lines and status signals. As the name refers the data are transferred
over the data lines, control lines are used to control the peripherals and of course these peripherals returns
some status signals back to the computer through status lines. These lines are connected to the Data,
Control and Status registers internally. So by manipulating these registers in the software program one
can easily read or write data to the parallel port through the parallel port with programming languages like
C or Visual Basic. Whatever is written to these registers will appear in corresponding lines as voltages
which can be measured using a multi-meter. For example if 1 is written to the data register the line Data0
of the parallel port will be driven to +5 Volts. Thus one can programmatically turn on and off any of the
data lines and the control lines.

JECET; June 2014-August 2014; Sec. C, Vol.3.No.3, 1653-1663.

1656

Closed ...

Mukherjee et al.

Fig.2. Interfacing of Stepper Motor Driver with PC Parallel Port


Driving the stepper motors requires the switching of current from one stator winding to another. This
switching function has been provided by the driver circuit which arranges, distributes and amplifies pulse
trains from the signal control circuit. The stator windings of the stepper motor are excited at specified
sequence. Therefore, in this present scheme ULN 2003 Stepper Motor Driver IC has been interfaced with
the Printer Parallel Port of the PC (DB 25) as shown in Fig.2. through which the control software
generates a sequence of bit pattern which goes to the Stepper Motor to achieve the desired angular
position and direction of rotation. The IC ULN2003 are high voltage, high current Darlington arrays each
containing seven open collector Darlington pairs with common emitters. Each channel rated at 500mA
and can withstand peak currents of 600mA. These versatile devices are useful for driving a wide range of
loads including solenoids, relays DC Motors, LED displays, filament lamps, thermal print heads and high
power buffers. Therefore they are used to amplify weak signals so that they can be clearly detected by
another circuit. Thus they help to obtain a very high level of current gain, so that the signal is clear.
Instead of ULN 2003 transistors can also be used. If transistors are used as drivers, diodes must be used to
take care of inductive current generated when the coil is turned off. As ULN 2003 has inbuilt driver
circuit so it has been preferred.
3. ROLE OF ROTARY OPTICAL SHAFT ENCODERS AND OPTICAL SENSORS
In many motion systems rotary optical shaft encoders20 provide the most versatile and economical means
to obtain feedback signals for angular position and speed control. The operation of these devices is similar
to optical tachometer. Shaft encoders comprise of a transparent or opaque glass disk, a pattern of opaque
and transparent sections is created around the periphery of the disc. A light beam provided a LED is
passed through the disc. The rotation of the disc and the pattern around the periphery causes the light
beam to make and break for the transparent and the opaque sections respectively. The pulsed signal is
then amplified and fed back to the digital controller .
JECET; June 2014-August 2014; Sec. C, Vol.3.No.3, 1653-1663.

1657

Closed ...

Mukherjee et al.

Fig.3. Rotary Optical Shaft Encoder and Optical Sensor arrangement


The Rotary optical encoders are classified into incremental and absolute 20 . Incremental encoders are more
widely used than absolute encoders, mainly because they are cheaper. In this present work of closed loop
angular position control of stepper motor incremental encoders have been used. The mechanical
movement of the stepper motor has been converted into electrical pulses by means of these incremental
encoders. The Optical sensor circuits comprises of a transmitter i.e. LED and a phototransistor as a
receiver at the other end. In between the LED and the phototransistor an incremental encoder is placed.
When the stepper motor rotates the incremental encoder attached with the motor shaft interrupts the light
source or the LED in the optical sensor circuit. When the light from the LED passes through the
transparent sections of the incremental encoder the output from the collector terminal of the
phototransistor will be 0 Volts and when it does not fall on the base of the phototransistor the output at
the collector terminal is 5 volts. The emitter of the phototransistor is grounded as shown in Fig.3.
Accordingly the encoder provides information to the controller about the instantaneous angular position
of the rotating shaft by producing one square wave cycle per increment of the shaft movement which is
referred to as the resolution of the encoder. For example an encoder with 1000 graduation marks will emit
a signal sequence of 1000 pulses while completing a single revolution.
4. SOFTWARE IMPLEMENTATION OF THE CONTROL UNIT
According to the general design requirement and hardware circuit principle of the system, the
character of the hardware connection and each module chip, and the function requirement, as well
as the improvement of program readability, transferability and convenient debugging the software
design has been modularized as shown in Fig.4. Software design of the system also includes developing
algorithm for the system, allocating memory blocks as per functionality, writing separate routines for
different interfacing devices and testing them on the designed hardware.

JECET; June 2014-August 2014; Sec. C, Vol.3.No.3, 1653-1663.

1658

Closed ...

Mukherjee et al.

Fig.4. Software Flow diagram for the Control Unit

JECET; June 2014-August 2014; Sec. C, Vol.3.No.3, 1653-1663.

1659

Closed ...

Mukherjee et al.

For implementation of the control unit the reference value or set value signal has been given from the
computer keyboard. The sequence of pulses has been generated to run the motor either in clockwise or
anticlockwise direction. Actual angular position information from the stepper motor has been received by
the computer through the optical encoder as feedback signal. The reference signal has been compared
with the feed back signal coming from the encoder considering actual slip of steps into account. If and
error has been generated, that has been corrected through generation sequence of pulses and sending the
same to the stepper motor.
5. EXPERIMENTAL RESULTS AND DISCUSSIONS
In the proposed system as the controller is designed by using computer software technique, there is a
flexibility to insert change any time very easily according to our requirement, without hampering
experimental hardware condition.The system is more stable and accuracy is high because the controller is
processor based .The system has been tested repeatedly. The results have been found excellent. From
the experimental data the best-fit straight-line curve has been plotted, as shown in Fig.5. The percentage
error of the experimental data from this linear trend line equation has been calculated. The percentage
deviation curve from linearity is found to lie within 0.8 % as shown in Fig. 6. It shows that the
deviation of the curve from the trend line equation is very small which means that the variation of the
measured or observed value from the true value is almost linear. Thus the experimental results indicate
that the system has good linearity and repeatability.
Table-1: Angular Position Control of Stepper Motor with Step Angle of 1.8 in closed loop mode
Sl.
No.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.

Positional Angle Set


in Degree
18
27
36
50
72
85
108
120
180
200
240
270
300
320
360

Position Angle obtained


in Degree
18
27
36
50.4
72
84.6
108
120.6
180
199.8
239.4
270
300.6
320.4
360

JECET; June 2014-August 2014; Sec. C, Vol.3.No.3, 1653-1663.

Error
(%)
-0.03887
-0.02592
-0.01944
0.78589
-0.00972
-0.47878
-0.00648
0.494138
-0.00389
-0.1035
-0.25291
-0.00259
0.197662
0.12281
-0.00194

1660

Closed ...

Mukherjee et al.

Fig.5. Setpoint Value Vs Observed Value of angular position of Stepper Motor

Fig.6. Percentage Error Curve


6. CONCLUSIONS AND FUTURE SCOPE OF WORK
A PC based, low-cost position control system of Stepper Motor has been successfully developed. An
efficient and versatile stepper motor drive system using IC ULN 2003 has also been investigated in the
present paper. This drive system can provide precise control of a stepper motor by selecting options of
JECET; June 2014-August 2014; Sec. C, Vol.3.No.3, 1653-1663.

1661

Closed ...

Mukherjee et al.

half or full step, forward or reverse movement and the speed in RPM or the fixed number of steps that the
motor should move, up to 1 degree micro-step and hence it is apt for any robotic and mechatronic
applications. The above problem has been implemented in hardware by fusing the software program into
a hardware module. The key features of this controller lie in its flexibility to provide for high positional
resolution operation of a given stepping motor control system. The controller has been extensively tested
for its accuracy. There had been absolutely no missing step problem during the testing. The controller is
capable of controlling multiple numbers of stepper motors simultaneously with very precise resolution.
The error in the measurement of angular position of the Stepper Motor used is within 0.8% which is
tolerable and thus verified that the system is running smoothly with stability, with high precision and high
rapid responding capability. The system developed is very much simple, rugged, and cost effective.
Application of such control system of stepper motor in remote surveillance system is the future scope of
this work.
REFERENCES
1. Bianculli and J.Anthony, Stepper Motor Apllication and Selection, IEEE Spectrum
1970, 7, 12, 25-29.
2. J.T.Boys, Economical Stepper Motors for Speed control Applications, IEEE Journal
on Electric Power Applications, 1979, 2, 1, 27-28.
3. C.Chen, Microcomputer Speed Control of Stepper Motor,IEEE Control System
Magazine, 1982, 2, 1, 17 20.
4. C.T.Chin, A Stepper Motor Controller, IEEE International Conference on Control
1988,500-505.
5. D.P. Mittal, A precision stepper motor controller for robotic applications, IEEE
Industrial Application Society Annual Meeting (Conference) 1989, 1, 686-691.
6. M.Bodson, J.N.Chiasson,R.T.Novotnak and R.B Rekowski, High performance
nonlinear feedback control of a permanent magnet Stepper motor , IEEE. Trans.
Control Syst. Technol.1993,1,1,5-14.
7. Z.L.Kang, A new methodology for using single microprocessor to control DC stepper
motors, Proceedings of IEEE International Conference on Industrial Technology
1994, 543-545.
8. R.Innes, Industrial Applications of Stepper Motor Control Systems,
Colloquium on Stepper Motors and Their Control,1994, 1-3.

IEEE

9. E.T.Ososanya, Microprocessor control of mechanical systems, Proceedings of IEEE


Southeastcon 1995, 417-421.
10. A.S.Zein El Din, High performance PLC controlled stepper motor in robot
manipulator,Proceedings of the IEEE International Symposium on Industrial
Electronics 1996, 2, 974-978.
11. K.G.Adams and M.VanReenen, A low-cost stepper motor positioning system with
minor closed-loop control Springer Journal,2005, 10,3.

JECET; June 2014-August 2014; Sec. C, Vol.3.No.3, 1653-1663.

1662

Closed ...

Mukherjee et al.

12. T.H.Woo,G.S.Zhang, M.Wang, B.Z.Xu, B.Gang, C.Li, Motion Control with the
Parallel Port on PC and its applications, International conference EUROCON 2007,
809-811.
13. Subrata Chattopadhyay, Utpal Chakraborty, Arindam Bhakta and Sagarika Pal, Digital
Position Control System of a Motorized Valve in a Process Plant Using Hybrid
Stepper Motor as Actuator,Sensors and Tranducers Journal (IFSA),2009,105,73-80.
14. Shi Rongrong, Stepper Motor Drive Control based on MCU, IEEE International
Conference on Control, Automation and Systems Engineering, CASE, 2011, 1-3.
15. B.Aranjo, Stepper Motor Drives for Robotic Applications, IEEE International
Conference on Power Engineering and Optimization, PEDCO, 2012, 361-366.
16. Darshana K.Sayre, Dipaknanada B.Mane, Controlling for Stepper Motor by Parallel
Port Controller using MATLAB, Proceedings of International Conference on
Electronics and Communication Engineering ECE, 2013, 91-95.
17. Kausik Chakraborty, Nisarga Chand, Bappaditya Roy, Pabitra Kumar Nandi, Design
and Development of Stepper Motor Position Control System Using Atmel 89c51
Microcontroller, International Journal of Emerging Research in Management &
Technology, 2013, 2,12,44-48.

18. Indira Mazumdar, Reetam Mondal, Sagarika Pal, Design and Development of
a Low Cost Colour Sensor and its application in Angular Position Control
System of a Stepper Motor, International Journal of Electronics and Computer
Science Engineering (IJECSE), 2013,2,4, 1241-1251.
19. Reetam Mondal, Arumay Mukhopadhyay, Debdoot Basak, Embedded System
of DC Motor Closed Loop Speed Control based on 8051 Microcontroller,
Elesevier,2013,10,840 -848.
20. D.Patranabis, Principles of Indutrial Instrumentation, Tata McGrawhill
publications 2010, Third Edition.

Corresponding Author: Reetam Mondal;


Assistant Professor, Department of Electrical Engineering, JIS College of Engineering (An
Autonomous Institute), Block-A, Phase III,
Kalyani-741235, West Bengal, India

JECET; June 2014-August 2014; Sec. C, Vol.3.No.3, 1653-1663.

1663

You might also like