Ethercat HAL driver

More
05 Nov 2020 05:47 #188374 by CORBETT
Replied by CORBETT on topic Ethercat HAL driver
@JanMrlth,

"Is there a place/repository to share config files?"
The only place that I am aware of is here on the LinuxCNC forum or at GitHub. "Tommylight" may know somewhere else, but for LCNC EtherCAT I would say only here and GitHub. If you go to Sasha Ittners Git page, there are a few example configs, but not a repository.


"I am gradually working my way forward in this thread. Can someone recommend a website/tutorials where all the knowledge is a bit more condensed? Browsing through 100s of posts does not seem to be the most effectiv way to get information :)"
This is one problem since it is open source and everyone here is volunteers. There is not really a good specific place to just go read one page after another to figure things out. The closest to that would be reading the integrator manual and the users manual. Over the years I have had the same problem you are facing which is trying to piece together multiple post to answer one question. Plus some post are really old and pertain to that version of LCNC and may not even be relevant to the version you may be using. This can be a huge problem at times when you can't find the answer you need for your version.

The one thing that is positive and helps is there is super dedicated people on here such as Tommylight, PCW, andypugh, and few others not mentioned that really know what they are doing. There are many others that can help, but only a few that can help with EtherCAT... Chimeno and Grotius are the main guy's to get with on EtherCAT as they have helped me in the past with problems.

Hope this helps.
Robert
The following user(s) said Thank You: chimeno

Please Log in or Create an account to join the conversation.

More
07 Nov 2020 20:58 #188613 by JanMrlth
Replied by JanMrlth on topic Ethercat HAL driver
So, I have been reading a lot and was able to write a xml-config for my AKD-Drive. What I have learned, I tried to put into this (German) video:


One Question:
www.etherlab.org/download/ethercat/ethercat-1.5.2.pdf say on page 23:

It is not possible to use [the generic driver] in-kernel realtime extensions like RTAI with the generic driver, because the network stack code uses dynamic memory allocations and other things, that could cause the system to freeze in realtime context.


Do I need a 'real' driver to be able to run a axis in real time? How much slower is the generic driver?
The following user(s) said Thank You: chimeno, Nico2017, Grotius, JimPanski, jc2ktr

Please Log in or Create an account to join the conversation.

More
07 Nov 2020 22:18 #188622 by Grotius
Replied by Grotius on topic Ethercat HAL driver
Hi,

I remember a document where the timing details where provided.
You see, it's almost equal between userspace and kernelspace.



It's true you can not mix rtai (.ko) with the generic (.so) driver.

How much slower is the generic driver?
I think it's 2-5 nanosec slower if you take the 4 ecrt steps together.
Attachments:

Please Log in or Create an account to join the conversation.

More
09 Nov 2020 16:34 #188763 by tetw
Replied by tetw on topic Ethercat HAL driver
Hi guys, I don't have much experience on EtherCAT I followed the installation the my configuration:
uname -a
Linux PcLcnc 4.9.0-8-rt-686-pae #1 SMP PREEMPT RT Debian 4.9.110-3+deb9u6 (2018-10-08) i686 GNU/Linux
I've some problems when I load "loadrt lcec" in hal
Failed to register PDO entry: No such file or directory
LCEC: master 0 PDO entry registration failed
lcec: rtapi_app_main: Invalid argument (-22)
/home/operatore/Scrivania/prova.hal:4: waitpid failed /usr/bin/rtapi_app lcec
/home/operatore/Scrivania/prova.hal:4: /usr/bin/rtapi_app exited without becoming ready
/home/operatore/Scrivania/prova.hal:4: insmod for lcec failed, returned -1
reading the posts preceding the error "PDO entry 0x6000"
dmesg | egrep EtherCAT
[   10.362827] EtherCAT: Master driver 1.5.2 unknown
[   10.363074] EtherCAT: 1 master waiting for devices.
[   10.369886] ec_generic: EtherCAT master generic Ethernet device module 1.5.2 unknown
[   10.369912] EtherCAT: Accepting 00:A0:D2:A5:C0:73 as main device for master 0.
[   10.380067] EtherCAT 0: Starting EtherCAT-IDLE thread.
[   10.380162] EtherCAT 0: Link state of ecm0 changed to UP.
[   10.389778] EtherCAT WARNING 0: 1 datagram TIMED OUT!
[   11.391141] EtherCAT WARNING 0: 124 datagrams TIMED OUT!
[   12.393481] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[   13.392298] EtherCAT WARNING 0: 123 datagrams TIMED OUT!
[   14.393714] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[   15.328642] EtherCAT 0: Link state of ecm0 changed to DOWN.
[ 1240.392727] EtherCAT: Requesting master 0...
[ 1240.392737] EtherCAT: Successfully requested master 0.
[ 1240.393919] EtherCAT ERROR 0 0:1: PDO entry 0x6000:01 is not mapped.
[ 1240.394471] EtherCAT 0: Releasing master...
[ 1240.394500] EtherCAT 0: Released.
[ 1810.942216] EtherCAT: Requesting master 0...
[ 1810.942224] EtherCAT: Successfully requested master 0.
[ 1810.948244] EtherCAT ERROR 0 0:1: PDO entry 0x6000:01 is not mapped.
[ 1810.949304] EtherCAT 0: Releasing master...
[ 1810.949378] EtherCAT 0: Released.
I only encountered when I insert the line with "EL2004" in the configuration XML.
I have'n found a solution for upload "PDO 0x6000"
Another inaccuracy when I execute the command
ethrecat slave 
 0  0:0   PREOP  +  EK1100 EtherCAT-Koppler (2A E-Bus)
 1  0:1   PREOP  +  EL1104 4K. Dig. Eingang 24V, 3ms, Sensorversorgung
 2  0:2   PREOP  +  EL1104 4K. Dig. Eingang 24V, 3ms, Sensorversorgung
 3  0:3   PREOP  +  EL1104 4K. Dig. Eingang 24V, 3ms, Sensorversorgung
 4  0:4   PREOP  +  EL1104 4K. Dig. Eingang 24V, 3ms, Sensorversorgung
 5  0:5   PREOP  +  EL1104 4K. Dig. Eingang 24V, 3ms, Sensorversorgung
 6  0:6   PREOP  +  EL1104 4K. Dig. Eingang 24V, 3ms, Sensorversorgung
 7  0:7   PREOP  +  EL1104 4K. Dig. Eingang 24V, 3ms, Sensorversorgung
 8  0:8   PREOP  +  EL1104 4K. Dig. Eingang 24V, 3ms, Sensorversorgung
 9  0:9   PREOP  +  EL3142 2K. Ana. Eingang 0-20mA
