01
EtherCAT Bus Protocol
1
EtherCAT System Composition
EtherCAT (Ethernet for Control Automation Technology) is an open architecture fieldbus system based on Ethernet, consisting of one master device and multiple slave devices. The master device uses a standard Ethernet controller, ensuring good compatibility; any computer with a network interface card and embedded devices controlled by Ethernet can act as the EtherCAT master.
For PC computers, the master controller can be developed using the EtherCAT Master protocol stack. EtherCAT slaves use dedicated slave controllers (ESCs), such as the dedicated integrated chips ET1100 and ET1200, or FPGAs integrated with EtherCAT communication functions via IP-Core. The EtherCAT physical layer utilizes standard Ethernet physical layer devices, with the transmission medium typically using 100BASE-TX compliant Category 5 UTP cables.
2
EtherCAT Operating Principle
The real-time industrial Ethernet EtherCAT fully utilizes the full-duplex transmission characteristics of Ethernet. It uses a master-slave mode for access control, where the master sends data frames to each slave, and each slave reads its own data from the data frame or inserts the data it needs into the data frame.
From the Ethernet perspective, an EtherCAT segment is an Ethernet device that receives and sends standard ISO/IEEE 802-3 Ethernet data frames. However, this Ethernet device is not limited to a single Ethernet controller and a corresponding microprocessor; it can consist of multiple EtherCAT slaves. These slaves can directly process the received messages, extract or insert relevant user data from the messages, and then pass the message to the next EtherCAT slave. The last EtherCAT slave returns the fully processed message, which is then sent to the control unit by the first slave as a response message.
EtherCAT slave devices read the corresponding address data as the message passes through their nodes, and input data is also inserted into the message as it passes, as shown in the figure below. This transmission method enables data communication within a cycle and improves bandwidth utilization, achieving a maximum effective data utilization rate of over 90%. Throughout the process, the message experiences only a few nanoseconds of delay.

Figure 1 Data Insertion into the Message
3
EtherCAT Bus Topology
EtherCAT supports various topological structures: linear, tree, and daisy-chain, etc. From a physical link perspective, basic topologies such as linear, tree, star, daisy-chain, and combinations of these topologies can be used for EtherCAT networks. Moreover, its topology is not limited by the number of cascading switches or hubs, greatly enhancing the wiring flexibility in different scenarios. From a data communication perspective, the most effective network connection methods are linear and tree structures, as well as composite topologies of these two structures. Many devices and I/O modules already have the required interfaces, so no additional switches are needed.

Since EtherCAT is based on traditional Ethernet, it can use standard Ethernet cables or optical fibers for connections. When using 100Base-TX cables, the distance between each station can reach 100 meters, and the entire network can connect up to 65,535 devices. Furthermore, EtherCAT supports hot connection, hot swapping, redundancy, and security features.
02
Hongke HK-MK5-5002 Encoder
1
Encoder Overview
An encoder is a device that encodes signals or data into a form suitable for communication, transmission, and storage. An encoder converts angular displacement or linear displacement into electrical signals; the former is called a code disk, while the latter is called a code ruler. Depending on the reading method, encoders can be classified into contact and non-contact types; based on working principles, encoders can be divided into incremental and absolute types. Incremental encoders convert displacement into periodic electrical signals, which are then transformed into counting pulses, representing the magnitude of displacement by the number of pulses. Each position of an absolute encoder corresponds to a specific digital code, so its reading only relates to the starting and ending positions of measurement, and not to the intermediate process.
In practical applications, EtherCAT encoders can convert the raw signals of devices into EtherCAT communication signals, allowing control systems to leverage the advantages of the EtherCAT protocol, such as nanosecond-level precise synchronization and flexible topology, thereby achieving precise and reliable control at a lower cost.
2
Hongke HK-MK5-5002 Module
The Hongke HK-MK5-5002 encoder module is an incremental encoder acquisition module with RS422 differential output. It features a 32-bit quadrature decoding counter, as well as a latch for zero pulse and latch signals, which can read the latched position and transmit the count and latch results to the controller via bus communication, achieving distributed encoder acquisition.

This module samples and calculates all input signal edges at a fourfold frequency, further improving resolution and acquisition accuracy.
The input channels and output channels of HK-MK5-5002, as well as the EtherCAT communication interface and power interface, all have corresponding LED indicators for quick observation and diagnosis of signal and instruction status.

3
Main Features
Key parameters of the Hongke HK-MK5-5002 encoder module:
-
Rated power supply voltage/V: 24 (-15% +20%);
-
Encoder input: Incremental encoder (A/B);
-
Channel count: 2 channels (EA + EB + EZ);
-
Input type: Differential;
-
Signal voltage/V: 0 ~ +5;
-
Pulse counting multiplier: 4 times / 2 times (default 4 times);
-
Pulse counting range: -2147483648 to +2147483648;
-
Support for reverse counting direction: Yes;
-
Hardware filtering: Supports 0-15 (default 8);
-
Electrical isolation: 500V;
-
Protection level: IP30;
HK-MK5-5002 power supply input can be supplied by the communication system or the field device side, with electrical isolation. Its sturdy metal housing provides excellent electromagnetic shielding and heat dissipation performance, with an IP30 protection level, ensuring stable use even in harsh industrial production environments, making it very safe and reliable.
03
Hongke HK-MK5-5002 Module Field Implementation
1
Device Installation
This module is designed with a compact size and can be directly mounted on machinery using a 35mm DIN rail.

