FreescaleCupNationalUndergraduateSmartcarcontestChapter1IntroductionNationalCollegeStudents'smartcarcompetitionistheMinistryofEducationinordertostrengthenstudents'practicalandinnovativecapacityandthecultivationofteamspiritandsetup.Thecompetitionisdifferentandhasheldnationalprofessionalcompetitionsofmathematicalmodeling,electronicdesign,mechanicaldesign,structuraldesignisbasedontherapiddevelopmentofautomotiveelectronicsbackground,coversthecontrol,patternrecognition,sensortechnology,electronics,electrical,computer,machineryandothermulti-disciplinarytechnologyandcreativegame.Inthiscompetition,theCompetitionOrganizingCommitteeracecarmodel,Freescale16themicrocontrollerMC9S12XS128asthecorecontrolunit,independentideaofthecontrolprogramandsystemdesign,includingthesensorsignalacquisitionandprocessing,controlalgorithmsandexecutionofpowermotordrive,steeringgearcontrol,etc.,andultimatelyasetofself-identificationroute,andinreal-timeoutputbodystateofintelligentvehiclecontrolhardwaresystems.Inthispaper,abriefdescriptionoftheCarsoftheoveralldesignconcept,hardwareandsoftwaredesignandcarmodelsintheassemblydebuggingprocess.thesystemdesignrequirementsanddemonstrationprogram2.1SystemdesignrequirementsThisgamerequiresallteamstothecompetitionprovidedbytheSecretariatunifiedthemicrocontrollerMC9S12XS128developmentboard(canalsobeusedMC9SXS128homemadecontrolboard),thedevelopmentofsoftware,CodeWarrior,andon-linedebuggingtool,Carsplatformonthebasisoftheunifieddesigncanself-identificationlinesmartcarautomaticallyrecognizestheroadinaspeciallydesignedrunway.Thecarinaccordancewithtracingtheblackline,thefinalresultsofthefinaldistrictgameisdecidedbythetimeresultsandreportingscores,thescorecalculationisgivenbythefollowingformula:Thefinalscoreofthegameis(inseconds)=Ts*(1-0.01R)WhereTsisthecarthefastestlaptime(inseconds);Risthetechnicalreportscore(scorerange0-10).2.2SystemdesignSystemconsistsofroadrecognitionmodule,speedsensormodule,controlmodule,servodrivemodule,motordrivermodule.BlockdiagraminFigure2.1areasfollows:ThedesignofthetotalblockdiagraminFigure2.1Betweeneachmoduleisonlyagoodblendtomakeamodelcarstableandfasttofinish.2.2.1huntwayGoodhuntistoensurethatthebasisofthemodelcarsteadyandrapidrunthiscompetition,wespendthemosttimeandeffort.Astheteamstoparticipateinthephotoelectricgroup,limitingthecameralensimagingprinciple,thebiggestadvantageofthecameraistheforwarddistancefarandwide,hasadecisiveroleinthecontrolofmodelcarwhentheforward-lookingdistanceincreases,inpracticewealsofoundthat:simplyincreasetheforward-lookingdistanceisofnouse,wefeelthattoimprovetheforward-lookingdistancemustalsoimprovetherangeofforward-lookingcameraisnotfar-sightedbutWhattoseesuchforward-lookingbeforeeffective.Thisteamhasalargenumberofphotoelectricsensorsonthemarketroadtotest,whichsummeduptheadvantagesanddisadvantagesofeachsensor.Thefinalselectionofthelargelens,thelasertube,accordingtotheexperimentallymeasuredobtainingtheforward-lookingupto80cm.2.2.2ThemotordrivemoduleMostoftheteamforthemotordrivemoduleintegratedmotordriverchipMC33886recommendedbytheCompetitionOrganizingCommittee.Theadvantageisthestrongdrivecapability,smallsizeandsimpleexternalcircuit,easytouse,itisconsistentwiththeneedsofthesystem.Thedrawbackismoreexpensive,notverygoodbuy,andtheMC33886on-resistanceisrelativelylarge,canbemulti-chipusedinparallel,butthisincreaseinthePCBareaandcomponentcost,whiletheMC33886internalover-currentprotectioncircuittolimitaccelerationwhenthespeedofamodelcarandthefastestspeed,resultinginastraightlinerunningatfulldutycycleuptolessthanweexpectedhigh-speed,accordingtopracticeindependentlydesignedcircuit,andtheperformanceandpowerconsumptionwillnotbeinferiorintheMC33886.ThefinalselectionofH-bridgefull-bridgecircuit,canbeverygoodtoreachthemotor-driveneffects.2.2.3speeddetectionmoduleSpeeddetectionmoduleprogram,andeachprogramislittledifferenceinperformance,acoverCD-ROM-basedinfraredsensorontheradiospeed,Halleffectsensors,infraredreflectancespeedsensorofthedifferentialsideofthechuck,specialphotoelectricencoder.Webelievethatthemostimportantthingisthespeedsensorissimpleandstable,theteameventuallytodesignthecodedisk,throughpractice,entirelyfeasible.2.2.3ThemastermoduleLimitedinthisgameusethemicrocontrollerMC9S12XS128onlyasthemaincontrolmoduleprocessor,youcanusetheHCS12MCUmoduleprovidedbytheCompetitionOrganizingCommitteecanalsobeusedMC9SXS128homemadesingle-chipcontrolcircuitboard.Wedecidedtodesignthemaincontrolmodule,andtherationaluseoftheinterfacearrangementsinterfacelayout,whichreducestheareaofthemaincontrolboard,toreducetheweightofthecar,atthesametimetheconnectionbetweenthemodulealsoappearsorderly.2.3system,thefinalprogramA.Self-designedmasterdevelopmentboardmodule.Two.Self-designedmotordriveandbrakemodules.3.Professionalencoderdiskasaspeeddetectionmodule.4.Lasertubeandalargelenstohunt.TheoveralleffectisshowninFigure2.7:Figure2.7modelcarrenderingsThesmartcarmechanicaldesignVehicledesignprinciplesoflight,whilethemaximumextentpossibletoreducethecenterofgravityandcenterofgravityslightlyrearw