Author: Situmorang, Marhaposan
Date published: June 1, 2011
Brushed-DC motors with suitable controller are used in a wide variety of consumer and industrial motion control applications, including factory automation devices and systems, pumping and ventilation systems, electric train, machine tools, house hold appliances etc. This is because DC motors can deliver three or more times the rated torque and combining with microcontroller-based control, it will create a low cost, quite motor operation with high resolution speed and torque control [1-3].
In practice, the motor rotation direction is controlled using H-bridge and selected motor speed is controlled using microcontroller by supplying a suitable voltage across the motor . Microcontroller can produce suitable voltage into DC motor to produce selected speed using Pulse Width Modulation (PWM) technique by varying the duty cycle of PWM signal. Recently, microcontroller-based PWM have been used with many advanced features such as, inbuild PWM generator event managers, time capture unit, dead time delay generator and watchdog timer along with high frequency so that the throughput delay can be neglected to some extent . It can be said that the more advanced features of microcontroller will give a good motor speed control.
In this paper DC motor speed controller is proposed using microcontroller AT89S52 to rotate stepper motor attached into potentiometer of variable regulated power supply. The DC motor contain disc which has 60 holes and the disc rotate between source and detector of optocoupler sensor. The DC motor speed is determined by counting bit pulses resulted from optocoupler sensor. AT89S52 is a standard microcontroller without generator PWM and other features such as find in advanced microcontroller. It is therefore technique to control voltage supplied to the motor not used PWM technique but instead microcontroller is programmed to turn stepper motor/potentiometer right to increase voltage or left to reduce voltage. Every step of stepper motor/potentiometer rotation would give a precise voltage value applied into DC motor since stepper motor normally used as position controller . The number of step of turning stepper motor are in accordance with microcontroller calculation which is based on difference between actual motor speed value and reference value and will discuss in more detail.
At first, the decimal number of reference speed of the DC motor is entered into microcontroller using keypad and in microcontroller the entered decimal value will be scanned and is saved as rpm reference speed. The process continued to execute a subroutine of time base 1 second and in the same time to execute the counter subroutine to count number of bit pulses from optocoupler sensor. Every 1 second after execution of time base subroutine, the number of bit pulses from optocoupler sensor is saved as an actual rpm speed. After that, the program then jump to the subroutine to substract reference speed from actual speed to produce error. Error from substraction is used to rotate stepper motor. The stepper motor is attached into potentiometer in a variable regulated power supply and output voltage of power supply is applied across DC motor. In this case DC motor voltage will be adjusted in a number of steps each cycle until rpm reference value is achieved according to the equation written in the subroutine to rotate stepper motor. All of reference and actual value of motor speed is displayed in LCD using subroutine in program.
3.1. Hardware Design
The block diagram of DC motor speed control system is shown in Fig. 1. It consists of functional elements such as: microcontroller AT89S52, DC motor, sensing unit, keypad, stepper motor, potentiometer in variable regulated power supply and display unit. The variable regulated power supply has an output specification: 0-15 V, 0-5 A.
3.2. Microcontroller AT89S52
Microcontroller AT 89S52 is a central controlling which is programmed to scan decimal number entered from keypad and to save as reference speed and to send number to display. The program continues to start timer as a time base and counter to count output pulses from optocoupler sensor. After time base 1 second has passed, the program will save the number of pulses as actual speed and send to display. Finally, the program will compare actual speed and reference speed and resulted error is used to turn stepper motor right or left according to bit carry in the error value. The system hardware diagram is shown in Fig. 2.
The 3x4 keypad module is used with character *, 0 to 9 and # connected to Port 1. The way to enter decimal number starting from pressing character * and followed by decimal number and then closing by pressing character #. The entered character is scanned with row and column to determined decimal value. The decimal value is saved in RAM and sent to display as reference rotation speed in rpm.
3.4. DC Motor
The DC motor specification used in the present study is shown in Table 1. The DC motor contain disc which has 60 holes in the same position. The disc is arranged between source and detector of optocoupler sensor. The low speed DC motor is preferred since motor speed controller would be tested under load variation applied on the centre top of the disc.
3.5. Sensing Unit
When the motor which contain disc is running the optocoupler sensor will sense the number of pulses that passed through the holes in the disc. Since there are 60 holes in the disc, optocoupler sensor will produce about 60 pulses after one rotation. The number of rotation per second (rps) can be calculated based on the number of pulses count in 1 second by the following equation:
rps = number of pulses count in 1 second/60 (1)
Since the number of rotation per minute (rpm) equal to 60 rps, the value of rpm can be calculated based on the number of pulses count in 1 second by the following equation:
rpm = 60 x number of pulses count in 1 second/60 rpm = number of pulses count in second (2)
The pulses produced by optocoupler in one second therefore equal to the rpm value of motor rotation. The pulses are passed through Schmidt trigger circuit and then connected to Port 2.4 of microcontroller. Microcontroller will count the number of pulses and after 1 second the number of pulse will be saved as rpm value of motor speed.
3.6. Stepper Motor
The stepper motor four phase, unipolar, 1.8 degree and rated torque 1.2 kg-cm is connected with microcontroller through IC buffer 2803 to modify TTL voltage from microcontroller into 12 V which is suitable into stepper motor. Microcontroller send 8 bit of data (HH) from accumulator into Port 3 and then only four bit ofthat data used to turn stepper motor. It will turn stepper motor right if the byte of data in accumulator is rotated left and turn stepper motor left if the byte of data in accumulator is rotated right. The stepper motor is attached into potentiometer in variable regulated power supply using 3:1 gear. Since the stepper motor rotate about 1.8 degree for one step, the potentiometer will turn about 0.6 degree for one step. One step rotation of potentiometer equal to 0.6 degree and its rotation will change output voltage of variable regulated power supply in the order of tenth of milivolt. This value is considered sensitive enough to change DC motor in rpm unit.
3.7. Display Unit
The display unit consists of two lines and sixteen column (2x16) of liquid crystal display (LCD) and is used to display reference and actual speed in rpm. The LCD control pins RS and R/W and En is connected to P2.5, P2.6 and P2.7 of microcontroller while the data DO to D7 is connected to PO.O to P0.7.
Software is written in assembly language MCS 51 and program was downloaded into microcontroller EEPROM using ISP Programmer. The flow chart of the program is presented in Fig. 3, which can be divided into three main parts. The initialization is the first program to be executed to initialize I/O port, register and RAM address that is included in program. The second part contain conditional jump instruction into subroutine for keypad scanning, timer subroutine for time base 1 second, counter subroutine for measuring actual rpm and subroutine for sending character to display. If the key * is pressed the program will jump to subroutine processing reference speed. The following pressed key after * will determine reference speed in term of hundred, tenth and decimal and then will be saved in RAM at a certain address and the speed value will be sent to display and finally key # is pressed to return into main program.
After reference speed has been set, the program will jump into counter and timer subroutine based on bit and not bit of the output pulse from optocoupler sensor. Counter will count the number of pulse by increasing one the value register RO, Rl every time a bit pulse received from sensor. The number which is saved in register RO, Rl is BCD number. On the other hand timer will start calculate time base one second after a non bit pulse received from sensor. After time base one second has been passed the program will jump to subroutine for processing BCD number in register RO and Rl into decimal value. The achieved decimal value will be equal to rpm of actual speed and will be saved in a certain RAM address and also is sent in to display.
The third part of program contain subroutine for comparing and then substracting actual speed with reference speed, to decide action to turn right of stepper motor if actual speed less than reference speed and vice versa. The subroutine for turning stepper motor/potentiometer in variable regulated power supply, initially is made 1 step every one cycle execution and can be modified so to turn stepper motor into 3 step or 5 step in every one cycle execution. In case stepper motor is rotated more than 1 step in every one cycle execution, time delay is given in the order of 13 ms between step motions. Besides 1 step, 3 step and 5 step, the subroutine can also be modified using equation:
number of step = abs (actual speed - reference speed) (3)
number of step = abs (actual speed - reference speed) /2 (4)
number of step = abs (actual speed - reference speed) /5 (5)
Equation (3), (4) and (5) which is based on the difference of actual speed with reference speed is inserted in subroutine to determine and modify the number of step that will be executed in one cycle execution as will be discussed later in results and discussion section. Using this approximation, the number of step of turning stepper motor is not constant but it depends on difference of decimal value between actual speed and reference speed. After turning stepper motor the process will jump back into main program and again counter, timer will proceed and again actual speed comparing with reference speed to decide the next action of turning stepper motor.
4. Results and Discussion
The performance of combination of AT89S52 microcontroller with stepper motor as a speed controller for DC motor has been studied. The DC motor rotation speed is tested for 100 rpm by entering character *100# from keypad. The rpm value response is observed according to number of step that has been written in subroutine for turning stepper motor in one cycle execution i.e. 1 step is presented in Fig. 4 (a); 3 step in Fig. 4 (b) and 5 step in Fig. 4 (c).
The subroutine is also modified using equation (3), (4) and (5) and the performance of using equation (3) is shown in Fig. 5 (a); using equation (4) in Fig. 5 (b) and using equation (5) in Fig. 5(c). The performance of the system results is presented in Table 2. The best response of motor speed is achieved after applying equation (4) into subroutine for turning stepper motor. This number of step of turning stepper motor approximation depends on the difference of decimal value between actual speed and reference speed divide by 2. Using its number of step approximation, the DC motor response gives settling time 7 second, steady state error 1 % , overshoot 1 rpm and undershoot 1 rpm.
It is also observed the value of voltage supplied into DC motor and its relation with rpm speed value as shown in Fig. 6. The curve shows a good linearity which has a voltage constant of about 43 mV/rpm. The voltage of 4.32 Volt representing output speed of 100 rpm.
Since motor speed is affected by loading variation, temperature and other parameters , the motor speed is also tested under the load variation of 0.3 Kg, 0.7 Kg and 1.0 Kg. Fig. 7 shows the response variation of motor speed after applying load 0.3 Kg, 0.7 Kg and 1.0 Kg without using speed controller. It is observed that the rpm value decrease linearly as load is increased
The motor speed again is tested under the load variation of 0.3 Kg, 0.7 Kg and 1.0 Kg using controller by applying equation (4) into subroutine for turning stepper motor The response of motor speed after using controller is presented in Fig. 8 (a) with load 0.3 Kg; in Fig. 8 (b) with load 0.7 Kg and in Fig. 8 (c) with load 1.0 Kg. The rpm value is brought into stable value in the order of 4 second after applying load and also after releasing load. Using this fact it is suggested that many possible applications can be managed using this controller. The applications might be in low speed scheme such as conveyer belt, escalator and other low speed equipments.
The combination of microcontroller AT89S52 with stepper motor as DC motor speed controller is designed and developed. The output response of 100 rpm test results showed that best performance is achieved if number of step for turning stepper motor in subroutine use equation approximation based on difference between actual speed and reference speed divide by two. Each cycle of execution therefore will result not constant number of step execution but is reduced until reference value is reached. The best response of motor DC is achieved which gives settling time 7 second, steady state error 1 %, overshoot 1 rpm and undershoot 1 rpm. Furthermore, under condition of load variation the controller shows that system stable in about 4 second after loading and after unloading.
. Miles Budimir, Model Trains Switch to DC Motors, Machine Design, Vol. 73, Issue 23, Dec 13, 2001, pp. 44.
. T. Chandrasekhar, Nagabhushan K Raju, V. V. CH. Ramana, Nagabushana Katte, Mani C Kuma, Embedded Based DC Motor Speed Control System, Sensors & Transducers, Vol. 121, Issue 10, Oct. 2010, pp. 95-104.
. Bonnie C Baker, Reston Condit, Low-Cost, Quiet Control, Appliances Design, Vol. 52, Issue 10, Oct 2004, pp. 40-43.
. Patrick T. Murphy, Evolution Motor Control Design, Design News, Vol. 64, Issue 7, Jul 1, 2009, p. 14.
. S. A. Prasad, B. S. Kariyappa, R. Nagary, S. K. Thakur, Microcontroller Based AC Power Controller, Wireless Sensor Network, Vol. 1, Issue 2, Jul 2009, pp. 76-81.
. Subrata Cahattopadhyay, Utpal Chakmborly, Alindan Bhakta and Sagarika Pal, Microcontroller Based Closed Loop PMDC Motor Position Control System, Sensors & Transducers, Vol. 102, Issue 3, March 2009, pp. 62-70.
. Greg Paula, Motor Controller Saves Energy, Mechanical Engineering, Vol. 119, Issue 7, Jul 1997, pp. 28.
201 1 Copyright O, International Frequency Sensor Association (IFSA). All rights reserved.
Department of Physics, Instrumentation Group,
University of Sumatera Utara, Medan, 20155, Indonesia
Tel: 62 061 8211050, fax: 62 061 8214290
Received: 13 May 2011 /Accepted: 20 June 2011 /Published: 30 June 2011