Comprehensive guide to the EtherCAT protocol

Comprehensive guide to the EtherCAT protocol

EtherCAT has emerged as an important and dominant protocol in the field of industrial automation. As technology advances, the need for faster and more efficient communication between devices becomes crucial. EtherCAT, short for Ethernet for Control Automation Technology, is designed to meet these demands. Running on the standard Ethernet interface, EtherCAT offers high throughput and real time performance. Originally designed and developed by Beckhoff, a special group called EtherCAT Technology Group (ETG) was founded in 2003 to enable wider industry participation. Later it was standardized as part of IEC 61158 and IEC 61784-2 standards from 2007. Now it is one of the most adopted industrial fieldbus protocols for automation. 

In this article, we will provide you with an in-depth introduction to EtherCAT, delving into its various aspects to demystify this powerful protocol. 

OSI Layer Mapping of EtherCAT 

To understand how EtherCAT operates, it is essential to grasp its OSI Layer mapping. The Open Systems Interconnection (OSI) model is a conceptual framework that defines how network protocols interact and communicate with each other.  

EtherCAT OSI Mapping

At the lower level, EtherCAT operates primarily on the Physical Layer (Layer 1) and the Data Link Layer (Layer 2) of the OSI model. At the Physical Layer, EtherCAT utilizes standard Ethernet cabling and transmits data in a ring topology. The Data Link Layer, responsible for frame transmission and error detection, leverages the Ethernet MAC. At the higher levels, the EtherCAT directly operates from the Application layer. Without all the intermediate layers, the protocols overheads are significantly reduced thereby achieving a good real-time performance.   

Operating Principle of EtherCAT 

EtherCAT operates based on a unique principle known as "processing on the fly." This principle enables devices to process data in real-time as it passes through them, reducing delays and improving overall system performance. The key to this operating principle lies in the EtherCAT Slave devices, which are responsible for processing the data without the need for intermediate storage. Unlike the traditional Ethernet where a complete frame has to be received before processing, EtherCAT enables processing as and when the frame arrives.  

In an EtherCAT network, the EtherCAT Master Node sends a frame containing data and commands to all the EtherCAT Slave devices simultaneously. Each Slave device processes the data relevant to it and adds its own data to the frame as it passes through. This cascading effect allows for efficient data exchange between devices in a synchronized manner. The operating principle of EtherCAT ensures high-speed communication, low latency, and deterministic behaviour, making it ideal for time-critical applications. 

Exploring the Frame Structure of EtherCAT 

The frame structure of EtherCAT is one of the key elements that contribute to its efficiency and speed. At a high level the frame structure is similar to the standard Ethernet frame with EtherType set as 0x88A4 to indicate it is an EtherCAT frame. The source and destination addresses can be used to transfer broadcast, multicast or point specific frames. 

EtherCAT Frame Format

On the payload front, the EtherCAT frame consists of two sections: the EtherCAT header and the EtherCAT Datagrams. The header contains essentially the length of the Ethernet datagram without the FCS part. Each of the datagram has 10 byte “Datagram header”, followed by variable length data and a 2 byte Working counter. The contents of the datagram are captured in the below table: 

Thus, within a single Ethernet frame, multiple datagram packets are packed and sent to different slave nodes. 

EtherCAT Master Node 

The EtherCAT Master Node is a central component in an EtherCAT network. It initiates communication with the EtherCAT Slave devices and coordinates the data exchange process. The Master Node is responsible for configuring the network, synchronizing the devices, and ensuring the proper functioning of the EtherCAT network. 

The Master Node can be implemented with a standard Ethernet controller including a regular PC. The EtherCAT master assembles data into the frame and sends it out at the beginning of each cycle. The nodes read the data addressed to them, writes new data to it and sends it downstream. Once the end is reached the frame is returned back to the paster which then starts sending the next frame.  

Understanding the EtherCAT Sub Node 

In an EtherCAT network, the EtherCAT Slave devices are connected in a daisy-chain topology, forming a series of nodes. Each node in the network is referred to as an EtherCAT Sub Node. These Sub Nodes are responsible for processing the data relevant to them and passing it along to the next Sub Node in the chain. 

The Sub Nodes receive the EtherCAT frame from the previous node, extract the relevant data, and add their own data to the frame before passing it to the next node. This process continues until the frame reaches the EtherCAT Master Node. This EtherCAT Sub node can be achived with a specialized controller as it calls for a special “processing on the fly” capability. While such controllers were available earlier with dedicated FPGAs and ASICs, nowadays many modern industrial MCUs/MPUs support them as an in-built peripheral. 

EtherCAT Bus Topology 

EtherCAT operates the Ethernet line in full-duplex mode whereby one pair of line is used for sending the data frame from the master to all the slaves and another pair to transmit the return data from the last slave. Thus, it is a logical ring structure irrespective of the actual network topology being employed. This flexibility allows devices to be connected as line, tree, star—or any combination of them. As each slave daisy-chain the line, there is no need for network switches, eliminating precious delays associated with typical Ethernet switches. Even in case of a line break of a ring topology, the terminating nodes on both ends transmit the Ethernet frame back to the master thereby allowing the master to quickly identify the precise location of the break. EthernCAT has redundancy options for cables and even masters, enabling higher availability of the automation network. 

