Ethercat HAL driver
13 Nov 2018 23:18 - 13 Nov 2018 23:58 #120631
by Grotius
Replied by Grotius on topic Ethercat HAL driver
Got it working.
Have used a prime time linuxcnc verision of the past. 2.6. Thanks to Andy for providing a fast iso cd adres on the forum in other thread. forum.linuxcnc.org/38-general-linuxcnc-q...2-6-live-cd-download
the iso cd of 2.6 debian linuxcnc
I grabbed a new pc and installed the iso cd, after the cd, only used this for core installation ethercat :
So now i have some ehtercat working after 5 hours on a old linuxcnc version, problably 32 bit.
But i was started with c code on 64 bit linuxcnc system.
This was compiling but i have to know more about c coding. But first test tonight is so far so good.
The reverse engineering will take some time. I will now first investegate the real time lsec component.
On my 64 bit system the etercat connection is good. But reading value's with a custom component is until now the bottleneck.
Maybe time will bring me to next level.
Have used a prime time linuxcnc verision of the past. 2.6. Thanks to Andy for providing a fast iso cd adres on the forum in other thread. forum.linuxcnc.org/38-general-linuxcnc-q...2-6-live-cd-download
the iso cd of 2.6 debian linuxcnc
I grabbed a new pc and installed the iso cd, after the cd, only used this for core installation ethercat :
Warning: Spoiler!
Installation
After the iso cd installation you have a directory : usr/share/linuxcnc-ethercat
You must type in terminal : sudo thunar -- To open copy, modify them with root privileges. Brrr.
This was for me the succes. In the example of swm-fm45a, i changed the ini to :
[HAL]
#HALFILE = core_sim.hal
HALFILE = swm-fm45a.hal
#HALFILE = swm-fm45a-axis.hal
HALFILE = swm-fm45a-spindle.hal
#HALFILE = swm-fm45a-io.hal
HALFILE = mies.hal
HALFILE = simulated_home.hal
This tiny changes provide e-stop reset + enable + auto homing. Then it's easye'r to check some things.
For those, the launcher adres, that i changed from standard startup icon : /usr/bin/linuxcnc '/home/grotius/linuxcnc/configs/sim.ethercat_mies/swm-fm45a.ini'
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":
They mean. Create a file called linuxcnc-mds.list and in this text file save this :
deb repo.modusoft.de/linuxcnc/wheezy ./
# sudo apt-get update // this was giving error's..
# sudo apt-get install linuxcnc-ethercat // this was going good.
The etherlabmaster should be installed automaticaly.
Currently you will get a warning about missing key. // i have not seen missing keystroke.
edit /etc/default/ethercat to match your setup
# sudo update-ethercat-config // also going good.
reboot
# ethercat slaves // working directly.
this sould show your connected slaves
start working with Ethercat enabled LinuxCNC
After the iso cd installation you have a directory : usr/share/linuxcnc-ethercat
You must type in terminal : sudo thunar -- To open copy, modify them with root privileges. Brrr.
This was for me the succes. In the example of swm-fm45a, i changed the ini to :
[HAL]
#HALFILE = core_sim.hal
HALFILE = swm-fm45a.hal
#HALFILE = swm-fm45a-axis.hal
HALFILE = swm-fm45a-spindle.hal
#HALFILE = swm-fm45a-io.hal
HALFILE = mies.hal
HALFILE = simulated_home.hal
This tiny changes provide e-stop reset + enable + auto homing. Then it's easye'r to check some things.
For those, the launcher adres, that i changed from standard startup icon : /usr/bin/linuxcnc '/home/grotius/linuxcnc/configs/sim.ethercat_mies/swm-fm45a.ini'
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":
They mean. Create a file called linuxcnc-mds.list and in this text file save this :
deb repo.modusoft.de/linuxcnc/wheezy ./
# sudo apt-get update // this was giving error's..
# sudo apt-get install linuxcnc-ethercat // this was going good.
The etherlabmaster should be installed automaticaly.
Currently you will get a warning about missing key. // i have not seen missing keystroke.
edit /etc/default/ethercat to match your setup
# sudo update-ethercat-config // also going good.
reboot
# ethercat slaves // working directly.
this sould show your connected slaves
start working with Ethercat enabled LinuxCNC
So now i have some ehtercat working after 5 hours on a old linuxcnc version, problably 32 bit.
But i was started with c code on 64 bit linuxcnc system.
This was compiling but i have to know more about c coding. But first test tonight is so far so good.
The reverse engineering will take some time. I will now first investegate the real time lsec component.
On my 64 bit system the etercat connection is good. But reading value's with a custom component is until now the bottleneck.
Maybe time will bring me to next level.
Last edit: 13 Nov 2018 23:58 by Grotius.
Please Log in or Create an account to join the conversation.
14 Nov 2018 18:54 #120690
by chimeno
Replied by chimeno on topic Ethercat HAL driver
Hello Grotius,
Ohh that's good, it's exciting when you do the first tests and it starts to work something. It's a good start.
regards
Chimeno
Ohh that's good, it's exciting when you do the first tests and it starts to work something. It's a good start.
regards
Chimeno
Please Log in or Create an account to join the conversation.
17 Nov 2018 21:00 #120923
by Grotius
Replied by Grotius on topic Ethercat HAL driver
Hi, i have a little Ethercat project update for 64 bit linuxcnc systems.
It's a hard case. My c program language must be improved...
But there is every day a little progress.
Next thing to do is setting an digital output outside of linuxcnc. When this succeed i will try to include hal.h.
.
It's a hard case. My c program language must be improved...
But there is every day a little progress.
Next thing to do is setting an digital output outside of linuxcnc. When this succeed i will try to include hal.h.
.
Warning: Spoiler!
installed debian 9, 64 bit with linuxcnc :
www.linuxcnc.org/testing-stretch-rtpreem...tch-uspace-amd64.iso
install a full linuxcnc-dev version, without this skip this page.
sudo apt-get install mercurial (install the etherlab reprository program instead of the git program)
hg clone hg.code.sf.net/p/etherlabmaster/code ethercat-hg
cd ethercat-hg
hg update stable-1.5
./bootstrap
./configure --disable-8139too --enable-generic
sudo make
sudo make modules
sudo make install
sudo make modules_install
sudo depmod
Copy from the ./ethercat-hg directory the file "Module.symvers" to the ./ethercat-hg/examples/mini/ directory.
This solves compiling problem's. This one was not in the HG document's.
Find mac adres : $ ip link show , you get something like this "fi:rs:tx:xx:lo:ve"
Copy the entire hg sysconfig map to :
./etc this results in ./etc/sysconfig/ethercat
Only the above ethercat file is used by etherlab for initialising. So put in there your mac adres " ... " and input in there the : "generic driver"
//This is not important, but just for info :
//In the past i made a empty file in the dev folder with name :
//EtherCAT0
//In the past i made a few files from root to user privileges in the etherlab directory.
For adding a ethercat.h file into the kernel, goto ./ethercat-hg/examples/mini/:
sudo make modules mini.c
sudo insmod mini.c (insmod add's it to the kernel)
sudo rmmod mini.c (rmmod delete's it from the kernel)
# When multi compiling is done, restart your pc for sure. If you do not, you output is not good.
Starting your ethercat master :
./opt/etherlab/etc/init.d/ethercat
type : ./ethercat start
type : ./ethercat stop
type : ./ethercat status
Starting ethercat help tools, for adressing, status, servo over ethercat, etc :
.//home/grotius/ethercat-hg/tool/ethercat
type : ./ethercat
You see a list.....
type : sudo ./ethercat cstruct -v ( this will display your c language upset )
type : sudo ./ethercat reg_write -p1 -tbool 0xf00 1 ( this is a hard one, not suceeded for me )
www.linuxcnc.org/testing-stretch-rtpreem...tch-uspace-amd64.iso
install a full linuxcnc-dev version, without this skip this page.
sudo apt-get install mercurial (install the etherlab reprository program instead of the git program)
hg clone hg.code.sf.net/p/etherlabmaster/code ethercat-hg
cd ethercat-hg
hg update stable-1.5
./bootstrap
./configure --disable-8139too --enable-generic
sudo make
sudo make modules
sudo make install
sudo make modules_install
sudo depmod
Copy from the ./ethercat-hg directory the file "Module.symvers" to the ./ethercat-hg/examples/mini/ directory.
This solves compiling problem's. This one was not in the HG document's.
Find mac adres : $ ip link show , you get something like this "fi:rs:tx:xx:lo:ve"
Copy the entire hg sysconfig map to :
./etc this results in ./etc/sysconfig/ethercat
Only the above ethercat file is used by etherlab for initialising. So put in there your mac adres " ... " and input in there the : "generic driver"
//This is not important, but just for info :
//In the past i made a empty file in the dev folder with name :
//EtherCAT0
//In the past i made a few files from root to user privileges in the etherlab directory.
For adding a ethercat.h file into the kernel, goto ./ethercat-hg/examples/mini/:
sudo make modules mini.c
sudo insmod mini.c (insmod add's it to the kernel)
sudo rmmod mini.c (rmmod delete's it from the kernel)
# When multi compiling is done, restart your pc for sure. If you do not, you output is not good.
Starting your ethercat master :
./opt/etherlab/etc/init.d/ethercat
type : ./ethercat start
type : ./ethercat stop
type : ./ethercat status
Starting ethercat help tools, for adressing, status, servo over ethercat, etc :
.//home/grotius/ethercat-hg/tool/ethercat
type : ./ethercat
You see a list.....
type : sudo ./ethercat cstruct -v ( this will display your c language upset )
type : sudo ./ethercat reg_write -p1 -tbool 0xf00 1 ( this is a hard one, not suceeded for me )
Please Log in or Create an account to join the conversation.
21 Nov 2018 19:00 #121155
by Hawkeye
Replied by Hawkeye on topic Ethercat HAL driver
Hello Grotius,
looks like you are already have a great progress on porting ethercat-driver to 64bit environment. As your last post is already a couple days old, did you already had the chance to test other modules like EL7041 using your modifications?
Would you suggest to start the installation of debian on a clean stock image rather than modifing the already existing debian9 iso-file you mentioned above?
Best Regards,
Ben
looks like you are already have a great progress on porting ethercat-driver to 64bit environment. As your last post is already a couple days old, did you already had the chance to test other modules like EL7041 using your modifications?
Would you suggest to start the installation of debian on a clean stock image rather than modifing the already existing debian9 iso-file you mentioned above?
Best Regards,
Ben
Please Log in or Create an account to join the conversation.
- CNCDestroyer
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
22 Nov 2018 21:34 #121237
by CNCDestroyer
Replied by CNCDestroyer on topic Ethercat HAL driver
Hello,
i want to retrofit a deckel fp4a with Beckhoff, granite devices Argon servo driver and stock servos.
is it possible to controll all devices over ethercat or had someone experience with it ?.
i already worked with beckhoff ethercat I/O´s and Linuxcnc this is not the problem.
i have already found a tutorial with Argon drivers and Linuxcnc but without ethercat.
Please correct me if iam thinking wrong but technically should comunicate etherything over ethercat with linuxcnc ?
Best Regards
Thomas G.
i want to retrofit a deckel fp4a with Beckhoff, granite devices Argon servo driver and stock servos.
is it possible to controll all devices over ethercat or had someone experience with it ?.
i already worked with beckhoff ethercat I/O´s and Linuxcnc this is not the problem.
i have already found a tutorial with Argon drivers and Linuxcnc but without ethercat.
Please correct me if iam thinking wrong but technically should comunicate etherything over ethercat with linuxcnc ?
Best Regards
Thomas G.
Please Log in or Create an account to join the conversation.
22 Nov 2018 23:37 - 23 Nov 2018 00:45 #121245
by Grotius
Replied by Grotius on topic Ethercat HAL driver
@Hawkeye,
I have ordered 2 extra Beckhoff component's. One is for 5v high speed output, this for testing stepper motor's drives and motors relating to the parport LTP1 max rpm's. To measure the real rpm's output difference i can make a conclusion.
Second Beckhoff component is 0-10 volt analog input, for testing torch height control with Beckhoff.
Your EL7041 is a stepper motor driver. This will work, but i think they are expensive, also they are limitied to 8000 steps / rev.
I use 10.000. Then you can use better an ordnary stepper driver with 80volts, you have more power also. 30 volt's up. And less
cost's. But it's nice to see everything in one din row.
The ethercat is currently for me only working outside Linuxcnc. I am looking to find a solution. Every day i spent a lot of time to this issue, and every day i come closer to a solution. One solution can be to solve the makefile from Sascha to 64 bit.
Then this github.com/sittner/linuxcnc-ethercat wil install on 64 bit. I get very far, even i get out an .so file. But there are problem's i have to solve to make this happen without problem's.
Second way is to make a c coded glue module for Linuxcnc. It's only possible with component's, for example Hostmot2 is such a component. What i am learning now is to make command's for the Real Time Api. RTapi. My c program language has to improve, otherwise i get no solution.
I have installed the 32 bit version of ethercat 2 times. I work's directly. But maybe my mistake, sometimes it was locking linux completely. It could be a configuration fault.
The Etercat outside of linuxcnc on 4.9.0-8-rt-amd64 is working perfectly. So now spent some time to integrate it. I have several idea's and tested, also several idea's on stock. Every day i come closer.
@CNC destoyer,
Look at "servo over ethercat", there are servo system's on 32 bit linuxcnc. Also on github.
When installing the github version on 64 bit i get this error :
The error is related to the line 19 in the realtime.mk file :
LDFLAGS += -Wl,-rpath,$(LIBDIR) -L$(LIBDIR) -llinuxcnchal -lethercat
The -lethercat is not found.....
I have ordered 2 extra Beckhoff component's. One is for 5v high speed output, this for testing stepper motor's drives and motors relating to the parport LTP1 max rpm's. To measure the real rpm's output difference i can make a conclusion.
Second Beckhoff component is 0-10 volt analog input, for testing torch height control with Beckhoff.
Your EL7041 is a stepper motor driver. This will work, but i think they are expensive, also they are limitied to 8000 steps / rev.
I use 10.000. Then you can use better an ordnary stepper driver with 80volts, you have more power also. 30 volt's up. And less
cost's. But it's nice to see everything in one din row.
The ethercat is currently for me only working outside Linuxcnc. I am looking to find a solution. Every day i spent a lot of time to this issue, and every day i come closer to a solution. One solution can be to solve the makefile from Sascha to 64 bit.
Then this github.com/sittner/linuxcnc-ethercat wil install on 64 bit. I get very far, even i get out an .so file. But there are problem's i have to solve to make this happen without problem's.
Second way is to make a c coded glue module for Linuxcnc. It's only possible with component's, for example Hostmot2 is such a component. What i am learning now is to make command's for the Real Time Api. RTapi. My c program language has to improve, otherwise i get no solution.
I have installed the 32 bit version of ethercat 2 times. I work's directly. But maybe my mistake, sometimes it was locking linux completely. It could be a configuration fault.
The Etercat outside of linuxcnc on 4.9.0-8-rt-amd64 is working perfectly. So now spent some time to integrate it. I have several idea's and tested, also several idea's on stock. Every day i come closer.
@CNC destoyer,
Look at "servo over ethercat", there are servo system's on 32 bit linuxcnc. Also on github.
When installing the github version on 64 bit i get this error :
Warning: Spoiler!
include ../config.mk
include Kbuild
include $(MODINC)
ifeq ($(BUILDSYS),kbuild)
# dirty workaround to get the RTAI directory
RTAIINCDIR = $(subst /rtai.h,,$(firstword $(wildcard $(foreach i,$(subst -I,,$(filter -I%,$(RTFLAGS))), $(i)/rtai.h))))
ifneq ($(RTAIINCDIR),)
RTAIDIR = $(realpath $(RTAIINCDIR)/..)
endif
all:
$(MAKE) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" KBUILD_EXTRA_SYMBOLS="$(RTLIBDIR)/Module.symvers $(RTAIDIR)/modules/ethercat/Module.symvers" -C $(KERNELDIR) SUBDIRS=`pwd` CC=$(CC) V=0 modules
else
LDFLAGS += -Wl,-rpath,$(LIBDIR) -L$(LIBDIR) -llinuxcnchal -lethercat
all: modules
endif
include Kbuild
include $(MODINC)
ifeq ($(BUILDSYS),kbuild)
# dirty workaround to get the RTAI directory
RTAIINCDIR = $(subst /rtai.h,,$(firstword $(wildcard $(foreach i,$(subst -I,,$(filter -I%,$(RTFLAGS))), $(i)/rtai.h))))
ifneq ($(RTAIINCDIR),)
RTAIDIR = $(realpath $(RTAIINCDIR)/..)
endif
all:
$(MAKE) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" KBUILD_EXTRA_SYMBOLS="$(RTLIBDIR)/Module.symvers $(RTAIDIR)/modules/ethercat/Module.symvers" -C $(KERNELDIR) SUBDIRS=`pwd` CC=$(CC) V=0 modules
else
LDFLAGS += -Wl,-rpath,$(LIBDIR) -L$(LIBDIR) -llinuxcnchal -lethercat
all: modules
endif
The error is related to the line 19 in the realtime.mk file :
LDFLAGS += -Wl,-rpath,$(LIBDIR) -L$(LIBDIR) -llinuxcnchal -lethercat
The -lethercat is not found.....
Last edit: 23 Nov 2018 00:45 by Grotius.
Please Log in or Create an account to join the conversation.
25 Nov 2018 01:42 #121313
by Hawkeye
Replied by Hawkeye on topic Ethercat HAL driver
Hello Grotius,
I am now in from of a debian-strech laptop and I am struggeling with the basic setup of ethercat. do you have a strait guide wo bring the ethercat-stack up and running?
When I try to build the sources I cloned with "hg clone hg.code.sf.net/p/etherlabmaster/code ethercat-hg" I am getting always the following error:
checking for kernel for e1000e driver... configure: error: kernel 4.9 not available for e1000e driver!
so far I tried:
hg clone hg.code.sf.net/p/etherlabmaster/code ethercat-hg
cd ethercat-hg
hg update stable-1.5
./bootstrap
#./configure --disable-8139too --enable-generic --enable-e1000e
./configure --disable-8139too --with-e1000e-kernel --enable-generic
make
make modules
sudo make install
sudo make modules_install
depmod
Best Regards and good night,
Ben
I am now in from of a debian-strech laptop and I am struggeling with the basic setup of ethercat. do you have a strait guide wo bring the ethercat-stack up and running?
When I try to build the sources I cloned with "hg clone hg.code.sf.net/p/etherlabmaster/code ethercat-hg" I am getting always the following error:
checking for kernel for e1000e driver... configure: error: kernel 4.9 not available for e1000e driver!
so far I tried:
hg clone hg.code.sf.net/p/etherlabmaster/code ethercat-hg
cd ethercat-hg
hg update stable-1.5
./bootstrap
#./configure --disable-8139too --enable-generic --enable-e1000e
./configure --disable-8139too --with-e1000e-kernel --enable-generic
make
make modules
sudo make install
sudo make modules_install
depmod
Best Regards and good night,
Ben
Please Log in or Create an account to join the conversation.
25 Nov 2018 11:01 - 25 Nov 2018 11:02 #121317
by Hawkeye
Replied by Hawkeye on topic Ethercat HAL driver
Hello,
Quick update:
Managed to bring up ethercat on my laptop. Needed to start
/etc/init.d/realtime and had to set within /etc/init.d/ethercat the driver to "generic". I had the same issue with /dev/Ethercat0 and solved it temporarily as already described within this Thread(s).
On shell I can see my ethercat devices using "ethcat slaves -v" now.
When I start Linuxcnc 3.8-pre now, it notifys me that my config needa Updates. Wheather or not I agree to update my config, the whole system freezes.
Any Idea?
Best Regards,
Ben
Quick update:
Managed to bring up ethercat on my laptop. Needed to start
/etc/init.d/realtime and had to set within /etc/init.d/ethercat the driver to "generic". I had the same issue with /dev/Ethercat0 and solved it temporarily as already described within this Thread(s).
On shell I can see my ethercat devices using "ethcat slaves -v" now.
When I start Linuxcnc 3.8-pre now, it notifys me that my config needa Updates. Wheather or not I agree to update my config, the whole system freezes.
Any Idea?
Best Regards,
Ben
Last edit: 25 Nov 2018 11:02 by Hawkeye.
Please Log in or Create an account to join the conversation.
25 Nov 2018 12:28 #121318
by Hawkeye
Replied by Hawkeye on topic Ethercat HAL driver
Update:
It's alive!
Works like a Charm!
Linuxcnc3.8 + debian stetch 64bit iso + ethercat components from Beckhoff
It's alive!
Works like a Charm!
Linuxcnc3.8 + debian stetch 64bit iso + ethercat components from Beckhoff
The following user(s) said Thank You: Nico2017
Please Log in or Create an account to join the conversation.
10 Jan 2019 01:47 - 10 Jan 2019 01:50 #123883
by Nico2017
Replied by Nico2017 on topic Ethercat HAL driver
Hi @Hawkeye,
would you be able to summarize the different steps you went through to make it work.
Thank you,
Nicolas
would you be able to summarize the different steps you went through to make it work.
Thank you,
Nicolas
Last edit: 10 Jan 2019 01:50 by Nico2017. Reason: More precise request
Please Log in or Create an account to join the conversation.
Time to create page: 0.369 seconds