Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Data Acquisition: Troubleshooting Incorrect Encoder Readings

Primary Software: LabVIEW Development Systems
Primary Software Version: N/A
Primary Software Fixed Version: N/A
Secondary Software: N/A
Hardware: Signal Conditioning Other

Problem:
I have a DAQ system that generates bad readings from my encoders. Are there any troubleshooting tips for incorrect readings?

Solution:
Please follow the following advice for troubleshooting incorrect readings involving encoders: 

  1. Confirm that the pin connections to the counters are correct:

    In Measurement and Automation Explorer (MAX) you can find the device Pinouts. This is done by selecting the device and select Device Pinout. In the NI-DAQmx Help you can also find suggested connections required between the encoder and the counter device. The DAQmx Help File is titled, Connecting Counter Signals. Select the type of hardware you’re using – TIO Signal Connections for Counters and a table will show you the counter connections required for different counter measurement types.

    If you’re using a differential encoders check the following knowledgebase article KnowledgeBase 201C6BHH: How Can I Connect a Differential Encoder to a PCI/PXI-660x. None of the National Instrument devices can handle differential signals and thus a line converter is required.


  2. Check ground connections, DGND to Device Ground:

    For more information concerning wiring considerations see Developer Zone: Field Wiring and Noise Considerations for Analog Signals.

    Note: “RGND" stands for Reserved Ground. These are simply additional ground pins. These pins are used for noise reduction in some cables. It would be recommended to use an Analog Input NI-DAQmx task to record the encoder phase signals to see if any noise or glitches are present. This will cause erroneous results.

    Depending on the hardware being used, enabling the Digital Debounce Filters for TIO Devices in NI-DAQmx could be an option. KnowledgeBase 3VDG0388: Enabling the Digital Debounce Filters for TIO Devices in NI-DAQmx.


  3. Try different counter and ground connections:

    It has been seen in the past that either a counter doesn’t work correctly or that some ground pins handle noise better than others.


  4. Z-index:

    Z-index can be used to reset the counter to a pre-specified value. For testing purposes disable this option on the NI-DAQmx task. For more information see KnowledgeBase 2JTAKK2Y: Z-Index Reload Phase in NI 660x Counter Boards. Make sure this function is disabled during problem solving. Ensure the readings are correct before introducing this feature.


  5. Signal Type:

    The NI devices can only accept external signals with the TTL specifications. The aspects which are important is the voltage rage and rise times. For more discussion please see KnowledgeBase KB 2CFGBTFT: Incorrect Count Values When Using an External Signal as the Counter Source.


  6. Reverse Phase A/B:

    Does the problem still appear when the Phase A and B are switched. If so, this suggests a hardware issue. If not, then considering looking into the software. Trying using a MAX TestPanel or example LabVIEW code.


  7. Check the Encoder Mode:

    Counters on M Series, C Series, NI-TIO devices support three types of decoding for quadrature encoders: X1, X2, and X4. With X1 decoding, when signal A leads signal B, the counter increments on the rising edge of signal A. When signal B leads signal A, the counter decrements on the falling edge of signal A. With X2 decoding, the same behavior holds as with X1, except the counter increments and decrements on both rising and falling edges of signal A. Similarly, with X4 decoding, the counter increments and decrements on both rising and falling edges of both signal A and signal B X4 decoding is more sensitive to position, but is also more likely to provide an incorrect measurement if there is vibration in the encoder.


Related Links:
KnowledgeBase 201C6BHH: How Can I Connect a Differential Encoder to a PCI/PXI-660x
Developer Zone: Field Wiring and Noise Considerations for Analog Signals
KnowledgeBase 3VDG0388: Enabling the Digital Debounce Filters for TIO Devices in NI-DAQmx
KnowledgeBase 2JTAKK2Y: Z-Index Reload Phase in NI 660x Counter Boards
KnowledgeBase KB 2CFGBTFT: Incorrect Count Values When Using an External Signal as the Counter Source

Attachments:





Report Date: 01/23/2009
Last Updated: 02/06/2009
Document ID: 4TMDLPCX

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit