24
CAN © CiA CAN-based higher layer protocols CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications CAN Reiner Zitzmann (CAN in Automation) www.can-cia.org

1 CAN Higher Layer Protocols

Embed Size (px)

Citation preview

Page 1: 1 CAN Higher Layer Protocols

CAN

© CiA

CAN-based higher layer protocols

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

CAN

Reiner Zitzmann(CAN in Automation)

www.can-cia.org

Page 2: 1 CAN Higher Layer Protocols

CAN

© CiA

Protocol layer interactions

COB = communication object

Indicating(responding)

device

COB

CAN frame(s)

Requesting(confirming)

device

Recessive Recessive

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

DominantCAN physical

layer

CAN data linklayer

CAN-basedapplication

layer

CAN physicallayer

CAN data linklayer

CAN-basedapplication

layer

Page 3: 1 CAN Higher Layer Protocols

CAN

© CiA

◆ 1991: CAN Kingdom◆ 1992: CAN Application Layer (CiA 20X series)◆ 1994: Smart Distributed System (IEC 62026, EN 50325)◆ 1994: DeviceNet (IEC 62026, EN 50325)◆ 1994: Truck and bus (SAE J1939)◆ 1995: CANopen (CiA 301, EN 50325)◆ 1997: OSEK-COM/NM (ISO 17356 series)◆ 1999: Truck/trailer (ISO 11992-1/-2/-3)◆ 2001: Diagnostics on CAN (ISO 15765)◆ 2002: ISOBUS (ISO 11783 series)◆ 2006: Re-creation vehicle CAN (CiA 501/2)

HLP historyHLP = Higher-layer protocol

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 4: 1 CAN Higher Layer Protocols

CAN

© CiA

CAN standardization

ISO 11898-1(11-bit ID)

ISO 11898-2

Data LinkLayer

PhysicalLayer

CAN 2.0A

RS-485

ISO 11898-1(11-bit ID)

ISO 11898-1(11-bit and29-bit ID)

ISO 11898-2

ApplicationLayer

SDSEN 50325-3

DeviceNetEN 50325-2

CANopenEN 50325-4

DeviceProfile

DeviceNetdeviceprofiles

CANopendeviceprofiles

ApplicationProfile

CANppenapplication

profiles

ISO 11898-2

ISO 11898-1(29-bit ID)

SAE J1939-based

applicationprofiles

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 5: 1 CAN Higher Layer Protocols

CAN

© CiA

CANopen device model

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Protocol Stack

PDO ProtocolSDO ProtocolSync ProtocolTime Protocol

Emergency ProtocolNMT Protocol

Heartbeat Protocoletc.

Object Dictionary

Data TypesCommunication Objects

Application ObjectsProprietary Objects

ApplicationSoftware

Device ProfileImplementation

ProprietarySoftwareRoutines

I/O

CAN

Control IFConfiguration IFDiagnostic IF

Process IF

Page 6: 1 CAN Higher Layer Protocols

CAN

© CiA

CANopen features

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

◆ Service Data Object (SDO) protocols ◆ Standard SDO protocols ◆ SDO block protocols◆ Process Data Object (PDO) protocol◆ Special object protocols: ◆ Synchronization (SYNC) protocol ◆ Time Stamp (TIME) protocol ◆ Emergency (EMCY) protocol◆ Network Management protocols: ◆ NMT Message protocol ◆ Boot-Up protocol ◆ Error Control protocols

- Heartbeat protocol- Node guarding protocol

Page 7: 1 CAN Higher Layer Protocols

CAN

© CiA

Pre-defined CAN-ID set

CANopen introduction - Basic protocols - Additional protocols - System design - Dev ice profiles - Application profiles

1200h1537 (601h) - 1663 (67Fh)1100bSSDO (rx)1016h, 1017h1793 (701h) - 1919 (77Fh)1110bNMT ERROR

CONTROL

1200h1409 (581h) - 1535(5FFh)1011bSSDO (tx)1403h1281 (501h) - 1407 (57Fh)1010bRPDO4 (rx)1803h1153 (481h) - 1279 (4FFh)1001bTPDO4 (tx)1402h1025 (401h) - 1151 (47Fh)1000bRPDO3 (rx)1802h897 (381h) - 1023 (3FFh)0111bTPDO3 (tx)1401h769 (301h) - 895 (37Fh)0110bRPDO2 (rx)1801h641 (281h) - 767 (2FFh)0101bTPDO2 (tx)1400h513 (201h) - 639(27Fh)0100bRPDO1 (rx)1800h385 (181h) - 511 (1FFh)0011bTPDO1 (tx)

1014h, 1015h129 (81h) - 255 (FFh)0001bEMERGENCY

1012h, 1013h256 (100h)0010bTIME STAMP1005h, 1006h, 1007h128 (80h)0001bSYNC

-00000bNMT

