LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with ultrasonic waves and phase difference

Hi all, I am using LabView as part of my mechanical engineering course. I have a project where I must use ultrasonic sensors with LabView. The end result would be to sweep through frequencies (approx. 39.5 - 41.5kHz) sending a signal (sine wave from LabView) to the ultrasonic transmitter, the ultrasonic receiver will then receive this wave out of phase (from theory). The wave received from the receiver will then be captured in LabView and the phase difference (angles or radians) will then be measured.

I have gotten help to make certain elements of my vi so far. However I have encountered difficulties, and after long research and no closer to a sloution. I would greatly appreciate anyone who could offer help or expertise in this matter.

Attached are two vi's, the first is using simulated sine waves (where a phase difference can be entered and it is then calculated). This vi also also allows for a begin and an end fequency, where a time and increment can be entered accordingly. For it's purpose this works without problems.

 

The second vi is essentially the same but with DAQ assitants in place of simulated sine waves.

This vi does not work the main problems are:

 

 The received signal, A/I, has only a fraction (approx. 0.1) of the amplitude of the A/O sine wave.

 For anyone familar with ultrasonic sensors, i also experience the entire sine wave transitioning up and down.

 This problem could be causing the entire program to not produce a phase difference, as the waves don't match in terms of amplitude.

 

 Can anyone offer a solution as to why the amplitude difference? IF it is to be expected with ultrsonic sensors is there any way of increasing this amplitude on the  

 received wave in LabView.
 Can anyone tell if, the amplitudes did match could this program calculate the phase difference with an actual wave from the sensor. Would noise be an issue?

 

 Any other improvements or ideas would be appreciated, my main dilema is time to get this task done, having only started with this program recently.

 

 The card I am using is the PCI-6221

]

 Regards.

Download All
0 Kudos
Message 1 of 4
(3,295 Views)

That your read signal don't have the same amplidute is a expected result...

Best practice: Use the best fitting input range of your DAQ , think about nyquist (aliasing filter) and sample as fast as you can (in respect of SNR)

Search for signal normalisation , there is a vi that does the job for you.

 

 I would use SAM(sinus approximation method)  to determin the phase of such a signal. SAM is pretty robust to noise and the phase resolution can get very high 🙂

If output und input is from the same clock you can do a 3 parameter fit (Offset, amplitude,phase) otherwise add frequence as a 4th parameter.

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 2 of 4
(3,251 Views)

Dear Jack

 

Have a look at the solution within this forum post:

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=360256&requireLogin=False

 

This is using a DAQ assistant and calculating phase different, taking into account interchannel delay. 

 

 

I have also included 2 VI's for you to try. The first one named 'Phase difference between waveforms' is an efficient form of calculating the phase difference normally between two waves. (Obviously with the same amplitude) The 'Correct phase for inter channel delay' is again using DAQ assistants to calculate the sine waves and then calculates the phase difference between the two waves. Please let me know how you get on and hope this helps.

Many thanks for using the NI forums and I look forward to your reply.

Kind regards

David

Applications Engineer
National Instruments UK
Download All
Message 3 of 4
(3,244 Views)

Thank you both for your replies and suggestions. I am uncertain as to whether or not I will get to use the equipment again before christmas due to my schedule, but I will try and comprise a vi in the meantime. I will get back to you letting you know how I get on. Thanks again for all your help.

Kind Regards,

Jack

0 Kudos
Message 4 of 4
(3,227 Views)