Problems with Lichuan Ethercat servo drive
12 Sep 2024 16:52 #310014
by bertoldo
Replied by bertoldo on topic Problems with Lichuan Ethercat servo drive
Hi friend... I'm glad someone pointed me to your post!
My case is exactly the same. I've been trying for 5 months and I'm about to give up on ethercat.
I'm at the same point as you were, I can identify the servo on the network but I can't read or write without it saying that it stays in PREOP and doesn't go away.
I saw that you shared it but I'm a beginner, how should I use these files you sent? Could you please detail if I should replace everything or what to do?
My case is exactly the same. I've been trying for 5 months and I'm about to give up on ethercat.
I'm at the same point as you were, I can identify the servo on the network but I can't read or write without it saying that it stays in PREOP and doesn't go away.
I saw that you shared it but I'm a beginner, how should I use these files you sent? Could you please detail if I should replace everything or what to do?
Please Log in or Create an account to join the conversation.
13 Sep 2024 03:00 - 13 Sep 2024 03:19 #310040
by bertoldo
Replied by bertoldo on topic Problems with Lichuan Ethercat servo drive
Hello trisa25! I've been struggling for months without success!
Thanks for sharing with us!
I arrived at the forum and saw that you managed to do it and I think it's incredible! Well, where should I put these files in the linuxcnc-cia402 folder? What would be the path and should I copy the folder or just the files?
I faithfully followed what the forum asked. I'm on a clean copy and I didn't open LinuxCNC at any time, no configuration, nothing! In fact, my doubt is because I'm going to make a Scara robot and there's a ready template there... whether this configuration you made will work or not.
Thanks for sharing with us!
I arrived at the forum and saw that you managed to do it and I think it's incredible! Well, where should I put these files in the linuxcnc-cia402 folder? What would be the path and should I copy the folder or just the files?
I faithfully followed what the forum asked. I'm on a clean copy and I didn't open LinuxCNC at any time, no configuration, nothing! In fact, my doubt is because I'm going to make a Scara robot and there's a ready template there... whether this configuration you made will work or not.
Last edit: 13 Sep 2024 03:19 by bertoldo.
Please Log in or Create an account to join the conversation.
13 Sep 2024 13:22 #310075
by bertoldo
Replied by bertoldo on topic Problems with Lichuan Ethercat servo drive
Hello!
I'm struggling here... in my case there is no such folder as config...
I'm going to make a Scara arm so I don't know if it can have several configurations or just 1... because I haven't run my servo on Ethercat yet and I want to continue to get it either way. Then I'll go where I need to go.
Question 1: Is this config folder generated after I open Linux CNC? I don't want to do that because I'm once again faithfully following the tutorial that's on the forum. Hehehehe
Question 2: If I make it for a 3-axis CNC router, can I make a configuration for Scara and will the Ethercat issue be the same?
I'm struggling here... in my case there is no such folder as config...
I'm going to make a Scara arm so I don't know if it can have several configurations or just 1... because I haven't run my servo on Ethercat yet and I want to continue to get it either way. Then I'll go where I need to go.
Question 1: Is this config folder generated after I open Linux CNC? I don't want to do that because I'm once again faithfully following the tutorial that's on the forum. Hehehehe
Question 2: If I make it for a 3-axis CNC router, can I make a configuration for Scara and will the Ethercat issue be the same?
Please Log in or Create an account to join the conversation.
13 Sep 2024 14:33 #310086
by bertoldo
Replied by bertoldo on topic Problems with Lichuan Ethercat servo drive
I feel like crying... the engine worked! Thank you very much now let's go to phase 2 hehehehe
Please Log in or Create an account to join the conversation.
13 Sep 2024 15:02 #310089
by bertoldo
Replied by bertoldo on topic Problems with Lichuan Ethercat servo drive
hello trisa25.
I managed to make it work with your files but I actually need to make a scara... and there is a ready-made cinematic there. Can you help me?
I managed to make it work with your files but I actually need to make a scara... and there is a ready-made cinematic there. Can you help me?
Please Log in or Create an account to join the conversation.
14 Sep 2024 14:35 - 14 Sep 2024 16:19 #310145
by Sandro
Replied by Sandro on topic Problems with Lichuan Ethercat servo drive
This is my full configuration. Please note this is for a hobby machine and I cannot take responsibility for any present or not present safety features. Use at your own risk.
Slave 0 is the Cat IO board which can be found on Aliexpress.
Slave 1 is a DVS 1.8 kW servo motor with 23 bit absolute encoder, which I am using as spindle. I have set the encoder to 17 bit incremental at the moment. The same XML configuration as for the Lichuan servos works for this one as well.
Slaves 2-4 are the Lichuan servos for my three axes.
I was having issues using the Lichuans in csp mode, due to quite a substantial following error. For this reason I have set them to csv mode. This way I was able to do some PID tuning and clamping down the error to a few microns. I was also playing arround with the parameters on the servo drives directly to improve on the following error further. Most parameters did not do a lot in my case. However, P08.15 "Load inertia ratio" helped a lot. For the axes X and Y I have currently set it to about 12 and for Z-axis to about 7.
Slave 0 is the Cat IO board which can be found on Aliexpress.
Slave 1 is a DVS 1.8 kW servo motor with 23 bit absolute encoder, which I am using as spindle. I have set the encoder to 17 bit incremental at the moment. The same XML configuration as for the Lichuan servos works for this one as well.
Slaves 2-4 are the Lichuan servos for my three axes.
I was having issues using the Lichuans in csp mode, due to quite a substantial following error. For this reason I have set them to csv mode. This way I was able to do some PID tuning and clamping down the error to a few microns. I was also playing arround with the parameters on the servo drives directly to improve on the following error further. Most parameters did not do a lot in my case. However, P08.15 "Load inertia ratio" helped a lot. For the axes X and Y I have currently set it to about 12 and for Z-axis to about 7.
Last edit: 14 Sep 2024 16:19 by Sandro.
Please Log in or Create an account to join the conversation.
- ihavenofish
- Offline
- Platinum Member
Less
More
- Posts: 686
- Thank you received: 124
14 Sep 2024 18:52 #310161
by ihavenofish
Replied by ihavenofish on topic Problems with Lichuan Ethercat servo drive
videos!
I wanna see this actually moving a machine. Interesting about the CSV/CSP, but I think it makes sense in relation to what someone else said in another thread, that you are getting the reported position one frame late, so it always appears to lag, even though it "isn't".
But also cool that you seem to have linux tuning the motion so tight in velocity mode. More options is better. Am I right that in velocity mode you can increase the cycle clock? (1khz to 2 or 4, I forget, maybe that was only on delta).
I wanna see this actually moving a machine. Interesting about the CSV/CSP, but I think it makes sense in relation to what someone else said in another thread, that you are getting the reported position one frame late, so it always appears to lag, even though it "isn't".
But also cool that you seem to have linux tuning the motion so tight in velocity mode. More options is better. Am I right that in velocity mode you can increase the cycle clock? (1khz to 2 or 4, I forget, maybe that was only on delta).
Please Log in or Create an account to join the conversation.
14 Sep 2024 22:43 #310172
by hmnijp
i looked at your config and saw some errors: addf for all functions must be configured in the correct
сomponent execution order.(read, calculation functions, write). but in your config addf pid functions are executed after new data is already sent to ethercat (addf write...) thus you create a delay of several servo cycles...
the same applies to the rest of the addf. (motion, estope.. etc)
Replied by hmnijp on topic Problems with Lichuan Ethercat servo drive
This is my full configuration. Please note this is for a hobby machine and I cannot take responsibility for any present or not present safety features. Use at your own risk.
Slave 0 is the Cat IO board which can be found on Aliexpress.
Slave 1 is a DVS 1.8 kW servo motor with 23 bit absolute encoder, which I am using as spindle. I have set the encoder to 17 bit incremental at the moment. The same XML configuration as for the Lichuan servos works for this one as well.
Slaves 2-4 are the Lichuan servos for my three axes.
I was having issues using the Lichuans in csp mode, due to quite a substantial following error. For this reason I have set them to csv mode. This way I was able to do some PID tuning and clamping down the error to a few microns. I was also playing arround with the parameters on the servo drives directly to improve on the following error further. Most parameters did not do a lot in my case. However, P08.15 "Load inertia ratio" helped a lot. For the axes X and Y I have currently set it to about 12 and for Z-axis to about 7.
i looked at your config and saw some errors: addf for all functions must be configured in the correct
сomponent execution order.(read, calculation functions, write). but in your config addf pid functions are executed after new data is already sent to ethercat (addf write...) thus you create a delay of several servo cycles...
the same applies to the rest of the addf. (motion, estope.. etc)
addf lcec.read-all servo-thread
addf cia402.0.read-all servo-thread
....
addf motion-command-handler servo-thread
addf motion-controller servo-thread
....
addf pid.x.do-pid-calcs servo-thread
....
addf cia402.0.write-all servo-thread
addf lcec.write-all servo-thread
The following user(s) said Thank You: Sandro
Please Log in or Create an account to join the conversation.
15 Sep 2024 08:02 - 15 Sep 2024 08:02 #310183
by Sandro
Replied by Sandro on topic Problems with Lichuan Ethercat servo drive
Hi hmnijp
Thank you very much for pointing it out. I was completely unaware.
Maybe one more thing worth of note: I have hooked the opmode-display into the e-stop logic. This way I am only able to enable the machine, once the servos are ready. The Lichuans need about 5 seconds to sync their current position back to LCNC at startup. When you were to enable the machine within this timeframe, you get a joint following error once the sync occurs. Because the machine is now in e-stop, I cannot enable it prematurely. Maybe not the most elegant way, but it does the job.
A few things left to do is to set a "homed" flag for the axes when enabling the machine, so I don't need to do the button press manually. If someone has an idea how to correctly set this up, any help is much appreciated.
Besides that, I'd like to enable spindle orient. Here I am missing an index pulse to reset the encoder count, when orient is being enabled.
Thank you very much for pointing it out. I was completely unaware.
Maybe one more thing worth of note: I have hooked the opmode-display into the e-stop logic. This way I am only able to enable the machine, once the servos are ready. The Lichuans need about 5 seconds to sync their current position back to LCNC at startup. When you were to enable the machine within this timeframe, you get a joint following error once the sync occurs. Because the machine is now in e-stop, I cannot enable it prematurely. Maybe not the most elegant way, but it does the job.
A few things left to do is to set a "homed" flag for the axes when enabling the machine, so I don't need to do the button press manually. If someone has an idea how to correctly set this up, any help is much appreciated.
Besides that, I'd like to enable spindle orient. Here I am missing an index pulse to reset the encoder count, when orient is being enabled.
Last edit: 15 Sep 2024 08:02 by Sandro.
Please Log in or Create an account to join the conversation.
15 Sep 2024 11:07 #310190
by hmnijp
you can do it like this
Replied by hmnijp on topic Problems with Lichuan Ethercat servo drive
A few things left to do is to set a "homed" flag for the axes when enabling the machine, so I don't need to do the button press manually. If someone has an idea how to correctly set this up, any help is much appreciated.
you can do it like this
loadrt flipflop names=flip-is-on
addf flip-is-on servo-thread
net is-on halui.machine.is-on => flip-is-on.set
net is-on-reset motion.is-all-homed => flip-is-on.reset
net go-home flip-is-on.out => halui.home-all
Please Log in or Create an account to join the conversation.
Time to create page: 0.206 seconds