Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Quadrature Encoder / Position Measurement

10 ratings | 3.30 out of 5
Print

Description

Measurements concerning rotation typically require a quadrature encoder to convert rotation into an electrical signal. Typically quadrature encoders produce pulses on two channels, channel A and channel B, as the shaft rotates. To specify which direction the shaft is rotating, channel A either leads or trails channel B by 90°. To measure the rotation, one channel is sent to the counter's source to provide the signal to be counted, and the other channel is sent to the counter's up/down pin to tell the counter to either count up or down. The encoder may have a third line for Z indexing, which produces a pulse every time the shaft passes a certain position to permit absolute measurement. Not all counters support Z indexing, but if they do, there will be a separate line specifically for Z indexing.





Buffered Acquisition
For those applications where the counter's value must be sampled faster than software timing permits, or for time critical applications, hardware timing must be used. Hardware timed acquisition, also known as buffered acquisition, latches the counter value on the rising edge of a gating pulse. Either continuous or finite buffered acquisitions can be done. Synchronization of the position measurement can be done by using the other signal as the gating pulse--for instance, to synchronize two position measurements, simply wire the same gating pulse to both counters.

Unbuffered Acquisition
Software timed encoder measurements have the counter continually counting but only read the value of the counter in response to software events such as the user pressing a button or the next iteration of a while loop. Since there may be some delay between when the read function is first entered and the value is actually returned, the encoder may have already generated additional pulses during that time, so software timing should only be used when accuracy is not paramount.

Common Applications


The various types of counters available on National Instruments boards do not all offer the same features. These feature differences are described below.

NI-TIO based counters (PCI-66XX boards)
Supports quadrature encoders and Z-indexing. Also supports X1, X2, X4, and two-pulse encoders, as well as an optional debouncing noise filter (please see the manual for more details). Connect channel A to the source, channel B to the up/down (also known as the AUX) line, and Z indexing to the gate. The gating pulse must be selected with Counter Set Attribute or GPCTR_Change_Parameter (LabVIEW); use ND_GATE or "gate selection", respectively). X1, X2, X4, and the noise filter are enabled through software (Counter Set Attribute in LabVIEW, GPCTR_Change_Parameter in NI-DAQ).

DAQ-STC based counters (E-Series boards)
Supports quadrature encoders, but not Z-indexing. The up/down pin is DIO6 for counter 0 and DIO7 for counter 1. Connect channel A to the source pin, channel B to the up/down pin, and the gating pulse to the gate. For information on using quadrature encoders with E-Series boards, refer to the Using Quadrature Encoders with E Series DAQ Boards document (linked below).

8253 counters (Lab-Series/1200)
The 8253 counter (used on LabPC, 512, 700, and 1200 series) does not support buffered counting; use software timing instead. The 8253 counter (used on LabPC, 512, 700, and 1200 series) does not have an up/down pin, so it cannot support quadrature encoders without additional hardware.

Am9513 based counters (non-E-Series MIO)

The Am9513 counter does not support buffered counting; use software timing instead. The Am9513 counter (used in non-E-series MIO devices and the PC-TIO-10) also does not have an up/down pin, so additional hardware must be used.
10 ratings | 3.30 out of 5
Print

Reader Comments | Submit a comment »

Quad FieldPoint Module
Should also mention about the FieldPoint Quad module here.
- Feb 16, 2006

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).