- From: Klaas Gadeyne <Klaas.Gadeyne_at_mech.kuleuven.ac.be>
- Date: Mon, 20 Oct 2003 16:00:38 +0200 (CEST)
> > I need a quadrature decoder for an industrial application. The following
> > is required:
> >
> > * X2 quadrature decoding
> > * position readout rate between 50Hz and 20KHz
> > * the counter should be automatically reset by the
> > card upon detection of a rising edge of Z
> >
> > It looks like the NI660x driver implements enough functionality to cover
> > my needs, am I right to say that?
> >
> We haven't tested the driver for higher acquisition rates than
> 1-KHz...
Although this probably won't be an issue...
> We have not tested the Z index pulse functionality...
Even worse, we haven't implemented it yet :-)
It is provided in our API though, but the driver currently does not
implement it.
See
<http://people.mech.kuleuven.ac.be/~kgadeyne/software/pprts/drivers/comedi/ni660x/test/encodertest.c>
It should be straightforward to implement it though, you should just add
some extra defines to comedi.h
// The following is not implemented yet (See TODO)
==================================================
data[2] = When to take into account the indexpulse:
IndexPhaseHighHigh, IndexPhaseLowHigh, IndexPhaseLowLow,
IndexPhaseHighLow
data[3] = Reset counter if index pulse arrives?
GPCT_RESET_COUNTER_IF_INDEX_ARRIVES
GPCT_CONTINU_COUNTING_WHEN_INDEX_ARRIVES
And add 2 extra "switch" statements to the GPCT_insn_config() call in
ni_660x.c, the check these values and write the appropriate bits in the
config register (see Register level manual 39/40)
If you don't do it, I might just add it if I feel like it somewhere in the
near future :-)
> > May I also ask what particular Linux and COMEDI version you use in your
> > robot application?
> 2.4.19 and 2.4.2X kernels, RTAI from CVS, and Comedi from CVS.
kernels are patched with the rtai-adeos patches, we use lxrt to read the
counter values (I guess you'll need something simular if you want to read
at 20 kHz)
regards,
klaas
Received on 2003-10-20Z13:00:38