Ethercat HAL driver

More
14 Jan 2016 16:47 - 14 Jan 2016 16:49 #68392 by narogon
Replied by narogon on topic Ethercat HAL driver
Check the hal ethercat component you have installed, it must contain a file called lcec_el7041_1000.c

In any case you could use the generic component to configure a el7041 in an easy way. Check roschi's tutorial

Tutorial
Last edit: 14 Jan 2016 16:49 by narogon.
The following user(s) said Thank You: Markux

Please Log in or Create an account to join the conversation.

More
15 Jan 2016 07:59 - 15 Jan 2016 14:18 #68433 by cgc
Replied by cgc on topic Ethercat HAL driver
Hi,
first install this repo:

repo.modusoft.de/linuxcnc/wheezy/linuxcnc-ethercat_0.9.0-2_i386.deb

this is version 0.9.0 without the 7041-1000

then download the latest master from github, and type in a terminal "sudo make install"
this is version 0.9.2 with 7041-1000

you need also "linuxcnc-dev"

regards Frank
Last edit: 15 Jan 2016 14:18 by cgc.
The following user(s) said Thank You: Markux

Please Log in or Create an account to join the conversation.

More
21 Jan 2016 09:59 - 21 Jan 2016 16:46 #68870 by Markux
Replied by Markux on topic Ethercat HAL driver
Hi guys, sry for the late reply, reached the computer just today.

Thanks Frank, worked like a charm.
I mean, at least it is recognized now and I can see the pins named lcec.0.7041-1000.XXXXX still haven't tried moving a motor, but should be ok. Yeah, apparently I never had the files for parsing installed.

Also thank you narogon...when I saw Franks reply, didn't want to type the component on my own (if thats what is called, not rly sure what it is...is it a program/function of both a .c and a .h files that you can write by yourself and call it later during the work of LinuxCNC?) so I just followed his advice. But the tutorial is useful if I need to add stuff later.

M
Last edit: 21 Jan 2016 16:46 by Markux.

Please Log in or Create an account to join the conversation.

More
25 Jan 2016 12:17 #69087 by Markux
Replied by Markux on topic Ethercat HAL driver
Hello

Another question about the el7041: is there a way to do the commissioning part (current limit and nominal voltage settings) through LinuxCNC and this driver?

I had a successful test run on a motor but I had to do this part through TwinCAT since I didn't know how to do it through our setup.
I was wondering that maybe someone here does.

I would ideally like to bypass using TwinCAT; quite user friendly but I'd have to switch every time I change the parameters and it poses some limits on the hardware as well (works only with intel chipsets as far as I know).

Please Log in or Create an account to join the conversation.

More
26 Jan 2016 12:13 - 26 Jan 2016 12:14 #69115 by cgc
Last edit: 26 Jan 2016 12:14 by cgc.

Please Log in or Create an account to join the conversation.

More
27 Jan 2016 20:29 #69166 by rogerz6217
Replied by rogerz6217 on topic Ethercat HAL driver
Dear all,
This is my halrun cmd, everthing goes well.
halcmd: loadrt threads name1=master period1=1000000
halcmd: loadusr -W lcec_conf /home/lab428/hiwin.xml
halcmd: loadrt lcec
halcmd: addf lcec.read-all master
halcmd: addf lcec.write-all master
halcmd: start
setp lcec.0.0.drivecontrol-1 1
setp lcec.0.0.drivecontrol-2 1
setp lcec.0.0.drivecontrol-0 1

However, when i use .hal file with linuxcnc, the statusword stuck in 0x650 no matter how i set the controlword.
My .hal file as below.
#load the XML config & the ethercat hal parser.
loadusr -W lcec_conf /home/lab428/hiwin.xml
loadrt lcec

#load the motion component
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES

#add the function we need to the servo-thread
addf lcec.read-all servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf lcec.write-all servo-thread

#set the control word to 6 and the state will be ready to switch on.
setp lcec.0.0.drivecontrol-1 1
setp lcec.0.0.drivecontrol-2 1

