You are on page 1of 11

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

E-ISSN: 2278–179X

Journal of Environmental Science, Computer Science and
Engineering & Technology
An International Peer Review E-3 Journal of Sciences and Technology

Available online at
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.

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.


P.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.T. Vol. within a considerable step angle limit.Gang.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. M.S.T.Zein El Din10 using Programmable Logic Controllers (PLC) for controlling the rotor position.Chiasson.No. Keywords: Computer controlled.Xu. B. 1654 . 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. Stepper Motor. direction and speed of stepper motors.3. Mukherjee et al. INTRODUCTION Stepper Motor based positioning system is very much useful and popular requirement in the industry.Woo. Digital position control JECET. 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. Many schemes on the present problem have been proposed in past couple of years. C.Mital5 where a 16-Bit Microprocessor has been used as a controller to provide fast and reliable control operations. A new methodology using a single microprocessor to control the speed. M. A precision stepper motor controller capable of both independent and and synchronized control of multiple number of stepper motors has been discussed by D.Chen3 . C. Parallel Port on PC.Li12 .H. 1653-1663. Economical stepper motor for speed control applications has been presented by J. direction and rotation angle of DC Stepper Motor has been implemented by Z.Wang. 1.G. Motion Control of Stepper Motors with the Parallel Port on PC and its applications has been described by T. 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. The principal aim of this motion control is to design control systems which are able to make automatic movement of a machine.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.Zhang. A digital control of a multi-axis-system has been developed by A..G. Error Checker Circuit. C. present paper. K.T.T.Adams and M.. June 2014-August 2014.Closed . Experimental results indicate that the proposed system has high performance and efficiency with percentage error within tolerable limits. Sec.L. which suffers from disadvantages of unstable oscillation in certain speed ranges. J.Bodson. E.Z. The application of Microcomputer for speed control of stepper motor with a digital driving circuit has been described by C.R.Boys 2 . PWM amplifiers and Motorala as digital signal processor has been implemented. Position control.S.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.Kang7 .Novotnak and R.B Rekowski6 has studied a high performance non-linear feedback control of permanent magnet stepper motor where line encoders. In recent times thus PC based digital control is also becoming convenient and popular for research and development in quite a lot of fields. B.N. Bianculli and J.3.

1. An Embedded System of DC Motor Closed Loop speed control of DC Motor based on 8051 Microcontroller has been discussed by Reetam Mondal. scheme of a motorized valve using microcontroller for controlling the stepper motor as an actuator has been designed by Subrata Chattopadhyay and Sagarika Pal13 .No. Now to achieve a desired angular position. consists of a Stepper Motor Driver ULN2003 which has been interfaced with the parallel port of the PC or the LPT Terminal. thus achieving the exact angular position of the stepper motor either in clockwise or anticlockwise direction. 1653-1663. B. Arumay Mukhopadhyay and Debdoot Basak19 to study the reaction of controlled variable to set-point changes. 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.Closed . METHODOLOGY AND BLOCK DIAGRAM The overall block diagram of the proposed system shown in Fig. Bappaditya Roy. 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. C. 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. A Stepper Motor Drive Control based on MCU has been proposed by Shi Rongrong14 . 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. to achieve an accurate angular position of the Stepper Motor. The error obtained due to loss of steps would be nullified by the software programming using Visual Basic. 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.Mane 16 .. Indira Mazumdar.3.8º has been used. By using suitable software the instantaneous angular position of the stepper motor is compared with the set-point value. a phototransistor at the other end. Controlling of Stepper Motor by Parallel Port Controller using MATLAB has been described by Darshana K. In this present development Stepper Motor with Step Angle of 1. 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. June 2014-August 2014. Stepper Motor Position Control using 8051 Microcontroller has been developed by Kausik Chakraborty. 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. 1655 . Sec. 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. Two JECET. Nisarga Chand.. Pabitra Kumar Nandi1 7 .e. which is fed back to the input terminal of the parallel port of the PC.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. Vol. Then this signal from the sensor is fed back to the computer through the input terminal of the parallel port.3. Dipaknanada B. Mukherjee et al. Thus it generates a pulse train corresponding to the number of steps rotated by the Stepper Motor. So. In the present investigation attempts has been made to design and develop closed loop angular position control of stepper motor using software technique through computer’s parallel port.Sayre. 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. 2.

