Ethercat HAL driver

More
17 Apr 2018 14:58 #109195 by sqmathlete
@Automatica27

I've been waiting for a while, hoping that someone with need and a bit of code savvy will turn up in this thread and be able to clean up the attached modified home.c file. The modified home.c file will allow you to home with either absolute or incremental encoders. By setting the the latch velocity = 0.0 and the search velocity = 6.6 or 9.9 (6.6 for absolute encoders) it envokes a special case (look back in the thread for Roschi's hints) where all linuxcnc can do is e-stop during the homing routine. Incremental encoders require a bit of ladder logic to switch into home mode, complete the homing routine, and switch back to CSP mode but, in your case you probably won't need more than a few rungs if any for absolute encoders.

If you look through the file for 6.6 and 9.9 you will see where I have made the changes. I am hoping that these changes could be implemented in such a way that they do not interfere with the regular homing routine of linuxcnc so that other non ethercat configurations can be used. Unfortunately, my coding level is not at a point where I am confident that these changes could be submitted but perhaps with some help we could push this along.

IMHO, one could argue that if the ethercat hal driver is to be fully utilized, a universal option for being able to use the internal homing routine of the servo amp would be of great value.

Kind Regards,
Dan


File Attachment:

File Name: homing.c
File Size:38 KB
Attachments:

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

More
17 Apr 2018 19:26 #109219 by chimeno
Replied by chimeno on topic Ethercat HAL driver Homing
Hello dan
What would be useful to use this homing system?

regards
Chimeno

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

More
17 Apr 2018 21:10 #109223 by sqmathlete
@Chimeno,

Well, my thinking is that the servo amps have all of the things built in to handle acceleration, deceleration, encoder, e stop and of course homing. Thus once we set up the parameters via the xml file we can treat the amps as a black box and let them handle all of the complicated motion stuff which free's up the cpu for other tasks. Linuxcnc homing.c basically duplicates all of the amps internal functions hence the quick short cut through the code is all that is needed.

Also, it is my understanding that in order to reset the counter to zero the amp must be in home mode. You can use linuxcnc to home the servo to the home switch but the amps counter will not be reset to zero unless the amp is in home mode.

Furthermore Roschi, had to modify homing.c to use absolute encoders, I had to modify it to use incremental encoders so it seems like the more that people use the ethercat hal driver and get closer to the point of a working machine this issue will keep coming up.
Why keep having to duplicate? I was hoping that Automatica27 would come to the same conclusion now that he has his amps working. Perhaps not?

However, that being said I'm pretty new to all of this and I could be simply missing something... Is there another solution?

Kind Regards,
Dan

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

More
18 Apr 2018 20:52 #109269 by chimeno
Replied by chimeno on topic Ethercat HAL driver Homing
Hello dan,
I'm not an expert, every day I intend to learn more, it makes sense to handle the acceleration, stops .. etc I think for the position mode is perfect, I used it, but in the speed mode I think much better than Linux, auqnue As I say I'm not an expert and maybe I'm wrong, best regards
Chimeno

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

More
08 May 2018 03:56 - 08 May 2018 03:57 #110365 by Bradn5
Replied by Bradn5 on topic Ethercat HAL driver
Hi all,
wishing to get some feedback on ethercat drives,

New machine being built was meant to use Yaskawa Sigma-7 SGDS Analog drivers but due to stock issues the supplier suggested to use the EtherCat versions of these, rushing around trying to understand these drivers and ethercat systems so the build can continue

Is the development far enough to be able to use LinuxCNC as an ethercat master to directly drive a machine based off these drives? or would there need to be some board in between?
Would it be possible to have a system running to a stage of basic cutting without months of coding/tuning?

It would be great to use these as they have absolute encoders for homing, the next option is downgrading a series to keep analog driven motors+incremental encoders .

Machine is for hobby use for 3D molds where each mold is a one-off

Cheers
Last edit: 08 May 2018 03:57 by Bradn5.

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

More
08 May 2018 21:19 #110401 by chimeno
Replied by chimeno on topic Ethercat HAL driver
hi Bradn5,
I have no experience in the servo Yaskawa Sigma-7 SGDS, but you should not have many problems, you can use the generic method or build your own driver.

regards
Chimeno

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

More
06 Jun 2018 17:28 #111774 by ReneCNC
Replied by ReneCNC on topic Ethercat HAL driver
Hello all,

I have a problem getting the EtherCATdriver to work.

When I try to start Linuxcnc i get this error:

lcec: dlopen: /usr/lib/linuxcnc/modules/lcec.so: undefined symbol: rtapi_mutex_get
./EtherCAT_Test.hal:17: waitpid failed /usr/bin/rtapi_app lcec
./EtherCAT_Test.hal:17: /usr/bin/rtapi_app exited without becoming ready
./EtherCAT_Test.hal:17: insmod for lcec failed, returned -1


Can someone tell me what the Problem is, or this error means?

I´m using the linuxcnc-stretch-uspace-amd64-r10.iso, compiled the Debian package of github.com/sittner/ec-debianize and installed it, compiled github.com/sittner/linuxcnc-ethercat and installed it with make install.
Then I set up a simple test config with this lines in the .hal
loadusr -W lcec_conf ethercat-conf.xml
loadrt lcec
In the ethercat-conf.xml i´ve is only a EK110 Bus Coupler configured.

I´m quite new to Linuxcnc and maybe ist just a stupid mistake.
Would be very great if someone could help me.

Kind Regards,
René

File Attachment:

File Name: error_2018-06-06.txt
File Size:60 KB
Attachments:

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

More
07 Jun 2018 16:20 #111895 by andypugh
Replied by andypugh on topic Ethercat HAL driver
I was wondering if rtapi_mutex_get() was only defined in RTAI, but it appears to appear in uspace too:

github.com/LinuxCNC/linuxcnc/blob/master.../rtapi/rtapi_mutex.h

Were there any warnings during compilation?

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

More
07 Jun 2018 20:19 #111932 by ReneCNC
Replied by ReneCNC on topic Ethercat HAL driver
Hi andypugh,
thanks for your reply.
I don´t remember any warnings.
I will try to compile again and look for warnings.

Do you know more about rtapi_mutex_get, what is this or what does it do?

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

More
07 Jun 2018 20:46 #111937 by andypugh
Replied by andypugh on topic Ethercat HAL driver
It is something to do with giving different modules mutally-exclusive access to code, so that one routine does not change data while another is working on it.

More than that I don't know.
The following user(s) said Thank You: ReneCNC

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

Time to create page: 0.167 seconds
Powered by Kunena Forum