12-07-2007 11:51 AM
12-11-2007 10:21 AM
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
12-12-2007 02:33 PM
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.
12-13-2007 05:32 PM
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
12-15-2007 01:13 PM
12-17-2007 11:46 PM
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
12-17-2007 11:46 PM
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
04-07-2011 03:34 PM
@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
04-08-2011 12:37 AM
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