Hongke Technology | Hongke EtherCAT incremental encoder input module data acquisition practical test

Publisher:幸福花开Latest update time:2024-09-10 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Encoder Overview

An encoder is a device that compiles and converts signals or data into a signal form that can be used for communication, transmission and storage. The encoder converts angular displacement or linear displacement into electrical signals. The former is called a code disk and the latter is called a yardstick. According to the readout method, encoders can be divided into contact and non-contact types; according to the working principle, encoders can be divided into incremental and absolute types. The incremental encoder converts the displacement into a periodic electrical signal, and then converts the electrical signal into a counting pulse, and the number of pulses is used to indicate the size of the displacement. Each position of the absolute encoder corresponds to a certain digital code, so its indication is only related to the starting and ending positions of the measurement, but not to the intermediate process of the measurement.


In practical applications, the EtherCAT encoder can convert the original signal of the device into an EtherCAT communication signal, allowing the control system to take advantage of the EtherCAT protocol in providing nanosecond-level precise synchronization and flexible topology, thereby achieving precise and reliable control at a lower cost.


Hongke HK-MK5-5002 EtherCAT Encoder

Hongke HK-MK5-5002 encoder module is an incremental encoder acquisition module for RS422 differential output. It has a 32-bit quadrature decoding counter, a zero pulse, and a latch signal to read the latch position, and pass the count and latch results to the controller through bus communication, thereby realizing distributed encoder acquisition.

d69aaafc-cd39-11ed-ad0d-dac502259ad0.png

This module uses 4 times the frequency to sample and calculate the edges of all input signals, which can further improve the resolution and acquisition accuracy.

d6ae845a-cd39-11ed-ad0d-dac502259ad0.png

The input channels, output channels, EtherCAT communication interface and power interface of Hongke HK-MK5-5002 all have corresponding LED indicator lights for quick observation and diagnosis of signal and command status.

Testing Process

Step.1

.1

Hardware Hookup

This article mainly tests the Hongke HK-MK5-5002-T000 encoder module to read encoder data. KPA Studio software is used as the virtual master station on the EtherCAT side. When the encoder is turned, the data collected by the MK5 5002 encoder module is detected online on KPA.


Before conducting a communication test, you must first make hardware connections to the MK5-5002-T000 encoder module. The figure shows the hardware after the connection is completed:


d6e13800-cd39-11ed-ad0d-dac502259ad0.jpg


The encoder A/B/Z differential signals are connected to the terminals corresponding to channel 1 of the HK-MK5-5002 module respectively; the encoder power lines are connected to the terminals corresponding to 5V and 0V of the HK-MK5-5002 module respectively;


The power input of HK-MK5-5002 is used to power the communication system or the field equipment, and has electrical isolation. Its sturdy metal casing can provide excellent electromagnetic shielding and heat dissipation performance, and the IP30 protection level ensures stable use in harsh industrial production environments. It is very safe and reliable.

Step.2

Hongke KPA Studio Configuration

Hongke KPA Studio is a tool software for configuring, debugging and diagnosing EtherCAT networks. The software has the following two main uses:

(1) Connect to the EtherCAT master developed by KPA's master protocol stack to perform EtherCAT network configuration and diagnosis.

(2) Cooperate with KPA's EtherCAT master software (MRT) to debug various EtherCAT slaves, such as servos, IO, etc.


The configuration steps are as follows:

1) After KPA Studio and MRT_WIN32 are installed, double-click Master (Win32) to open MRT. When you open the background task, there is the running icon of MRT.


d7033e0a-cd39-11ed-ad0d-dac502259ad0.png


2) Double-click "studio" to open the KPA Studio software, and click "Run without license" to enter the operation interface.


d72d738c-cd39-11ed-ad0d-dac502259ad0.png


3) The interface after opening the KPA Studio software is as follows:


d73dc9bc-cd39-11ed-ad0d-dac502259ad0.png


