From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <12d5cebd852.gprizzi@domain.hid> Date: Thu, 6 Jan 2011 21:01:56 +0100 (CET) From: "gprizzi@domain.hid" Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_193331_14025014.1294344116309" Subject: [Xenomai-help] R: Re: R: Re: error in executing xenomai tests Reply-To: "gprizzi@domain.hid" List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: gilles.chanteperdrix@xenomai.org Cc: xenomai@xenomai.org ------=_Part_193331_14025014.1294344116309 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Dear Sir, I find your considerations very useful, unfortunately I am not expert in tuning conventional operating system with real time patch. If you can help me I will greatly appreciate your advices. I run latency test and got the following results: root@domain.hid# ./latency == Sampling period: 100 us == Test mode: periodic user-mode task == All results in microseconds warming up... RTT| 00:00:01 (periodic user-mode task, 100 us period, priority 99) RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst RTD| -1.786| 2.224| 19.821| 0| 0| -1.786| 19.821 RTD| -1.796| 2.330| 19.490| 0| 0| -1.796| 19.821 RTD| -1.831| 2.231| 19.495| 0| 0| -1.831| 19.821 RTD| -1.772| 2.291| 19.743| 0| 0| -1.831| 19.821 RTD| -1.473| 2.460| 19.708| 0| 0| -1.831| 19.821 RTD| -1.524| 2.381| 19.717| 0| 0| -1.831| 19.821 RTD| -1.752| 2.338| 19.807| 0| 0| -1.831| 19.821 RTD| -1.893| 2.297| 19.520| 0| 0| -1.893| 19.821 RTD| -2.192| 2.284| 19.549| 0| 0| -2.192| 19.821 RTD| -1.635| 2.327| 19.530| 0| 0| -2.192| 19.821 RTD| -1.416| 2.406| 19.580| 0| 0| -2.192| 19.821 RTD| -1.305| 2.471| 14.930| 0| 0| -2.192| 19.821 RTD| -1.782| 2.409| 14.999| 0| 0| -2.192| 19.821 RTD| -1.774| 2.364| 18.456| 0| 0| -2.192| 19.821 RTD| -1.784| 2.328| 19.914| 0| 0| -2.192| 19.914 RTD| -1.768| 2.293| 19.639| 0| 0| -2.192| 19.914 RTD| -1.777| 2.263| 19.463| 0| 0| -2.192| 19.914 RTD| -1.228| 2.389| 19.923| 0| 0| -2.192| 19.923 RTD| -1.223| 2.405| 19.579| 0| 0| -2.192| 19.923 RTD| -1.778| 2.431| 14.499| 0| 0| -2.192| 19.923 RTD| -1.983| 2.493| 15.335| 0| 0| -2.192| 19.923 Looking at the worst case of a latency of about 20 us with a task at 2 KHz I can estimate 2*10^-3 * 20 * 10 ^-6 = 40 * 10^-3 sec lost for latency in 1 sec.. In the average case I will have 5*10^-3 sec. lost for latency in 1 sec. I think that these percentage can be accepted in a robotic position control, what do you think about these assumption? Can you suggest me a better way to evaluate the latency with respect of robotic position control system or can you suggest me some useful articles to read about this topic? My kernel has the following configuration CONFIG_PREEMPT_VOLUNTARY=y # CONFIG_PREEMPT is not set CONFIG_HIGH_RES_TIMERS=y and I had a look at https://rt.wiki.kernel.org/index.php/Frequently_Asked_Questions Do you think that setting CONFIG_PREEMT=y instead of CONFIG_PREEMPT_VOLUNTARY=y will significantly reduce latency? Thank you for your kind support. Gianpaolo Rizzi ----Messaggio originale---- Da: gilles.chanteperdrix@xenomai.org Data: 5-gen-2011 8.06 PM A: "gprizzi@domain.hid" Cc: Ogg: Re: R: Re: [Xenomai-help] error in executing xenomai tests gprizzi@domain.hid wrote: > Tank you for your quick and clear replay. > > I am going to use xenomai to run OROCOS based control applications. > The faster frequency of periodic tasks is estimated between 1KHz to 2 KHz. Well, that is not enough information. If you seriously want to meet some deadlines, you have to make a few calculations, then see if your system has sufficient latency, using the "latency" test. But this really is the job you should be doing. Note that for 1kHz or 2kHz on x86 platform, preempt_rt latencies may be worth checking. -- Gilles. ------=_Part_193331_14025014.1294344116309 Content-Type: text/html;charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear Sir,

I find your considerations very useful, unfortunately I am= not  expert in tuning conventional
operating system with real tim= e patch.

If you can help me I will greatly appreciate your advices.<= br>
I run latency test and got the following results:

