You are on page 1of 25

ABSTRACT

The aim of developing this project is to control the speed a 2h DC motor. The main
advantage in using a DC motor is that the Speed-Torque relationship can be varied to
almost any useful form. To achieve the speed control an electronic technique called
Pulse Width Modulation is used which generates High and Low pulses. These pulses
vary the speed in the motor. For the generation of these pulses a microcontroller
(AT89c51) is used. As a microcontroller is used setting the speed ranges as per the
requirement is easy which is done by changing the duty cycles time period in the
program. This project is practical and highly feasible in economic point of view, and
has an advantage of running motors of higher ratings. This project gives a reliable,
durable, accurate and efficient way of speed control of a 2hp DC motor.
CHAPTER ONE
1.0 INTRODUCTION
1.1 BACKGROUND OF STUDY
The device that converts electrical energy into mechanical energy is
called as a motor. The motor that utilizes a DC supply to produce mechanical output is
DC Motor. The advantages of using these types of motors over conventionally used AC
motors are stated below.
• DC motors have higher controller efficiency.
• DC motors have typical 98% efficiency.
• DC motors have better overload and peak voltage characteristics.
The main advantage of using these DC motors is that the speed- torque characteristics
can be varied to almost any useful form.
As a result of all these advantages these motors have a wide range of applications in
places where constant speed is to be maintained at varying loads. Conveyor belts,
elevators, cranes, ski lifts, extruders, mixers, sewing machines are few such applications
where DC motors are used. So controlling the speed of a DC motor is a purposeful and
required place to work on. The various types of DC motors are
• Series field wound type
• Shunt field wound type
• Compound field wound type
For all these types of DC motor common methods of speed controls.

Speed control methods in a DC motor:


The motor speed can be controlled by controlling armature voltage and armature current.
It is obvious that speed control is possible by varying
• Flux per pole ,Φ (Flux control)
• resistance Ra of armature circuit (Rheostatic Control)
• applied voltage V (Voltage Control)
The above methods have some demerits like a large amount of power is
wasted in the controller resistance. Hence, efficiency is decreased. It needs expensive
arrangement for dissipation of heat produced in the controller resistance. It gives speeds
below the normal speed. By these data that are acquainted we can draw a conclusion that
these electric and electromechanical methods are less adaptive so electronic techniques
are used for speed control. These methods provide higher efficiency, greater reliability,
quick response, higher efficiency. One such technique is Pulse Width Modulation. We
apply this technique in our project so as to control the speed of the DC motor.

1.2 AIMS AND OBJECTIVES


The aim of this project is to help calculate or measure the speed of a dc motor using
microcontroller and other methods.
Objectives includes:
a. To understand how a speed control of a 2hp DC electrical motor system works.
b. To implement and show how a speed control of a dc motor is been measured.
1.3 STATEMENT OF THE PROBLEM
To actually measure and calculate the speed control of a DC electric motor is proven
difficult, using an Arduino or Microcontroller requires some level of advanced
programming to accurately get the values needed to know the speed of a DC motor

1.4 SIGNIFICANCE OF THE STUDY


DC motors has proven more efficient than AC motors, therefore it is important to know
the actual measurements and calculations of how a DC electric motor operates, so that
one can achieve a desired output using a microcontroller or other controllers.
1.5 SCOPE/LIMITATION OF THE STUDY
A student will be able to show on how a speed control of a 2hp DC electric motor
system works and how it can be implemented and different stages on how it is being
used by the military, companies and industries.
1.6 DEFINITION OF TERMS
 DC MOTOR: Direct Current Motor
 AC MOTOR: Alternating Current Motor
 PWM: Pulse Width Modulation
 ARDUINO: is an open-source platform used for building electronics projects.
Arduino consists of both a physical programmable circuit board (often referred
to as a microcontroller) and a piece of software, or IDE (Integrated Development
Environment) that runs on your computer, used to write and upload computer
code to the physical board.
 MICROCONTROLLER: (MCU for microcontroller unit) is a small computer
