[Rtai] rt_get_real_time_ns brings not what is expected

Paolo Mantegazza mantegazza at aero.polimi.it
Thu Mar 31 09:49:50 CEST 2011


Erik Rull wrote:
> Paolo Mantegazza wrote:
>> erik.rull at rdsoftware.de wrote:
>>> Hi Paolo,
>>>
>>> this line of code fixes the issue from my side :-)
>>>
>>> rt_gettimeorig(NULL);
>>>
>>> because the base value was 0 when calling the function.
>>>
>>> Thanks for your help.
>>>
>>> Best regards,
>>>
>>> Erik
>>
>> That's OK, you might even setup a long period deamon to that that now
>> and then in order to have any drift corrected.
> 
> What does that mean?
> Will it be a monotonic correction or might I get a "jump back" when 
> recalibrating?
> 

I do not expect anything like that. Just think that to have the real 
time RTAI aligns the time of day to the TSC, in an ininterruptible way. 
Once the time origin has been set it goes on with using just the TSC. 
Linux might do the same, but if you have any other adjustment, e.g. NTP, 
then you might will to realign now and then.

paolo


>> The point is that, in the author's mind, the first initialization should
>> be native in RTAi if the POSIX real time clock is enabled when
>> configuring RTAI.
>> If not so yet then there is something I forgot to do.
>>
>> paolo
>>
> 
> Best regards,
> 
> Erik
> 



More information about the Rtai mailing list