0% found this document useful (0 votes)
2 views6 pages

Design and Implementation of Ethercat Slave Based On Arm Cortex-M0

This paper discusses the design and implementation of an EtherCAT slave module based on the ARM Cortex-M0 microcontroller, featuring eight 16-bit input and output ports. The experimental results indicate that the module meets real-time requirements for industrial automation, demonstrating its effectiveness in machine control applications. Future work will focus on adapting the EtherCAT master for various embedded platforms to enhance connectivity with the proposed slave module.

Uploaded by

Max Bondaruk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

Design and Implementation of Ethercat Slave Based On Arm Cortex-M0

This paper discusses the design and implementation of an EtherCAT slave module based on the ARM Cortex-M0 microcontroller, featuring eight 16-bit input and output ports. The experimental results indicate that the module meets real-time requirements for industrial automation, demonstrating its effectiveness in machine control applications. Future work will focus on adapting the EtherCAT master for various embedded platforms to enhance connectivity with the proposed slave module.

Uploaded by

Max Bondaruk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Design and Implementation of EtherCAT Slave Based

on ARM Cortex-M0

Yu-Wei Huang1 and Chih-Hung Wu2,


1
Graduate Institute of Vehicle Engineering, National Changhua University of Education,
Changhua 50007, Taiwan
2
Department of Game and Product Design, Chienkuo Technology University, Changhua
50094, Taiwan

Abstract. In this paper, EtherCAT slave module design and implementation


based on Cortex-M0 is carried out. This paper designs a slave module with
EtherCAT slave controller (ESC) and Cortex-M0 microcontroller. The slave
module has eight 16-bits input ports and eight 16-bits output ports. The
experimental results show that performance of the slave module can meet the
real-time requirements in industrial automation. Combining with other modules,
it could satisfy the varieties of control functions needed. It is easy to be made
and operated.

Keywords: EtherCAT slave, Cortex-M0, Microcontroller.

1 Introduction

With the requirement of industrial automation, Ethernet technology applied to


industrial control systems become an important area for its cost and fast speed
communication. The industrial fieldbus requires quick response time less than 1ms. In
order to meet the requirements, varieties of solutions based on Ethernet are
proposed[1-4]. Real time Ethernet is based on conventional Ethernet technology. It
could meet the requirements of fast speed communication in industrial control.
Fast development of Ethernet technology let more and more deployment and
application of real-time Ethernet technology used in industry, and EtherCAT
(Ethernet for Control Automation Technology) having less cycle time and high
bandwidth is better to be considered applying. EtherCAT is a high-performance
industrial network system based on the Ethernet system, so it is suitable used on
machine control and automation in industry and can reduce development time.
In this paper, a solution of EtherCAT slave controller based on Cortex-M0 has
been proposed. The slave module combines EtherCAT slave controller (ESC),
microcontroller and input/output ports. The EtherCAT Controller Slave chip is
Beckhoff ET1100. The microcontroller is NUC140VE3AN with ARM Cortex-M0. It
has eight 16-bits input ports and eight 16-bits output ports. The experimental results
show that performance of the slave module can meet the real-time requirements in
industrial control fields.

 Chih-Hung Wu (E-mail: [email protected]), ICITES


2 EtherCAT Technology

Each EtherCAT slave node can transmit Ethernet frames in a short cycle time. The
physical layer of EtherCAT uses the standard Ethernet technology, so the
conventional Ethernet cables, connectors and tools are available. Because EtherCAT
master adopts a standard network controller, it is very cost-effective without special
hardware required.
EtherCAT uses standard IEEE 802.3 Ethernet frames and it has a reserved
EtherType of 0x88A4. The EtherCAT Slave Controller processes the frame in
hardware. An EtherCAT frame is subdivided into the EtherCAT header followed by
one or more EtherCAT datagrams as shown in Fig. 1[5]. The EtherCAT frame has at
least one EtherCAT datagram. If the minimum Ethernet frame size requirement is not
fulfilled, padding bytes have to be added. Otherwise the length of EtherCAT frame is
equal to the sum of all EtherCAT datagrams plus EtherCAT frame header.