on a single metal-oxide-semiconductor (MOS) integrated circuit (IC) chip. A
microcontroller contains one or more CPUs (processor cores) along with
memory and programmable input/output peripherals.
CHAPTER TWO
2.0 LITERATURE REVIEW
Speed control of dc motor could be achieved using mechanical or electrical techniques.
In the past, speed controls of dc drives are mostly mechanical and requiring large size
hardware to implement. The development has launched these drives back to a position
of formidable relevance, which were predicted to give way to ac drives. Some
important applications are rolling mills, paper mills mine winders, hoists, machine
tools, traction, printing presses, textile mills, excavators and cranes. This paper
provides a system that can utilized to use DC motor for various applications. We can
utilize the DC Motor for various applications by controlling the speed and orientation
according to the field of interest. Pulse Width Modulation (PWM) is the technique of
utilizing switching devices to produce effect of a continuously varying analog signal.
This PWM conversion generally has very high electrical efficiency and can be used in
controlling either a three-phase synchronous motor or a three-phase induction motor .It
is desirable to create three perfectly sinusoidal current waveforms in the motor
windings, with relative phase displacements of 120°. The production of sine wave
power using a linear amplifier system would have low efficiency, maximum of 64%.
Efficiency can be increase up to 95% if instead of the linear circuitry, fast electronic
switching devices are used, depending on the properties of the semiconductor power
switch.The result is a load current waveform that depends mainly on the modulation of
the duty ratio.

Fig(1.0): Wave form at different duty cycles


The main purpose of this paper is to analyze, identify and make conclusion based on
this paper. A literature review means a collecting related data, analyzed business
process, identify underlying patterns and create a conclusion. Another description of
the literature review is a systematic, explicit and reproducible method to identifying
evaluating and synthesizing the exiting body of completed and recorded work produced
by researcher, scholars and practitioners. In order to develop a successful project, the
current system is identified. The system of conventional DC motor speed control based
on microcontroller is analyzed. Studies of these system are significant to develop a
valid, reliable and efficient up grade project. The literature review part acts as a mean
to discover which methodology should be chosen in developing this system. Facts and
Findings established what the existing system does and the problem are and leads to a
definition of a set of options from which users may choose their required system. This
section will be discussing about the domain of this project, the existing system and
finally the other techniques that applicable to be used while developing this project. It
focused on the how to design and develop the project systematically according to the
requirement of minimize the functional of conventional project. In the other situation,
these will be describing any element or method which is useful to be used for the
purpose of searching and gathered useful information in developing this project.
CHAPTER THREE
3.0 METHODOLOGY
3.1 BLOCK DIAGRAM

Fig( 3.1): Block Diagram of a speed control of a 2hp DC Motor System

3.1.1 POWER SUPPLY

This module is basically designed to achieved 5V,500mA.This consists of a


transformer which is used to step down the AC voltage ,IN4007 diodes used to form a
bridge rectifier to convert AC to DC , capacitor 1000uF which used as a filter
circuit ,7805 regulator to obtain a 5V at the output of the regulator ,330 ohm resistance,
LED as indicator.
Fig(3.2): diagram of supply section

3.1.2 EMBEDDED MICROCONTROLLER: There is a whole wide range of


microcontroller available in the market. But this particular project is developed using
AVR series of microcontroller (ATMEGA16) because of its inbuilt ADC port and its
variable frequency.ATmega16 is a low-power CMOS 8-bit microcontroller based on
the AVR RISC architecture. By executing powerful instructions in a single clock cycle,
the ATmega16 achieves throughputs approaching 1 MIPS per MHz, allowing the
system designed to optimize power consumption versus processing speed. Further it
also minimizes the cost of this personal area network.
3.1.3 ISP CONNECTOR OR USB TO SERIAL CABLE: To interfaces the
coordinator node with the other nodes.
3.1.4 LCD DISPLAY MODULE: The LCD(liquid crystal display) unit receives
character codes (8 bits per character) from a microprocessor or microcomputer, latches
the codes to its display data RAM (80-byte) DD RAM for storing 80 characters,
transforms each character code into a 5‟7 dot-matrix character pattern, and displays the
characters on its LCD screen. We are 16*2 LCD „s which have 16 columns and 2 rows
with 16 hardware pins connected as pin 1,3and 16 are connected to ground, pin 2 and
15 are connected to +5v pin 3 ,4,5 are RS, RW and enable respectively enable pin is
always low. Data pins of LCD are 11,12,13,14 which are used for 4 bit parallel
communication.
3.1.5 L293D(MOTOR DRIVER IC): This IC is high voltage high current four
channel driver designed to accept DTL or TTL logic. This can provide 600mA output
current capability per channel and providing 1.2 peak output current(non repetitive) per
channel and also have internal over temperature protection . It consists of a half H-
bridge to provide high current in order to drive motors.
3.1.6 MAX 232(LEVEL CONVERTER): MAX232 is a dual driver/receiver IC that
includes a capacitive voltage generator to supply EIA-232 voltage levels from a single
5-V supply [2]. Each receiver converts EIA-232 inputs to 5-V TTL/CMOS levels.
These receivers have a typical threshold of 1.3 V and a typical hysteresis of 0.5 V, and
can accept ±30-V inputs. Each driver converts TTL/CMOS input levels into EIA-232
levels. This can be made to work with the help of a few capacitors attached to it.
3.1.7 PERSONAL COMPUTER (PC): This is a multi-purpose computer that is used
to program the microcontroller using assembly language of C++ programming
language, to give a desired output.
3.1.8 MOTOR: is any of a class of rotary electrical motors that converts direct current
electrical energy into mechanical energy. Other components in the block diagram
above are put together to give the motor an output value according to the speed
measured in RPM.
3.2 CIRCUIT DIAGRAM

