Ethercat HAL driver
- willrat
- Offline
- New Member
Less
More
- Posts: 12
- Thank you received: 1
01 Apr 2013 04:04 - 01 Apr 2013 14:03 #32134
by willrat
Replied by willrat on topic Ethercat HAL driver
Great, Thanks for the update.
And you've added 40x2 - useful as I have a EL4032 AO unit to utilise. I also have a EL3063 12bit AI - I'll have a look at the setup for the 3162 and see if I can figure it out.
There was a typo (.o changed to .c) in the Makefile that prevented building. I've attached a diff of what I assumed to be a fix. however I now have undefined symbols when it builds emcec.ko
WARNING: "ecrt_master_receive" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_create_domain" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_sdo" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_send" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_sdo_request_state" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_domain_queue" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_sync_slave_clocks" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_complete_sdo" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_watchdog" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_domain_reg_pdo_entry_list" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_application_time" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_domain_process" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_callbacks" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_state" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_state" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_slave_config" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_dc" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_sdo_request_data" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_domain_data" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_pdos" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_sync_reference_clock" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_create_sdo_request" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_deactivate" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_domain_size" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_sdo_request_read" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_activate" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_release_master" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_request_master" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_sdo_request_timeout" [/home/user/linux-ec/src/emcec.ko] undefined!
And you've added 40x2 - useful as I have a EL4032 AO unit to utilise. I also have a EL3063 12bit AI - I'll have a look at the setup for the 3162 and see if I can figure it out.
There was a typo (.o changed to .c) in the Makefile that prevented building. I've attached a diff of what I assumed to be a fix. however I now have undefined symbols when it builds emcec.ko
WARNING: "ecrt_master_receive" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_create_domain" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_sdo" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_send" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_sdo_request_state" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_domain_queue" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_sync_slave_clocks" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_complete_sdo" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_watchdog" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_domain_reg_pdo_entry_list" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_application_time" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_domain_process" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_callbacks" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_state" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_state" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_slave_config" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_dc" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_sdo_request_data" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_domain_data" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_pdos" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_sync_reference_clock" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_slave_config_create_sdo_request" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_deactivate" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_domain_size" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_sdo_request_read" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_master_activate" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_release_master" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_request_master" [/home/user/linux-ec/src/emcec.ko] undefined!
WARNING: "ecrt_sdo_request_timeout" [/home/user/linux-ec/src/emcec.ko] undefined!
Last edit: 01 Apr 2013 14:03 by willrat. Reason: added build errors
Please Log in or Create an account to join the conversation.
- sascha
- Offline
- New Member
Less
More
- Posts: 18
- Thank you received: 30
01 Apr 2013 15:38 #32146
by sascha
Replied by sascha on topic Ethercat HAL driver
OK, I've fixed the Makefile (was the tribute to try a fast action ).
In case of EL41x2 to EL40x2 just the output object ID's are changed. EL31x2 to EL30x2 is
not such simple, as the state information differs a little (I think you mean EL3062?).
If you have such a device, it would be fine if you try. Keep asking when I could help.
The warnings you see come from the missing "extern" keyword on the
function declaration in ecrt.h (in my opinion), but I haven't testet it yet.
I will have to do it and send the developers a notice. But the warning has no
functional impact. It also appears when you build the EtherCAT RT demo apps.
In case of EL41x2 to EL40x2 just the output object ID's are changed. EL31x2 to EL30x2 is
not such simple, as the state information differs a little (I think you mean EL3062?).
If you have such a device, it would be fine if you try. Keep asking when I could help.
The warnings you see come from the missing "extern" keyword on the
function declaration in ecrt.h (in my opinion), but I haven't testet it yet.
I will have to do it and send the developers a notice. But the warning has no
functional impact. It also appears when you build the EtherCAT RT demo apps.
Please Log in or Create an account to join the conversation.
- sascha
- Offline
- New Member
Less
More
- Posts: 18
- Thank you received: 30
01 Apr 2013 17:53 #32149
by sascha
Replied by sascha on topic Ethercat HAL driver
I think I have to use KBUILD_EXTRA_SYMBOLS to avoid the warnings. I will test ist later.
Please Log in or Create an account to join the conversation.
- willrat
- Offline
- New Member
Less
More
- Posts: 12
- Thank you received: 1
02 Apr 2013 04:02 #32166
by willrat
Replied by willrat on topic Ethercat HAL driver
Yes EL3062 a typo! and EL4032 2 channels AI and AO 12-bit. We are controlling hydraulic servos and getting position with Balluff transducers.
I'm now going to try a small (simple) test rig with 2xEL1018 8 Channel input modules. Running the 'ethercat master' give me a idle master; all the slaves are reported. The 'user' example makes the master active. So I'm assuming the master is OK.
I'm guessing something like this might work for my hal configuration...
$halrun
halrun: loadusr emcec_conf config.xml
halrun: loadrt emcec
So whats the format of the input config.xml?
Looking at the code for each device is seems the hal pins are automatically named canonically. So is the config just for additional parameters? trying loadrt emcec complains of no emcec_conf.
I'm now going to try a small (simple) test rig with 2xEL1018 8 Channel input modules. Running the 'ethercat master' give me a idle master; all the slaves are reported. The 'user' example makes the master active. So I'm assuming the master is OK.
I'm guessing something like this might work for my hal configuration...
$halrun
halrun: loadusr emcec_conf config.xml
halrun: loadrt emcec
So whats the format of the input config.xml?
Looking at the code for each device is seems the hal pins are automatically named canonically. So is the config just for additional parameters? trying loadrt emcec complains of no emcec_conf.
Please Log in or Create an account to join the conversation.
- sascha
- Offline
- New Member
Less
More
- Posts: 18
- Thank you received: 30
02 Apr 2013 04:29 #32167
by sascha
Replied by sascha on topic Ethercat HAL driver
You have to load as follows:
so that the real time part is loaded just after the config parser is ready.
Then add read/write function. For example:
The xml file in the simples case is just a list of slaves. Please note
that "appTimePeriod" has to match the period of the servo-thread in
the example above.
Here a more complex example with DC config, generic device, dynamic PDO mapping
and SDO initialization:
You are right. Pin names are generated pending on the type of devide (except the
generic one). There is also a attribtute "name" for masters & slaves to override
the default index based naming.
I should do some work an docs
loadusr -W emcec_conf ethercat-conf.xml
loadrt emcec
so that the real time part is loaded just after the config parser is ready.
Then add read/write function. For example:
addf emcec.read-all servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf emcec.write-all servo-thread
The xml file in the simples case is just a list of slaves. Please note
that "appTimePeriod" has to match the period of the servo-thread in
the example above.
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="10">
<slave idx="0" type="EK1100"/>
<slave idx="1" type="EL1008"/>
<slave idx="2" type="EL1808"/>
<slave idx="3" type="EL2808"/>
<slave idx="4" type="EL2808"/>
<slave idx="5" type="EL3162"/>
<slave idx="6" type="EL4132"/>
<slave idx="7" type="EL4132"/>
<slave idx="8" type="EL5151"/>
<slave idx="9" type="EL5152"/>
<slave idx="10" type="EL5101"/>
<slave idx="11" type="EL2521"/>
</master>
Here a more complex example with DC config, generic device, dynamic PDO mapping
and SDO initialization:
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="10">
<slave idx="0" type="EK1100"/>
<slave idx="1" type="EL1809"/>
<slave idx="2" type="EL1809"/>
<slave idx="3" type="EL2809"/>
<slave idx="4" type="EL4002"/>
<slave idx="5" type="EL4002"/>
<!-- EL6751 CANopen slave -->
<slave idx="6" type="generic" vid="00000002" pid="1a5f3052" configPdos="true">
<sdoConfig idx="f800" subIdx="complete">
<sdoDataRaw data="0A 00 05 02 80 00 1E 00"/>
<sdoDataRaw data="01 00 12 80 64 00"/>
</sdoConfig>
<sdoConfig idx="8000" subIdx="complete">
<sdoDataRaw data="2B 00 05 00 00 00 00 00"/>
<sdoDataRaw data="00 00 00 00 00 00 00 00"/>
<sdoDataRaw data="00 00 00 00 05 04 00 00"/>
<sdoDataRaw data="02 00 00 00 5F 1A 00 00"/>
<sdoDataRaw data="00 00 00 00 00 00 00 00"/>
<sdoDataRaw data="00 00 00 00 00 00 00 00"/>
<sdoDataRaw data="00 00 02 00 64 00 03 00"/>
<sdoDataRaw data="D0 07 00 00 01 01 00 00"/>
<sdoDataRaw data="0A 00"/>
</sdoConfig>
<sdoConfig idx="8001" subIdx="complete">
<sdoDataRaw data="01 00 01 00 00 00 FF 02"/>
<sdoDataRaw data="85 01 00 00 00 00 00 18"/>
</sdoConfig>
<sdoConfig idx="8002" subIdx="complete">
<sdoDataRaw data="01 00 00 00 00 00 FF 02"/>
<sdoDataRaw data="05 02 00 00 00 00 00 14"/>
</sdoConfig>
<syncManager idx="0" dir="out">
</syncManager>
<syncManager idx="1" dir="in">
</syncManager>
<syncManager idx="2" dir="out">
<pdo idx="1600">
<pdoEntry idx="7000" subIdx="01" bitLen="16" halPin="can-out" halType="bit"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<pdoEntry idx="6000" subIdx="01" bitLen="16" halPin="can-in" halType="bit"/>
</pdo>
<pdo idx="1a80">
<pdoEntry idx="a000" subIdx="01" bitLen="8" halPin="can-slave-nodestate" halType="u32"/>
<pdoEntry idx="f100" subIdx="01" bitLen="8" halPin="can-error" halType="u32"/>
<pdoEntry idx="f100" subIdx="03" bitLen="16" halPin="can-state" halType="u32"/>
<pdoEntry idx="f100" subIdx="02" bitLen="1" halPin="can-diagflag" halType="bit"/>
<pdoEntry idx="a000" subIdx="02" bitLen="1" halPin="can-slave-diagflag" halType="bit"/>
<pdoEntry idx="0000" subIdx="00" bitLen="6"/>
</pdo>
</syncManager>
</slave>
<slave idx="7" type="EL2809"/>
<slave idx="8" type="EL7342">
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/>
<watchdog divider="2498" intervals="2000"/>
</slave>
<slave idx="9" type="EL7342">
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-25000"/>
<watchdog divider="2498" intervals="2000"/>
</slave>
<slave idx="10" type="EL9505"/>
</master>
You are right. Pin names are generated pending on the type of devide (except the
generic one). There is also a attribtute "name" for masters & slaves to override
the default index based naming.
I should do some work an docs
The following user(s) said Thank You: Nico2017
Please Log in or Create an account to join the conversation.
- willrat
- Offline
- New Member
Less
More
- Posts: 12
- Thank you received: 1
03 Apr 2013 04:00 - 03 Apr 2013 04:00 #32190
by willrat
Replied by willrat on topic Ethercat HAL driver
Thanks for that very much appreciated, I've got a basic functioning system now.
The notes you've just posted is enough docs for starters!
One thing we are interested in for the future is the EL6224 which is for IO-Link devices; I don't know if you've come across this technology; its another consortium arrangement; it allows traditionally analog devices to be connected serially and device configuration can be done over the network also.
The notes you've just posted is enough docs for starters!
One thing we are interested in for the future is the EL6224 which is for IO-Link devices; I don't know if you've come across this technology; its another consortium arrangement; it allows traditionally analog devices to be connected serially and device configuration can be done over the network also.
Last edit: 03 Apr 2013 04:00 by willrat.
Please Log in or Create an account to join the conversation.
- nursum
- Offline
- New Member
Less
More
- Posts: 16
- Thank you received: 0
08 Apr 2013 23:23 #32438
by nursum
Replied by nursum on topic Ethercat HAL driver
Hi,
ist the servo driver also usable for the Beckhoff AX drives, which are similar to Servostar from Kollmorgen and ABB ACP201drives? They also uses COE (CanOpen over EtherCat).
I plan to use these drives for my milling machine which works actually with "big" DC-Motors (2 KW Siemens).
Ingo
ist the servo driver also usable for the Beckhoff AX drives, which are similar to Servostar from Kollmorgen and ABB ACP201drives? They also uses COE (CanOpen over EtherCat).
I plan to use these drives for my milling machine which works actually with "big" DC-Motors (2 KW Siemens).
Ingo
Please Log in or Create an account to join the conversation.
- willrat
- Offline
- New Member
Less
More
- Posts: 12
- Thank you received: 1
09 Apr 2013 03:15 #32443
by willrat
Replied by willrat on topic Ethercat HAL driver
I think you will have to write a driver for this.
The ethercat master is based on etherlab. Search the web for "etherlab ax" gives a few results on the etherlab mailing list with different versions of the AX drives - some use CANoverEtherCat some use SercosOverEthercat -- perhaps some have had success?
The Beckhoff website does not have the full specs for the servo drives' ethercat interface (whilst the IO modules are well documented)
I'd start here
www.mail-archive.com/find.php?cx=partner...therlab+ax&sa=Search
The ethercat master is based on etherlab. Search the web for "etherlab ax" gives a few results on the etherlab mailing list with different versions of the AX drives - some use CANoverEtherCat some use SercosOverEthercat -- perhaps some have had success?
The Beckhoff website does not have the full specs for the servo drives' ethercat interface (whilst the IO modules are well documented)
I'd start here
www.mail-archive.com/find.php?cx=partner...therlab+ax&sa=Search
Please Log in or Create an account to join the conversation.
- ccdodo
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 1
07 Jun 2013 12:22 #35385
by ccdodo
Replied by ccdodo on topic Ethercat HAL driver
great work!
Please Log in or Create an account to join the conversation.
- ccdodo
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 1
25 Jun 2013 08:27 #36017
by ccdodo
Replied by ccdodo on topic Ethercat HAL driver
Hi, I have installed the EtherCAT master follow the wiki wiki.linuxcnc.org/cgi-bin/wiki.pl?EtherCatDriver. I have some beckhoff modules: EK1100 ,EL2008,EL1008,EL2521. But I can't visit the slaves. When running 'ethercat master',it shows:
Master0
Phase: Waiting for device(s)...
Active: no
Slaves: 0
Ethernet devices:
Main: 00:01:6c:8b:dd:f8 (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
My Network adapter is Intel Pro/100 VM, and the ethercat config file content is:
MASTER0_DEVICE="00:01:6C:8B:DD:F8"
DEVICE_MODULES="e100"
So I don't know how to fix it. anyone can help?
Master0
Phase: Waiting for device(s)...
Active: no
Slaves: 0
Ethernet devices:
Main: 00:01:6c:8b:dd:f8 (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
My Network adapter is Intel Pro/100 VM, and the ethercat config file content is:
MASTER0_DEVICE="00:01:6C:8B:DD:F8"
DEVICE_MODULES="e100"
So I don't know how to fix it. anyone can help?
Please Log in or Create an account to join the conversation.
Time to create page: 0.166 seconds