Fig. 1. Ethernet Frame with EtherCAT Data Format

Fig. 2 shows the structure of an EtherCAT frame. EtherCAT frame consists of


header and at least one EtherCAT datagram. The Length of the EtherCAT datagrams
is specified with 11 bits. The protocol type has 4 bits. Only EtherCAT command
(Type = 0x1) is currently processed by ESCs.

Fig. 2. The structure of EtherCAT Frame

Fig. 3 shows the structure of an EtherCAT datagram. Each datagram has header,
data and working counter. The working counter counts the number of devices that
were successfully addressed by this EtherCAT datagram.

Fig. 3. The structure of an EtherCAT datagram


Instead of store and forward, EtherCAT passes the Ethernet frame through each
salve node on the fly shown in Fig. 4. When frame passing through each node, the
data is read and written in units of several nanoseconds to each corresponding area.
The Ethernet frame is transmitted from the EtherCAT master throughout all slave
nodes, and then sent back to the EtherCAT master by the last slave node. With this
mechanism, EtherCAT achieves real time requirement of high-speed data
transmission.

Fig. 4. EtherCAT frame pass through network

EtherCAT slave controllers utilize a device called a Fieldbus Memory


Management Unit (FMMU) that can read, write and forward EtherCAT Ethernet
packets on-the-fly. FMMU convert logical addresses into physical addresses by the
means of internal address mapping. Thus, FMMUs allow using logical addressing for
data segments that span several slave devices: one datagram addresses data within
several arbitrarily distributed ESCs. Each FMMU channel maps one continuous
logical address space to one continuous physical address space of the slave.
The registers in each slave that can be mapped by the FMMUs are known as
Process Data Objects (PDOs). EtherCAT exchanges PDO data bi-directionally
between the master and multiple slaves. In this paper, the first EtherCAT slave
configured FMMU to map logical address 0x01000000 to physical register 0x1100
for output ports. Then, FMMU of second EtherCAT maps logical address
0x01000010 to physical register 0x1180 and so on.

3 Design of EtherCAT Slave

The slave module combines EtherCAT Piggyback controller boards FB1111-014X,


NuTiny-SDK-NUC140 development board, input/output ports and other circuits.
The EtherCAT Piggyback controller boards FB1111-014X combine an ET1100
EtherCAT Slave Controller, two EtherCAT ports and a PDI-Connector on a printed
circuit board. The ET1100 takes care of the EtherCAT communication as an interface
between the EtherCAT nodes. The ET1100 is used as a part of a microcontroller
design with 2 EtherCAT communication ports. The Process Data Interface (PDI) is
used to communicate with external hardware.
NuTiny-SDK-NUC140 is the specific development board for NuMicro NUC140
series[6]. Users can use NuTiny-SDK-NUC140 to develop and verify the application
program easily. NuTiny-SDK-NUC140 includes two portions. NuTiny-EVBNUC140
is the evaluation board and Nu-Link-Me is its Debug Adaptor. Thus, users do not
need other additional ICE or debug equipment. NuTiny-EVB-NUC140 uses the
NUC140VE3AN microcontroller to design, develop and verify applications for a real
time system.
The asynchronous microcontroller NUC140 interface uses demultiplexed address
and data busses to reduce pins. The width of bidirectional data bus is 16 bits. The
NUC140 equips an external bus interface (EBI) for external device used. The EBI
supports device whose address bus and data bus are multiplexed. For the external
device with separated address and data bus, the connection to device needs additional
logic to latch the address. The address latch enable (ALE) signal can differentiate the
address and data cycle. The signals of connection between NUC140 and FB1111 are
shown in Fig. 5.

Fig. 5. The connection of EtherCAT slave module