Fig(3.3): Circuit Diagram of a speed control of a DC Motor using Microcontroller

The above figure shows the circuit of the DC motor speed controller. 230V, AC mains
is stepped down by transformer X1 to deliver secondary output of 12V, 500mA.The
secondary output is rectified by a full-wave bridge rectifier comprising diodes D1
through D4, filtered by capacitor C1 and regulated by IC 7805(IC1). Capacitor C2
bypasses any ripple present in the regulated output. LED1 acts as the power-„on‟
indicator. Resistor R1 limits the current passing through LED1. IC AT89C51 (IC2) is a
low power, high-performance, 8-bit microcontroller. At the heart of the speed
controller system is microcontroller AT89C52 (IC2), which creates (using timer 0)
pulses of varying width for pulse width modulation and controls the motor speed. To
change the speed of the motor, switches S2 and S3 are interfaced to interrupt the input
to pins P3.2 and P3.3 of IC2, respectively. Whenever any of switches S2 and S3 is
pressed, an interrupt is generated, which changes the duty cycle of the pulse train.
Switch S2 interfaced to Interrupt-0 increases the duty cycle of the pulse waveform,
whereas switch S3 interfaced to Interrupt-1 decreases the duty cycle of the pulse
waveform. Power-on reset for the microcontroller is achieved through capacitor C6 and
resistor R2. Switch S1 provides manual reset to the microcontroller. A 12MHz crystal
(XTAL) is used for basic clock frequency. Port pin P1.1 is internally pulled cup. It is
used as the output to control the motor with driver transistor T1. Whenever timer-0
overflows, the status of pin P1.1 is complemented and hence a square wave with
appropriate duty cycle is generated. This pin is interfaced to power transistor TIP122
(T1), which is used to drive the motor. When the transistor is driven into saturation,
current flows through the motor. When the transistor is cut off, the motor current keeps
flowing because of the motor’s inductance. Diode D6 connected across the motor coil
prevents reverse current flow. The software is written in “C” language and compiled
using Keil C compiler, which generates Intel hex code for the microcontroller. The
μVision3 integrates all tools including the “C” compiler, micro assembler,
linker/locator and hex file generator. The generated hex code is burnt into the
microcontroller using a suitable programmer. Whenever any switch is pressed, the duty
cycle of PWM varies. The software then calculates the appropriate values for TH0 and
TL0 for „on‟ and „off‟ time of the output, which are copied in TH0 and TL0 on timer
interrupts. In this circuit, we have used timer 0 of the microcontroller for generating
PWM pulses, which is clocked using a 12MHz crystal oscillator. The base frequency is
kept constant at 1 kHz and the duty cycle of this wave is varied to change the analogue
level at output pin P1.1 of the microcontroller.
3.3 SPEED CONTROL METHODS IN A DC ELECTRIC MOTOR
The motor speed can be controlled by controlling armature voltage and armature
current. It is obvious that speed control is possible by varying
• Flux per pole, Φ (Flux control)
• Resistance Ra of armature circuit (Rheostat
Control)
• Applied voltage V (Voltage Control)
The above methods have some demerits like a large amount of power is wasted in the
controller resistance. Hence, efficiency is decreased. It needs expensive arrangement
for dissipation of heat produced in the controller resistance. It gives speeds below the
normal speed. By these data that are acquainted we can draw a conclusion that these
electric and electromechanical methods are less adaptive so electronic techniques are
used for speed control. These methods provide higher efficiency, greater reliability,
quick response, higher efficiency. One such technique is Pulse Width Modulation. We
apply this technique in our project so as to control the speed of the DC motor.
3.4 PULSE WIDTH MODULATION
Pulse width modulation (PWM) is a method for binary signals generation, which has 2
signal periods (high and low). The width (W) of each pulse varies between 0 and the
period (T). The main principle is control of power by varying the duty cycle. Here the
conduction time to the load is controlled. Let for a time t1, the input voltage appears
across the load i.e. ON state and for t2 time the voltage across the load is zero.
• The average voltage at output is given by Va = 1/T ∫ vodt = t1/T Vs = ft1
Vs = kVs
• the average load current Ia = Va/R = kVs/R where, T is the total time period =t1+t2, k
= t1/T is the duty cycle.
• The rms value of output voltage is V0 = ( i/T ∫ V02 dt ) ½ = k Vs
• The output power and is given by Pi = 1/T ∫v0idt = 1/T ∫ v02/R dt = kVs2/R
• The duty cycle can be varied from 0 to 1 by varying t1, T or f. Therefore, the output
voltage V0 can be varied from 0 to Vs by controlling k, and the power flow can be
controlled.
• As the time t1 changes the width of pulse is varied and this type of control is called
pulse width modulation (PWM) control.
For better understanding of PWM these diagrammatic representations can be used.
These figures represent the waveforms obtained as output at different voltage
requirements.
 HIGH SPEED SIGNAL (90%): The green part of the signal represents the ON
