<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.gmail-blob-code-inner
{mso-style-name:gmail-blob-code-inner;}
span.gmail-pl-c1
{mso-style-name:gmail-pl-c1;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-NZ" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Graeme.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> etherlab-users [mailto:etherlab-users-bounces@etherlab.org]
<b>On Behalf Of </b>Ignacio Rosales Gonzalez<br>
<b>Sent:</b> Wednesday, 24 January 2018 12:47 a.m.<br>
<b>To:</b> Boris Skegin <boris.skegin.de@googlemail.com><br>
<b>Cc:</b> etherlab-users@etherlab.org<br>
<b>Subject:</b> Re: [etherlab-users] Sync problems and DC mode<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hello,<o:p></o:p></p>
</div>
<p class="MsoNormal">First of all many thanks for your help! <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">If you look below, master->app_time is not really used in the code.
<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I get the dc ref slave clock with
<span class="gmail-pl-c1">ecrt_master_reference_clock_time</span><span class="gmail-blob-code-inner">(master->master, &master->reference_time); and save in master->reference_time</span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span class="gmail-blob-code-inner">after that </span><br>
<br>
<span class="gmail-blob-code-inner"> ecrt_master_sync_slave_clocks(master->master); // sync slaves to ref clock</span><br>
<span class="gmail-blob-code-inner"> ecrt_master_application_time(master->master, master->reference_time+master->app_time_period); //update master time with time got from dc ref slave</span><o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="gmail-blob-code-inner">Could you help me with the Sync0shift values?? The topology of my network is line one.
</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="gmail-blob-code-inner">Master ----- S1 - S2 - S3 ..... and so on until S25.
</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="gmail-blob-code-inner">I suppose I must set a very small one for the first slave and increase it a little for the next ones, no??
</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="gmail-blob-code-inner">The kernel is Linux debian 3.4-9-rtai-686-pae #1 SMP PREEMPT Debian 3.4.55-4linuxcnc i686 GNU/Linux</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="gmail-blob-code-inner">what is the default one of the linuxcnc 2.7 debian wheezy</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="gmail-blob-code-inner">The network card is a realtek r8169</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="gmail-blob-code-inner">Thanks again</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="gmail-blob-code-inner">Regards, </span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span class="gmail-blob-code-inner">Ignacio Rosales</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2018-01-23 2:06 GMT+01:00 Boris Skegin <<a href="mailto:boris.skegin.de@googlemail.com" target="_blank">boris.skegin.de@googlemail.com</a>>:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Hello.<br>
<br>
> With this version<br>
> <<a href="https://github.com/narogon/linuxcnc-ethercat/commit/e4ab86ba6167ced532e49904059df580062b2d97#diff-059a684a933530837771b5a249433ff3" target="_blank">https://github.com/narogon/linuxcnc-ethercat/commit/e4ab86ba6167ced532e49904059df580062b2d97#diff-059a684a933530837771b5a249433ff3</a>><br>
> (also as attachment lcec_main.c) I get the servos sync and OP but it seems<br>
> that the PDO doesn't arrive for some of the slaves (no idea why).<br>
<br>
master->app_time += master->app_time_period; means that you just sum<br>
up constant cycle times of the LinuxCNC thread. So any latency<br>
information gets lost here.<br>
<br>
Rather make master->app_time be equal to something like<br>
rt_get_time() transferred to EtherCAT time.<br>
<br>
I also think that a proper value for sync0Shift can help a lot.<br>
<br>
If however nothing of that helps, then proceed to Graeme Foot's option b) .<br>
<br>
BTW, what exactly is your kernel and network card and do you really<br>
use an adopted ( non-generic) network driver?<br>
<br>
Regards,<br>
boris<o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>