EtherCAT realtime HAL driver
Overview
This driver tries to provide an easy-to-expand framework for the connection of LinuxCNC to EtherCAT devices.
Some of the often used Beckhoff devices like digital and analog I/O, encoder input and pulse train output
are already supported just as the [Stöber] MDS5000 series of servo drives.
The driver is based on [IgH's EtherCAT master] and builds a
glue layer like the etherlab component. It consists of an userspace component for configuration and a
RT HAL module for the data processing.
The config module reads in and parses a xml config file and provides a prepared form of configuration data
via shared memory to the RT part. The RT module is organised in a global part that is common to all submodules and a .c and .h file for
each supported (class off) hardware device.
Since this driver is sill under development you can find the code [here].
Feel free to test or review the code and send me suggestions and hints. There is a discussion thread about this driver
in the [forum].
Currently supported devices
- Bus coupler
- EK1100* - EtherCAT Coupler
- Digital in
- EL1002 - 2-channel digital input terminal 24 V DC, 3 ms
- EL1004 - 4-channel digital input terminal 24 V DC, 3 ms
- EL1008* - 8-channel digital input terminal 24 V DC, 3 ms
- EL1012 - 2-channel digital input terminal 24 V DC, 10 µs
- EL1014 - 4-channel digital input terminal 24 V DC, 10 µs
- EL1018 - 8-channel digital input terminal 24 V DC, 10 µs
- EL1024 - 4-channel digital input terminal 24 V DC for type 2 sensors
- EL1034 - 4-channel digital input terminal 24 V DC, potential-free inputs
- EL1084 - 4-channel digital input terminal 24 V DC, switching to negative potential, 3 ms
- EL1088 - 8-channel digital input terminal 24 V DC, switching to negative potential, 3 ms
- EL1094 - 4-channel digital input terminal 24 V DC, switching to negative potential, 10 µs
- EL1098 - 8-channel digital input terminal 24 V DC, switching to negative potential, 10 µs
- EL1104 - 4-channel digital input terminals 24 V DC, 24 V and 0 V sensor supply, 3 ms
- EL1114 - 4-channel digital input terminals 24 V DC, 24 V and 0 V sensor supply, 10 µs
- EL1124 - 4-channel digital input terminals 5 V DC
- EL1134 - 4-channel digital input terminals 12 V DC
- EL1144 - 4-channel digital input terminals 48 V DC
- EL1808* - HD EtherCAT Terminal, 8-channel digital input 24 V DC, 2-wire connection
- Digital out
- EL2002 - 2-channel digital output terminal 24 V DC, 0.5 A
- EL2004 - 4-channel digital output terminal 24 V DC, 0.5 A
- EL2008 - 8-channel digital output terminal 24 V DC, 0.5 A
- EL2022 - 2-channel digital output terminal 24 V DC, 2 A
- EL2024 - 4-channel digital output terminal 24 V DC, 2 A
- EL2032 - 2-channel digital output terminal 24 V DC, 2 A
- EL2034 - 4-channel digital output terminal 24 V DC, 2 A
- EL2042 - 2-channel digital output terminal 24 V DC, 2 x 4 A/1 x 8 A
- EL2084 - 4-channel digital output terminal 24 V DC, negative switching
- EL2088 - 8-channel digital output terminal 24 V DC, negative switching
- EL2124 - 4-channel digital output terminal 5 V DC
- EL2808* - HD EtherCAT Terminal, 8-channel digital output 24 V DC, 0.5 A
- Analog in, 2ch, 16 bits
- EL3102 - 2-channel analog input terminal -10 to +10 V, differential input, 16 bits
- EL3112 - 2-channel analog input terminal 0 to 20 mA, differential input, 16 bits
- EL3122 - 2-channel analog input terminal 4 to 20 mA, differential input, 16 bits
- EL3142 - 2-channel analog input terminal 0 to 20 mA, single-ended, 16 bits
- EL3152 - 2-channel analog input terminal 4 to 20 mA, single-ended, 16 bits
- EL3162* - 2-channel analog input terminal 0 to 10 V, single-ended, 16 bits
- Analog out, 2ch, 16 bits
- EL4102 - 2-channel analog output terminal 0 to 10 V, 16 bits
- EL4112 - 2-channel analog output terminal 0 to 20 mA, 16 bits
- EL4122 - 2-channel analog output terminal 4 to 20 mA, 16 bits
- EL4132* - 2-channel analog output terminal -10 to +10 V, 16 bits
- Encoder inputs
- EL5151* - 1-channel incremental encoder interface
- EL5152* - 2-channel incremental encoder interface
- Pulse train (stepper) output
- EL2521* - 1-channel pulse train output terminal RS422/24 V DC
- Motion Interfaces
- EL7041-1000* - 1-channel stepper motor terminal, 50 V DC, 5 A, 1 with Enc In
- EL7342* - 2-channel DC motor output stage 50 V DC, 3.5 A with Enc In
- EM7004* - 4-axis interface, 16 Dig in, 16 Dig Out, 4 Analog Out, 4 Enc In
- Servo Inverters
- Stöber MDS5000 series*
- DELTA Electronics ASDA series*
- Generic driver for manual mapping of POSs to HAL pins
Devices with an asterisk (*) are tested, all other devices are supported due to an equal process image.
If you have hardware that is supported and not tested and you like to test it or you have hardware
that is not supported yet und you like to support development for this device, just drop me a line.
Installation
If you are using the current LinuxCNC Distribution (LCNC 2.6 Debian Wheezy based at time
of writing) the installation is pretty simple:
- create a file "/etc/apt/sources.list.d/linuxcnc-mds.list":
deb http://repo.modusoft.de/linuxcnc/wheezy ./
- # sudo apt-get update
- # sudo apt-get install linuxcnc-ethercat
The etherlabmaster should be installed automaticaly.
Currently you will get a warning about missing key.
- edit /etc/default/ethercat to match your setup
- # sudo update-ethercat-config
- reboot
- # ethercat slaves
this sould show your connected slaves
- start working with Ethercat enabled LinuxCNC
Building
If you like to build the driver by you own, you could just clone the git
and do a
and
You need etherlabmaster-dev (from the repos mentioned above) and linuxcnc-dev to be installed for this.
Configuration
You can find some examples under /usr/share/linuxcnc-ethercat/examples
... to be continued
( [Configuration tutorial for IndraDrives.] )
Usage