09-17-2008 12:57 AM
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
09-17-2008 07:20 AM
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.