No. Control and Status registers internally. JECET..3. For example if 1 is written to the data register the line Data0 of the parallel port will be driven to +5 Volts. control lines are used to control the peripherals and of course these peripherals returns some status signals back to the computer through status lines. INTERFACING OF THE STEPPER MOTOR DRIVER WITH PC PARALLEL PORT The parallel port is an excellent interfacing mechanism. one to display the set-point value and the other to display the feedback value. These lines are connected to the Data.Closed . sets of display units are designed. the error can be seen at a glance from the hardware system itself. C. Fig. 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. Closed Loop Motion and Position Control of Stepper Motor Using Parallel Port on PC have been achieved. Thus one can programmatically turn on and off any of the data lines and the control lines.1.. The primary use of these parallel ports is to connect printers to the computer and therefore it is often called as printer port. Mukherjee et al. 1656 . As the name refers the data are transferred over the data lines. Sec. June 2014-August 2014. 1653-1663. 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.3. So. Whatever is written to these registers will appear in corresponding lines as voltages which can be measured using a multi-meter. Basic Block Diagram of the Proposed System 2. allowing all sorts of devices to be connected to and controlled by the PC. Thus. Vol.

Each channel rated at 500mA and can withstand peak currents of 600mA. high current Darlington arrays each containing seven open collector Darlington pairs with common emitters. June 2014-August 2014. A light beam provided a LED is passed through the disc. 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. 1653-1663. If transistors are used as drivers.3. Shaft encoders comprise of a transparent or opaque glass disk. Sec. LED displays. thermal print heads and high power buffers. As ULN 2003 has inbuilt driver circuit so it has been preferred. The stator windings of the stepper motor are excited at specified sequence.2. Mukherjee et al. Therefore. These versatile devices are useful for driving a wide range of loads including solenoids. diodes must be used to take care of inductive current generated when the coil is turned off. 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. distributes and amplifies pulse trains from the signal control circuit.Closed . so that the signal is clear. 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. filament lamps. JECET.No. The operation of these devices is similar to optical tachometer. Instead of ULN 2003 transistors can also be used. Interfacing of Stepper Motor Driver with PC Parallel Port Driving the stepper motors requires the switching of current from one stator winding to another.3.2. Thus they help to obtain a very high level of current gain. The pulsed signal is then amplified and fed back to the digital controller . a pattern of opaque and transparent sections is created around the periphery of the disc. C. The IC ULN2003 are high voltage.. 3. This switching function has been provided by the driver circuit which arranges. 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. Fig. Therefore they are used to amplify weak signals so that they can be clearly detected by another circuit. relays DC Motors.. Vol. 1657 .

The emitter of the phototransistor is grounded as shown in Fig.3. In this present work of closed loop angular position control of stepper motor incremental encoders have been used.. The Optical sensor circuits comprises of a transmitter i. Software design of the system also includes developing algorithm for the system. the character of the hardware connection and each module chip. June 2014-August 2014. mainly because they are cheaper. Vol. writing separate routines for different interfacing devices and testing them on the designed hardware. SOFTWARE IMPLEMENTATION OF THE CONTROL UNIT According to the general design requirement and hardware circuit principle of the system. JECET.3. transferability and convenient debugging the software design has been modularized as shown in Fig. 1653-1663. C. The mechanical movement of the stepper motor has been converted into electrical pulses by means of these incremental encoders.No. Rotary Optical Shaft Encoder and Optical Sensor arrangement The Rotary optical encoders are classified into incremental and absolute 20 . 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. Mukherjee et al. as well as the improvement of program readability.e. Sec. 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.3. Incremental encoders are more widely used than absolute encoders. Fig.4. For example an encoder with 1000 graduation marks will emit a signal sequence of 1000 pulses while completing a single revolution. and the function requirement. 4.Closed ..3. 1658 . 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. allocating memory blocks as per functionality.

