Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use daqmx to get encoder direction/count on E-series board?

Hardware:
PCI-6014
Labview 7.1

I have a linear actuator and wish to get distance/direction.  The motor has a quad encoder with phase A and B only.  I connected the lines according the the E-series, PFI-8 and PFI-6, and ground to digital ground. I then attempted to design a control with daqmx but failed.  I have tried the daqmx examples but none were attempting a reverse in direction.  Most examples given for direction change are for traditional daq control; i cant make a correlation on what to use to substite traditional daq with daqmx vi's. 
2 questions:
How do I use daqmx to get encoder direction/count on E-series board?

Are there low pass filter vi's recommended for each phase connection to stabilize data?

Thanks,
Wayne Hilburn
0 Kudos
Message 1 of 5
(3,964 Views)

Hello Wayne,

Take a look at the Count Digital Events.vi shipping example.  You can find this in LabVIEW by selecting Help >> Find Examples... then browsing to Hardware Input and Output >> DAQmx >> Counter Measurements >> Count Digital Events.
If you set the "Count Direction" control to "Externally Controlled", you will be able to count up and down depending on which direction you rotate your encoder.  Make sure you wire Phase A to Ctr0 Source and Phase B to P0.6.  P0.6 is the up/down line for counter 0.

I hope this helps.  Please let me know if you have any further questions.

Regards,
Sean C.

0 Kudos
Message 2 of 5
(3,948 Views)

Thanks Sean,

I feel a little bit like an idiot, yes i can laugh at myself....

When I origionally tried the VI you suggested above, it didnt work properly.  However, after reading your post, I realized I was hooked into the PFI6 and not the DIO6 or P0.6 as you suggest.  It worked fine.  I will play with it to get the proper value when the count goes neg, right now its a very large number. 

do you have any suggestions toward the filtering question I originally posted?

Thanks,

Wayne

0 Kudos
Message 3 of 5
(3,944 Views)

Hi Wayne,

I apologize... I forgot to respond to your filtering question.

All counting is done in hardware, so using a filtering VI in software would not help in this case.  To stabilize your encoder signals, you will have to pass Phase A and Phase B through hardware low pass filters before connecting them to the counter source and P0.6.  You will need to build your own external filters to clean up your encoder signals.

I hope this helps.  Please let me know if you have any further questions.

Regards,
Sean C.

0 Kudos
Message 4 of 5
(3,942 Views)


Thanks again Sean,
I have referenced a bullitin in NI's website called "Using Quadrature Encoders with E Series DAQ Boards" , and it has the external hardware information I need. 



Take care,
Wayne


0 Kudos
Message 5 of 5
(3,939 Views)