LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vi for an optical cable encoder?

Hi im am fairly new to DAQ on labview and i have an optical encoder which pulses every 0.5 degree (so 720 pulses in one rev), it is attached to a scb68 connector block which is attached to a PCI 6111S card via a cable.
 
Is there a specfic example that i could look at to get the hang of things? i want the counter for the pusles to reset itself after every whole revolution. any suggesstions would be most grateful.
 
Thanks
 
Notay
0 Kudos
Message 1 of 6
(3,046 Views)
The examples that ship with LV illustrate how to use the counters.

In terms of the reset, do you want to reset every 720 pulses, or once a rotation - the two are subtly different. You can take the count out from the counter and do a MOD 720 function and use the remainder output. This will give an output that restarts every 720 pulses. The one potential problem is that the reset point will not be in the same place relative to the shaft position from one run to the next - but this might not be an issue.

The other way to do the reset is to use an encoder that has two outputs, one (as in your case) every 1/2 degree of rotation; and one every 360 degrees of rotation. You can then use that once-per-revolution output to reset the counter in hardware. Plus, you can align that mark to some known position like TDC (top dead-center) so the counter output can tell you the shaft's absolute rotational position.

One thing to be on the look out for is that the counter inputs can be very particular about the input waveform. Make sure the signal at the computer is a nice, neat square wave. No undershoot, no overshoot, and no ringing.

Mike...

Message Edited by mikeporter on 07-24-2007 05:50 PM


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 6
(3,038 Views)

Hi mike thanks for your reply.

I think my encoder has two outputs, one for every half degree and i think the other one would be useful for the TDC, would this sort of thing be hard to implement in labview as i am fairly new to it?

by the way what exactly to you mean by MOD 720?

thanks for all your help and i will reply back when i have more information about the encoder, as i have to speak to my supervisor.

Notay

0 Kudos
Message 3 of 6
(3,029 Views)
A MOD function is to divide a number by another number and only return the remainder. So MOD 720 would divide the count by 720 and return a remainder which by definition will be between 0 and 719.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 6
(3,024 Views)
Also, be careful of the width of the once per revolution pulse. If it is greater than 1/2 degree of rotation, the reset will last longer than one of the incremental pulses. In this case you will need to do some kind of edge triggered reset. I saw this happen many years ago. I do not know whether modern encoders avoid this issue or not.

Lynn
0 Kudos
Message 5 of 6
(3,008 Views)

Hi thanks for your reply,

i seem to be having a slight problem with the scb68 and pci 6111s card. the encoder has 2 outputs; one pulse every 1 full rev and pulses every 0.5 degree.

the problem is on the scb68 there are 2 inputs for the counting, when i have one of the outputs plugged in one of the terminals, it works. however when i have both of them plugged in on the two seperate terminal channels, i get 2 counters pulsing at 0.5 degree, i do not get the pulse counting every 1 full rev, i do not understand, i have checked it with MAX but the problem persits there so it cannot be my code, but could be the card or device.

any suggestions?

thanks

Notay

0 Kudos
Message 6 of 6
(3,003 Views)