Hi all,

I'm implementing  an predictive control application to run on my powerpc
(MPC5200 - 400Mhz) with Xenomai patch. Now that I have it done, I wonder
estimate the computation time of some parts in my code.
I trying to use the Native/Xenomai API to get it but the results are weirds.
My task code is below:


void Simulator (void* c)
{

    unsigned char n;
    unsigned long overrun;
    FILE *stream;
    unsigned int i;

    float v, t;
    n    = 20;
    v    = (float) V;
    t    = (float) T;
    alfa = (float) sqrt(29);
    stream = fopen("time.dat", "w+t"); // where I print the results



    for(i=na_mfd;i<nref;i++)
    {
        *infoTempo = rt_timer_ticks2ns(rt_timer_read());
       fprintf(stream, "%lld\n",infoTempo);*

       // ------------- My control Code ---------------//
        x_sys[i]    = (float) (x_sys[i-1] + V*cos(teta_sys[i-1]+fi[i-1])*T);

        y_sys[i]    = (float) (y_sys[i-1] + V*sin(teta_sys[i-1]+fi[i-1])*T);

        teta_sys[i] = (float) (teta_sys[i-1] + (V*sin(fi[i-1])*T)/LE);
        y[0] = x_sys[i-1];
        y[1] = y_sys[i-1];
        abs2local(&y[0], &y[1], &x_sys[i], &y_sys[i], &teta_sys[i]);
        y[0] = teta_sys[i];
        purePursuit(r, &x_sys[i], &y_sys[i], &teta_sys[i], xref, yref, &n,
&nref, &alfa, &dg, &t, &v);
        processFreeResponseOP(R, B, f, y, du, h, na_mfd, nb_mfd, nout, nin);

        processCommand(K, r, f, du, 0, h, na_mfd, nb_mfd, nout, nin, n);
        #ifdef DEBUG
        printArray(f, TAILREF, "Resposta Livre:");
        printArray(du, nb_mfd*nin, "du:");
        #endif
        fi[i] = fi[i-1] + du[nb_mfd-1];
        infoTempo = rt_timer_ticks2ns(rt_timer_read());

//------------------------------------------------------------------------------//


    }
    fclose(stream);

}

That's the only one task I have on my system. I wonder compute the time to
process every single step of *for* loop. What you think?

Besides this, I'm looking some documents that say:

The selection
of the proper operation mode (oneshot or periodic) of the timer is made at
build time using the configuration switch
named *CONFIG_XENO_OPT_TIMING_PERIOD* from the nucleus section. A
zero value causes the native skin to operate in oneshot mode; otherwise,
periodic
mode is used according to the given duration of the clock tick, expressed in
nanoseconds. If support for periodic timing has been disabled at
configuration
level (i.e. *CONFIG_XENO_OPT_TIMING_PERIODIC* is unset), the timer mode
always defaults to oneshot.

What is *CONFIG_XENO_OPT_TIMING_PERIOD*? And where configure it?

I hope someone have some time for that.

Thanks a lot,

Breno
*
*
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to