Simple, Low Cost, and Efficient Design of a PC-based DC Motor Drive

: In industrial applications, requiring variable speed and load characteristics, the DC motor is the attractive piece of equipment; due to its ease of controllability. Pulse-width modulation (PWM) or duty-cycle variation methods are commonly used in speed control of DC motors. A simple, low cost, and efficient design for a control circuit uses the PWM to adjust the average voltage fed the DC motor is proposed in this paper. The objective of this paper is to illustrate how the DC motor's speed could be controlled using a 555 timer. This timer works like a changeable pulse width generator. The pulse width can be changed via relays to add or remove resistors in the timer circuit. Using relays enable the proposed circuit to drive higher-power motors. The designed circuit controls the speed of a Permanent Magnet PM DC motor by means of the parallel port of a PC; therefore, the user will be able to control the speed of the DC motor. C++ computer program is used to run the motor at four levels of speed. An interface circuit is used to connect the motor to the parallel port. PC based control software is chosen to get simplicity and ease of implementation.

Modern evolutions in science and technology result in a numerous applications of high efficiency DC motor drives in multiple fields like electric trains, chemical process, rolling mills, home electric appliances, and robotic manipulators, which need speed controllers to carry out tasks.
For a long time, the DC motors are widespread in the industry control field, because they have numerous good characteristics, such as; high starting torque, easily linear controlled, and high response performance, etc.The variant motor control method depends upon its variant performance.The peripheral control apparatuses are adequate which contribute to more comprehensive achievement in the industrial control system.Hence, the DC motor control is easier than other types of motors.Nowadays, the control and measurement system could be implemented based on the computer [1].
Speed control represents the important advantage of DC motors.The motor speed has direct proportion with the armature voltage and inverse proportion with the magnetic flux of the poles; therefore, the rotor speed could be adjusted according to the field current and armature voltage.Speed control can be achieved by variable battery tapping, variable supply voltage, resistors or electronic controls [2].
In 21th century, the computers system have been applied in various application because it easy to monitor.To access a system, the user only interface with the PC software without need explore about hardware or manually control in computer system.It is not practical, in the contemporary technology period, to use a manual controller because it may waste cost and time.So as to minimize time and cost, it is necessary to suggest a controller based on PC, because it is portable.The users could monitor their system at specific place without going to the plant (machine), specifically in industrial application.As well as, the power could be minimized and preserved with computer which is more reliable and precise.The computer assisted by developed software is able to interfacing with hardware system, making the computer system reliable [2].
One of the important advantages of using the PWM technique in speed control of DC motor is that the signal stays digital always from the processor to the controlled system without need to digitalto-analog conversion, which minimizes the noise effects.Therefore, the DC supply is chopped into either fully ON or fully OFF.The voltage/current supply is fed into analog load through a repeating series of the ON/OFF pulses.By giving sufficient bandwidth, any analog value can be encoded with PWM.Another advantage of the PWM is that the pulses can extend into the full supply voltage and yield higher motor torque, and capable to surmount the internal motor resistance more easily [2].
The PWM is an efficient way of digitally encoding the levels of analog signals.PC based electrical appliances control is an interesting PC based research, mainly useful for industrial applications, home automation, and supervisory control applications.PC based PWM speed controller has become an essential in many implementations, starting with routines such as gate openers, window shutters through PC fire alarms and metering to automotive implementations such remote keyless entry and tire pressure monitoring systems [1].
There is enough number of research works in the literature talk about utilizing the solid-state devices in the PC-based control of DC drives.Huang and Lee [1] designed a PID controller to change the DC motor speed using the Lab VIEW software program, and demonstrated the motor speed in realtime to get the response of the PID controller based system.Sánchez1 and Valenzuela [2] had been proposed a control scheme in real-time without using a data acquisition board.So that the design was based on using the PC parallel port and two microcontrollers to achieve data feedback, Meha et al. [3] had investigated the speed control of DC motor using PWM technique.The desired speed of the motor had been programmed with C# language through the communication with 8051 microcontroller with a standard PC serial port.The microcontroller based closed-loop automatic DC motor speed control had been introduced by Dewangan et al. [4].A PMDC motor adjustable speed drive control was implemented by Ravindran and Kumar [5] with software program in Visual Basic code and hardware setup.The output of the proposed system is accomplished from the GUI of the LABVIEW.Gupta and Deb [6] presented a cost effective method to control the speed of a low cost brushed DC motor used in electric cars by integrating an IC 555 Timer with a high boost converter.This converter was used since electric cars need high voltages and currents.
Yadav et al. [7] presented an open loop scheme for the speed control of a PMDC motor using an AVR Microcontroller.The PC interfacing has been done using serial port (DB9 Connector).Kumari et al. [8] had made an attempt to control the axes motion in CNC machine tools by controlling the speed of both DC as well as Stepper motors.A PC-to-Motor interface and driver circuit board had been designed and developed for the presented system.The software of the system had been developed using LabVIEW-based graphical programming language.Chauhan and Semwal [9] implemented a PWM based speed control of PMDC motor through RS232 serial communication port with PC.Controlling the motor speed through tachogenerator as a speed feedback was executed using an ATmega8L microcontroller.Shah and Deshmukh [10] implemented a PWM technique with the help of LM3524 for the speed control of PMDC motor fed by a DC chopper.[11] presented an experimental setup for PWM controlling the speed of a DC motor used to drive a conveyor belt.An H-bridge had been used to supply the DC motor that permits to reverse the direction of the motor rotation.An ARDUINO UNO board, controlled by a program given in the LabVIEW 2013 programming environment, and combined with an Atmega 328 microcontroller was used to generate a the PWM signal.

