Re: Servo rate of 20kHz

Hi Edgar,

On Fri, 2007-05-25 at 09:34 -0700, Edgar Berdahl wrote:
> Hello Karssen,
> 
> Thanks very much for your reply. This is helpful for me.
> 
> I imagine that it's mainly hard to achieve low latencies because the  
> interrupt handler never knows exactly when it will get called. 
I guess that depends on whether you use the periodic scheduler or the
one shot mode, but I'm not completely sure. 
In my program I know exactly what's going to happen when. I'm
controlling an experiment by sending out digital pulses at times I
planned in advance. I could do that in RTAI periodic mode (which I did
in the beginning), which means that every time delay between two pulses
must be an integer multiple of the period. Because of this periodicity
it's the mode with least latency. But since I don't want to be limited
by a fixed period I now use the oneshot mode. IIRC I read somewhere in
the documentation that in this mode there's an extra latency of about
3us. 

Because I plan everything in advance I have no info on how the latencies
are when your program is waiting for an interrupt to occur. Maybe the
guys at the orocos project (http://www.orocos.org/) could give you more
info on that. 

> Does  
> this mean that increasing the computations in the control loop will  
> have a small effect on the latency, and not a large one? I mean, I  
> assume that once the control interrupt is running, everything should  
> happen very quickly if it's a fast computer.
When I ran the RTAI latency test, the shortest RTAI period I could
safely use (i.e. in which the overrun was 0) was 15us. When I later
added a few comedi DIO and AO statements I had to increase the period to
20us in order to have perfect timing again. When running at 15us timing
was OK most of the time, but about 1/3 of the time steps was longer.
Apparently doing IO doesn't always take the same time. 



Lennart.

> 
>   - Ed
> 
> On 25.05.2007, at 00:32, L.C. Karssen wrote:
> 
> > On Thu, 2007-05-24 at 16:58 -0700, Edgar Berdahl wrote:
> >> Hello,
> >>
> >> Is it possible to use comedi and RTAI to run a control loop at a
> >> servo rate of 10kHz or 20kHz? We would prefer to have at most a few
> >> samples of delay around the control loop.
> >
> > That depends on the amount of code in the control loop, I guess.  
> > For my
> > experiment I've just made a control program that sets 8 DIO and 2 AO
> > lines with a minimum time step of 20us (50KHz). I was about the  
> > fastest
> > timing I could get. I use an NI-DAQ PCI-6024E card.
> > While performing the latency tests of RTAI (as discussed in the  
> > RTAI-Lab
> > tutorial of Roberto Bucher for example) I got a minimal period of  
> > 15us.
> >
> > Lennart.
> >
> >>
> >> Would this preclude using a controller with perhaps 10 poles and 10
> >> zeros?
> >>
> >>
> >> Thanks,
> >> Ed
> >>
> >> _______________________________________________
> >> comedi mailing list
> >> comedi_at_comedi.org
> >> https://cvs.comedi.org/cgi-bin/mailman/listinfo/comedi
> > -- 
> > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> > L.C. Karssen
> > Department of Physics and Astronomy
> > Faculty of Science
> > Utrecht University
> > Princetonplein 1
> > 3584 CC  Utrecht
> > The Netherlands
> >
> > tel.: +31 (0)30-253-2208
> > fax.: +31 (0)30-253-7468
> > e-mail: L.C.Karssen_at_phys.uu.nl
> > www: http://www1.phys.uu.nl/wwwaoud
> > -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
> >
-- 
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
L.C. Karssen
Department of Physics and Astronomy
Faculty of Science
Utrecht University
Princetonplein 1
3584 CC  Utrecht
The Netherlands

tel.: +31 (0)30-253-2208
fax.: +31 (0)30-253-7468
e-mail: L.C.Karssen_at_phys.uu.nl
www: http://www1.phys.uu.nl/wwwaoud
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

Received on 2007-05-25Z16:56:05