LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform moving peaks for Line CCD Camera

Hi all
 
I use USB-CCD Camera and plot the waveform of signals. The waveform (amplitude vs. pixels) is shifting left and right. where I am confused is how to detect the moving peaks within labview. Also can I get the shift distance of a specific peak against the time? Thank you.
0 Kudos
Message 1 of 9
(3,658 Views)

Hi vonsin,

You can use the Peak Detector.vi to detect peaks in the input waveform. This is only one of the VIs that can do peak detection. If you search for the keyword "peak" in the functions palette, you will find other VIs that can do the same. I recommed that you look at the other VIs too. You can use a shift register to save the previous peak positions, so that you can calculate the time shift.

Please look at the attached example for one possible way of doing this. I simulate a random signal and detect the peak with the maximum amplitude then I track its location. The VI is written in LabVIEW 8.5. If you have any trouble opening it, please look at the screen shot of the Block Diagram.

Hope this helps.

Jaidev

 

 

Senior Product Manager
National Instruments
Download All
0 Kudos
Message 2 of 9
(3,634 Views)

hi, Jaidev

Thanks for your help. I can track the peaks in time-domain now, here I have another question. I am trying to use the shift of one selected  peak as feedback signal to my system. The system is basically similar to Mach-Zehnder interferometer(MZI). We put an actuator in one beam of the two arms of MZI. The feedback signal to actuator(peizo) is expected to stablize the shifting fringes of interferometer automatically. I know it should be easy. But as a new learner to Labviw, I am at a loss how to realize the feedback. Could you give some suggestions? thanks again.

0 Kudos
Message 3 of 9
(3,611 Views)

Hi vonsin,

The error in your peak position is your feedback signal. After appropriate scaling it can directly be used as the control signal for your actuator. How you actually apply your feedback will completely depend upon the type of device you are using for output and the input format for your actuator.

This is essentially a feedback system and you could consider using our PID toolkit for smooth control action.

Jaidev

 

Senior Product Manager
National Instruments
0 Kudos
Message 4 of 9
(3,592 Views)
Hello, Jaidev
You are right. The peizo controller unit I am using is provided by Thorlabs inc. (Model Number BPC201, it can be used in Labview with ActiveX technique). I tried several ways to scale the error before applying it to the actuator, but somehow it couldn't realize stablization function. One of my blocks diagram is attached below in wtry43, where I applyed the error directly to the actuator. Now we are trying another way that is to plot two waveforms in one graph with a given time delay and calculate phase difference(using extract single tone vi), then average the phase difference before using it as feedback. Still the problem with proper scaling of feedback signal is remained to solve. Further suggestions are appreciated.
 
vonsin
0 Kudos
Message 5 of 9
(3,575 Views)

Hi vonsin,

You could use the PID VI to control the actuator. By changing the individual gains, you can tweak the feedback to the actuator as desired.

Please read this article for more details on PID control:

http://zone.ni.com/devzone/cda/tut/p/id/3782

Thank You,

Jaidev

Senior Product Manager
National Instruments
0 Kudos
Message 6 of 9
(3,551 Views)

Hi vonsin,

You could use the PID VI to control the actuator. By changing the individual gains, you can tweak the feedback to the actuator as desired.

Please read this article for more details on PID control:

http://zone.ni.com/devzone/cda/tut/p/id/3782

Thank You,

Jaidev

Senior Product Manager
National Instruments
0 Kudos
Message 7 of 9
(3,551 Views)

@Jaidev wrote:

Hi vonsin,

You can use the Peak Detector.vi to detect peaks in the input waveform. This is only one of the VIs that can do peak detection. If you search for the keyword "peak" in the functions palette, you will find other VIs that can do the same. I recommend that you look at the other VIs too. You can use a shift register to save the previous peak positions, so that you can calculate the time shift.

Please look at the attached example for one possible way of doing this. I simulate a random signal and detect the peak with the maximum amplitude then I track its location. The VI is written in LabVIEW 8.5. If you have any trouble opening it, please look at the screen shot of the Block Diagram.

Hope this helps.

Jaidev

 

 


Hi Jaidev,

 

I am trying to use your "Detect Shift in Peak Position.vi" with my Thorlabs "LC1-USB" line CCD camera; to detect the max peak location.  I am using the the camera's drivers to output the data, but at driver (sub program) "LC1 Get Scan Data.vi" it gives me a error code (HEX 0xBFFC0002) and says "Parameter 2 out of range." 

 

Also I am going to use the corrected vi to find the max peak location every 1 mm for 25 millimeters and input the max peak locations into an array of data.

 

Below, is my vi and sub vi's.  If you cannot access my sub vi's please let me know.

 

If you of anyone else can help me fix my "Modified Detect Shift in Peak Position.vi."  I will be very grateful!!!

 

Thank you very much,

Michelle2607   

Download All
0 Kudos
Message 8 of 9
(3,013 Views)

hi

i am using this LC1-USB ccd .

i have fixed this error.

this is my code.

i hope that it could be useful

best regards

0 Kudos
Message 9 of 9
(3,006 Views)