Ethercat HAL driver

More
9 years 11 months ago #82576 by Lixiaohui
Replied by Lixiaohui on topic Ethercat HAL driver

mfalcon wrote: hello

I tried several times with the mentioned steps, but I failed to get the whole thing to work, please help me to understand what I am missing. I am a newbie in linuxcnc, and my experience with linux itself is limited . The following are the steps that I made:


Step 0 : you need to install Debian Linuxcnc with RTAI core (I failed to do the following procedure when I tried Linux with
RT Preemption). The following procedure was fully tested with Linux Debian-7.9'-'3.4-9-rtai-686-pae' linuxcnc.

First Part: Intallation of Eathercatlab Hal Component

1st Download ethercat master from IgH from here:
www.etherlab.org/download/ethercat/ethercat-1.5.2.tar.bz2

2nd Open a shellTerminal, and go to the folder that contains the ethercat master, and Untar the file

3rd download debian folder from sittner from here:
github.com/sittner/ec-debianize/archive/master.zip

4th Unzip the file "ec-debianize-master.zip"

5th copy debian folder (the was produced in 4th step) to /ethercat-1.5.2/ (that was produced 2nd step)

6th now in the shell terminal, use the following instructions:
cd ethercat-1.5.2
cd debian
./configure -a
cd ..
sudo apt-get update
dpkg-checkbuilddeps
(I was missing dpatch package)
dpkg-buildpackage
wait until it finishes building. use command "cd .." in the shell to go to the parent directory.
You will find two files : etherlabmaster-dev_1.5.2+hg4b0b90_i386.deb , etherlabmaster_1.5.2+hg4b0b90_i386.deb

7th sudo dpkg -i etherlabmaster_1.5.2+hg4b0b90_i386.deb

8th edit the file : "/etc/default/ethercat"

9th sudo update-ethercat-config

10th sudo dpkg -i etherlabmaster-dev_1.5.2+hg4b0b90_i386.deb

11th restart the machine to get the driver loaded at start. After that you can execute # ethercat master in terminal



Second Part : Installation of linuxcnc with lcec Hal Driver

1st Download sittner linuxcnc modification with lcec inside:
# git clone github.com/sittner/linuxcnc-ethercat.git linuxcnc-ethercat
# cd linuxcnc-ethercat

2nd # make

3rd # sudo make install

4th cd linuxcnc-ethercat/src

5th Build

6th make

7th sudo make install

8th . Copy the built binary to the ethercat directory : sudo cp lcec_conf /usr/bin/

9th restart


after all of this I get the following error when I run the example CDP17_x:


Debug file information:
Error: could not insert module /usr/realtime-3.4-9-rtai-686-pae/modules/linuxcnc/lcec.ko: Invalid parameters
./cpd17_x.hal:2: exit value: 1
./cpd17_x.hal:2: insmod for lcec failed, returned -1
See the output of 'dmesg' for more information.
4645
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components

how can I resolve this??


I have encountered the same problem with you, so whether you have resolved this or not?

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

More
9 years 11 months ago #82582 by Lixiaohui
Replied by Lixiaohui on topic Ethercat HAL driver
Maybe you have to confirm that you have connected the master and corresponding slave in the XML file.

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

More
9 years 11 months ago #82602 by cgc
Replied by cgc on topic Ethercat HAL driver
Hi,
what is your hardware?

regards Frank

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

More
9 years 10 months ago - 9 years 10 months ago #83580 by jerryCNC
Replied by jerryCNC on topic Ethercat HAL driver
Hi, Jolli:

I am studying AX5000 drive too, but fall far behind than you. When you wrote:
"...As linuxcnc-ethercat doesn't support SoE init configuration, I've tried to upload the data with a script using "ethercat soe_write" or by plugging ethercat cable to a machine running TwinCAT in config/freerun state. ..."

For so-called "ethercat soe_write", I guess you are calling "ecrt_master_write_idn()" from "lcec_write_master()", right?
Could you please provide the complete file for using "ethercat soe_write"?

Thanks
Jerry
Last edit: 9 years 10 months ago by jerryCNC.

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

