ADCmotorisamotorthatutilizesaconstantpolaritypowersourcetoproducemechanical
work.
AllthismeansisthatyoucanconnectittoasimpleDCpowersourcesuchasabatteryto
powerit.Thismeansnocomplexdrivingcircuitryisneeded,asmostrobotsarepoweredby
batteries.
Beforewegetintohowyoucanusethesemotorsinyourproject,wewilltakealookathow
theseareconstructedandhowtheyworkinternally.
InternalConstructionandWorkingPrinciple
<EmbedGIF:
https://en.wikipedia.org/wiki/File:Ejs_Open_Source_Direct_Current_Electrical_Motor_Model_Ja
va_Applet_(_DC_Motor_)_80_degree_split_ring.gif
>
AsimpleDCmotorconsistsofacoilofconductorswithinthefieldofapairofpermanent
magnets.Theendterminalsofthecoilareelectricallyconnectedtoapairofsplitrings,also
calledcommutators.Thisensuresthatthedirectionofcurrentswitchesdirectioneveryhalf
cycle,sothatthecoilskeeprotatinginthesamedirection.
Weknowacurrentcarryingconductorplacedinanexternalmagneticfieldexperiencesaforce.
Thisforceiswhatcausestheshaftofthemotortorotate.
ThecommutatoristhekeycomponentthatletsthiskindofmotortobepoweredbyaDCsource
ratherthananACsource.
PoweringaDCMotor
Asyoumayhavenoticed,thismotorisatwoterminaldevice.Butthereis
nopolarityindication.Sohowdoyouknowinwhichwaytoconnectthe
batteryorwhateverpowersourceyoureusing?
Takeacloserlookattheconstruction.Reversingthepolarityjustreversesthedirectionofthe
force,andthereforethedirectionofrotation.Soyoucanconnectthebatterywhateverwayyou
want.Ifyouwantthemotortorotatetheotherway,justreversethepolarity.Prettyeasy,eh?
TheSimpleDeal
Sothesimplestcircuitforsuchamotoristoconnectthemotortoabatterywithaswitchin
series,sothatwecanswitchitonanoff.
TheBidirectionalSwitchCircuit,a.k.a.,DPDTCircuit
Butwait,whatifIwanttocontrolthedirectionofrotationofthemotorwithaswitchtoo?
Theresasolutionforthistoo,anditscalledaDPDTswitch,orDoublePoleDoubleThrow
switch.
WerecommendyoutakealookathowaDPDTswitchworksintheswitchestutorialbefore
proceeding.
Thecircuitdiagramisasfollows:
Trytofollowthedirectionofthecurrent.Itflowsinoppositedirectionsinthetwopositionsofthe
switch.Nowwecanchangethedirectionofrotationtoo.Yaay!
Interfacingwithmicrocontrollers
Nowyoucancontrolthemotorusingswitches.Butwhatifyouwanttousethisina
microcontrollerbasedproject?
Youcouldtrytopowerthemotordirectlyfromamicrocontroller(MCU)outputpin.
Therearetwoproblemswiththisapproach:
Mostmotorsusedinroboticsareusuallyratedat9Vor12Vormore.
MCUpinscansourcenomorethanafewmilliamperesofcurrent
Thismeansthatthemotorwon'tgetenoughpower,sowillrotateslowly,ornotworkatall.
TheTransistorApproach
Toovercomethispowerlimitation,wemightusetransistorsasswitches.Thebaseofannpn
transistormaybeconnectedtoanoutputpinofaMCU.Whentheoutputishigh,thetransistor
conducts,allowingthemotortoworkatfulloperationalpower.Whentheoutputislow,the
transistorstopsconducting,andhencethemotorstops.MOSFETsmayalsobeusedforthis
purpose.
ThevalueofRBisdependentontheexactapplication,but500toa1000ohmwouldbeasafe
startingpoint.RCmaybeomittedifVCCislessthan12V.
Thedownsidetousingthismethodisthemotoronlyrotatesinonedirection.
Thesolution?
TheMotorDriverICsetup
ItscalledanHBridgemotordrivercircuit.Fancynomenclatureaside,thiscircuitisavailableas
acommonIC,theL293D.
EndingNotes
Flybackdiode
Insomesources,youmightfindadiodeinparalleltothemotor.Thisdiodeisaprotectiondiode,
knownasaflybackdiode.Becauseamotorisaninductiveload,whenthecurrentstops
flowing,theinductiveeffectcausesalargebackwardsEMF.Thiscouldfrysensitiveelectronics
suchasatransistororamicrocontroller.
SpeedControl
Ifyouwanttocontrolthespeedofrotationofthemotor,onewayistouseapotentiometerin
serieswiththemotor.Adjustingthepotentiometerwillsetthespeed.A100ohmpotentiometer
willworkfine.
Ifthespeedcontrolneedstobedoneinamicrocontrollerinsoftware,aPWMmethodmaybe
applied.Checkoutmorehere:
<PWMtutoriallinkhere>