单片机的遥控智能小车
单片机的遥控智能小车
通过研发实现了I.种以光电传感器为敏感元件,以ATVIIIIXCVI.单片机为控制核心的电动循迹小车的智能控,该系统还包括直流电机.LIXI.I.0芯片和LMIIIIIIV比较器等.
本设计采用ATVIIIIXCVI.单片机作为智能小车核心控制器.本系统以单片机为控制核心,实现电动车的前进.退.左转和右转功能.通过角度传感器[I.]检测跷跷板角度的变化,利用增量式PI算法[II]控制电动车寻找平衡点,同时运用光电传感器检测黑线,使电动车在行驶过程中保持直线运动且不会脱离跷跷.
I.:方案设计
电动车的速度.位置.运行状况的实时测量,并将测量数据传送至单片机进行处理,然后由单片机根据所检测的各种数据实现对电动车的智能控制.这种方案能实现对电动车的运动状态进行实时控制,控制,灵活可靠,精度高,可满足对系统的各项要求.
直流调速系统采用脉宽调速系统,其主电路采用脉宽调制式变换器,简称PWM变换器.由于PWM调速系统的开关频率较高,仅靠电枢电感的滤波作用就可以获得脉动很小的直流电流,电枢电流容易连续,系统的低速运行平稳,调速范围较宽,可达I.:I.0000左右.由于电流波形比V-M系统好,在相同的平均电流下,电动机的损耗和发热都比较小.同样由于开关频率高,若与快速响应的电机相配合,系统可以获得很宽的频带,因此快速响应性能好,动态抗扰能力强.根据以上综合比较,以及本设计中受控电机的容量和直流电机调速的发展方向,本设计采用了H型单极型可逆PWM变换器进行调速.
I..I.光电检测模块设计
该智能小车在贴有黑线的白纸路面"上行驶,因此本模块设计需要检测铺在行驶区的黑胶带,包括直线行驶区和沿弧线行驶区两个区域.由于黑线和白纸对光线的反射系数不同可根据接收到的反射光的强弱来判断道路"---黑线.本文采用的是简单实用 *好棒文|www.hbsrm.com +Q: 3_5_1_9_1_6_0_7_2
的检测方法,即红外探测法.
红外探测法,即利用红外线在不同颜色的物理表面具有不同的反射性质的特点.在小车行驶过程中不断地向地面发射红外光,当红外光遇到白色地面时发生漫发射,反射光被装在小车上的接收管接收;如果遇到黑线则红外光被吸收,则小车上的接收管接收不到信号.
I..II信号比较模块设计
输送给单片机,用于检测传感器的敏感性,电路图如图V所示.当两个传感器同时检测到光时,直线前进.当传感器检测不到光时,处于截止状态,双运算放大器LMIIIIIIV输出低电平给单片机,由程序处理;若左路未检测到光,则向左纠正方向;若右路未检测到光,则向右纠正方向.
I..III电机控制与驱动模块设计
由于采用的是双驱动的小车,这部分电路必须能够输出两个不同的电压值,分别去控制小车的左.右两个驱动电机,使小车的两个车轮的转速和方向相同或不同,从而来控制它的前进和转弯.在系统的设计过程中,用两个LIXI.I.0芯片来分别连接单片机和直流电机.LIXI.I.0是为控制和驱动电机设计的两通道推挽式功率放大专用集成电路器件,将分立电路集成在单片IC之中,使外围器件成本降低,整机可靠性提高.该芯片有两个TTL/CMOS兼容电平的输入,具有良好的抗干扰性;两个输出端能直接驱动电机的正反向运动,它具有较大的电流驱动能力,每通道能通过VIII00mA的持续电流,峰值电流能力可达I..V~II.0A;同时它具有较低的输出饱和压降与静态电流;内置的钳位II极管能释放感性负载的反向冲击电流,使它在驱动继电器.直流电机.步进电机或开关功率管的使用上安全可靠.
循迹小车系统以常见的ATVIIIIXCVI.单片机为核心,辅以较简单的元器件和电路设计,在顺利完成循迹功能的前提下,又充分考虑到了外观.成本等问题,因此小车的大部分电路由手工焊接完成.在设计中,我们没有在电路中增加冗余的功能,但是保留了各种硬件接口和软件子程序接口,方便以后的扩展和开发.
II.系统硬件设计系统硬件设计
II.I.电机驱动模块设计
在制作智能小车时,后左.右轮分别用两个转速和力矩基本完全相同的直流减速电机进行驱动,车头前部装I.个方向轮,然后通过I/O口控制两个直流减速电机的转速和转向就可以实现小车的左转.右转和直行.
电机驱动采用片集成电机驱动芯片LIIIXVIIIN.LIIIXVIIIN是ST公司的产品,内部包含IV通道逻辑驱动电路,是I.种II相和IV相电机的专用驱动器,即内含II个H桥的高电压大电流双全桥式驱动器,接收标准TTL逻辑电平信号,可驱动IVVIV.IIA以下的电机.
II.II寻迹模块设计
寻迹模块主要由光电反射式传感器组成.光敏电阻的阻值随周围环境光线的变化而变化,当光线照射到白线上面时,光线发射强烈;光线照射到黑线上面时,光线发射较弱.因此当光敏电阻在白线和黑线上方时,阻值会发生明显的变化,将阻值的变化值经过比较器就可以输出高低电平.但是这种方式受环境影响大,工作不稳定.本文实际采用的是RPRIIII0型反射式传感器制作的寻迹模块.
RPRIIII0是I.种I.体化反射型光电探测器,其发射器是I.个砷化镓红外发光II极管,而接收器是I.个高灵敏度硅平面光电III极管.当发光II极管发出的光反射回来时,III极管导通并输出低电平.
II.III避障模块设计
避障模块主要由红 *好棒文|www.hbsrm.com +Q: 3_5_1_9_1_6_0_7_2
外反射式传感器组成.红外反射式传感器由I.个红外发射管(发射器)和I.个光电II极管(接收器)构成,红外发射管发出的红外光在遇到反光性较强的物体后被折回,被光电II极管接收,引起光电II极管光生电流的增大,将此变化转为电压信号,就可以被处理器接收并处理.
II.IV遥控模块设计
本模块发射端采用高灵敏的HL-V000型万能电视遥控器,接收端采用接收频率为IIIVIIIkHz的万能接收头I.VIIIIIIVIII,该模块与单片机接口非常方便.另外,对于经红外接收后的编码信号,本系统设计时运用ATVIIIIXCVII单片微机的外部中断来接收,信号的下降沿触发外部中断.为了识别I.个完整的键信号,必须对每I.个编码脉冲的宽度进行测量,以判别接收到的脉是!0?还是!I.?,利用单片机中的定时器/计数器来测量脉冲宽度.定时器/计数器的除分比是可以设定的,从除II到除II0IVVIII,可测量的脉冲宽度可达V00ms.本文设定的除分比为I.II,即I.II分频,因为外部时钟约为I.IIMHz,时钟周期为I.s,所以定时器/计数器每计时I.次为I.s.
II.V报警模块设计
报警模块的核心芯片选择I.I.0报警IC,可应用于汽车.摩托车.防盗器.个人防暴器.门磁报警器等场所.
III.系统软件设计
本系统软件采用模块化结构,由主程序﹑初始化子程序.中断子程序.延时子程序.按键发音子程序.按键扫描子程序构成.
III.I.寻迹子程序设计
寻迹模块设计是通过把左右光电传感器的输出端分别接到单片机的PIIII和PIIIII管脚上,然后通过单片机编程,产生PWM控制信号,通过LIIIXVIII控制电机的转速,让小车达到前进.左转.右转及停止行驶的目的.
III.II避障子程序设计
避障模块设计是通过把左右红外反射式传感器模块的输出端分别接到单片机的PII0和PIII.管脚上,然后通过单片机编程,产生PWM控制信号,通过LIIIXVIII控制电机的转速,让小车达到前进.左转.右转及停止行驶的目的.
III.III遥控子程序设计
遥控模块设计是通过把红外接收头I.VIIIIIIVIII的输出端接到单片机的PIIIII管脚上,然后用万能遥控器对其进行遥控,接着让单片机解码,产生PWM控制信号,通过LIIIXVIII控制电机的转速,让小车达到前进.左转.右转及停止行驶的目的.
IV.总结
采用单片机为核心,利用光电传感器和红外反射式传感器作为探测系统,设计了可以实现自动寻线行走.自动避障.报警以及遥控等功能的智能小车.该设计的显著优点是电路简单.可靠性强.成本低,并且非常易于功能进I.步完善和扩展.
附件II:外文原文
ElectricintelligentcarbasedonSCM
Throughresearchandtorealizeaphotoelectricsensorforsensitivecomponents,withATVIIIIXCVI.ascontrolcoreelectrictracingofintelligentcontrolcarbonylation-thecar,Thesystemisalsoincludingdcmotor,LIXI.I.0chipsandLMIIIIIIVcomparatoretc.ThedesignUSESATVIIIIXCVI.asintelligentcarcorecontroller.
ThesystemtakesmicrocontrollerascontrolcoreandrealizationofelectricbeforeEnter,back,turnleftandrightturnfunction.ThroughtheAnglesensor[I.]detectionTheseesawAnglechange,useincrementalPIalgorithm[II]tocontroltheelectricCarforbalance,andusingphotoelectricsensordetectionblackline,maketheelectricityActuationvehicleinthecourseofdrivingkeeplinearmotionanddontskipfromatrium.
I..ProjectDesign
lightbyasensor,therealityoftheelectriccarismovingquicklydegrees,bit,buy,transportationlineshapewhenmeasuredquantityofrealcondition,andwillbemeasuredquantitynumberaccordingtopreachsenttomonolithicmachineintolineprocessing,butbysinglechipmachineaccordingtothemeasuredbyrootdifferentformsofseveralinspectionaccordingtorealnowtoelectricactuationvehiclewisdomcancontrolsystem.Thiskindofsquarecasecanrealnowtoelectricactuationvehicledynamicshapestateintotheshipmentdorealpossessioninsystem,controlsystemspiritalive,candepend,puredegreeishigh,canfullfootofeachitemofthestockingstobeg.(I.)straightepidemiologicalspeedistasseledstraightepidemiologicalspeeddepartmentwithpulsewidthmodulationexperience.meanwhilegatherspeedisexperience.meanwhile,itsmainelectricalpulsewidthmodulationbyroadsystemtypevariablechangedevice,JanesaysPWMvariablechangedevice.AdjustablespeedbyinthedepartmentofPWMexperience.meanwhileopenshutfrequencyrateishigh,onlyonelectricitybarnadoelectricitysenseoffilterwavecanbeusetogettomoveverysmallstraightpulseelectricflow,electricityflowbarnadoelectriccapacityeasilyeventantras,departmentoflowspeedoperationflatexperience.meanwhile,adjustablespeedstabilityvanissurroundedrelativelywide,canreachI.000leftright.ByonelectricalflowwaveshapethanV-Msystem,beinphasewithflattoallelectricalflowdynamicmachine,electricheatconsumptionandhairlossthanasmall.Withthesamplebyinopenshutfrequencyrateishigh,andifafastspeedofelectricalmachineringshouldmatchclose,fastentasseledphasecanbetogetverywidefrequencyband,becauseofthefastspeedringshouldbegood,dynamicconfigurationsexualcanperturbationresistancecanforceispowerful.Accordingtotheroot,withmorethanensemblecloseandthissetofelectricalmachinecontrolprojectbytoleranceofthequantityandelectricalmachinespeedstraightflowofhair,theexhibitortoadopttheprojectwithasingleextremelyHtypecanbechangedintochangedeviceinversePWMlinespeed.
I..I.photoelectricdetectionmoduledesign
Theintelligentcarwasstuckontheblacklinerunningonwhitepaper"road",sothismoduledesignneedtodetectshopontheblackrubberbeltdrivearea,includingRunstraightalongthearcdistrictanddrivingdistricttwoarea.Becauseoftheblackandwhitepapertolightreflectioncoefficientisdifferent,canaccordingtoreceivereflectedlight.
Thestrengthofthejudge"road"-theblackline.ThispaperUSESissimpleandpracticaldetectionmethods,namelytheinfrareddetectionmethod.
Infrareddetectionmethod,i.e.useinfraredrayindifferentcolorsofphysicalsurfacewithdifferentreflectionpropertiescharacteristics.InthecardrivingprocessContinuallytothegroundtolaunchtheinfrared,whentheinfraredmetwhitegroundoccurswhenthereflectedlight,aimlessandlaunchpackedonthecarofreceivingtubereceiving;ifFruitismetblacklineisabsorbed,andthentheinfraredcarsreceivingtubereceivinglessthansignal.
I..IIsignalcomparativemoduledesign
ThispartdesignUSESaLMIIIIIIVcomparator,ofsensorsignalvoltagereceivedcompareandamplified,andwillcomparetheresultsafterFeedtothemicrocontroller,usedtodetectsensorsensitivity,diagramshowninfigureVshows.Whentwosensorssimultaneouslydetectlight,straightforward.Whenthesensorcantdetectlight,incut-offstate,doubleLMIIIIIIVoperationalamplifieroutputlowleveltomicrocontroller,byprogramprocessing,IfleftNotdetectedlight,thenleftcorrectdirection;Iftherighthasnotbeendetectedlight,thenturncorrectdirection.
I..IIImotorcontrolanddrivingmoduledesign
Becauseuseisdoubledrivecars,thispartofthecircuitmustbeabletooutputoftwodifferentvoltagevalues,respectivelytocontrollingtrolleyrightandlefttwomotordrive,thetwoofthewheelspeedanddirectionofthesameordifferent,thustocontrolitsadvanceandturning.Insystemdesignprocess,usetwoLIXI.I.0chipstoconnectSCManddcmotorrespectively.LIXI.I.0isforcontrolanddrivemotordesigntwochannelspush-pullpoweramplifierapplication-specificintegratedcircuitdevice,discretecircuitsinmonolithicICintegratedsuchthattheperipheralequipmentsinlowercostandthewholemachinecancarryonsexualhigh.ThecoreslicetwoaTTL/CMOSandletelectricityflatloseinto,havegoodanti-jamming,Twooutputterminalcanpickfloodingdynamicelectricmachinestraighttotheshipmentofpositivereversemoveandithashadabigelectricityflowfloodingdynamiccanforce,eachcallwaycanpassoverVIII00mAcontinuouscurrent,peakcurrentcapacityofI..V~0A;Atthesametimeithasloweroutputsaturationpressuredropandthestaticelectricity,Thebuilt-inclampadiodecanreleasetheperceptualloadofreversecurrentimpulse,makingitthedriverelays,dcmotors,steppingmotororswitchpowertubetheuseofsafeandreliable.
FollowtracingcarsystemtocommonATVIIIIXCVI.,complementarywithrelativelysimplecomponentsandcircuitdesign,thesmoothcompletionoffollowunderthepremiseoftracingfunction,andfullyconsideredappearance,costs,somostofthecircuitcarbymanualweldingiscomplete.Inthedesign,weneverinacircuitincreaseredundantfunctions,butretainedvarioushardwareinterfaceandsoftwaresubroutinesinterfacetofacilitatetheexpansionanddevelopmentafter.
II.Systemhardwaredesign
II.I.motordrivermoduledesign
Inmakingintelligentcar,afterleft,rightwheelrespectivelywithtwospeedandTorquebasicidenticaldcmotordrivendeceleration,bolt-ontrunk-lidspoilerDepartmenttoinstalladirectionwheel,thenthroughtheI/OmouthtocontroltwodcslowingdownMotorspeedandsteeringcanbeachievedonthecartotheleft,turnrightandstraightLine.
MotordriverusingaintegratedelectricalmachinefloodingdynamiccoresliceLIIIXVIIIN.LIIIXVIIINisSTtheproductofthecompany,theinternalcontainingfourchannellogicaldrivecircuit,itisakindoftwophasefourphasemotordrive,namelythespecialcontainstwoHbridgeofhighvoltagelargecurrentcommanderbridgetypedrive,acceptancecriteriaTTLlogiclevelsignals,bedrivenIVVIV,IIAbelowthemotor.
II.IItracingmoduledesign
Tracingmodulemainlycomposedbyphotoelectricsensorreflex.Photoconductiveresistanceoftheresistanceofthelightwiththesurroundingenvironmentchanges,whentheLTTwhitelinesabove,lightemissionstrongly;TheLTTblacklineabove,lightemissionarerelativelyweak.Sowhenphotoconductiveresistanceinwhitelineandblacklineabovetheelementswilloccursignificantlychanges,theresistancechangesvalueaftercomparatorcanoutputhighlevel.Butthiswayenvironmentalinfluencesbig,workisnotstable.ThisarticleactualuseisRPRIIII0typereflexsensorsmadetracingmodule.
RPRIIII0isanintegrationofreflectivephotoelectricdetector,thetransmitterisagaasinfraredlightemittingdiodeandthereceiverisahighsensitivitysiliconphotoelectrictriodeflat.Whenthelightemittingdiodereflectedback,triodeconductionandoutputlowlevel.
II.IIIobstacleavoidancemoduledesign
Obstacleavoidancemodulemainlycomposedbyinfraredreflectionsensor.Infraredreflectionsensorbyoneinfraredtubes(launchers)andI.photoelectricdiode(receiver)constitute,infraredtubesouttomeettheinfraredobjectreflectivesexstrongafterbeturnedback,byphotoelectricdiodereceiving,causephotoelectricdiodecurrentincreases,lightbornthischangeintovoltagesignal,itcouldbeprocessorreceivesandprocessing.
II.IVremotecontrolmoduledesign
ThismodulewilllaunchendUSEShighsensitiveHL-V000typeuniversaltelevisionremotecontrol,thereceiverusingreceivefrequencyforIIIVIIIkHzsreceivingheadI.VIIIIIIVIII,thismoduleandthesinglechipcomputerinterfaceisveryconvenient.Inaddition,fortheredoutsidemeetafterharvestofplaitcodeletternumber,thedepartmenttasseledsetwhenshippedwithprojectofATVIIIIXCVIIsinglechipmicrocomputerexternalinterruptiontoreceive,signalthefallingedgeoftrigger
externalinterruption.Inordertorecognizeacompletekeysignal,mustforeachcodingpulsewidthweremeasuredwithdiscriminantreceivesthepulseis!0still!I.?,themicrocontrollertimer/countertomeasuringpulsewidth.Timer/counterexcept?pointsthancanbeset,fromexceptIItoexceptII0IVVIII,measurablepulsewidthcanreachV00ms.ThispapersetexceptpointsforI.II,namelythanI.IIpointsfrequency,becausetheexternalclockisaboutI.IIMHz,clockcycleforI.s,sothetimer/counterforI.pertimingonces.
II.Valarmmoduledesign
AlarmmodulecorechipI.I.0IC,canchooseapplicationinautomobile,motorcycle,alarms,personalriotdevice,doormagneticalarmdeviceandetc.
III.Systemsoftwaredesign
Thissystemsoftwaremodularstructure,themainprogram,initialanti-fuzzyprocedures,interruptsubroutines,delaysubroutines,buttonspronunciationsubroutines,buttonsscanningsubroutinesconstitutes.
III.I.tracingsubroutinesdesign
Tracingmoduleisdesignedbytheleftrightphotoelectricsensoroutputterminalreceivingmonolithicmachinerespectively,PIIIIandPIIIIItubefeet,thenthroughthemicrocontrollerprogramming,producePWMcontrolsignal,throughLIIIXVIIIcontrolmotorspeed,letthecartomoveforward,leftturn,turnrightandstopdrivingpurpose.
III.IIavoidbarrierofprogramming
ObstacleavoidancemoduleisdesignedbytheinfraredreflectionsensormodulearoundtheoutputterminalreceivingMCUrespectivelyPII0andPIII.tubefeet,thenthroughthemicrocontrollerprogramming,producePWMcontrolsignal,throughLIIIXVIIIcontrolmotorspeed,letthecartomoveforward,leftturn,turnrightandstopdrivingpurpose.
III.IIIremotesubroutinesdesign
RemotecontrolmoduleisdesignedbytheinfraredsensorI.VIIIIIIVIIIanoutputterminalofthereceivingMCUPIIIIItubefeet,thenuseall-purposeremotecontrolontheremotecontrol,thenletmicrocontrollerdecoding,producePWMcontrolsignal,throughLIIIXVIIIcontrolmotorspeed,letthecartomoveforward,leftturn,turnrightandstopdrivingpurpose.
IV.Summary
Adoptssinglechip,usingphotoelectricsensorandinfraredreflectionsensorwasdesignedasadetectionsystem,canrealizeautomatichominglinetowalk,automaticobstacleavoidance,alarmandremotecontrolfunctionssuchasintelligentcar.Thisdesignistheobviousadvantagesofsimplecircuit,reliability,lowcost,andveryeasytofunctionoffurtherperfectingandexpansion
通过研发实现了I.种以光电传感器为敏感元件,以ATVIIIIXCVI.单片机为控制核心的电动循迹小车的智能控,该系统还包括直流电机.LIXI.I.0芯片和LMIIIIIIV比较器等.
本设计采用ATVIIIIXCVI.单片机作为智能小车核心控制器.本系统以单片机为控制核心,实现电动车的前进.退.左转和右转功能.通过角度传感器[I.]检测跷跷板角度的变化,利用增量式PI算法[II]控制电动车寻找平衡点,同时运用光电传感器检测黑线,使电动车在行驶过程中保持直线运动且不会脱离跷跷.
I.:方案设计
电动车的速度.位置.运行状况的实时测量,并将测量数据传送至单片机进行处理,然后由单片机根据所检测的各种数据实现对电动车的智能控制.这种方案能实现对电动车的运动状态进行实时控制,控制,灵活可靠,精度高,可满足对系统的各项要求.
直流调速系统采用脉宽调速系统,其主电路采用脉宽调制式变换器,简称PWM变换器.由于PWM调速系统的开关频率较高,仅靠电枢电感的滤波作用就可以获得脉动很小的直流电流,电枢电流容易连续,系统的低速运行平稳,调速范围较宽,可达I.:I.0000左右.由于电流波形比V-M系统好,在相同的平均电流下,电动机的损耗和发热都比较小.同样由于开关频率高,若与快速响应的电机相配合,系统可以获得很宽的频带,因此快速响应性能好,动态抗扰能力强.根据以上综合比较,以及本设计中受控电机的容量和直流电机调速的发展方向,本设计采用了H型单极型可逆PWM变换器进行调速.
I..I.光电检测模块设计
该智能小车在贴有黑线的白纸路面"上行驶,因此本模块设计需要检测铺在行驶区的黑胶带,包括直线行驶区和沿弧线行驶区两个区域.由于黑线和白纸对光线的反射系数不同可根据接收到的反射光的强弱来判断道路"---黑线.本文采用的是简单实用 *好棒文|www.hbsrm.com +Q: 3_5_1_9_1_6_0_7_2
的检测方法,即红外探测法.
红外探测法,即利用红外线在不同颜色的物理表面具有不同的反射性质的特点.在小车行驶过程中不断地向地面发射红外光,当红外光遇到白色地面时发生漫发射,反射光被装在小车上的接收管接收;如果遇到黑线则红外光被吸收,则小车上的接收管接收不到信号.
I..II信号比较模块设计
输送给单片机,用于检测传感器的敏感性,电路图如图V所示.当两个传感器同时检测到光时,直线前进.当传感器检测不到光时,处于截止状态,双运算放大器LMIIIIIIV输出低电平给单片机,由程序处理;若左路未检测到光,则向左纠正方向;若右路未检测到光,则向右纠正方向.
I..III电机控制与驱动模块设计
由于采用的是双驱动的小车,这部分电路必须能够输出两个不同的电压值,分别去控制小车的左.右两个驱动电机,使小车的两个车轮的转速和方向相同或不同,从而来控制它的前进和转弯.在系统的设计过程中,用两个LIXI.I.0芯片来分别连接单片机和直流电机.LIXI.I.0是为控制和驱动电机设计的两通道推挽式功率放大专用集成电路器件,将分立电路集成在单片IC之中,使外围器件成本降低,整机可靠性提高.该芯片有两个TTL/CMOS兼容电平的输入,具有良好的抗干扰性;两个输出端能直接驱动电机的正反向运动,它具有较大的电流驱动能力,每通道能通过VIII00mA的持续电流,峰值电流能力可达I..V~II.0A;同时它具有较低的输出饱和压降与静态电流;内置的钳位II极管能释放感性负载的反向冲击电流,使它在驱动继电器.直流电机.步进电机或开关功率管的使用上安全可靠.
循迹小车系统以常见的ATVIIIIXCVI.单片机为核心,辅以较简单的元器件和电路设计,在顺利完成循迹功能的前提下,又充分考虑到了外观.成本等问题,因此小车的大部分电路由手工焊接完成.在设计中,我们没有在电路中增加冗余的功能,但是保留了各种硬件接口和软件子程序接口,方便以后的扩展和开发.
II.系统硬件设计系统硬件设计
II.I.电机驱动模块设计
在制作智能小车时,后左.右轮分别用两个转速和力矩基本完全相同的直流减速电机进行驱动,车头前部装I.个方向轮,然后通过I/O口控制两个直流减速电机的转速和转向就可以实现小车的左转.右转和直行.
电机驱动采用片集成电机驱动芯片LIIIXVIIIN.LIIIXVIIIN是ST公司的产品,内部包含IV通道逻辑驱动电路,是I.种II相和IV相电机的专用驱动器,即内含II个H桥的高电压大电流双全桥式驱动器,接收标准TTL逻辑电平信号,可驱动IVVIV.IIA以下的电机.
II.II寻迹模块设计
寻迹模块主要由光电反射式传感器组成.光敏电阻的阻值随周围环境光线的变化而变化,当光线照射到白线上面时,光线发射强烈;光线照射到黑线上面时,光线发射较弱.因此当光敏电阻在白线和黑线上方时,阻值会发生明显的变化,将阻值的变化值经过比较器就可以输出高低电平.但是这种方式受环境影响大,工作不稳定.本文实际采用的是RPRIIII0型反射式传感器制作的寻迹模块.
RPRIIII0是I.种I.体化反射型光电探测器,其发射器是I.个砷化镓红外发光II极管,而接收器是I.个高灵敏度硅平面光电III极管.当发光II极管发出的光反射回来时,III极管导通并输出低电平.
II.III避障模块设计
避障模块主要由红 *好棒文|www.hbsrm.com +Q: 3_5_1_9_1_6_0_7_2
外反射式传感器组成.红外反射式传感器由I.个红外发射管(发射器)和I.个光电II极管(接收器)构成,红外发射管发出的红外光在遇到反光性较强的物体后被折回,被光电II极管接收,引起光电II极管光生电流的增大,将此变化转为电压信号,就可以被处理器接收并处理.
II.IV遥控模块设计
本模块发射端采用高灵敏的HL-V000型万能电视遥控器,接收端采用接收频率为IIIVIIIkHz的万能接收头I.VIIIIIIVIII,该模块与单片机接口非常方便.另外,对于经红外接收后的编码信号,本系统设计时运用ATVIIIIXCVII单片微机的外部中断来接收,信号的下降沿触发外部中断.为了识别I.个完整的键信号,必须对每I.个编码脉冲的宽度进行测量,以判别接收到的脉是!0?还是!I.?,利用单片机中的定时器/计数器来测量脉冲宽度.定时器/计数器的除分比是可以设定的,从除II到除II0IVVIII,可测量的脉冲宽度可达V00ms.本文设定的除分比为I.II,即I.II分频,因为外部时钟约为I.IIMHz,时钟周期为I.s,所以定时器/计数器每计时I.次为I.s.
II.V报警模块设计
报警模块的核心芯片选择I.I.0报警IC,可应用于汽车.摩托车.防盗器.个人防暴器.门磁报警器等场所.
III.系统软件设计
本系统软件采用模块化结构,由主程序﹑初始化子程序.中断子程序.延时子程序.按键发音子程序.按键扫描子程序构成.
III.I.寻迹子程序设计
寻迹模块设计是通过把左右光电传感器的输出端分别接到单片机的PIIII和PIIIII管脚上,然后通过单片机编程,产生PWM控制信号,通过LIIIXVIII控制电机的转速,让小车达到前进.左转.右转及停止行驶的目的.
III.II避障子程序设计
避障模块设计是通过把左右红外反射式传感器模块的输出端分别接到单片机的PII0和PIII.管脚上,然后通过单片机编程,产生PWM控制信号,通过LIIIXVIII控制电机的转速,让小车达到前进.左转.右转及停止行驶的目的.
III.III遥控子程序设计
遥控模块设计是通过把红外接收头I.VIIIIIIVIII的输出端接到单片机的PIIIII管脚上,然后用万能遥控器对其进行遥控,接着让单片机解码,产生PWM控制信号,通过LIIIXVIII控制电机的转速,让小车达到前进.左转.右转及停止行驶的目的.
IV.总结
采用单片机为核心,利用光电传感器和红外反射式传感器作为探测系统,设计了可以实现自动寻线行走.自动避障.报警以及遥控等功能的智能小车.该设计的显著优点是电路简单.可靠性强.成本低,并且非常易于功能进I.步完善和扩展.
附件II:外文原文
ElectricintelligentcarbasedonSCM
Throughresearchandtorealizeaphotoelectricsensorforsensitivecomponents,withATVIIIIXCVI.ascontrolcoreelectrictracingofintelligentcontrolcarbonylation-thecar,Thesystemisalsoincludingdcmotor,LIXI.I.0chipsandLMIIIIIIVcomparatoretc.ThedesignUSESATVIIIIXCVI.asintelligentcarcorecontroller.
ThesystemtakesmicrocontrollerascontrolcoreandrealizationofelectricbeforeEnter,back,turnleftandrightturnfunction.ThroughtheAnglesensor[I.]detectionTheseesawAnglechange,useincrementalPIalgorithm[II]tocontroltheelectricCarforbalance,andusingphotoelectricsensordetectionblackline,maketheelectricityActuationvehicleinthecourseofdrivingkeeplinearmotionanddontskipfromatrium.
I..ProjectDesign
lightbyasensor,therealityoftheelectriccarismovingquicklydegrees,bit,buy,transportationlineshapewhenmeasuredquantityofrealcondition,andwillbemeasuredquantitynumberaccordingtopreachsenttomonolithicmachineintolineprocessing,butbysinglechipmachineaccordingtothemeasuredbyrootdifferentformsofseveralinspectionaccordingtorealnowtoelectricactuationvehiclewisdomcancontrolsystem.Thiskindofsquarecasecanrealnowtoelectricactuationvehicledynamicshapestateintotheshipmentdorealpossessioninsystem,controlsystemspiritalive,candepend,puredegreeishigh,canfullfootofeachitemofthestockingstobeg.(I.)straightepidemiologicalspeedistasseledstraightepidemiologicalspeeddepartmentwithpulsewidthmodulationexperience.meanwhilegatherspeedisexperience.meanwhile,itsmainelectricalpulsewidthmodulationbyroadsystemtypevariablechangedevice,JanesaysPWMvariablechangedevice.AdjustablespeedbyinthedepartmentofPWMexperience.meanwhileopenshutfrequencyrateishigh,onlyonelectricitybarnadoelectricitysenseoffilterwavecanbeusetogettomoveverysmallstraightpulseelectricflow,electricityflowbarnadoelectriccapacityeasilyeventantras,departmentoflowspeedoperationflatexperience.meanwhile,adjustablespeedstabilityvanissurroundedrelativelywide,canreachI.000leftright.ByonelectricalflowwaveshapethanV-Msystem,beinphasewithflattoallelectricalflowdynamicmachine,electricheatconsumptionandhairlossthanasmall.Withthesamplebyinopenshutfrequencyrateishigh,andifafastspeedofelectricalmachineringshouldmatchclose,fastentasseledphasecanbetogetverywidefrequencyband,becauseofthefastspeedringshouldbegood,dynamicconfigurationsexualcanperturbationresistancecanforceispowerful.Accordingtotheroot,withmorethanensemblecloseandthissetofelectricalmachinecontrolprojectbytoleranceofthequantityandelectricalmachinespeedstraightflowofhair,theexhibitortoadopttheprojectwithasingleextremelyHtypecanbechangedintochangedeviceinversePWMlinespeed.
I..I.photoelectricdetectionmoduledesign
Theintelligentcarwasstuckontheblacklinerunningonwhitepaper"road",sothismoduledesignneedtodetectshopontheblackrubberbeltdrivearea,includingRunstraightalongthearcdistrictanddrivingdistricttwoarea.Becauseoftheblackandwhitepapertolightreflectioncoefficientisdifferent,canaccordingtoreceivereflectedlight.
Thestrengthofthejudge"road"-theblackline.ThispaperUSESissimpleandpracticaldetectionmethods,namelytheinfrareddetectionmethod.
Infrareddetectionmethod,i.e.useinfraredrayindifferentcolorsofphysicalsurfacewithdifferentreflectionpropertiescharacteristics.InthecardrivingprocessContinuallytothegroundtolaunchtheinfrared,whentheinfraredmetwhitegroundoccurswhenthereflectedlight,aimlessandlaunchpackedonthecarofreceivingtubereceiving;ifFruitismetblacklineisabsorbed,andthentheinfraredcarsreceivingtubereceivinglessthansignal.
I..IIsignalcomparativemoduledesign
ThispartdesignUSESaLMIIIIIIVcomparator,ofsensorsignalvoltagereceivedcompareandamplified,andwillcomparetheresultsafterFeedtothemicrocontroller,usedtodetectsensorsensitivity,diagramshowninfigureVshows.Whentwosensorssimultaneouslydetectlight,straightforward.Whenthesensorcantdetectlight,incut-offstate,doubleLMIIIIIIVoperationalamplifieroutputlowleveltomicrocontroller,byprogramprocessing,IfleftNotdetectedlight,thenleftcorrectdirection;Iftherighthasnotbeendetectedlight,thenturncorrectdirection.
I..IIImotorcontrolanddrivingmoduledesign
Becauseuseisdoubledrivecars,thispartofthecircuitmustbeabletooutputoftwodifferentvoltagevalues,respectivelytocontrollingtrolleyrightandlefttwomotordrive,thetwoofthewheelspeedanddirectionofthesameordifferent,thustocontrolitsadvanceandturning.Insystemdesignprocess,usetwoLIXI.I.0chipstoconnectSCManddcmotorrespectively.LIXI.I.0isforcontrolanddrivemotordesigntwochannelspush-pullpoweramplifierapplication-specificintegratedcircuitdevice,discretecircuitsinmonolithicICintegratedsuchthattheperipheralequipmentsinlowercostandthewholemachinecancarryonsexualhigh.ThecoreslicetwoaTTL/CMOSandletelectricityflatloseinto,havegoodanti-jamming,Twooutputterminalcanpickfloodingdynamicelectricmachinestraighttotheshipmentofpositivereversemoveandithashadabigelectricityflowfloodingdynamiccanforce,eachcallwaycanpassoverVIII00mAcontinuouscurrent,peakcurrentcapacityofI..V~0A;Atthesametimeithasloweroutputsaturationpressuredropandthestaticelectricity,Thebuilt-inclampadiodecanreleasetheperceptualloadofreversecurrentimpulse,makingitthedriverelays,dcmotors,steppingmotororswitchpowertubetheuseofsafeandreliable.
FollowtracingcarsystemtocommonATVIIIIXCVI.,complementarywithrelativelysimplecomponentsandcircuitdesign,thesmoothcompletionoffollowunderthepremiseoftracingfunction,andfullyconsideredappearance,costs,somostofthecircuitcarbymanualweldingiscomplete.Inthedesign,weneverinacircuitincreaseredundantfunctions,butretainedvarioushardwareinterfaceandsoftwaresubroutinesinterfacetofacilitatetheexpansionanddevelopmentafter.
II.Systemhardwaredesign
II.I.motordrivermoduledesign
Inmakingintelligentcar,afterleft,rightwheelrespectivelywithtwospeedandTorquebasicidenticaldcmotordrivendeceleration,bolt-ontrunk-lidspoilerDepartmenttoinstalladirectionwheel,thenthroughtheI/OmouthtocontroltwodcslowingdownMotorspeedandsteeringcanbeachievedonthecartotheleft,turnrightandstraightLine.
MotordriverusingaintegratedelectricalmachinefloodingdynamiccoresliceLIIIXVIIIN.LIIIXVIIINisSTtheproductofthecompany,theinternalcontainingfourchannellogicaldrivecircuit,itisakindoftwophasefourphasemotordrive,namelythespecialcontainstwoHbridgeofhighvoltagelargecurrentcommanderbridgetypedrive,acceptancecriteriaTTLlogiclevelsignals,bedrivenIVVIV,IIAbelowthemotor.
II.IItracingmoduledesign
Tracingmodulemainlycomposedbyphotoelectricsensorreflex.Photoconductiveresistanceoftheresistanceofthelightwiththesurroundingenvironmentchanges,whentheLTTwhitelinesabove,lightemissionstrongly;TheLTTblacklineabove,lightemissionarerelativelyweak.Sowhenphotoconductiveresistanceinwhitelineandblacklineabovetheelementswilloccursignificantlychanges,theresistancechangesvalueaftercomparatorcanoutputhighlevel.Butthiswayenvironmentalinfluencesbig,workisnotstable.ThisarticleactualuseisRPRIIII0typereflexsensorsmadetracingmodule.
RPRIIII0isanintegrationofreflectivephotoelectricdetector,thetransmitterisagaasinfraredlightemittingdiodeandthereceiverisahighsensitivitysiliconphotoelectrictriodeflat.Whenthelightemittingdiodereflectedback,triodeconductionandoutputlowlevel.
II.IIIobstacleavoidancemoduledesign
Obstacleavoidancemodulemainlycomposedbyinfraredreflectionsensor.Infraredreflectionsensorbyoneinfraredtubes(launchers)andI.photoelectricdiode(receiver)constitute,infraredtubesouttomeettheinfraredobjectreflectivesexstrongafterbeturnedback,byphotoelectricdiodereceiving,causephotoelectricdiodecurrentincreases,lightbornthischangeintovoltagesignal,itcouldbeprocessorreceivesandprocessing.
II.IVremotecontrolmoduledesign
ThismodulewilllaunchendUSEShighsensitiveHL-V000typeuniversaltelevisionremotecontrol,thereceiverusingreceivefrequencyforIIIVIIIkHzsreceivingheadI.VIIIIIIVIII,thismoduleandthesinglechipcomputerinterfaceisveryconvenient.Inaddition,fortheredoutsidemeetafterharvestofplaitcodeletternumber,thedepartmenttasseledsetwhenshippedwithprojectofATVIIIIXCVIIsinglechipmicrocomputerexternalinterruptiontoreceive,signalthefallingedgeoftrigger
externalinterruption.Inordertorecognizeacompletekeysignal,mustforeachcodingpulsewidthweremeasuredwithdiscriminantreceivesthepulseis!0still!I.?,themicrocontrollertimer/countertomeasuringpulsewidth.Timer/counterexcept?pointsthancanbeset,fromexceptIItoexceptII0IVVIII,measurablepulsewidthcanreachV00ms.ThispapersetexceptpointsforI.II,namelythanI.IIpointsfrequency,becausetheexternalclockisaboutI.IIMHz,clockcycleforI.s,sothetimer/counterforI.pertimingonces.
II.Valarmmoduledesign
AlarmmodulecorechipI.I.0IC,canchooseapplicationinautomobile,motorcycle,alarms,personalriotdevice,doormagneticalarmdeviceandetc.
III.Systemsoftwaredesign
Thissystemsoftwaremodularstructure,themainprogram,initialanti-fuzzyprocedures,interruptsubroutines,delaysubroutines,buttonspronunciationsubroutines,buttonsscanningsubroutinesconstitutes.
III.I.tracingsubroutinesdesign
Tracingmoduleisdesignedbytheleftrightphotoelectricsensoroutputterminalreceivingmonolithicmachinerespectively,PIIIIandPIIIIItubefeet,thenthroughthemicrocontrollerprogramming,producePWMcontrolsignal,throughLIIIXVIIIcontrolmotorspeed,letthecartomoveforward,leftturn,turnrightandstopdrivingpurpose.
III.IIavoidbarrierofprogramming
ObstacleavoidancemoduleisdesignedbytheinfraredreflectionsensormodulearoundtheoutputterminalreceivingMCUrespectivelyPII0andPIII.tubefeet,thenthroughthemicrocontrollerprogramming,producePWMcontrolsignal,throughLIIIXVIIIcontrolmotorspeed,letthecartomoveforward,leftturn,turnrightandstopdrivingpurpose.
III.IIIremotesubroutinesdesign
RemotecontrolmoduleisdesignedbytheinfraredsensorI.VIIIIIIVIIIanoutputterminalofthereceivingMCUPIIIIItubefeet,thenuseall-purposeremotecontrolontheremotecontrol,thenletmicrocontrollerdecoding,producePWMcontrolsignal,throughLIIIXVIIIcontrolmotorspeed,letthecartomoveforward,leftturn,turnrightandstopdrivingpurpose.
IV.Summary
Adoptssinglechip,usingphotoelectricsensorandinfraredreflectionsensorwasdesignedasadetectionsystem,canrealizeautomatichominglinetowalk,automaticobstacleavoidance,alarmandremotecontrolfunctionssuchasintelligentcar.Thisdesignistheobviousadvantagesofsimplecircuit,reliability,lowcost,andveryeasytofunctionoffurtherperfectingandexpansion
版权保护: 本文由 hbsrm.com编辑,转载请保留链接: www.hbsrm.com/lwqt/wxzs/153.html