LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keeping Two Counters 90 Degrees Out Of Phase

I am attempting to imitate a quadrature encoder and as a base have used this example code

 

https://decibel.ni.com/content/docs/DOC-11954

 

I find this code works acceptably at low frequencies on my x6343, but when the frequency rises above say, 20 hz, the two pulses begin to slide into phase. This gets worse as frequency increases. However there does not seem to be much drift, so i am assuming the problem is to do with the delay at the start of the VI.

 

Is there any way I can get around this, or is it an insurmountable obstacle? Can I use hardware timing to avoid it?

0 Kudos
Message 1 of 2
(2,015 Views)

That example assumes that number of samples /4 is a reasonable approximation of 90deg (and it is to some extent)  It sounds like you are seeing quantization error.  try scaleing the sample rate and number of samples to maintain a multiple of 4 samples per cycle.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 2
(2,001 Views)