CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Sun Dec 16, 2018 5:51 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Thu Dec 15, 2016 6:42 pm 
Offline

Joined: Mon Oct 31, 2016 5:49 pm
Posts: 28
Hi,
I use a BBB with a RT kernel to control a servomotor through Ethercat.
I use the SMC_FollowPosition block since new position values arrive in real-time each Ts milliseconds. (Ts can be 100ms or 1sec).
I tried with MoveAbsolute and MoveRelative blocks as well with the same result.

Unfortunately i always get this error and the motor stops spinning.
I called the technical support of the driver's company and they told me to increase the sync offset up to 50% but i have the same error.

How could i solve the problem?

Thanks in advance.


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Fri Dec 16, 2016 7:20 am 
Offline

Joined: Fri Feb 05, 2016 11:25 am
Posts: 1
The first thing that comes to my mind is to remove the etherCAT task from the visu task where it is duplicated...


Top
   
PostPosted: Fri Dec 16, 2016 11:31 am 
Offline

Joined: Mon Oct 31, 2016 5:49 pm
Posts: 28
Hi,

Thanks, that was just an oversight during some tests. In fact the error is still present despite the fact i removed the ethercat task from the visu task.

What could be the problem ??

Thanks.


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Fri Dec 16, 2016 1:02 pm 
Offline
Frequent User
Frequent User

Joined: Fri Sep 02, 2011 8:02 pm
Posts: 291
Check your task execution time - average and max values. Your task cycle time could be too fast. I had a job where I used a 2ms Etherxat task time. Most of the time the task time executed in just under 2 ms. But occasionally it executes in 2.1 ms. Lost sync

_________________
Scott Cunningham
KEB America, Inc.
www.kebblog.com
www.kebamerica.com


Top
   
PostPosted: Fri Dec 16, 2016 2:09 pm 
Offline

Joined: Mon Oct 31, 2016 5:49 pm
Posts: 28
Hi, Thanks for you fast reply.

Here are some results:

with a Ethercat task of 4ms and 25% sync offset i get this: Max Cycle Time : 1830 microsec but an unreasonable Jitter Max: 6029 microsec e Min: -3531 microsec as you can see in the second picture.

Then with an Ethercat task of 8ms and 50% sync offset i get: Max Cycle Time : 1732 microsec but an unreasonable Jitter Max: 6675 microsec e Min: -6685 microsec as you can see in the first picture.

This Jitter values are likely to be the problem !!!! I've never seen Jitters so high. What can be the problem? I used 2 BBB with the same results.

I use this kernel:
Quote:
Linux beaglebone 4.4.14-bone-rt-r11 #1 PREEMPT RT Fri Jul 1 01:43:25 UTC 2016 armv7l GNU/Linux


I tried with the OS installed on SD as well on the eMMC.

EDIT: I also tried with a raspberry Pi 2 Model B

Please help.

Thank you


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Fri Dec 16, 2016 11:03 pm 
Offline

Joined: Mon Oct 31, 2016 5:49 pm
Posts: 28
Hi,
I solved my own problem. I set ethercat task back to 4ms with 30% sync offset. Then i set the priority of the Visu task to 31 whilst the ethercat task priority was set to 0. Now the jitter is between +- 150 microsec and the lost sync error is gone.

Thank you for pointing me to the right direction.


Top
   
PostPosted: Fri Dec 16, 2016 11:42 pm 
Offline
Frequent User
Frequent User

Joined: Fri Sep 02, 2011 8:02 pm
Posts: 291
Great to hear. Sorry I forgot to mention the task priority!!!

_________________
Scott Cunningham
KEB America, Inc.
www.kebblog.com
www.kebamerica.com


Top
   
PostPosted: Sun Dec 02, 2018 5:09 pm 
Offline

Joined: Sun Dec 02, 2018 7:19 am
Posts: 5
Dear sir:
I have the same question with you. I also use a codesys with 2 hours and now when I set the sync to 4ms and offset 20%, it gets a error of fieldbus lost synchronicity when I try to control 5 real motor after about half ah hour. which is amzing is the drivers do not have any error about this,just error occured in codesys.
I try to fiind the jitter of the ethercat task, about 1300+us, I think the jitter is too large so lead the error occuring,then I changed the offset with different values and find a best value is -20% with the jitter within 150us. And I think i get the real question about this error,but after about half an hour, i also got the same error and i find the jitter becomes more and more big.
I really do not know the interal reason of the error "fieldbus lost synchronicity" and if it comes up with the task jitters.
Do you got the answer of this ?
Thanks for reading!


Top
   
PostPosted: Sun Dec 02, 2018 8:01 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3018
Hi,
A rt_preempt patched Linux kernel is mandatory and 1:1 connected ethercat slaves...
BR
Edwin


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 9 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited