Controller Area Network CAN 6112021 1 Outline Introduction

  • Slides: 37
Download presentation
Controller Area Network CAN 6/11/2021 1

Controller Area Network CAN 6/11/2021 1

Outline • Introduction • ISO 11898 -1: 2015 ⁻ ⁻ ⁻ Layered architecture Implementation

Outline • Introduction • ISO 11898 -1: 2015 ⁻ ⁻ ⁻ Layered architecture Implementation variants Core concepts LLC sublayer/MAC/Physical layer description Fault confinement • CANopen • Available Designs • Power On Reset 6/11/2021 2

Introduction • Multi master priority based bus network • Non destructive message arbitration •

Introduction • Multi master priority based bus network • Non destructive message arbitration • Data is broadcasted to every node • Each node decides which messages are relevant to process • Robust error detection • Very flexible for configuration after deployment. E. g adding or removing new nodes • Auto switch-off defective nodes • Automatic retransmission • Differential signaling ( Immunity to noise ) • Data can be broadcasted as well as can be requested remotely. • Dominant logic is ‘ 0’ while ‘ 1’ is recessive 6/11/2021 3

6/11/2021 4

6/11/2021 4

ISO 11898 -1: 2015 • CAN ISO 11898: 2015 defines specifications for two layers

ISO 11898 -1: 2015 • CAN ISO 11898: 2015 defines specifications for two layers • Datalink Layer • Physical Layer Physcial Layer Datalink Layer PCS • Bit encoding • Bit decoding • Synchronization 6/11/2021 MAC • • LLCS Data encapsulation/de-capsulation • Acceptance filtering Frame coding • Overload notification Medium access management • Recovery management Error detection Error signaling Acknowledgment Serialization Deserialization 5

ISO 11898 -1: 2015 • Three different implementation options are available as per standard

ISO 11898 -1: 2015 • Three different implementation options are available as per standard 1. Classical CAN frame format is supported and the flexible data rate frame format is not tolerated 2. Classical CAN frame format is supported but flexible data rate frame format is tolerated 3. Both classical and flexible data rate frame format are supported Here not tolerated mean if flexible data frame format is used while it is not supported will cause generation of error frames Classical frame format: 1 Mbit/s and 8 bytes of data per frame Flexible frame format: >1 Mbit/s and up to 64 bytes of data per frame • Two options are available for Arbitration field. ⁻ Classic Base Frame Format ⁻ FD Base Frame Format ⁻ Classical Extended Frame Format ⁻ FD Extended Frame Format 6/11/2021 11 bit identifier Canakari design 29 bit identifier 6

ISO 11898 -1: 2015 SO Arbitration field F 11 bits = Base or 29

ISO 11898 -1: 2015 SO Arbitration field F 11 bits = Base or 29 bits = Extended Control Field Data field CRC field 4 DLC bits and Some other Control bits 8 bytes 15 bits EO F Classic Base/ Extended Frame Format SO Arbitration field F 11 bits = Base or 29 bits = Extended Control Field Data field CRC field 4 DLC bits and Some other control bits 8 – 64 bytes 17 / 21 bits CRC + 4 bits stuff count EO F FD Base/ Extended Frame Format 6/11/2021 7

ISO 11898 -1: 2015 Classic Base/ Extended Frame Format SOF = 1 dominant bit

ISO 11898 -1: 2015 Classic Base/ Extended Frame Format SOF = 1 dominant bit Arbitration field = 1 RTR bit / 3 bits (RTR, SRR, IDE) control field = 2 bits (ro, FDF) CRC = 1 bit delimiter ACK = 1 bit delimiter EOF = 7 recessive bits FD Base/ Extended Frame Format SOF = 1 dominant bit Arbitration field = 1 RRS bit/ 3 bits (RRS, SRR, IDE) control field = 5 bits (IDE, FDF, res, BRS, ESI) / 4 bits (FDF, res, BRS, ESI) CRC = 1 bit delimiter ACK = 1 bit delimiter EOF = 7 recessive bits 6/11/2021 8

ISO 11898 -1: 2015 • Four different types of frames are used on CAN

ISO 11898 -1: 2015 • Four different types of frames are used on CAN network Data Frame (DF): Used to carry data from a transmitter to all receivers Remote Frame (RF): Frame used by a node to request data from some other node using the same identifier Error Frame (EF): Transmitted by any node in case of detected bus error Overflow Frame (OF): Used to provide some delay in between DF & RF • Data frames and remote frames shall arbitrate for access to the bus • Conflict is resolved by arbitration, message with the highest priority gets access. In case of same ID DF always wins • Data frames and remote frames shall be separated from preceding frames by inter-frame space i. e. 3 bits • Frames marked as corrupted are retransmitted typically 17 – up to 31 nominal bit times • If a frame is not acknowledged it is marked as corrupted. • Depending on the number of error counts a node is put in error active, error passive and bus off state ( logically disconnected ) 6/11/2021 9

ISO 11898 -1: 2015 • LLC defines the upper part of the data link

