Anyone looking at CS3E-D1008 drivers from Leadshine?

More
02 Dec 2022 21:44 #258372 by ewax
Hello!

I'm in the planning phase of a machine and just saw Marco Reps' video(sounds like I'm not the only one).  I had somewhat of a traditional plan involving a 7i76e but am now looking strongly at ethercat.  The leadshine CS3E-D1008 drives seem reasonably priced but I haven't really heard anything about them outside of the marketing materials.  Is anyone else looking at these or already using them?

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

More
02 Dec 2022 22:46 #258381 by petervg
What are the odds :-). I'm doing exactly that. Have a machine using mesa cards for step/dir and some servo drives, but I'm not happy with the servos. Damencnc in the Netherlands provided a CS3E-D1008 with a CS-M23485 motor and I'm trying to get ethercat to work now so I can test the stepper. Kevin (damencnc) is sure enough I'll like them to promise me a full refund if I don't like them.

Hardware itself seems very well built, but I still need to take a look at motion studio from leadshine. They have a history of providing really crappy softyware but Kevin told me they stepped up their game. Still need to look at that though, but I want to get ethercat working first.

At this time I'm a little stuck however compiling etherlabmaster using ec-debianize. You happen to have experience there? I'll be more than happy to share the experience on my CNC when I get this one working...

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

More
03 Dec 2022 08:20 #258403 by rodw

At this time I'm a little stuck however compiling etherlabmaster using ec-debianize. You happen to have experience there? I'll be more than happy to share the experience on my CNC when I get this one working...

Its all changed. Forget ec-debanize, I wrote up a how to using etherlabmaster's onofficial repos which is stickyed here
forum.linuxcnc.org/ethercat/45336-etherc...-how-to-step-by-step

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

More
03 Dec 2022 10:39 #258411 by petervg
I spent hours reading forum posts last night and I figured out that from kernel 5.10 on, the timeval struct has changed to ktime_t. And this is the root cause on which ec-debianize fails. I tried ec-debianize because I got stuck making and installing the ethercat driver:
- halcompile could not be run as root (using sudo)
- rtapi.h could not be found

I tried solving these issues like this:
1. halcompile could not be run as root (using sudo)sudo nano /etc/sudoers
look for the line
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
and change this to
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/petervg/git/linuxcnc/bin:/home/petervg/git/linuxcnc/src/rtapi
-> This might be something to add to your post?

2. rtapi.h could not be found
in "lcec_main.c" the file "rtapi_app.h" is included, but not located in the linuxcnc-ethercat repository. And because the syntax was #include "rtapi_app.h" and not #include <rtapi_app.main> I assumed the sourcecode from linuxcnc needed to be copied to the same location (cp -r ~/git/linuxcnc/src/* ~/dev/linuxcnc-ethercat/src/). But that didn't work out. Neither adding the linuxcnc source code folder to the path variable, neither changing #include "rtapi_app.h" to #include <rtapi_app.main> helped me to compile the code.
So I went looking on the forum for answers and I came up with ec-debianize until I realised that wasn't possible either due to the kernel changes.)

I'm taking a look at your (very very very helpful) post, and I don't know where I went wrong in the past. I just recloned github.com/sittner/linuxcnc-ethercat.git and could make/install it on the firs try.

Thank you very much for the quick reply! I see you are very active on the forum. Wish I had more time to invest and help this community, but 24h days seem to be too short :-).

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

More
03 Dec 2022 10:44 - 03 Dec 2022 10:45 #258412 by petervg
@rodw, small typo in your post: "halcmd halcmd loadusr -W lcec_conf ethercat-conf.xml" contains 2x the command "halcmd" :-).
Last edit: 03 Dec 2022 10:45 by petervg.
The following user(s) said Thank You: tommylight, rodw

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

More
03 Dec 2022 23:24 #258462 by petervg
@ewax: I got the CS3E-D1008 working up to the point I can see all registers of the drive in linuxcnc using ethercat (see screenshot attached).

But Leadshine motion studio is buggy as hell and some items have not even been translated from chinese. You can't resize any windows to suit the text displayed and connecting to the drive is a hit or miss (but stable once it is connected). It's not an usb connection as you would think, but the drive has an internal usb-serial convertor and the software needs to connect as if it is a serial port.

In the background of motion studio (I have the latest version) it says "Ver 1.3.10 Alpha - for internal user only"...