10  0:10  PREOP  +  EL4132 2Ch. Ana. Ausgang +/-10V, 16bit
11  0:11  PREOP  +  EL9410 E-Bus Netzteilklemme (Diagnose)
12  0:12  PREOP  +  EL2004 4K. Dig. Ausgang 24V, 0.5A
13  0:13  PREOP  +  EL2004 4K. Dig. Ausgang 24V, 0.5A
14  0:14  PREOP  +  EL2004 4K. Dig. Ausgang 24V, 0.5A
15  0:15  PREOP  +  EL2004 4K. Dig. Ausgang 24V, 0.5A
16  0:16  PREOP  +  EL2004 4K. Dig. Ausgang 24V, 0.5A
17  0:17  PREOP  +  EL2004 4K. Dig. Ausgang 24V, 0.5A
18  0:18  PREOP  +  EL2004 4K. Dig. Ausgang 24V, 0.5A
19  0:19  PREOP  +  EL2004 4K. Dig. Ausgang 24V, 0.5A
20  0:20  PREOP  +  Infranor Xtrapuls v2.2 (CoE)
21  0:21  PREOP  +  Infranor Xtrapuls v2.2 (CoE)
22  0:22  PREOP  +  Infranor Xtrapuls v2.2 (CoE)
23  0:23  PREOP  +  Infranor Xtrapuls v2.2 (CoE)
24  0:24  PREOP  +  Infranor Xtrapuls v2.2 (CoE)
25  0:25  PREOP  +  Infranor Xtrapuls v2.2 (CoE)
26  0:26  PREOP  +  Infranor Xtrapuls v2.2 (CoE)
I don't see the 2 "ES9100" present between positions 4-5 and 15-16 even disconnecting the servo insert them first WHY?

Please Log in or Create an account to join the conversation.

More
10 Nov 2020 09:10 #188852 by Grotius
Replied by Grotius on topic Ethercat HAL driver
Hi Tetw,

Did you succeed to load and run a simple config like the EK1100 only?
Bustime in xml file : 1000000 is ok.

Please Log in or Create an account to join the conversation.

More
10 Nov 2020 13:50 #188873 by jc2ktr
Replied by jc2ktr on topic Ethercat HAL driver
Hi folks,

i managed to get LinuxCNC with ethercat driver up and Running thanks to Grotius.

Is there anywhere a Tutorial how to add Ethercat devices. I have an RTelligent Ethercat (COE) Capable ECT60 Stepper Driver with the Corresponding .XML file. And a Beckhoff EP2316-0008 8 INPUTS / 8 Outputs. How should the ethercat_conf.XML look to get the drive/io module usable.

I have tried to make the XML with the tutorial for the IndraDrives from the LinuxCNC wiki:

indraDrive tutorial

File Attachment:

File Name: ECTSeriesV...1-10.xml
File Size:180 KB

If I do a ethercat slaves in Terminal it writes following output:

0 0:0 PREOP + ECT60(COE)
1 0:1 PREOP + EP2316-0008 8 K. Dig. Ein, 10�s, 8 K. Dig. Aus 24V, 0,5A, Diagn
Attachments:

Please Log in or Create an account to join the conversation.

