Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
166 views

Integration of Real-Time Ethernet in Linuxcnc: Using The Example of Sercos Iii

This document discusses integrating real-time Ethernet capabilities into the open-source CNC software LinuxCNC. Specifically, it focuses on integrating Sercos III, a real-time Ethernet protocol commonly used to control servo drives. The approach taken was to use a PC card that implements the Sercos III protocol stack to act as the Sercos III master, allowing LinuxCNC to transmit set values to servo drives in real time over Ethernet. Real-time capabilities were added to the Linux kernel and userspace to ensure deterministic and synchronous transmission of set values. This represents the first time an entirely open-source CNC system has been realized with real-time Ethernet communication abilities comparable to proprietary embedded CNC systems.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
166 views

Integration of Real-Time Ethernet in Linuxcnc: Using The Example of Sercos Iii

This document discusses integrating real-time Ethernet capabilities into the open-source CNC software LinuxCNC. Specifically, it focuses on integrating Sercos III, a real-time Ethernet protocol commonly used to control servo drives. The approach taken was to use a PC card that implements the Sercos III protocol stack to act as the Sercos III master, allowing LinuxCNC to transmit set values to servo drives in real time over Ethernet. Real-time capabilities were added to the Linux kernel and userspace to ensure deterministic and synchronous transmission of set values. This represents the first time an entirely open-source CNC system has been realized with real-time Ethernet communication abilities comparable to proprietary embedded CNC systems.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/273300642

Integration of real-time Ethernet in LinuxCNC: Using the example of Sercos


III

Article  in  The International Journal of Advanced Manufacturing Technology · June 2015


DOI: 10.1007/s00170-015-6786-y

CITATIONS READS

9 5,157

3 authors, including:

Elmar Wings Marcel Müller


Hochschule Emden/Leer Weidmüller Group
12 PUBLICATIONS   69 CITATIONS    21 PUBLICATIONS   101 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Corner Blending View project

Enhance Lighting for the Internet of Things (ELIoT) View project

All content following this page was uploaded by Elmar Wings on 06 November 2019.

The user has requested enhancement of the downloaded file.


Noname manuscript No.
(will be inserted by the editor)

Integration of Real Time Ethernet in LinuxCNC


Using the example of Sercos III

Elmar Wings · Marcel Müller · Marc Rochler

Received: date / Accepted: date

Abstract In recent years, open source software ap- 1 Introduction


plications based on the operating system Linux have
replaced previous proprietary software in many fields. The main task of the CNC is to control the relative
However, up to now the open source software commu- motion between the tool and the workpiece. For this
nity did not come up with an appropriate CNC solution. objective, the CNC processes drive specific set values
Particularly, the requirement for real time communica- from G-code to control the axes of the machine tool
tion between system components has been a major chal- in real time [15], [7]. Usually, an embedded hardware-
lenge. The paper at hand presents a new approach for based CNC is used to process these set values and to
the integration of Real Time Ethernet into LinuxCNC control the motion in real time. Though, also CNC ex-
developed at the Institut für Maschinen- und Anlagen- ist, that are entirely software-based. The latter are very
bau in Emden. For the first time a CNC system entirely cost efficient. Contrary to the embedded systems, it is
based on open souce software has been realized that can possible to use standard PC hardware. Hence, the need
compete with proprietary embedded CNC. to rely on hardware specific operating systems does not
apply. From a technical point of view, software-based
CNC can outperform their counterparts in three dif-
ferent aspects. First and foremost, since the CNC is
Keywords LinuxCNC · EMC · Real Time Ethernet · entirely implemented in software, it can be modified
Sercos III · CIFX 50-RE · NXIO 50-RE · Servo drive · to great extend. Second, the use of PC hardware is
CSB01 accompanied with the usability of standard interfaces
like Ethernet, the Universal Serial Bus (USB) and the
Peripheral Component Interconnect (PCI). The inte-
gration into a company’s network does not represent a
Institut für Maschinen- und Anlagenbau problem. Finally, modern PC hardware offers an excep-
Prof. Dr. E. Wings tional level of computing power, compared to embedded
Constantiaplatz 4 solutions. However, in order to utilize a software-based
26723 Emden
Tel.: +49 4921 807-1430 CNC to its full extend, it is necessary to establish a real
E-mail: Elmar.Wings@hs-emden-leer.de time software architecture that can interface with the
M. Müller, B.Eng. system components in the most efficient way possible.
Constantiaplatz 4 The algorithm for geometry processing and trajectory
26723 Emden generation within the CNC significantly determines the
Tel.: +49 4921 807-1481 achievable quality of the set values [7].
E-mail: Marcel.Mueller@hs-emden-leer.de
The paper at hand focuses on the path to trans-
M. Rochler, B.Sc.
Constantiaplatz 4
mit set values from the CNC to the axes. Both, the
26723 Emden generation and transmission of the set values have to
Tel.: +49 4921 807-1480 be performed in real time. Otherwise, the axes are not
E-mail: Marc.Rochler@technik-emden.de able to move synchronously. The result could be harm-
2 Elmar Wings et al.

ful vibration, increased chatter, poor surface finish and 4 Approach


a machined workpiece that does not show precise di-
mensional accuracy. Sercos III is using a master/slave arrangement to trans-
mit data between nodes. For that purpose, the Ser-
cos III master controls the timing. Usually, the CNC
2 State of the art provides the function of the Sercos III master. Other
nodes like servo drives or I/O modules are the con-
Particularly to control servo drives, the Real Time Eth- trolled slaves [23]. Whereas, in order to obtain a high
ernet protocol Sercos III is used to interconnect the level of flexibility, the master is realized by using the
servo drives with the control. Sercos III is deterministic PC card CIFX 50-RE from Hilscher Gesellschaft für
with short cycle times and guarantees a high level of Systemautomation mbH. The protocol stack will be ex-
synchronism (low jitter) [6]. Sercos III is used to con- ecuted on the PC card and can be replaced by other pro-
trol intelligent servo drives. These kind of drives pro- tocol stacks e.g. EtherCAT, PROFINET, Ethernet/IP
vide e.g. a closed-loop control which enables a decen- by loading another protocol specific firmware [13]. To
tralized control. Furthermore it relieves the CNC so establish communication with the CIFX 50-RE, it is re-
that it has more performance for other tasks like the quired to install the userspace I/O driver uio netx and
set value generation. Proprietary control systems from the library libcifx [10]. The library contains the hard-
Bosch Rexroth AG and Beckhoff Automation use Real ware specific application programming interface CIFX-
Time Ethernet for many years. API which is described in detail in [8].
LinuxCNC (formerly Enhanced Machine Controller
or EMC2) is a software-based CNC utilizing standard
PC hardware. This software is released under the terms 4.1 Real time in userspace
of the GNU GPLv2 (General Public Licence version 2).
This means, the control software is free of charge and The userspace I/O driver needs a real time capable
open souce [21]. userspace. Therefore, the mainline Linux kernel 3.4.9
LinuxCNC is a software for real time control, how- was patched to the real time kernel 3.4.9-rt17. Following
ever it doesn’t support Real Time Ethernet. Though this, the patched kernel and the userspace I/O driver
the protocols are standardized. Exclusive interfaces like uio netx are compiled and installed on a desktop PC
the parallel port and specific expansion boards are sup- with Ubuntu 10.04 Lucid Lynx. The RT Preempt patch
ported by LinuxCNC via ISA or PCI to control step- is used to patch the Linux kernel for real time. This
pers and servo drives [18]. A driver for Modbus is inte- guarantees a real time capable userspace since tasks
grated. Unfortunately, Modbus is not the best choice for with a higher priority can preempt tasks with lower
hard real time environments like motion control [18]. An priority, regardless if the preempting task runs in user-
EtherCAT driver is still under development and sup- space or kernelspace [22].
ports a few devices [17]. But until now, the EtherCAT This approach is not compatible with the standard
driver is not a part of the LinuxCNC master branch1 . repository of LinuxCNC [20] because the standard repos-
Currently, LinuxCNC spends a lot of time with step itory uses the Real Time Application Interface RTAI2
pulse generation for stepper motors or closed-loop con- to guarantee real time without a real time capable user-
trol for servo drives. space. The chosen repository[4] of LinuxCNC contains
EMC-RT-Preempt and the shared memory interface.
EMC-RT-Preempt is a variant of LinuxCNC which is
3 Objective compatible with RT Preempt3 and runs without RTAI.
The shared memory interface realizes the communica-
The objective of the development work carried out at tion between LinuxCNC and a third party software,
the Institut für Maschinen- und Anlagenbau was to in- which is outlined in the next sections.
tegrate a real time capable interface into LinuxCNC. So
that the advantages of intelligent servo drives are suit-
4.2 Interfaces
able for LinuxCNC. This can be seen in the example
of Sercos III. The solution shall enable the control of a
The solution is a self developed application written in
servo drive with LinuxCNC via Sercos III in real time.
C. This application is called Shared Memory Interface
For that purpose, the focus is on the cycle time and the
2
jitter. http://www.rtai.org
3
https://www.osadl.org/Realtime-Linux.projects-
1
http://git.linuxcnc.org/gitweb realtime-linux.0.html
Integration of Real Time Ethernet in LinuxCNC 3

to Real Time Ethernet, abbreviated SHM-RTE. As shown Layer 7


in figure 1, SHM-RTE uses the shared memory inter- Application Layer
face as a connection to LinuxCNC and handles data like LinuxCNC
Layer 6 SHM-RTE
set values and actual values. The dual port memory is
Presentation Layer
its interface to the Sercos III network. SHM-RTE uses Sercos III
the dual port memory to handle the transfer of the set Layer 5
values to the Sercos III slaves and the transfer of the Session Layer
actual values generated by the Sercos III slaves to Lin- Layer 4
uxCNC. For this purpose, the CIFX-API is used. The Transport Layer
Sercos III
data transfer from the dual port memory to the Sercos Layer 3
III slaves and vice versa is executed by the Sercos III Network Layer
protocol stack.
Layer 2 Modified Ethernet
Data Link Layer

Layer 1 Ethernet 802.3 PHY


Ubuntu with RT PREEMPT

Userspace
Physical Layer
SHM-RTE LinuxCNC
Fig. 2 Open Systems Interconnection Model
libcifx.so

4.3 Real time capability of SHM-RTE


Kernelspace

uio netx.ko As shown in figure 3, the real time capability of SHM-


RTE has to be established. For this purpose, the schedul-
ing policy FIFO and the highest real time priority 99
PCI are set for SHM-RTE according to listing 1, so that
Hardware SHM-RTE is capable to run in real time [14]. After this,
Master: CIFX 50-RE Slave the CIFX 50-RE is initialized with the choosen config-
uration.
Dual Port Memory Ethernet Ethernet 1 /* shm - rte . c */
2 # include < sched .h >
3 # define RTPRIO 99
4 # define SCHEDULER SCHED_FIFO
5 struct sched_param param_me ;
Fig. 1 Data transfer between LinuxCNC and a slave [10] 6 param_me . sched_priority = RTPRIO ;
7 s ch ed _ se t sc he d ul e r (0 , SCHEDULER , &
param_me ) ;

Listing 1 Define scheduling policy and real time priority [14]

Figure 2 represents this approach in the Open Sys-


tems Interconnection Model with its communication
layers. The Sercos III protocol stack is involved from 5 Transfer of set values
the application layer (7) to data link layer (2). The typi-
cal transport layer protocols like the Transmission Con- Today, the CNC is controlled by an NC program based
trol Protocol (TCP) or User Datagram Protocol (UDP) on G-code. This G-code can be generated manually or
and the typical network layer protocol Internet Proto- with a CAM software (computer-aided manufacturing)
col (IP) are not in use. Furthermore, the data link layer from a drawing, created with a CAD software (computer-
is modified to guarantee the data transfer in real time. aided design). The CNC processes this G-code, gener-
For this purpose, LinuxCNC and SHM-RTE work only ates drive specific set values and signals for other ac-
in the upper layers. LinuxCNC generates the set values tors, and considers signals from sensors. This section
and SHM-RTE provides these. The CIFX-API enables describes transferring generated set values to the ac-
SHM-RTE to access the dual port memory. Figure 3 to tors [15]. In one direction, the application SHM-RTE
5 show the functionality of SHM-RTE as a flow chart. copies the data from the shared memory into the dual
The application SHM-RTE is synchronized with Lin- port memory to provide data for the Sercos III mas-
uxCNC and the Sercos III cycle. For this purpose, all ter. In the other direction, the application SHM-RTE
applications work in real time. copies the data from the dual port memory into the
4 Elmar Wings et al.

