LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LABVIEW and Encoder Products Model 121 shaft encoder

Hello all,

 

I am having difficulties with the interface between LabView and a shaft encoder (Encoder Products Model 121 with 360 counts per revolution).  When the shaft is turned one full revolution, LabView will read 2 or 3 counts from the Z pulse wire (when it should read one) and ~2400 counts from the A pulse wire (when it should read 360).  I connected the encoder outputs to an oscilloscope to verify that the encoder was outputting the proper number of pulses, which it was.  However the pulses were hardly square waves, and the signal was a bit noisy.  Has anyone had any experience with these problems?  Is there a way to clean up the signal?  I am using a PCI-6052E board, which I heard may present some difficulties.

 

Thanks for any advice you have.

0 Kudos
Message 1 of 11
(4,842 Views)
I have a few machines with these ecoders on them. I have the 121 that has 2540 counts pre revolution. First it is nice if you have a data acquisition card with quadrature sampling built in. We use the USB-6211. It does a fine job of counting. Second you will need to know if you bought the open collector , push pull or line driver mode of the encoder. It sounds like to me that you have a sinking input so you are going to have to provide 5VDC and sink it to get the proper steps. I hope this helps.
Tim
GHSP
0 Kudos
Message 2 of 11
(4,840 Views)

If you go to the website you can pull off a spec sheet that allows you to put together a part number for the order. You can use this to get all of your information from the part number. It should tell you the model 121-N-A-5-01-S-0256-Q-OC-1-S-N.

 

121 is the model number

N is the communication (4 pole, 6 pole, 8 pole, 12 pole)

A Hosing mounting style

5 is 5 vdc or 12 vdc power input

01 is bore size

S is the operating temp

0256 is the cycles per revolution (important)

Q number of channels for quadrature (important)

OC is Open collector or Push Pull or Line Driver (important)

1 is max frequency could be important if you are rotating fast.

 

Get this information and you will have every thing that you need to start your project.

 

Are you connecting this to a display of some kind or going directly into the break out board?

Tim
GHSP
0 Kudos
Message 3 of 11
(4,825 Views)

Thanks for the quick response.  I believe we have the line driver version of the encoder.  We are providing it with +5V DC from a regulated power supply (to the white wire, which should be power).  Were you referring to sinking a different source?

 

Another thing I forgot to mention is that the LabView counter ocassionally does not recognize the signal from the encoder at all (it doesn't count when the shaft is spinning).

0 Kudos
Message 4 of 11
(4,818 Views)

We had to sink the signal to get the correct pulses for our application. This would mean that you have to hook up a 5 VDC signal to your encoder pulse of the encoder along with the power to the encoder to start. So you would have to hook up five volts to one side of the pulse generator and use it kind of like a relay. When the encoder pulse is high it would sink the 5 VDC to 0 VDC. This is where you get the nice square waves that you are expecting. See the circuit below.

 

If you are using 5 VDC using the V=IR the resistor that you would need to use would be 250 Ω or greater since the max output is 20 mA for this device.

Tim
GHSP
Message 5 of 11
(4,807 Views)

You can also try to see if the encoder output was directly connected to the daq, the encoder's power supply common was attached to the daq's digtal ground, and the daq input was floating. In this situation you would be able to see your pluses too.

Tim
GHSP
0 Kudos
Message 6 of 11
(4,803 Views)
I really appreciate the help.  I will try your suggestions and report back on what I've found.
0 Kudos
Message 7 of 11
(4,792 Views)

Thanks for your suggestions, we were still a little unclear as to what exactly sinking the input means. I am attaching a diagram here that shows our setup. The 5V power supply is connected to the encoder which gives out 3 sets of differential line driver outputs (A,A',B,B',Z,Z'). So far we were trying to connect the Z output to the source pin of a counter to count the one per rev pulse but were oberving random increments in count which  as you have suggested is due to the floating output. So if we connect a 250ohm resistor across the A pulse and the common ground (common to power supply, encoder and DAQ), would this be correctly sinking the output. Would this give us a clean square wave that can be counted.

Thanks, shyam.

0 Kudos
Message 8 of 11
(4,730 Views)

To sink a source means that you supply a power to the contact. In this case we supply 5Vdc to the encoder pole so that every time the pole is passed it sinks or draws down the voltage to zero.

 

undefined

 

Try this and see if it helps.

Tim
GHSP
0 Kudos
Message 9 of 11
(4,717 Views)

Hi there all and aeastet, Thanks a lot. The fix works perfectly!! It saves us the effort in buying the optical isolator module!

Shyam.
0 Kudos
Message 10 of 11
(4,707 Views)