More
10 Nov 2020 16:01 - 10 Nov 2020 16:03 #188890 by Grotius
Replied by Grotius on topic Ethercat HAL driver
Hi Jc2ktr,

Is there anywhere a Tutorial how to add Ethercat devices.
No not really.

To all users. :laugh:

It is time to write an application that writes the xml file automaticly for the lcec driver.
This will save everyone over here lot's of time. For a few, it can saves weeks.
I mention in general, that the application's at linuxcnc are becoming more complex and advanched over time.

I have experience with reading and writing xml files in c++. It's really easy to do that.
But i need help from you guy's to make the software details.

Who is for making the software and can help provide the ethercat info for the different servo drives?

I have non experience with twincat. Otherwise maybe i had the logic to write some code, but now it's that we can let the software
do a terminal command, then retrieve a slave list. At that moment we have to generate the xml file.
Last edit: 10 Nov 2020 16:03 by Grotius.

Please Log in or Create an account to join the conversation.

More
10 Nov 2020 16:07 - 10 Nov 2020 16:07 #188891 by Grotius
Replied by Grotius on topic Ethercat HAL driver
Hi JanMrlth,

I have seen your video on Youtube. Nice work. Quite complex to understand the ethercat bus.
Last edit: 10 Nov 2020 16:07 by Grotius.

Please Log in or Create an account to join the conversation.

More
11 Nov 2020 03:01 #188952 by Nico2017
Replied by Nico2017 on topic Ethercat HAL driver
Hi @Grotius,
I agree with you that the parametrization of the EtherCAT xml file for linuxcnc EtherCAT driver can be a hard task.

I believe you can get a lot (all) of information from the ESI file (xml format) usually provided by manufacturers at request and also by the use of TwinCAT to read those EtherCAT parameters. But I believe that TwinCAT is actually looking into those ESI file to get a default configuration, more precisely if you are using TwinCAT offline not connected to any physical slave and simulate an EtherCAT master - slaves topology.

Some motor drives or slaves will need to be configured via the manufacturer software/application to configure the EtherCAT communication (inputs outputs and so on). Once parametrized you could use TwinCAT to connect yourself to the slave and identify the different informations. Then you have to convert it into usable information for the linuxcnc EtherCAT .xml file.

You could also use the EtherCAT commands to identify all pdos directly.

Nicolas

Please Log in or Create an account to join the conversation.

More
11 Nov 2020 13:20 #188990 by tetw
Replied by tetw on topic Ethercat HAL driver

Hi Tetw,

Did you succeed to load and run a simple config like the EK1100 only?
Bustime in xml file : 1000000 is ok.

Hi Grotius,
I know things have changed I don't know why, but it only works with “EK1100” even by changing the parameter “appTimePeriod” together with the thread of the hal file, I tried to unplug the result does not change.
dmesg | egrep EtherCAT
[   10.316518] EtherCAT: Master driver 1.5.2 unknown
[   10.316767] EtherCAT: 1 master waiting for devices.
[   10.325681] ec_generic: EtherCAT master generic Ethernet device module 1.5.2 unknown
[   10.325708] EtherCAT: Accepting 00:A0:D2:A5:C0:73 as main device for master 0.
[   10.336070] EtherCAT 0: Starting EtherCAT-IDLE thread.
[   10.336161] EtherCAT 0: Link state of ecm0 changed to UP.
[   10.345732] EtherCAT WARNING 0: 1 datagram TIMED OUT!
[   11.350801] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[   12.354137] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[   13.358682] EtherCAT WARNING 0: 121 datagrams TIMED OUT!
[   14.151273] EtherCAT 0: Link state of ecm0 changed to DOWN.
[   80.361852] EtherCAT: Requesting master 0...
[   80.361861] EtherCAT: Successfully requested master 0.
[   80.361899] EtherCAT 0: Domain0: Logical address 0x00000000, 0 byte, expected working counter 0.
[   80.363775] EtherCAT 0: Master thread exited.
[   80.363780] EtherCAT 0: Starting EtherCAT-OP thread.
[   80.369196] EtherCAT WARNING 0: 97 datagrams TIMED OUT!
[   80.397692] EtherCAT 0: Master thread exited.
[   80.397706] EtherCAT 0: Starting EtherCAT-IDLE thread.
[   80.397810] EtherCAT 0: Releasing master...
[   80.397815] EtherCAT 0: Released.
[   80.625045] EtherCAT WARNING: Datagram f6a2e250 (master-fsm) was SKIPPED 1 time.
[   94.471306] EtherCAT: Requesting master 0...
[   94.471315] EtherCAT: Successfully requested master 0.
[   94.471382] EtherCAT ERROR 0 0:1: PDO entry 0x6000:01 is not mapped.
[   94.471965] EtherCAT 0: Releasing master...
[   94.471977] EtherCAT 0: Released.

Please Log in or Create an account to join the conversation.

Time to create page: 0.204 seconds
Powered by Kunena Forum