Ethercat HAL driver

More
23 Apr 2014 02:45 - 30 Nov 2015 07:05 #46227 by roschi
Replied by roschi on topic Ethercat HAL driver
Hi All,
in case you search for the EtherCAT manual from ESTUN version 1.02 find it here:
link
the original ESTUN XML File for the use in TwinCAT can be find here:
ESTUN_ProNet_V200.xml

I was in contact with the R&D of ESTUN they told me two more parameters:
0x60b1 is the speed feed forward
0x60b2 is the torque feed forward
in case 0x6060 is 8 (cyclic position mode)
for other parameters you can also have a look at the CiA DSP 402
e.g. link

Also you can find some samples for XML, HAL, PLC and INI files that could give hints for setup EtherCAT drives here:
roschi.eu/retrofit/

The modified homing.c --> no need for moving the axis in case of absolut encoders and modified lcec_conf.c, lcec.c --> added scaling parameter feature in xml files can be found here:
link to github

Regards Andreas
Last edit: 30 Nov 2015 07:05 by roschi.
The following user(s) said Thank You: arvidb, Nico2017

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

More
26 Apr 2014 16:27 - 26 Apr 2014 18:16 #46332 by wazza77
Replied by wazza77 on topic Ethercat HAL driver
Hi guys

i know that a similar issue was posted at the beginning of this but i am missing /master/debian from
/src/hal/drivers/ethercat/master/debian
i git cloned sittner and checkout add-hal-ethercat. i thought the the ec debianiz folder might be what was met to be there so i created master and copied
the debian folder to it but no luck so im flying blind and by the seat of my pants. mind you this is all new to me its been an interesting day
I have learned a lot. graphic drivers and Ethernet drivers all had to be added first real day with linux

