How Do I Use a Quadrature Encoder with My Data Acquisition Board?Hardware: Multifunction DAQ (MIO)>>M Series, Multifunction DAQ (MIO)>>E Series
Problem: How do I use a quadrature encoder, single ended or differential, with my data acquisition (DAQ) board? Solution: Quadrature encoders are generally used to measure angular position, often of something like a rotating shaft. Like any other encoder, a quadrature encoder has a specified resolution that indicates how many pulses determine a full revolution of the rotation shaft. This value is specified in pulses/revolution. There are two types of quadrature encoders that are handled in slightly different ways. The following addresses how to read from both differential and single ended quadrature encoders using counters on National Instruments Data Acquisition boards. Single Ended Quadrature Encoder A standard quadrature encoder can have up to 3 channels— channels A, B and Z. Channels A and B are used to indicate the position of the shaft at any given point in time. Channel Z is used to reload the counter with a value specified by the user when a certain phase position condition is met by channels A and B. There is more detailed information about how channel Z is used on page 121 of the M Series User Manual. Channels A and B are both output by the quadrature encoder 90º out of phase with each other. Images of the A and B channel outputs are shown in Figure 1. The direction of rotation is determined by which phase leads. When phase B leads A, then the shaft is rotating in the counter-clockwise direction. ![]() Figure 1: Quadrature Encoder Signals A and B.
The NI E-, M-, S- and X-series DAQ boards can perform measurements on quadrature encoders. Currently, our M series DAQ boards can perform X2 and X4 encoding measurements. This is due to the fact that E-series cards cannot measure both the rising and falling edge. These types of encoding simply determine what edges of channel A and B signals the counter increments/decrements on. For more information about these types of encoding, see pages 120-125 of the M Series User Manual. The exact pins on the NI-DAQ cards may vary depending on the card, but channels A, B and Z are connected to the counter's Source, AUX and GATE pins, respectively. For information about exactly which pins these connections correspond to on your specific card, you can check your device pinout from Measurement & Automation Explorer (MAX) by right clicking on your device and selecting Device Pinout. Differential Quadrature Encoder A differential quadrature encoder has 5 signals instead of 3. There are A, A Inverse, B, B Inverse and a Z index channels. Unfortunately most of our data acquisition boards (E-Series, M-Series, X-Series, and TIO) do not support differential encoder measurements. We can, however, use these differential encoders in the same way we would use a single ended quadrature encoder. You can connect just the A, B and Z index channels to the Source, AUX and GATE pins on your counter. You can also make the same connections with the A inverse, B inverse and Z channels. The NI 9411 is a 6 channel differential input module and it supports differential encoder measurements. There is a connection diagram in the NI 9411 Getting Started Guide that explains how to connect signals of a differential encoder. Related Links: Product Manuals: NI 9411 Getting Started Guide (December 2015) Product Manuals: E Series User Manual (February 2007) Product Manuals: M Series User Manual (July 2016) Product Manuals: X Series User Manual (December 2015) Example Program: NI-DAQmx: Using the BNC-2120 to Measure an Angular Quadrature Encoder Tutorial: Using Quadrature Encoders with E Series DAQ Boards Tutorial: Encoder Measurements: How-To Guide KnowledgeBase 3CKGJQ9T: Connecting an Encoder to a Counter KnowledgeBase 35MGFEI3: Can My E Series Counter Detect Both the Rising and Falling Edges of My Quadrature Encoder Signal? Attachments:
Report Date: 11/15/1995 Last Updated: 11/17/2016 Document ID: 0FE9BGSR |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