#check if the state is in OP mode then enable emc and go to switched on state.
net ready_to_switch lcec.state-op => iocontrol.0.emc-enable-in => lcec.0.0.drivecontrol-0

The change of statusword as below.


Thanks for help.
Attachments:

Please Log in or Create an account to join the conversation.

More
28 Jan 2016 02:47 #69185 by Doyle
Replied by Doyle on topic Ethercat HAL driver
Hi all,
First many thanks to Sascha and Andreas for such a great job and clear instructions on how to get things working. I am a complete beginner on this but learning fast to develop a fully open-source plotting method for making yacht sails.

I have Indra drives and motors on the way and a while back decided to get the EK1818 as being the most cost-effective for my needs. When it turned up I suddenly realised that it is not currently supported under the EtherCat driver (dohh!). I have followed the instructions as far as I can without drivers and motors and can see it sitting there as an "ethercat slaves" device.

I understand that it is essentially a EK1100 with 8 digital inputs (like a EL1018) and 4 digital ouputs (cf. EL2004).
Has anybody got any tips on what I need to modify to get this working with the EtherCat driver? Or can I just "call" it an EK1100 in the xml? I haven't scratched it (yet) so I'm guessing they would exchange it for individual EK1100, EL1018, etc. but that will much more expensive.

I know this is a steep learning curve for me but really appreciate the support of the community!

Thanks,
David

Please Log in or Create an account to join the conversation.

More
28 Jan 2016 12:05 - 28 Jan 2016 12:06 #69189 by sirop
Replied by sirop on topic Ethercat HAL driver

Hello

Another question about the el7041: is there a way to do the commissioning part (current limit and nominal voltage settings) through LinuxCNC and this driver?

I had a successful test run on a motor but I had to do this part through TwinCAT since I didn't know how to do it through our setup.
I was wondering that maybe someone here does.

I would ideally like to bypass using TwinCAT; quite user friendly but I'd have to switch every time I change the parameters and it poses some limits on the hardware as well (works only with intel chipsets as far as I know).


If your slave understands SDO commands ( and PDO ampping), then you can use a shell script with Etherlab SDO commands
like:
www.iram.fr/~blanchet/ethercat/akd/examples/akd_free_pdo.sh -- example for Kollmorgen CoE slave

github.com/sirop/EtherCAT_HAL/blob/master/setPDO.sh -- example fro Copley CoE slave
Last edit: 28 Jan 2016 12:06 by sirop. Reason: typo
The following user(s) said Thank You: Nico2017

Please Log in or Create an account to join the conversation.

More
28 Jan 2016 12:16 #69190 by narogon
Replied by narogon on topic 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.

Please Log in or Create an account to join the conversation.

More
28 Jan 2016 12:30 #69191 by sirop
Replied by sirop on topic Ethercat HAL driver

Dear all,
However, when i use .hal file with linuxcnc, the statusword stuck in 0x650 no matter how i set the controlword.
My .hal file as below.
#load the XML config & the ethercat hal parser.
loadusr -W lcec_conf /home/lab428/hiwin.xml
loadrt lcec

#load the motion component
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES

#add the function we need to the servo-thread
addf lcec.read-all servo-thread


#check if the state is in OP mode then enable emc and go to switched on state.
net ready_to_switch lcec.state-op => iocontrol.0.emc-enable-in => lcec.0.0.drivecontrol-0

Thanks for help.


I did not follow your previous comments and I do not know your slave.

So my quick guess: if it is not about improper slave configuration, then it can be a timing issue.
Suppose, your control word is always set (one cycle ?) too late?

To gain more control about this try
either
wiki.linuxcnc.org/cgi-bin/wiki.pl?Etherlab (LinuxCNC, RTAI)
or
github.com/sirop/EtherCAT_HAL/blob/master/pdortapi2dc.comp (Machinekit, Xenomai/RT-Preempt ) .

Please Log in or Create an account to join the conversation.

Time to create page: 0.222 seconds
Powered by Kunena Forum