shared memory to provide the data from the slaves for #1

LinuxCNC. This is shown in figure 4 to 5. Subsequent


in this paper we refer to an engraving machine with B
cartesian coordinates (x, y and z axis). But there is no
reason to restrict the approach to this machine type. Check access to
read from DPM

Start

No Read
Set Schedul- access?
ing policy FIFO
Set rt priority 99

Yes
CIFX API
config.nxd Initialize CIFX 50-RE
cifxs3m.nxf Dual Port
Memory Read data from DPM

No
Initialized? Error Disable read access

Yes

Check access to SHM


Establish connec-
tion to CIFX 50-RE

No Access No Wait for access


Established? Error
permitted? to SHM

Yes
Yes

#1 A

Fig. 3 Flow chart of SHM-RTE part 1


Shared
Write to SHM Memory

#2

5.1 From LinuxCNC to SHM-RTE via shared memory


Fig. 4 Flow chart of SHM-RTE part 2
LinuxCNC is modularized and built from several com-
ponents. These components are pieces of software with
different functions. For example, it can be a hardware HAL pins axis.0.motor-pos-cmd, axis.1.motor-pos-cmd
driver or an external program with HAL hooks like and axis.2.motor-pos-cmd, so that the set values for the
motion, which accepts motion commands. The com- x, y and z axis are available at the shared memory in-
ponents are interconnected in the Hardware Abstrac- terface. This is shown in figure 6. In addition to this,
tion Layer (HAL) and called HAL components. In the figure 6 denotes with dashed arrows that data are also
HAL of LinuxCNC, HAL pins enable the interconnec- transferable from SHM-RTE into LinuxCNC, e.g. to the
tion of HAL components through HAL signals. So, in graphical user interface (GUI).
addition to the machine configuration, a HAL config- To this point, the configuration is independent from
uration is needed. The HAL configuration defines the the connected slaves. The next description is hardware
components to be loaded and the interconnection be- specific and shows how to transfer the set values to eval-
tween them [16]. The HAL configuration file is called uation boards. The evaluation boards are used later
SharedMemory.hal [2] and comes with the chosen repos- in the section measuring system. For each hardware
itory [4]. It loads the component shm interface [1] and module, SHM-RTE needs a hardware specific structure
connects the HAL signals Xpos, Ypos and Zpos with with members which match to the data. For the eval-
this component. On the other side, these signals are uation boards, the structure is called NXIO50RE and
connected with the HAL component motion across its contains the member LED out of the data type float.
Integration of Real Time Ethernet in LinuxCNC 5

#2 Motion GUI

axis.0.motor-pos-cmd
axis.1.motor-pos-cmd
Shared
Memory Read from SHM
axis.2.motor-pos-cmd

Xpos Ypos Zpos

shm interface.0.float out z


shm interface.0.float out y
Check access to shm interface.0.float out x
write to DPM

SHM Interface

shmif data.float out x


No Write
access? shmif data.float out y
shmif data.float out z

Yes

Dual Port nxio50reCR.LED out


Write data to DPM Memory
nxio50reCN.LED out
nxio50reCL.LED out

Disable write access SHM-RTE

Fig. 6 Data transfer between LinuxCNC and SHM-RTE

No
Quit? B

[8]. If the connection has been successfully established,


the cyclic part of the application is able to start the
Yes
data transfer. According to the example from [8], mem-
A
ory pointers are used to copy process data images. The
array pabDPMMemory points to the input data image
while pabDPMMemory OUT points to the output data
Close connections
image. The arrays are mapped to the hardware specific
variables. For example, the content of nxio50reCL.LED out
is copied to pabDPMMemory OUT [4]. Inside the Ser-
End
cos III network, all these output data are handled as
Fig. 5 Flow chart of SHM-RTE part 3 parameter S-0-1502 while the input data are handled
as parameter S-0-1503.

