CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Thu Jul 27, 2017 1:38 am

All times are UTC+01:00




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

Joined: Mon Oct 31, 2016 5:49 pm
Posts: 22
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: 22
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: 231
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


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

Joined: Mon Oct 31, 2016 5:49 pm
Posts: 22
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: 22
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: 231
Great to hear. Sorry I forgot to mention the task priority!!!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 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