CAN
CAN-based higher layer protocols
N A C
Reiner Zitzmann
(CAN in Automation)
www.can-cia.org
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
Protocol layer interactions
Requesting (confirming) device
CAN-based application layer CAN data link layer CAN physical layer
Indicating (responding) device COB
CAN-based application layer CAN data link layer CAN physical layer
CAN frame(s) Recessive Recessive
Dominant
COB = communication object
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
HLP history
1991: 1992: 1994: 1994: 1994: 1995: 1997: 1999: 2001: 2002: 2006: CAN Kingdom
HLP = Higher-layer protocol
CAN Application Layer (CiA 20X series) Smart Distributed System (IEC 62026, EN 50325) DeviceNet (IEC 62026, EN 50325) Truck and bus (SAE J1939) CANopen (CiA 301, EN 50325) OSEK-COM/NM (ISO 17356 series) Truck/trailer (ISO 11992-1/-2/-3) Diagnostics on CAN (ISO 15765) ISOBUS (ISO 11783 series) Re-creation vehicle CAN (CiA 501/2)
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
CAN standardization
Application Profile Device Profile Application Layer Data Link Layer Physical Layer DeviceNet device profiles CANppen application profiles CANopen device profiles SAE J1939 -based application profiles
SDS DeviceNet CANopen EN 50325-3 EN 50325-2 EN 50325-4 ISO 11898-1 CAN 2.0A (11-bit ID) ISO 11898-1 ISO 11898-1 (11-bit and (29-bit ID) 29-bit ID) ISO 11898-2
RS-485
ISO 11898-2 ISO 11898-2
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
CANopen device model
Protocol Stack PDO Protocol SDO Protocol Sync Protocol Time Protocol Emergency Protocol NMT Protocol Heartbeat Protocol etc. Object Dictionary Data Types Communication Objects Application Objects Proprietary Objects Application Software Device Profile Implementation Proprietary Software Routines
I/O
CAN
Control IF Configuration IF Diagnostic IF
Process IF
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
CANopen features
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
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
Pre-defined CAN-ID set
Object NMT SYNC TIME STAMP EMERGENCY TPDO1 (tx) RPDO1 (rx) TPDO2 (tx) RPDO2 (rx) TPDO3 (tx) RPDO3 (rx) TPDO4 (tx) RPDO4 (rx) SSDO (tx) SSDO (rx) NMT ERROR CONTROL Function code 0000b 0001b 0010b 0001b 0011b 0100b 0101b 0110b 0111b 1000b 1001b 1010b 1011b 1100b 1110b CAN Identifier 0 128 (80h) 256 (100h) 129 (81h) - 255 (FFh) 385 (181h) - 511 (1FFh) 513 (201h) - 639(27Fh) 641 (281h) - 767 (2FFh) 769 (301h) - 895 (37Fh) 897 (381h) - 1023 (3FFh) 1025 (401h) - 1151 (47Fh) 1153 (481h) - 1279 (4FFh) 1281 (501h) - 1407 (57Fh) 1409 (581h) - 1535(5FFh) 1537 (601h) - 1663 (67Fh) 1793 (701h) - 1919 (77Fh) Communication parameters at Index 1005h, 1006h, 1007h 1012h, 1013h 1014h, 1015h 1800h 1400h 1801h 1401h 1802h 1402h 1803h 1403h 1200h 1200h 1016h, 1017h
CANopen introduction - Basic protocols - Additional protocols - System design - Dev ice profiles - Application profiles
CiA
CAN
DeviceNet model
ISO layer-7 - Application ISO layer-2 - Data Link
ISO layer-1 - Physical ISO layer-0 - Media
{ {
{
Application layer Data link layer Physical signaling Transceiver Transmission media
}
}
DeviceNet application layer specification
CAN protocol specification
DeviceNet physical layer specification
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
Device object model
Required Objects
Application Object(s)
Parameter Identity
Assembly
Message Router
I/O Connection
Explicit msg
DeviceNet Object
DeviceNet
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
DeviceNet features
Physical Media Maximum Devices
64 Nodes per Network (Shielded Twisted Pair) Communications and Power Thick - Trunk wire Thin - Trunk or Drop
Network Power
24vDC power to devices Thick trunk rated to 8 amps Thin wire rated at 3 amps
Trunk line Distance and Baud rate
100m 500m 250m 100m Max. with Thin cable @ 125Kbaud (thick) @ 250Kbaud (thick) @ 500Kbaud (thick)
(4Km with Repeaters)
ALLEN-BRADLEY
PanelView 550
< F1 F2 F3 F4 F5 < F6 F7 F8 F9 F1 0
<-----------------'
^ > v
Device Connections
T-Taps Zero-drop
Terminating Resistors
75 Resistors at both network trunkline ends
Messaging Services
Producer/Consumer High-speed I/O Programming Configuration Diagnostics
Cumulative Drop-line Budget Drop-line wiring
Single drop Daisy-chaining off drop Branching off drop 156m @ 125Kbaud 78m @ 250Kbaud 39m @ 500Kbaud
(Maximum of 6m each)
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
Message services
Strobe Polling Change-of-State Cyclic
ALLEN-BRADLEY
PanelView 550
< F1 F2 F3 F4 F5 < F6 F7 F8 F9 F1 0
<-----------------'
^ > v
Point-to-Point
Peer to Peer Broadcast Multicast
Multi-master
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
SAE J1939 reference model
7 6 5 4 3 2 1 Application Profile Presentation Session Transport Network Data Link Physical
J1939 - Base document containing a general description, a tutorial and tables of addresses, data contents, etc. J1939/31 - Truck and Bus Network Layer J1939/21 - Data Link Layer 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/81 - Network Management J1939/71 - Vehicle Application Layer J1939/72 - Virtual Terminal (DIN 9684) - Draft J1939/73 - Application Layer - Diagnostics
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.
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
Data link layer (/21)
Arbitration Field
ISO 11898-1
SRR
Control Field
DLC (4)
Data Field
CRC Field
ACK End of Field Frame
ACK
IFS
SOF
RTR
IDE
11-bit Identifier
18-bit Identifier
0-8 Bytes
15-bit CRC
DEL
DEL
R1
R0
J1939/21
3
Priority (P)
1
Data Page (DP)
0 - 64
Data Field
PDU Specific (PS) Source Address (SA)
Reserved (R)
PDU Format (PF)
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
Transport protocol
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.
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
Parameter specification
MESSAGE
3.3.35 AMBIENT CONDITIONS Transmission repetition rate: 1 sec Data length: 8 bytes PGN 00FEF5 h Byte: 1 2,3 4,5 6 7,8 Barometer pressure Cab interior temperature Ambient air temperature Air inlet temperature Road surface temperature PARAMETERS
3.2.5.43 Barometric pressure- Absolute air pressure of the atmosphere. Data Length: 1 byte Resolution: 0,5 kPa/bit gain, 0 kPa offset Data Range: 0 kPa to + 125 kPa (0 psi to + 18,1 psi) SPN: 108 Type: Measured 3.2.5.11 Cab interior temperature- Temperature of air inside the part of the vehicle encloses the driver and vehicle operating controls. Data Length: 2 bytes Resolution: 0,03125 C/bit gain, -273 C offset Data Range: -273 C to + 1735.0 C (-459,4 to 3155.0 F) SPN: 170 Type: Measured 3.2.5.12 Ambient air temperature- Temperature of air surrounding vehicle. Data Length: 2 bytes Resolution: 0,03125 C/bit gain, -273 C offset Data Range: -273 C to + 1735.0 C (-459,4 to 3155,0 F) SPN: 171 Type: Measured 4.2.5.13 Air inlet temperature- Temperature of air entering vehicle air induction system. Data Length: 1 bytes Resolution: 1 C/bit gain, -40 C offset Data Range: -40 C ti +210 C (-40 to 410 F) SPN: 172 Type: Measured CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
ISO 11783 (ISOBUS)
Management Computer
Implement ECU and Bridge
. e.g
AN
e op
Task Controller
VT Gateway
CAN-based ISO 11783
Tractor ECU Implement ECU Hitch
GPS Engine
CAN-based SAE J1939
Implement ECU
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
ISO 11783 documents
Part 1 2 3 4 5 6 7 8 9 10 11 12 13 Title General standard for mobile data communication Physical layer Data link layer Network layer Network management Virtual terminal Implement messages application layer Power train messages Tractor ECU Task controller & management information system Mobile data element dictionary Diagnosis File server Status in preparation published published published published published published in preparation published in preparation in preparation in preparation in preparation
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
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
CiA
CAN
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
CiA
CAN
TTCAN requirements
TTCAN = time-triggered communication on CAN (ISO 11898-4)
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
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
ISO 11898-4 time window
Tx enabled Tx disabled
CAN Data Frame or CAN Remote Frame Exclusive or Arbitration or Free Window
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
TTCAN system matrix
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
Merged windows
Window 0 RefMsg RefMsg Window 1 Message A Message A Window 2 Arbitration Window 3 Arbitration Window4 Message B Arbitration Free Window Message C
Tx_Enable
Tx_Disable
Tx_Enable Arbitration
Tx_Disable
Arbitration Tx_Enable
Tx_Disable
Merged Arbitration Windows
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA
CAN
Reference message (level1)
7
Next_Is_Gap
6
reserved
5 to 0
Optional Cycle_Count_Bits
The Reference message of level 1 consists of at least one data byte
CAN introduction - CAN protocols - CAN physical layer - CAN implementations - Higher-layer protocols - CAN applications
CiA