EtherCat Sync & DC problem

More
15 Mar 2018 14:54 #107375 by Automata27
Hi,

I am using Ethercat hal driver with lcec & lcec_conf...i am facing synch & DC(distributed clock ) issue...i am using panasonic A6 drives & motor...i am running lcec in csp mode...

i have attached ecat_conf.xml file for ref. and output waveform of pos-cmd(motor-pos-cmd), pos-fb(lcec.0.0.pos-fb), internal cmd velocity and velocity- feedback(lcec.0.0.actvel) ethercat bus. you can see in the waveform that on feedback velocity graphs there is spikes at certain fixed interval (approx 2.3 sec).

anyone have any idea about this??
it would be great if anyone can help me with this.

FYI...
i am using following systems:-
- linux kernel :- 3.4-9-rtai-686-pae #1 SMP PREEMPT Debian 3.4.55-4linuxcnc i686 GNU/Linux (debian wheezy)
- network card :- realtek r8169

File Attachment:

File Name: ecat_conf_...3-15.xml
File Size:5 KB


Thanks in advance.
Regards.
Attachments:

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

More
16 Mar 2018 08:34 #107415 by sirop
Replied by sirop on topic EtherCat Sync & DC problem
Hi.

Why do you suspect it to be Sync & DC problem?

If you run your slaves in csp (Cyclic Synchronous Position),
you send increments of position and - I guess - wait until the target position is reached.
The each time your velocity would increase up to a certain value and then decrease.

Check the manual of your drive for Trapezoidal and S-curve Motion Profiles.

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

More
17 Mar 2018 07:59 #107460 by Automata27
Hi sirop,

thanks for reply...
i have checked in servo drive's s-curve profile parameter and have tried setting position command smoothening parameter also...in this case amplitude of spike gets reduced but still that spike comes at regular interval...setting this parameter will increase ferror...secondly i am not using motion profiles from drive, i am using linuxcnc motion profiler...

i am suspecting dc problem because it is coming at regular interval...it might be some issue with xml configuration like appTimePeriod or refClockSyncCycles or synch0shift etc., it will be helpful if you can check and let me know if it is correct or not...

Regards.

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

More
17 Mar 2018 08:33 #107461 by sirop
Replied by sirop on topic EtherCat Sync & DC problem
I can not really test it as I do no have your setup here.

synch0shift: try to play with it similar to github.com/sittner/linuxcnc-ethercat/blo...thercat-conf.xml#L10 .

The Sync0shift values should be the same for all slaves (with the same time base), so that they all apply their PDO data at the same shift time from the start of the period. This allows you to send the PDO information any time between the start of the period and the sync time without the slave missing the information. The distributed clock framework makes sure all the slaves clocks are in sync so that the sync0 time occurs at the same time on all the slaves.

I have a period of 1000us, so I use a shift time of 500us. So I can use up to half of by period to receive, calc and send new PDOs. Note: the send time includes the time the frame is on the wire.


Graeme.

lists.etherlab.org/pipermail/etherlab-users/2018/003287.html

refClockSyncCycles: this value defines how often the network is re-sync'ed. Try somehting like 4 or 5 insted of the present 1000 .

If you used RT PREEMPT, you could try out: github.com/sittner/linuxcnc-ethercat/iss...suecomment-371244865
The following user(s) said Thank You: pamxy

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

More
18 Mar 2018 11:59 - 18 Mar 2018 12:05 #107487 by chimeno
Replied by chimeno on topic EtherCat Sync & DC problem
hello Automata,
I do not understand your question very well but seen in the .xml file a couple of things, I would change the refClockSyncCycles = "* 1" and sync0Cycle = "configured cycle time"

sync0Cycle = "250000"
sync0Shift = "125000"

depending on how you have configured the servo, which DC mode do you use?
DC (Synch.),
SM2 (Synch.),
FreeRun (Non-synch.)
What cycle time do you use?
125μs, 250μs, 500μs, 1ms, 2ms, 4ms
 when I had synchronization problems, that is, only problem is reading the frame so that the servo cycle time corresponded with the LCEC, place a buffer.
// ax5xxx raw position counter 2

pos_count_2 = EC_READ_S32 (& pd [hal_data-> ax5xxx_fd2]);

if (pos_count_2! = 0) {// SYNC
if (* (hal_data-> pos_fb_2)> (double) 0x7fffffff) {
* (hal_data-> pos_fb_2) = (double) 0x7fffffff;
}
if (* (hal_data-> pos_fb_2)> (double) -0x7fffffff) {
* (hal_data-> pos_fb_2) = (double) -0x7fffffff;
}
* (hal_data-> pos_fb_2) = (double) pos_count_2 / (AX5XXX_POSITION_SCALE * hal_data-> pos_scale);
}

sync0Shift = "half cycle"



I hope I can help you.
regards
Chineno
Last edit: 18 Mar 2018 12:05 by chimeno. Reason: Edit

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

More
20 Mar 2018 12:24 #107596 by Automata27
as per your suggestion following settings i have changed...

refClockSyncCycles = "* 1" and sync0Cycle = "configured cycle time"
sync0Cycle = "1000000"
sync0Shift = "0"

attached is the waveform that i got now...still dc issue is there...

i am configured drive DC synch mode...
cycle time that i use is 1ms....

as per your suggestion if i set sycn0shift = "half cycle " then also same issue...no change...
Attachments:

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

More
20 Mar 2018 12:32 #107597 by Automata27
Hi Sirop,

i have tried sycn0shoft value as per link send by you...but no change in result...

Also i have tried compiling with "3.4-9-rtai-686-pae" code from link below...but its gives warning of "UNKOWN SYNBOL __moddi3"...i have tried resolving this issue but no luck on that side... any one have any idea about this error??

github.com/sittner/linuxcnc-ethercat/tree/fix-dc-sync

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

More
20 Mar 2018 13:26 #107602 by Todd Zuercher
Are you trying to run Linuxcnc within a virtual machine?
You should know that real time kernels don't work in VMs. Latencies will be all over the place and unusable. They have to run on bare hardware in order to get usable latency. A VM is fine for some testing and development, but anything timing dependent can't be expected to work.

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

More
20 Mar 2018 13:41 #107605 by sirop
Replied by sirop on topic EtherCat Sync & DC problem

Hi Sirop,
Also i have tried compiling with "3.4-9-rtai-686-pae" code from link below...but its gives warning of "UNKOWN SYNBOL __moddi3"...i have tried resolving this issue but no luck on that side... any one have any idea about this error??

github.com/sittner/linuxcnc-ethercat/tree/fix-dc-sync


This new feature would only work with RT_PRREMPT, see github.com/sittner/linuxcnc-ethercat/iss...suecomment-371898365

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

More
20 Mar 2018 13:43 #107606 by Automata27
Hi Todd Zuercher,

no i am not running linuxcnc in VM...i am running in mother board with atom quad core processor and 4gb ram...

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

Time to create page: 0.256 seconds
Powered by Kunena Forum