ISO 11898 -1: 2015 • LLC defines the upper part of the data link layer. Following functions must be provided by LLC sublayer ⁻ Frame acceptance filtering ⁻ Overload notification ⁻ Recovery management Identifier field Format field DLC field LLC Data field LLC Sublayer Data Frame Identifier field Format field DLC field LLC Sublayer Remote Frame • Format field distinguishes between Classic/FD and Basic/Extended frames • DLC field defines number of bytes of data 6/11/2021 10

ISO 11898 -1: 2015 • MAC layer defines lower part of the Data link

ISO 11898 -1: 2015 • MAC layer defines lower part of the Data link layer ⁻ encapsulation/de-capsulation of transmit/receive data ⁻ Error detection and signaling ⁻ Management of transmit /receive medium access SOF Arbitration Control Data CRC ACK EOF MAC Data Frame SOF Arbitration Control CRC ACK EOF MAC Remote Frame • ACK bit is set to dominant by any node which receives correct frame. It doesn’t need to be the node which is supposed to receive data 6/11/2021 11

ISO 11898 -1: 2015 • MAC sublayer provides the following 5 error checks ⁻

ISO 11898 -1: 2015 • MAC sublayer provides the following 5 error checks ⁻ ⁻ ⁻ Bus monitoring Stuff rule check Frame check CRC check ACK check • Physical layer specification is further divided into three parts ⁻ Physical coding sublayer ⁻ Physical medium attachment ( not in this scope ) ⁻ Medium dependent interface ( not in this scope ) 6/11/2021 12

ISO 11898 -1: 2015 • Purpose of fault confinement is to make sure bus

ISO 11898 -1: 2015 • Purpose of fault confinement is to make sure bus is available all the time irrespective of faulty nodes • To make distinction between permanent and temporary failures • Switching off faulty nodes logically so that they are not allowed to send and receive data • According to fault confinement a node can be in three following states mentioned below ⁻ Error active • Transmit/receive error counter < 127 ⁻ Error passive • Transmit/receive error counter > 127 ⁻ Bus-off • Transmit error counter > 255 • Can return to active state upon restart/normal mode request and 128 occurrences of 11 consecutive recessive bits 6/11/2021 13

ISO 11898 -1: 2015 Node status Send Receive Ack Error frame Error active 6

ISO 11898 -1: 2015 Node status Send Receive Ack Error frame Error active 6 consecutive dominant bits Error passive (wait time) 6 consecutive recessive bits Bus-off Implementation dependent 6/11/2021 14

CANopen Application layer Presentation layer Session layer CANopen Application layer Transport layer Network layer

CANopen Application layer Presentation layer Session layer CANopen Application layer Transport layer Network layer • CANopen is device and manufacturer independent standard for communication between the devices on CAN network. Defined for application layer • Meets the physical and data link layer requirements of ISO 11898 : 2015 • Data is transferred between devices using already defined communication objects • Limits the number of devices to 127 on CAN network • To reduce communication overhead and make filtering easy, CANopen uses predefined identifiers • Provides mechanism for synchronization over CAN network 6/11/2021 15

CANopen device model • Application objects are the interface options/functionality on any device or

CANopen device model • Application objects are the interface options/functionality on any device or what is available to the user or process to interact with the device • Each communication object is indexed with the 16 bit address and 8 bit sub index (e. g for arrays) 6/11/2021 16

CANopen Three communication protocol models are used in CANopen • Master / Slave •

CANopen Three communication protocol models are used in CANopen • Master / Slave • Client / Server • Producer / Consumer • Master / Slave protocol At any time there can be only one Master in the network for a specific functionality all other nodes are slaves Slaves Master request Data Indication Unconfirmed 6/11/2021 17

CANopen Slave Master request Confirm RTR Data Indication Response confirmed • Client / Server

CANopen Slave Master request Confirm RTR Data Indication Response confirmed • Client / Server Client request Confirm 6/11/2021 Data Indication Response 18

CANopen • Producer / Consumer o Push Model same as Master / Slave unconfirmed

CANopen • Producer / Consumer o Push Model same as Master / Slave unconfirmed protocol except there can be more than one producers in the network o Pull Model same as Master / Slave confirmed protocol but there can be more than one consumers and RTR is generated by the consumers while response is generated by the producers • Transmission Modes • Synchronous Transmission • Event-Driven Transmission parameter of PDO defines if its synchronous or event driven SYNC object is transmitted periodically before synchronous PDOs 6/11/2021 19

CANopen Three different modes of message triggering • Event and Time Driven Message transmission

CANopen Three different modes of message triggering • Event and Time Driven Message transmission is started whenever there is some specified event or when a certain time has passed • Remotely Requested Message transmission starts on receiving RTR • Synchronously Triggered After transmission of SYNC or number of SYNCs Communication Objects 1. 2. 3. 4. 5. 6. Process Data Objects (PDO) Service Data Objects (SDO) Synchronization Object (SYNC) Time Stamp Object (TIME) Emergency Object (EMCY) Network Management (NMT) 6/11/2021 20