Petru and Mazen
The purpose of a digital DC motor control is to use a digital signal that describing the demanded average voltage which needed to supply the DC motor.Operating and driving speed concept of a DC motor need to be study.Therefore, this paper has to take a part to design and develop a computer-based DC motor speed drive interface system.The paper has divided to two parts which are DC motor drive circuit design and Personal Computer (PC) to parallel communication interface.
The current paper is developing to provide an efficient, simple, and low cost method for controlling the speed of a DC motor via interfacing it with a PC through parallel port and using PWM technique.The PWM signal can be generated by using an IC -NE555 timer.The pulse width can be changed using relays by inserting or splitting resistors in the 555 circuit.These relays can good interface enabling the proposed circuit to drive higher-power motors.

Permanent Magnet DC Motor [12]:
The Permanent Magnet (PM) DC motor is one of the most widely used prime movers in industry today.PMDC motors became increasingly widespread in applications require relatively low torques and efficient use of space.The PMDC motors have construction differs from other DC motors, in which; the magnetic field of the stator is generated by suitably located poles, made up of magnetic materials.Differently, these motors do not require a field excitation, whether by means of the selfexcitation or separately techniques.
The equations that represent the PM motor operation are shown in equivalent 1 through 7.
The motor torque generated is relating to the armature current, Ia with a torque constant, kt which can be defined by the motor geometry: Like the traditional DC motor, the rotation of the rotor generates a back emf, Eb, that is linearly related to motor speed ωm by a voltage constant, ke: The PM motor equivalent circuit is quite simple, since it does not require modeling the field winding effects.The equivalent circuit and the torque-speed characteristic of a PM motor are shown Fig. 1.

Fig. 1: Equivalent circuit and torque-speed characteristic of the PMDC motor
The circuit model shown in Fig. 1 can be used to extract the torque-speed characteristic, as follows.For a fixed speed and thus fixed current, the inductor might be considered as a short-circuit and get the following equation stated in (3) [12]: Where Vs: motor input voltage source, Ra: motor armature winding resistance, T: motor torque, Eb: motor back emf, Ke: voltage constant, and ωm: motor speed.thus getting the speed -torque equations (4 to 7) [12]: Where To and ωmo are zero speed torque and speed at no load, respectively.

Pwm DC Motor Drive:
There are different types of DC motor drives used to drive different types of loads with different values of speed.Therefore, many speed-controlling devices are greatly needed.The most common speed control method is PWM technique.This technique depends on switching the power device ON and OFF at a certain frequency, by changing the ON and OFF times "duty cycle".
Many applications employ a microcontroller to produce the required PWM signals.On the other side, the 555 PWM circuit proposed here will produce an easy and low cost to build circuit, and suitable understanding of the pulse width modulation idea.The main advantage of using 555 timer is because that it does not require coding.It is very cheap, also useful in different applications where the PWM setting needed only, sometimes be changed.
The PWM 555 timer circuit is formed as an astable oscillator.Once an input power is applied, the 555 will be oscillated without using any external trigger.