C. Mukherjee et al. 1653-1663. June 2014-August 2014..3.No. Software Flow diagram for the Control Unit JECET.3.4.Closed . Sec. 1659 .. Vol. Fig.

. 6. If and error has been generated. The percentage deviation curve from linearity is found to lie within ± 0. 1.25291 -0. 13.494138 -0. as shown in Fig.6 108 120.The system is more stable and accuracy is high because the controller is processor based .00259 0. 5. C. 11. 6.00389 -0.No.8 % as shown in Fig.3..47878 -0. The sequence of pulses has been generated to run the motor either in clockwise or anticlockwise direction. there is a flexibility to insert change any time very easily according to our requirement. 5. Mukherjee et al.Closed .4 360 JECET. 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.6 180 199.12281 -0.78589 -0. 7. June 2014-August 2014. The percentage error of the experimental data from this linear trend line equation has been calculated. 1653-1663.02592 -0. 2. Thus the experimental results indicate that the system has good linearity and repeatability. Error (%) -0. 8. Sec.4 72 84. that has been corrected through generation sequence of pulses and sending the same to the stepper motor.197662 0. 12.6 320. Table-1: Angular Position Control of Stepper Motor with Step Angle of 1. without hampering experimental hardware condition. No. Vol. 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.03887 -0. 3.00648 0. 15.00194 1660 .3. 14. From the experimental data the best-fit straight-line curve has been plotted. 9. 4.8 239. The reference signal has been compared with the feed back signal coming from the encoder considering actual slip of steps into account.1035 -0. The results have been found excellent.5.01944 0. For implementation of the control unit the reference value or set value signal has been given from the computer keyboard. 10.The system has been tested repeatedly. EXPERIMENTAL RESULTS AND DISCUSSIONS In the proposed system as the controller is designed by using computer software technique.8º in closed loop mode Sl.4 270 300.00972 -0. Actual angular position information from the stepper motor has been received by the computer through the optical encoder as feedback signal.

This drive system can provide precise control of a stepper motor by selecting options of JECET. An efficient and versatile stepper motor drive system using IC ULN 2003 has also been investigated in the present paper. Sec. Vol. Fig. Mukherjee et al. June 2014-August 2014. CONCLUSIONS AND FUTURE SCOPE OF WORK A PC based.5. Percentage Error Curve 6. C.6.3.No. Setpoint Value Vs Observed Value of angular position of Stepper Motor Fig.. 1661 . low-cost position control system of Stepper Motor has been successfully developed.3.Closed .. 1653-1663.