CANopen • Process Data Objects (PDO) To transfer real time data Provides interface to

CANopen • Process Data Objects (PDO) To transfer real time data Provides interface to application objects Two types> Transmit-PDO and Receive-PDO PDOs are transferred using Producer/Consumer model PDO write is according to push model while PDO read is pull model • Service Data Objects (SDO) Direct access to object dictionary Used to configure devices during initialization and also during operation Transferred using client and server model • Synchronous Object (SYNC) Broadcasted periodically Time period is defined using standard parameter communication cycle period Follows Producer/Consumer push model 6/11/2021 21

CANopen • Time Stamp Object (TIME) TIME producer broadcasts the time stamp object Transmission

CANopen • Time Stamp Object (TIME) TIME producer broadcasts the time stamp object Transmission is done using Producer/Consumer model • Emergency Object (EMCY) Used for errors • Network Management (NMT) Devices are Initialized, started, monitored, reset or stopped Atleast one Master in the network and all other devices are slaves All CANopen devices are in one of the following 4 states, Initialization, Operational, Preoperational and stopped NMT objects follow Master/Slave model 6/11/2021 22

CANopen • Object Dictionary 6/11/2021 Index 16 -bit (8 -bit sub) Object type Variable,

CANopen • Object Dictionary 6/11/2021 Index 16 -bit (8 -bit sub) Object type Variable, array, string etc Name of the object Data type Integer, float, unsigned etc Access rights Rw, ro, wo Default value - 23

CANopen • Communication object identifier 11 -Bit CAN ID 4 -bit Function code 7

CANopen • Communication object identifier 11 -Bit CAN ID 4 -bit Function code 7 -bit Node ID • Lowest value function code has the highest priority as well as lowest node ID e. g Node 1 = 0000001 Node 2 = 0000010 Then Node 1 wins arbitration. If node ID is 0 then it is a broadcast. 6/11/2021 24

CANopen Communication Object Function Code CAN-ID NMT 0000 0 SYNC 0001 128 TIME 0010

CANopen Communication Object Function Code CAN-ID NMT 0000 0 SYNC 0001 128 TIME 0010 256 Broadcast objects of the generic pre-defined connection set Fuction codes = binary CAN-ID = decimal 6/11/2021 25

CANopen COB Function code CAN-ID EMCY 0001 129 -255 PDO 1 (tx) 0011 385

CANopen COB Function code CAN-ID EMCY 0001 129 -255 PDO 1 (tx) 0011 385 -511 PDO 1 (rx) 0100 513 -639 PDO 2 (tx) 0101 641 -767 PDO 2 (rx) 0110 769 -895 PDO 3 (tx) 0111 897 -1023 PDO 3 (rx) 1000 1025 -1151 PDO 4 (tx) 1001 1153 -1279 PDO 4 (rx) 1010 1281 -1407 SDO (tx) 1011 1409 -1535 SDO (rx) 1100 1537 -1663 NMT error control 1110 1793 -1919 Peer-to-peer objects of the generic pre-defined connection set 6/11/2021 26

Power On Reset 6/11/2021 27

Power On Reset 6/11/2021 27

POR Definition: it detects supply voltage during power up and generates a reset signal

POR Definition: it detects supply voltage during power up and generates a reset signal until supply voltage reaches a specified threshold so that all the latches and flipflops start in a known state and there is no unwanted output behavior or race conditions. • Bandgap reference core is used as the base for POR • If the supply is temperature independent then usually it is process independent as well • If two voltages are added such that one is negative temperature coefficient and other is positive temperature coefficient then the result will be zero TC • Forward biased diode / bipolar transistor biased in forward diode configuration / MOS operated in weak inversion has negative temperature coeffiecient • If any of the above two devices operate at different current densities then their voltage difference is positive temperature coefficient which is Vtlogn 6/11/2021 28

POR Kuijk Cell Bandgap Reference 6/11/2021 29

POR Kuijk Cell Bandgap Reference 6/11/2021 29

POR Kuijk Cell Bandgap Reference Based POR 6/11/2021 30

POR Kuijk Cell Bandgap Reference Based POR 6/11/2021 30

POR Kuijk Cell Bandgap Reference MOS Based POR 6/11/2021 31

POR Kuijk Cell Bandgap Reference MOS Based POR 6/11/2021 31

POR Monte. Carlo 6/11/2021 32

POR Monte. Carlo 6/11/2021 32

POR Transient Fast rise 6/11/2021 33

POR Transient Fast rise 6/11/2021 33

POR Transient Slow rise 6/11/2021 34

POR Transient Slow rise 6/11/2021 34

POR Monte. Carlo 6/11/2021 35

POR Monte. Carlo 6/11/2021 35

POR Schematic 6/11/2021 36

POR Schematic 6/11/2021 36

POR Schematic Comparator 6/11/2021 37

POR Schematic Comparator 6/11/2021 37