The NE555 Timer [13], [14]:
NE555 can be introduced as a multipurpose integrated circuit IC that could execute both multivibrator functions; monostable and astable.This circuit distinguishes with a greater accuracy, repeatability, flexibility provided in the IC packages, and ease of application.The NE555 timer circuit is able to produce precise pulses (time delays) or oscillation.In the time-delay "monostable" mode, the pulse duration or time delay can be adjusted by using an external RC network.In the astable "clock generator" mode, the output frequency may be changed by adding two external resistors R1, R2 and one capacitor C. Fig. 2 shows typical circuits for the NE555 in both modes of operation, monostable and astable operation.Also, it can be noted that the threshold and the trigger levels could be externally controlled.
The pulse width, in the monostable circuit, can be computed as depicted in Eq. ( 10): The positive pulse width, for the astable timer circuit could be determined as seen in Eq. ( 11) and the negative pulse width could be defined as in Eq. ( 12):

Fig. 2: NE555 timer
In the proposed circuit, a stable mode is used so that the resistors R1 and R2 help in varying the frequency of the output from the comparator of the timer.This helps in generating a pulse train used to switch the transistor that used on.The biasing voltage used in the circuit is VCC.The output of the comparator is a square wave with VCC amplitude as shown in Fig. 3:

Astable Operation [13], [14]:
The astable (or multivibrator) circuit does not require trigger for starting.Once timer is powered, the output will start to oscillate between VCC volts and 0 volts as shown in Fig. 3.
The astable circuit could be oscillated very quickly (up to millions of cycles/sec) or slowly (down to many minutes/cycle).The time when the output is High is called ON time, or charge time (or mark), while the time of Low output is called OFF time, or discharge time.The connection of 555 as a stable mode is seen in Fig. 4.

Fig. 4: Connections of 555 timer in astable mode
As the capacitor voltage extends (2VCC /3), the discharge transistor is enabled (pin 7), and this point in the circuit will be grounded.Capacitor C now will discharge through R2 alone.Starting at (2VCC /3), it discharges towards ground, but again is interrupted halfway there, at (VCC /3).So, the discharge time will be t2=0.693R2*C.
The astable timer circuit performance could be represented by Eqs.(13-16): Where T is the total period of the pulse train, f is output circuit frequency, and Vav is the average output voltage.

PC Parallel Port as Analog I/O Interface:
A parallel port (or printer port) is an interface type placed on computers used to connect various peripherals.The parallel port data pins are Transistor-Transistor-Logic (TTL) outputs and generate a typical logic high of (3-5V) DC and a logic low of 0V [15].PC interfacing is the art of connecting computers and peripheral devices.The controller designed in this paper utilizes the PC parallel port as an analog I/O interface.Only four bits are used as analog interfaces through a PWM technique.This technique permits to build an analog interface without using A/D or D/A converters.The analog voltages and currents could be used to control processes directly.The analog control may seem as an intuitive and simple, it is not always practical or economically attractive.Analog circuits tend to be drifted over time and difficult to tune.When the analog circuits are digitally controlled, system power consumption and costs could be drastically minimized.The PWM is an efficient technique for controlling analog circuits via digital signals.The PWM is a method to digitally encode the analog signal levels.The duty cycle of a square wave shown in Fig. 3 is modulated for encoding a specific analog signal level.

Generation of PWM Waveform Using IC 555 Timer:
In controlling DC motors, it is possible to utilize transistor, resistor, autotransformer, etc. to execute linear current control, but this method has very large power consumptions.Nowadays, the PWM controlling devices are the most often used.The PWM circuit operates by producing a square wave with a changeable ON/OFF ratio.The average ON time might be changed from (0-100 %).Consequently, an adjustable amount of electric power can be fed to the load.The PWM circuit is more efficient than a resistive power controller [13].
The PWM and the driving motor circuit are respectively related to each other.The PWM is generated by using IC 555 timer so as to control the DC motor speed.The principle is based on using of square wave (duty cycle) for variation value of waveform.This is for generating the motor drive signal.The torque loaded on the motor is determined by PWM duty cycle.The speed of the DC motor is depending on duty cycle of PWM signal.PWM is also space saving, economical, and noise immune.
The PWM control can implemented by switching the power applied to the motor ON and OFF very rapidly.The DC voltage is transferred to a square-wave signal.By changing, the duty cycle of the signal (modulating the pulse width), the average input power and thus the motor speed could be controlled.
Generating PWM on parallel (LPT1) port data pins (D0-D3), using C++ is very simple.For ON period, high logic (1 means 3.49V) has to be applied on that data pin and low logic (0 means 0.09V) for OFF period of pulse.

