




已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
外文原文IntroductionControllerAreaNetwork(CAN)wasinitiallycreatedbyGermanautomotivesystemsupplierRobertBoschinthemid-1980sforautomotiveapplicationsasamethodforenablingrobustserialcommunication.Thegoalwastomakeautomobilesmorereliable,safeandfuel-efficientwhiledecreasingwiringharnessweightandcomplexity.Sinceitsinception,theCANprotocolhasgainedwidespreadpopularityinindustrialautomationandautomotive/truckapplications.Othermarketswherenetworkedsolutionscanbringattractivebenefitslikemedicalequipment,testequipmentandmobilemachinesarealsostartingtoutilizethebenefitsofCAN.ThegoalofthisapplicationnoteistoexplainsomeofthebasicsofCANandshowthebenefitsofchoosingCANforembeddedsystemsnetworkedapplications.CANOverviewMostnetworkapplicationsfollowalayeredapproachtosystemimplementation.Thissystemeticapproachenablessinteroperabilitybetweenproductsfromdifferentmanufacturers.AstandardwascreatedbytheInternationalStandardsOrganization(ISO)asatemplatetofollowforthislayeredapproach.ItiscalledtheISOOpenSystemsInterconnection(OSI)NetworkLayeringReferenceModel.TheCANprotocolitselfimplementsmostofthelowertwolayersofthisreferencemodel.ThecommunicationmediumportionofthemodelwaspurposelyleftoutoftheBoschCANspecificationtoenablesystemdesignerstoadaptandoptimizethecommunicationprotocolonmultiplemediaformaximumflexibility(twistedpair,singlewire,opticallyisolated,RF,IR,etc.).Withthisflexibility,however,comesthepossibilityofinteroperabilityconcerns.Toeasesomeoftheseconcerns,theInternationalStandardsOrganizationandSocietyofAutomotiveEngineers(SAE)havedefinedsomeprotocolsbasedonCANthatincludetheMediaDependentsInterfacedefinitionsuchthatallofthelowertwolayersarespecified.ISO11898isastandardforhigh-speedapplications,ISO11519isastandardforlow-speedapplications,andJ1939(fromSAE)istargetedfortruckandbusapplications.Allthreeoftheseprotocolsspecifya5Vdifferentialelectricalbusasthephysicalinterface.TherestofthelayersoftheISO/OSIprotocolstackarelefttobeimplementedbythesystemsoftwaredeveloper.HigherLayerProtocols(HLPs)aregenerallyusedtoimplementtheupperfivelayersoftheOSIReferenceModel.HLPsareusedto:1)Standardizestartupproceduresincludingbitratesused,2)Distributeaddressesamongparticipatingnodesortypesofmessages,3)Determinethestructureofthemessages,and4)Providesystem-levelerrorhandlingroutines.ThisisbynomeansafulllistofthefunctionsHLPsperform;howeveritdoesdescribesomeoftheirbasicfunctionality.CANProtocolBasicsCarrierSenseMultipleAccesswithCollisionDetection(CSMA/CD)TheCANcommunicationprotocolisaCSMA/CDprotocol.TheCSMAstandsforCarrierSenseMultipleAccess.Whatthismeansisthateverynodeonthenetworkmustmonitorthebusforaperiodofnoactivitybeforetryingtosendamessageonthebus(CarrierSense).Also,oncethisperiodofnoactivityoccurs,everynodeonthebushasanequalopportunitytotransmitamessage(MultipleAccess).TheCDstandsforCollisionDetection.Iftwonodesonthenetworkstarttransmittingatthesametime,thenodeswilldetectthecollisionandtaketheappropriateaction.InCANprotocol,anondestructivebitwisearbitrationmethodisutilized.Thismeansthatmessagesremainintactafterarbitrationiscompletedevenifcollisionsaredetected.Allofthisarbitrationtakesplacewithoutcorruptionordelayofthehigherprioritymessage.Thereareacoupleofthingsthatarerequiredtosupportnon-destructivebitwisearbitration.First,logicstatesneedtobedefinedasdominantorrecessive.Second,thetransmittingnodemustmonitorthestateofthebustoseeifthelogicstateitistryingtosendactuallyappearsonthebus.CANdefinealogicbit0asadominantbitandalogicbit1asarecessivebit.Adominantbitstatewillalwayswinarbitrationoverarecessivebitstate,thereforethelowerthevalueintheMessageIdentifier(thefieldusedinthemessagearbitrationprocess),thehigherthepriorityofthemessage.Asanexample,supposetwonodesaretryingtotransmitamessageatthesametime.Eachnodewillmonitorthebustomakesurethebitthatitistryingtosendactuallyappearsonthebus.Thelowerprioritymessagewillatsomepointtrytosendarecessivebitandthemonitoredstateonthebuswillbeadominant.Atthatpointthisnodelosesarbitrationandimmediatelystopstransmitting.Thehigherprioritymessagewillcontinueuntilcompletionandthenodethatlostarbitrationwillwaitforthenextperiodofnoactivityonthebusandtrytotransmititsmessageagain.Message-BasedCommunicationCANprotocolisamessage-basedprotocol,notanaddressbasedprotocol.Thismeansthatmessagesarenottransmittedfromonenodetoanothernodebasedonaddresses.EmbeddedintheCANmessageitselfisthepriorityandthecontentsofthedatabeingtransmitted.Allnodesinthesystemreceiveeverymessagetransmittedonthebus(andwillacknowledgeifthemessagewasproperlyreceived).Itisuptoeachnodeinthesystemtodecidewhetherthemessagereceivedshouldbeimmediatelydiscardedorkepttobeprocessed.Asinglemessagecanbedestinedforoneparticularnodetoreceive,ormanynodesbasedonthewaythenetworkandsystemaredesigned.Forexample,anautomotiveairbagsensorcanbeconnectedviaCANtoasafetysystemrouternodeonly.Thisrouternodetakesinothersafetysysteminformationandroutesittoallothernodesonthesafetysystemnetwork.Thenalltheothernodesonthesafetysystemnetworkcanreceivethelatestairbagsensorinformationfromtherouteratthesametime,acknowledgeifthemessagewasreceivedproperly,anddecidewhethertoutilizethisinformationordiscardit.AnotherusefulfeaturebuiltintotheCANprotocolistheabilityforanodetorequestinformationfromothernodes.ThisiscalledaRemoteTransmitRequest(RTR).Thisisdifferentfromtheexampleinthepreviousparagraphbecauseinsteadofwaitingforinformationtobesentbyaparticularnode,thisnodespecificallyrequestsdatatobesenttoit.Oneadditionalbenefitofthismessage-basedprotocolisthatadditionalnodescanbeaddedtothesystemwithoutthenecessitytoreprogramallothernodestorecognizethisaddition.Thisnewnodewillstartreceivingmessagesfromthenetworkand,basedonthemessageID,decidewhethertoprocessordiscardthereceivedinformation.CANMessageFrameDescriptionCANprotocoldefinefourdifferenttypesofmessages(orFrames).ThefirstandmostcommontypeofframeisaDataFrame.Thisisusedwhenanodetransmitsinformationtoanyorallothernodesinthesystem.SecondisaRemoteFrame,whichisbasicallyaDataFramewiththeRTRbitsettosignifyitisaRemoteTransmitRequest.Theothertwoframetypesareforhandlingerrors.OneiscalledanErrorFrameandoneiscalledanOverloadFrame.ErrorFramesaregeneratedbynodesthatdetectanyoneofthemanyprotocolerrorsdefinedbyCAN.Overloaderrorsaregeneratedbynodesthatrequiremoretimetoprocessmessagesalreadyreceived.DataFramesconsistoffieldsthatprovideadditionalinformationaboutthemessageasdefinedbytheCANspecification.EmbeddedintheDataFramesareArbitrationFields,ControlFields,DataFields,CRCFields,a2-bitAcknowledgeFieldandanEndofFrame.TheArbitrationFieldisusedtoprioritizemessagesonthebus.SincetheCANprotocoldefinesalogical0asthedominantstate,thelowerthenumberinthearbitrationfield,thehigherprioritythemessagehasonthebus.Thearbitrationfieldconsistsof12-bits(11identifierbitsandoneRTRbit)or32-bits(29identifierbits,1-bittodefinethemessageasanextendeddataframe,anSRRbitwhichisunused,andanRTRbit),dependingonwhetherStandardFramesorExtendedFramesarebeingutilized.ThecurrentversionoftheCANspecification,version2.0B,defines29-bitidentifiersandcallsthemExtendedFrames.PreviousversionsoftheCANspecificationdefined11-bitidentifierswhicharecalledStandardFrames.Asdescribedintheprecedingsection,theRemoteTransmitRequest(RTR)isusedbyanodewhenitrequiresinformationtobesenttoitfromanothernode.ToaccomplishanRTR,aRemoteFrameissentwiththeidentifieroftherequiredDataFrame.TheRTRbitintheArbitrationFieldisutilizedtodifferentiatebetweenaRemoteFrameandaDataFrame.IftheRTRbitisrecessive,thenthemessageisaRemoteFrame.IftheRTRbitisdominant,themessageisaDataFrame.TheControlFieldconsistsofsixbits.TheMSBistheIDEbit(signifiesExtendedFrame)whichshouldbedominantforStandardDataFrames.ThisbitdeterminesifthemessageisaStandardorExtendedFrame.InExtendedFrames,thisbitisRB1anditisreserved.ThenextbitisRB0anditisalsoreserved.ThefourLSBsaretheDataLengthCode(DLC)bits.TheDataLengthCodebitsdeterminehowmanydatabytesareincludedinthemessage.ItshouldbenotedthataRemoteFramehasnodatafield,regardlessofthevalueoftheDLCbits.TheDataFieldconsistsofthenumberofdatabytesdescribedintheDataLengthCodeoftheControlField.TheCRCFieldconsistsofa15-bitCRCfieldandaCRCdelimiter,andisusedbyreceivingnodestodetermineiftransmissionerrorshaveoccurred.TheAcknowledgeFieldisutilizedtoindicateifthemessagewasreceivedcorrectly.Anynodethathascorrectlyreceivedthemessage,regardlessofwhetherthenodeprocessesordiscardsthedata,putsadominantbitonthebusintheACKSlotbittimeThelasttwomessagetypesareErrorFramesandOverloadFrames.WhenanodedetectsoneofthemanytypesoferrorsdefinedbytheCANprotocol,anErrorFrameoccurs.OverloadFramestellthenetworkthatthenodesendingtheOverloadFrameisnotreadytoreceiveadditionalmessagesatthistime,orthatintermissionhasbeenviolated.Theseerrorswillbediscussedinmoredetailinthenextsection.Fast,RobustCommunicationBecauseCANwasinitiallydesignedforuseinautomobiles,aprotocolthatefficientlyhandlederrorswascriticalifitwastogainmarketacceptance.Withthereleaseofversion2.0BoftheCANspecification,themaximumcommunicationratewasincreased8xovertheversion1.0specificationto1Mbit/sec.Atthisrate,eventhemosttime-criticalparameterscanbetransmittedseriallywithoutlatencyconcerns.Inadditiontothis,theCANprotocolhasacomprehensivelistoferrorsitcandetectthatensurestheintegrityofmessages.CANnodeshavetheabilitytodeterminefaultconditionsandtransitiontodifferentmodesbasedontheseverityofproblemsbeingencountered.Theyalsohavetheabilitytodetectshortdisturbancesfrompermanentfailuresandmodifytheirfunctionalityaccordingly.CANnodescantransitionfromfunctioninglikeanormalnode(beingabletotransmitandreceivemessagesnormally),toshuttingdowncompletely(bus-off)basedontheseverityoftheerrorsdetected.ThisfeatureiscalledFaultConfinement.NofaultyCANnodeornodeswillbeabletomonopolizeallofthebandwidthonthenetworkbecausefaultswillbeconfinedtothefaultynodesandthesefaultynodeswillshutoffbeforebringingthenetworkdown.ThisisverypowerfulbecauseFaultConfinementguaranteesbandwidthforcriticalsysteminformation.ConclusionTheCANprotocolwasoptimizedforsystemsthatneedtotransmitandreceiverelativelysmallamountsofinformation(ascomparedtoEthernetorUSB,whicharedesignedtomovemuchlargerblocksofdata)reliablytoanyorallothernodesonthenetwork.CSMA/CDallowseverynodetohaveanequalchancetogainaccesstothebus,andallowsforsmoothhandlingofcollisions.Sincetheprotocolismessage-based,notaddressbased,allmessagesonthebusreceiveeverymessageandacknowledgeeverymessage,regardlessofwhetherinneedsthedataornot.Thisallowsthebustooperateinnode-to-nodeormulticastmessagingformatswithouthavingtosenddifferenttypesofmessages.Fast,robustmessagetransmissionwithfaultconfinementisalsoabigplusforCANbecausefaultynodeswillautomaticallydropoffthebusnotallowinganyonenodefrombringinganetworkdown.Thiseffectivelyguaranteesthatbandwidthwillalwaysbeavailableforcriticalmessagestobetransmitted.WithallofthesebenefitsbuiltintotheCANprotocolanditsmomentumintheautomotiveworld,othermarketswillbegintoseeandimplementCANintotheirsystems.中文翻译简介控制器区域网络(CAN)的最初创建者是80年代中期的德国汽车系统供应商罗伯特博世,作为汽车应用启用强大的串行通信的方法。其目标是让汽车更可靠,安全,省油同时减少线束的重量和复杂性。公司自成立以来,已取得了CAN协议广泛普及和其在工业自动化汽车/卡车方面的应用。该总线在其他市场网络解决方案一样能够带来强有力的利润,例如医疗设备,测试设备和移动机器也开始利用CAN总线的优势。本文的目的是解释一些CAN的基本知识,和选择CAN通信作为嵌入式系统网络应用的好处。CAN总线概述大多数网络应用程序遵循分层方法实施。这一系统的方法使不同产品之间的制造商共同创建一个标准的国际标准化组织(ISO)的为模板遵循这种分层方法。这就是所谓的国际标准组织开放系统互连(OSI)网络分层参考模型。CAN协议本身实现了较低的最基本参考模型层的通信模型中的一部分,是故意忽略CAN规范,使系统设计调整和优化的通信协议最大程度的灵活性(双绞线多种媒体,单丝,光隔离,射频,红外线等)。有了这个灵活性,但是,随之而来的互操作的可能性成为关注。为了缓解这些问题一些国际标准组织与国际汽车工程师学会(SAE)在原来的基础上定义了一些在CAN协议基础上的定义,这包括在指定两个底层媒体独立接口的定义。ISO11898是一个用于高速应用的标准,ISO11519是一个低速应用标准,J1939的(从SAE)对象是卡车和总线的应用。所有这些协议的物理接口指定为一个5V的差分电气总线。其余剩下ISO/OSI协议栈层由系统软件开发商来实现,更高一层的协议(HLPs)一般用来实现上面五层的OSI参考模型。HLPs用于:1)规范程序,包括比特率启动使用时,2)参与节点之间分配地址消息或类型,3)确定的消息结构,4)提供系统级的错误处理例程。这绝不是一个执行的职能HLPs完整列表,但它确实描述了他们的基本的一些功能。CAN总线协议基础载波侦听多路访问冲突检测(CSMA/CD)CAN通讯协议是CSMA/CD协议,CSMA代表载波侦听多路访问。这意味着,每一个网络节点在尝试往总线上发送一个消息期间,必须监测总线并保证总线处于不活动状态(载波监听);另外,当总线处于空闲状态,总线上的每一个节点传输消息的机会是平等的(多址接入)。CD代表冲突检测。如果两个网络上的节点在同一时间开始发送数据,节点将检测到冲突并采取适当的行动。在CAN协议中,利用无损逐位仲裁的方法。这也就是说,即使完成冲突检测,仲裁后消息仍然保持完整,所有这一切仲裁均无损坏或延误的最高优先级的消息。无损逐位仲裁的实现需要两个条件。第一,逻辑状态必须定义为显性或隐性。第二,发送节点必须监视总线状态,以此观察正在试图发送到总线上的实际逻辑状态。CAN总线定义为一个逻辑显性位0和逻辑隐性位1。一个显性位的状态总能仲裁隐性位的状态,因此,较低的消息标识符值(消息中的仲裁过程中使用的字段),消息的优先级越高。例如,假设两个节点试图在同一时间发送消息。每个节点会监察总线,以保证它正试图发送的位确确实实出现在总线上。较低的优先级的消息将在某个点尝试发送一个隐性位,并监视总线状态使自己成为主节点。此时,这个节点失去仲裁,并立即停止发送。更高的优先级消息将持续发送直到完成,失去仲裁的节点将等待总线的下一个空闲周期,并尝试发送数据。基于消息的通信CAN协议是一个基于消息的协议,而不是一个基于地址的协议,这意味着消息不能从一个节点地址传送到另一个节点地址上。嵌入式CAN消息本身就是优先和正在传输数据的内容。所有系统中的节点将接收每个传递在总线上的消息(如果消息正确接收并确认)。它是由系统的每个节点决定是否将接收到的数据立即丢弃还是保存处理。一个单一的消息可以设计成指定接受一个特定的节点,或许多建立在网络和系统上的节点。例如,汽车安全气囊传感器只能通过CAN连接到安全系统的路由器节点,此路由器节点接收其他系统安全信息并转发到安全系统网络的其他节点上。安全系统网络上的所有其他节点可以在同一时间从路由器上收到最新的安全气囊传感器的信息,确认是否被正确接收后,决定是否利用这些信息,或遗弃它。另外一个内置在CAN协议中的有用的特性是,可以要求一个节点向另一个节点发送消息,这就是所谓的远程发送请求(RTR)。这个与前面的例子不同,因为,此时节点在等待一个特定的节点的消息,这个特定节点发出的消息是被动的。这种基于消息的协议的一个额外的好处是,可以添加额外的节点,系统没有必要对所有其他节点进行重新编程,也可以识别这个节点。这个新的节点将开始接收来自网络的消息,根据消息ID,决定是否要处理或丢弃收到的信息。CAN消息帧描述CAN协议定义了四种不同类型的信息(或帧)。第一个也是最常见的类型是数据帧,这是用来当一个节点发送信息系统中的任何或所有其他节点;二是远程帧,这基本上是一个用来设置表示,它是一个远程发送请求RTR位的数据帧。其他两个错误处理的帧,一个为错误帧和一个为过载帧。检测出CAN协议定义的错误都将产生错误帧,产生超载错误的节点,需要更多的时间来处理已经接收的数据。数据帧中包括的有关数据信息的额外字段由CAN定义规范,数据帧中嵌入
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 电脑代理销售合同范本
- 私人饭店厨房合同范本
- 湖北施工合同补充协议
- 矿山巷道掘进合同范本
- 租车合作框架合同范本
- 设备技术改造合同范本
- 软件系统实施合同范本
- 购买抖音账号合同范本
- 活动板建设房合同范本
- 转让出售钻机合同范本
- 煤矿安全规程2025版解读
- 监狱公选面试题库及答案
- 尿培养的采集
- 具有法律效应的还款协议书6篇
- 东航空乘英语考试题目及答案
- 2025绿植租赁协议(简易版)
- T-AOPA0062-2024电动航空器电推进系统动力电机控制器技术规范
- 《三级工学一体化师资培训》课件-第四课:教学活动策划
- 2025年全国企业员工全面质量管理知识竞赛题及参考答案
- 2025年秋季开学典礼诗歌朗诵稿:纪念抗战胜利八十周年
- 2025年广东省中考英语试卷深度评析及2026年备考策略
评论
0/150
提交评论