Hi, that's all right. I'm using Xenomai. I just want to demonstrate the idea about how to synchronize the master clock to ref slave clock in an alternative way. I choose the RTAI example to have the comparison with the method of Graeme Foot.
You can test the rest nevertheless without that part. I didn't change the API, so you don't need to change anything in your code. But 1) If you call ecrt_master_application_time() outside of the loop, it is recommended that you remove it. 2) And only if you use ecrt_master_reference_clock_time(), you need to notice that at the program start, before the calculation of dc system time offsets for each slave has been done, ecrt_master_reference_clock_time() would now have errno EAGAIN to notify the user that the ref clock is not ready yet. So it is worth to always check the return value of ecrt_master_reference_clock_time(), like I did in my rtai_rtdm_dc example. That's it. Regards, Jun On Fri, Apr 4, 2014 at 3:17 AM, Gavin Lambert <[email protected]> wrote: > Hi Jun, > > > > Thanks; I’m having a look at it, but much of it is new to me. I’m using > PREEMPT_RT so my code is based on the dc_user example, not the RTAI > examples, and I’d probably have to try adapting it before I could test it. > > > > Regards, > > Gavin Lambert > > > > *From:* Jun Yuan [mailto:[email protected]] > *Sent:* Friday, 4 April 2014 01:46 > *To:* Gavin Lambert > *Cc:* [email protected] > *Subject:* Re: [etherlab-users] DC-Synchronization - Sync signal > generation > > > > Hi Gavin, > > your interest is my motivation. I have attached the bundle file. > > My changes is base on the newest Version 1.5.2 in 'stable-1.5' branch. I > added a new 'rtleaders' branch first and did all my changes on that. So > after "$ hg unbundle etherlab_1.5.2_jyuan.hg", don't forget to switch to > the 'rtleaders' branch using "$ hg update rtleaders". > > I found a better way of synchronizing the master clock to ref slave clock. > It is much faster and more stable. I managed to port my C++ code into C > code in the rtai_rtdm_dc example today, but I cannot test if the new code > compiles right now. If you have a rtai environment, please test it for me > if it compiles, and give me some feedback. > > Besides that, there is a more accurate DC time offset calculation. There > should be no more errors like "Slave did not sync after 5000ms". The > accurate time offset estimation saves much time for the DC Sync procedure. > Slaves would have such a small dc diff (several hundred ns maybe) at the > beginning of the dc sync check, that I even changed > EC_SYSTEM_TIME_TOLERANCE_NS from 1000000ns to 1000ns. > > The postponed check of master->has_app_time makes the error "No app_time > received up to now, but master already active" away. > > And there are the bugfix for ecrt_master_select_reference_clock() from > Graeme Foot, and some other bug fixes from Jeroen Van den Keybus. > > > > Any feedback is welcome. Have fun testing those changes! > > > > Jun > > > > On Thu, Apr 3, 2014 at 12:13 AM, Gavin Lambert <[email protected]> > wrote: > > On 2 April 2014 22:40, quoth Jun Yuan: > > > But there is a reason why we all put the ecrt_master_application_time() > outside > > the loop. Because we all got burned by the error "No app_time received > up to > > now, but master already active.", which is a timing bug in Etherlab. I've > > resolved the problem by change the code of Etherlabmaster, which get rid > of > > the "No app_time" bug. Now I don't need to call > ecrt_master_application_time() > > outside the loop any more. I will publish the bundle to the mailing list > when > > I have time. > > I'd be very interested to see this. Slave sync timing, "no app time", and > the 5000ms sync timeout have been a recurring bugbear for me. > -- Jun Yuan [Aussprache: Djün Üän] Robotics Technology Leaders GmbH Am Loferfeld 58, D-81249 München Tel: +49 89 189 0465 24 Fax: +49 89 189 0465 11 mailto: [email protected] Umlautregel in der chinesischen Lautschrift Pinyin: Nach den Anlauten y, j, q, und x wird u als ü ausgesprochen, z.B. yu => ü, ju => dschü, qu => tschü, xu => schü.
_______________________________________________ etherlab-users mailing list [email protected] http://lists.etherlab.org/mailman/listinfo/etherlab-users