Design and Implementation
The proposed design can be divided into two parts; the first one is the design of Astable mode by using 555 device with modeling of its duty cycle, while the second one is the design of driving circuit for PMDC motor.If R2 >> R1 then ON time (t1) / OFF time (t2) ratio = 1 approx and the output is a square wave with duty cycle of 50%.

Design of Astable
If R2 << R1 then ON time (t1) / OFF time (t2) ratio = ∞ approx and the output is a constant DC with duty cycle of 100%.
If R1=R2 then ON time (t1) / OFF time (t2) ratio = 2 and the output is a square wave with duty cycle of 2/3 % = 66.67%.The duty cycle and corresponding output voltage of the time is shown in Fig. 7, they can be calculated from Eqs. (15 and 16) and the value of the frequency.It can be seen that the duty cycle of the 555 timer circuit in astable mode cannot reach less than 50%; Duty Cycle (50-100) %.
To extend the duty cycle to be from full off (0% duty cycle) to full on (100% duty cycle), some modification may be done on the timer circuit as shown in Fig. 8. Diodes D1 and D2 will be added to the circuit in Fig. 4 to be forward and backward paths for charging and discharging the capacitor C, respectively.

Modified Duty Cycle (0-100) %
Selecting the ratios of R1 and R2 in Eq. 15 varies the duty cycle accordingly.If a duty cycle of smaller than 50% is needed, even if R1=0, the charging time cannot be made smaller than the discharging time since the charge path is: R1+R2, while the discharge path is: R2 alone.Hence, it is necessary to insert a diode D1 in parallel with R2, cathode toward the timing capacitor.Another diode D2 is not mandatory (in series with R2), cathode away from the timing capacitor.Thus, the charge path will be R1, through the D1 into C, while the discharge is being through the D2 and R2 to the discharge transistor.This schematic will give a duty cycle ranging from less than 5% to greater than 95%.It should be noticed that for reliable practical operation, a minimum value of 3kΩ for R2 is needed to confirm that oscillation starts.When the capacitor C begins to charge through R1 and D1, the voltage on C rise to 2VCC/3, the threshold (pin 6) will be activated, which makes the output (pin 3), and discharge (pin 7) are going Low.
When the capacitor C starts to discharge through R2 and D2 and the voltage on C drops below of VCC /3, the output (pin 3) and discharge (pin 7) pins are going High, and the cycle repeats.Pin 5 is not used for an external voltage input; therefore, it is bypassed by a 0.01uF capacitor to ground as shown previously in the Fig. 3.
Assuming R2 value to be fixed, the duty cycle varies only with respect to R1.Therefore, Charging time; t1 = 0.683R1C (high output) … ( 17 All the desired values to be designed for the wanted duty cycle (or average output voltage) and the oscillation frequency for the PWM output of the timer can be calculated according to the modified equations (17-22) and using the curves shown in the Figs.(9and10).Therefore, the DC motor speed could be controlled using a 555 timer over the full range by changing the signal mark-space ratio across the full range, so it is possible to get any desired average output voltage ranging (0-5V).

Drive Circuit Design
The PC employs a software program to control the motor speed.The motor is connected via an interface circuit to the PC.The interface circuit shown in Fig. 11 includes IC1 (74LS244 buffer); IC2 (ULN2003 driver); IC3 (NE555 astable multivibrator circuit); relay switches S1, S2, S3 and S4; and T1 (2N2222) motor driver transistor.In the case of load currents up to about 600mA, a 2N2222A NPN transistor is advised.For higher-power motors, the BJT transistor might be replaced by an IGBT or a power MOSFET.The 555 timer works as a changeable pulse width generator.A Freewheeling diode, D1 is used to prevent back-emf induced from inductive loads like brushed motors from destroying the switching transistor.The pulse width can be changed by utilizing relays to insert or split resistors in the 555 timer circuit.IC3 has a square wave as an output voltage.This voltage is applied into the base of transistor T1 through a current limiting resistor R3.The transistor T1 is utilized to drive the DC motor.
The computer program controls these resistors.In the first case, the switching relays; S1 and S2 are in ON case, and the charging resistor is R1C, where R1C≈0.1×R2=0.1*47k=4.7kΩ, is used to reduce the on time of the pulse signal and, then, the motor speed to the lower limit.
When relays S1 and S3 are on, the IC3 555 generates a pulse signal with a duty cycle of 50%.Therefore, the charging resistor, R1b, is equal to the discharging resistor, R2.In the third case, when the relays S1 and S4 are on, and the charging resistor is R1a, where R1a ≈ 10×R2=10*47=470kΩ.This will increase the on time of the pulse signal and, thus, the motor speed will be 90% of its maximum speed.
When, S1 is on while all other switches S2, S3 and S4 are off, the 555 timer output is adjusted to logic one with a 100% duty cycle and thus driving the DC motor with its maximum speed.The conditions of the ON/OFF operation of the relays and their corresponding motor speeds are summarized in Table 1.The code is prompting to choose a specific speed, stores the selection as an integer variable choice, produces the right digital sequence, and stores it with another integer variable.By using the outportb function, the value of the integer variable data at the PC's parallel port could be placed.The program used the kbhit function for stopping the DC motor when hitting any key on the PC keyboard.The software has been written in "C++" language and compiled using Turbo C++ compiler.Firstly, as the motor is switched off, the program is prompting to press ''Enter" key to start the motor.Once the key is pressed, the motor begins running at low speed.After a few seconds, the program will ask to press any key on the keyboard to go to the next screen for controlling the motor speed.This screen has options to increase and decrease the motor speed and also to exit from the program.To vary the motor speed, enter the choices (1-4) and press ''Enter" key This work varies the motor speed, one step at a time, and the message of "Speed decreased" or "Speed increased" will be shown on the screen.To return to the main menu, certainly, again press "Enter" key.
The circuit prototype has been built on a PC board to experimentally validate the designed PWM speed control DC motor drive as demonstrated in Fig. 12.

Results and Discusion
The experimental results of the motor drive prototype are depicted as seen in Figs.(13)(14)(15).Figs.(13(a)-15(a)) show the output no load voltage waveforms with 10%, 50%, and 90% duty cycle PWM signals, to get speeds listed as in Table 1.
With 0V (or 0 pulses), the output voltage waveform will produce 0% PWM duty.Elevating the voltage from (0-5V) causes increasing the PWM duty from (0-100%) and turning the motor.As it can be seen from the figures, a signal of 10% duty cycle is on for 10% of the wavelength and off for 90%, while a signal of 90% duty cycle is ON for 90% and OFF for 10%.These signals are transferred to the DC motor at a high enough frequency when the pulsing has no effect on the motor.As a result, the overall power fed to the motor can be controlled from off (0% duty cycle) to full on (100% duty cycle) with good efficiency and stable control.
In PWM control technique, the input voltage with fixed time period and magnitude and variable duty cycle is switching rapidly across the motor armature, however, because the motor current is influenced by their internal inductance and resistance, the resulting motor current is shown as in Figs.
(13(b)-15(b)).These figures show the input current of the motor operated on periods 10%, 50% and 90% of the time, respectively.As the duty cycle becomes higher, the average input motor current gets higher and the motor speed increases.

Conclusions
The aim of this paper is to present an efficient, flexible, simple, low cost, lightweight and accurate design method for PWM controlling the speed of a DC motor using voltage control method by interfacing it with a PC via the parallel port.Program interface is user-friendly enabling simple and flexible operation.The PWM circuit was developed using the NE555 timer.The user can adjust timer control by picking up different resistors and capacitors.In this paper, PWM acts as a tool to control DC motor speed (in four levels).Since the average value of the armature voltage is controlled, the motor speed could be controlled only below the rated speed.The motor could be run as low as 230 rpm and as high as 3000 rpm, approximately.The PC is utilized in controlling process because of simplicity and ease of programming, especially as a demonstrative prototype.The proposed circuit may be used in 5 Volt systems.This circuit has been used to control the motor speed for small DC fans of the type used in computer power supplies.Using relays enable the proposed circuit to drive higher-power motors.

CONFLICT OF INTERESTS.
-There are no conflicts of interest.

Fig. 9 :Fig. 10 :
Fig. 9: Frequency vs. R1 for different values of C for modified duty cycle

Fig. 11 :
Fig. 11: Speed control of a 5V PMDC motor via the PC's parallel portTable 1: Switch States and Generated PC Sequences

Fig. 12 :
Fig. 12: Photograph of Hardware a) overall setup b) DC motor driver