CAN网络培训
- 格式:pptx
- 大小:5.30 MB
- 文档页数:45
1.介绍CAN 只定义物理层和数据链路层,没有规定应用层,本身并不完整,需要一个高层协议来定义CAN 报文中的11/29 位标识符、8 字节数据的使用。
而且,基于CAN 总线的工业自动化应用中,越来越需要一个开放的、标准化的高层协议:这个协议支持各种CAN 厂商设备的互用性、互换性,能够实现在CAN网络中提供标准的、统一的系统通讯模式,提供设备功能描述方式,执行网络管理功能。
2.对象字典(OD)对象字典是一个有序的对象组,每一个对象组采用一个16位的索引和一个8位的子索引来寻址。
the Object Dictionary serves as aninterface between the communicationand the application.对象字典中索引的分类3.NMT状态机3.1.心跳报文(Heartbeat)一个节点可以被配置为心跳报文的生产者,Heartbeat的消费者一般是主站3.2.NMT Boot-upNMT-Slave发布Boot up 报文通知NMT 主节点它已经从initialising状态进入pre-operational 状态3.3.节点保护/寿命保护NMT主节点发送远程帧NMT从节点响应远程帧数据部分包括一个触发位(bit7),触发位必须在每次节点保护应答中交替置“0”或者“1”。
触发位在第一次节点保护请求时置为“0”。
位0 到位6(bits0~6)表示节点状态,可为下表中的数值。
带*号的只有在支持Bootup的节点才提供,状态0不在节点保护应答中出现,因为节点在此状态下不应答节点保护报文。
4.周期性过程数据(PDO)传输方式1、事件驱动当输入值发生变化时,数据立即被发送出去2、远程请求PDO由远程帧触发,大部分设备不支持远程帧,且CIA组织不推荐使用。
3、同步传输RPDO:先接收到数据,但不更新到设备,只有接收到同步帧出发后,才更新,通过这种方式实现同步。
CAN总线直接OSEK网络管理规范培训资料概述CAN总线是一种串行通信协议,广泛应用于汽车电子系统和工业控制等领域。
OSEK是针对分布式实时嵌入式系统设计的开放式操作系统规范,提供了一套标准化的任务调度、进程间通信、网络管理等机制,被广泛用于汽车电子系统中。
本文档面向初学者,介绍CAN总线直接OSEK网络管理规范的基本概念和实现细节。
CAN总线数据帧格式CAN总线使用数据帧进行通信,每个数据帧包含一个ID、一个控制位和8个数据位。
ID是11位或29位,用于标识发送方和接收方。
控制位包括一个RTR位和一个IDE位,用于标识数据是否是远程请求或扩展帧。
帧发送和接收CAN总线的通信基于广播的方式,所有节点都能够接收到所有的数据帧。
发送端将数据帧发送到总线上,接收端通过ID过滤器选出感兴趣的数据帧进行接收。
如果多个节点同时发送数据帧,则会发生冲突,此时会采用非常规算法进行冲突解决。
性能参数CAN总线的性能参数包括通信速率、错误检测、事件触发等。
通信速率可以达到1Mbps,错误检测包括CRC检验和ACK确认,若出现错误会触发错误标志。
事件触发包括总线错误、总线超时和总线关闭等。
OSEK网络管理OSEK网络体系结构OSEK网络体系结构分为基础体系结构和扩展体系结构两部分。
基础体系结构包括任务管理、队列管理、事件管理和消息管理等,扩展体系结构包括内存管理、定时器管理、网络协议等。
任务是OSEK中最基本的执行单元,每个任务都有一个优先级和一个固定的执行周期。
任务可以在任何时候被抢占,根据优先级高低进行调度。
任务可以通过事件标志、定时器和消息队列等机制进行通信和同步。
进程间通信OSEK中的进程间通信有多种方式,包括信号量、事件标志、消息队列、共享内存和邮箱等。
每种方式都有其特定的使用场景和限制,需要根据具体情况选择合适的方法。
网络管理OSEK网络管理规范定义了一套标准化的网络管理机制,包括网络节点的定义、节点状态的管理、多节点通信的管理等。
insert picture8cm x 7cm Direct OSEK Network Management©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.AgendaP hysical Basics B asics Mechanisms S tructure of Animation S etup of a RING T ransition to BUS SLEEP T he LIMPHOME StateA New Node in a Running Network L oss of a Node in the Network O SEK NM State MachineB us error –BUS OFF Physical BasicsModern Vehicle withLowspeed and HighspeedCAN bus (and gatewaysto other bus systems)CAN HighspeedCAN LowspeedLINFlexRayMOST©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.Quiescent current consumption (ECU Sleep mode) of the ECUs is a very important topic in the automotive environmentThe ECUs have different requirements for transition to ECU Sleep modeControlled transition to ECU Sleep modeThere are several methods of resolution for these problems >>Security ControlSeat ControlClimate Control3 ECUs in the CAN network as an example1. Method of resolution: ECUs connected directly with the Clamp 15KL15VCC©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.VCCShould be working all the time to detect Basically 3 kinds of ECUsKL151. Method of resolution:ECUs connected directly with the Clamp 15100%KL30KL15Power2. Method of resolution: ECUs connected directly with the Clamp 30©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.3. Method of resolution: ECUs connected directly with theClamp 30 and a NetworkManagement is used100%KL30PowerKL15©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.100%KL30Power3. Method of resolution:ECUs connected directly with the Clamp 30 and a Network Management is usedKL15100%KL30Power3. Method of resolution: ECUs connected directly with the©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.100%KL30Power3. Method of resolution: ECUs connected directly with the©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.SummaryDistinguish between the Network Management state BUS SLEEP and the ECU is switched off or in low power modeBUS SLEEP is the necessary condition for an ECU to go to low power mode or to switch off the ECU.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.AgendaPhysical Basics B asics Mechanisms S tructure of Animation S etup of a RING T ransition to BUS SLEEP T he LIMPHOME StateA New Node in a Running Network L oss of a Node in the Network O SEK NM State MachineB us error –BUS OFF Basics MechanismsBasic Mechanisms –Tasks of the Network ManagementControl Transition to Bus Sleep ModeDetermination of Net ConfigurationMonitoring of Configuration During OperationPrepare Status InformationBus-Off Handling©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.Basic Mechanisms –NM MessageByte 0Byte 1Appearance in following animation sequencesByte 2 -7Sleep Acknowledge Sleep Indication LimpHomeRing AliveComplete Network Management MessageA direct Network Management has its own Network Management MessagesBase address depends on OEMBasic Mechanisms -How does the Ring WorkOSEK Network Management uses the Token-Ring Mechanism (see notes).The Token is passed to the ECUs with the next higher number via the destination opCode. If there is no next higher number, the token passes to the ECU with the lowest number.The Ring is build-up according to the numbers of the ECUs.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.Basic Mechanisms -Broadcast MechanismEach message is received from all participating ECUs. Only the addressed ECU will interpret the NM Message and receives the Token.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.AgendaPhysical Basics Basics Mechanisms S tructure of Animation S etup of a RING T ransition to BUS SLEEP T he LIMPHOME StateA New Node in a Running Network L oss of a Node in the Network O SEK NM State MachineB us error –BUS OFF Structure of Animation©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.AgendaPhysical Basics Basics Mechanisms Structure of Animation S etup of a RING T ransition to BUS SLEEP T he LIMPHOME StateA New Node in a Running Network L oss of a Node in the Network O SEK NM State MachineB us error –BUS OFF Setup of a RINGSetup of a RING -WakeUp of the ECUs7Wake©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.AgendaSetup of a RING T ransition to BUS SLEEP T he LIMPHOME StateA New Node in a Running Network L oss of a Node in the Network O SEK NM State MachineB us error –BUS OFF Transition to BUS SLEEP Physical Basics Basics Mechanisms Structure of AnimationTransition to BUS SLEEP –First AttemptGotoMode(BusSleep)©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.GotoMode(BusSleep)©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.TTmultiple applications in one ECU that have to use©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.Multiple Independent ApplicationsRepresents an independent softwareapplication in an ECU.Situation:n Applications use 1 Resource >>©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.n Applications use one Bus (e.g. n=2)Without SynchronizationWith SynchronizationThis synchronization has to be done by the application now More about this in the CCL part.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.AgendaTransition to BUS SLEEP T he LIMPHOME StateA New Node in a Running Network L oss of a Node in the Network O SEK NM State MachineB us error –BUS OFF The LIMPHOME State Setup of a RING Physical Basics Basics Mechanisms Structure of Animation©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.Without Network Management DLL. The NM Messages will beacknowledged (from CAN side)But there is no other node participating in the Network.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.Without Network Management DLL. The NM Messages will beacknowledged (from CAN side)But there is no other nodeparticipating in the Network.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.Without Network Management DLL. The NM Messages will beacknowledged (from CAN side)But there is no other node participating in the Network.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.Without Network Management DLL.The NM Messages will beacknowledged (from CAN side)But there is no other node participating in the Network.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.Without Network Management DLL. The NM Messages will beacknowledged (from CAN side)But there is no other node participating in the Network.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.Without Network Management DLL. The NM Messages will beacknowledged (from CAN side)But there is no other node participating in the Network.The LIMPHOME State –Transition to BUS SLEEP©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.AgendaThe LIMPHOME StateA New Node in a Running Network L oss of a Node in the Network O SEK NM State MachineB us error –BUS OFF A New Node in a Running Network Transition to BUS SLEEP Setup of a RING Physical Basics Basics Mechanisms Structure of Animation©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.©2006. Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.。