•Menu bar: can open help documents, set basic software options, open data recording, frame recording and other tools;

• Toolbar: tools for creating new projects, connecting to master stations, deleting master stations, topology display, etc.;

•EtherCAT network topology window: used to configure the EtherCAT network, such as slave order, number of slaves, etc.;

•Master-slave station configuration/operation window: configure various parameters of the master and slave stations, operate the master and slave stations, such as switching state machines, modifying process data and mailbox data, etc.;

•Slave ESI file window: displays slave ESI file information and can import slave ESI files;

•Diagnostic window: Displays various status information and diagnostic information.

4) Import the slave ESI file

Before scanning a slave station, please import the ESI file of the slave station into the Studio software so that Studio can automatically match the corresponding ESI file after scanning the slave station.

In the ESI file window, right click and select Open slaves library folder.


d75f0168-cd39-11ed-ad0d-dac502259ad0.png


After opening the path, copy your slave ESI file to this path.

Return to the ESI file window, right-click and select Reload slaves library to complete the import.


d788f324-cd39-11ed-ad0d-dac502259ad0.png


At this point, in the slave ESI library, find the slave ESI file of HK-KB as shown in the figure, which means the import is successful.

d7a2044a-cd39-11ed-ad0d-dac502259ad0.png

Step.3

Signal acquisition test

1) First, connect to the local master, i.e. Master (WIN32), click connect in the figure, after successful connection, select the device network card Usb 3.0 to Gigabit Ethernet Adapt, which is used to send EtherCAT messages, as shown below.


d7be4222-cd39-11ed-ad0d-dac502259ad0.png


2) Use HK-MK5-5002 channel 1 to collect encoder values, insert the network cable, connect the master station, and power on the HK-MK5-5002 module. In the topology window, right-click Master1 - Scan configuration to scan the connected slave stations.


d7da5228-cd39-11ed-ad0d-dac502259ad0.png


3) If the wiring is normal and the slave is online, the slave can be scanned. As shown in the following figure, the HK-MK5 5002 EtherCAT slave has been scanned.


d7fa8c8c-cd39-11ed-ad0d-dac502259ad0.png


4) The master station scans out the slave station module HK-MK5-5002, click Master 1 with the mouse, and then click State in the master-slave station operation port to enter the OP state as shown in the figure.


d8166d6c-cd39-11ed-ad0d-dac502259ad0.png


5) In the KPA software, click Process Image with the mouse, and then rotate the encoder. You can observe that the value of PDO (6000:08-Counter value) changes as the encoder rotates (the following figures show the data collection effects when the encoder rotates forward and reverse respectively).


d82f4986-cd39-11ed-ad0d-dac502259ad0.png


d84e9354-cd39-11ed-ad0d-dac502259ad0.png


If the encoder rotation direction is opposite to the counting direction, the reverse counting function can be enabled by setting the object dictionary 0x8000.3 (Enable direction inversion) to 1. If you need to set parameters through CoE, you need to switch the slave state machine to Pre-OP first. After setting, you need to assign 0x1234 to the object dictionary F003.01 (Save Current Paremeters) to save the current parameters so that they will not be lost when power is off. Finally, the slave state machine will be in OP state.


Summarize

Hongke HK-MK5-5002 encoder module is an incremental encoder acquisition module for RS422 differential output, with 32-bit orthogonal decoding counter, and zero pulse, latch signal latch can read the latch position, and pass the count and latch results to the controller through bus communication, so as to realize distributed encoder acquisition. The module uses 4 times the frequency to sample and calculate the edges of all input signals, which can further improve the resolution and acquisition accuracy.

Reference address:Hongke Technology | Hongke EtherCAT incremental encoder input module data acquisition practical test

Previous article:Hongke Solution | How to choose between Hongke Industrial Raspberry Pi and PLC?
Next article:Hongke Case | Using Hongke Phase Sequence Monitoring Relay to Ensure Safe Operation of Screw Conveyor (Auger) System

Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号