Missing counts of a quadrature encoder (Real-Time Windows Target with NI PCI-6221)

Hello,
I'm trying to get an incremental encoder input with Real-Time Windows Target. The DAQ board being used is NI PCI-6221. After setting up and creating the Simulink model, I executed the model in external mode with sampling time of 0.001 sec. The frequency of the encoder output pulse was less than 1 MHz.
However, the problem is that some (not all) of the encoder counts are missed. The encoder works well without missing counts when tested with other setting (using laptop, QuaRC, and Q8-USB board).
Is there any other options that should be controlled for reading an encoder counts? Or, my misunderstanding?
Thank you.
With regards,
Pilwon

2 Comments

First, I'd try to distinguish between hardware and software as the cause of the problem.
Is everything properly connected? In particular, are ground connections OK? Are you able to test the same hardware setup with software other than Real-Time Windows Target (just running a different software on the same computer, without reconnecting the cables)?
Thank you very much for your advice. I finally found the source of the problem.
It was the cable which is connecting the DAQ terminal and the encoder. The cable was not appropriate for transferring the encoder signal although the connection was proper.

Sign in to comment.

Answers (0)

Asked:

on 24 Jul 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!