Manual EPOS2 ApplicationNotesCANopen
Manual EPOS2 ApplicationNotesCANopen
&!"
Positioning Controller
Application Note
"CANopen Basic Information"
Edition May 2008
EPOS 24/1, EPOS 24/5, EPOS 70/10, MCD EPOS 60W, EPOS2 50/5
Firmware version 2000h or higher
Introduction
The EPOS positioning controller is a digital positioning system suitable for DC and EC (brushless) motors with
incremental encoders in a modular package. The performance range of these compact positioning controllers
ranges from a few watts up to 700 watts.
A variety of operating modes allows all kinds of drive and automation systems to be flexibly assembled using
positioning, speed and current regulation. The built-in CANopen interface allows networking to multiple axis drives
and online commanding by CAN bus master units.
For fast communication with several EPOS devices, use the CANopen protocol. The individual devices of a
network are commanded by a CANopen master.
Objectives
This application note explains the functionality of the CANopen structure and protocol. The configuration process is
explained step by step.
Tool
EPOS Studio Version 1.30 or higher 280937, 302267, 302287, 317270, 275512, 347717, 300583
maxon motor ag Brünigstrasse 220 P.O. Box 263 CH-6072 Sachseln Tel.: 041/666 15 00 Fax: 041/666 16 50 www.maxonmotor.com
maxon motor control
EPOS Positioning Controller EPOS Application Note: CANopen Basic Information
Network Structure
The CAN interface of the maxon EPOS drives follows the CiA CANopen specification DS-301 Version 4.02
Application Layer communication profile and the DSP 402 Version 2.0 Device Profile Drives and Motion Control.
The CAN-Bus line has to be terminated at both ends with a termination resistor of typically 120 Ω.
Some EPOS Positioning Controller have an internal bus termination which can be switched on with a DIP-Switch:
Configuration
Follow the instructions step by step to set up a correct CAN communication.
Step 1: Use one of the PC CAN interface cards or PLC’s listed below. For all of these manufacturers
CANopen motion control libraries, examples and documentation are available. The latest version may
Master be downloaded freely at http://www.maxonmotor.com.
Recommended PLC's
Manufacturer / Contact Supported maxon Motion
Products Control Library
Beckhoff All offered CAN IEC 61131-3
> www.beckhoff.de cards Beckhoff Library
Note: All other CAN products of other manufacturers can also be used, however no motion
control library is available.
Step 2: The two-wire bus line has to be terminated at both ends with a termination resistor of 120 Ω.
CAN Bus Wiring The two-wires should be twisted and may be shielded depending on EMC requirements.
Connector J2 pin 1 “CAN high” Pin 1 “CAN high” Connector J2 pin 6 “CAN high”
Connector J2 pin 2 “CAN low” Pin 2 “CAN low” Connector J2 pin 7 “CAN low”
Connector J2 pin 5 “CAN GND” Pin 3 “CAN GND Connector J2 pin 4 “GND”
CAN shield connect to taphole Pin 4 “CAN shield” Cable shield soldered on
on EPOS 24/1 housing connector housing
female male
Figure 3: Connector (J2) Figure 4: CAN connector Figure 5: Pin assignment for
Molex Micro-Fit 3.0TM female and male D-Sub
4 poles (430-25-0400) connectors
Figure 6: Pin assignment for Figure 7: Pin assignment for female and male RJ45
female and male D-Sub connectors
connectors
EPOS2 50/5
The CAN-ID (= Node-ID) is set by DIP-Switch 1 ... 7.
All addresses from 1 ... 127 can be coded using the binary code.
Switch Binary code Value
1 20 1
2 21 2
3 22 4
4 23 8
5 24 16
6 25 32
7 26 64
Figure 10: DIP-Switch EPOS2 50/5
By setting DIP-Switch address 0 the CAN-ID can be configured by software (changing object
‘Node-ID’) > Range: 1 … 127.
Step 4: For the EPOS the following CAN bit rates are available:
CAN
Communication Object ‘CAN Bit rate’ Bit rate Max. line length
(Index 0x2001 Sub-Index 0x00) according to CiA DS-102
0 1 MBit/s 25 m
1 800 kBit/s 50 m
2 500 kBit/s 100 m
3 250 kBit/s 250 m
4 125 kBit/s 500 m
5 50 kBit/s 1000 m
6 20 kBit/s 2500 m
All devices on the CAN bus have to use the same bit rate! The maximum bit rate of a
CANopen bus depends on the line length. Use the EPOS Studio to configure bit rate by
writing the object ‘CAN Bit rate’ (Index 0x2001, Sub-Index 0x00) in the object dictionary.
Step 6: Use a CAN monitor program (supported by manufacturer of PC or PLC CAN interface) to
Communication check the current wiring and EPOS configuration.
Test
1. Reset all EPOS devices on the bus.
2. At power on the EPOS will send a boot up message.
3. Check that all connected devices send a boot up message (otherwise the EPOS
produces a “CAN in Error Passive Mode”.
4. Boot up message:
COB-ID = 0x700 + Node-ID
Data [0] = 0x00
For example the figure below shows the incoming message on CAN bus (EPOS Node-ID = 1)
by a CAN monitor from IXXAT.
SDO Communication
A Service Data Object (SDO) reads from entries or
writes to entries of the Object Dictionary. The SDO
transport protocol allows transmitting objects of any
size. The SDO communication can be used to
configure the object of the EPOS.
Nearly all objects of the EPOS object dictionary can be read and written using the non-segmented SDO protocol
(expedited transfer). Only the data recorder buffer needs to be read using the segmented SDO protocol. For this
reason only the non-segmented SDO protocol is explained in this application note. For a description of the
segmented protocol (Normal Transfer Type) have a look at the CANopen specification (CiA Standard 301).
Reading Object
Client => Data Data Data Data Data Data Data Data
COB-ID
Server [Byte 0] [Byte 1] [Byte 2] [Byte 3] [Byte 4] [Byte 5] [Byte 6] [Byte 7]
0x600 + Index Index Sub-
Reserved
Node-ID LowByte HighByte Index
Server => Data Data Data Data Data Data Data Data
COB-ID
Client [Byte 0] [Byte 1] [Byte 2] [Byte 3] [Byte 4] [Byte 5] [Byte 6] [Byte 7]
0x580 + Index Index Sub- Object Object Object Object
Node-ID LowByte HighByte Index Byte 0 Byte 1 Byte 2 Byte 3
Writing Object
Client => Data Data Data Data Data Data Data Data
COB-ID
Server [Byte 0] [Byte 1] [Byte 2] [Byte 3] [Byte 4] [Byte 5] [Byte 6] [Byte 7]
0x600 + Index Index Sub- Object Object Object Object
Node-ID LowByte HighByte Index Byte 0 Byte 1 Byte 2 Byte 3
Server => Data Data Data Data Data Data Data Data
COB-ID
Client [Byte 0] [Byte 1] [Byte 2] [Byte 3] [Byte 4] [Byte 5] [Byte 6] [Byte 7]
0x580 + Index Index Sub-
Reserved
Node-ID LowByte HighByte Index
Note: The ‘Abort Codes’ are described in the document 'EPOS Firmware Specification' in the section
'Communication Errors (Abort Codes)'.
Example Read
Read ‘Current Regulator P-Gain’ (Index 0x60F6 Sub-Index 0x01) from node 1
Example Write
Write ‘Current Regulator P-Gain’ (Index 0x60F6 Sub-Index 0x01) to node 1
Example Abort
Read ‘Unknown Object’ (Index 0x2000 Sub-Index 0x08) to node 1
PDO Communication
Process Data Objects (PDOs) are used for fast data transmission (real-time data) with a high priority. PDOs are
unconfirmed services containing no protocol overhead. Consequently, they represent an extremely fast and flexible
method of transmitting data from one node to any number of other nodes. PDOs can contain a maximum of 8 data
bytes that can be specifically compiled and confirmed by the user to suit his requirements. Each PDO has a unique
identifier and is transmitted by only one node, but it can be received by more than one (producer/consumer
communication).
The CANopen network management is node-oriented and follows a master/slave structure. It requires one device
in the network, which fulfils the function of the NMT (Network Management) Master. The other nodes are NMT
Slaves.
The CANopen NMT Slave devices implement a state machine, which brings every device in Pre-Operational state
automatically after power-on and internal initialisation. In this state the node may be configured and parameterised
via SDO (e.g. using a configuration tool), no PDO communication is allowed.
>To switch from Pre-Operational to Operational State, you have to send the ‘Start Remote Node Protocol’:
Start Remote Node Protocol
COB-ID CS (Byte 0) Node-ID (Byte 1) Functionality
0 0x01 0 (all) All EPOS (all CANopen nodes) will enter the Operational
NMT State
0 0x01 n The EPOS (or CANopen node) with the Node-ID n will enter
the Operational NMT State
>To switch from Operational to Pre-Operational State, you have to send the ‘Enter Pre-Operational Protocol’:
Enter Pre-Operational Protocol
COB-ID CS (Byte 0) Node-ID (Byte 1) Functionality
0 0x80 0 (all) All EPOS (all CANopen nodes) will enter the Pre-
Operational NMT State
0 0x80 n The EPOS (or CANopen node) with the Node-ID n will enter
the Pre-Operational NMT State
Note: More information about NMT Services can be found in the document ‘Communication Guide’.
PDO Transmissions
PDO transmissions may be driven by remote requests, event triggered and by the Sync message received:
- Remotely requested:
Another device may initiate the transmission of an asynchronous PDO by sending a remote transmission
request (remote frame).
- Synchronous transmission:
In order to initiate simultaneous sampling of input values of all nodes, a periodically transmitted Sync
message is required. Synchronous transmission of PDOs takes place in cyclic and acyclic transmission
mode. Cyclic transmission means that the node waits for the Sync message, after which it sends its
measured values. Its PDO transmission type number (1 to 240) indicates the Sync rate it listens to (how
many Sync messages the node waits before the next transmission of its values). The EPOS supports only
Sync rates of 1.
PDO Mapping
PDO Configuration
The following section explains step by step how the configuration has to be implemented for PDOs. For all changes
in the 'Object Dictionary' described below, use the EPOS Studio. For each step an example is noted for 'Receive
PDO 1' and 'Node 1'.
Step 1: The default value of the COB-ID depends on the Node-ID (Default COB-ID = PDO-Offset +
Configure Node-ID).
COB-ID
Otherwise the COB-ID can be set in a defined range.
All changed COB-IDs can be reset by 'Restore Default PDO COB-IDs' in the context menu on
’Object Dictionary’ view of the EPOS Studio.
Example: Object > ‘COB-ID used by RxPDO 1’ (Index 0x1400, Sub-Index 0x01):
Step 2: Type 0x01 TxPDOs The data is sampled and transmitted after the occurrence of
Set the SYNC.
Transmission
Type RxPDOs The data is passed to the EPOS and transmitted after the
occurrence of the SYNC.
Type 0xFD TxPDOs The data is sampled and transmitted after the occurrence of a
remote transmission request (RTR).
Type 0xFF TxPDOs The data is sampled and transmitted after the occurrence of a
remote transmission request or an internal event (value
changed).
Type = 0xFF
Step 3: Disable the PDO by wiring zero to the object 'Number of Mapped Application Objects in …'
Number of
Mapped Example: Object > 'Number of Mapped Application Objects in RxPDO 1' (Index
Application 0x1600, Sub-Index 0x00)
Objects
Value = 0x00
All PDOs are dynamic. 8 Bytes (64bit) can be mapped in a PDO (max. 8 Objects).
Note: All mappable objects are listened in the associated document “Firmware
Specification” (see tables Receive/Transmit PDO mapping objects).
Step 5: Enable the PDO by writing the value of the number of objects in 'Number of Mapped
Number of Application Objects in …’.
Mapped
Application Example: Object > 'Number of Mapped Application Objects in RxPDO 1' (Index
Objects 0x1600, Sub-Index 0x00)
Value = 0x03
Notes:
1
Data Field
The data field holds the NMT State. Each time the value of toggle changes between 0x00 and 0x80. Therefore the
following values for the data field are possible:
Heartbeat Protocol
The Heartbeat Protocol has a higher priority than the Node Guarding Protocol. If both are enabled, only the
Heartbeat Protocol is supported. The EPOS transmits a heartbeat message cyclically if the Heartbeat Protocol is
enabled (Heartbeat Producer Time 0 = Disabled, Heartbeat Producer Time greater than 0 = enabled). The
Heartbeat Consumer guards the reception of the Heartbeat within the Heartbeat Consumer Time. If the Heartbeat
Producer Time is configured on the EPOS it starts immediately with the Heartbeat Protocol.
Notes:
1
Data Field
The Data Field holds the NMT State: