background image

EtherCAT Communication

EPOS4 Communication Guide
CCMC  |  2019-11  |  rel8759

4-41

  

 

4

ETHERCAT COMMUNICATION

The functionality of the EPOS4 can be extended with an EtherCAT communication by using an EtherCAT 
Card in extension slot 1 or a Connector Board with EtherCAT functionality.

ETG.1000 V1.0.4: EtherCAT Specification (

[6])

corresponds with the international standard IEC 61158-x-12 Industrial communication networks – 
Fieldbus specifications (CPF 12: EtherCAT) (

[9])

ETG.1020 V1.2.0: EtherCAT Protocol Enhancements Specification (

[7])

ETG.2000 V1.0.9: EtherCAT Slave Information (ESI) Specification (

[8])

CiA 402 V4.0: CANopen Drives and motion control device profile (

[5])

corresponds with international standard IEC 61800-7 Ed 2.0; Generic interface and use of profiles 
for power drive systems – profile type 1 (

[10])

Reference

You may access all relevant data and the free-for-download documentation from the EtherCAT website at 

http://ethercat.org/. Navigate to the downloads section and search for the document “EtherCAT Technol-

ogy Introduction”.
The document “EtherCAT_Introduction_xxxx.pdf” will serve well as an introduction to EtherCAT and does 
include information on the technology, implementation, and possible applications.

For EPOS4 firmware and hardware, consult maxon's comprehensive documentation set available at 

http://epos.maxongroup.com. Among others, you will find the following documents:

EPOS4 FIRMWARE SPECIFICATION

Operating modes

Communication and error handling

Object dictionary

etc.

EPOS4 HARDWARE REFERENCE

Technical data

Wiring diagrams and connection overview

etc

EPOS4 APPLICATION NOTES

EtherCAT integration

etc

Summary of Contents for EPOS4

Page 1: ...EPOS4 Positioning Controllers Communication Guide CCMC Edition 2019 11 DocID rel8759 Communication Guide ...

Page 2: ...ABLE OF CONTENTS READ THIS FIRST These instructions are intended for qualified technical personnel Prior commencing with any activities you must carefully read and understand this manual and you must follow the instructions given therein EPOS4 positioning controllers are considered as partly completed machinery according to EU Directive 2006 42 EC Article 2 Clause g and are intended to be incorpor...

Page 3: ...ze you with the described equipment and the tasks on safe and adequate installation and or commissioning Follow the described instructions to avoid dangerous situations to keep installation and or commissioning time at a minimum to increase reliability and service life of the described equipment The present document is part of a documentation set and contains performance data and specifications in...

Page 4: ...d below and will not be further tagged with their respec tive trademark It must be understood that the brands the below list is not necessarily concluding are pro tected by copyright and or other intellectual property rights even if their legal trademarks are omitted in the later course of this document Table 1 2 Brand names and trademark owners Notation Explanation EPOS4 stands for EPOS4 Position...

Page 5: ...g 2 CiA 301 CANopen application layer and communication profile www can cia org 3 CiA 305 CANopen Layer setting services LSS and protocols www can cia org 4 CiA 306 CANopen Electronic device description www can cia org 5 CiA 402 CANopen Drives and motion control device profile www can cia org 6 ETG 1000 EtherCAT Specification www ethercat org 7 ETG 1020 EtherCAT Protocol Enhancements Specification...

Page 6: ...About this Document EPOS4 Communication Guide 1 6 CCMC 2019 11 rel8759 page inte ntionally left blank ...

Page 7: ...Frame OpCode BYTE 0x60 Len BYTE 2 number of words Parameters BYTE Node ID WORD Index of Object BYTE Subindex of Object Response Frame OpCode BYTE 0x00 Len BYTE 4 number of words Parameters DWORD Communication Error Code Definition on page 6 47 BYTE 4 Data Bytes Read Request Frame OpCode BYTE 0x81 Len BYTE 2 number of words Parameters BYTE Node ID WORD Index of Object BYTE Subindex of Object Respon...

Page 8: ... OpCode BYTE 0x62 Len BYTE 1 number of words Parameters BYTE Bit 0 Bit 1 7 ControlByte Toggle Bit Not used BYTE Dummy Byte without meaning Response Frame OpCode BYTE 0x00 Len BYTE 3 131 number of words Parameters DWORD Communication Error Code Definition on page 6 47 BYTE Length max 255 bytes BYTE Bit 0 Bit 1 Bit 2 7 ControlByte Toggle Bit Last Data Segment Not used BYTE 0 254 Data Bytes Read BYTE...