Achieving Synchronization in EtherCAT 

Synchronization is a critical aspect of EtherCAT, especially in applications where precise timing is required. EtherCAT achieves synchronization through Distributed Clocks, which allows all devices in the network to operate with a common and accurate time reference. Distributed Clocks in EtherCAT work based on the concept of a Distributed Clock Domain, where each device has its own clock that is synchronized to a common reference clock. The EtherCAT Master Node takes the role of the Clock Master and distributes the reference clock signal to all the Slave devices. This is achieved via a mechanism where each node adds the timestamp first during reception of downstream message and second time when the return message is being transmitted from the same node. The master uses this information to calculate the delay for each node. With this, the EtherCAT achieves deviation of less than 1 µs, which is equivalent to the IEEE 1588 Precision Time Protocol standard (PTP).  

Exploring the Different EtherCAT Profiles 

EtherCAT offers various profiles that define the functionality and behavior of devices in an EtherCAT network. These profiles ensure compatibility and interoperability between devices from different manufacturers. EtherCAT profiles cover a wide range of applications, including motion control, I/O devices, safety systems, and more. 

Each EtherCAT profile defines specific parameters, functions, and behavior that devices need to adhere to. These profiles ensure that devices from different manufacturers can seamlessly communicate and work together in an EtherCAT network. Some of the common profiles are Servo drive profile (SERCOS), CAN Application Protocol over EtherCAT (CoE), Ethernet over EtherCAT (EoE),  File Access over EtherCAT (FoE) and ADS over EtherCAT (AoE). 

Ethernet over EtherCAT - Tunneling TCP/IP 

EtherCAT-Tunneling TCP/IP is a revolutionary feature that allows EtherCAT frames to be transmitted over standard Ethernet networks. This feature enables EtherCAT to extend its reach beyond the boundaries of EtherCAT networks and communicate with devices in the internet realm.  

With Ethernet over EtherCAT, TCP/IP frames are encapsulated in EtherCAT packets and transmitted over Ethernet networks. With EtherCAT as the primary communication mechanism, the real time nature of the system is preserved without compromising the performance expected of the EtherCAN network. This brings the popular internet protocols like TCP/IP, MQTT, HTTP, HTTPS, VPN etc. on to this industrial automation network. 

Conclusion: Embracing the Power of EtherCAT 

In conclusion, EtherCAT is a revolutionary protocol that has transformed the field of industrial automation. Its unique operating principle, efficient frame structure, and synchronization capabilities make it a powerful tool for time-critical applications. Understanding the various aspects of EtherCAT, from the OSI Layer mapping to the role of the Master Node and Sub Nodes, is crucial for designing and implementing efficient EtherCAT networks. 

By exploring the different EtherCAT profiles and leveraging features like Ethernet over EtherCAT-Tunneling TCP/IP, engineers can harness the full potential of EtherCAT in their automation systems. Embracing the power of EtherCAT opens up new opportunities for faster, more efficient, and highly synchronized communication between devices. As technology continues to advance, EtherCAT is also evolving itself with versions like EtherCAT P,  EtherCAT G, playing a vital role in shaping the future of industrial automation. 

Reference:

Comprehensive guide to the EtherCAT protocol


To view or add a comment, sign in

More articles by Saravana Pandian Annamalai

  • Understanding the Intricacies of the Immobilizer Control Module

    Understanding the Intricacies of the Immobilizer Control Module

    In the realm of automotive security, the Immobilizer Control Module (ICM) stands as a pivotal component, safeguarding…

  • Necessity of Edge AI Systems

    Necessity of Edge AI Systems

    In the rapidly evolving world of technology, the concept of Edge AI systems has emerged as a game-changer…

  • Deployment models of AI Systems

    Deployment models of AI Systems

    In the rapidly evolving world of technology, Artificial Intelligence (AI) has emerged as a game-changer…

  • Application of Artificial Intelligence Systems

    Application of Artificial Intelligence Systems

    At its core, Artificial Intelligence is the field of computer science that focuses on the development of intelligent…

    1 Comment
  • A Comprehensive Introduction to Electric Vehicle Chargers

    A Comprehensive Introduction to Electric Vehicle Chargers

    As the world transitions towards a more sustainable future, electric vehicles (EVs) have become an increasingly popular…

  • Realization of AI Systems

    Realization of AI Systems

    Artificial Intelligence has emerged as a revolutionary force, reshaping the way we interact with technology and solving…

  • Classification of Artificial Intelligence Systems

    Classification of Artificial Intelligence Systems

    Further to the presentation I presented on Embedded AI, I thought of writing a series of articles on embedded AI…

  • Using Interrupts for context switching in RTOS

    Using Interrupts for context switching in RTOS

    As we are aware, embedded firmware is the software that powers a wide range of devices, from simple home appliances to…

  • Interrupt handling in RISC-V Architecture

    Interrupt handling in RISC-V Architecture

    Earlier in our introductory article on RISC-V interrupt handling, we explored the basics of RISC-V architecture, its…

  • Advanced Interrupt Handling in Linux

    Advanced Interrupt Handling in Linux

    In the world of Linux operating systems, interrupt service routines play a crucial role in managing hardware events…

Insights from the community

Explore topics