Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

pulse train from encoder

Hi,

I am attempting to generate a pulse train to trigger a camera using an X4 quadrature encoder with A, B and Z index, the Ni 9401 and the NI 9172 chassis. My encoder generates 2500 pulses per revolution but I need a pulse train of 5 pulses every revolution to capture 5 images evenly spaced on my rotor. I want to capture these five locations for every revolution. Any help would be greatly appreciated

0 Kudos
Message 1 of 4
(6,076 Views)

I don't know that particular cDAQ hw, but here's a starting point that oughta work with any of the counters I know of.

 

The idea is to trigger off the Z-index so you can set the phasing of the N pulses/rev.  The initial delay is set to this phasing value, while high and low time split the available "ticks" needed to generate N pulses per rev.  I've assumed that the 2500 pulses per rev is the post-quadrature resolution, such that ch A and B each have 625 cycles/rev.

 

Below is a LV 2010 snippet:

 

-Kevin P

 

trig divide down encoder.png

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 4
(6,059 Views)

Hi,

Thanks for your reply. This almost achieves my objective. Could you please give me a definition of each of the terms in the code listed below and what values to put in them if I want to get 5 evenly spaced pulses per revolution and my encoder generates 2500 cycles per turn.

- Pulses per revolution to generate:

- # revs worth of pulses

- Phase relative to Z (units of Cycle A)

- Cycles of Ch A per revolution

0 Kudos
Message 3 of 4
(6,051 Views)

I also have a problem with the pulse duration. I get one big pulse and multiple smaller pulses of differing periods. It might be connected to the inputs into the code

0 Kudos
Message 4 of 4
(6,049 Views)