Industrial Communication Chapter 4: CANopen
CANopen Features
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Truong Dinh Chau
2
CANopen Features
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Truong Dinh Chau
2
Introduction ●
CAN (Control Area Network) Created by Bosch for automotive industry ● New concept of non collision Producer / Consumer model ●
●
CAN in Automation CiA Created in 1991 to promote CAN ● Published standards and Profiles ●
●
CANopen ●
DS-301 profile created in 1995
http://www.can-cia.org Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Truong Dinh Chau
3
OSI Layers Used ●
3 Layers Used
APPLICATION
CiA DS-301 = Communication profile CAL = CAN Application Layer
PRESENTATION
Not used
SESSION
Not used
TRANSPORT
Not used
NETWORK
Not used
DATALINK
CAN 2.0 A and B + ISO 11898
PHYSICAL
ISO 11898 + DS-102
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Truong Dinh Chau
4
Physical Layer ●
Error in the doc !
Twisted differential pair : 1 pair : CAN_H & CAN_L ● 2 pairs: CAN_H & CAN_L & Power Supply ●
●
Characteristic line impedance :120 ohms nominal
●
Line termination :120 ohms at both ends of the line
●
Wire resistance : 70 milli-ohms/metre nominal
●
Topology :Bus type with the shortest possible tap links
●
Maximum Number of Devices = 127 (1 Master + 126 Slaves)
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
5
Bus Length ●
Depends on the speed Speed in baud
Bus length
Length of a junction
1 Mbps
20 m
0,3 m (∑L. Junction=0,6 m)
800 Kbps
40 m
3 m (∑L. Junction =6 m)
500 Kbps
100 m
5 m (∑L. Junction =10 m)
250 Kbps
250 m
5 m (∑L. Junction =10 m)
125 Kbps
500 m
5 m (∑L. Junction =10 m)
50 Kbps
1000 m
60 m (∑L. Junction =120 m)
20 Kbps
2500 m (with repeater)
150 m (∑L. Junction =300 m)
10 Kbps
5000 m (with repeater)
300 m (∑L. Junction =600 m)
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
6
Physical Connections ●
3 Categories (DR-303-1) ●
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.
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
7
9-pin SUB D connector ●
DIN 41652
Pin Signal Description: 1: Reserved 2: CAN_L = CAN Low bus line (dominant low) 3: CAN_GND = CAN Ground 4: Reserved 5: (CAN_SHLD) = Optional CAN Shield 6: (GND) = Optional Ground 7: CAN_H = CAN High bus line (dominant high) 8: Reserved 9: (CAN_V+) = Optional CAN external power supply Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
8
RJ 45 Connector ●
Cat 5
1: CAN_H = CAN High bus line (dominant high) 2: CAN_L = CAN Low bus line (dominant low) 3: CAN_GND = Bus ground 4: Reserved 5: Reserved 6: (CAN_SHLD) = Optional CAN Shield 7: CAN_GND = Bus ground 8 (CAN_V+) = Optional CAN external power supply
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
9
5-pin Mini Style connector ●
ANSI/B93.55M-1981
Male product end Pin Signal Description: 1: (CAN_SHLD) = Optional CAN Shield 2:(CAN_V+) = Optional CAN external power supply 3:CAN_GND = Bus ground 4:CAN_H = CAN High bus line (dominant high) 5:CAN_L = CAN Low bus line (dominant low)
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
10
Open Style Connector
Male product end
Pin Signal Description: 1:CAN_GND = bus ground 2:CAN_L = CAN Low bus line (dominant low) 3:(CAN_SHLD) = Optional CAN Shield 4:CAN_H = CAN High bus line (dominant high) 5:(CAN_V+) = Optional CAN external power supply
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
11
Link Layer ●
Industrial Applications: CAN 2.0 A (frame identifier on 11 bits) Arbitration field
1
11
Start of frame (SOF)
Identifier
1
6
RTR Remote Transmission Request bit
Control field compatibility & data length
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
0 to 64
15
1 1 1
7
CRC ACK delimit. delimit.
Data field useful data (max 8 byte)
CRC field Cyclic redundancy check
ACK slot
End of frame (EOF)
12
4 Types Of Frames ●
Data Frame ●
●
transport data from a producer to consumers without any guarantee that it will be processed.
Remote Frame identifier will have the same value as that of the request).
●
Error Frame ●
●
transmitted when a station detects the presence of errors on the bus.
Overload Frame ●
sent to ask for an additional time lapse between successive frames (data or request).
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
13
Protection Mechanisms ●
Very Reliable – Hamming Distance = 6
●
At bit level ●
●
At frame structure level ●
●
the delimiters CRC Delimiter, ACK Delimiter, End of Frame, Error Delimiter, Overload Delimiter are integrated to enable the structure to be checked.
At content validity level ●
●
when 5 identical bits are transmitted, an additional "stuffing" bit with the opposite value is introduced intentionally. This bit is tested and eliminated by the receiver.
a Cyclic Redundancy Check (CRC) is used to detect possible transmission errors.
ACK slot ●
this window enables the transmitter to know that his message has been received correctly by at least one receiver (dominant bit).
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
14
Robust EMC Behavior ●
Effects of disturbances are minimized Separate GND line ● Differential signal transmission ●
●
Short data frames (8 bytes maximum) Data can still be transmitted in environments that are severely electromagnetically disturbed ● Retransmit only the lost data (not the whole telegram) ●
t
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
15
Non Destructive Bus Access ●
Prior messages will always be transmitted
●
No telegram loss – no collision (CSMA-CA)
S O F
10
9
8
7
6
5
4
3
2
1
0
R T R
CANopen device 1
0
0
0
1
1
0
0
0
0
0
0
1
0
CANopen device 63
0
0
0
1
1
0
1
Resulting CAN frame
0
0
0
1
1
0
0
0
0
1
0
Identifier
Control Field
Data Field
listing only 0
0
‘0’ is the dominant value
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
16
Application Layer Producer / Consumer Model ● Flexible Data Transmission ● Data Stored in EDS Files ●
Electronic Data Sheets per device ● CANo en Ob ects reached thanks to Index and SubIndex ●
Index
Objects
0x0000
Reserved
0x0001 – 0x009F
Data Types Area
0x00A0 – 0x0FFF
Reserved
0x1000 – 0x1FFF
Communication Profile Area
Describes the objects associated with communication.
0x2000 – 0x5FFF
Manufacturer Specific Profile Area
Describes the "application" objects specific to the manufacturer.
0x6000 – 0x9FFF
Standardised Device Profile Area
Describes the "application" objects standardised by CiA.
0xA000 – 0xFFFF
Reserved
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
Description
Defines the various types of variables used: bytes, words, signed, unsigned, etc.
17
Functions to Set from DS-301 ●
Network administration ●
●
PDO = Process Data Object (producer-consumer model) ●
●
used for high-speed transmission of process data (<= 8 bytes) – Implicit xc ange
SDO = Service Data Object (client-server model) ●
●
messages are used for starting the bus, assigning identifiers, parameter setting and NMT (Network Management) monitoring (master-slave model)
transmission of parameter setting data (with segmentation can be > 8 bytes) (not time-critical) – Explicit Exchange
SFO = Special Function Object ●
predefined messages for managing synchronization, time references, fatal errors.
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
18
PDO: 2 parameters
●
PDO Mapping Parameter Which Data to produce / receive ● Object from the EDS file ●
●
PDO Communication Parameters Which target – identifier (COB-ID): Slave to slave synchronization possible ● Transmit / receive modes ● Inhibit time (time between 2 PDO) ●
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
19
Transmission Modes ●
Synchronous: by receiving a SYNC object Acyclic: ●transmission is pre-triggered by a "Remote Transmission request" ●transmission is pre-triggered by the occurrence of a "Specific event" object in the device profile (most of the time, change of state) ● Cyclic: ●transmission is triggered periodically after each 1, 2 or up to 240 SYNC objects ●
●
Asynchronous: transmission is triggered by a "Remote Transmission request" ● transmission is pre-triggered by the occurrence of a "Specific event" object in the device profile ●
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
20
Transmission Modes (Cont.)
Be careful with analog values ! ● Flexibility & Performance ●
●
Responsiveness
– <1 ms for 256 digital I/Os at 1Mbit/s
Inhibit Time ●
Used to ensure less prioritized PDO to be produced
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
22
SDO (Service Data Object) Explicit Messaging ● Client / Server Method ●
●
●
Close to Modbus request
Used at Bootup For Configuration
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
23
SFO ●
SYNC = Synchronization Object
●
EMCY= Emergency Object
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
24
SFO: Bus Monitoring ●
Node Guarding ●
●
master-slave concept (polling), allowing the bus manager to request (remote request) the status of each station at a configurable time interval.
Heartbeat ●
producer-consumer concept: the status of the station is generated cyclically at a configurable interval (less bus load & health check between devices possible)
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
25
Configuration with Unity Pro
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
26
2 Different Tools ●
Premium: TSX SCP 110 Module Sycon Software to configure the bus ● Unity Pro to integrate the configuration ●
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
27
2 Different Tools (Cont.) ●
M340: CANopen Configuration Tool Embedded inside Unity ● V2 Modules bring more functionalities (BMXP3420x0.2) ●
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
28
Embedded Devices ●
Included Devices
●
Additionnal Devices ●
Added thanks to the Hardware Catalog tool
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
29
Device Configuration ●
I/O Objects ●
IODDT generation
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
30
Device Configuration ●
Channel Function Represent a set of default configuration for a specific device ● Can be added / modify in the Hardware catalogue manager ●
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
31
Device Configuration ●
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 ●
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
32
Device Configuration ●
Config tab ●
Change the device parameters that will be send to the device during bootup
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
33
Master Configuration ●
Mapping (Inputs / Outputs Words) ●
●
Needs to be adapted to the correct size!
Bus Parameters ●
Baudrate, inhibit time, SYNC, etc…
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
34
Exercise ●
Add & Configure a CANopen Device (3-20) – Create a new configuration – Add a new device (Tesys U) and configure it – Configure the master – – Modify PDO parameters and observe the result – Modify the mapping and the configuration send
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
35
Explicit Exchange ●
SDO Executed Through Function Blocks ADDM: used to define the CANopen address of the targeted slave ● READ_VAR: to send a SDO read object request. ● WRITE_VAR: to send a SDO write object request. ●
●
SDO Online Test
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
36
ADDM FB ●
IN: ●
●
Out ●
●
String variable: ‘r.m.c.e’ Converted table of words, to be used in the others FB
‘r.m.c.e’ r = the rack number where the CANopen module is located, ● m = the slot number of the CANopen module, ● c = the channel used ● e = the equipment address (slave address) of the target ●
– 0.0.2.e
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
37
READ_VAR FB
●
IN: ADR: to be linked to the output of the ADDM block. ● OBJ: defining object to read (for CANopen: ‘SDO’) ●
●
●
OUT ●
●
NB: number of consecutive objects to read RECP: reception zone of the block, delivering the value read (table of words)
IN/OUT ●
GEST: table of 4 words to manage the communication block (errors, timeout, length, etc..)
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
38
WRITE_VAR FB
●
IN: ADR: to be linked to the output of the ADDM block. ● OBJ: defining object to read (for CANopen: ‘SDO’) ●
●
●
EMIS: source table to write from the PLC
IN/OUT ●
GEST: table of 4 words to manage the communication block (errors, timeout, length, etc..)
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
39
Exercise ●
Acyclic Requests SDO (3-27) – Monitor the faults of the device – Sending SDO using the debug tool to read fault code – Sending SDO using the READ_VAR to read fault code –
_ change a configuration parameter (comm loss fallback behaviour)
– Test the application
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
40
CANopen Application Management ●
Devices Function Blocks Library Tesys ● Motion & Drives ● Etc… ●
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
41
MFB Library ●
Library to manage Drives
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
42
MFB Library ●
Commonly Used
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
43
Compatible with AXIS ●
CANopen AXIS Axis linked to compatible devices only ● Schneider drives and on CANopen only with “MFB” function ●
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
44
Exercise ●
Manage a Drive with MFB (3-37) – Insert the ATV71 inside the configuration – Configure the ATV71 using the display – Insert MFB functions –
Industrial Communication Course with Unity Pro - CANopen Schneider Electric Vietnam | Truong Dinh Chau
45