In SHM-RTE, three variables are defined with the data


type of the structure NXIO50RE. One variable for each
SHM-RTE
module: nxio50reCL, nxio50reCN and nxio50reCR. The
members of the three variables are connected with the & pabDPMMemory OUT [4] & pabDPMMemory [20]
members from shmif data. The variable shmif data of
& pabDPMMemory OUT [12] & pabDPMMemory [12]
the type shmif data t is described in [3]. Its members
& pabDPMMemory OUT [20] & pabDPMMemory [4]
float out x, float out y and float out z contain the set
values for the x, y and z axis, generated by LinuxCNC.
Now, the set values are exported from LinuxCNC. They Master

are available in SHM-RTE. In the next step, the data


are transported to the Sercos III slaves. S-0-1502 S-0-1503

Slaves

5.2 From SHM-RTE to the slave via dual port memory


Fig. 7 Data transfer between SHM-RTE and a slave
To enable the transfer of data the driver for the CIFX
50-RE has been initialized. See detailed description in
6 Elmar Wings et al.

CIFX 50-RE NXIO 50-RE\CL NXIO 50-RE\CN NXIO 50-RE\CR NANL-C500-RE


Table 1 Timing configuration for Sercos III master
Slave 1: x axis Slave 2: y axis Slave 3: z axis
CH0 CH1
Port 3
CH1 CH0 CH1 CH0 IDN Timing Value in µs

Port 2 S-0-1002 tScyc 1000


S-0-1006 t1 500
NXIO 50-RE\CA NXIO 50-RE\CA S-0-1007 t4 250
Port 0 Port 1
S-0-1017[0] t6 0
S-0-1017[1] t7 1
Port 1 Port 0

7 Result

Fig. 8 System of measurement [12] The analysis of the measurement is done according to
[12]. 600,404 telegrams were analyzed. The chosen cycle
time was 1ms. Two diagrams of this analysis are shown
in figure 9 and figure 10. They show logarithmically
6 Measuring system scaled master data telegrams over the cycle time. In fig-
ure 9, only the master’s jitter is shown. The master’s
The efficiency of this approach is verified by a small jitter is caused by the CIFX 50-RE. The maximum jit-
measuring system. LinuxCNC produces set values for ter is 10ns and the standard deviation is 4ns. In figure
an engraving process with three axes. SHM-RTE han- 10, both the master’s and slave’s jitter are shown. The
dles the transfer of this data to three Sercos III slaves. slave’s jitter is caused by the three slaves. Due to the
For this purpose, three evaluation boards of the type full duplex characteristic of the built Ethernet network,
NXIO 50-RE are configured as Sercos III slaves accord- we have a logical ring topology with a physical line
ing to [11]. topology. This is the reason for more than three jitter
According to [13], these boards are interconnected peaks. The average cycle time is 1,000,003ns. The jitter
with the netAnalyzer PC card NANL-C500-RE and the is between -160ns and +170ns. The standard deviation
CIFX 50-RE via cat5e patch cables in a physical line is 26ns or 0.003%. According to [23], a jitter < 1µs is
topology as shown in figure 8. The boards are con- required for motion control applications. The maximal
nected to each other by Ethernet connection boards occurred jitter is 170ns. Therefore, this demonstrates a
NXIO 50-RE\CA. In figure 8, the cat5e patch cables reliable integration of Sercos III into LinuxCNC.
are drawn as arrows.
The CIFX 50-RE is configured as Sercos III master
with the FDT based frame application SYCON.net4
according to [9]. The timing configuration is shown in
table 1. As specified in [24], tScyc is the communication
cycle time, t1 is the AT transmission starting time, t4
is the feedback acquisition capture point and t5 is the
minimum feedback processing time, whereat t5 is deter-
mined by the slave. If t4 ≤ t1 − t5 , the feedback values
of the slave are transmitted in the same communication
cycle. This affords a dynamic response.
All Sercos III telegrams are sent out by the master,
passing through the NANL-C500-RE before they reach
Fig. 9 Analysis of master’s jitter for cycle time
the slaves. The telegrams are logged and visualized by
the netAnalyzer software in diagrams. For the purpose
of illustration, the set values for x, y and z axis are
mapped on the 32 LEDs of each board.
8 Integration of industrial grade hardware