Page 9: ...ay communication is not supported Request Frame OpCode BYTE 0x68 Len BYTE 4 number of words Parameters BYTE Node ID WORD Index of Object BYTE Subindex of Object BYTE 4 Data Bytes to write Response Frame OpCode BYTE 0x00 Len BYTE 2 number of words Parameters DWORD Communication Error Code Definition on page 6 47 Request Frame OpCode BYTE 0x69 Len BYTE 4 number of words Parameters BYTE Node ID WORD ...

Page 10: ...BYTE Bit 0 Bit 1 Bit 2 7 ControlByte Toggle Bit Last Data Segment Not used BYTE 0 254 Data Bytes to write BYTE Dummy Byte when length odd Response Frame OpCode BYTE 0x00 Len BYTE 3 number of words Parameters DWORD Communication Error Code Definition on page 6 47 BYTE Length written max 255 bytes BYTE Bit 0 Bit 1 7 ControlByte Toggle Bit Not used Request Frame OpCode BYTE 0x70 Len BYTE 2 Parameters...

Page 11: ... read only if a SendLSS command has been executed before Request Frame OpCode BYTE 0x7A Len BYTE 4 Parameters BYTE 8 LSS master message Response Frame OpCode BYTE 0x00 Len BYTE 2 number of words Parameters DWORD Communication Error Code Definition on page 6 47 Request Frame OpCode BYTE 0x7B Len BYTE 2 Parameters WORD Timeout ms Response Frame OpCode BYTE 0x00 Len BYTE 6 number of words Parameters ...

Page 12: ...ent as an answer to a request All commands send an answer The master must always ini tiate communication by sending a packet structure The data flow while transmitting and receiving frames are as follows Figure 2 2 USB RS232 communication Commands Figure 2 3 USB RS232 communication Sending a data frame to EPOS4 Figure 2 4 USB RS232 communication Receiving a response data frame from EPOS4 ...

Page 13: ...on page 2 17 SYNC The first two bytes are used for frame synchronization DLE Starting frame character DLE Data Link Escape 0x90 STX Starting frame character STX Start of Text 0x02 HEADER The header consists of 2 bytes The first field determines the type of data frame to be sent or received The next field contains the length of the data fields OpCode Operation command to be sent to the slave For de...

Page 14: ... USB RS232 communication CRC algorithm ArrayLength Len 2 WORD DataArray ArrayLength Generator Polynom G x 10001000000100001 x16 x12 x5 x0 DataArray 0 DataArray 1 DataArray 2 DataArray ArrayLength 1 HighByte Len LowByte OpCode Data 0 Data 1 0x0000 CrcValue WORD CalcFieldCRC WORD pDataArray WORD ArrayLength WORD shifter c WORD carry WORD CRC 0 Calculate pDataArray Word by Word while ArrayLength shif...

Page 15: ... in this order byte0 LSB byte1 byte2 byte3 MSB 2 2 6 Data Format RS232 Data are transmitted in an asynchronous way thus each data byte is transmitted individually with its own start and stop bit The format is 1 start bit 8 data bits no parity 1 stop bit Most serial communication chips SCI UART can generate such data format 2 2 7 Timeout Handling The timeout is handled over a complete frame Hence t...

Page 16: ...USB RS232 Communication Data Link Layer EPOS4 Communication Guide 2 16 CCMC 2019 11 rel8759 2 2 8 Slave State Machine Figure 2 7 USB RS232 communication Slave State Machine ...

Page 17: ...nd Reference on page 2 7 B CRC CALCULATION For details chapter 2 2 3 Cyclic Redundancy Check CRC on page 2 14 2 Prepare the word DataArray for CRC calculation little endian Important Make sure that the CRC is calculated correctly If the CRC is not correct the command will neither be accepted nor processed CRC calculation includes all bytes of the data frame except synchronization bytes and byte st...

Page 18: ...nswer to the command ReadObject with an answer frame and the returned parameters in the data block as follows Reception order low byte first 0x90 0x02 0x00 0x04 0x00 0x00 0x00 0x00 0x01 0x90 0x90 0x00 0x00 0x9A 0x5C Important Do not send any data before the receive frame or a timeout is present EPOS4 cannot process data simultaneously E REMOVE BYTE STUFFING AND THE SYNCHRONIZATION ELEMENTS 10 Byte...