2
Connecting Power
The module’s power supply design consists of two parts, Us and Up, corresponding to the communication system and the field load power supply, respectively. Separate power supplies effectively ensure that the communication system is not affected by the field-side power supply. Us is used for the module’s communication system power supply, while Up is for the field device side power supply. Users can use two isolated power converters to supply power to Us and Up respectively. When the field input/output signal circuit of the HK-MK5 series encoder module encounters abnormal conditions (such as power supply anomalies, load short circuits, surges), it can protect the communication circuit from being affected and prevent interference signals from the field from impacting the communication circuit.

3
Application Example
Using HK-MK5-5002 Channel 1 to Acquire Encoder Values:
-
Connect the encoder A/B/Z differential signals to the corresponding terminals of channel 1 of the HK-MK5-5002 module;
-
Connect the encoder power lines to the corresponding terminals of 5V and 0V of the HK-MK5-5002 module;
-
Insert the network cable to connect to the master station and power on the HK-MK5-5002 module;
-
The master station scans the slave module HK-MK5-5002, entering OP state;
-
Rotate the encoder to observe that the PDO (6000:08-Counter value) changes with the rotation of the encoder, with a default counting of 4 times;
-
If the rotation direction of the encoder is opposite to the counting direction, enable the reverse counting function by setting object dictionary 0x8000.3 (Enable direction inversion) to 1. If parameters need to be set through CoE, the slave state machine must first be switched to Pre-OP. After setting, save the current parameters by assigning 0x1234 to object dictionary F003.01 (Save Current Parameters) to ensure they are not lost when power is off, and finally switch the slave state machine to OP state.
04
Typical Applications
1
Packaging Industry
The HK-MK5-5002 encoder features safety, speed, multifunctionality, and compactness, making it particularly suitable for use in packaging machinery. High yield under efficient production conditions is key to the economic operation of modern production equipment in the packaging industry. Critical factors affecting production economic benefits include enhancing factory performance by accelerating various processes, optimizing production order control, and minimizing downtime.

2
Wind Power Industry
Accurate position and speed information are important measurement variables in the control loop of wind turbines. The HK-MK5-5002 encoder provides higher resolution and achieves high control quality through digital signal processing and active error correction. Flexible encoder systems are true all-rounders, providing information on position, speed, and acceleration, which can be directly integrated into status monitoring systems or integrated into the safety monitoring of systems through additional outputs.

3
Press Machine Molding Adjustment
The molding height of the press slider is achieved by adjusting the length of the connecting rod. There are two methods for adjusting the slider molding height: manual adjustment and automatic adjustment.
-
Manual adjustment uses tools to rotate the adjustment screw to change the molding height; the automatic adjustment method adjusts the molding height by rotating the molding motor forward or backward. Generally, small presses adopt manual adjustment, while medium and large presses, especially large closed presses, often have significant molding height adjustments, making manual adjustment inconvenient and requiring automatic adjustment.
-
Automatic adjustment means setting a target mold height value, controlling the molding motor’s rotation to raise or lower the slider, and monitoring the molding height position by reading the encoder’s value in real-time. When the target mold height is reached, the automatic adjustment is completed.

The HK-MK5-5002 EtherCAT interface high-resolution incremental encoder features intelligent diagnostic functions and high-speed data transmission capabilities, enabling high-precision measurement of position and speed in industrial automation applications. Its powerful diagnostic functions for parameters such as operating temperature and working time, along with early detection of errors, greatly enhance network stability; using the encoder to measure the molding height of the slider, the PLC reads or writes values, processes them, and obtains the current value of the slider molding height, thereby controlling the start and stop of the molding motor to achieve automatic adjustment of the slider.
4
Material Handling
The HK-MK5-5002 encoder can provide speed detection and precise steering angle monitoring for automated material handling vehicles, also known as Automated Guided Vehicles (AGVs), enabling good travel speed and orderly storage and retrieval of goods. Different loads of goods and materials are transported to designated locations, stacked, and placed into warehouses or removed. Only when the automated guided vehicles are accurately guided can the logistics center operate more efficiently. Sensors play a crucial role here.

05
Conclusion
With the continuous advancement of Smart Manufacturing 2025 and the increasing demand for industrial automation, applications of control systems in factory automation to mobile machinery are becoming increasingly widespread. This motion control application requires accurate and real-time mastery of the physical position information of mechanical equipment. Encoders, as devices that encode signals (such as bit streams) or data into forms suitable for communication, transmission, and storage, have become important feedback loop execution components in industrial automation control.
The real-time industrial Ethernet EtherCAT has rapidly developed in the modern control field due to its advantages of high performance, low cost, and ease of application, making it suitable for automated packaging, logistics warehousing, mechanical engineering, optoelectronics, and other fields.
Hongke Event Announcement
Hongke is a high-tech company with over 15 years of experience in the field of industrial automation, particularly in the industrial bus communication industry. The Hongke Intelligent Automation Division has engaged in deep cooperation with world-renowned industrial automation, energy management, and building automation experts in Europe and the United States, providing top-level communication protocol hardware and software solutions in the industry. The types of communication technologies involve industrial automation communication protocols [CAN, CANopen, EtherCAT, Profinet, Ethernet/IP, IO-Link, OPC UA, MQTT, TSN], energy management and building automation communication protocols [ASCII, BACnet, KNX, Modbus], and solutions include codes, chips/modules, circuit boards, gateways, I/O, industrial computers, relays, testing solutions, training, and development services. Therefore, Hongke is one of the very few suppliers in the domestic market with extensive technical experience in the OT field.
To accelerate the construction of an intelligent future for automated networks connecting all things and achieve coordinated action among multiple systems and efficient energy management, Hongke will hold a series of free live courses from October 24 to October 28 on the theme of “Energy Management and Automation”. Don’t miss out on the valuable insights!
