GuiHue / grootec

0 stars 0 forks source link

CSP vs CSV #1

Open zmrdko opened 1 week ago

zmrdko commented 1 week ago

Hi, I went through your config. I see you are using position mode for servos. I use the same, but I get crazy following error and I see you set FERROR to 10 as well. Guys at linuxcnc recommend using velocity mode + PID. I am just not sure, how to implement it with deasda component, where we dont have commanded position, only commanded velocity (in velocity mode). However I did the same on B3L drives with mesa step/dir card and it was way better with velocity mode (f-error almost 0, peaks at 0.006mm on acceleration start)

GuiHue commented 1 week ago

That part in the config isn’t done yet. Deasda has csp and it works fine once correctly setup. I’ll get to that this weekend. Current version is broken.

GuiHue commented 4 days ago

@zmrdko I uploaded my current test setup. All axis work well in CSP mode. Haven't tuned the servo drives themselves yet. No joint following errors for the time being. I have my doubts with CSV and a PID, since I do not believe that a PID in Linuxcnc based on delayed encoder information is going to be more accurate than the position loop directly in the drive. This changes if you use linear scales for feedback though. The later is my goal (its already in place), but first I need the machine to run at all.

Do note the comments in the ini file regarding egear. For Joint4 this is not correct yet.

zmrdko commented 4 days ago

I’m confused now, since you used PID component anyway. You dont really need it when using position mode, because you directly tell the drive the target position. PID is used only with velocity mode, when you want to tell how “aggressive” you want to reach the position via velocity commands.

GuiHue commented 4 days ago

I know. The config is WIP and I have chosen to use keep the PID in the config, since I'll be using them eventually. It's not like those will do any damage. They are not part of the loop.

To be clear: This is not a fully operational config yet.

zmrdko commented 4 days ago

Alright, that’s is the point. From my experience, you want to have perfectly tuned servo drive (using ASDASoft), so that you have basically zero following error between drive and motor. Then you move to linuxcnc. The position mode should be OK without any further effort, but you will have fairly big following error, which will be proportional to current speed (up to 1mm). To be honest, I dont know how linuxcnc does the calculation, but this is what I experienced. Zero following error in ASDASoft and position mode in linuxcnc was something like 0.2-0.8mm following error. However using velocity mode with pid, you should be able to tune following error in linuxcnc to almost zero with peaks in accelerations in 0.00x mm range. Note that both modes uses feedback from motor encoder.

zmrdko commented 4 days ago

Also starting a thread on this topic on forum.linuxcnc.org wouldn’t do any harm. We might get an exact explanation. I just remember that using velocity mode with encoder feedback is recommended on mesa card, since the stepping can get out of synchronization with linuxcnc, so you might get unrecognized inaccuracy. But there is no stepping in position mode in ethercat drives.

zmrdko commented 4 days ago

https://forum.linuxcnc.org/ethercat/53049-position-vs-velocity-mode