The input/output connection panel has eight 16-bits input port and eight 16-bits
output ports. The NUC140 microcontroller gets Ethercat output from registers of
ESC and transfer to corresponding output ports. Then, NUC140 microcontroller gets
data from input ports and transfers data to register of ESC respectively. A 4-to-16 line
demultiplexer accepts four binary line inputs and provides 16 mutually exclusive
active LOW outputs. The demultiplexer sets only one of the 8 inputs and 8 outputs as
active.

Fig. 6. The appearance of EtherCAT slave module


4 Experiment and Result

The test system contains a master and three slave nodes. The master includes a PC,
standard Ethernet interfaces and TwinCAT software. The master connects EtherCAT
slave module with unshielded twisted pair. The connection of the devices is shown in
Fig. 4.
The I/O information of each EtherCAT slave is read from and entered in the
TwinCAT System Manager. The TwinCAT software scan slave devices, the screen of
inputs and outputs appeared as shown in Fig. 7. The operation state of EtherCAT
slave BOX 1 is in OP. There are no communication problems in EtherCAT slave
hardware circuit. Next, began the debugging of ESM(EtherCAT State machine)
configuration file and the driver programs.

Fig. 7. TwinCAT System Manager

The slave program consists of three parts: microcontroller initialization function,


ESC initialization function and main loop function as shown in Fig. 8. The
microcontroller initialization function includes pin function, PLL and CPU clock,
timer, EBI settings, etc. The ESC initialization function initializes EtherCAT slave
interfaces.
The main loop function consists of periodic process data and non-periodic events.
The ESM is responsible for the coordination of master and slave applications at start
up and during operation. State changes are typically initiated by requests of the master.
Master is acknowledged by the slave non-periodic event application after the
associated operations have been executed. I/O data processing of EtherCAT are
completed by the periodic process data function. In Operation state (OP), master
transfer EtherCAT frames through all slave nodes. The frames are processed by the
ESC on the fly. Data is read and written as the bits when passing the ESC.
Fig. 8. The flow chart of EtherCAT slave program

5 Conclusions and Suggestions

This paper presents a slave module that based on EherCAT technology and Cortex-
M0 microcontroller. The EherCAT frame passed through each slave node in units of
several nanoseconds, so the slave module can meet the real-time requirements in
industrial automation. With the excellent performance of the real-time EtherCAT
technology, it would be accepted by more and more developers in industry control
fields. For the future study, how to port the EherCAT master to various embedded
platforms connected with the proposed EtherCAT slave is a challenge.

Acknowledgments. This study was funded by grants from Foxnum Technology Co.,
Ltd.(project no. 302205501), so that the study can be completed smoothly.

References

1. Zhu, Z. H.; Wang Y. E.: The real-time technology research of industrial Ethernet in
control field. In: 2010 International Conference on Mechanic Automation and Control
Engineering (MACE), pp. 5274-5277. Wuhan, China(2010)
2. Dalimir Orfanus, Reidar Indergaard, Gunnar Prytz, Tormod Wien: EtherCAT-based
Platform for Distributed Control in High-Performance Industrial Applications. In: 2013
IEEE 18th Conference on Emerging Technologies & Factory Automation (ETFA), pp. 1-8.
Cagliari, Italy(2013)
3. Yiming, A.; Eisaka, T.: Development of an Ethernet protocol for industrial real-time
communications. 2004 IEEE International Symposium on Communications and
Information Technology, vol. 2, pp. 1122-1125. Japan (2004)
4. Decotignie, J. D.: Ethernet-Based Real-Time and Industrial Communications. Proceedings
of the IEEE, Vol. 93(6), pp. 1102-1117(2005)
5. Hardware Datasheet ET1100 EtherCAT Slave Controller, BECKHOFF, Germany(2010)
6. NuMicro NUC100 Series NUC130NUC140 Technical Reference Manual, NuMicro,
Taipei(2011))

You might also like