Ethercat HAL driver

More
12 May 2021 01:03 #208610 by Nico2017
Replied by Nico2017 on topic Ethercat HAL driver
Hi all,

well apparently rewriting the .xml esi file for TwinCAT by putting the required parameters for Velocity command did the trick. So far, only the original file in pos command had been used and had been working so far to initialize the EtherCAT ability of the IndraDrives.

But apparently for this one, it required the vel command version of this drive to get the EtherCAT ability and get the drive moving from linuxcnc. Not sure exactly how and why but happy to discuss if some people have been facing the same issue.

Thank you,

Nicolas
The following user(s) said Thank You: Grotius

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

More
18 May 2021 06:53 #209306 by besriworld
Replied by besriworld on topic Ethercat HAL driver
Hello ,
i installed linuxc and EtherCAT and i can connect to the servo driver.
I'm trying to control the servo motor from the terminal, but I have a problem. The driver responds to these commands:

ethercat slaves

ethercat download -t int8 0x6060 0 3
ethercat upload -t int8 0x6061 0

I can change operation mode from terminal . but when I try to get information about the position of the axis I get 0x000000000 0

I think the problem comes from here:
The PDO is distributed in the CoE communication protocol area. In the EtherCAT system, the
master-to-slave data is transmitted using RxPDO (0X1600). The data length is 14 bytes and the
sub-index is 0x00~0x0D. The slave-to-master data is transmitted using TxPDO (0X1A00) and the
data length is 14 bytes.

How can I send / receive a larger data length (type). Now I can only upload/download commands type int8

Thansk!

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

More
18 May 2021 18:25 #209375 by db1981
Replied by db1981 on topic Ethercat HAL driver
Hello,

you can't access pdo communication from terminal.
Ethercat download/upload is sdo communication, which is not realtime.

For getting access to your pdos you would have to setup an read/write function in an realtime task.
In an linuxcnc environment you can do this with the linuxcnc-ethercat hal driver.
Using lcec_conf with an ethercat_config xml file created by you for your application, sets up this communication in your ethercat master and maps your pdos to linuxcnc hal pins.

the realtime part lcec read and write then reads and writes the pdos to/from your halpins.

read through this thread how to create an ethercat config xml file, also take a look at the example folder in linuxcnc-ethercat and the linuxcnc wiki.
The following user(s) said Thank You: besriworld

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

More
21 May 2021 07:25 #209735 by besriworld
Replied by besriworld on topic Ethercat HAL driver
Thanks ,
I tried to deal with the problem myself, but I can't handle it. I attach the configuration files. I'm trying to make one driver work with LinuxCNC. There can be a lot of nonsense inside. I'm just new to the world of Linux / LinuxCNC

File Attachment:

File Name: ethercat_c...5-21.hal
File Size:1 KB

File Attachment:

File Name: ethercat_c...5-21.xml
File Size:1 KB

File Attachment:

File Name: ethercat_c...5-21.ini
File Size:1 KB

File Attachment:

File Name: linuxcnc.r...5-21.txt
File Size:5 KB

File Attachment:

File Name: dmesg_2021-05-21.txt
File Size:52 KB

File Attachment:

File Name: 6_ADTECH_X...21-2.xml
File Size:193 KB

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

More
21 May 2021 07:40 #209737 by db1981
Replied by db1981 on topic Ethercat HAL driver
Hello,

i am not completly shure whats wrong, how die you linuxcnc 2.9.(master) install? deb package ?

-first change the haltypes "special32" to "float" in your ethercat conf.xml . There exists no haltype "special32", haltypes are "bit,s32,u32,float,float-unsigned,complex" ...

if this not works, remove in your halfile the path before lcec_conf , if you have installed linuxcnc-ethercat correctly this is not neccesary.

post dmesg and linuxcnc output again....
The following user(s) said Thank You: besriworld

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

More
21 May 2021 19:24 #209783 by besriworld
Replied by besriworld on topic Ethercat HAL driver
Nothing changes

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

More
21 May 2021 20:10 #209795 by db1981
Replied by db1981 on topic Ethercat HAL driver
hmmm,

please go to your linuxcnc-ethercat folder, do an make clean and then
make install again.
are there any errors at compiling?

this is a little bit strange in dmesg :
[ 352.618901] lcec_conf[1094]: segfault at 5 ip 00007fd2b0e32fca sp 00007ffd37755b28 error 4 in libc-2.28.so[7fd2b0d1e000+148000]
The following user(s) said Thank You: besriworld

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

More
21 May 2021 22:01 - 22 May 2021 07:14 #209806 by besriworld
Replied by besriworld on topic Ethercat HAL driver
thanks for the help . I'm uploading new files. I did a new installation linuxcnc ethercat
There is no change.
I start LinuxCNC from the icon


PS: I make a new installation of LinuxCNC from this link Debian witch Ethercat
But I have new error again. :(

Debug file information:
Note: Using POSIX realtime
/usr/share/linuxcnc/hallib/core_sim.hal:29: Pin 'joint.1.motor-pos-cmd' does not exist
3330
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime

File Attachment:

File Name: dmesg_2021...22-2.txt
File Size:1 KB

File Attachment:

File Name: ethercat-c...5-22.xml
File Size:1 KB

File Attachment:

File Name: qtvcp_post...5-22.hal
File Size:1 KB

File Attachment:

File Name: linuxcnc.r...22-2.txt
File Size:5 KB

File Attachment:

File Name: qtaxis_2021-05-22.ini
File Size:7 KB
Last edit: 22 May 2021 07:14 by besriworld.

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

More
22 May 2021 07:35 - 22 May 2021 07:41 #209824 by Grotius
Replied by Grotius on topic Ethercat HAL driver
/usr/share/linuxcnc/hallib/core_sim.hal:29: Pin 'joint.1.motor-pos-cmd' does not exist
3330


This is a hal message. It says the stepgenerator position command pin does not exist. I expect you edited hal files.

If you start the linuxcnc axis build in example from the linuxcnc config picker, check if this works.

Then for ethercat you should start with something very minimal in hal. Like only adding the lcec to the servo threat.
Step by step you gonna build it up. Attached a hal files that you can strip down and then try ant load it.

These lines should be your starting point for succes :
loadrt threads name1=base-thread fp1=0 period1=15000 name2=servo-thread period2=1000000
loadusr -W copy_filepath_here_that_points_to/lcec_conf  copy_filepath_here_that_points_to/ethercat-conf.xml
loadrt lcec
net ec-slaves-responding <= lcec.slaves-responding
net ec-link-up <= lcec.link-up
net ec-all-op <= lcec.all-op

addf lcec.read-all base-thread
addf lcec.write-all base-thread

And edit the attached xml file to your needs.
Attachments:
Last edit: 22 May 2021 07:41 by Grotius.

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

More
22 May 2021 12:46 #209834 by db1981
Replied by db1981 on topic Ethercat HAL driver
Hi,

remove the calls to the unneccesary hal files in the ini file HAL Section .
core _sim.hal should not be loaded.

and load your halfile with the ethercat lines as normal hal. not as postgui hal file.

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

Time to create page: 0.153 seconds
Powered by Kunena Forum