- Posts: 12
- Thank you received: 0
Ethercat HAL driver
I'm not using the etherlab control as outlined by sascha. I just use the etherlab (1.5.2) package control scripts from the command line.
My config file is in /etc/ethercat.conf as per etherlab default but the modified version outlined on the wiki places it elsewhere... so you might have a problem there.
You should try to get the etherlab part running first -- so going to the etherlab mailing list may also be a good start.
First you can check that the module is the correct module it should be
sudo ethercatctl stop
check your 'normal' driver is e100 not e1000 or e1000e
lsmod | grep -i e100
if e100 is not listed then that might the problem
sudo ethercatctl start
note any errors; check dmesg for errors
then check the module is loaded
sudo lssmod | grep -i ec
you should have
ec_master
ec_e100
any module listed with a ec_ prefix is an ethercat module;
If that looks OK then run the ethercat command with -v to print more info.
Check dmesg after running
ethercat -v master
Please Log in to join the conversation.
I just follow the etherlab's doc:
$ ./configure
$ make
$ make modules
# make install
# make modules install
# depmod
cd /opt/etherlab
cp etc/sysconfig/ethercat /etc/sysconfig/
ln -s etc/init.d/ethercat /etc/init.d/
then customize the sysconfig file /etc/sysconfig/ethercat
start the master
/etc/init.d/ethercat start
and I can find the master and slaves.
$ sudo /opt/etherlab/bin/ethercat -v master
Master0
Phase: Idle
Active: no
Slaves: 4
Ethernet devices:
Main: e0:05:c5:eb:5a:7f (attached)
Link: UP
Tx frames: 35480
Rx frames: 35479
Lost frames: 0
Tx bytes: 2148072
Tx errors: 0
Tx frame rate [1/s]: 250 780 458
Tx rate [KByte/s]: 14.6 46.1 27.1
Loss rate [1/s]: 0 0 0
Frame loss [%]: 0.0 0.0 0.0
Backup: None.
Distributed clocks:
Reference clock: Slave 0
Application time: 0
2000-01-01 00:00:00.000000000
sudo /opt/etherlab/bin/ethercat -v slave
=== Master 0, Slave 0 ===
State: PREOP
Flag: +
Identity:
Vendor Id: 0x00000002
Product code: 0x044c2c52
Revision number: 0x00110000
Serial number: 0x00000000
DL information:
FMMU bit operation: no
Distributed clocks: yes, 64 bit
DC system time transmission delay: 0 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 MII up open yes - 3877337170 0 0
1 EBUS up open yes 1 3877338060 890 145
2 MII down closed no - - - -
3 N/A down closed no - - - -
General:
Group: SystemBk
Image name:
Order number: EK1100
Device name: EK1100 EtherCAT-Koppler (2A E-Bus)
Flags:
Enable SafeOp: no
Enable notLRW: no
Current consumption: -2000 mA
=== Master 0, Slave 1 ===
State: PREOP
Flag: +
Identity:
Vendor Id: 0x00000002
Product code: 0x07d83052
Revision number: 0x00100000
Serial number: 0x00000000
DL information:
FMMU bit operation: no
Distributed clocks: yes, 64 bit
DC system time transmission delay: 145 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 EBUS up open yes 0 3816389530 0 145
1 EBUS up open yes 2 3816390130 600 145
2 N/A down closed no - - - -
3 N/C down closed no - - - -
General:
Group: DigOut
Image name:
Order number: EL2008
Device name: EL2008 8K. Dig. Ausgang 24V, 0.5A
Flags:
Enable SafeOp: no
Enable notLRW: no
Current consumption: 110 mA
=== Master 0, Slave 2 ===
State: PREOP
Flag: +
Identity:
Vendor Id: 0x00000002
Product code: 0x03f03052
Revision number: 0x00100000
Serial number: 0x00000000
DL information:
FMMU bit operation: no
Distributed clocks: yes, 64 bit
DC system time transmission delay: 290 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 EBUS up open yes 1 2666310340 0 145
1 EBUS up open yes 3 2666310650 310 155
2 N/A down closed no - - - -
3 N/C down closed no - - - -
General:
Group: DigIn
Image name: TERM_DI
Order number: EL1008
Device name: EL1008 8K. Dig. Eingang 24V, 3ms
Flags:
Enable SafeOp: no
Enable notLRW: no
Current consumption: 90 mA
=== Master 0, Slave 3 ===
State: PREOP
Flag: +
Identity:
Vendor Id: 0x00000002
Product code: 0x09d93052
Revision number: 0x03fb0000
Serial number: 0x00000000
DL information:
FMMU bit operation: no
Distributed clocks: yes, 64 bit
DC system time transmission delay: 445 ns
Port Type Link Loop Signal NextSlave RxTime [ns] Diff [ns] NextDc [ns]
0 EBUS up open yes 2 3745942530 0 155
1 EBUS down closed no - - - -
2 N/A down closed no - - - -
3 N/C down closed no - - - -
Mailboxes:
Bootstrap RX: 0x1000/244, TX: 0x10f4/244
Standard RX: 0x1200/54, TX: 0x1280/54
Supported protocols: CoE, FoE
General:
Group: DigOut
Image name:
Order number: EL2521
Device name: EL2521 1K. Pulse Train Ausgang
CoE details:
Enable SDO: yes
Enable SDO Info: yes
Enable PDO Assign: yes
Enable PDO Configuration: no
Enable Upload at startup: no
Enable SDO complete access: yes
Flags:
Enable SafeOp: no
Enable notLRW: no
Current consumption: 280 mA
Please Log in to join the conversation.
If using the deb after changing the conf in /etc/default/ethercat just do a "sudo update-ethercat-config". This will activate the new configuration.
Please Log in to join the conversation.
I have some questions about this HAL driver for the ethercat.
I did see that it says that it supports distributed clocks is this also for the servo drives?
Would it work to connect 5 servodrives over ethercat and interpolate them or this driver is not made for that kind of tasks?
We are using ethercat drives at my work, so i have good knowledge about this bt not with this HAL driver and Linux CNC.
Is there any one using servos like i wonder and have good result or its better to go for the old style with analog and pulse signals?
Best regards
Oscar
Please Log in to join the conversation.
I plan to fit my milling machine with Ethercat controlled drives (actually +/- 10V). All hardware is still here but the time is the problem!
Do you have scills about the mapping of the SDO and PDO objects with Ethercat and here especialy with the drives? You have to go very deep in the CAN over Ethercat protocol.....
Ingo (Germany)
Please Log in to join the conversation.
it supports DC for any device that supports DCs. Please find here an example for a machine with stoeber servo inverters:
First you need too tell the master to sync its clock to the slaves:
Then you can configure the sync for each device:
What kind of inverter do you plan to use? You can use the generic driver to interface that device (please see one of my earlier posts for an example), but real fun will appear if you build an native driver module for a particular inverter that do all the dirty work like scaling, reading SDOs on initialization and exporting pins with the domain specific data types. The lcec_stmds5k.c or lcec_el7342.c might be good starting points for that (stmds5k is the stoeber inverter and el7342 a dc motor driver with encoder fedback).
Regards
Sascha
Please Log in to join the conversation.
I used the "generic" EtherCat driver from Sascha Ittner for Bosch Rexroth Indradrives.
I've added a parameter to the XML file in the generic slave entry which does a simple scaling (meens also adjusting some code from Sascha Ittner). Nothing else was changed in the generic driver. All other settings can be made directly in the drive.
See Post
or
video from setup on youtube
Please Log in to join the conversation.
I would ask some few things:
1. Sascha did a driver that has also a generic that you can modify and save for use with new hardware. This is comlicated for somebody that has no experience in doing that (like me). Is it possible that someday, somebody will write a parser from configuration XML files to EMC2? On Beckhoff site you can dowload the entire product line with XML conf files, except AX5xxx servos. It wouldn't be simpler to copy directory (or xml files from other hw makers) to emc2 directory and simply selecting them - I know that isn't easy and what we do have now is quite good, but...
2. I downloaded servo AX5xxx conf files in XML format, all I have seen is that servo drives series 5000 from Beckhoff use Sercos over Ethercat (SoE), will be possible in future to implemet also SoE devices?
3. Is it possible to have a quick tutorial how to make a driver from Sascha's generic one, if you get an XML file with PDOs ?
Anyway thank you for the contribution (Sascha, Etherlab) you already did, it changed emc2 from hobby to professional.
Please Log in to join the conversation.
Coyote wrote: 1. Sascha did a driver that has also a generic that you can modify and save for use with new hardware. This is comlicated for somebody that has no experience in doing that (like me). Is it possible that someday, somebody will write a parser from configuration XML files to EMC2?
We aren't allowed to use the four characters "EMC2" any more, we have had to rebrand everything as "LinuxCNC".
Anyway, as far as I can see, the config files for the LinuxCNC Ethercat driver are XML files. It may be that the ones you can download will just work.
Please Log in to join the conversation.
I think we are not that far away from that. See the tutorial.Coyote wrote: 1. Sascha did a driver that has also a generic that you can modify and save for use with new hardware. This is comlicated for somebody that has no experience in doing that (like me). Is it possible that someday, somebody will write a parser from configuration XML files to EMC2? On Beckhoff site you can dowload the entire product line with XML conf files, except AX5xxx servos. It wouldn't be simpler to copy directory (or xml files from other hw makers) to emc2 directory and simply selecting them - I know that isn't easy and what we do have now is quite good, but...
.
Coyote wrote: 2. I downloaded servo AX5xxx conf files in XML format, all I have seen is that servo drives series 5000 from Beckhoff use Sercos over Ethercat (SoE), will be possible in future to implemet also SoE devices?
The configuration of drives with SoE is not (yet) possible with the HAL-Driver for EtherCAT. Therefore you have to build a state machine within the init phase of the HAL-driver itself. That’s because some of the IDN’s can only be written in Bus-INIT Phase and some should be written to the drive in the Bus-PreOP Phase. (The tool EtherCAT Configurator from Beckhoff, free download does this). Because you have to do this only once, from my point of view there is no great need to implement in the HAL-Driver SoE support in a general way for different Bus-Phases. It is 'nice to have'.
Coyote wrote: 3. Is it possible to have a quick tutorial how to make a driver from Sascha's generic one, if you get an XML file with PDOs ?
I have written a little tutorial that work for the IndraDrive Cs from Bosch Rexroth. If you plan to do the scaling in the HAL-Setup you can use the generic driver as it is without programming. (Just position command, position feedback and enable inverter) I think it should work also for Beckhoff, AMK, LTI drives because the Content of the XML files from manufacturer is standarized
Tutorial on Google Docs
Please feel free to comment directly in the document or correct my english.
Best Regards Andreas
Please Log in to join the conversation.
