Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring phase lag between two conters

Dear friends,

 

I am wish to meaure the phase lag (degrees) between two shafts that are connected to encoders. The encoder has two pulse outputs(A,B). i have USB6229, for counter measurements.

 

I need to measure the position lag of pulses from two conters. Please suggest the suitable way of proceeding to start the programming.

 

Thanks,

Kirupasankar S

0 Kudos
Message 1 of 2
(3,731 Views)

There's one simple answer (two-edge separation measurement coupled with period measurement) that gives excellent precision but which may not

be satisfactory due to a number of peripheral concerns:

 

1. Will the two encoders have the same nominal frequency?

2. Is there a way to fine-adjust the nominal phase relationship?  Are the encoders high-resolution?  You may find your nominal phase so

   near to 0 or 360 that mechanical dynamics push you across the boundary.  This would cause you to miss a two-edge measurement,

   so your two-edge data and period data would get out of sync.

 

 

A likely better approach which is less precise but more reliable is outlined below.

1. Configure 2 counters for angular position measurement. 

2. Create a dummy AI or AO task whose sample clock is routed for use as the counter tasks' sample clocks.

3. You might consider configuring the position tasks to use an "Arm Start" trigger, but it will probably not end up being relevant.  It's only helpful if you have done some

    *really* careful mechanical setup to establish a precise relationship between the A pulses of one encoder and the A pulses of the other.  This is rarely done.  The

    result is that there is some fixed phase offset between the two that is built into the mechanical setup.   So you'll end up needing to look for *changes* in phase from

    that initial nominal value.  If you're gonna subtract out the initial offset anyway, then it doesn't end up mattering so much if the two tasks are Arm Start triggered to

    begin simultaneously.

4. Start the counter position tasks first, then start the dummy AI or AO task.

5. Post-process the results.

 

-Kevin P.

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