Ethercat HAL driver
I've just make a pull request to sasha to add the posibility of using additional attributes in xml files.
Editing the el7041 component file, it wouldn't be so difficult define some sdo commands using the parameters defined on the xml file.
I've just included the parameters to the component, check my fork github.com/narogon/linuxcnc-ethercat
Just have to use
<slave idx="0" type="EL7041-1000" nomVoltage="numberyouwant" maxCurrent="numberyouwant">.....
I've just had a quick look to beckhoff documentation and I think you want to configure 0x8010 0x01 and 0x8010 0x03 parameters. Tell me if the parameters you want are others
Please Log in or Create an account to join the conversation.
Editing the el7041 component file, it wouldn't be so difficult define some sdo commands using the parameters defined on the xml file.
I've just included the parameters to the component, check my fork github.com/narogon/linuxcnc-ethercat
Just have to use<slave idx="0" type="EL7041-1000" nomVoltage="numberyouwant" maxCurrent="numberyouwant">.....
Thank you narogon.
Since these two are crucial parameters that can cause also immediate hardware damage without even moving the motor, it might not be a bad idea to have them in the .xml file. It would be nice however to have the liberty of accessing the entire CoE register later on; how do you see this been done? as described in the link provided by cgc in Thinkpad example, sending commands or maybe a file with all of the addresses inside?
Macheinekit_Thinkpad
Thanks again to both, you have been really helpful. Also thanks sirop, I'll give the files a go in the next days.
Have you tried your fork practically?
If you wish I can try it, got all of the hardware needed..I can set the parameters and check them later with TwinCAT before moving/powering the motor to be on the safe side...
Please Log in or Create an account to join the conversation.
You can check if it works using a terminal and executing:
ethercat -p(SLAVE INDEX) --type uint16 upload 0x8010 03
ethercat -p(SLAVE INDEX) --type uint16 upload 0x8010 01
The same way could be used to read the entire CoE by SDO. Those parameters can't be modified in many slaves while they are in OP state, so i don't see the need to write them in a different way.
Please Log in or Create an account to join the conversation.
"configure.mk:1: ***missing separator. Stop." and an empty config.mk file.
Please Log in or Create an account to join the conversation.
I dled your fork and I tried doing make and install, both resulted in:.
"configure.mk:1: ***missing separator. Stop." and an empty config.mk file.
have you tried?
make clean
make install
I've not made any changes on configure.mk config ...
Only lcec_config.c, lcec_config.h, lcec.h and lcec_main.c
And lcec_el7041_1000.c
Please Log in or Create an account to join the conversation.
the directory where the master from sittner and your fork are, is not the same.
Am I going to have problems to keep on using whatever I had before? seeing he removed a bunch of stuff o.O
sry my linux machine is offline, this is why i posted the screenshot, i know it is more convenient posting the code, but...it wouldve taken a while :/
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
it only removes the compiled files from the directory you are. Let me check again the fork
Try to download it again. It has lot of mistakes from my modifications this morning.
I've just checked it.
Sorry for that.
Please Log in or Create an account to join the conversation.
- sqmathlete
- Offline
- Premium Member
- Posts: 118
- Thank you received: 17
Before I get started I just wanted to say how impressed I am with the development of the LinuxCNC Ethercat HAL Driver. Well done!
This has inspired me to retrofit a Thermwood C50 Gantry Router with an Ethercat system that includes Beckhoff I/O modules and Delta ASDA AC Servo amps.
I did a fresh install of LinuxCNC 2.7.3 and then followed Sascha's instructions on pg 16 of this thread.
The output of which looks like :I also have set up a simple Debian repos (currently without keys) which is intended to be used with the current LinuxCNC Debian Wheezy based dist. This way installation should be very easy:
create a file "/etc/apt/sources.list.d/linuxcnc-mds.list":
deb repo.modusoft.de/linuxcnc/wheezy ./
# sudo apt-get update
# sudo apt-get install linuxcnc-ethercat
The etherlabmaster should be installed automaticaly.
Currently you will get a warning about missing key.
edit /etc/default/ethercat to match your setup
# sudo update-ethercat-config
reboot
# ethercat slaves
daniel@linuxcnc://$ sudo ethercat slaves
[sudo] password for daniel:
0 0:0 PREOP + EK1100 EtherCAT-Koppler (2A E-Bus)
1 0:1 PREOP + EL1008 8K. Dig. Eingang 24V, 3ms
2 0:2 PREOP + EL2022 2K. Dig. Ausgang 24V, 2A
daniel@linuxcnc://$
So far so good. However when I create a basic machine configuration Linuxcnc fails with the following output from the dmesg command
daniel@linuxcnc://$ dmesg | grep eth
[ 13.837409] eth0: 0xf802e000, 08:62:66:45:95:4c, IRQ 18
[ 13.914039] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 16.921149] r8168: eth0: link up
[ 16.921240] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
daniel@linuxcnc://$ sudo ethercat master
[sudo] password for daniel:
Master0
Phase: Idle
Active: no
Slaves: 3
Ethernet devices:
[color=#ff0000] Main: c4:12:f5:32:fe:d2 (attached)[/color]
and
daniel@linuxcnc://$ dmesg | grep lcec
[32892.810025] lcec: disagrees about version of symbol hal_param_float_newf
[32892.810028] lcec: Unknown symbol hal_param_float_newf (err -22)
[32892.810031] lcec: disagrees about version of symbol hal_pin_u32_newf
[32892.810033] lcec: Unknown symbol hal_pin_u32_newf (err -22)
[32892.810056] lcec: disagrees about version of symbol hal_param_bit_newf
[32892.810057] lcec: Unknown symbol hal_param_bit_newf (err -22)
[32892.810068] lcec: disagrees about version of symbol hal_param_s32_newf
[32892.810070] lcec: Unknown symbol hal_param_s32_newf (err -22)
[32892.810082] lcec: disagrees about version of symbol hal_pin_s32_newf
[32892.810083] lcec: Unknown symbol hal_pin_s32_newf (err -22)
[32892.810101] lcec: disagrees about version of symbol hal_pin_bit_newf
[32892.810102] lcec: Unknown symbol hal_pin_bit_newf (err -22)
[32892.810163] lcec: disagrees about version of symbol hal_param_u32_newf
[32892.810164] lcec: Unknown symbol hal_param_u32_newf (err -22)
[33453.100981] lcec: disagrees about version of symbol hal_param_float_newf
[33453.100985] lcec: Unknown symbol hal_param_float_newf (err -22)
[33453.100988] lcec: disagrees about version of symbol hal_pin_u32_newf
[33453.100989] lcec: Unknown symbol hal_pin_u32_newf (err -22)
[33453.101013] lcec: disagrees about version of symbol hal_param_bit_newf
[33453.101015] lcec: Unknown symbol hal_param_bit_newf (err -22)
[33453.101026] lcec: disagrees about version of symbol hal_param_s32_newf
[33453.101027] lcec: Unknown symbol hal_param_s32_newf (err -22)
[33453.101040] lcec: disagrees about version of symbol hal_pin_s32_newf
[33453.101041] lcec: Unknown symbol hal_pin_s32_newf (err -22)
[33453.101058] lcec: disagrees about version of symbol hal_pin_bit_newf
[33453.101060] lcec: Unknown symbol hal_pin_bit_newf (err -22)
[33453.101121] lcec: disagrees about version of symbol hal_param_u32_newf
[33453.101122] lcec: Unknown symbol hal_param_u32_newf (err -22)
I think this was solved (pg22) by boyzo
and cgcI saw Sascha post "fixed debien dependencies for linuxcnc 2.7 userspace version" in its git repository.
How can I install this fix on installed ethercat driver on 2.7 linuxcnc?
Install linuxcnc-dev beforeInstall linuxcnc-dev before
Download the source with : git clone ....
change to the directory: linuxcnc-ethercat
delete old installation: make clean
compile the source with: sudo make install
Download the source with : git clone ....
change to the directory: linuxcnc-ethercat
delete old installation: make clean
compile the source with: sudo make install
Not sure how to proceed since I am using the main distribution instead of the -dev files. Any guidance would greatly be appreciated.
Also, I have attached my test configuration files.
Kind Regards
Daniel
Please Log in or Create an account to join the conversation.
- sqmathlete
- Offline
- Premium Member
- Posts: 118
- Thank you received: 17
daniel@linuxcnc:~$ dmesg | grep EtherCAT
[ 10.098483] EtherCAT: Master driver 1.5.2 2eff7c993a63
[ 10.098565] EtherCAT: 1 master waiting for devices.
[ 10.150577] EtherCAT: Accepting C4:12:F5:32:FE:D2 as main device for master 0.
[ 10.151571] EtherCAT 0: Starting EtherCAT-IDLE thread.
[ 12.141074] EtherCAT 0: Link state of ecm0 changed to UP.
[ 12.145079] EtherCAT 0: 3 slave(s) responding on main device.
[ 12.145085] EtherCAT 0: Slave states on main device: PREOP.
[ 12.153028] EtherCAT WARNING 0: 1 datagram TIMED OUT!
[ 12.153047] EtherCAT 0: Scanning bus.
[ 13.150083] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[ 13.150086] EtherCAT WARNING 0: 125 datagrams UNMATCHED!
[ 14.147134] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[ 14.147137] EtherCAT WARNING 0: 125 datagrams UNMATCHED!
[ 14.713482] EtherCAT 0: Bus scanning completed in 2576 ms.
[ 14.713485] EtherCAT 0: Using slave 0 as DC reference clock.
[ 3152.128644] EtherCAT WARNING 0: 78 datagrams TIMED OUT!
[ 3152.128647] EtherCAT WARNING 0: 78 datagrams UNMATCHED!
[ 3152.152573] EtherCAT ERROR 0-2: Failed to receive AL state datagram: Datagram timed out.
[ 3152.160560] EtherCAT 0: 0 slave(s) responding on main device.
[ 3153.125695] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[ 3154.114772] EtherCAT 0: Link state of ecm0 changed to DOWN.
[32266.047555] EtherCAT 0: Link state of ecm0 changed to UP.
[32266.051558] EtherCAT 0: 3 slave(s) responding on main device.
[32266.051561] EtherCAT 0: Slave states on main device: INIT.
[32266.051600] EtherCAT 0: Scanning bus.
[32266.059510] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[32267.056561] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[32267.056563] EtherCAT WARNING 0: 125 datagrams UNMATCHED!
[32268.053613] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[32268.053615] EtherCAT WARNING 0: 125 datagrams UNMATCHED!
[32268.444481] EtherCAT 0: Bus scanning completed in 2400 ms.
[32268.444484] EtherCAT 0: Using slave 0 as DC reference clock.
[32268.496317] EtherCAT 0: Slave states on main device: PREOP.
[35708.608520] EtherCAT 0: Scanning bus.
[35708.616439] EtherCAT WARNING 0: 54 datagrams TIMED OUT!
[35708.616444] EtherCAT WARNING 0: 54 datagrams UNMATCHED!
[35709.613483] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[35709.613486] EtherCAT WARNING 0: 125 datagrams UNMATCHED!
[35710.610535] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[35710.610538] EtherCAT WARNING 0: 125 datagrams UNMATCHED!
[35710.825920] EtherCAT 0: Bus scanning completed in 2224 ms.
[35710.825922] EtherCAT 0: Using slave 0 as DC reference clock.
[38777.801363] EtherCAT WARNING 0: 29 datagrams TIMED OUT!
[38777.801366] EtherCAT WARNING 0: 29 datagrams UNMATCHED!
[38777.825293] EtherCAT ERROR 0-2: Failed to receive AL state datagram: Datagram timed out.
[38777.833271] EtherCAT 0: 0 slave(s) responding on main device.
[38778.798418] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[38779.787492] EtherCAT 0: Link state of ecm0 changed to DOWN.
[38893.451406] EtherCAT 0: Link state of ecm0 changed to UP.
[38893.455403] EtherCAT 0: 3 slave(s) responding on main device.
[38893.455406] EtherCAT 0: Slave states on main device: PREOP.
[38893.455447] EtherCAT 0: Scanning bus.
[38893.463362] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[38894.460411] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[38894.460414] EtherCAT WARNING 0: 125 datagrams UNMATCHED!
[38895.457465] EtherCAT WARNING 0: 125 datagrams TIMED OUT!
[38895.457468] EtherCAT WARNING 0: 125 datagrams UNMATCHED!
[38895.784517] EtherCAT 0: Bus scanning completed in 2336 ms.
[38895.784519] EtherCAT 0: Using slave 0 as DC reference clock.
daniel@linuxcnc:~$
Thanks again
Daniel
Please Log in or Create an account to join the conversation.