




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 把握考试动向2025年信息系统项目管理师试题及答案
- 公共政策评估的关键指标试题及答案
- 2024年年4K超高清资金筹措计划书代可行性研究报告
- 软件设计师考试多层面提升方案试题及答案
- 政治舆论对决策的影响轨迹试题及答案
- 影响公共卫生政策的政治因素分析试题及答案
- 更有效地学习西方政治考试试题及答案
- 软件设计师考试中的时间分配技巧试题及答案
- 西方国家政策的社会影响分析试题及答案
- 社会心理学在公共政策分析中的应用试题及答案
- 光伏施工安全培训
- 国企岗位笔试题目及答案
- 社工招录考试试题及答案
- 餐厅厨房5S管理
- 变配电运行值班员(220kV及以下)高级技师-机考题库(导出版)
- DB11-T 2398-2025 水利工程巡视检查作业规范
- 2025春季学期国开电大本科《人文英语3》一平台在线形考综合测试(形考任务)试题及答案
- 《人工智能安全导论》 课件 第七章 人工智能在联邦学习领域
- 员工电动车管理制度
- 百叶窗施工工艺方案 组织设计
- 授权审批管理制度
评论
0/150
提交评论