




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
experiments.BuildasimpletwowheelsrobotwithL293DH-BridgedriverandIRsensors.WriteaCprogramcontrolsrobottrackedwithblacktape.FunwithVing-PeawCompetition2543,courselayout,day-by-daychangedruleandscoringalsoincluded。IntroductionOneofmystudenthasmadeadisgracefulrobotthatusedtwosteppermotorsandwithasimpleIRsensor.Yes,abovepictureiswhatImtalking.Withoutbatterycarrying,alittlebittorqueofthestepperandmisalignmentofdrivingshaft,makesitcrawlingnotwalking,butfirstdemo,showedquiteimpressivetome.HesaidhewroteacoupleofprogramlinesusingC,hisrobotcantracktheblacktape.Ifeeldelightedhisintentionandendeavor.Ithought,"heborrowedmeDS5000,expensiveone,asoftuControllerwithinternalbootloader,whyshouldnttrywithourlearningboardC-52EvaluationBoardinstead".Anotherone,toldmethesameday"IfoundtheL293Push/PullFourChannelDriveratBan-Moah,itcosts1.5US$".Ivebeensearchingthischipforayear.TheMiniBoard,aMotorola68HC11RobotControllerboarddesignedbyFredG.Martin,alsousesthisdriver.Thedayafter,IthendecidedtopreparethepagedescribinghowtouseC-52EVBasarobotcontrollerboard.Iaskedmystudentforcompetition,buildyourselvesrobotthatcantracktheblacktape.Prizeforthewinneris100US$,withabitconditionthatthewinnermustpayforabigpartyatSoiJindasSomtum(PapayaSalad)shop.Andoneofthecompetitorisme.Ithoughttheruleshouldbeconceivedroughlybystudentsandtechnicallybyme.Thepictureonthatdaywillputheresoon.C-52EVBresourcesBeforehand,letlookatavailableresourcesofC-52EVBforrobotexperiments.ActuatorsDCmotorPWMwithtimer2helpsP1.4,P1.5,P1.6,P1.7Sensorsdigital/analogIRdetectorwithcomparatorchip/foranaloginput,seeuseofPIC16C711digitalinput/T0,T1forpulseinputBrainCprogramavailablecodeanddataspaceapprox.32kB8000H-FFFFHProgramDownloaderRunningwithoutmonitorPAULMON2withPAULsstartupheader9600,8n1P3.0(RxD)andP3.1(TxD)DCMotorDriverBasiccircuitofusingL293formsanH-BridgeDriverisshowninFigure1.AsshownforsuchinductiveloadasDCmotor,externaldiodesforsuppressingbackEMFmustbeconnected.TheMiniBoardusesL293Dinstead,theL293Dhasinternaldiodes,howeverprovidingabitlessdrivingcapacity,i.e.,600mA@4.5V-36V.Fromthetruthtable,weseethatdirectionofthemotorcancontrolbypinCandD.VINHenable/disablepowertothemotor,thusforspeedregulation,wethenusethispinforPWMsignaling.Seedetails,L293.pdfdatasheet.Figure1:BasiccircuitofL293formsH-BridgeDriverAcircuitconnectingC-52P1toL293driverchipisshowninFigure2.AsshownEnablepin1connectedtoP1.0isforPWMsignaling.Weuseadditionalinverteratpin7andpin15toprovideproperlogicforeasydirectionalcontrol.Pleasenotethatpin4,5,12,13aretiedtogroundandifheatsinkingneeded,onemethodistomakealargeareaofPCBorsolderingitwithametalsheet,say.Figure2:ConnectingC-52EVBP1.4-P1.7toL293.ExternaldiodesmustbeconnectedforL293(notshownincircuitdiagram).MylatestdesignputadditionalinverterforPWMsignalatpin1andpin9topreventfullpowerdeliveringtoDCmotorswhenresettingthe89C52(i.e.,allbitsofP1islogichigh).CheckthelogicofPWMpinsforanothermicrocontrollers.LineTrackingSensor(IhavetoKUK)SincetheresnoADCfor89C52chip,eachcompetitormaybuildtheirownLineTrackingSensor,somemayuseLM339QUADcomparatorwithIRtransmitterandreceiver,somemayuseLDRasdescribedinLineFollowerRobot.Withanexternalcomparator,itmaynotnecessarytohaveADC,butwithLDR,weneedexternalADC."HavingadditionalADCfor89C52wouldbebetter",Ithought.HowcanweprovideADCfor89C52withacheapmethod?IchosePIC16C711with4-channelADC,and7-pininputport.Interfacingto89C52isdonewithsimplePISOprotocolbyusingRB0forSCLKandRA4forSDA.ThecodeforsuchpurposewaswritteninC,hereisthesourcefile,C52ADC.CandtheHEXcode,C52ADC.HEX.Aftersomeinitialization,the711chipwaitfortriggerreadsignalatpinRB0,i.e.,high-to-lowtransition,thenitresponsesbysending40-bitthroughRA4(SDA)withlow-to-hightransition.40-bitdatastreambeginswithLSBofADC0toMSBofPORTB.ExampleofprogramfrotestingADCisADC.CandthehexfileisADC.HEX.
Figure3:UsingPIC16C711tobea4-channelADCand7-bitinputportforC-52EVB.SimplePowerSupplyandChargerCircuitsFigure4showsasimplepowersupplycircuit.IhavetestedwithKABO,itworksfine.Forthosewhohaveabigcapacityrechargeablebattery,theresistancevalueofRcanbeselectedforapprox.10%outputchargingcurrent.DCincanbehigherifyourbatteryvoltagehigherthan8.4V,say.ToensuretheoutputcurrentiswithinthevaluecalculatedbyR,measureDCcurrentbefore.ThemaximumsupplyforLM317is~35V.Figure4:CircuitDiagramofbatterysupply+12VAlkalineand+8.4VNiMHwithaconstantcurrentrechargercircuit.For~20mA,useR~60Ohms.S1ismainswitchforCPUandL293circuits.UsingPAULsStartupHeaderfilewithMicro-CBeforewritingPWMgenerationfortestingabovecircuit,letstudyhowtousePaulsheader.WithaPAULsstartupheaderatthebeginningoftheapplicationCprogram,aftersuccessfullydownloadingthehexcode,justpressRESET,the89C52thenwillruntheapplicationinsteadofPAULMON2monitorprogram.AslongastheprogramremaininSRAM,runningtheprogramcanonlybedonewithpressingRESET.ToreturntoPAULMON2prompt,turntheboardpoweroffforawhile,thenbackthepoweronagain.ThisconceptofstartupheaderallowsustouseC-52EVBasadedicatedcontrollerbesideasalearningboard.OriginallyPaulhasmadewithentirelyinAssemblycode.However,IhaveadaptedforMicro-CCompiler.Ihaveputtheheaderforstartupcodeinthestartupandruntimelibraryforsmallmemorymodel.ThefileC52ROBOT.ASM,willcompileandlinktothemain()functionwithS=c52robot.asmwheninvokingcommandcoordinator.Exampleofcommandlineis;c:\mc\cc51%1-ilph=c:\mcm=ss=c52robot.asm%1ishello(.c),sayLettryhello.candcompilewithabovecommandline,downloadthehello.hexintotheC-52board,thenpressRESET,seewhathappen?ManualControlProgramdemonstratesPWMgenerationwithKABOOnemethodofdeliveringDCpowertomotorsistousePWM.ThePWMmethodsupplysDCpulsewithfixedfrequencybutwithadjustabledutycycle.IusedTIMER2inAUTOreloadproducing1000HzPWMfrequency.Eachtimeexecutinghasenteringintoserviceroutine,a16-bitPWM1wasshiftedouttoP1.7andPWM2toP1.6.Mainprogramhasataskthatsetthepowerformotor1andmotor2bywriting16-bitPWMpatternintoPWM1andPWM2formotor1andmortor2respectively.Theserviceroutinefortimer2isputinstartupcode.Seeexampleprogram,KABO1.CandC52ROBOT.ASM,forPWMdemonstrationwithmanualcontrol.Ihavedesignedandbuiltmyownrobotforthecompetitionalso.ItnamesKABOhavingdifferentialdrivemethod.Asshowninright-handside,istherarepartpoweredbyC52-EVB.ThemotordriverchipL293Danda74LS04areputatthesolderingpad.
Ving-PeawCompetitionIsupposethereshouldhavetenrobotstobecompeted.DetailsRuleandScoringwillb
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 凿井勘查合同范例
- 劳务损伤赔偿合同范本
- 化工生产合同范本
- 2024年中国动漫博物馆(杭州)招聘考试真题
- 2024年重庆永川区五间镇招聘公益性岗位人员笔试真题
- 乡下房屋转卖合同范本
- gf分包合同范本
- 修路合同范本简版
- 出售小区公共用地合同范本
- 北京三室一厅租房合同范本
- 安全管理工作中形式主义及防止对策
- 2024年郑州信息科技职业学院高职单招(英语/数学/语文)笔试历年参考题库含答案解析
- 2023-2024学年西安市高二数学第一学期期末考试卷附答案解析
- 学校保密教育培训课件
- 班组文化是企业文化建设的核心
- Project-培训教学课件
- 福建省服务区标准化设计指南
- 秋风词赏析课件古诗词赏析
- 销售人员薪酬设计实例 薪酬制度设计 薪酬设计方案 设计案例全套
- 福特F-150猛禽说明书
- 征地搬迁基本要求及工作技巧课件
评论
0/150
提交评论