Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

sspp07

Member

07-12-2018 09:12 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Labels:

Hello,

I am Physicist. I am currently working on the project where, I have to measure laser beam width using second moment width formula (4* Sigma). I did using 86% (1/E^2) method. but it's not give a correct and accurate plot when beam is not circular. Also it's not ISO Standard method to measure laser beam width.

Here, I have uploaded my work.

Please if anybody previously work on this kind of project, guide me through this problem. I just need little bit guidance.

Solved! Go to Solution.

altenbach

Knight of NI

07-12-2018 11:11 AM - edited 07-12-2018 11:14 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

What do you think should the "accurate" plot" look like?

Do you have a link describing the formulas used?

(codewise:

- "Index array" is resizeable
- There is no need for the local variables, just use a wire
- None of your sequence frame serve any purpose. Why are they there?
- Your while loops should be FOR loops because the number of iterations is known before the loop starts
- You can use autoindexing on the 2D and transposed 2D array inputs, no need to measure the size.
- Is this really typical and good data?
- Since x of your xy graphs is equally spaced, all you need are plain waveform graphs.
- Why is there so much duplicate code? Can't you re-use some of it?

)

07-12-2018 11:33 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hello Altenbach,

Thank you so much for really quick reply.

I understood all your questions regarding the old code. I will remove all the duplicating stuff and also clean up code later.

I just attached this code to give an example what I did in past.

Basically this code generate the output like attached file.

Here, I also attached the link for second moment waist calculation.

I have also one more question,

Do you have any idea about integration of waveform. how we can integrate the waveform?

Thanks

Download All

Virus scan in progress. Please wait to download attachments.

Kyle97330

Active Participant

07-12-2018 11:37 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

I'm not sure why you're using the 1/e² method if you're supposed to use the d4 Sigma method. If you use d4 Sigma, all you need to do is calculate the centroid first, and then the diameter is derived by summing the square of the distance from each point of the image to the centroid, multiplied by the intensity at that point. The entire summation is then divided by the total power (energy) of the beam, and the square root of that value is multiplied by 2 times sqrt(2).

dσ = 2 * SQRT(2 * SUM [((x - xc)² + (y - yc)²) * p(x,y)] / I)

where xc and yc are the coordinates of the image centroid, p(x,y) is the intensity at location (x,y), I is the total intensity of the image, and SUM is taken over the total image area.

Because the d4 Sigma Diameter measurement uses the square of the distance from the centroid, background noise can have a significant impact on the calculation. Therefore, it is extremely important that a background subtraction or other noise removal feature be used with the d4 Sigma Diameter measurement.

07-12-2018 11:41 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hello,

I am totally agree with you. That's exactly what I have to do.

Only, thing is I need little bit suggestion how can i perform this task in labview. i.e. Small example, or similar calculation example.

Can you explain me through small vi?

If it's possible.

Thanks

Solution

Accepted by topic author sspp07

Kyle97330

Active Participant

07-12-2018 02:01 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Generally I find that when converting a formula to a LabVIEW expression, there are generally two ways:

1. Follow PEMDAS except instead of doing a calculation, drop a node and wire it. Done properly this ensures you don't forget anything.

2. Use a formula node (or expression node if it's very simple) and just write it out, with slight modifications to match the allowed formatting.

So in your case, if you have a 2D array of intensities, you'd probably pass it into 2 nested FOR loops to get x and y from the iteration terminals and p(x,y) from the scalar out of the array auto-index terminal, and that gives you everything you need for the elements inside the square brackets. Then, out of each loop, put in a "Add array elements" node to sum rows and then columns, and do the final calculations on the sum.

07-12-2018 02:22 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Thanks. I will try to follow this steps if I faced any problem will let you know.

Thank you so much for help.

07-13-2018 02:31 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hello,

Here, I have attached my VI. As per your suggestion I made it.

Could you please check it and let me know, did I solved correctly or not?

Thanks

Kevin.MN

Member

07-16-2018 06:03 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

It looks like it will work from a quick once-over. I would verify it gives the expected results before putting it to use. Are there any sections you are particularly concerned about?

Cheers.

Kevin S.

Technical Support Engineering

National Instruments

Technical Support Engineering

National Instruments

altenbach

Knight of NI

07-16-2018 10:52 PM - edited 07-16-2018 10:55 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@sspp07 wrote:

Could you please check it and let me know, did I solved correctly or not?

There are some serious race conditions due to blatant overuse of local variables. You are dreading from and writing to the same local variables in parallel, but the result critically depends on the order of operations. You can eliminate all of them! None of your sequence structures are needed. All your controls belong before the loops.