Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
TEAM MEMBERS:
- V ng Khoa
- Nguyn Hong Khng
- Trng Tt Nht Minh
CONTENTS
I. INTRODUCTION:................................................................................6
1)Definition of CANopen:.....................................................................6
2) Objects:..............................................................................................8
3) Profiles:..............................................................................................9
a)DS301 communication profile:........................................................9
b) DSP402 device profile:.................................................................10
II.PHYSICAL LAYER:..........................................................................11
1) Topology and medium access:.........................................................11
a) Topology of a CANopen network:................................................11
b) Topology of a powered CANopen network:.................................11
2) Physical connections:......................................................................13
a) 9-pin SUB D connector DIN 41652:.............................................13
The connector is 9 pin D-SUB female:.............................................13
The associated connector is 9 pin D-SUB male:...............................14
b) RJ 45 connector:...........................................................................14
c) 5-pin Mini Style connector:..........................................................16
d) Open Style Connector:..................................................................16
3) Line termination:............................................................................17
4) Bus Length:.....................................................................................17
III.DATA LINK LAYER:........................................................................18
1)Communication objects:...................................................................19
2) Frame:..............................................................................................20
2
a)Data Frame:....................................................................................20
b)Remote Frame:...............................................................................21
c)Error Frame:...................................................................................21
d)Overload Frame:............................................................................22
3) Protection Mechanisms:...................................................................22
4) Robust EMC Behavior.....................................................................23
5) Non Destructive Bus Access............................................................23
6) Bit time:...........................................................................................24
a)Minimum bit time..........................................................................24
b)Bit time definition..........................................................................24
IV. APPLICATION LAYER:.................................................................25
1) CANopen message:.........................................................................25
a) COD ID:........................................................................................25
b) Function code:...............................................................................27
c) Node address:................................................................................27
d) Data frame:....................................................................................28
2) Communication relationships:.........................................................28
a)Master-slave relationship:..............................................................29
b)Client-server relationship:..............................................................29
c)Producer-consumer relationship:....................................................30
3)Service data communication:............................................................31
a) Overview:......................................................................................31
b)SDO data exchange:.......................................................................32
c)Message types:...............................................................................32
d)SDO message:................................................................................32
e)Evaluation of numeric values:........................................................33
3
b) Channel Function:.........................................................................60
c) PDO Configuration:......................................................................61
d) Config tab:....................................................................................61
3) Master Configuration:......................................................................62
a) Mapping (Inputs / Outputs Words)................................................62
b) Bus Parameters..............................................................................62
I. INTRODUCTION:
1)Definition of CANopen:
CANopen is a network technology optimized for the usage in
industrial control environments, in machine internal networks and in
embedded systems (any control unit deeply "embedded" in a device with
electronics). Lately CANopen also moved into the automotive market,
where CiA 447 is used as a dedicated network for add-on electronics in
emergency response vehicles, taxis and other special purpose vehicles.
The lower-layer implementation of CANopen is based upon CAN
(Controller Area Network) which is implemented on microcontrollers of
more than 30 chip manufacturers.
In industrial control terms CANopen is a "Fieldbus", such as
DeviceNet, Smart Distributed Systems, InterBus-S and others. Some
applications use derivations from RS485 for similar embedded networks.
However, with RS485 the network designer / developer needs to invent
many communication routines whereas CANopen features a pre-defined
set of network communication functionality.
As the basis technology is included in so many low-cost and low to
medium-performance components, it is well suited for cost-sensitive /
high-volume applications, other applications using 8-bit to 16-bit
microcontrollers and low-power applications.
The functionality provided by CANopen allows the configuration
of each network node by a network master or configuration tool. The
configuration parameters set the communication behavior of a device
and allow to set which process data is stuffed where (data field) into
which message (message identifier) and when this message is triggered.
Typical message trigger events can be a detection in the change-of-state
of the process data or a repetitive timer (e.g. transmit every 100ms).
2) Objects:
Processes under CANopen are executed via objects. Objects carry
out different tasks; they act as communication objects for data transport
to the field bus, control the process of establishing a connection or
monitor the network devices. If objects are directly linked to the device
(device specific objects), the device functions can be used and changed
via these objects.
Object group
Communications profile
Vendor specific objects
Standardized device profiles
3) Profiles:
Standardized profiles: description of objects that are used with different
devices without additional configuration. The users and manufacturers
organization CAN in Automation has standardized various profiles. These
include: DS301 communication profile and DSP402 device profile.
a)DS301 communication profile:
The DS301 communication profile is the interface between device
profiles and CAN bus. It was specified in 1995 under the name DS301 and
defines uniform standards for common data exchange between different device
types
under
CANopen.
The objects of the communication profile in the device carry out the tasks
of data exchange and parameter exchange with other network devices and
initialize, control and monitor the device in the network.
b) DSP402 device profile:
The DSP402 device profile describes standardized objects for
positioning, monitoring and settings of drives. The tasks of the objects
include:
+Device monitoring and status monitoring (Device Control)
+Standardized parameterization
+Changing, monitoring and execution of operating modes
10
11
II.PHYSICAL LAYER:
1) Topology and medium access:
a) Topology of a CANopen network:
The figure (1) shows a CANopen bus with two segments linked by a
repeater (REP).
Each segment must have line termination (LT) at each end.
Devices are connected in different ways:
by a derivation, using drops connected to single or multi port Taps
by chaining, either on a single connector (nodes 2, 8), either with
two connectors (node 7).
b)
Topology of a
powered
network:
CANopen
TAP inside one segment shall be possible if rules described in this document
are followed.
The figure (2) shows the same topology as in figure (1) with a Supply MultiTAP instead of non-powered TAP.
TAP, Multi TAP, Supply TAP, Supply Multi TAP are shown in the figures
below:
13
2) Physical connections:
In its recommendation DR-303-1, the CiA provides a list of suitable
connectors classified into 3 categories:
+General use 9-pin SUB D connector DIN 41652, multi-pole connector
(ribbon cable to 9-pin SUB-D), RJ10 and RJ45
+Industrial use 5-pin Mini Style, 5-pin Micro Style, Open Style
+Special use 7-pin round connector, 8-pin round connector, 9-pin round
connector, 12-pin round connector, Hand Brid Harting.
a) 9-pin SUB D connector DIN 41652:
The D-subminiature or D-sub is a common type of electrical
connector. They are named for their characteristic D-shaped metal
shield. Connector usually contains two or more parallel rows of pins or
sockets surrounded by a D-shaped metal shield that provides mechanical
support, ensures correct orientation, and screen against electromagnetic
interference.
The connector is 9 pin D-SUB female:
In DIN 41652, with male product end, we have the pin signal
description:
14
b) RJ 45 connector:
The RJ45 (Registered jack 45) connector is standardized as the IEC
60603-7 8P8C modular connector with eight conductors.
15
16
3) Line termination:
The underlying CAN architecture defines the basic physical structure of
the CANopen network. Therefore, a line (bus) topology is used.
17
1)Communication objects:
In CAN bus, the data link layer of CANopen, can only transmit
short packages consisting of an 11-bit id, a remote transmission request
(RTR) bit and 0 to 8 bytes of data. The CANopen standard divides the
11-bit CAN frame id into a 4-bit function code and 7-bit CANopen
node ID. This limits the number of devices in a CANopen network to
127 (0 being reserved for broadcast). An extension to the CAN bus
standard (CAN 2.0 B) allows extended frame ids of 29 bits, but in
practice CANopen networks big enough to need the extended id range
are rarely seen.
18
2) Frame:
CANOpen has four frame types: Data frame, Remote frame,
Error frame, Overload frame.
a)Data Frame:
Data frame transports data from a producer to consumers
without any guarantee that it will be processed. The data frame is the
only frame for actual data transmission. There are two message formats:
Base frame format
(with 11 identifier bits) and Extended frame format ( with 29 identifier
bits).
19
20
b)Remote Frame:
Remote frame is sent by a client to a server to request transmission
of a data frame (the identifier will have the same value as that of the
request).
Generally data transmission is performed on an
autonomous basis with the data source node (e.g., a sensor) sending out
a Data Frame. It is also possible, however, for a destination node to
request the data from the source by sending a Remote Frame.
There are two differences between a Data Frame and a Remote
Frame. Firstly the RTR-bit is transmitted as a dominant bit in the Data
Frame and secondly in the Remote Frame there is no Data Field.
Example:
RTR = 0 ; DOMINANT in data frame
RTR = 1 ; RECESSIVE in remote frame
In the very unlikely event of a Data Frame and a Remote Frame
with the same identifier being transmitted at the same time, the Data
Frame wins arbitration due to the dominant RTR bit following the
identifier. In this way, the node that transmitted the Remote Frame
receives the desired data immediately.
c)Error Frame:
Error frame is transmitted when a station detects the presence of
errors on the bus.
The error frame consists of two different fields:
+The first field is given by the superposition of ERROR
FLAGS (612 dominant/recessive bits) contributed from different
stations.
+The following second field is the ERROR DELIMITER
(8 recessive bits).
There are two types of error flags:
21
d)Overload Frame:
Overload frame is sent to ask for an additional time lapse
between successive frames (data or request).
The overload frame contains the two bit fields Overload Flag and
Overload Delimiter. There are two kinds of overload conditions that can
lead to the transmission of an overload flag:
+The internal conditions of a receiver, which requires a delay
of the next data frame or remote frame.
+Detection of a dominant bit during intermission.
The start of an overload frame due to case 1 is only allowed to be
started at the first bit time of an expected intermission, whereas overload
frames due to case 2 start one bit after detecting the dominant bit.
Overload Flag consists of six dominant bits. The overall form
corresponds to that of the active error flag. The overload flags form
destroys the fixed form of the intermission field. As a consequence, all
other stations also detect an overload condition and on their part start
transmission of an overload flag. Overload Delimiter consists of eight
recessive bits. The overload delimiter is of the same form as the error
delimiter.
3) Protection Mechanisms:
- Very Reliable : CANOpen has Hamming Distance = 6.
22
6) Bit time:
a)Minimum bit time
The first obvious requirement for SE Devices is that they use
components compliant with their max available bit-rate. This concerns
CAN controller, opto-couplers and CAN transceiver.
CANopen devices with a Conformance Class M20, S20 and M30,
S30 shall implement components which support the 1Mbit/s bit-rate,
whereas M10, S10 CANopen devices shall use components supporting
500kbit/s bit-rate.
Characteristic is t bit = minimum bit time = 2 s for x10, 1 s for
x20 and x30
b)Bit time definition
Bit time is divided into separate non overlapping segments :
+Synchronization segment = Sync_Seg
+Propagation time segment = Prop_Seg
+Phase Buffer segment 1 = Phase_Seg1
+Phase Buffer segment 2 = Phase_Seg2
24
a) COD ID:
The COB ID (Communication Object Identifier) has 2 tasks as far as
controlling communication objects is concerned:
+Bus arbitration: Specification of transmission priorities.
+Identification of communication objects. An 11 bit COB
identifier as per the CAN 3.0A specification is defined for CAN
communication, it comprises 2 parts:
Function code, 4 bits
Node address (node ID), 7 bits.
26
b) Function code:
27
The function code classifies the communication objects. Since the bits
of the function code in the COB ID are more significant, the function code
also controls the transmission priorities: Objects with a lower function code
are transmitted with higher priority. For example, an object with function
code 1 is transmitted prior to an object with function code3 in the case of
simultaneous bus access.
c) Node address:
Each network device is configured before it can be operated on the
network. The device is assigned a unique 7 bit node address (node
ID)between 1 (01 h) and 127 (7Fh). The device address 0 is reserved for
broadcast transmissions which are used to send messages to all reachable
devices simultaneously.
Example: Selection of a COB ID. For a device with the node address 5,
the COB ID of the communication object T_PDO1 is:
384+node ID = 384 (180h) + 5 = 389 (185h).
d) Data frame:
The data frame of the CANopen message can hold up to 8 bytes of data.
In addition to the data frame for SDOs and PDOs, special frame types are
specified in the CANopen profile:
Error data frame.
Remote data frame for requesting a message
The data frames contain the respective communication objects.
2) Communication relationships:
CANopen uses 3 relationships for communication between
network
devices:
Master-slave relationship
Client-server relationship
28
Producer-consumer relationship
29
a)Master-slave relationship:
A network master controls the message traffic. A slave only responds
when it is addressed by the master.
The master-slave relationship is used with network management objects
for a controlled network start and to monitor the connection of devices.
30
The client addresses and sends a CAN message to a server. The server
evaluates the message and sends the response data as an acknowledgement.
c)Producer-consumer relationship:
The producer-consumer relationship is used for exchanging messages
with process data, because this relationship enables fast data exchange without
administration
data.
A Producer sends data, a Consumer receives data.
31
target
position
reached.
32
consist of 8 bytes. SDOs have a higher COB ID than PDOs; therefore, they
are transmitted over the CAN bus at a lower priority.
b)SDO data exchange:
A service data object (SDO) transmits parameter data between 2 devices.
The data exchange conforms to the client-server relationship. The server is the
device to whose object dictionary an SDO message refers.
c)Message types:
Client-server communication is triggered by the client to send parameter
values to the server or to get them from the server. In both cases, the client
starts the communication with a request and receives a response from the
server.
d)SDO message:
Put simply, an SDO message consists of the COB ID and the SDO data
frame, in which up to 4 bytes of data can be sent. Longer data sequences are
distributed over multiple SDO messages with a special protocol.
The device transmits SDOs with a data length of up to 4 bytes. Greater
amounts of data such as 8 byte values of the data type Visible String8 can
be distributed over multiple SDOs and are transmitted successively in blocks
of 7bytes.
Example: The following illustration shows an example of an SDO
message:
33
COB ID and data frame R_SDO and T_SDO have different COB IDs.
The data frame of an SDO messages consists of:
Command code (ccd) which contains the SDO message type and
the data length of the transmitted value.
Index and sub index which point to the object whose data is
transported with the SDO message.
Data of up to 4 bytes.
e)Evaluation of numeric values:
Index and data are transmitted left-aligned in Intel, or little endian
format. If the SDO contains numerical values of more than 1 byte in length,
the data must be rearranged byte-by-byte before and after a transmission.
34
Unused bytes in the data field are shown with a slash in the graphic.
The content of these data fields is not defined.
CCD coding: The table below shows the command code for writing
parameter values. It depends on the message type and the transmitted data
length.
35
*Reading data:
The client starts a read request by transmitting the index and sub index
that point to the object or part of the object whose value it wants to read. The
server confirms the request by sending the desired data. The SDO response
contains the same index and sub index. The length of the response data is
specified in the command code ccd.
The table below shows the command code transmitting a read value. It
depends on the message type and the transmitted data length.
36
g) Error response:
If a message could not be evaluated, the server sends an error message.
37
The client starts a read request by transmitting the index and sub index
that point to the object or the object value whose value it wants to read.
The server confirms the request by transmitting index, sub index, data
length and the first 4 bytes of the requested data. The command code specifies
that data of more than 4 bytes are transmitted. The command code of the read
response from the server to the first message is 41h.
38
39
40
*Activating PDOs:
With the default PDO settings, R_PDO1 and T_PDO1 are activated. The
other PDOs must be activated first. A PDO is activated with bit 31 (valid bit)
in sub index 01h of the respective communication object:
03h.
The time interval event timer cyclically triggers an event message.
After the time intervals has elapsed, the device transmits the event controlled
T_PDO. The time is set with sub index 05h.
42
*Receive PDOs:
The objects for R_PDO1, R_PDO2 and R_PDO3 are preset.
- R_PDO1:
+R_PDO1 contains the control word, object control word (6040 h), of the
state machine which can be used to set the operating state of the device.
+R_PDO1 is evaluated asynchronously, i.e. it is event-driven.R_PDO1
is
preset.
-R_PDO2:
+ With R_PDO2, the control word and the target position of a motion
command, object target position (607Ah), are received for a movement in the
operating mode Profile Position.
43
is
- R_PDO3:
+R_PDO3 contains the control word and the target velocity, object
Target velocity (60FFh) , for the operating mode Profile Velocity.
+R_PDO3 is evaluated asynchronously, i.e. it is event-driven.R_PDO3
is preset.
*Transmit PDOs:
+ The objects for T_PDO1, T_PDO2 and T_PDO3 can be changed by
means of PDO mapping.
-T_PDO1:
+T_PDO1 contains the status word, object status word (6041 h) , of the
state machine.
44
45
PDO mapping, in this case for a device with node address 41 (default Mdrive
address).
*Dynamic PDO mapping:
The device uses dynamic PDO mapping. Dynamic PDO mapping
means that objects can be mapped to the corresponding PDO using adjustable
settings.
The settings for PDO mapping are defined in an assigned
communication object for each PDO.
46
entries. A sub index entry contains 3 pieces of information on the object: the
index, the sub index and the number of bits that the object uses in the PDO.
Sub index 00h of the communication object contains the number of valid
sub index entries.
47
5) Synchronization:
The synchronization object SYNC controls the synchronous exchange of
messages between network devices for purposes such as the simultaneous start
of multiple drives.
The data exchange conforms to the producer-consumer relationship. The
SYNC object is transmitted to all reachable devices by a network device and
can be evaluated by the devices that support synchronous PDOs.
48
With the default settings of the PDOs, R_PDO1 ... R_PDO4 and
T_PDO1 ... T_PDO4 are received and transmitted asynchronously.
T_PDO2 ... T_PDO3 are transmitted additionally after the event timer
has elapsed. The synchronization allows an operating mode to be started
simultaneously on multiple devices so that, for example, the feed of a portal
drive with several motors can be synchronized.
6)Emergency service:
The Emergency Service signals internal device errors via the CAN bus.
The error message is transmitted to the network devices with an EMCY object
according to the Consumer-Producer relationship.
a) Boot-up message:
The communication profile DS301, version 3.0, defines an additional
task for the EMCY object: sending a boot-up message. A boot-up message
informs the network devices that the device that transmitted the message is
ready for operation in the CAN network.
The boot-up message is transmitted with the COB ID 700h + node ID
and one data byte (00h).
51
52
MDrivePlus and MDrive Hybrid devices can only take on the function
ofan NMT slave.
53
To the right, the graphic shows the communication objects that can be
used in the specific network state.
*Initialization:
An NMT slave automatically runs through an initialization phase after
the supply voltage is switched on (power on) to prepare it for CAN bus
operation. On completion of the initialization, the slave switches to the
operating state Pre Operational and sends a boot-up message. From now on,
54
55
The first byte, the Command specifier, indicates the NMT service
used:
The second byte addresses the recipient of an NMT message with anode
address between 1 and127 (7Fh). A message with node address0 is
broadcast to all reachable NMT slaves.
b) NMT services for connection monitoring:
Connection monitoring monitors the communication status of network
devices.
3 NMT services for connection monitoring are available:
Node guarding for monitoring the connection of an NMT slave.
Life guarding for monitoring the connection of an NMT master.
Heartbeat for unconfirmed connection messages from network
devices.
*Node guarding / Life guarding:
COB ID:
The communication object NMT error control (700h+node-Id) is used
for connection monitoring. The COB ID for each NMT slave is determined on
thebasis of the node address:
COB ID = function code NMT error control (700h) + node-Id.
56
57
*Heartbeat:
The optional Heartbeat protocol replaces the node guarding/life guarding
protocol. It is recommended for new device versions.
A heartbeat producer transmits a heartbeat message cyclically at the
frequency defined in the object Producer heartbeat time (1017h) . One or
several consumers can receive this message. Producer heartbeat time
(1016h) = 0 deactivates heartbeat monitoring.
59
*Time intervals:
The time intervals are set in increments of 1 ms steps; the values for the
consumer must not be less than the values for the producer. Whenever the
Heartbeat message is received, the time interval of the producer is restarted.
*Start of monitoring:
\
Heartbeat monitoring starts as soon as the time interval of the
producer is greater than zero. If Heartbeat monitoring is already active
during the NMT state transition to Pre-Operational, Heartbeat monitoring
starts with sending of the boot-up message. The boot-up message is a
Heartbeat message with one data byte 00h.
Devices can monitor each other via Heartbeat messages. They assume
the function of consumer and producer at the same time.
60
V.CONFIGURATION:
Using 2 different tools:
a) Premium: TSX SCP 110 Module
Sycon Software to configure the bus.
Unity Pro to integrate the configuration.
61
1) Embedded devices:
a) Included Devices
b) Additional devices
62
2) Device Configuration:
a) I/O Objects:
IODDT generation.
b) Channel Function:
Represent a set of default configuration for a specific device.
Can be added / modify in the Hardware catalogue manager.
63
c) PDO Configuration:
Default PDO activated from the selected device function.
Variables can be added / removed in each PDO.
PDO
can
be
activated
/
deactivated.
Transmission types can be changed.
d) Config tab:
Change the device parameters that will be send to the device
during boot up.
64
3) Master Configuration:
a) Mapping (Inputs / Outputs Words)
Needs to be adapted to the correct size.
b) Bus Parameters
Baudrate, inhibit time, SYNC.
65