Speed control of DC motor by u sing PWM technique A Project Report on
SPEED CONTROL OF DC MOTOR BY USING PWM TECHNIQUE Submitted in a partial fulfillment of the requirement to award the degree of
BACHELOR OF TECHNOLOGY IN
ELECTRICAL AND ELECTRONICS ENGINEERING BY
D.RAMARISHNA !"#$$%A"$&'(
Un)er t*e e+tee,e) -/)0nce o1
Pro1. 2.3.G.RAMA RAO M. Tec* !P*. D(4 MISTE4 MIEEE4 MIE4
Pro1e++or
DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING BONAM 3ENATA CHALAMAYYA ENGINEERING COLLEGE !Appro5e) 67 AICTE4 Ne8 De9*/4 011/9/0te) to 2.N.T.U.4Accre)/te) 67 NBA( ODALARE3U:;&&$%"
B.3.C.ENGINEERING COLLEGE ODALARE3U:;&&$%" B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING
CERTIFICATE This is to certify that this project entitled “SPEED CONTROL OF DC MOTOR BY USING PWM TECHNIQUE
and submitted by
D.RAMA RISHNA in partial fulfillment f the
requirement for the award of B! Tech in "lectrical and "lectronic + "ngineering of 2A3AHARLAL NEHRU TECHNOLOGY UNI3ERSITY AINADA AND TRAINING during the academic session #$$%$''
ProjecG t /)e
He0)O1T*eDep0rt,ent
Pro1.2.3.G.RAMARAO
Pro1.
2.3.G.RAMA
RAO M. Tec* !P*. D(4 MISTE4 MIEEE4 MIE4
M .Tec* !P* .D(4 MISTE4 MIEEE4
MIE4
Pro1e++or=HOD
Pro1e++or=HOD
EXTERNAL EXAMINER
ACNOWLEDGEMENT B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
(irst and foremost we sincerely salute our estimated institution BONAM 3ENATA CHALAMAYYA ENGINEERING COLLEGEfor
gi)ing this golden opportunity for fulfilling our warm dreams of becoming engineers! *e wish to e+press to our heartfelt gratitude and thanks to our guide and ,!!-! Sri 2.3.G.RAMA RAO. /rofessor of "!"!" department for his )aluable suggestions and indebted help to complete our project in time successfully! *e thank our honorable principal SriDr .D.S.3 .PRASAD for his kind co&operation and for pro)iding the department facilities like the computer lab and internet! *e are thankful to our academics director B!0!1 "ngineering 1ollege Dr.G.M.3.Pr0+0)4 for pro)iding appropriate en)ironment required for the project! *e are much thankful to our staff for their )aluable suggestions and lab technicians for their co&operation!
PRO2ECT ASSOCIATES>>>..
-!2343 52IS,N3.
ABSTRACT B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique The project re)eals the digital closed loop control system for speed control of -1 motor using /*4 technique! In present days the power semiconductor de)ices ha)e completely re)olutioni6ed the control of dri)es especially in the area of control usage of thyristors igbt7s power 4s("T etc!. was increased The digital circuit can be interfaced to microcontroller! So that the speed can be controlled by 4icrocontroller there by making speed control of -1 motor e)en more easily! /wm technique to the digital circuit dri)es the component correspondingly speed will change ! The project basically consists of micro controller 41S 8' series 9:c8# and motor dri)er. thermal sensor. comparator. key pad.';<# dot matri+ =1- display and rotation feedback sensor >optical encoder?! The program is written in micro controller to take the input )alues from the user. then rotates the motor by placing 8$@ duty cycle pulse on the motor! The motor is rotated at < 2/4 speed. can be detected by using feedback sensor and micro controller! If the speed is abo)e the specified speed then the micro controller continuously reduces the duty cycle till the speed comes to a predetermined le)el! If the detected speed is less than the pre determined speed then the micro controller continuously increases the duty cycle till the determined le)el! The micro controller keeps on tracking the determined speed by )arying duty cycle in a closed loop control system!
INDE? INTRODUCTION
B.V.C Engineering College, d!l!re"u.
'
Speed control of DC motor by u sing PWM technique A
%. DC MOTOR
'!'introductiontospeedcontrol '!#classificationofdcmotor '!speedcontrolofdcmotor '!Aspeedcontrolofdcshuntmotor '!A!'(lu+controlmethod '!A!# armatureCrheostat control method '!A!0oltagecontrolmethod '!8 motor applications '!8!' Shunt motor '!8!# series motor '!8!1ompoundmotor $. SWITCHING DE3ICES = PWM TECHNIQUE #!' power semiconductor de)ices classification diode #!# thyristors #! #!Abipolarjunctiontransistor #!8 power 4osfet #!; pwm technique #!;!'!Introduction #!;!#! /rinciple #!;!! 4ethods &. COMPONENTS DESCRIPTION !' introduction
!# power supply ! )oltage regulator !Apositi)e)oltageregulator switches !8 !;motorandmotordri)es !% optical encoder !99:c8#microcontroller !: on chip oscillator !'$ liquidcrystaldisplay '. BLOC DIAGRAM AND CIRCUIT DIAGRAM A!' block diagram A!# 1ircuit diagram A! e+planation
8 8 % 9 9 : '# ' ''A 'A '; '% '% ': #$ #' ## ## #8 #% $ ' # # A 8 % A$ A' 8' 8 8% 89 8: ;$
;. CIRCUIT O3ER3IEW
;#
#. RESULT AND CONCLUSION
;
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique @. ANNE?URE
;A
. REFERENCES
%$
INTRODUCTION
INTRODUCTION B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique Today7s industries are increasingly demanding process automation in all sectors! 3utomation results into better quality. increased production an reduced costs! The )ariable speed dri)es. which can control the speed of 3!1C-!1 motors. are indispensable controlling elements in automation systems! -epending on the applications. some of them are fi+ed speed and some of the )ariable speed dri)es! The )ariable speed dri)es. till a couple of decades back. had )arious limitations. such as poor efficiencies. larger space. lower speeds. etc!. ,owe)er. the ad)ent power electronic de)ices such as power 4S("Ts. IDBTs etc!. and also with the introduction of micro &controllers with many features on the same silicon wafer . transformed the scene completely and today we ha)e )ariable speed dri)e systems which are not only in the smaller in si6e but also )ery effi cient. highl y reliable and meeting all the stringent demands of )arious industries of modern era! -irect currents >-1? motors ha)e been used in )ariable speed dri)es for a long time! The )ersatile characteristics of dc motors can pro)ide high starting torques which is required for traction dri)es! 1ontrol o)er a wide speed range. both below and abo)e the rated speed can be )ery easily achie)ed! The methods of speed control are simpler and less e+pensi)e than those of alternating current motors! There are different techniques a)ailable for the speed control of -1 motors! The phase control method is widely adopted. but has certain limitations mainly it generates harmonics on the power line and it also has got p !f when operated lower speeds! The second method is pwm technique. which has got better ad)antages o)er the phase control! In the proposed project. a 8 ,!/ -1 motors circuitry is designed. and de)eloped using pulse with modulation >/*4?!The pulse width modulation can be achie)ed in se)eral ways! In the present project. the /*4 generation is done using micro& controller!
In order to ha)e better speed regulation. it is required to ha)e a feedback from the motor! The feedback can be taken either by using a tachogenerator or an optical encoder
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique or the back "4( itself can be used !In present proj ect. we implement ed the feedback by using the "4( of the armature as the feedback signal! The project proposed is a real time working project. and this can be further impro)ised by using the other safety features. such as field current. air gap magnetic flu+. armature current. etc!.
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
1.
DC MOTOR
%. DC MOTOR B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
%.% INTRODUCTION TO SPEED CONTROL Speed control means intentional change of dri)e speed to a )alue required for performing the specific work process! This concept of speed control or adjustment should not be taken to include the natural change in speed which occurs due to change in the load on the shaft! 3ny gi)en piece of industrial equipment may ha)e its speed change or 3djusted mechanically by means of stepped pulleys. sets of change gears. )ariable speed friction clutch mechanism and other mechanical de)ices! ,istori cally it is pro)ed to be the first step in transition from non adjustable speed to adjustable speed dri)e! The electrical speed control has many economical as well as engineering ad)antages o)er mechanical speed control The nature of the speed control requirement for an industrial dri)e depends upon its type! Some dri)es may require continues )ariation of speed for the whole of the range from 6ero to full speed or o)er a portion of this range . while the others may require two or more fi+ed speeds
%.$ CLASSIFICATION OF DC MOTORS -1 motors are classified into three types depending upon the way their field windings are e+cited! (ield windings connections for the three types f -1 motors ha)e been shown in figure
!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
3
Saturating M SHUNT MOTOR
Ser/e+ 1/e9)
SERIES
3
S*nt 1/e9) Ser/e+ 1/e9)
COMPOUND MOTOR F/-.%.% C90++/1/c0t/on o1 DC Motor
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
%.& SPEED CONTROL OF DC MOTORS The -1 motors are in general much more adaptable speed dri)es than 31 motors which are associated with a constant speed rotating field! Indeed one of the primary reasons for the strong competiti )e position of -1 motors in modern industrial dri)es is the wide range of specified afforded we know the equation
NE 5 >
Eb / ¿
ϕ?
E5 >0&Ia 2a C ? ϕ *here 0Esupply )oltage >)olts? Ia E armature current >amps? 2aEarmature resistance >ohms? FEflu+ per pole >*eber?
Eb =back emf ( volts )
This equation gi)es two methods of effecti)e speed changes!i!e! a?
The )ariation of field e+citation. if this causes in the flu+ per pole F and is known as the field control!
b?
The )ariation of terminal )oltage >0?!this method is known as armature control!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
%.' SPEED CONTROL OF SHUNT MOTOR %.'.% FLU? CONTROL METHOD It is known that NG'C F by decreasing the flu+. the can be increased and )ice )ersa! ,ence. name flu+ or field control method! The flu+ of -1 motor can be changed by changing shunt field rheostat! Since
I sh
I sh
with help of a
in relati)ely small. shunt field rheostat has to carry only
a small. so that rheostat is small in si6e! This method therefore )ery efficient in non& interpolar machines the speed can be increased by this method in the ratio #H' any further weakening of flu+ F ad)ersely affect the communication 3nd hence puts a limit to the ma+imum speed obtainable with this method in machines fitted with interlopes in ratio of ma+imum to minimum speeds of ;H' is fairly common! The connection diagram for this type of speed control is shown in figure below!
Field
Fig..! Flu" Control
B.V.C Engineering College, d!l!re"u.
V
Speed control of DC motor by u sing PWM technique
%.'.$ ARMATURE OR RHEOSTAT CONTROL METHOD
Controll er Fiel V I
Speed ,N
Ristence in armature
Armature current, Ia
Fig .#
R*eo+t0t Contro9 Met*o) 0n) C*0r0cter/+t/c+
This method is used when speeds below the no load speed are required! 3s the supply )oltage is normally constant. the )oltage across the armature is )aried by inserting a )ariable rheostat or controller resistance in series with the armature circuit as shown in fig! as controller resistance is increased. potential difference across the armature B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique is decreased. thereby decreasing the armature speed! (or a load of constant torque. speed is appro+imately proportional to the potential difference! 3cross the armature current characteristics in fig! in seen that greater the resistance In the armature circuit. greater is the fall in speed =et Ia'
E
Ia# N'. N# E 0
E
3rmature current in the first case E
3rmature current in the second case
corresponding speeds Supply )oltage
Then N'
α
>)&Ia'2a ?G"b'
=et some controller resistance of )alue 2 be added to the armature circuit resistance so that its )alue becomes
>22a? E 2t Then N# G >0&Ia# 2t? G "b# N#CN'E"b#C"b' 1onsidering no load speed. we ha)e NCN$ >I&>Ia 2t?C >0&Ia$ 2a? Neglecting Iao 2a w!r!t!to0. we get NENo >I&>Ia 2t?C 0
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
No
S$eed%
Ia
I
Fig.
It is seen that for a gi)en resistance 2t the speed is a linear function of armature current Ia as shown in fig! The load current for which the speed would be 6ero is found by putting NE$ in abo)e relation $ E N$ >>I&Ia 2t?C0? r Ia E 0C2t This ma+imum current and is known as stalling current! This method is )ery wasteful. e+pensi)e and unsuitable for rapidly changing loads because for a gi)en )alue of 2t. speed will change with load! 3 more stable operation can be obtained by using a di)erter across the armature in addition to armature control resistance! Now. the changes in armature current will not be so effecti)e in changing the potential difference across the armature! The connection diagram for this type of speed control arrangement is shown in fig! B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
Series resisten
Shunt
Motor Diverte
F/-.%.; Ar,0tre Contro9 Met*o)
%.'.& 3OLTAGE CONTROL METHOD A( MULTIPLE CONTROL 3OLTAGE
In this method. the shunt field of the motor is connected permanently to a fi+ed e+citing )oltage but the armature is supplied with different )oltages by connecting it across one at the se)eral different )oltages by means of suitable switchgear! The armature will be appro+imately proportional to these different )oltages! The intermediate speeds can be obtained by adjusting the shunt field regulator!
B( WARD:LEONARD SYSTEM This system is used where an unusually wide >upto '$H'? and )ery sensiti)e speed control is required as for colliery winders . elect ric e+ca)ators and the main dri)es in steel mills and blooming in paper mills! The field of the motor >4'? whose speed control is permanently connected across the -1 supply lines! The other motor 4# is directly connected to Denerator D!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique The output )oltage of D is directly is fed to the main motor 4'! The )oltage of generator can be )aried from 6ero to upto its ma+imum )alue by means of field regulator! By re)ersing the direction of the field current of D by means of the re)ersing switch which 2S. generated )oltage can be re)ersed and hence the direction of rotation of 4'! It should be remembered that motor set always runs in the same direction! 3 modification of the word J=eonard system is known as word J=eonard &linger system which uses a smaller motor generator set with The addition of a flywheel whose function is to reduce fluctuations in the /ower demand from the supply circuit ! The chief ad)antage of system is its o)erall efficiency especially at right loads! It has the outstanding merit of gi)ing wide speed 1ontrol from ma+imum in one direction through 6ero to the ma+imum in the opposite direction and of gi)ing a smooth acceleration!
%.; MOTOR APPLICATIONS -1 motor possesses e+cellent torque speed characteristics and offer a wide range of speed control! Though efforts are being made to obtain wide range speed control with ac motors. yet the )ersatility and fle+ibility of a dc motors can7t be matched by a ac motors! In )iew of this. the demand for dc motors would continue undiminished e)en in figure! 3 brief discussion regarding the dc motor applications is gi)en below!
%.;.% SHUNT MOTORS •
(or a gi)en field current in a shunt motor. the speed drop from no load to full load is in)ariably less than ;@ t o 9@! In )iew of this. the shunt motor is termed a constant speed motor! Therefore for constant speed dri)es in industry. dc shunt motor7s can be employ! But this motor can7t complete with constant speed squirrel cage induction motor. becaus e the latter cheaper. rugged and requires less maintenance!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique •
*hen constant speed ser)ice at low speeds is required. the comparison is usually between synchronous motors and dc shunt motors! It is because the construction of high performance poly phase induction motor with large number of poles is difficult! ,owe)er. for adjustable speed ser)ice at low operating speed. dc shunt
•
motor is a preferred choice *hen the dri)en load requires a wide range of speed control >both below base speed and abo)e base speed?. a dc shunt motor is employed. e!g! !in latches etc!
%.;.$ SERIES MOTORS The outstanding feature of series motor is the automatic decrease in speed as soon as increased load torque is required! The decreasing speed with increase in load torque or )ice )ersa has only a marginal effect on the power taken by the series motor! •
Since a series motor can withstand se)ere starting duties and can furnish high starting torques . it is best suited for dri)ing hoists. trains . e+ca)ators .cranes. etc! wound motor induction motors compete fa)orably with series motor7s .but the choice is go)erned by the economics ! ,owe)er for traction purposes . series motor is the only choice! Therefore series motors are widely used in all types of
•
electric )ehicles. eletrictrains. streetcars. battery powered tools. automoti)e starter motors etc! Series motors can be used to dri)e permanently connected loads. such as fan load.
•
because their torque requirement increases with the square of the speed In order to a)oid the pollution in big cities. now battery dri)en automobiles are being introduced on a large scale!
%.;.& COMPOUND MOTORS 3 compound motor with a strong series field has its characteristics approaching that of a series motor! Therefore such type of compound motors are used for loads requiring hea)y starting torque which are likely to be reduced to 6ero 3 compound motor with weak series field has its characteristics approaching that of a shunt motor! *eak series field causes more drooping speed torque characteristics
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique than with an ordinary shunt motors! Such compound motors with steeper characteristics. are used where load fluctuates between wide limits intermittently!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
$.SWITCHING DE3ICES PWM TECHNIQUES
$. SWITCHING DE3ICES AND PWM TECHNIQUE $.% POWER SEMICONDUCTOR DE3ICES CLASSIFICATION B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
(o)er se&i*ondu*tor
! Ter&inal
(N
# Ter&inal
S*hot,e-
(o)er MOSFE
0FE
Th-rist
I/
/0
F/-.$.%. C90++/1/c0t/on o1 S8/tc*/n- De5/ce+
Today7s power semiconductor de)ices are almost e+clusi)ely based on silicon material and can be classified as followsH -iode Thyristor or silicon&controlled rectifier >S12? Bipolar junction transistor >BKT? /ower 4S("T
$.$ DIODE /ower diodes pro)ide uncontrolled rectification of power and are used in applications such as electroplating. anodi6ing. battery charging. welding. power supplies >dc and ac?. and )ariable frequency dri)es! They are also used in feedback and the freewheeling functions of con)erters and snubbers! Shows the diode symbol and its )olt& ampere characteristics! In the forward biased condition. the diode can be represented by a junction offset drop and a series&equi)alent resistance that gi)es a positi)e slope in the 0& I characteristics! The typical forward conduction drop is '!$ 0! This drop will cause conduction loss. and the de)ice must be cooled by the appropriate heat sink to limit the B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique junction temperature! In the re)erse&biased condition. a small leakage current flows due to minority carriers. which gradually increase with )oltage! If the re)erse )oltage e+ceeds a threshold )alue. called the breakdown )oltage. the de)ice goes through a)alanche breakdown. which is when re)erse current becomes large and the diode is destroyed by heating due to large power dissipation in the junction!
F/-.$.$.S7,6o9 = C*0r0cter/+t/c+ o1 D/o)e
$.& THYRISTORS
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique Thyristors or silicon&controlled rectifiers >S12s? ha)e been the traditional workhorses for bulk power con)ersion and control in industry! The modern era of solid& state power electronics started due to the introduction of this de)ice in the late ':8$s! Basically. it is a trigger into conduction de)ice that can be turned on by positi)e gate current pulse but once the de)ice is on. a negati)e gate pulse cannot turn it off! The de)ice turn on process is )ery fast and turn off process is slow because the minority carriers are to be cleared from the inner junctions by “reco)ery and recombinationL processes 1ommercial thyristors can be classified as phase control and in)erter types! The thyristors ha)e been widely used in dc and ac dri)es. lighting. heating and welding control!
F/-.$.&. D/o)e +7,6o9 0n) 3:I c*0r0cter/+t/c+
$.' BIPOLAR POWER OR 2UNCTION TRANSISTORS B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
!BPTS OR B2TS( 3 bipolar junction transistor >BKT?. unlike a thyristor&like de)ice. is a two& junction. self&controlled de)ice where the collector current is under the control of the base dri)e current! Bipolar junction transistors ha)e recently been ousted by IDBTs >insulated gate bipolar transistors? in the higher end and by power 4S("Ts in the lower end! The dc current gain > hFE? of a power transistor is low and )aries widely with collector current and temperature! The gain is increased to a high )alue in the -arlington connection. as shown in (igure ,owe)er. the disad)antages are higher leakage current. higher conduction drop. and reduced switching frequency! The shunt resistances and diode in the base&emitter circuit help to reduce collector leakage current and establish base bias )oltages! 3 transistor can block )oltage in the forward direction only >asymmetric blocking?! The feedback diode. as shown. is an essential element for chopper and )oltage&fed con)erter applications! -ouble or triple -arlington transistors are a)ailable in module form with matched parallel de)ices for higher power rating! /ower transistors ha)e an important property known as the second breakdown effect! This is in contrast to the a)alanche breakdown effect of a junction. which is also known as first breakdown effect! *hen the collector current is switched on by the base dri)e. it tends to crowd on the base&emitter junction periphery. thus constricting the collector current in a narrow area of the re)erse&biased collector junction! This tends to create a hot spot and the junction fails by thermal runaway. which is known as second breakdown! The rise in junction temperature at the hot spot accentuates the current concentration owing to the negati)e temperature coefficient of the drop. and this regeneration effect causes collapse of the collector )oltage. thus destroying the de)ice!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
F/-.$.'. T8o +t0-e D0r9/n-ton tr0n+/+tor 8/t* 67p0++ )/o)e $.; POWER MOSFETS Mnlike the de)ices discussed so far. a power 4S("T >metal&o+ide semiconductor field effect transistor? is a unipolar. majority carrier. “6ero junctions.L )oltage&controlled de)ice! >a? shows the symbol of an N&type 4S("T and >b? shows its )olt&ere characteristics! If the gate )oltage is positi)e and beyond a threshold )alue. an N&type conducting channel will be induced that will permit current flow by majority carrier >electrons? between the drain and the source! 3lthough the gate impedance is e+tremely high at steady state. the effecti)e gate&source capacitance will demand a pulse current during turn&on and turn&off! The de)ice has asymmetric )oltage&blocking capability. and has an integral body diode. as shown. which can carry full current in the re)erse direction! The diode is characteri6ed by slow reco)ery and is often bypassed by an e+ternal fast&reco)ery diode in high&frequency applications!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
F/-.$.;.Po8er MOSFET S7,6o9
F/-.$.. 3:I c*0r0cter/+t/c+ o1 po8er MOSFET
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
$. PWM TECHNIQUE $..% Intro)ct/on /ulse&width modulation >/*4? or duty&cycle )ariation methods are commonly used in speed control of -1 motors! The duty cycle is defined as the percentage of digital high7 to digital low7 plus digital high7 pulse&width during a /*4 period!
F/-.$.#. ;3 P9+e+ W/t* " T*ro-* ;" Dt7 C7c9e (ig!' shows the 80 pulses with $@ through 8$@ duty cycle! The a)erage -1 0oltage )alue for $@ duty cycle is 6eroO with #8@ duty cycle the a)erage )alue is '!#80 >#8@ of 80?! *ith 8$@ duty cycle the a)erage )alue is #!80. and if the duty cycle is %8@. the a)erage )oltage is !%80 and so on! The ma+imum duty cycle can be '$$@. which is equi)alent to a -1 wa)eform! Thus by )arying the pulse&width. we can )ary the a)erage )oltage across a -1 motor and hence its speed! The a)erage )oltage is gi)en by the following equationH P E -! Yma+ >'& -? Ymin But usually minimum equals 6ero so the a)erage )oltage will beH P E -! Yma+ The circuit of a simple speed controller for a mini -1 motor. such as that used in tape recorders and toys. is shown in (ig
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
F/-.$.@. DC ,otor +pee) contro9 +/n- PWM ,et*o) a?
*rite an assembly program to generate a /*4 with a frequency of ' k,6 and a duty cycle of 8$@. and watch your signal on the oscilloscope! b? Now connect your signal to the motor dri)er! The major reason for using pulse width modulation in -1 motor control is to a)oid the e+cessi)e heat dissipation in linear power amplifiers! The heat dissipation problem often results in large heat sinks and sometimes forced cooling! /*4 amplifiers greatly reduce this problem because of their much higher power con)ersion efficiency! 4oreo)er the input signal to the /*4 dri)er may be directly deri)ed from any digital system without the need for any -C3 con)erters! The /*4 power amplifier is not without disad)antages! The desired signal is not translated to a )oltage amplitude but rather the time duration >or duty cycle? of a pulse! This is ob)iously not a linear operation! But with a few assumptions. which are usually )alid in motor control. the /*4 may be appro+imated as being linear >i!e!. a
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique pure gain?!The linear model of the /*4 amplifier is based on the a)erage )oltage being equal to the integral of the )oltage wa)eform! Thus 0S Q Ton E 0eq Q T *here 0S E the supply )oltage >'# )olts? Ton E /ulse duration 0eq E the a)erage or equi)alent )oltage seen by the motor T E Switching period >'Cf? The recommended switching frequency is $$,6! The switching frequency >'CT?. is determined by the motor and amplifier characteristics! The control )ariable is the duty cycle which is Ton C T! The duty cycle must be recalculated at each sampling time! The )oltage that the motor sees is thus 0eq. which is equal to the duty cycle times the supply )oltage!
$..$ Pr/nc/p9e /ulse width modulation control works by switching the power supplied to the motor on and off )ery rapidly! The -1 )oltage is con)erted to a square wa)e signal. alternating between fully on >nearly '#)? and 6ero. gi)ing the motor a series of power “kicksL! /ulse width modulation technique >/*4? is a technique for speed control which can o)ercome the problem of poor starting performance of a motor! /*4 for motor speed control works in a )ery similar way! Instead of supplying a )arying )oltage to a motor. it is supplied with a fi+ed )oltage )alue >such as '#)? which starts it spinning immediately! The )oltage is then remo)ed and the motor coasts7! By continuing this )oltage onCoff cycle with a )arying duty cycle. the motor speed can be controlled! The wa)e forms in the below figure to e+plain the way in which this method of control operates! In each case the signal has ma+imum and minimum )oltages of '#) and $)!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique •
•
•
In wa)e form. the signal has a mark space ratio of 'H'!with the signal at '#) for 8$@ of the time. the a)erage )oltage is ;). so the motor runs at half its ma+imum speed! In wa)e form. the signal has mark space ratio of H'!which means that the output is at '#) for %8@ of the time! This clearly gi)es an a)erage output )oltage of :). so the motor runs at C A of its ma+imum speed! In wa)e form. the signal has mark space ratio is 'H. gi)ing an output signal that is '#) for just #8@ o the time! The a)erage output )oltage of this signal is just ). so the motor runs at 'CA of its ma+imum speed!
By )arying the mark space ratio of the signal o)er the full range. it is possible to obtain any desired a)erage output )oltage from $) to'#) !The motor will work perfectly well. pro)ided that the frequency of the pulsed signal is set correctly. a suitable frequency being $,6!setting the frequency too low gi)es jerky operation! and setting it too high might increase the motor7s impedance!
'H' 4ark space ratio >8$@ duty cycle?
H' 4ark space ratio >%8@ duty cycle?
'H4ark space ratio >#8@dutycycle?
F/-.$.. P9+e W/)t* Mo)90t/on W05e1or,+
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
$..& METHODS The pwm signals can be generated in a number of ways! there are se)eral methodsH • • • •
analogue method digital method discrete I1 n board micro controller
An09o-e ,et*o)
3 block diagram of an analogue /*4 generator is
Triangle wa)e generator from radio com arator control recei)er
PWM
recei)er signel to demand signel con)erter
Fig.!.1. B9oc D/0-r0, O1 An An09o-e P8, Gener0tor
The simplest way to generate a /*4 signal is the intersecti)e method. which requires only a saw tooth or a triangle wa)e form >easily generated using a simple oscillator? and a comparator! *hen the )alue of the reference signal is more than the modulation wa)e form. the /*4 signal is in the high state. otherwise it is in the low state! D/-/t09 Met*o)
The digital method in)ol)es incrementing a counter. an comparing the counter )alue with a pre&loaded register )alue. or )alue set by an 3-1! Thy normally us a counter that increments periodically and is reset at the end )ery period of the /*4! *hen the B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique counter )alue is more than the reference )alue. the /*4 output changes state from high to low!
PWM -ener0tor c*/p+ There are se)eral Ic7s a)ailable which con)er ts a -1 le)el into a /*4 output! many of these are designed for use in switch mo power supplies !unfortunately. the de)ices designed for switch mode power supplies not to allow the mark&space ratio to alter o)er the entire $ J '$$@ range! many limit the ma+imum to :$@ which is effecti)ely limiting the power you can send to the motors! de)ices designed as pulse generators should allow the whole range to be used!
On6o0r) ,/cro contro99er 3 micro controller on the robot. this may be able to generate the wa)e form. although if you ha)e a more than a couple of motors. this may be too much of load on the micro controllers resources! So if you ha)e chosen to use an on board micro controller. then as part of you selection process. include whether it has /*4 outputs !if it has this can greatly simplify the process of generating signals!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
&. COMPONENTS DESCRIPTION
&. COMPONENTS DESCRIPTION
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
&.% INTRODUCTION The main aim of the dc motor speed control using pwm is after power on the power supply generates 8) dc .'#) dc .the logic section works on 8) dc and the motor and motor dri)en secti ons are working on '#) dc !the e+planation s of the power supply is gi)en in the power supply module! 3fter power on the micro controller generates oscillations at the rate of ''!$8:& '#4h6!frequency sine wa)e i!e! internally con)erted into square wa)e with the help of internal oscillator! The oscillator section is gi)en bellowing the oscillator module The reset logic generates the reset signal are applied at the r+d pin of the micro controller! The e+ploitation of the reset logic is gi)en below! 3fter reset he micro controller starts e+ecuting program on the memory location program area $$$$h!initially the micro controller initiali6es the =1- display connected to the port$. port#!%. port#!;. port#!8! Sub sequentially the mc displays the “set speedL i!e! required Speed to rotate the information must be feeded through switches connected to the port'O the switches are ment for increment decrement. set! 3fter set speed is entered the micro controller dri)es the motor )ia motor dri)er tip'## transistor connected to the port if the port pin is ' the transistor enters in to the saturation region then the motor start rotating at the rate of specified speed the speed is decided by the duty cycle! initially we are rotating at the rate of 8$@ duty cycle i!e! 8$@ on time and 8$@ off time !The rotation of the motor is detected by the an optical encoder that includes u&shaped octo coupler and sensor with holes the octo coupler generates a square wa)e corresponding to the no! of ports located on the disk and motor speed!
&.$ POWER SUPPLY
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
&.$.% De+cr/pt/on The /ower Supply is a /rimary requirement for the project work! The required -1 power supply for the base unit as well as for the recharging unit is deri)ed from the mains line! (or this purpose center tapped secondary of '#0&$'#0 transformer is used! (rom this transformer we getting 80 power supply! In this 80 output is a regulated output and it is designed using %9$8 positi)e )oltage regulator! This is a /in )oltage regulator. can deli)er current up to 9$$ milliamps! 2ectification is a process of rendering an alternating current or )oltage into a unidirectional one! The component used for rectification is called 2ectifier7! 3 rectifier permits current to flow only during positi)e half cycles of the applied 31 )oltage! Thus. pulsating -1 is obtained to obtain smooth -1 power additional filter circuits required!
&.$.$ CIRCUIT DIAGRAM %1#v 1N(00) *
#&0v " 1#v' 0 '1#v
##00!"# 100!"#$
FI.#..
/lo*, Diagra& O2 (o)er Su$$l-
3 diode can be used as rectifier! There are )arious types of diodes! ,owe)er. semiconductor diodes are )ery popularly used as rectifiers! 3 semiconductor diode is a
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique solid&state de)ice consisting of two elements is being an electron emitter or cathode. the other an electron collector or anode! Since electrons in a semiconductor diode can flow in one direction only&form emitter to collector&the diode pro)ides the unilateral conduction necessary for rectification! The rectified utput is filtered for smoothening the -1. for this purpose capacitor is used in the filter circui t! The filte r capacitors are usually connected in parallel with the rectifier output and the load! The 31 can pass through a capacitor but -1 cannot. the ripples are thus limited and the output becomes smoot hed! *hen the )oltage across the capacitor plates tends to rise. it stores up energy back into )oltage and current! Thus. the fluctuation in the output )oltage is reduced considerable!
&.& 3OLTAGE REGULATORH The =4 %9<<< series of the three terminal regulations is a)ailable with se)eral fi+ed output )oltages making them useful in a wide range of applications! ne of these is local on card regulation! The )oltages a)ailable allow these regulators to be used in logic systems. instrumentation and other solid state electronic equipment! 3lthough designed primarily as fi+ed )oltage regulators. these de)ices can be used with e+ternal components to obtain adjustable )oltages and currents! The =4%9<< series is a)ailable in aluminum to packages which will allow o)er '!83 load current if adequate heat sinking is pro)ided! 1urrent limiting is included to limit the peak output current to a safe )alue! The =4 %9<< is a)ai lable in the metal leads to 8 and the plastic to :#! (or this type. with adequate heat sinki ng!
The regulator can deli) er '$$m3 o utput current! +he
advantae o- this t.pe o- reulator is, it is eas. to use and minimi/e the numer o- eternal components2 The following are the features )oltage regulatorsH a? utput current in e+cess of '!83 for %9 and %9= series b? Internal thermal o)erload protection
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique c? No e+ternal components required d? utput transistor sage area protection e? Internal short circuit current limit!
&.' POSITI3E 3OLTAGE REGULATOR The positi)e )oltage regulator has different features like
utput current up to '!83
No e+ternal components
Internal thermal o)erload protection
,igh power dissipation capability
Internal short&circuit current limiting
utput transistor safe area compensation
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
-irect replacements for (airchild micro3%9$$ series
Nominal utput
2egulator
0oltage
'
80
u3%9$81
;0
u3%9$;1
90
u3%9$91
9!80
u3%9981
'$0
u3%9'$1
#0
u3%9'#1
'80
u3%9'81
'
90
u3%9'91
#
A0
u3%9#A1
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
&.; SWITCHES The three switches are connected to p'!'.p'!#.p'!. of micro controller when switch is open the port maintains logic high *hen the switch is depressed maintains high the logic $!these switches are pulled to 0cc )ia '$k resistor the type of switch press to on ! In electronics. a switch is an electrical component that can break an electrical circuit. interrupting the current or di)erting it from one conductor to another! The most familiar form of switch is a manually operated electro mechanical de)ice with one or more sets of electrical contacts! "ach set of contacts can be in one of two statesH either RclosedR meaning the contacts are touching and electricity can flow between them. or RopenR. meaning the contacts are separated and no conducting! Since the ad)ent of digital logic in the ':8$s. the term has spread to a )ariety of digital acti)e de)ices such as transistors and logic gates whose function is to change their output state between two logic le)els or connect different signal lines. and e)en computers. network switches. whose function is to pro)ide connections between different port sin a computer network The term RswitchedR is also applied tell communication networks. and signifies a network that is pro)iding dedicated circuits for communication between end nodes. such as the network! The common feature of all these usages is they refer to de)ices that control a binary stateH they are either on or off. closed or open. connected or not connected!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
(ig!!#!! switches *hen the wattage being switched is sufficiently large. the electron flow across opening switch contacts is sufficient to ioni6e the air molecules across the tiny gap between the contacts as the switch is opened. forming a also known as an electric arc! The plasma is of low resistance and is able to sustain power flow. e)en with the separation distance between the switch contacts steadily increasing! The plasma is also )ery hot and is capable of eroding the metal surfaces of the switch contacts! *here the )oltage is sufficiently high. an arc can also form as the switch is closed and the contacts approach! If the )oltage potential is sufficient to e+ceed the of the air separating the contacts. an arc forms which is sustained until the switch closes completely and the switch surfaces make contact! In either case. the standard method for minimi6ing arc formation!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique /re)enting contact damage is to use a fast&mo)ing switch mechanism. typically using a spring&operated tipping&point mechanism to assure quick motion of switch contacts. regardless of the speed at which the switch control is operated by the user! 4o)ement of the switch control le)er applies tension to a spring until a tipping point is reached. and the contacts suddenly snap open or closed as the spring tension is released! 3s the wattage being switched increases. other methods are used to minimi6e or pre)ent arc formation! /lasma is hot and will rise due air currents! The arc can be quenched with a series of nonconducti)e blades spanning the distance between switch contacts. and as the arc raises its length increases as it forms ridges rising into the spaces between the blades. until the arc is too long to stay sustained and is e+tinguished! "+tremely large switches enclose the switch contacts in something other than air to increase the resistance against arc formation. such switch contacts in a )acuum. or immersion of the switch contacts in mineral oil!
&. MOTOR AND MOTOR DRI3ER The purpose of a motor speed controller is to take a signal representing the demanded speed. and to dri)e a motor at that speed! The controller may or may not actually measure the speed of the motor! If it does. it is called a (eedback Speed 1ontroller or 1losed =oop Speed 1ontroller. if not it is called an pen =oop Speed 1ontroller! (eedback speed control is better. but more complicated. and may not be required for a simple robot design! 4otors come in a )ariety of forms. and the speed controllerRs motor dri)e output will be different dependent on these forms! The speed controller presented here is designed to dri)e a simple cheap starter motor from a car. which can be purchased from any scrap yard! These motors are generally series wound. which means to re)erse themO they must be altered slightly. >see the section on motors?!
Below is a simple block diagram of the speed controller! *eRll go through the important parts block by block in detail!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
F/-.&.&. B9oc D/0-r0, O1 Spee) Contro99er The speed of a -1 motor is directly proportional to the supply )oltage. so if we reduce the supply )oltage from '# 0olts to ; 0olts. the motor will run at half the speed! ,ow can this be achie)ed when the battery is fi+ed at '# 0olts The speed controller works by )arying the a)erage )oltage sent to the motor! It could do this by simply adjusting the )oltage sent to the motor. but this is quite inefficient to do! 3 better way is to switch the motorRs supply on and off )ery quickly! If the switching is fast enough. the motor doesnRt notice it. it only notices the a)erage effect! *hen you watch a film in the cinema. or the tele)ision. what you are actually seeing is a series of fi+ed pictures. which change rapidly enough that your eyes just see the a)erage effect & mo)ement! Your brain fills in the gaps to gi)e an a)erage effect! Now imagine a light bulb with a switch! *hen you close the switch. the bulb goes on and is at full brightness. say '$$ *atts! *hen you open the switch it goes off >$ *atts?! Now if you close the switch for a fraction of a second. and then open it for the same amount of time. the filament wonRt ha)e time to cool down and heat up. and you will just get an a)erage glow of 8$ *atts! This is how lamp dimmers work. and the same principle is used by speed controllers to dri)e a motor! *hen the switch is closed. the motor sees '# B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique 0olts. and when it is open it sees $ 0olts! If the switch is open for the same amount of time as it is closed. the motor will see an a)erage of ; 0olts. and will run more slowly accordingly! 3s the amount of time that the )oltage is on increases compared with the amount of time that it is off. the a)erage speed of the motor increases! This on-off switching is performed by power 4S("T! 3 4S("T >4etal&+ide&Semiconductor (ield "ffect Transistor? is a de)ice that can turn )ery large currents on and off under the control of a low signal le)el )oltage ! (or more detailed information. see the dedicated chapte r on 4S("T? The time that it takes a motor to speed up and slow down under switching conditions is dependent on the inertia of the rotor >basicall y how hea)y it is?. and how much friction and load torque there is! The graph below shows the speed of a motor that is being turned on and off fairly slowlyH
F/-.&.'.Gr0p* Bet8een Spee) An) Spp97 3o9t0-e You can see that the a)erage speed is around '8$. although it )aries quite a bit! If the supply )oltage is switched fast enough. it won7t ha)e time to change speed much. and the speed will be quite steady! This is the principle of switch mode speed control! Thus the speed is set by /*4!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
&.# Opt/c09 enco)er ptical encoder is a electro mechanical de)ice which pro)ides the most efficient method of digiti6ing the )ariable properties of a rotating shaft! The optical encoderRs disc is made of glass with transparent and opaque areas! 3 light source and photo detector array reads the optical pattern that results from the discRs position at any one time !This code can be read by a controlling de)ice. such as a microprocessor. to determine the angle of the shaft !The absolute analog type produces a unique dual analog code that can be translated into an absolute angle of the shaft >by using a special algorithm?! The controllerRs two channels can be operated independently or combined to set the direction and rotation of a )ehicle by coordinating the motors on each side >tank&like steering?! The motors may be operated in open or closed loop speed mode! The 3<#9;$ includes inputs for two uadrate! "ncoders up to#8$k,6 and four limit switches. for precise speed and tra)eled distance measurement !The 3<#9;$ features intelligent current sensing and controlling that will automatically limit each channelRs power output to '#$3! (or higher power application. the product may be ordered in a Single 1hannel configuration. capable of dri)ing single load up to #A$3 at ;$0! The controller supports a long list of features. including analog and digital ICs for accessories and sensors. thermal protection. programmable acceleration. short&circuit protection. input command watchdog and non&)olatile storage of configuration parameters! The 3<#9;$ can be reprogrammed in the field with the latest features by downloading new operating software from 2oboticR s web site !The 3<#9;$ is built into a compact :!$U= + 8!8U* + '!;U, >##9mm + 'A$mm +A$mm?. robust e+truded aluminum case. which also ser)es as a heat sink for it output power stage! The large fin area ensures sufficient heat dissipation for operation without a fan in most applications! The 3<#9;$ is a)ailable now to customers worldwide at V%#$ in single quantities. complete with cable and /1&based configuration software! /roduct Information. application e+amples and software can be downloaded from the companyRs web site at www!roboteq!com!
&.@ @C;$ MICROCONTROLLER B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
&.@.% INRODUCTION 4icro controller is a true computer on a chip! 4icroprocessors are intended to be general&purpose digital computers whereas micro controllers are intended to be special purpose digital controllers! Denerally microprocessors contain a 1/M. memory& addressing units and interrupt handling circuits! 4icro controllers ha)e these features as well as timers. parallel and serial IC and internal 234 and 24! =ike the microprocessor. a microcontroller is a general&purpose de)ice. but one that is meant to read data. and control its en)ironmental based on those calculations! The contrast between a micro controller and a microprocessor is best e+emplified by the fact that microprocessors ha)e many operational codes for mo)ing data from e+ternal memory to 1/MO microcontrollers may ha)e one or two! 4icroprocessors may ha)e one or two types of bit&handling instructionsO micro controllers will ha)e many! The microprocessor is concerned with the rapid mo)ement of code and data from e+ternal addresses to the chipO the microcontroller is concerned with rapid mo)ements of bits within the chip! The microcontroller can function as a computer with the addition of no e+ternal digital partsO the microprocessor must ha)e many additional parts to be operational! Denerally A&bit microcontrollers are intended for use in large )olumes as true '&chipcomputers! Typical applications consist of appliances and toys! "ight bit micro controllers represent a transition 6one between the dedicated. high )olume. A&bit micro controllers and the high performance. '; and #&bit units! "ight bit micro controllers are )ery useful word si6e for small computing tasks! ';&bit controllers ha)e also been designed to take the ad)antage of high le)el programming languages in the e+pectation that )ery little assembly language programming will be done when employing these controllers in sophisticated applications! # bit controllers are also used in high speed control and signal processing applications!
&.@.$ DESCRIPTION B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique The 3T9:18# is a low&power. high&performance 14S 9&bit microcomputer with 95 bytes of (lash programmable and erasable read only memory >/"24?! The de)ice is manufactured using 3tmel7s high&density non)olatile memory technology and is compatible with the industry&standard 41S&8' instruction set and pin out! The on&chip (lash allows the program memory to be reprogrammed in&system or by a con)entional non)olatile memory programmer! By combining a )ersatile 9&bit 1/M with (lash on a monolithic chip. the 3tmel 3T9:18# is a powerful microcomputer which pro)ides a highly&fle+ible and cost&effecti)e solution to many embedded control applications
&.@.& ON:CHIP MEMORY This refers to any memories >1ode. 234 or other? that physically e+ist on the 4icrocontroller itself! n& 1hip memory can be of se)eral types! The 9$8' has a bank of '#9 bytes if Internal 234! This internal 234 a)ailable and it is also the most fle+ible in terms of reading. writing. and modifying its contents! Internal 234 is )olatile. so when the 9$8' is rest this memory is cleared! The first 9 bytes >$$h&$%h? are “register bank $L! By manipulating certain S(2s. a program may choose to use register banks '. # or ! These alternati)e register banks are located in internal 234 in addresses $9h through '(h! Bit memory also li)es and is part of internal 234! The 9$bytes remaining of Internal 234. from addresses $h through %(h.may be used by user )ariables that need to be accessed frequently or at a high speed! This area is also utili6ed by the microcontroller as a storage area for the operating stack! This fact se)erely limits the 9$8'7s stack since. as illustrated in the memory map. the area reser)ed for the stack is only 9$ bytes and usually it is less since these 9$ bytes has to be shared between stack and user!
&.@.' E?TERNAL CODE MEMORY
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique This is code >or program? memory that resides off&chip! This is often in the form of an e+ternal >"/24?! 1ode 4emory is the memory that holds the actual 9$8' program that is to be run! This memory is limited to ;A5 and comes in many shapes and si6es! 1ode 4emory may be found on&chip. either burned in to the microcontroller as 24 or "/24! 1ode may also be stored completely off& chip in an e+ternal 24 or. more commonly. an e+ternal "/24! (lash 234 is also another popular method of storing program! 0arious combinations of these memory types may also be used&that is to say. it is possible to ha)e A5 of code memory on&chip and ;A5 of code memory off&chip in an "/24! *hen the program is stored in&chip the ;A5 ma+imum is often reduced to A5. 95 or ';5!This )aries depending on the )ersion of the chip that is being used! "ach )ersion offers how much 24C"/24 spacer the chip has! ,owe)er. code memory is most commonly implemented as off&chip "/24! This is especially true in low&cost de)elopment systems!
&.@.; E?TERNAL RAM This 234 memory resides off&chip! This is often in the form of standard static 234 or flash 234!3s an ob)ious of Internal 234. the 9$8' also supports what is called "+ternal 234!3s the name suggests. "+ter nal 234 is any random access memory which is found off&chip! Since the memory is off&chip it is not as fle+ible in terms of accessing. and is also slower! (or e+ample. to increment an Internal 234 location by ' requires only ' instruction and ' instruction cycle! To increment a '&byte )alue stored in "+ternal 234 requires A instructions and % instruction cycles! In this case. e+ternal memory is % times slower! *hat e+ternal 234 loses in speed and fle+ibility it gains in quantity *hile internal 234 is limited to '#9 bytes >#8; bytes with an 9$8#?. the 9$8' supports "+ternal 234 up to ;A5!
&.@.# FEATURES
1ompatible with 41S&8' /roducts! 95 Bytes of'.$$$ In&System 2eprogrammable "nduranceH *riteC"rase 1ycles! (lash 4emory! (ully Static perationH $ ,6 to #A 4,6 Three&le)el /rogram 4emory =ock!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
#8; + 9&Bit Internal 234! # /rogrammable IC =ines! Three ';&bit TimerC1ounters! "ight Interrupt Sources! /rogrammable Serial 1hannel! =ow /ower Idle and /ower -own 4odes
&.@.@ PIN DIAGRAM AND ITS DESCRIPTION The microcontroller generic part number actually includes a whole family of microcontrollers that ha)e numbers ranging from 9$'to 9%8' and are a)ailable in N& 1hannel 4etal +ide Silicon >N4S? and 1omplementary 4etal +ide Silicon >14S? construction in a )ariety of package types! with A5bytes of (lash /rogrammable and "rasable 2ead nly 4emory >/"24?! The de)ice is manufactured using 3tmel7s high density non)olatile memory technology and is compatible with the industry standard 41S&8' instruction set and pin out! The on&chip (lash allows the program memory to be reprogrammed in&system or by a con)entional non)olati le memory programmer! By combining a )ersatile 9&bit 1/M with (lash on a monolithic chip. the 3tmel 3T9:18# is a powerful microcomputer which pro)ides a highly fle+ible and cost effecti)e solution to many embedded control applications!
PIN DIAGRAM
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
F/-.&.;. P/n D/0-r0, The 3T9:18# pro)ides the following standard featuresH A 5bytes of (lash. #8; bytes of 234. # IC lines. two ';&bit timerCcounters. fi)e )ector two&le)el interrupt architecture. a full duple+ serial port. and on&chip oscillator and clock circuitry! In addition. the 3T9:18# is designed with static logic for operation down to 6ero frequency and supports two software selectable power sa)ing modes! The Idle 4ode stops the 1/M while allowing the 234. timerCcounters. serial port and interrupt system to continue functioning! The /ower down 4ode sa)es the 234 contents but free6es the oscillator disabling all other chip functions until the ne+t hardware reset!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
&.@.@ ARCHITECTURE OF @C;$
F/-.&..Arc*/tectre o1 @C;$
Port "
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique /ort $ is an 9&bit open drain bidirectional IC port! 3s an output port each pin can sink eight TT= inputs! *hen 's are written to port $ pins. the pins can be used as high& impedance inputs! /ort $ may also be configured to be the multiple+ed low order addressCdata bus during accesses to e+ternal program and data memory! In this mode /$ has internal pull&ups! /ort $ also recei)es the code bytes during (lash programming. and outputs the code bytes during program )erification! "+ternal pull&ups are required during program )erification!
Port % /ort ' is an 9&bit bi&directional IC port with internal pull&ups! The /ort ' output buffers can sinkCsource four TT= inputs! *hen 's are written to /ort ' pins they are pulled high by the internal pull&ups and can be used as inputs! 3s inputs. /ort ' pins that are e+ternally being pulled low will source current >II=? because of the internal pull&ups! /ort ' also recei)es the low&order address bytes during (lash programming and program )erification! 3lternate functions of port '
Port $ B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique /ort # is an 9&bit bidirectional IC port with internal pull ups! The /ort # output buffers can sinkCsource four TT= inputs! *hen 's are written to /ort # pins they are pulled high by the internal pull&ups and can be used as inputs! 3s inputs. /ort # pins that are e+ternally being pulled low will source current >II=? because of the internal pull ups! /ort # emits the high&order address byte during fetches from e+ternal program memory and during accesses to e+ternal data memory that use ';&bit addresses >40< 3.W-/T2?! In this application it uses strong internal pull&up s when emitting 's! -uring accesses to e+ternal data memory that uses 9&bit addresses >40< 3. W2I?. /ort # emits the contents of the /# Special (unction 2egister! /ort # also recei)es the high&order address bits and some control signals during (lash programming and )erification!
Port & /ort is an 9&bit bidirectional IC port with internal pull ups! The /ort output buffers can sinkCsource four TT= inputs! *hen 's are written to /ort pins they are pulled high by the internal pull ups and can be used as inputs! 3s inputs. /ort pins that are e+ternally being pulled low will source current >II=? because of the pull ups! /ort also ser)es the functions of )arious special features of the 3T9:18# as listed belowH
3lternate functions of port B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
&.@. RSTH 2ST means 2"S"TO 9:18# uses an acti)e high reset pin! It must go high for two machine cycles! The simple 21 circuit used here will supply )oltage >0cc? to reset pin until capacitance begins to charge! 3t a threshold of about #!80. reset input reaches a low le)el and system begin to run!
(ig!!%!2eset 1onnection
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
ALEPROG 3ddress =atch "nable output pulse for latching the low byte of the address during accesses to e+ternal memory! This pin is also the program pulse input >/2D? during (lash programming! In normal operation 3=" is emitted at a constant rate of 'C; the oscillator frequency. and may be used for e+ternal timing or clocking purposes! Note. howe)er. that one 3=" pulse is skipped during each access to e+ternal -ata 4emory! If desired. 3=" operation can be disabled by setting bit $ of S(2 location 9",! *ith the bit set. 3=" is acti)e only during a 40< or 401 instruction! therwise. the pin is weakly pulled high! Setting the 3="&disable bit has no effect if the microcontroller is in e+ternal e+ecution mode!
PSEN /rogram Store "nable is the read strobe to e+ternal program memory! *hen the 3T9:18# is e+ecuting code from e+ternal program memory. /S"N is acti)ated twice each machine cycle. e+cept that two /S"N acti)ations are skipped during each access to e+ternal data memory!
EA3PP "+ternal 3ccess "nable! "3 must be strapped to DN- in order to enable the de)ice to fetch code from e+ternal program memory locations starting at , up to ((((,! Note. howe)er. that if lock bit ' is programmed. "3 will be internally latched on reset! "3 should be strapped to 0cc for internal program e+ecutions! This pin also recei)es the '#&)olt programming enable )oltage >0pp? during (lash programming. for parts that require '#&)olt 0pp!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique T#H "+ternal count input to TimerC1ounter #. 1lock out! T#"
&. THE ON:CHIP OSCILLATORS /ins
#d! '#d Z#8;d&T,'[?!The oscillator is chosen to help generate both standard and nonstandard baud rates! If standard baud rates are desired. an ''!$8:#4, crystal should be selected! (rom our desired standard rate. T,' can be calculated! The internally implemented )alue of capacitance is pf!
F/[email protected]:C*/p O+c/990tor+ &..% Pro-r0, Me,or7 Loc B/t+ B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique n the chip there are three lock bits which can be left unprogram med >M? or can be programmed >/? to obtain the additional features !*hen lock bit ' is programmed. the logic le)el at the "3 pin is sampled and latched during reset! If the de)ice is powered up without a reset. the latch initiali6es to a random )alue. and holds that )alue until reset is acti)ated! It is necessary that the latched )alue of "3 be in agreement with the current logic le)el at that pin in order for the de)ice to function properly!
&..$ Pro-r0, Conter 0n) D0t0 Po/nter The 9:18# contains two ';&bit registersH the program counters >/1? and the data pointer >-/T2?. "ach is used to hold the address of a byte in memory! The /1 is the only register that does not ha)e an internal address! The -/T2 is under the control of program instructions and can be specified by its ';&bit name. -/T2. or by each indi)idual byte name. -/, and -/=! -/T2 does not ha)e a single internal addressO -/, and -/= are each assigned an address!
A = B Re-/+ter+ The 9:18# contains A general&purpose. working. registers! Two of these. registers 3 and B. hold results of many instructions. particularly math and logical operations. of the 9:18# 1/M! The other # are arranged as part of internal 234 in four banks. B$&B. of eight registers! The 3 register is also used for all data transfers between the 9:18# and any e+ternal memory! The B register is used for with the 3 register for multiplication and di)ision operations!
&..& F90-+ 0n) t*e Pro-r0, St0t+ Wor) !PSW( (lags may be con)eniently addressed. they are grouped inside the program status word >/S*? and the power control >/1N? registers!
The 9:18# has four math flags that respond automatically to the outcomes of math operations and three general&purpose user flags that can be set to ' or cleared to $ by the programmer as desired! The math flags include 1arry >1?. 3u+iliary 1arry >31?. B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique )erflow >0?. and /arity >/?! Mser flags are named ($. D($ and D('O they are general& purpose flags that may be used by the programmer
&.%" LIQUID CRYSTAL DISPLAY In ':;9. 213 =aboratories de)eloped the first liquid crystal display >=1-?! Since then. =1-7s ha)e been implemented on almost all types of digital de)ices. from watches to computer to projection T0s !=1-7s operate as a light “)al)eL. blocking light or allowing it to pass through! 3n image in an =1- is formed by applying an electric field to alter the chemical properties of each =11 >=iquid 1rystal 1ell? in the display in order to change a pi+el7s light absorption properties! These =117s modify the image produced by the backlight into the screen output requested by the controller! Through the end output may be in color. the =117s are monochrome. and the color is added later through a filtering process! 4odern laptop computer displays can produce ;8.8; simultaneous colors at resolution of 9$$ < ;$$! To understand the operation of an =1-. it is easiest to trace the path of a light ray from the backlight to the user! The light source is usually located directly behind the =1-. and can use either ="- or con)entional fluorescent technology! (rom this source. the light ray will pass through a light polari6er to uniformly polari6e the light so it can be acted upon by the liquid crystal >=1? matri+! The light beam will then pass through the =1 matri+. which will determine whether this pi+el should be “onL or “offL! If the pi+el is “onL. the liquid crystal cell is electrically acti)ated. and the molecules in the liquid will align in a single direction! This will allow the light to pass through unchanged! If the pi+el is “offL. the electric field is remo)ed from the liquid. and the molecules with in scatter! This dramatically reduces the light that will pass through the display at that pi+el! In a color display. after the light passes through the liquid crystal matri+. it passes through a color filter >usually glass?! This filter blocks all wa)elengths of light e+cept those within the range of that pi+el! In a typical 2DB display. the color filter is integrated into the upper glass colored microscopically to render each indi)idual pi+el red. green or blue! The areas in between the colored pi+el filter areas are printed black to increase
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique contrast! 3fter a beam of light passes through the color fil ter. it passes through yet another polari6er to sharpen the image and eliminate glare! The image is then a)ailable for )iewing!
&.%".% INTERFACING LCD TO THE MICROCONTROLLERH This is the first interfacing e+ample for the parallel port! *e will star with something simple! This e+ample does not use the Bi&directional feature found on newer ports. thus it should work with most. if no all /arallel /orts! It howe)er does not show the use of the status port as an input! So what are we interfacing 3 '; 1haracter < # =ine =1- 4odule to the /arallel /ort! These =1- 4odules are )ery common these days. and are quite simple to work with. as all the logic required running them is on board!
&.%".$ Fe0tre+
Interface with either A&bit or 9&bit microprocessor!
-isplay data 234
9$
1haracter generator 24
';$ different 8
1haracter generator 234
9 different user programmed 8
-isplay data 234 and character generator 234 may be
\9 bits >9$ characters?!
\% dot&matri+ character patterns!
\% dot&matri+ patterns!
3ccessed by the microprocessor! Numerous instructions
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
1lear -isplay. 1ursor ,ome. -isplay NC((. 1urser
NC((. Blink 1haracter. 1ursor Shift. -isplay Shift!
Built&in reset circuit is triggered at power N!
(ig!!:! =1-
&.%".& P/n )/0-r0,
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
(ig!!'$! /in -iagram f =cd In the abo)e table 0cc and 0ss are supply pins and 0"" >/in no!? is used for controlling =1- contrast! /in No!A is 2s pin for selecting the register. there are two )ery important registers are there inside the =1-! The 2S pin is used for their selection as follows! If 2SE$. the instruction command code register is selected. allowing the user to send data to be displayed on the =1-! 2C* is a read or writes /in. which allows the user to write information to the =1- or read information from it! 2C*E' when reading 2C*E$ when writing! The =1- to latch information presented to its data pins uses the enable >"? pin! The 9&bit data pins. -$&-%. are used to send information to the =1- or read the contents of the =1-7s internal registers! To display letters and numbers. we must send 3S1II codes for the letters 3&. and number $ &: to these pins while making 2SE'!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
'.BLOC DIAGRAM CIRCUIT DIAGRAM B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
'. BLOC DIAGRAM AND CIRCUIT DIAGRAM '.% BLOC DIAGRAM
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
F/-.'.%.B9oc D/0-r0, O1 D.C Motor Spee) Contro9 U+/n- P8,
A!# CIRCUIT DIAGRAM
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique +12'
#1 4007 CN1 Power 1 2 3 4
VC C
VCC
U1 L7805 #2 4007
1 C1
V IN
VOUT
1000!25
RN2=103 R3
+
2 3
4 5
VCC C4 104p%
6
J 2
1)
1
U6 1 U op,o 2
SW1
SW3 +12V
# 22 Q 16 BC547
2 3
4 5 678$
U3 6 5 4
1 2 3 4 5 6 7 8 $
SW2
VCC
R&SISTOR VR
3 0 1 = 1 N R
1
+12V
R1 8(2)
2 C2 100!16
+
C3 10!16'
40 VC C 31 &!VPP
P1(0!T 2 P1(1!T 2/&P1(2 P1(3 P1(4 P1(5 P1(6 P1(7
3$ 38 37 36 35 34 33 32
P0(0!#0 P0(1!#1 P0(2!#2 P0(3!#3 P0(4!#4 P0(5!#5 P0(6!#6 P0(7!#7
RST
10 11 12 13 14 15 16 17
P3(0!R-# P3(1!T -# L&!PRO. P3(2!INT0 PS&N P3(3!INT1 P3(4!T 0 P2(7!15 P3(5!T 1 P2(6!14 P3(6! W R P2(5!13 P3(7!R# P2(4!12 P2(3!11 1$ P2(2!10 1 8 -TL1 P2(1!$ 2 0 -TL2 .N# P2(0!8
30 2$
1 2 3 4 5 6 7 8 $ 10 11 12 13 14 15 16
28 27 26 25 24 23 22 21
T8$C52
#IO#&
11(05$2 *1 C5 33p
C6 33p
F/-.'.$.C/rc/t D/0-r0, O1 D.C Motor Spee) Contro9 U+/n- P8,
'.& E?PLANATION /ulse&width modulation >/*4? or duty&cycle )ariation methods are commonly used in speed control of -1 motors! The duty cycle is defined as the percentage of digital high7 to digital low7 plus digital high 7pulse&width during a /*4 period !(ig ! ' shows the 80 pulses with $@through 8$@ duty cycle !The a)erage -1 )oltage )alue for$@ duty cycle is 6eroO with #8@ duty cycle the a)erage )alue is '!#80 >#8@of 80?! *ith B.V.C Engineering College, d!l!re"u.
16!2LC#
Speed control of DC motor by u sing PWM technique 8$@ duty cycle the a)erage )alue is #!80. and if the duty cycle is %8@. the a)erage )oltage is !%80and so on! The ma+imum duty cycle can be '$$@. which is equi)alent to a -1 wa)eform! Thus by )arying the pulse&width. we can )ary the a)erage )oltage across a -1 motor and hence its speed !The circuit of a simple speed controller for a mini -1 motor. such as that used in tape recorders and toys. is shown in (ig! #!,ere N' in)erting Schmitt trigger is configured as an a stable but )ariable duty cycle ! 3lthough the total in&circuit resistance of 02' during a complete cycle is'$$ kilo&ohms. the part used during positi)e and negati)e periods of each cycle can be )aried by changing the position of its wiper contactor obtain )ariable pulse&width! Schmitt gate N# simply acts as a bufferCdri)er to dri)e transistor T' during positi)e in recursion sat its base! Thus the a)erage amplitude of -1 dri)e pulses or the speed of motor 4 is proportional to the setting of the wiper position of 02'portmeter! 1apacitor 1# ser)es as a (ig! 'H 80 pulses with $@ through8$@ duty cycle storage capacitor to pro)ide stable )oltage to the circuit! Thus. by )arying02' the duty cycle can be changed from $@ to'$$@ and the speed of the motor from stopped7 condition to full speed in an e)en and continuous way! The diodes effecti)ely pro)ide different timing resistor )alues during charging and discharging of timing capacitor 1'!The pulse or rest period is appro+imately gi)en by the following equationH /ulse or 2est period ] $!A + 1'>(arad? + 02' >ohm? seconds !
,ere. use the in&circuit )alue of 02' during pulse or rest period as applicable !The frequency will remain constant is gi)en by the equationH (requency ] #!A;;C >02'!1'? ] #8$,6 >for 02'E'$$ kilo&ohms and 1'E$!'^(?The recommended )alue of in&circuit resistance should be greater than8$ kilo&ohms but less than # mega ohms .while the capacitor )alue should be greater than '$$ /f!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
;. CIRCUIT O3ER3IEW
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
;.RESULT CONCLUSION
;. RESULT AND CONCLUSION ;.% RESULTS *hene)er the supply is on then the motor is rotating .on that time the optical encoder senses the motor speed and the user sets the set speed and then the motor counts the speed according to that speed !on that time the any disturbance occur to the optical B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique encoder the counter does not count any speed! ,ere the three switches arte there is for sets the speed and another two is increment and decrement purpose!
;.$ CONCLUSION The dc motor speed is controlled by using power electronic con)erter circuit! The /*4 technique is used to control the speed of dc motor the speed sensor is used to detect the speed and closed loop control systems is used for pulse circuit! The speed pulse train will be based on required input speed! this circuit is useful to operate the dc motors at required speed!The circuit response time is too low! ,ence high reliability can be achie)ed! The designed circuit was tested for )arious speed inputs satisfactorily!
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
ANNE?URE
M/crocontro99er pro-r0,
ORG " L2MP START ORG "";" B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
THIS IS SPEED CONTROL PROGRAM DT$":"&:$""# LCD P3PSIT P$.; ENABLE p$. READWRITE P$.# REG INS" DATA% P%.' MOTOR P%.; MOTOR ;"H DISP LOCATION ADD ;%H SPEED ON TIME ;$H SPEED OFF TIME ;&H SPEED SET 3AL ;'H SPEED READ 3AL START CLR P%.' CLR P%. Y?J
MO3 ;H4K""H
2B P%.%4U?D LCALL DEL% 2B P%.%4Y?J
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
MO3 ;H4K"%H U?D LCALL LCDINI ??%
LCALL SEC
MO3 DPTR4 K"&C"H LCALL TLINE MO3 DPTR4 K"&D"H LCALL BLINE LCALL SSEC MO3 DPTR4 K"&E"H LCALL TLINE MO3 DPTR4 K"&F"H LCALL BLINE LCALL SSEC
MO3 ;"H4K@BH MO3 ;%H4K#FH MO3 ;$H4K@"H MO3 ;;H4K""H B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
MO3 ;&H4K#FH LCALL SDI LCALL SEC MMRR MO3 R"4K""H Y% LCALL DEL% 2B P%.%4Y% LCALL INCR MO3 ;"H4K@BH CLR A MO3 A4;&H MO3 ;;H4A LCALL SDIS LCALL SEC U% 2B P%.$4U LCALL DEL% 2B P%.$4U% B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
LCALL DECR MO3 ;"H4K@BH CLR A MO3 A4;&H MO3 ;;H4A LCALL SDIS LCALL SEC U$ 2B P%.&4Y% LCALL DEL% 2B P%.&4U$ TY% 2B P%.&4TY% LCALL DEL%
DB K&$H DB K&;H DB K&'H B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
:::::::::::::::::: DB K&$H DB K&;H DB K&;H
B.V.C Engineering College, d!l!re"u.
Speed control of DC motor by u sing PWM technique
2"("2"N1"SH '!Dopal 5 -ubey “(undamentals of "lectric -ri)esL Narosa /ublishing ,ouse New -elhi. ':9:! #!4uhammad ,! 2ashid. /ower "lectronics 1ircuits. -e)ices. and 3pplications.L /rentice ,all. rd edition. #$$! ! 5umara 45S1. -ayananda /2-. Dunatillaka 4-/2. Kayawickrama SS. “/1 based speed controlling of a dc motorL. 3 fmal year report Mni)ersity of 4oratuwa Illiniaus MS3. #$$''$#! A! K Nicolai and T 1astagnet . “3 (le+ible 4icro controller Based 1hopper -ri)ing a /ermanent 4agnet -1 4otorL. The "uropean /ower "lectronics 3pplication! ':: 8! 3 5hoei 5h! ,adidi. “MicroProcessor Based Closed- Loop Speed Control
System for DC Motor Using Power MOSFE L. rd I""" international conference on "lectronics. 1ircuits and Systems> '::;? )ol!#. pp!'#A%&'#8$! ;! /eter Spaso). “4icrocontroller TechnologyH The ;9,1''L /rentice ,all. 8th edition. #$$A! %! /ulse width modulator module >/*44?. 3Tmega9= data shee 9! =1- interfacing. the microcontroller and embedded systems by 4uhammad 3li 4a6idi. Kanice Dillispie 4a6idi. 2olin -! 4ckinlay! :! =1- interfacing with 4icrocontrollers Tutorial Inde+. httpHCCwww!9$8'projects!netClcd&InterfacingC 2ecent 3d)ances in 1ircuits. Systems. Signal and Telecommunications
B.V.C Engineering College, d!l!re"u.