Integration of Real-Time Ethernet in Linuxcnc: Using The Example of Sercos Iii
Integration of Real-Time Ethernet in Linuxcnc: Using The Example of Sercos Iii
net/publication/273300642
CITATIONS READS
9 5,157
3 authors, including:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Elmar Wings on 06 November 2019.
Userspace
Physical Layer
SHM-RTE LinuxCNC
Fig. 2 Open Systems Interconnection Model
libcifx.so
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
Yes
Yes
#1 A
#2
#2 Motion GUI
axis.0.motor-pos-cmd
axis.1.motor-pos-cmd
Shared
Memory Read from SHM
axis.2.motor-pos-cmd
SHM Interface
Yes
No
Quit? B
Slaves
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
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]
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
P-0-1372 P-0-1371
11 Conclusion
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