The evaluation boards are not suitable for industrial


environments. Therefore, we define the integration of
4
http://www.hilscher.com/en/products/product- industrial grade hardware into LinuxCNC using the ex-
groups/software/configurator/syconnet ample of a servo drive via Sercos III.
Integration of Real Time Ethernet in LinuxCNC 7

data from the servo drive are transferred into Linux-


CNC. For that purpose, the HAL pins are connected
via HAL Signals.
These HAL pins and HAL signals can be of dif-
ferent types, such as bit, integer or float. Components
like the decomposer comp u32 xbit and the composer
comp xbit u32 are loaded to convert values from type
integer to several bits or to convert several bits to a
value of type integer. This is shown in figure 11. The
master control word consists of 16 bits (x ms 0 to x ms 15).
In figure 11, the master control word is set bitwise in
the GUI of LinuxCNC. These bits are composed into
Fig. 10 Analysis of master’s and slave’s jitter for cycle time
two intergers and are transmitted to the Sercos III mas-
ter. The Sercos III master and the Sercos III slave han-
dle this data as IDN S-0-0134.
8.1 Hardware configuration

For this purpose, the servo drive CSB01.1C-S3-ENS- GUI (pyvcp)

NNN-NN-S-NN-FW from Bosch Rexroth AG is config- pyvcp.x ms 0 pyvcp.x ms 15


ured for position control. In addition, the digital I/O x ms 0 x ms 15
interface of the servo drive is implemented. The con- comp-xbit-u32.2.in0 comp-xbit-u32.3.in7
figuration of the servo drive is done according to [5]
Compser (comp-xbit-u32) Composer (comp-xbit-u32)
for position control with cyclic command value input.
The following configurations are done for the Sercos III comp-xbit-u32.2.out comp-xbit-u32.3.out

master:
status out 3 status out 4
Consumer data
shm interface.0.status out 3 shm interface.0.status out 4
– master control word (IDN S-0-0134)
SHM Interface
– digital outputs (IDN P-0-1372)
– position command value (IDN S-0-0047) shmif data.status out 3 shmif data.status out 3

Producer data CSB01x.master control word [0] CSB01x.master control word [0]

– status word (IDN S-0-0135) SHM-RTE

– digital inputs (IDN P-0-1371)


pabDPMMemory OUT [2] pabDPMMemory OUT [3]
– position feedback value (IDN S-0-0051)
Master
The master control word is required to enable the drive’s
control. For detailed information see [5]. This servo S-0-0134
drive provides digital outputs and digital inputs. The
use is optional. The same also applies for the position Slave

feedback value because the control loop is closed by the


servo drive. Therefore, the focus is on the master con- Fig. 11 Data transfer to set the master control word
trol word.

8.2 HAL configuration


8.3 Visualization of signals
The manual [16] gives a detailed introduction in HAL
configuration and was used to connect all HAL pins. Values like the master control word can be used via G-
In SHM-RTE, the data for master control word, status code, manually set or visualized in LinuxCNC, if the
word, digital outputs and digital inputs are handled as HAL pins are well-defined and interconnected. Signals
integers. The position command value (also called set can be visualized in LinuxCNC via the Python Virtual
value) and position feedback value (also called actual Control Panel (PyVCP). This panel allows the defini-
value) are handled as floats. The consumer data are led tion of graphical elements in the Extensible Markup
out from LinuxCNC as HAL signals, while the producer Language (XML). A HAL signal like x ms 0 has to be
8 Elmar Wings et al.