root@domain.hid= 1010:/usr/lib/xenomai# ./latency
=3D=3D Sampling period: 100 us
=3D= =3D Test mode: periodic user-mode task
=3D=3D All results in microsecond= s
warming up...
RTT|  00:00:01  (periodic user-mode task, 1= 00 us period, priority 99)
RTH|----lat min|----lat avg|----lat max|-over= run|---msw|---lat best|--lat worst
RTD|     -1.786|&= nbsp;     2.224|     19.821| &= nbsp;     0|     0|  &nbs= p;  -1.786|     19.821
RTD|   &n= bsp; -1.796|      2.330|     1= 9.490|       0|     0|&nb= sp;    -1.796|     19.821
RTD| &= nbsp;   -1.831|      2.231|  &= nbsp;  19.495|       0|   = ;  0|     -1.831|     19.821RTD|     -1.772|      2.291|=      19.743|       0|&nbs= p;    0|     -1.831|   &n= bsp; 19.821
RTD|     -1.473|    =   2.460|     19.708|     =   0|     0|     -1.831| &= nbsp;   19.821
RTD|     -1.524|  = ;    2.381|     19.717|   = ;    0|     0|     -= 1.831|     19.821
RTD|     -1.75= 2|      2.338|     19.807|&nbs= p;      0|     0|  &= nbsp;  -1.831|     19.821
RTD|   = ;  -1.893|      2.297|    = ; 19.520|       0|     0|=      -1.893|     19.821
RTD|&nbs= p;    -2.192|      2.284| &nbs= p;   19.549|       0|  &n= bsp;  0|     -2.192|     19.82= 1
RTD|     -1.635|      2.3= 27|     19.530|       0|&= nbsp;    0|     -2.192|   = ;  19.821
RTD|     -1.416|   &nb= sp;  2.406|     19.580|    &nb= sp;  0|     0|     -2.192|&nbs= p;    19.821
RTD|     -1.305| &n= bsp;    2.471|     14.930|  &n= bsp;    0|     0|    = ; -2.192|     19.821
RTD|     -1= .782|      2.409|     14.999|&= nbsp;      0|     0| &nbs= p;   -2.192|     19.821
RTD|  &n= bsp;  -1.774|      2.364|   &n= bsp; 18.456|       0|    = 0|     -2.192|     19.821
RTD|&= nbsp;    -1.784|      2.328| &= nbsp;   19.914|       0|  = ;   0|     -2.192|     19= .914
RTD|     -1.768|      = 2.293|     19.639|       = 0|     0|     -2.192|  &n= bsp;  19.914
RTD|     -1.777|   =    2.263|     19.463|    =    0|     0|     -2.192|&= nbsp;    19.914
RTD|     -1.228| = ;     2.389|     19.923|  = ;     0|     0|   &n= bsp; -2.192|     19.923
RTD|    = -1.223|      2.405|     19.57= 9|       0|     0| &= nbsp;   -2.192|     19.923
RTD|  = ;   -1.778|      2.431|   = ;  14.499|       0|   &nb= sp; 0|     -2.192|     19.923
RT= D|     -1.983|      2.493|&nbs= p;    15.335|       0| &n= bsp;   0|     -2.192|    = 19.923


Looking at the worst case of a latency of about 20 us wi= th a task at 2 KHz
I can estimate 2*10^-3 * 20 * 10 ^-6 =3D 40 * 10^-3 s= ec lost for latency in 1 sec..
In the average case I will have 5*10^-3 s= ec. lost for latency in 1 sec.

I think that these percentage can be= accepted in a robotic position control,
what do you think about these a= ssumption?

Can you suggest me a better way to evaluate the latency w= ith respect of robotic
position control system or can you suggest me so= me useful articles to read about this topic?

My kernel has the follo= wing configuration

CONFIG_PREEMPT_VOLUNTARY=3Dy
# CONFIG_PREEMPT = is not set

CONFIG_HIGH_RES_TIMERS=3Dy

and I had a look at
https://rt.wiki.kernel.org/index.php/Frequently_Asked_Questions
Do you think that setting CONFIG_PREEMT=3Dy instead of
CONFIG_PREEMPT= _VOLUNTARY=3Dy
will significantly reduce latency?

Thank you for y= our kind support.


Gianpaolo Rizzi

----Messaggio originale----
Da: gilles.chanteperdrix@xenomai.org
Data= : 5-gen-2011 8.06 PM
A: "gprizzi@domain.hid"<gprizzi@domain.hid>
Cc: &l= t;xenomai@xenomai.org>
Ogg: Re: R: Re: [Xenomai-help] error in execu= ting xenomai tests

gprizzi@domain.hid wrote:
> Tank you for your q= uick and clear replay.
>
> I am going to use xenomai to run OR= OCOS based control applications.
> The faster frequency of periodic t= asks is estimated between 1KHz to 2 KHz.

Well, that is not enough in= formation. If you seriously want to meet some
deadlines, you have to mak= e a few calculations, then see if your system
has sufficient latency, us= ing the "latency" test. But this really is the
job you should be doing.<= br>
Note that for 1kHz or 2kHz on x86 platform, preempt_rt latencies may= be
worth checking.

--
=09=09=09=09=09    Gill= es.


------=_Part_193331_14025014.1294344116309--