Proceedings of IEEE International Conference on Industrial Technology 1994. “Microcomputer Speed Control of Stepper Motor”. 1. 12. half or full step. rugged.T.B Rekowski. “High performance PLC controlled stepper motor in robot manipulator”. A.P. 686-691.Novotnak and R.Chiasson. D.Closed .Proceedings of the IEEE International Symposium on Industrial Electronics 1996.5-14.Chin. 25-29.500-505.R..L. M.1. Control Syst. and cost effective. Application of such control system of stepper motor in remote surveillance system is the future scope of this work. forward or reverse movement and the speed in RPM or the fixed number of steps that the motor should move. C. 974-978. IEEE International Conference on Control 1988. REFERENCES 1. 1979.VanReenen.N.Kang. 8. 1982. K. The controller has been extensively tested for its accuracy.Zein El Din. E. IEEE Industrial Application Society Annual Meeting (Conference) 1989. 2. 10. The above problem has been implemented in hardware by fusing the software program into a hardware module. IEEE Spectrum 1970. 7. 1-3. J. 2.1993. 417-421. “A new methodology for using single microprocessor to control DC stepper motors”. The controller is capable of controlling multiple numbers of stepper motors simultaneously with very precise resolution. Z.Ososanya. up to 1 degree micro-step and hence it is apt for any robotic and mechatronic applications. 4. June 2014-August 2014.1. “A Stepper Motor Controller”.Innes. “A precision stepper motor controller for robotic applications”.T..Adams and M. 10.T. “A low-cost stepper motor positioning system with minor closed-loop control” Springer Journal.Boys. 7. Bianculli and J. 17 – 20. Sec.G. 3. IEEE. J. 543-545. “High performance nonlinear feedback control of a permanent magnet Stepper motor ”. 1.S.3. The key features of this controller lie in its flexibility to provide for high positional resolution operation of a given stepping motor control system. IEEE 9. “Economical Stepper Motors for Speed control Applications”. 11. There had been absolutely no missing step problem during the testing.Anthony. “Industrial Applications of Stepper Motor Control Systems”. 1662 .Bodson. 1653-1663.IEEE Control System Magazine. 27-28.8% which is tolerable and thus verified that the system is running smoothly with stability. C. Vol. Mittal. Mukherjee et al.1994. Technol. with high precision and high rapid responding capability. 2. C.3. The error in the measurement of angular position of the Stepper Motor used is within ±0.T.3.No.Chen. Colloquium on Stepper Motors and Their Control. IEEE Journal on Electric Power Applications. 6. The system developed is very much simple. 2. 5. 1. JECET. Proceedings of IEEE Southeastcon 1995. Trans.2005. “Stepper Motor Apllication and Selection”. R. “Microprocessor control of mechanical systems”.

International conference EUROCON 2007. C. JIS College of Engineering (An Autonomous Institute). Elesevier. 2012.2013. Reetam Mondal. 17. Kalyani-741235. Arumay Mukhopadhyay. Kausik Chakraborty. June 2014-August 2014.2009... Darshana K.G. Reetam Mondal. Shi Rongrong. Third Edition.Wang.Aranjo. 1241-1251. 18. 809-811. 2013. West Bengal.No. Arindam Bhakta and Sagarika Pal. “Principles of Indutrial Instrumentation”. Proceedings of International Conference on Electronics and Communication Engineering ECE.3. T. Corresponding Author: Reetam Mondal.Sayre. 20. India JECET. Utpal Chakraborty. 15. 13. B.Gang.44-48.S. PEDCO. Department of Electrical Engineering. Tata McGrawhill publications 2010. 2. International Journal of Emerging Research in Management & Technology. D. 2011. 361-366. Mukherjee et al.H. B.Woo.Li. “Stepper Motor Drives for Robotic Applications”. Vol. CASE. Debdoot Basak. Sagarika Pal. “Design and Development of a Low Cost Colour Sensor and its application in Angular Position Control System of a Stepper Motor”.73-80. “Digital Position Control System of a Motorized Valve in a Process Plant Using Hybrid Stepper Motor as Actuator”. 14. M.Zhang.105.Sensors and Tranducers Journal (IFSA).840 -848.Patranabis. Sec. Automation and Systems Engineering. B. IEEE International Conference on Power Engineering and Optimization. Dipaknanada B.Z. Nisarga Chand.10.Xu. Pabitra Kumar Nandi. C. 2013. 1-3. 19. Block-A. “Design and Development of Stepper Motor Position Control System Using Atmel 89c51 Microcontroller”.Closed .2. “Stepper Motor Drive Control based on MCU”. Phase – III. “Controlling for Stepper Motor by Parallel Port Controller using MATLAB”.12. 2013. “Embedded System of DC Motor Closed Loop Speed Control based on 8051 Microcontroller”.3. IEEE International Conference on Control. International Journal of Electronics and Computer Science Engineering (IJECSE).4. Subrata Chattopadhyay.Mane. “Motion Control with the Parallel Port on PC and its applications”. 1663 . 16. 91-95. Bappaditya Roy. Assistant Professor. 1653-1663. 12. Indira Mazumdar.