Page 19: ...h Valid 0x0000 CrcValue G CHECK 13 Check the EPOS4 receive frame Important If the error code is unequal to 0 zero the command was not processed Check chapter 6 Communication Error Code Definition on page 6 47 for error details Fix the error before attempting to resend the data frame Response frame OpCode BYTE Read object 0x00 Len BYTE Number of words 0x04 Parameters BYTE Node ID 0x01 DWORD Communi...

Page 20: ...xD RxD and GND The RS232 standard can only be used for point to point communication between a master and a single EPOS4 slave It uses negative bipolar logic with a negative voltage signal representing a logic 1 and pos itive voltage representing a logic 0 Voltages of 3 25 V with respect to signal ground GND are consid ered logic 1 whereas voltages of 3 25 V are considered logic 0 MEDIUM For the ph...

Page 21: ...tion on page 1 5 3 1 2 Notations Abbreviations and Terms used Table 3 5 CAN communication Notations Notation Description Format nnnnb Numbers followed by b binary nnnnh Numbers followed by h hexadecimal nnnn All other numbers decimal Abbreviation Description CAN CAN Application Layer CMS CAN Message Specification COB Communication Object CAN Message a unit of transportation in a CAN message networ...

Page 22: ...ss to the device s Object Directory WO Write Only Term Description CAN Client or CAN Master A host typically a PC PLC or other control device supervising the nodes of a network CAN Server or CAN Slave A node in the CAN network that can provide service under the CAN Master s control Object A CAN message with meaningful functionality and or data Objects are referenced according to addresses in the O...

Page 23: ...escribed similar to the ISO Open Systems Interconnection OSI Reference Model CANopen represents a standardized application layer and communication profile Figure 3 9 CAN communication Protocol layer interactions 3 2 1 Physical Layer CANopen is a networking system based on the CAN serial bus It assumes that the device s hardware fea tures a CAN transceiver and a CAN controller as specified in ISO 1...

Page 24: ...ta contained in the message The Cyclic Redundancy Check CRC field is used to detect possible transmission errors It con sists of a 15 bit CRC sequence completed by the recessive CRC delimiter bit During the Acknowledgment ACK field the transmitting node sends out a recessive bit Any node that has received an error free frame acknowledges the correct reception of the frame by returning a dominant b...

Page 25: ...R32 etc the subindex value is always zero For complex Object Dictionary entries such as arrays or records with multiple data fields the sub index references fields within a data structure pointed to by the main index An example A receive PDO the data structure at index 1400h defines the communication parameters for that module This structure contains fields or the COB ID and the transmission type ...

Page 26: ...smitted from one device producer to one another device consumer or to numerous other devices broadcasting PDOs are transmitted in a non confirmed mode The producer sends a Transmit PDO TxPDO with a spe cific identifier that corresponds to the identifier of the Receive PDO RxPDO of one or more consumers Figure 3 13 CAN communication Process Data Object PDO There are two PDO services The Write PDO i...

Page 27: ...by its firmware specification such as the separately available documents EPOS2 Firmware Specification or EPOS4 Firmware Specification The PDOs correspond to entries in the Object Dictionary and serve as an interface to objects linked to real time process data of the master s application code The application objects data type and their mapping into the master s PDOs must match with the slave s PDO ...

Page 28: ... by the occurrence of an object specific event specified in the device profile b Polling by remote frames The transmission of asynchronous PDOs may be initiated upon receipt of a remote request ini tiated by another device c Synchronized Synchronous PDOs are triggered by the expiration of a specified transmission period synchro nized by the reception of the SYNC object Figure 3 15 CAN communicatio...

Page 29: ...ay support more than one SDO one supported SDO is mandatory and the default case Figure 3 16 CAN communication Service Data Object SDO Read and write access to the CANopen Object Dictionary is performed by SDOs The Client Server Com mand Specifier contains the following information download upload request response segmented expedited transfer number of data bytes end indicator alternating toggle b...

Page 30: ...C Synchronous transmission of a PDO means that the transmission is fixed in time with respect to the trans mission of the SYNC Object The synchronous PDO is transmitted within a given time window synchronous window length with respect to the SYNC transmission and at the most once for every period of the SYNC The time period between SYNC objects is specified by the parameter communication cycle per...

