Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to prevent encoder duplicate count with a PCI-6036E card

Hi all,

 

I have a PCI-6036E card which has an encoder signal connected to CTR_0_SRC (PFI8) input. When a try to read encoder counts I get a duplicated value. My card doesn't support the "Duplicate Count Prevention" property. How can I solve this problem?

 

In addition I have the encoder channel B connected to GP_UP_DOWN (P0.6) input to detect movement direction.

 

Thanks a lot in advance.

 

Regards

 

Maria

0 Kudos
Message 1 of 4
(6,435 Views)

First, the technique you're using is not the best approach.  Real quadrature decoding is much more robust.  But if you're stuck with a short deadline and nothing but your E-series board, you have a decent chance to get pretty good results that way.

 

The big things to watch out for are that count errors may occur and accumulate during direction reversals, and *will* occur if you have vibration that oscillates across the "A" edge but not far enough to toggle "B".

 

Having said all that, are you sure that the duplicated value you read isn't simply the truth?  Could you be capturing / reading values fast enough to get 2 reads within 1 cycle of "A"?

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 4
(6,424 Views)

Hi Kevin,

 

thanks for your answer, but, yes, I'm sure about read counts, because I can read them with an oscilloscope and I checked that counts I get with my card are about the double of counts read with oscilloscope. And, yes, I assume I'll get errors, but not 100%.

 

I don't know the technique you mentioned to get encoder counts, can I implement it with this card. I have to use this card since I have to integrate this reading into an existing system.

 

Can I design my code in such a way to get good values?

 

Thank you.

Regards,

 

Maria

0 Kudos
Message 3 of 4
(6,413 Views)

  A similar situation came up again when I had a couple minutes to do just a little research.  I'd highly recommend adding a quadrature converter circuit between your encoder and your data acq board.  This reply has a link to one such quadrature-to-clock-and-dir converter.

 

-Kevin P

 

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 4
(6,408 Views)