Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading simulated encoder with 6602

Hello!
 
I'm trying to read quadrature encoder (to be more specific this is an output of the pulse train generator that simulates the encoder).
In the attached picture you can see how the signal that i'm trying to read.
 
I need an advise about the correct filter settings.
Please also see the attached vi.
 
Usefull data:
Labview 8.2.1
Capturing device PXI-6602.
The Encoder is 16384 pulses. (If the reading is x4, i should get 2^16 - 65536 ticks).
The Encoder has differential outputs, but i've connected only A,B and Z.
The rotating speed is up to 5000 rpm. You can see in on the picture. (16384*(5000/60)=1,365,333MHz).
 
  • There is no problem to read the encoder with another devices, i have a motion analyzer from Control&Robotics solution and it works great.

Thank you.

Elman Izia.

 

 

Attachment 001.jpg (78 kb)
Attachment Position capture.vi (171 kb)

0 Kudos
Message 1 of 4
(4,040 Views)

Hi Elman,

 

I am unsure want you would like to accomplish?  Are you just trying to read in the value from an encoder? 

 

There are some shipping examples that will help you read in the values from your encoder. 

 

NI Example Finder >>Hardware Input and Output >> Counter Measurements >> Position >> Meas Angular Position-Buffered-Cont-Ext Clk.vi

 

If you are trying to read at a rate of 1.36533MHz, then you might want to use another counter to generate a sample clock.  Otherwise you are limited to the 80 or 20MHz clocks.  If you use a second counter, you will be able to generate the exact frequency that you would like.

 

Here is a document that will help you connect the differential outputs of your encoder to your PXI-6602.

 

 

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
0 Kudos
Message 2 of 4
(4,016 Views)

Hello Rob,

Thank you for the reply.

The purpose of my test is correct measurement of the encoder, and the ability to aqcuire the measured data to the PC.

What is unclear to me, is why the 80Mhz frequency could be not enough to filter the 1.33Mhz pulse train? The minimal pulse width that i'm expecting is 1/(1.33MHz/2)=3.8e-7sec. According to the 6602 manual the minimum pulse width can be up to 1e-7sec.

There is a difference between filtering the input and sampling the data, filters should come before the sampling data. Please take a look at the attached vi. 

 Izia.

0 Kudos
Message 3 of 4
(4,009 Views)

Hi Elman,

The filter clock is used to make sure that your signal has integrity and eliminates glitches.  In order for signal to be counted, it must remain high for two consecutive periods of your filter clock.  There are five time bases (5us, 1us, 500ns, 100ns and programmed) that can be used as your filter clock.  The programmed clock can be created by another counter and this setting will let a signal be counted if it is at least twice times the filter period.

This is a great method to help eliminate errors that can be introduced by noise, crosstalk or transmission line effects.

The TimebaseSrc property is going to select a clock to be used as the source.  In your example that property is correct, you would want to use the 80MHz clock.  The TimebaseRate property is going to be used to divide the clock down to specific frequency.  It will divide the master clock down by an integer value and round it to get a rate that is as close to the value entered.  I would recommend leaving this number as 80MHz. 

The MinPulseWidth property is going to determine the clock of the filter clock.  This property is going to use the TimebaseRate property to create the predefined filter clock settings.  If your signal stays high for two consecutive periods of the minimum pulse width, then it will be counted. 

You need to determine the minimum pulse width that is acceptable for your application.  Since your signal has a pulse width of about 360ns, you might want to use the predefined filter clock of 100ns.

In short, you are creating a digital filter that will only allow a signal to be recognized if it remains high for two consecutive pulses.

For further explanation, refer to the PCI/PXI–6602 User Manual page 3-20.

http://www.ni.com/pdf/manuals/322137a.pdf

 

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
0 Kudos
Message 4 of 4
(3,989 Views)