More
9 years 8 months ago - 9 years 8 months ago #87582 by LinuxBen
Replied by LinuxBen on topic Ethercat HAL driver
Hello
I'm new to LinuxCNC and at the foot of steep learning curve as it seems.

My Beckhoff Devices/Modules:
- EK1101 Bus coupler, unsupported (the same as EK1100 which is supported, but the EK1101 has a selectable address)
- BK1250 K-Bus Translator, unsupported, enables to use of "old" K-Bus Devices on the EtherCat bus. Probably no own functionality but it maps any number of K-Bus-Devices.
- KL1104, 4 Inputs
- KL2114, 4 Outputs
- 4 pieces of KL2531, Stepper Drivers

What worked on Linux:
- LinuxCNC 2.7 wheezy installed.
- EtherCat Hal driver installed : wiki.linuxcnc.org/cgi-bin/wiki.pl?EtherCatDriver
- I can see the connected devices
user@phywe:~/linuxcnc/configs/phywe$ ethercat slaves
0 0:0 PREOP + EK1101 EtherCAT-Koppler (2A E-Bus, ID-Switch)
1 0:1 PREOP + BK1250 Koppler zwischen E-Bus- und K-Bus-Klemmen

What worked on Windows:
- Visual Studio install
- Twincat 3
- I can connect the Windows Box to the Beckhoff device and see the nodes of the devices.

So far so good.
But as you maybe know, the Beckhoff devices from my setup are not supported by the ethercat driver. So I assume I have to use generic type in XML configuration.
Questions:
1. If the EtherCatDriver does not support the Beckhoff Modules I have, then I still can use them by creating a "generic type" XML file for them?
2. I struggled to find a way to extract the "sdo" and "syncmaster" stuff. Where can I do it? I only found the option "Export XML Description" under the "TwinCat" Tab in Visual Studio. Please see the attached files.
3. If I will be able to compile that XML file, what is the way to test it? Is it ok to load the XML with
halrun
and then
halcmd: loadusr -W lcec_conf /home/user/linuxcnc/configs/phywe/ethercat-conf.xml
and some more commands? I'm still investigating this...sorry

Unfortunately I don't have any of the already implemented devices found on the web, so I cannot compare XML outputs.
If somebody has a pro-tip, you are welcome!
Ben
Attachments:
Last edit: 9 years 8 months ago by LinuxBen. Reason: Attachments are in the middle of the text, sorry for this.

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

More
9 years 8 months ago - 9 years 8 months ago #87586 by sirop
Replied by sirop on topic Ethercat HAL driver

LinuxBen wrote: Questions:
1. If the EtherCatDriver does not support the Beckhoff Modules I have, then I still can use them by creating a "generic type" XML file for them?
2. I struggled to find a way to extract the "sdo" and "syncmaster" stuff. Where can I do it? I only found the option "Export XML Description" under the "TwinCat" Tab in Visual Studio. Please see the attached files.
3. If I will be able to compile that XML file, what is the way to test it? Is it ok to load the XML with
halrun
and then
halcmd: loadusr -W lcec_conf /home/user/linuxcnc/configs/phywe/ethercat-conf.xml
and some more commands? I'm still investigating this...sorry

Unfortunately I don't have any of the already implemented devices found on the web, so I cannot compare XML outputs.
If somebody has a pro-tip, you are welcome!
Ben


1. Yes, you can.

2. linuxcnc-ethercat uses the so called raw SDO. It is a toil. So rather preconfigure your slaves with a bash scripts consisting of
Code:
ethercat download -PNumber -tType Index Subindex Value
See, for instance, github.com/sirop/linuxcnc-ethercat/blob/...pley/setPDO_FAULT.sh .

What do you mean by "syncmaster" stuff? A Hex value for DC configuration? This can be read out from your ESI xml file.

3. Yes, that's right.
Last edit: 9 years 8 months ago by sirop. Reason: typo
The following user(s) said Thank You: Nico2017

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

Time to create page: 5.944 seconds
Powered by Kunena Forum