connected to a graphical element like pyvcp.x ms 0. In cessfully realized at the Institut für Maschinen- und
this case, the graphical element pyvcp.x ms 0 is a check Anlagenbau5 . This was verified by 24-hours tests.
button. Such a check button is defined with the tag
checkbutton. For detailed information see [18]. In this
manner, the 16 bit master control word is set with 16 9 Other protocols than Sercos III
check buttons. Furthermore, HAL signals can be used
via G-code. With the presented approach, we have described the
integration of Real Time Ethernet in LinuxCNC using
the example of Sercos III. In addition to that, the CIFX
8.4 Using signals with G-code 50-RE supports further protocols to integrate further
hardware into LinuxCNC using other protocols than
Sercos III. In this case, the CIFX 50-RE needs only the
1 ( sample_progra m . nc )
2 ( Turn digital output on P0 = x_out_1 ) master protocol stack of the desired protocol and a new
3 M62 P0 configuration with the FDT based frame application
4 ( Turn digital output off P0 = x_out_1 ) SYCON.net. This is specified in [13]. As described be-
5 M63 P0 fore, the application SHM-RTE needs a hardware spe-
Listing 2 Using digital outputs with G-code cific structure with members which match to the data.
The CIFX 50-RE supports the master protocol stack for
Listing 2 shows an abstract from an NC program. It Sercos III, EtherCAT, Ethernet/IP and PROFINET.
demonstrates how to set a HAL signal via G-code. In Subsequent tests at the Institut für Maschinen- und
line 3, the command M62 P0 sets the digital output Anlagenbau have demonstrated that the approach is
P0. In line 5, the command M63 P0 resets the digital compatible with further protocols and further hard-
output. The digital output P0 is a HAL pin of the HAL ware. For example, the digital and analog I/O modules
component motion and is called motion.digital-out-00. EL1014, EL2004, EL3064 and EL4004 from Beckhoff
As shown in figure 12, P0 is connected to the drive’s Automation were integrated into LinuxCNC using the
digital outputs (IDN P-0-1372) via HAL signal x out 1. EtherCAT coupler EK11006 . Similar to the set values
In addition to the digital outputs, the digital inputs and actual values for the servo drive, the analog out-
of the drive are also connected to motion. The use of puts and analog inputs were connected with LinuxCNC.
digital inputs and outputs is described in [19]. The protocols Ethernet/IP and PROFINET were also
integrated into LinuxCNC using the described evalua-
tion boards NXIO 50-RE. These subsequent tests are
Motion
not outlined in this paper. Along first tests, the same
results are expected.
motion.digital-out-00 motion.digital-in-00
x out 1 x in 1 10 Other controls than LinuxCNC

Although, this manuscript has a focus on LinuxCNC


there is no reason to restrict the approach to Linux-
CNC. Other control systems with a shared memory in-
terface are usable if they run with a Linux based oper-
Master
ating system with a real time capable userspace.

P-0-1372 P-0-1371
11 Conclusion

Slave The presented approach enables the integration of the


Real Time Ethernet protocols Sercos III, EtherCAT,
Fig. 12 Data transfer to set the master control word Ethernet/IP and PROFINET into LinuxCNC via the
PC card CIFX 50-RE. This integration was verified
with the evaluation boards NXIO 50-RE.
The integration of the servo drive CSB01.1C-S3- 5
http://mabi.hs-emden-leer.de
6
ENS-NNN-NN-S-NN-FW with its digital I/O was suc- http://www.beckhoff.de/default.asp?ethercat/ek1100.htm
Integration of Real Time Ethernet in LinuxCNC 9

