08-20-2009 12:09 PM
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.
08-20-2009 12:22 PM
08-20-2009 12:53 PM
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?
08-20-2009 01:13 PM
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).
08-20-2009 02:01 PM
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.
08-20-2009 02:28 PM
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.
08-20-2009 04:26 PM
08-27-2009 03:22 PM
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.
08-28-2009 07:09 AM
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.
Try this and see if it helps.
08-28-2009 08:54 AM
Hi there all and aeastet, Thanks a lot. The fix works perfectly!! It saves us the effort in buying the optical isolator module!
Shyam.