Hi Peter,
getSpeed() won't be a problem. It's just "v=x/t"!
I'll try to change this device driver to use its interruption.
Thanks
Adriano
--- In "PeterElliot" <> wrote:
>
> Hi Adriano,
>
> Check out the ADC Device Drive in the file section of the group. It
> implements an interrupt driven background task which should be
> modifiable for your application.
>
> The only thing to decide is how to implement the getSpeed() (assuming
> it's not a simple register read) so that the interrupt is does not
> take too long.
>
> Hope this helps,
>
> PJE
>
> --- In "Adriano Naspolini" <anaspolini@>
> wrote:
> >
> > Hi,
> > My application has a Feedback Control System function needing to be
> > calculated every 50ms.
> > The function is something like that:
> >
> > control (int speedRef){
> > e1 = e0;
> > e0 = speedRef-getSpeed();
> > c1 = c0;
> > c0 = e1*0.5 - e0*1.1 + c1;
> > if (c0 > 100)
> > c0=100;
> > else if (c0 < 0)
> > c0 = 0;
> > SetPWM(c, ...);
> > }
> >
> > At the same time i have threads taking care of graphic interface,
> > serial bus, reading/writing a file, but without hard time
> constraints.
> >
> > Is there any way to make this work in a Debian 2.4.x/TS7300 (no
> RTOS)?
> >
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|