In addition to the evaluation boards, it was possible 15. Kief, H.B., Roschiwal, H.A. (eds.): CNC-Handbuch
to integrate industrial grade hardware like a servo drive 2013/2014. Carl Hanser Verlag, München (2013).
16. LinuxCNC.org: HAL Manual V2.5, 2014-10-29 (2014).
and I/O modules.
URL http://linuxcnc.org/docs/2.5/pdf/LinuxCNC_
The analysis of the measurement with the NANL- HAL_Manual.pdf
C500-RE and the 24-hours tests with a real servo drive 17. LinuxCNC.org: Ethercat realtime hal driver (2013).
show that the integration is suitable to control dynamic URL http://www.wiki.linuxcnc.org/cgi-bin/wiki.
pl?EtherCatDriver
servo drives with LinuxCNC using Real Time Ethernet.
18. LinuxCNC.org: Integrator Manual V2.5, 2014-10-29
(2014). URL http://linuxcnc.org/docs/2.5/pdf/
Acknowledgements The authors would like to thank Dipl.- LinuxCNC_Integrator_Manual.pdf
Ing. Thomas Peetz, M.Sc. for providing technical support 19. LinuxCNC.org: User Manual V2.5, 2014-10-29 (2014).
that made this work possible. URL http://linuxcnc.org/docs/2.5/pdf/LinuxCNC_
User_Manual.pdf
20. LinuxCNC.org: Download linuxcnc (2014). URL http:
References //linuxcnc.org/index.php/english/download
21. LinuxCNC.org: Linuxcnc: Software for realtime control
(2014). URL http://www.linuxcnc.org/
1. Abel, M.: Hal component: Shared memory in-
22. OSADL eG: Realtime linux road map (2014). URL
terface (2011). URL https://gitorious.
https://www.osadl.org/?id=99
org/emc-rt-preempt/emc-rt-preempt/source/
23. Sercos International e.V.: plug and play - Sercos, the
dbc5f99db839a1913828863828e55cb6220fc954:
automation bus (2014). URL http://sercos.com/
src/hal/drivers/shm_interface.c
2. Abel, M.: Hal configuration for shared mem- literature/pdf/sercos3_en.pdf
ory interface (2011). URL https://gitorious. 24. DIN Deutsches Institut für Normung e.V.: Industrial
org/emc-rt-preempt/emc-rt-preempt/source/ communication networks - Fieldbus specifications - Part
dbc5f99db839a1913828863828e55cb6220fc954: 4-19: Data-link layer protocol specification - Type 19
configs/SharedMemory/SharedMemory.hal elements (IEC 61158-4-19:2010). Beuth Verlag, Berlin
3. Abel, M.: Specification of shared memory in- (2013)
terface (2011). URL https://gitorious.
org/emc-rt-preempt/emc-rt-preempt/source/
dbc5f99db839a1913828863828e55cb6220fc954:
src/hal/drivers/shm_interface.h
4. Abel, M.: Repository to track the adoption
of emc to rt preempt (2012). URL https:
//gitorious.org/emc-rt-preempt/emc-rt-preempt/
commits/linuxcnc_rt_shm_20120501_cleaned
5. Bosch Rexroth AG: Rexroth IndraDrive Firmware
for Drive Controllers MPH,- MPB-, MPD,- MPC-08:
R911332643 (2011).
6. Ethernet Powerlink Standardization Group: Industrial
Ethernet Facts: The 5 Major Technologies (2013).
7. Hehenberger, P.: Computerunterstützte Fertigung.
Springer-Verlag, Heidelberg and Dordrecht and London
and New York (2011).
8. Hilscher Gesellschaft für Systemautomation mbH: Driver
Manual cifx Device Driver: Windows 2000/xp/vista/7
v1.1.x.x: DOC060701DRV21EN (2011).
9. Hilscher Gesellschaft für Systemautomation mbH: Oper-
ating Instruction Manual DTM for Hilscher Sercos III
Master Devices: Configuration of Hilscher Master De-
vices: DOC090301OI05EN (2011).
10. Hilscher Gesellschaft für Systemautomation mbH: Driver
Manual cifx Device Driver: Linux (Kernel 2.6.x / 3.3.x)
v1.0.1.0: DOC090201DRV05EN (2012).
11. Hilscher Gesellschaft für Systemautomation mbH: User
Manual NXIO 50-RE-Board Hardware Description:
DOC090101UM06EN (2012).
12. Hilscher Gesellschaft für Systemautomation mbH: User
Manual Real-Time Ethernet Kit: Analysis Examples:
DOC081202UM04EN (2012).
13. Hilscher Gesellschaft für Systemautomation mbH: User
Manual Real-Time Ethernet Kit: Installation Operation
and Configuration: DOC081105UM04EN (2012).
14. Kerrisk, M.: The linux man-pages project: Linux
man-pages online: Alphabetic list of all pages (2012).
URL http://man7.org/linux/man-pages/dir_all_
alphabetic.html

View publication stats

You might also like