Page 31: ...ps Module Control Services for initialization of NMT Slaves that want to take part in the distributed application Error Control Services for supervision of nodes and network s communication status Configuration Control Services for up downloading of configuration data from to a network module A NMT Slave represents that part of a node which is responsible for the node s NMT functionality It is uni...

Page 32: ...Setup Dynamic PDO Mapping and calculates PDO COB IDs Communication While initialization is active no communication is supported Upon completion a boot up message will be sent to the CAN Bus Reset Node 1 8 9 Initialization Pre Operational FALSE Generates a general reset of the EPOS4 software having the same effect as turning off and on the supply voltage Not saved parameters will be overwritten wit...

Page 33: ... node EPOS4 device with Node ID n will enter NMT State Pre Operational Reset Communication 0 0x82 0 all All CANopen nodes EPOS4 devices will reset the communication 0 0x82 n The CANopen node EPOS4 device with Node ID n will reset the communication Reset Node 0 0x81 0 all All CANopen nodes EPOS4 devices will reset 0 0x81 n The CANopen node EPOS4 device with Node ID n will reset Start Remote Node 0 ...

Page 34: ...ode Guard ing The predefined master slave connection set supports one emergency object one SDO four Receive PDOs and three Transmit PDOs and the node guarding object Table 3 13 CAN communication Objects of the default connection set Object Function Code binary Resulting COB ID Communication Parameter at Index NMT 0000 0 SYNC 0001 128 0080h 1005h EMERGENCY 129 255 0081h 00FFh 1014h PDO1 tx 0011 385...

Page 35: ...CANopen devices Communication between LSS Master and LSS Slaves is accomplished by LSS protocols which use only two COB IDs LSS master message from LSS Master to LSS Slaves COB ID 0x7E5 LSS slave message from the LSS Slaves to LSS Master COB ID 0x7E4 Layer Setting Services are only accessible in NMT slave state Stopped To enter Stopped state Stop Remote Node NMT Services on page 3 31 is used 3 5 1...

Page 36: ...ges state of one LSS Slave from Waiting to Configuration LSS command specifier 0x40 is used to submit the Vendor ID 0x41 to submit the Product Code 0x42 to submit the Revision Number 0x43 to submit the Serial Number Identity object 0x1018 EPOS4 Firmware Specification Then the single addressed LSS Slave changes to configuration state and answers by sending a command specifier 0x44 response Figure 3...

Page 37: ...ode ID 3 5 2 4 Configure Bit Timing Parameters By means of the service configure bit timing parameters the LSS Master must configure new bit timing The new bit timing will be active not before receiving Store Configuration Protocol or Activate Bit Timing Parameters Figure 3 28 LSS Configure Bit Timing Parameters cs 0x11 LSS Slave answers with error code and specific error error code 0 1 protocol s...

Page 38: ...3 30 LSS Switch Delay 3 5 2 6 Store Configuration Protocol Stores the communication parameters Node ID CAN bit rate and RS232 bit rate in a non volatile memory Figure 3 31 LSS Store Configuration 3 5 2 7 Inquire Identity Vendor ID Reads Vendor ID of a LSS Slave Identity object 0x1018 EPOS4 Firmware Specification Figure 3 32 LSS Inquire Identity Vendor ID switch delay The duration ms of the two per...

Page 39: ...tity Revision Number Reads Revision Number of a LSS Slave Identity object 0x1018 EPOS4 Firmware Specification Figure 3 34 LSS Inquire Identity Revision Number 3 5 2 10 Inquire Identity Serial Number Reads Serial Number of a LSS Slave Identity object 0x1018 EPOS4 Firmware Specification Figure 3 35 LSS Inquire Identity Serial Number 3 5 2 11 Inquire Identity Node ID Reads Node ID of a LSS Slave Iden...

Page 40: ... a binary network search can be implemented for the LSS Master This method sets the LSS address range to the full address area first then requests the identify remote slave The range which comprises one or more responded LSS Slaves will be split in two sub areas The request to the sub areas will be repeated until each LSS Slave has been identified Identity object 0x1018 EPOS4 Firm ware Specificati...

Page 41: ...Ed 2 0 Generic interface and use of profiles for power drive systems profile type 1 10 Reference You may access all relevant data and the free for download documentation from the EtherCAT website at http ethercat org Navigate to the downloads section and search for the document EtherCAT Technol ogy Introduction The document EtherCAT_Introduction_xxxx pdf will serve well as an introduction to Ether...