time and the white part of it represents time when it is not receiving any voltage.

 SIGNAL WITH HALF VOLTAGE (50%):

 Signal with low voltage (10%):


3.4.1 ADVANTAGES OF PWM :
The main advantage of PWM is that power loss in the switching devices is very low.
When a switch is off there is practically no current, and when it is on, there is almost
no voltage drop across the switch. Power loss, being the product of voltage and current,
is thus in both cases close to zero. PWM works also well with digital controls, which,
because of their on/off nature, can easily set the needed duty cycle. Using pulse width
modulation has several advantages over analog control. Using PWM to dim a lamp
would produce less heat than an analog control that converts some of the current to
heat. Also, if you use PWM, the entire control circuit can be digital, eliminating the
need for digital-to-analog converters. Using digital control lines will reduce the
susceptibility of your circuit to interference. Finally, motors may be able to operate at
lower speeds if you control them with PWM. When you use an analog current to
control a motor, it will not produce significant torque at low speeds. The magnetic field
created by the small current will be too weak to turn the rotor. On the other hand, a
PWM current can create short pulses of magnetic flux at full strength, which can turn
the rotor at extremely slow speeds. The technology has become more pervasive as low
cost microcontrollers incorporate PWM control. Microcontrollers offer simple
commands to vary the duty cycle and frequencies of the PWM control signal. PWM is
also used in communications to take advantage of the higher immunity to noise
provided by digital signals. So by getting these pulses generated by a microcontroller
we can increase the efficiency, accuracy and thus the reliability of the system. The
most commonly used microcontroller is 8051 that has been used in this project for
production of pulses.
CHAPTER FOUR
4.0 RESULT ANALYSIS
4.1 CONSTRUCTION PROCEDURES AND TESTING
The components for the circuit were first assembled on a bread board and tested. After
it was found to work as anticipated the components were transferred to a Vero board
for the final construction.
4.2 HARDWARE SETUP

Fig.(4.1) Hardware section of a speed control of a 2hp DC electric motor

4.3 SOFTWARE SETUP AND SIMULATION


Microcontroller, when it is used to operate as a wireless network involves following
steps:
 CODING / DEBUGGING: Coding or debugging is one in a high-level
language (such as c or java). Compiler for a high level language helps to reduce
production time. To program the microcontrollers WinAVR [2] was used using
C language. The source code has been commented to facilitate any occasional
future improvement and maintenance. WinAVR is a suite of executable, open
source software development tools for the Atmel AVR series of RISC
microprocessors hosted on the Windows platform. It includes the GNU GCC
compiler for C and C++. WinAVR contains all the tools for developing on the
AVR. This includes AVR-gcc (compiler), AVR-gdb (debugger) etc.
 COMPILING: After compiling the program, it is converted to machine level
language in the form of o’s ans1’s.This file is called as the Hex file and is saved
with the extension (.Hex). The compiler also generates errors in the program
which should be removed for proper execution of the program.
 BURNING: Burning the machine language (hex) file into the microcontroller‟s
program memory is achieved with a dedicated programmer, which attaches to a
PC’s peripheral. PC’s serial port has been used for this purpose. Pony Prog
programmer was used to burn the machine language file into the
microcontroller’s program memory. Pony prog is serial device programmer
software with a user-friendly GUI framework available for
Windows95/98/ME/NT/2000/XP and Intel Linux. Its purpose is reading and
writing every serial device. It supports I²C Bus, Micro wire, SPI EEPROM, and
the Atmel AVR and Microchip PIC microcontroller. The microcontrollers were
programmed in approximately two seconds with a high speed-programming
mode. The program memory, which is of Flash type, has, just like the
EEPROM, a limited lifespan. On AVR microcontroller family it may be
reprogrammed up to a thousand times without any risk of data corruption
Atmega16 Programmer (ISP) which is used to burn the program into AVR
microcontrollers.
 EVALUATION: If the system performs as desired by the user and performs all
the tasks efficiently and effectively the software development phase is over and
the project is ready to be installed in any of the industrial sites as a personal area
network. If not, the entire process is repeated again to rectify the errors. One of
the difficulties of programming microcontrollers is the limited amount of
resources the programmer has to deal with. In PCs resources such as RAM and
processing speed are basically limitless when compared to microcontrollers. In
contrast to a PC, the code on microcontrollers should be as low on resources as
possible, but being cost effective and power efficient makes it a better option. In
the programming of the proposed system is used the following .c and .h file.

Fig (4.3): snapshot C coding for proposed system using of AVRstudio4


Fig (4.4): view of hardware AVR Programmer (ISP) by Robokits

4.3 TESTING
 Frequency Response Test

After the construction of the hardware and software setup, it was subjected to tests to
determine its frequency response which indicates the range of frequencies for which
the appliance is suitable. To do this, a signal generator was used to feed signals of fixed
amplitude but varying frequency to the voltage and current input of the motor. The gain
at each signal variation was found by using a double beam oscilloscope to measure and
compare the output and input signals.
4.4 RESULT USING VSM OSCILLOSCOPE

 Condition 1 when both the switches are open:

Voltage Speed
4.3V 860 rpm

 Condition 2 when switch SW1 is Closed

Voltage Speed Average speed

4.3V 860rpm 790 rpm

3.6V 720rpm
CHAPTER FIVE
CONCLUSSION
This project brought together several components and ideas to achieve a common goal:
to prove that it is possible to run DC series motor on variable speed using PWM. We
put a lot of time in to achieve a variable speed of DC series motor and to perform best
it possibly could. Now that the project as a whole is finished, we hand it over to future
generations to design and improve each component. The designing of a sustainable
system to control the speed and orientation of a geared DC Electric Motor was
successfully implemented in this paper. DC motors have speed control capabilities
which means that speed, torque and even direction of rotation can be changed at
anytime to meet new condition. The hardware of the proposed system and interfacing
with computer using RS232 serial communication port. The project can be divided into
two element which is hardware and software. The developed system can be used in the
GUI to monitor and control the speed of DC electric motor. The paper provides a
platform for further advancement in the field of industrial use of DC geared motors.
REFERENCE
[1] Gopal K. Dubey, “Fundamentals of Electric Drives”,.Narosa Publishing House
New Delhi,1989.
[2] S. M. Bashi, I. Aris and S.H. Hamad “Development of Single Phase Induction
Motor Adjustable Speed Control Using M68HC11E-9 Microcontroller,” Journal of
Applied Sciences 5 (2), pp. 249-252 .
[3] Kumara MKSC, Dayananda PRD, Gunatillaka MDPR,Jayawickrama SS, “PC
based speed controlling of a dc motor”, A fmal year report University of Moratuwa
Illiniaus USA, 2001102.
[4] J Nicolai and T Castagnet , “A Flexible Microcontroller Based Chopper Driving a
Permanent Magnet DC Motor”, The European Power Electronics Application. 1993.
[5] J. Chiasson, Nonlinear Differential-Geometric Techniquesfor Control of a Series
DC Motor, IEEE Transactionson Control Systems Technology.vol 2, pp.35-42,1994.
[6] Yodyium Tipsuwan and Mo-Yuen Chow “FuzzyLogic microcontroller
implementation for DC motor speed control”, IEEE Transactions on Power Electronics,
V0l.11, No.3, June 1999, pp 1271-1276.
SOURCE CODE

void USARTInit
(uint16_t ubrr_value)
{ UBRR= ubrr_value;
//Set Baud rate UCSRC=(1<<URSEL)|(3<<UCSZ0);// Set Frame Format
UCSRB=(1<<RXEN)|(1<<TXEN);//
//Enable The receiver and transmitter }
Reading From The USART This function will read data from the USART. char
USARTReadChar()
{ while(!(UCSRA & (1<<RXC)))
//Wait until a data is available { //Do nothing } return UDR;
//Now USART has got data from host and is available is buffer }
Writing to USART:
void
USARTWriteChar(char data)
{ while(!(UCSRA & (1<<UDRE)))
//Wait until the transmitter is ready
{ //Do nothing } UDR=data; //Now write the data to USART buffer }

#include<reg51.h>

These are the ports from where the microcontroller gets the information about the switch positions.
sbit SW_1 = P2^6; //connecting switch 1 to the port 2 ,pin 6.
sbit SW_2 = P2^7; // connecting switch 1 to the port 2 ,pin 7.
sbit MTR = P1^0; // from this pin we get the signal that is to be fed to the base
void main() microcontroller doesn’t get any voltage so the
switches are considered as 0’s. At this condition the
{ int x; - program is written so that the output signal given by
the microcontroller should have 150 machine cycles
while(1) of ON state and 600 machine cycles of OFF state.
{
This condition is stated when the switch1 is closed
if(SW_1==0 & SW_2==0) and switch 2 is open in this position the supply from
{ the switch1 is shorted into the ground terminal so
microcontroller doesn’t get any voltage so the switch
MTR=1; is considered as 0. Similarly switch 2 is open and
supply is sent to microcontroller so it is considered
for(x=0;x<150;x++); - 1.At this condition the program is written so that the
MTR=0; output signal given by the microcontroller should
have 300 machine cycles of ON state and 300
for(x=0;x<600;x++); machine cycles of OFF state.
}
This condition is stated when the switch2 is closed
if(SW_1==0 & SW_2==1)
and switch 1 is open in this position the supply from
the switch2 is shorted into the ground terminal so
microcontroller doesn’t get any voltage so the switch
{ is considered as 0. Similarly switch 1 is open and
MTR=1; supply is sent to microcontroller so it is considered
1.At this condition the program is written so that the
for(x=0;x<300;x++); output signal given by the microcontroller should
have 600 machine cycles of ON state and 150
MTR=0;
machine cyclesofOFFstate
for(x=0;x<300;x++);
}
if(SW_1==1 & SW_2==0)
{
MTR=1;

This condition is stated when


both the switches are closed in
this position the supply from
the switches is shorted into the
ground terminal so
for(x=0;x<600;x++);
MTR=0;
for(x=0;x<150;x++);
}
if(SW_1==1 & SW_2==1)
{
MTR=1;
}
}
COMPONENTS LIST

Name of the Component Make Value Number


AT89C51 ATMEL 1
Micro Controller
Resistors R1,R2 10KΩ 2
Capacitors C1,C2 1nF 2
Capacitor C3 1mF 1
Diode D1 IN4004 1
Transistor T1 TIP122 1
Switches SW1,SW2 2
DC Motor AMETECK 12Volts 1
DC Adapter Q1(C) 12 Volts 1
DC Adapter Q2(C) 5 Volts 1
Crystal Oscillator X1 12MHz 1

You might also like