Correlating A/D and Quadrature Encoder with Direction Reversal

I need to acquire analog input data that is correlated with position information from an incremental encoder. In an old DOS system we do this by having the processor respond to fast timer interrupts. On each interrupt, the processor reads the encoder position from a 5312 encoder board and if the position has advanced to the next increment, it does a single analog read which is saved in a buffer. In a Windows environment, we are looking at using one phase of the encoder as an external trigger to the A/D board, which is acquiring a whole buffer using DMA, so the processor would not be involved in a real-time fashion. But this method has a problem. In our application it is possible for our encoder to briefly reverse direction during the data acquisition. Merely counting pulses from one phase of the encoder will not properly take this brief reversal into account, because the direction information is not available in one phase. We could build a custom interface board with a microcontroller to generate unidirectional pulses from quadrature encoder input, but we would rather use all off-the-shelf hardware. Is there any solution to this problem using commercial PCI-bus boards?

-Robert Scott Ypsilanti, Michigan (Reply through this forum, not by direct e-mail to me, as automatic reply address is fake.)

Reply to
Robert Scott
Loading thread data ...

address is fake.)

However you accomplish this, you will need to look at both tracks. Incremental encoder outputs have four states: 1,1; 1,0; 0,0; and 0,1 in sequence. You want to count a clocking transition only after the proper intermediate transitions have been traversed. I have a (patented; expired) way to do that with two XOR gates and a flip-flop (usually, a counter) in hardware. I have done it with a micro that issued interrupts whenever an input made a transition.

I'm puzzled. You evidently know position by keeping track of the incremental encoder and maintaining an internal count, probably with an interrupt routine. The signals you need to do that reliably in the presence of vibration should allow you to do what you want with no further hardware.

Jerry

Reply to
Jerry Avins

The quadrature encoder board (TE5312) knows the encoder position at all times, but a Windows application cannot read the board often enough to get position information that correlates with the analog channel. Yes, an interrupt routine based on a fast timer would work, but in Windows 2000 that is a real pain - a kernel mode device driver at the very least. I need to use a mode of operation for the A/D board that does not require processor intervention until the entire move is complete. I need to know what the analog channel was doing at each position as defined by the encoder after a move. A/D boards have an external sample clock option and a DMA buffered mode option, which almost works. In fact, it does work, provided can guarantee that the encoder does not back up during the logging operation. Again, I am trying to make this work with all off-the-shelf hardware.

-Robert Scott Ypsilanti, Michigan (Reply through this forum, not by direct e-mail to me, as automatic reply address is fake.)

Reply to
Robert Scott

address is fake.) A signal from the encoder board that interrupts whenever the count changes would suit you well. Is the board implemented in a way that would allow that?

Jerry

Reply to
Jerry Avins

No, and even if it did, that would not help because fast interrupt service routines are not available to applications in Windows 2000. You have to write a kernel mode device driver to do that - something that is very complicated and expensive to do well.

In any case, in the meantime I have solved my problem. I found a new National Instruments boards (the NI-6220) that has A/D and quadrature encoder inputs on one board, and which allows DMA logging of both types of inputs (A/D readings and cumulative counts) in one interleaved buffer. I'll just use that board with NI's supplied device drivers.

-Robert Scott Ypsilanti, Michigan (Reply through this forum, not by direct e-mail to me, as automatic reply address is fake.)

Reply to
Robert Scott

I think your requirement is too whacky to find something off the shelf that does it unless you can find something fast enough which is programmable.

Only thing can think of is to look at PCI motion control boards which could do the encoder reading for you and may be able to run a user program fast enough to track the encoder and pulse a general purpose output. Some of them may even have ADCs good enough to to the other half of your job.

A custom solution is pretty simple, an 8 pin PIC would work up to a few tens of kHz pulse rates, the smalest CPLDs could also do it up to tens of MHz.

Reply to
nospam

...

Great! The best solutions come off the shelf, provided they don't need to be warped too much.

Jerry

Reply to
Jerry Avins

What is whacky about wanting to know the force as a function of position when shifting a manual transmission? It is a commonly tested parameter in production testing of these parts.

Sure, you can read the data, but how can a PIC store 20,000 data points for later analysis by the Windows computer that is running the whole test? Furthermore, it is not that easy to read quadrature encoders with a PIC. I know because I have done it.

-Robert Scott Ypsilanti, Michigan (Reply through this forum, not by direct e-mail to me, as automatic reply address is fake.)

Reply to
Robert Scott

You said

"We could build a custom interface board with a microcontroller to generate unidirectional pulses from quadrature encoder input"

That is a 'whacky' requirement.

It can't it doesn't need to to meet your 'whacky' requirement.

Reply to
nospam

Some people tend to think that whatever they don't understand is wacky or petty. After all, they know everything of importance, don't they?

You might be amused or informed by patents 4,000,039 and 4,379,221.

Jerry

Reply to
Jerry Avins

Hi Robert,

You may have already solved your problem, but just in case...

My company offers a PCI board with the following features:

  • 8x A/D 14-bit, simultaneously sampled
  • 8x D/A 12-bit, simultaneous update
  • 8x Quadrature Encoder inputs simultaneously sampled
  • 32x DIO

This model is the Q8. There is another model called the Q4 with 1/2 the I/O.

formatting link
Cheers,

M

address is fake.)

Reply to
Matthew Hodjera

I checked your website. C "The Q8 SDK is currently under development."

I can't afford to be your beta tester. I need something that works now. Can you give me any reason why I should consider your board over the tried-and-true National Instruments M-series, which has full support for C/C++ applications?

-Robert Scott Ypsilanti, Michigan (Reply through this forum, not by direct e-mail to me, as automatic reply address is fake.)

Reply to
Robert Scott

Robert,

A bit to the west of you at U of M, I'm using National Instrument's new M Series boards which now include encoder inputs and hardware clocked digital IO. Digital IO can be sync'd to the AI clock or to many other sources. It can be configured to acqurie a set of data on each external trigger. Excellent tech support.

Steve

formatting link

Reply to
Steve Parus

Also check out the various natinst.public.* newsgroups including natinst.public.daq.*.

Steve

formatting link

Reply to
Steve Parus

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.