So far the pc software is really rough but performs the basic tasks of setting up ethercat doable. Not a cheerfull experience, but besides setting the current to 6amps I didn't have to actually change anything so far. Standard settings allow you to use the drive over ethercat. I haven't tried tuning the motors yet, but since thy are closed loop steppers this should be a lot easier than servos.

I have cobbled together a working XML file for the drive, and the next thing is to figure out how to wire it up in the HAL file. I have attached my XML file for the C3SE-D1008 in this post.

One sidenote: I was able to testrun the steppers, and using a 48V powersupply I was able to reach 2000rpm without a load. So for a stepper that's nice, certainly because I'm only using half the allowed voltage on the drive.

 
Attachments:

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

More
04 Dec 2022 08:55 #258487 by rodw
Awesome you got it  going. Did you use my method in the end?
On bullseye (5.10 kernel), I was at a total roadblock.  I could not use Buster as I needed hardware drivers in Bullseye. Grotius kindly made a deb for me that worked but I still had issues getting it all to auto start
So then I started to work with Bookworm that has linuxcnc packaged in it. Combined with their repo, I was in business again so documented it on the forum here. The only issue I have had with that approach is that when you end up with a few kernels, debian can choose the wrong one to install linux-headers into. Thats why I say to use $(uname -r) in the installation and it just seems to work.

the changes to the .mak file were good until just recently so I made that bit optional and hid it under a spoiler.

ec-debainize is well and truly redundant as etherlabmaster migrated to gitlab so the repos used in the old approach are no longer maintained but the debs are built daily. Thats why I prefer their repos.

 

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

More
04 Dec 2022 12:40 #258499 by petervg

Awesome you got it  going. Did you use my method in the end?

Yes, absolutely! Your sticky post at forum.linuxcnc.org/ethercat/45336-etherc...-step-by-step#237098 was exactly how I was able to do it.

On bullseye (5.10 kernel), I was at a total roadblock.  I could not use Buster as I needed hardware drivers in Bullseye. Grotius kindly made a deb for me that worked but I still had issues getting it all to auto start

I did see that post, but I was a little reluctant to use that same .deb as that seemed to be specifiic for your machine. The names of my NIC are also different. That could be a potential blocking issue for me. I wanted to do as much from source as I could, mainly to learn.

The only issue I have had with that approach is that when you end up with a few kernels, debian can choose the wrong one to install linux-headers into. Thats why I say to use $(uname -r) in the installation and it just seems to work

I also always do it that way to install the kernel headers. Keeps me from making dumb mistakes :-)

the changes to the .mak file were good until just recently so I made that bit optional and hid it under a spoiler.

Well, that's where I may have gone wrong. I didn't replace the contents of the .mk file and all compiled without errors (I doublechecked the terminal logs to be sure). But when running linuxcnc, I still got an error "lcec: dlopen: /usr/lib/linuxcnc/modules/lcec.so: undefined symbol: ecrt_slave_config_sdo" (forum.linuxcnc.org/ethercat/47555-lcec-s...ve-config-sdo#258429). This was solved by replacing the content of the .mk file. So this may not be optional?

ec-debainize is well and truly redundant as etherlabmaster migrated to gitlab so the repos used in the old approach are no longer maintained but the debs are built daily. Thats why I prefer their repos.

yeah, that's what makes a little hard to get started. The forum is a really really great help, but it's sometimes a little unclear as to what will still work and what not without knowing the history. I understand this now, but last week wasn't easy to get started.  Anyway... I evolved from a user downloading an ISO to slightly tinker with to compiling everything from scratch. I also tested out bookworm a while ago (but dropped because there where some issues I did'nt know how to get around) and the I even learned what it was like to patch and compile the kernel. Glad I did this as I learned soooo much, but also afraid it's just the tip of the iceberg :-).

 
The following user(s) said Thank You: rodw

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

More
04 Dec 2022 12:54 #258500 by rodw
Great I could help.
A user recently reported that he had to use the default .mk file to get it to compile
I tried again and found the same thing. But I did not have any ethercat hardware to test on.
So its optional for some and mandatory for others!
The following user(s) said Thank You: petervg

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

More
05 Jan 2023 13:24 #260999 by Markgonz
Hey Peter how are you? I am really interested to know your opinion on the leadshine ethercat drives and steppers, I plan to build a small cnc with mesa card and JMC 140w servos but the simplicity of wiring of ethercat systems is really cool, could you share a pic of what your setup looks like wiring wise? If I understand correctly is posible to wire limit switches directly to each axis drive?

Thanks a lot in advance!

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

Time to create page: 0.138 seconds
Powered by Kunena Forum