sittner / linuxcnc-ethercat

LinuxCNC EtherCAT HAL driver
GNU General Public License v2.0
200 stars 137 forks source link

Add support for EL30x4, EL3403, EM37xx, EP23xx, and fix naming of EL7041. #86

Closed scottlaird closed 6 months ago

scottlaird commented 4 years ago

This adds support for several additional Beckhoff modules.

Where available, I added additional module product codes to these drivers, so that minor variants should be supported as well.

This also adds additional product codes to the EL1xxx code to support EP1xxx modules with distinct product codes.

In addition, this renames the existing EL7041_1000 driver to simply EL7041. It retains EL7041_1000 as an alias, and adds EP7041 as well.

This EL3403 driver is derived from https://forum.linuxcnc.org/24-hal-components/22346-ethercat-hal-driver?start=740#140914. The others were created by using existing drivers as a template and merging the correct PDOs, etc.

Let me know if you want this split into distinct pull requests or want anything changed.

scottlaird commented 4 years ago

This should close issue #31.

R-CORBETT commented 4 years ago

Scott,

I am over on the opposite side of the USA in the bottom of Georgia, but I have been out to Seattle a few times. I saw you had put Linux on a Beckhoff CX5020. I have four CX5020's that are just a little older that I put LinuxCNC on about 2 years ago. Got all of them working about a year ago except for the encoder terminals. I have a different beckhoff setup for my machine that works, but always wanted the CX5020's in a few machines if possible for space savings. I was stunned when I saw your website with it on there, I figured I was the only idiot to try and get it working, LOL. I have a couple of issues I will get with you about in the future, but what I really wanted to get with you about is the EL7041. I saw you had re-worked the code and wanted to see if you can adjust for the EL7041-0000. I have a few of these models and would like to get them working, and figured you could possibly do something with it. I am not a programmer, but absolutely love the LinuxCNC on Beckhoff using EtherCAT setup. I shot a few videos of my test setup and will have to send you a picture of it.

Thanks, Robert

scottlaird commented 4 years ago

Robert -- IIRC the EL7041-0000 should work as is, but I don't have one to try. The only differences that I'm aware of between the EL7041-0000 and the -1000 are a few extra SDO settings for things like holding current, and it shouldn't matter for the normal use of things.

Have you tried setting up your ethercat.xml file with "EL7041-1000" to see what happens?

R-CORBETT commented 4 years ago

Scott,

Yeah in my XML I tried the following:

EL7041-1000 EL7041-0000 EL7041- EL7041

It seems to take in EtherCAT as in Terminal you can do a "ethercat slaves" and get the list of the slaves, but when you try to start up LinuxCNC it fails and the error screen shows: Invalid Slave: EL7041

Unless I am getting something wrong in LCNC, but I do not believe so as I am quite verse with HAL and can manipulate the INI and HAL files to do what I want most of the time.

I would be willing to ship you one of my terminals if you are interested in working on the code, I would like to get it back and would pay shipping so that there is no cost to you. If you are not interested, I understand as I have been working on this forever and time is money.

Thanks, Robert

Stormholt commented 3 years ago

@scottlaird I have question about the el30x4 and el3202 drivers. Where does the sync_error pdo-entry with subindex (0x0e) come from? i cannot find them in "ethercat cstruct" or the devices xml or when looking at the devices in Twincat.

ThomasEg commented 1 year ago

I stumbled across this since i'm planning on using the EL3054 module in a project. However this pull looks "a bit stale", would it be possible to get it merged? it seems like the conflicts have already been resolved on another PR: https://github.com/scottlaird/linuxcnc-ethercat/pull/1

...any chance these could all be merged together and added to master?

BTW: Awesome work guys :)

satiowadahc commented 1 year ago

@ThomasEg you can always clone and customize it for your needs, I don't make a PR for every driver I write

ThomasEg commented 1 year ago

@ThomasEg you can always clone and customize it for your needs, I don't make a PR for every driver I write

Yes, that is an option, but i think getting the drivers into the original repository is a huge benefit for all users. Like a "standing on the shoulders of giants" kinda thing.... no reason to reinvent the wheel every time...

...but if this isn't getting merged into the repository, then there is no other way and i'll have to make my own clone... just seems a bit foolish IMO...

sittner commented 1 year ago

This is really true. Thank you all for usage and support of this Project over the years. Unfortunately the focus of my work shifted the last years and maintaining this project as it should be is currently not possible for me. My original intention was to add this stuff to the LinuxCNC repro, what never happens due to concerns about licenses. As part of a bigger Project it would be easier to spread the load over more shoulders. Maybe there will be a fork which acts as new development hot spot, but currently I am not aware of such one. So this project remains in it current state. I am not happy with that, too. If there are some ideas to improve that, they are highly welcome.

scottlaird commented 1 year ago

I haven't been putting any effort into LinuxCNC / Ethercat lately, but it's nearing the top of my priority list again. We might want to consider creating a Github project to own a fork, and then getting a few people involved. I can't do much for a couple days, but I should be able to put some effort into getting things organized after that, unless someone else is dying to do the work.

scottlaird commented 1 year ago

@sittner, out of curiosity, what is the licensing issue that you mentioned? A quick glance makes it look like LinuxCNC and this code are both GPL 2. Are there underlying dependencies with issues? Or politics? I haven't contributed anything to LinuxCNC and I'm not very up on their internal culture.

scottlaird commented 1 year ago

It looks like creating new Github organizations is easier than I'd expected. I just created https://github.com/linuxcnc-ethercat, with my and sittner@ as contributors. I will fork his linuxcnc-ethercat project into it for now, and then look at merging, setting up CI/CD, permissions, etc in a day or two.

scottlaird commented 1 year ago

Okay, I've merged this into http://github.com/linuxcnc-ethercat/linuxcnc-ethercat, and it at least manages to build. I haven't had time to actually test it with real hardware yet.

sittner commented 1 year ago

Thank you much for pushing that forward, Scott. The license concerns are related to EtherCAT itself, since the protocol is not open in the sense of open source. However, since the ethercat master is not part of linuxcnc-ethercat, I've never shared these concerns.

R-CORBETT commented 1 year ago

Scott,

I wanted to post my fix to the problem I had a few years back with the EL7041's. I figured it out back then, but never got back on here to post the fix.

Ok all of mine were used from Ebay... so when I got them as with any of the terminals I get, I did a factory reset by: sudo ethercat -p 6 download --type uint32 0x1011 0x01 0x64616F6C (mine was in position 6) It did reset the terminal, but it did not work. I could still see the terminals by doing a "ethercat slaves" so I knew ethercat was seeing them but just not linking up to the driver. Then I tried a factory reset in TwinCAT, but to no avail either.

So, then I simply tried to "re-name" them in TwinCAT. Unbelievably it worked... everyone of them linked right up in LCNC after that. So doing a factory reset by the command line or in TwinCAT will not work sometimes but renaming them did in my case. Just wanted to share that with everyone on here as I had already posted it on the LCNC forum. What a simple fix that completely drove me crazy back then.

I see you are going to take control of the driver from Sascha... I am glad that you and the other contributors are planning to keep this alive. I am very verse with LCNC, but I am not a programmer, so I just tweak what I need to get it working. Otherwise, I would jump on board to help as I don't want this to die either.

I will be watching, and as always, thanks to Sascha, You, and Everyone that contributes to make this happen.

Thanks, Robert