- Posts: 43
- Thank you received: 14
Ethercat HAL driver
- narogon
- Offline
- Senior Member
-
Less
More
11 years 11 months ago #53011
by narogon
You must create a file that describes your network. There is an example in the tutorial. I'm writting using phone, I'll try to clear it up later.
Replied by narogon on topic Ethercat HAL driver
nylon7 wrote: I follow this Tutorial file& user cgc
Now
ethercat slaves0 1001:0 PREOP + EK1100 EtherCAT-Koppler (2A E-Bus)
1 1001:1 PREOP + EL2521 1K. Pulse Train Ausgang
halcmd: loadusr -W lcec_conf ./el2521.xml<stdin>:1: execv(lcec_conf): No such file or directory
<stdin>:1: lcec_conf exited without becoming ready
So, how should I do to solve the problems..
thanks
You must create a file that describes your network. There is an example in the tutorial. I'm writting using phone, I'll try to clear it up later.
- ccdodo
- Offline
- New Member
-
Less
More
- Posts: 5
- Thank you received: 1
11 years 10 months ago #54314
by ccdodo
Replied by ccdodo on topic Need help about installing linuxcnc-add-hal
Hi, I am trying to use linuxcnc with ethercat these days but meet some difficulties:
The first one is failed to 'home'...
Here are the steps I follow to setup linuxcnc:
1. Download ethercat-1.5.2 from Igh
2. untar the tarball of ethercat
# tar xvfj ethercat-1.5.2.tar.bz2
3. About linuxcnc-add-hal-ethercat, there are two source in git, one is from s*** and the other is a***, I download linuxcnc-add-hal-ethercat from axxxx in git as the debian folder is not under /ethercat/master in s*** version.
4. use debian folder in linuxcnc-add-hal-ethercat and ethercat to generate ethercat_1.5.2-1_i386.deb and ethercat-dev_1.5.2-1_i386.deb via dpkg:
4.1 copy the debian directory to your build directory.
# cp -av <path-of-LinuxCNC-add-hal-ethercat>/src/hal/drivers/ethercat /master/debian ethercat-1.5.2 <- Here the debian folder is not really got from a*** source but using the "ec-debianize-master"
4.2 build the packages
# cd ethercat-1.5.2
# cd debian
# ./configure -a
# cd ..
# dpkg-checkbuilddeps (and install missing deps:libtools,dpatch)
# dpkg-buildpackage
5. Install the first deb, modify the MAC and DEVICE in /etc/default /ethercat , and update the config
6. Install the second deb and reboot
7. compile linuxcnc-a-h-e follow:
7.0 add 5101 line to source code
7.1 cd ./linuxcnc-a-h-e/src
7.2 ./configure
7.3 sudo make
7.4 sudo make install
7.5 sudo make setuid
7.6 source script/rip-environment
According to the instruction, "Then do a reboot or load the ec*-modules manually (see /etc/modules), the master should now be functional." after step 5 BUT the modules are not loaded after reboot sometimes or are loaded but no /opt/etherlab/bin/ethercat exist in different trys. Since ethercat works not well so the debs are removed and source code of ethercat has been re-compiled follow:
1 ./autogen.sh
2 ./configure (no "--enable-run-in-place")
3 make clean
make
sudo make setuid
4 back to the upper path and 'source scripts/rip-environment'
5 The version of linuxcnc is 2.6.0~pre
Then the ethercat is able to start and slave status can be checked.
Everything seems to be OK until I press the home button...Nothing happens
HAL config is used to find the problem: Once the home button is pressed, the corresponding axis.N.homing will be true but the vel-cmd will not change and the real axis does not move.
After tried many ways, the problem seems to stay at "HOME_SEARCH_VEL" and "HOME_LATCH_VEL" in INI file:
If both are set to zero, home button is useful but the current position will be set as HOME.
If one is set to zero but the other not, error will be sent to say that the value should be non-zero.
If both are set to non-zero, nothing happens except the status of axis.N.homing changes from false to true and axis.N.home-state changes from 0 to 7.
And if I set both to zero, manualy move those axis to a certain position, and set the current position to be HOME, the machine runs perfect in MDI, JOG or NC mode.
I guess maybe some part of the code is wrong as it was still developing in git but I've no idea what to do...
So, what should I do to solve the problem ?
And where can I get the complete version but not developing version of linuxcnc-add-hal-ethercat?
As to the problem above, I tried another version of linux-add-hal-ethercat in which the emc was still named as "emcec" on another PC.
The steps are the same as those above except the debian folder used in 4.1 is obtained from the folder under corresponding linuxcnc.
Ethercat works well by checking the master and slaves by command lines.
Emcec can be started by 'halrun' and ethercatConf.xml can be loaded by emcec_conf.
BUT, a fatal error jumped out when I type 'loadrt emcec' as below:
'
halcmd: loadrt emcec
insmod: error inserting '/home/nim/new/linuxcnc-add-hal-ethercat/rtlib/emcec.ko': -1 Unknown symbol in module
<stdin>
: exit value: 1
<stdin>
: insmod failed, returned -1
See the output of 'dmesg' for more information.
'
Then I make clean and make again but only many few *.ko can be generated so errors like helper_modules can not be found in /bin will jump out in during make.
Then I install the debs again to compile the linuxcnc again but the error shows up all the same even though no error shows during make.
More info is obtained via 'dmesg' of which maybe useful are attatched and some key sentences are listed below:
[18617.447960] RTAI[hal]:
.8.1> mounted over IPIPE-NOTHREADS 2.6-03.
[18617.447962] RTAI[hal]: compiled with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) .
[18617.447982] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[18617.447984] PIPELINE layers:
[18617.447986] f8d64e20 9ac15d93 RTAI 200
[18617.447987] c085cb20 0 Linux 100
[18617.461417] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[18617.461543] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[18617.461546] RTAI[sched]: hard timer type/freq = APIC/20883354(Hz); default timing: periodic; linear timed lists.
[18617.461549] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 2999805000 hz.
[18617.461550] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[21739.424304] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[21739.424362] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[21739.424366] RTAI[sched]: hard timer type/freq = APIC/20883354(Hz); default timing: periodic; linear timed lists.
[21739.424368] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 2999805000 hz.
[21739.424370] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[21739.424416] RTAI[usi]: enabled.
[21739.447954] RTAI[math]: loaded.
[21762.205786] emcec: Unknown symbol ecrt_sdo_request_timeout
[21762.205847] emcec: Unknown symbol ecrt_request_master
[21762.205953] emcec: Unknown symbol ecrt_release_master
[21762.206013] emcec: Unknown symbol ecrt_master_activate
[21762.206126] emcec: Unknown symbol ecrt_sdo_request_read
[21762.206330] emcec: Unknown symbol ecrt_domain_size
[21762.206390] emcec: Unknown symbol ecrt_master_deactivate
[21762.206451] emcec: Unknown symbol ecrt_slave_config_create_sdo_request
[21762.206656] emcec: Unknown symbol ecrt_master_sync_reference_clock
[21762.206716] emcec: Unknown symbol ecrt_slave_config_pdos
[21762.206776] emcec: Unknown symbol ecrt_domain_data
[21762.206836] emcec: Unknown symbol ecrt_sdo_request_data
more sentences like above fills the whole screen...
As to the weird problems, what should I do to solve them ?
Thanks for your attention and happy new year.
The first one is failed to 'home'...
Here are the steps I follow to setup linuxcnc:
1. Download ethercat-1.5.2 from Igh
2. untar the tarball of ethercat
# tar xvfj ethercat-1.5.2.tar.bz2
3. About linuxcnc-add-hal-ethercat, there are two source in git, one is from s*** and the other is a***, I download linuxcnc-add-hal-ethercat from axxxx in git as the debian folder is not under /ethercat/master in s*** version.
4. use debian folder in linuxcnc-add-hal-ethercat and ethercat to generate ethercat_1.5.2-1_i386.deb and ethercat-dev_1.5.2-1_i386.deb via dpkg:
4.1 copy the debian directory to your build directory.
# cp -av <path-of-LinuxCNC-add-hal-ethercat>/src/hal/drivers/ethercat /master/debian ethercat-1.5.2 <- Here the debian folder is not really got from a*** source but using the "ec-debianize-master"
4.2 build the packages
# cd ethercat-1.5.2
# cd debian
# ./configure -a
# cd ..
# dpkg-checkbuilddeps (and install missing deps:libtools,dpatch)
# dpkg-buildpackage
5. Install the first deb, modify the MAC and DEVICE in /etc/default /ethercat , and update the config
6. Install the second deb and reboot
7. compile linuxcnc-a-h-e follow:
7.0 add 5101 line to source code
7.1 cd ./linuxcnc-a-h-e/src
7.2 ./configure
7.3 sudo make
7.4 sudo make install
7.5 sudo make setuid
7.6 source script/rip-environment
According to the instruction, "Then do a reboot or load the ec*-modules manually (see /etc/modules), the master should now be functional." after step 5 BUT the modules are not loaded after reboot sometimes or are loaded but no /opt/etherlab/bin/ethercat exist in different trys. Since ethercat works not well so the debs are removed and source code of ethercat has been re-compiled follow:
1 ./autogen.sh
2 ./configure (no "--enable-run-in-place")
3 make clean
make
sudo make setuid
4 back to the upper path and 'source scripts/rip-environment'
5 The version of linuxcnc is 2.6.0~pre
Then the ethercat is able to start and slave status can be checked.
Everything seems to be OK until I press the home button...Nothing happens
HAL config is used to find the problem: Once the home button is pressed, the corresponding axis.N.homing will be true but the vel-cmd will not change and the real axis does not move.
After tried many ways, the problem seems to stay at "HOME_SEARCH_VEL" and "HOME_LATCH_VEL" in INI file:
If both are set to zero, home button is useful but the current position will be set as HOME.
If one is set to zero but the other not, error will be sent to say that the value should be non-zero.
If both are set to non-zero, nothing happens except the status of axis.N.homing changes from false to true and axis.N.home-state changes from 0 to 7.
And if I set both to zero, manualy move those axis to a certain position, and set the current position to be HOME, the machine runs perfect in MDI, JOG or NC mode.
I guess maybe some part of the code is wrong as it was still developing in git but I've no idea what to do...
So, what should I do to solve the problem ?
And where can I get the complete version but not developing version of linuxcnc-add-hal-ethercat?
As to the problem above, I tried another version of linux-add-hal-ethercat in which the emc was still named as "emcec" on another PC.
The steps are the same as those above except the debian folder used in 4.1 is obtained from the folder under corresponding linuxcnc.
Ethercat works well by checking the master and slaves by command lines.
Emcec can be started by 'halrun' and ethercatConf.xml can be loaded by emcec_conf.
BUT, a fatal error jumped out when I type 'loadrt emcec' as below:
'
halcmd: loadrt emcec
insmod: error inserting '/home/nim/new/linuxcnc-add-hal-ethercat/rtlib/emcec.ko': -1 Unknown symbol in module
<stdin>
: exit value: 1<stdin>
: insmod failed, returned -1See the output of 'dmesg' for more information.
'
Then I make clean and make again but only many few *.ko can be generated so errors like helper_modules can not be found in /bin will jump out in during make.
Then I install the debs again to compile the linuxcnc again but the error shows up all the same even though no error shows during make.
More info is obtained via 'dmesg' of which maybe useful are attatched and some key sentences are listed below:
[18617.447960] RTAI[hal]:
.8.1> mounted over IPIPE-NOTHREADS 2.6-03.[18617.447962] RTAI[hal]: compiled with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) .
[18617.447982] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[18617.447984] PIPELINE layers:
[18617.447986] f8d64e20 9ac15d93 RTAI 200
[18617.447987] c085cb20 0 Linux 100
[18617.461417] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[18617.461543] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[18617.461546] RTAI[sched]: hard timer type/freq = APIC/20883354(Hz); default timing: periodic; linear timed lists.
[18617.461549] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 2999805000 hz.
[18617.461550] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[21739.424304] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[21739.424362] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[21739.424366] RTAI[sched]: hard timer type/freq = APIC/20883354(Hz); default timing: periodic; linear timed lists.
[21739.424368] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 2999805000 hz.
[21739.424370] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[21739.424416] RTAI[usi]: enabled.
[21739.447954] RTAI[math]: loaded.
[21762.205786] emcec: Unknown symbol ecrt_sdo_request_timeout
[21762.205847] emcec: Unknown symbol ecrt_request_master
[21762.205953] emcec: Unknown symbol ecrt_release_master
[21762.206013] emcec: Unknown symbol ecrt_master_activate
[21762.206126] emcec: Unknown symbol ecrt_sdo_request_read
[21762.206330] emcec: Unknown symbol ecrt_domain_size
[21762.206390] emcec: Unknown symbol ecrt_master_deactivate
[21762.206451] emcec: Unknown symbol ecrt_slave_config_create_sdo_request
[21762.206656] emcec: Unknown symbol ecrt_master_sync_reference_clock
[21762.206716] emcec: Unknown symbol ecrt_slave_config_pdos
[21762.206776] emcec: Unknown symbol ecrt_domain_data
[21762.206836] emcec: Unknown symbol ecrt_sdo_request_data
more sentences like above fills the whole screen...
As to the weird problems, what should I do to solve them ?
Thanks for your attention and happy new year.
- roschi
- Offline
- Senior Member
-
Less
More
- Posts: 40
- Thank you received: 29
11 years 10 months ago - 11 years 10 months ago #54347
by roschi
Replied by roschi on topic Need help about installing linuxcnc-add-hal
Hi,
my comments are based on the latest commit on github aschiffler
The add-hal-ethercat branch is merged to master.
Homing
- set both velocities (latch, search) in the ini file to zero --> simulation purpose, testing
- set search to zero and latch to 6.6 --> multi turn absolut encoders, position will taken from feedback as it is
- set search to zero and latch to 9.9 --> drive driven homing search motion, started by homing pin, finished by home-sw-in pin, (e.g. make use of wireing for overtravel switches directly to drive)
- set search to != zero and latch != 6.6 or 9.9 --> NC driven homing search motion, remember home-sw-in is active low, movement won't start if axis.N.home-sw-in is 0
my comments are based on the latest commit on github aschiffler
The add-hal-ethercat branch is merged to master.
Homing
- set both velocities (latch, search) in the ini file to zero --> simulation purpose, testing
- set search to zero and latch to 6.6 --> multi turn absolut encoders, position will taken from feedback as it is
- set search to zero and latch to 9.9 --> drive driven homing search motion, started by homing pin, finished by home-sw-in pin, (e.g. make use of wireing for overtravel switches directly to drive)
- set search to != zero and latch != 6.6 or 9.9 --> NC driven homing search motion, remember home-sw-in is active low, movement won't start if axis.N.home-sw-in is 0
Last edit: 11 years 10 months ago by roschi.
The following user(s) said Thank You: ccdodo
- ccdodo
- Offline
- New Member
-
Less
More
- Posts: 5
- Thank you received: 1
11 years 10 months ago - 11 years 10 months ago #54357
by ccdodo
Replied by ccdodo on topic Need help about installing linuxcnc-add-hal
Hi Roschi,
Thanks for your help first. The home does move the joints after I modified the signals in hal file.
BUT the home procedure is not like what I expected: After the home button is pressed, two possible results will turn out according to different config:
A The joint moves to the home switch but makes no more move when it reaches the switch, and homing stays True.
B The joint moves to the home switch which is reused as limit switch, sets the current coordinate as HOME_OFFSET, shows the homed sign like BMW, and sent a limit error.
Different combinations of parameters in ini file are test:
home_sw & limit_sw are different | home_sw & limit_sw are the same
HM_OFFSET: 0 0 0 0 | 0 30 30 -30
SEARCH_VEL: 30 30 -30 -30 | 30 30 30 30
LATCH_VEL: -5 5 5 -5 | -5 -5 5 5
IGNORE LIMIT: Y Y Y Y | Y Y Y Y
Result: A A * * | B B B B
*) Homing is aborted manually as homing direction is wrong
The mechanism structure in my machine is like:
X+ [Axis end] joint home-sw limit-sw [Axis end] X-
In condition A, limit-sw is false when it is not touched and it is wired into t input port on EL2521, home-sw is true when it is not touched and it is wired into input port on EL1008.
In condition B, home-sw in A is disabled and limit-sw is reused as home-sw, the input is connected into t-not port in hal file as it has to be the opposite to limit-sw.
The results seem to show that the action used to find the exact position of home after the joint reached the home-sw is invalid.
It really confused me...
Thanks for your help first. The home does move the joints after I modified the signals in hal file.
BUT the home procedure is not like what I expected: After the home button is pressed, two possible results will turn out according to different config:
A The joint moves to the home switch but makes no more move when it reaches the switch, and homing stays True.
B The joint moves to the home switch which is reused as limit switch, sets the current coordinate as HOME_OFFSET, shows the homed sign like BMW, and sent a limit error.
Different combinations of parameters in ini file are test:
home_sw & limit_sw are different | home_sw & limit_sw are the same
HM_OFFSET: 0 0 0 0 | 0 30 30 -30
SEARCH_VEL: 30 30 -30 -30 | 30 30 30 30
LATCH_VEL: -5 5 5 -5 | -5 -5 5 5
IGNORE LIMIT: Y Y Y Y | Y Y Y Y
Result: A A * * | B B B B
*) Homing is aborted manually as homing direction is wrong
The mechanism structure in my machine is like:
X+ [Axis end] joint home-sw limit-sw [Axis end] X-
In condition A, limit-sw is false when it is not touched and it is wired into t input port on EL2521, home-sw is true when it is not touched and it is wired into input port on EL1008.
In condition B, home-sw in A is disabled and limit-sw is reused as home-sw, the input is connected into t-not port in hal file as it has to be the opposite to limit-sw.
The results seem to show that the action used to find the exact position of home after the joint reached the home-sw is invalid.
It really confused me...
Last edit: 11 years 10 months ago by ccdodo. Reason: some content needs to be modified as spaces are ignored
- roschi
- Offline
- Senior Member
-
Less
More
- Posts: 40
- Thank you received: 29
11 years 10 months ago #54432
by roschi
Replied by roschi on topic Need help about installing linuxcnc-add-hal
Hi,
as I understand your post/problem above you use the "classic" homing sequence state machine. (LinuxCNC commands moves and recognize the switches)
I have modified this to my needs.
I have tested the "classic" homing so far but I can't reply 100% if it is doing all things right. For my config it does. ("classic" and my new variantes to state machine)
Please use the version for homing.c before my edits and look for common help on homing. ( link to correpondinf git hub file homing.c )
I think this is not a special topic which is connected to EtherCAT HAL Driver. Independent if you use the digital I/O via EtherCAT.
Hope that will help
Regards Andreas
as I understand your post/problem above you use the "classic" homing sequence state machine. (LinuxCNC commands moves and recognize the switches)
I have modified this to my needs.
I have tested the "classic" homing so far but I can't reply 100% if it is doing all things right. For my config it does. ("classic" and my new variantes to state machine)
Please use the version for homing.c before my edits and look for common help on homing. ( link to correpondinf git hub file homing.c )
I think this is not a special topic which is connected to EtherCAT HAL Driver. Independent if you use the digital I/O via EtherCAT.
Hope that will help
Regards Andreas
- sdfzz
- Offline
- New Member
-
Less
More
- Posts: 11
- Thank you received: 0
11 years 9 months ago - 11 years 9 months ago #54484
by sdfzz
Replied by sdfzz on topic Ethercat HAL driver
Hi,
First of all, thank you for your contribution.
However, I am having problems installing HAL-driver. I am planning to use LinuxCNC with EtherCAT slaves.
So, I've downloaded and installed LinuxCNC 2.6 LiveCD. Then, following roschi's tutorial, I downloaded EtherLab and "ec-debianize-master.zip".
I put "debian" folder from "ec-debianize-master.zip" inside Etherlab folder and ran the followings in terminal:
cd debian
sudo ./configure -a
However, I get error saying "sudo: ./configure: command not found"
Does anyone knows how to fix this? Any help will be appreciated
Thanks, Steve
First of all, thank you for your contribution.
However, I am having problems installing HAL-driver. I am planning to use LinuxCNC with EtherCAT slaves.
So, I've downloaded and installed LinuxCNC 2.6 LiveCD. Then, following roschi's tutorial, I downloaded EtherLab and "ec-debianize-master.zip".
I put "debian" folder from "ec-debianize-master.zip" inside Etherlab folder and ran the followings in terminal:
cd debian
sudo ./configure -a
However, I get error saying "sudo: ./configure: command not found"
Does anyone knows how to fix this? Any help will be appreciated
Thanks, Steve
Last edit: 11 years 9 months ago by sdfzz.
Time to create page: 1.375 seconds