Communicationparameters at Index

CAN IdentifierFunction codeObject

Page 8: 1 CAN Higher Layer Protocols

CAN

© CiA

Application layer

Physical signaling

Transceiver

Transmission mediaISO layer-0 - Media

ISO layer-1 - Physical

ISO layer-2 - Data Link {

{{

ISO layer-7 - Application {

Data link layer

DeviceNet application layer

specification

CAN protocol specification

DeviceNet physical layer specification

}}

}

DeviceNet model

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 9: 1 CAN Higher Layer Protocols

CAN

© CiA

DeviceNet

Assembly

DeviceNetObject

ParameterIdentity

MessageRouter

ApplicationObject(s)

Connection

ExplicitmsgI/O

Required Objects

Device object model

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 10: 1 CAN Higher Layer Protocols

CAN

© CiA

CumulativeDrop-line Budget156m @ 125Kbaud 78m @ 250Kbaud 39m @ 500Kbaud(Maximum of 6m each)

Trunk line Distanceand Baud rate100m Max. with Thin cable500m @ 125Kbaud (thick)250m @ 250Kbaud (thick)100m @ 500Kbaud (thick)(4Km with Repeaters)

Maximum Devices64 Nodes per Network

Physical Media(Shielded Twisted Pair)Communications and Power•Thick - Trunk wire•Thin - Trunk or Drop

Drop-line wiring•Single drop•Daisy-chaining off drop•Branching off drop

Device ConnectionsT-TapsZero-drop

Terminating Resistors75Ω Resistors at bothnetwork trunkline ends

Network Power•24vDC power to devices•Thick trunk rated to 8 amps•Thin wire rated at 3 amps

Messaging ServicesProducer/Consumer•High-speed I/O•Programming•Configuration•Diagnostics

ALLEN-BRADLEY

7 8 9

4 5 6

1 2 3

. 0 -

<-----------------'

<

-

-

F1

F6

F2

F7

F3

F8

F4

F9

F5

F1

0

PanelView 550

< >

^

v

DeviceNet features

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 11: 1 CAN Higher Layer Protocols

CAN

© CiA

Multi-master

Cyclic

Strobe Change-of-State

Multicast

Point-to-Point

Peer to Peer

Polling

Broadcast

ALLEN-BRADLEY

7 8 9

4 5 6

1 2 3

. 0 -

<-----------------'

<

-

-

F1

F6

F2

F7

F3

F8

F4

F9

F5

F1

0

PanelView 550

< >

^

v

Message services

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 12: 1 CAN Higher Layer Protocols

CAN

© CiA

PresentationSession

Transport

6

54

J1939/01 - Truck and Bus document defining application of J1939 to on-highway heavy duty vehicles.J1939/02 - Construction and agriculture-based and agriculture-equipment-based document.

Network3 J1939/31 - Truck and Bus Network Layer

Data Link2 J1939/21 - Data Link Layer

Physical1 J1939/1x - Physical Layer Documents/11 - Truck and Bus (250 kbit/s)/12 - John Deere (250 kbit/s)

/13 - OBD connector /14 - DIN 9684 (50 kbit/s)

/15 - Unshielded (250 kbit/s)

J1939 - Base documentcontaining a generaldescription, a tutorial andtables of addresses, datacontents, etc.

ApplicationProfile7

J1939/81 - Network Management J1939/71 - Vehicle Application LayerJ1939/72 - Virtual Terminal (DIN 9684) - DraftJ1939/73 - Application Layer - Diagnostics

SAE J1939 reference model

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 13: 1 CAN Higher Layer Protocols

CAN

© CiA

DLC (4) 0-8 Bytes18-bit Identifier 37

AC

K15-bit CRC

IDE

SR

R11-bit Identifier

SO

F

Data Field

R1

RT

R

R0

DE

L

DE

L

Arbitration FieldControl

FieldCRC Field ACK

FieldEnd ofFrame

IFSIS

O 1

1898

-1

2 8 8

PDUSpecific

(PS)

SourceAddress

(SA)

0 - 64

DataField

3 1 1 6

Priority(P)

Reserved(R)

DataPage(DP)

PDUFormat

(PF)

J193

9/21

Data link layer (/21)

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 14: 1 CAN Higher Layer Protocols

CAN

© CiA

A transport protocol is provided with the following features :◆ Connection-oriented, point-to-point (RTS/CTS).◆ Connectionless broadcast (BAM).◆ 1785 bytes may be sent.

Receiver controls flow of message:◆ May temporarily stop by sending CTS with #packets = 0,

continuing to send every 0,55 seconds.◆ May close with End-of-Message ACK.

Time will close connection if values exceed the following:◆ 250 ms between packets.◆ 1250 ms after CTS message sent.◆ 1250 ms and no CTS or ACK sent after last packet.◆ 550 ms no CTS after CTS(0) sent.

Transport protocol

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 15: 1 CAN Higher Layer Protocols

CAN

© CiA

MESSAGE

3.3.35 AMBIENT CONDITIONS

Transmission repetition rate: 1 secData length: 8 bytesPGN 00FEF5h

Byte: 1 Barometer pressure2,3 Cab interior temperature4,5 Ambient air temperature

6 Air inlet temperature7,8 Road surface temperature

PARAMETERS

3.2.5.43 Barometric pressure- Absolute air pressure of the atmosphere.Data Length: 1 byteResolution: 0,5 kPa/bit gain, 0 kPa offsetData Range: 0 kPa to + 125 kPa (0 psi to + 18,1 psi)SPN: 108Type: Measured

3.2.5.11 Cab interior temperature- Temperature of air inside the part of thevehicle encloses the driver and vehicle operating controls.Data Length: 2 bytesResolution: 0,03125 C/bit gain, -273 C offsetData Range: -273 C to + 1735.0 C (-459,4 to 3155.0 F)SPN: 170Type: Measured

3.2.5.12 Ambient air temperature- Temperature of air surrounding vehicle.Data Length: 2 bytesResolution: 0,03125 C/bit gain, -273 C offsetData Range: -273 C to + 1735.0 C (-459,4 to 3155,0 F)SPN: 171Type: Measured

4.2.5.13 Air inlet temperature- Temperature of air entering vehicle air inductionsystem.Data Length: 1 bytesResolution: 1 C/bit gain, -40 C offsetData Range: -40 C ti +210 C (-40 to 410 F)SPN: 172Type: Measured

Parameter specification

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 16: 1 CAN Higher Layer Protocols

CAN

© CiA

EngineHitch

TractorECU

GPSImplement ECU andBridge

ImplementECU

ImplementECU

Task Controller

ManagementComputer

GatewayVT

ISO 11783 (ISOBUS)

CAN-based SAE J1939

CAN-basedISO 11783

e.g. CANopen

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 17: 1 CAN Higher Layer Protocols

CAN

© CiA

ISO 11783 documentsPart Title Status 1 General standard for mobile data communication in preparation 2 Physical layer published 3 Data link layer published 4 Network layer published 5 Network management published 6 Virtual terminal published 7 Implement messages application layer published 8 Power train messages in preparation 9 Tractor ECU published10 Task controller & management information system in preparation11 Mobile data element dictionary in preparation12 Diagnosis in preparation13 File server in preparation

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 18: 1 CAN Higher Layer Protocols

CAN

© CiA

Data link and network layer

• CAN extended frame format (29-bit identifier)• Frame format compatible to SAE J1939• Broadcast and peer-to-peer communication services• Transport protocol for parameter groups with length > 8 byte

• Connection mode data transfer (SAE J1939)• Broadcast announce message (SAE J1939)• Extended transport protocol (ISO 11783)• Fast packet transport protocol (NMEA2000)

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 19: 1 CAN Higher Layer Protocols

CAN

© CiA

Event- versus time-triggered

Asynchronous triggering of message transmission• Change of value• Elapsing of not synchronized local timer• Other device-internal event

Advantages: High real-time performance, high design flexibility

Synchronous triggering of message transmission• Elapsing of local timer synchronized with global (system) time• Receiving in broadcast a trigger message

Advantages: High determinism capability, high composibility

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 20: 1 CAN Higher Layer Protocols

CAN

© CiA

◆ All messages are initiated by the progression of time◆ Each message has a defined time slot◆ No collision of messages◆ No automatic re-transmission of faulty message◆ Reception of each message is known in advance

Simplifies emulation and debugging◆ Time synchronisation

Global time system◆ Message scheduling has to be assigned before run time

TTCAN requirementsTTCAN = time-triggeredcommunication on CAN(ISO 11898-4)

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 21: 1 CAN Higher Layer Protocols

CAN

© CiA

Tx disabled

CAN Data Frame or CAN Remote Frame

Exclusive or Arbitration or Free Window

Tx enabled

ISO 11898-4 time window

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 22: 1 CAN Higher Layer Protocols

CAN

© CiA

TTCAN system matrix

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 23: 1 CAN Higher Layer Protocols

CAN

© CiA

Window 0 Window 1 Window 2 Window 3 Window4RefMsg Message A Arbitration Arbitration Message BRefMsg Message A Arbitration Free Window Message C

Merged Arbitration Windows

Tx_Enable Tx_Disable

Arbitration Arbitration

Tx_Enable Tx_Enable Tx_DisableTx_Disable

Merged windows

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications

Page 24: 1 CAN Higher Layer Protocols

CAN

© CiA

Next_Is_Gap

7

reserved

6

Optional Cycle_Count_Bits

5 to 0

• The Reference message of level 1 consists of at least one data byte

Reference message (level1)

CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications