Showing results for 
Search instead for 
Did you mean: 

Align Two Signals and Measure the Phase Shift

Go to solution

Here. You can also post VIs to the Version Conversion Board to get them converted.



0 Kudos
Message 11 of 14

Thank you!

Although it turned out not to be the thing I was hoping for, maybe you could help me with my problem.

I'm trying to use a USB-6215 to measure a 50 Hz signal. The thing i s that I then want to, at a certain phase angle, send out an digital signal to stop the signal. With the very basic knowledge I have, I'm not getting it to work at proper speed. When I'm trying to stop the signal by simply comparing it to another value, it seems to be too slow and stops at different levels each time.


0 Kudos
Message 12 of 14

You may need to post your VI so we can see what is going on.


However, it is likely that the primary problem is that OS latencies will prevent you from doing what you want. Consider the timing: Your signal is 50 Hz => period = 20 ms. If you want a phase angle resolution of 36 degrees (1/10 of a cycle), then you need to generate the digital signal with a resolution of 2 ms.


What are the tasks required to do this? 

1. Acquire the 50 Hz signal with enough resolution to measure the phase as required. Probably sample at 1 kHz or faster.

2. Read a group of samples. - Requires OS action - USB port access.

3. Analyze samples.

4. Calculate desired digital pulse (DO) timing.

Time required for 3 and 4 depend on number of samples and the nature of the calculations and may be microseconds to milliseconds.

5. Write the DO line. - Requires OS action - USB port access.

6. Note that the USB-6215 has only software timed DO.


The items marked "- Requires OS action - USB port access." will have jitter and latency depending on what the OS decides to do at any given moment. Using desktop operating systems typically results in latencies of a few millisceonds to occasional hundreds of milliseconds.


The short answer is that you are unlikely to be able to reliably get the performance you want with that device and without a real-time operating system.



0 Kudos
Message 13 of 14

Thank you for answering.

As of now I don't have a code, since all things I've tried failed!

Ok, I didn't realize it would be that slow. But maybe i'll give it try anyway 🙂

But to do that, I need a convient way to determine the maxium/minimum value of a sine curve, where the start of that signal might not be zero. I.e I don't know where the first sample will be on the curve. Any ideas?

0 Kudos
Message 14 of 14