[edit] i followed the same line as wen in post 40340 and recived a permission denied when configure -a so i used the sh ./configure -a
and i received [: 40: -a; unexpected operator but then i received that it was successfully config line 40 was fi but i think it is meant to be if but it has no argument for the if statement now
Last edit: 26 Apr 2014 18:16 by wazza77.

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

More
26 Apr 2014 21:00 #46335 by wazza77
Replied by wazza77 on topic Ethercat HAL driver
ok the current state of play is i have been able to make ethercat master and linuxcnc
but now i run the command ethercat slaves i get a error along the lines of: Failed to obtain number of master:Failed to open master device /dev/EtherCAT0:No such file or directory.
i looked into init.d and the command ethercat start but came back with no such file or directory
went root and tried it that way and came up wit no sysini/init.d/ethercat file i would appreciate any input on this problem
But for now i'm going to bed its midnight here and I have been at this since 8:30 am i think if i had more experience with Linux
i would see it its probably so simple but well its my first day

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

More
26 Apr 2014 22:02 - 26 Apr 2014 22:04 #46337 by roschi
Replied by roschi on topic Ethercat HAL driver
Hi Warren,

i looked into init.d and the command ethercat start but came back with no such file or directory
went root and tried it that way and came up wit no sysini/init.d/ethercat file i would appreciate any input on this problem


An automatic loading of etherlab master/kernel modules at boot time depends on your system/runlevel manager (see docs etherlab, docs runlevels common linux)

So for first tests there is a work around (does not solve the configuration for automatic loading at boot time):
Look for the install dir of etherlab. Perhaps the command 'whereis ethercat' gives a hint.
In my case this is /opt/etherlab/.
In this dir (or the dir you find out) go to subdir etc/ and edit ethercat.conf and enter the mac of your NIC you want to use for EtherCAT.
Then enter the command /opt/etherlab/etc/init.d/ethercat start. (If this won't work, check the content of /opt/etherlab/etc/init.d/ethercat for the parameter 'THERCAT_CONFIG=' this should point to the file you have edited with your mac.

Hope this will help.

Regards Andreas
Last edit: 26 Apr 2014 22:04 by roschi.
The following user(s) said Thank You: wazza77

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

More
27 Apr 2014 02:05 - 27 Apr 2014 02:35 #46346 by narogon
Replied by narogon on topic Ethercat HAL driver

Nacho,

I would be interested in seeing any information or config files relating to using these drives with linuxcnc.

We have a Panasonic A5 drive we will be using in a machine; I'm reliably informed that the Omron G5 drives are actually made by Panasonic and they are the same drives (and quite economical too!)

I assume you have still got some work todo to get the drive into the OP state to issue motion commands?

Regards
Will


Hi Will,

Here you have the xml original file for OMRON G5 drives and one example of a xml file that I've created to use with the lcec driver (ethercat_config_n.xml) following roschi's tutorial

Now I can control completely the robot position by halcmd (I use some pyvcp that I've created). Next easy step for me is implement it with the linuxcnc motion planner.

I will update all my results here.

Regards
Nacho.
Last edit: 27 Apr 2014 02:35 by narogon.
The following user(s) said Thank You: arvidb, willrat, wazza77, Nico2017

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

More
27 Apr 2014 02:32 #46347 by narogon
Replied by narogon on topic Ethercat HAL driver

ok the current state of play is i have been able to make ethercat master and linuxcnc
but now i run the command ethercat slaves i get a error along the lines of: Failed to obtain number of master:Failed to open master device /dev/EtherCAT0:No such file or directory.
i looked into init.d and the command ethercat start but came back with no such file or directory
went root and tried it that way and came up wit no sysini/init.d/ethercat file i would appreciate any input on this problem
But for now i'm going to bed its midnight here and I have been at this since 8:30 am i think if i had more experience with Linux
i would see it its probably so simple but well its my first day


Did you follow roschi's tutorial??

I'm going to try to explain what I did due to It wasn't easy for me neither. Maybe you can discover your problem reading this.

1st Download ethercat master from IgH
2nd Untar the file: tar xvfj ethercat-1.5.2.tar.bz2
3rd download debian folder from sittner
4th copy debian folder (3rd step) to /ethercat-1.5.2/ (2nd step)
5th sittner instructions:
#cd ethercat-1.5.2
# cd debian
# ./configure -a
# cd ..
# dpkg-checkbuilddeps (and install missing deps)
# dpkg-buildpackage

You get two files some files: ethercat_1.5.2-1_i386.deb, ethercat-dev_1.5.2-1_i386.deb .....

6th # sudo dpkg -i ethercat_1.5.2-1_i386.deb
7th edit /etc/default/ethercat with your configuration (in the file there are useful comments)
8th # sudo update-ethercat-config
9th # sudo dpkg -i ethercat-dev_1.5.2-1_i386.deb
10th restart the machine to get the driver loaded at start. After that you can execute # ethercat master in terminal

Install linuxcnc with lcec.

1st Download sittner linuxcnc modification with lcec inside
2nd unzip it
3rd modify /src/makefile due to there is a mistake inside:

they have forgotten
hal/drivers/ethercat/lcec_el5101.o \

between

hal/drivers/ethercat/lcec_el41x2.o \
and

hal/drivers/ethercat/lcec_el5151.o \ 

4th install it
cd src

In the source directory, build LinuxCNC:

./autogen.sh (this builds the configure script)
./configure
make clean
make
sudo make setuid


To run the software go back to the top level directory, and issue:

source scripts/rip-environment (You must do that every time you want to execute it)
linuxcnc

Regards,
Nacho
The following user(s) said Thank You: Nico2017

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

More
27 Apr 2014 17:48 - 27 Apr 2014 17:49 #46365 by wazza77
Replied by wazza77 on topic Ethercat HAL driver
Andreas/Nacho
thanks for your help it was hard to put myself in front of the computer today after yesterday.
But i could not believe i would get a response so quick from both of you and gave me the energy
OK i figured out how to gedit the config file. but in the end i was just having too many
issues and i just went and did a clean install and followed Nacho's directions above and i have
manage to get what looks like a ethercat master but with one problem i have no slaves yet i get this

Master0
Phase: Waiting for device(s)...
Active: no
Slaves: 0
Ethernet devices:
Main: 00:e0:4c:53:7b:79 (waiting...)
Link: DOWN
Tx frames: 0
Tx bytes: 0
Rx frames: 0
Rx bytes: 0
Tx errors: 0
Tx frame rate [1/s]: 0 0 0
Tx rate [KByte/s]: 0.0 0.0 0.0
Rx frame rate [1/s]: 0 0 0
Rx rate [KByte/s]: 0.0 0.0 0.0
Common:
Tx frames: 0
Tx bytes: 0
Rx frames: 0
Rx bytes: 0
Lost frames: 0
Tx frame rate [1/s]: 0 0 0
Tx rate [KByte/s]: 0.0 0.0 0.0
Rx frame rate [1/s]: 1040384 -606352 -1065589
Rx rate [KByte/s]: 0.0 0.0 1645326.0
Loss rate [1/s]: 0 0 0
Frame loss [%]: 0.0 0.0 0.0
Distributed clocks:
Reference clock: None
Application time: 0
2000-01-01 00:00:00.000000000

i believe this could just be my drive as i was messing around with it and may have switched of
the ethercat in the drive i will have a look at that tomorrow after may mill arrives iv been waiting 2 months for
it but i just have a niggling feeling about that line : Active: no

OK so now i will just get linuxcnc done and that will be me for the night. i think i owe a few people on here a beer or two. the only problem is with my work i will probably get around to every ons country so i will have
to get the beer :cheer:
Last edit: 27 Apr 2014 17:49 by wazza77.

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

More
29 Apr 2014 16:40 #46465 by wazza77
Replied by wazza77 on topic Ethercat HAL driver
Hi

OK I'm still having issues finding slaves on the network i have checked all my drives values and setting
it is set for ethercat i have the Err light flashing the code saying there is no communications on the drive
i entered my mack address in the configuration file and it shows up in the listing when i issue the command
ethercat master but i still have no communication. i have one problem when i #sudo update-ethercat-config
and it is:

Updating EtherCAT master confiuration
WARNING: All config files need .conf: /etc/modprobe.d/emc2, it will be ignored in a future release.
update-initramfs: Generating /boot/initrd.img-2.6.32-122-rtai
done.

also i have read through the config page and found the driver for my NIC but the command for --enable must i put this in the configure file in the ethercat-1.5.2 directory and should i have done this before i built the package ?

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

More
29 Apr 2014 17:59 #46472 by roschi
Replied by roschi on topic Ethercat HAL driver

Hi

OK I'm still having issues finding slaves on the network...


Hi,

some hints that might help:
- After starting the EtherCAT Master on Linux the adapter/NIC should not shown as a result for 'ifconfig' --> It is not available for 'classical' Ethernet communication any more
- configure/build EtherCAT master with all available kernel modules --> ./configure --enable-r8169 --enable-8139too --enable-e100 --enable-e1000 --enable-e1000e --enable-generic (lsmod should list the loaded modules: --> ecmaster and the module depending on your hardware, after you start the EtherCAT Master)

- If still the command ethercat slaves gives no result --> Start the LED blinking at your Master NIC after you physical connect to drive? --> If not check for: change to second RJ45 port at the slave, Cross-Link cable or patch cable (depends on the capability of the master NIC to handle both), Your drive is not a EtherCAT slave (are you really sure?)
- Check the functionallity of your slave with EtherCAT-configurator tool from beckhoff on a Windows system or the trial version of TwinCAT 3 (in case of 64 Bit windows). You need the 'original' EtherCAT XML file for the slave/drive from manufacturer
- Have another EtherCAT slave for testing e.g. Beckhoff EK1100 (Which drive do you use?)

Hope that will help

Regards Andreas

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

More
29 Apr 2014 18:27 #46474 by narogon
Replied by narogon on topic Ethercat HAL driver


also i have read through the config page and found the driver for my NIC but the command for --enable must i put this in the configure file in the ethercat-1.5.2 directory and should i have done this before i built the package ?


If you installed it like i explained, all the kernel modules are enabled. So you don't have to configure nothing before installation.

In the ethercat master configuration you must specify your mac and the kernel you are going to use.

I would follow roschi's advices and I would try to check your slaves using twincat for windows (there is a trial version you can download from beckhoff website). If everything is okay it should work in linuxcnc.

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

Time to create page: 0.170 seconds
Powered by Kunena Forum