Page 42: ...e the Sync Manager Operation of the connected EPOS4 the Slave requires its prior initialization by the Master via the ESM Within the ESM transitions between certain states must follow a given scheme and will be initiated by the Master The Slave itself must not execute any transition For an overview of the EtherCAT State Machine Figure 4 39 for further descriptions as from Table 4 16 Figure 4 39 Et...

Page 43: ...essful completion the Master will change to state Operational Operational Acyclic as well as cyclic communication is active Master and Slave exchange setpoint and actual values EPOS4 be enabled and operated via the CoE protocol Bootstrap Only FoE is possible Mailbox Firmware download via FoE Transition Status IP Start of acyclic communication Mailbox PI Stop of acyclic communication Mailbox PS Sta...

Page 44: ...EtherCAT master environment separate document EPOS4 Application Notes chapter EtherCAT Integration 4 4 Error Code Definition For in detail information on error codes device specific errors and error handling methodology separate document EPOS4 Firmware Specification chapter Error Handling Parameter Address Bit Description Control 0x0120 3 0 0x01 Init Request 0x02 Pre Operational Request 0x03 Boots...

Page 45: ...tocol Sender Receiver Description 1 USB maxon specific or RS232 maxon specific USB or RS232 Master EPOS4 ID 1 Gateway Command including the Node ID is sent to the device working as a gateway The gateway decides whether to execute the command or to translate and forward it to the CAN Bus Criteria Node ID 0 Gateway Execute Node ID DIP switch Execute else other Node ID Forward to CAN 2 CANopen SDO EP...

Page 46: ...Gateway Communication USB or RS232 to CAN EPOS4 Communication Guide 5 46 CCMC 2019 11 rel8759 page inte ntionally left blank ...

Page 47: ...t index or subindex 0x0604 0041 PDO mapping error Object is not mappable to the PDO 0x0604 0042 PDO length error Number and length of objects to be mapped would exceed PDO length 0x0604 0043 General parameter error General parameter incompatibility 0x0604 0047 General internal incompatibility error General internal incompatibility in device 0x0606 0000 Hardware error Access failed due to hardware ...

Page 48: ...Communication Error Code Definition EPOS4 Communication Guide 6 48 CCMC 2019 11 rel8759 page inte ntionally left blank ...

Page 49: ...re 3 17 CAN communication Object dictionary access 29 Figure 3 18 CAN communication Synchronization object SYNC 30 Figure 3 19 CAN communication Synchronous PDO 30 Figure 3 20 CAN communication Emergency service EMCY 31 Figure 3 21 CAN communication Network management NMT 31 Figure 3 22 CAN communication NMT slave states 32 Figure 3 23 CAN communication NMT object 33 Figure 3 24 CAN communication ...

Page 50: ... communication Object dictionary entry 25 Table 3 10 CAN communication Communication objects 26 Table 3 11 CAN communication NMT slave commands transitions and states 32 Table 3 12 CAN communication NMT protocols 33 Table 3 13 CAN communication Objects of the default connection set 34 Table 3 14 LSS Commands Overview 35 Table 4 15 EtherCAT communication Communication specifications 42 Table 4 16 E...

Page 51: ...ntedWrite function 9 L LSS definition 21 M MAC definition 21 N No abort abort code 47 notations used in this document 4 O Object definition 22 Object does not exist error abort code 47 OD definition 21 OSI Reference Model 23 P Password error abort code 47 PDO definition 22 PDO length error abort code 47 PDO mapping error abort code 47 PLC definition 22 purpose of this document 3 R Read only error ...

Page 52: ...2019 11 rel8759 Index U USB communication 7 gateway 45 physical layer 20 V Value range error abort code 47 W Write only error abort code 47 WriteObject function 9 Wrong device state error abort code 47 Wrong NMT state error abort code 47 ...

Page 53: ...EPOS4 Communication Guide CCMC 2019 11 rel8759 Z 53 Index p age intention ally left blank ...

Page 54: ...her means of electronic data processing without prior written approval is not permitted The mentioned trademarks belong to their respective owners and are protected under intellectual property rights 2019 maxon All rights reserved Subject to change without prior notice CCMC EPOS4 Communication Guide Edition 2019 11 DocID rel8759 maxon motor ag Brünigstrasse 220 CH 6072 Sachseln 41 41 666 15 00 www...

Reviews: