LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to continuously measure the distance between two line profiles?

Hello,

 

I am working on a project where I am using two laser sensors, one at the top and one at the bottom. There is a conveyor line exactly between the sensors, and a continuous rubber strip is placed on it, whose thickness I would like to measure. I want to display it on a graph and also numerically, if possible. 

I have attached a zip file that includes the code and an image that shows what I am trying to do. To get the thickness, my logic is that I basically have to calculate the distance between the line profiles which I want to show in the third blank graph. The code that I had earlier written for the calculation, you can see in the second image.

However, the result that I got with this code doesn't make any sense at all. Could anyone give me any hints of a better way to calculate this? 

Download All
0 Kudos
Message 1 of 7
(3,782 Views)

Cross post: https://forums.ni.com/t5/Real-Time-Measurement-and/How-to-continuously-measure-the-distance-between-...

 

If you have a graph on the screen you can get X,Y data out by right clicking and selecting export.

 

Your excel table doesn't seem to take into account the X data. Is that your intended behavior? If so, check out this code:

Example_VI.png

0 Kudos
Message 2 of 7
(3,732 Views)

I understand your code and it gives me the desired results perfectly too, thanks!

But this will work after I gather all my data and then do the calculations, right? I would like to calculate the thickness variation in real time (when the lasers are powered on and the material is moving, I would like to see the thickness variation as a single line simultaneously). How do I go ahead with that? Use bundle and build array and then  the same logic as you have used?

Also, I have attached the data from the two sensors (graphs) I am getting. Just one question about that, similar to the one which you had mentioned in your previous comment. I basically have X and Z data from the graphs. X is the length of the beam falling on the material and Z is the height. For calculating average thickness variation, my idea was to consider a particular window of X data, say 5 points (I have highlighted in the excel file), for both the sensors and then make the calculation with the corresponding Z co-ordinates. But I cannot think of a way to do this calculation in real time. 

0 Kudos
Message 3 of 7
(3,717 Views)

Please find the highlighted window of points here.

0 Kudos
Message 4 of 7
(3,715 Views)

How about this:

Distance measure3.png

Message 5 of 7
(3,698 Views)

Hello nanocyte,

 

This already looks good. I am going to be away from work for a day or two. I will implement this in my code as soon as I return and get back to you. I am pretty sure it will work.

Many thanks.  

0 Kudos
Message 6 of 7
(3,682 Views)

This works perfectly. Thank you!

0 Kudos
Message 7 of 7
(3,660 Views)