LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analysis of XY Graph data

Hello all, I have a rather perplexing problem that seems like it should be rather simple to solve. So far, it has proven to be anything but!

I am acquiring an array of DBLs and I need to extract several measurements. I've created a graph of displacement vs. angle, and I need to find key displacements and their associated angles.One of the problems is that I can't be sure that the operator is always going to start the measurement in the same place, so I don't have a definitive start point. All I can do is make them zero the rotary stage, which only means that the degree value will be zero, but the displacement will be arbitrary.

 

What's happening here is a probe is measuring feature height/depth on a part as the stage rotates. The small dips I want to reject/ignore are holes and the large dips are grooves that mark the spaces between the features I'm measuring.

 

I've attached an image of the plot and there are a few things to note:

  1. The cursors are bracketing the first area of interest, I need to find the peak and the lowest point before the sharp drop-off.
  2. As I said, I can't be 100% sure of a consistent starting point for the graph, other than degree value.
  3. There are smaller dips in the displacement between the large dips that need to be ignored.

There will be different numbers of features depending on part type. I know the angles and heights of the features, so I have things to compare against. My problem is finding a way to determine the start and stop points (I can then easily grab the indexes from the array) as well as reject the dips caused by the holes. Right now I'm looking at the percentage change from point to point after I grab a selected chunk of the data. I've been able to get the start point, but now I'm stuck.

 

Am I making this harder than it needs to be?

 

Any and all help is appreciated!

 

0 Kudos
Message 1 of 23
(3,951 Views)

I'm not sure I understand your problem, so let me re-state what I think I understand and we'll get it figured out.

 

 

--- You have a rotary stage (platform).

--- You can measure the position (in degrees, relative to some arbitrary start point) at any time.

--- You're placing parts upon this stage, at some arbitrary angle.

--- You can measure the height of this part, which I presume is really the distance from the part to a sensor above the part.

 

 

My problem is finding a way to determine the start and stop points

 

Judging strictly from your graph, can't you establish a threshold of say, 0.0  or -1.0 and look for the first (last) height that is above that threshold and call that the start (stop) ?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 23
(3,931 Views)

Things to consider:

 

1... You can use what I call en-masse operations to simplify things. if you have an array of DBLS for example, and a single constant threshold with a value of -1.0, then if you compare the array to the scaler, you get an array of booleans, one for each array element, that tells you that this element is greater than the threshold or it's not.  If you then search the array for a TRUE, you have the index of the leading edge of the part.  Search from that index forward for a FALSE, and you have the index of the hole, or maybe the trailing edge of the part.

(Yes, you can do the same thing with a FOR loop, but this is simpler).

 

En Masse operations

 

2... You say you're plotting X-Y data, but you also say you're acquiring an array of DBLs.  "An array" implies a singular array, so this is not clear.  Are you measuring the stage angle, or not?  If not, how are you generating the X of the X-Y plot?

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 23
(3,923 Views)

What you summarize is basically correct, although the sensor in this case is a probe in contact with the surface of the part.

The problem with the threshold approach is twofold. Firstly, the height I'm looking for is not relative to the lowest point on the graph, it's relative to the peak. Secondly, the threshold value for the stop point has to be some percentage value less then the peak to avoid finding a false minimum in the smaller dip.

0 Kudos
Message 4 of 23
(3,919 Views)

Yes, I am measuring the stage angle and plotting it as the X axis. I have one array of DBLs for the displacements and one for the angles. See my previous post for the difficulty with the threshold value.

0 Kudos
Message 5 of 23
(3,916 Views)

The problem with the threshold approach is twofold. Firstly, the height I'm looking for is not relative to the lowest point on the graph, it's relative to the peak.

 

Hmmmm.  You can't apply a threshold until you know the peak, and you can't know the peak until you know the whole part has been scanned, and you can't know the edges of the part unless you have a threshold.

 

Is that the circle you're chasing?

 

If so, it seems odd that you can't apply SOME sort of threshold to detect the leading / trailing edges of the part.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 23
(3,903 Views)

Secondly, the threshold value for the stop point has to be some percentage value less then the peak to avoid finding a false minimum in the smaller dip.

 

 

Why does it have to be a percentage?  Perhaps it could be an absolute number (0.3 mils or whatever in your picture).

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 7 of 23
(3,895 Views)

Yes, that's my merry-go-round, so to speak.

This is analysis that's being done after the data is collected, using values read from a part configuration file. The code I have written so far seems to be doing a fair job of finding the start point, and I think that if I choose the threshold values carefully I can get the rest of it.

0 Kudos
Message 8 of 23
(3,894 Views)

Judging by your picture, the slope of the leading (trailing) edge is a LOT steeper than the slope of the legitimate holes, or the artifacts.

Suppose you forget percentages and just go by absolute numbers (I'll assume you're measuring mils, though it doesn't matter).

 

Go through your displacement array, and calculate dY/dX (change in displacement vs. change in angle).

 

That produces an array of slope values.

 Find the MAX (positive) and MIN (negative) of that array.  The positions of the MAX and MIN are the indexes for the leading and trailing edges, are they not?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 9 of 23
(3,890 Views)

True, the leading and trailing edges are much steeper. But, they're outside of the regions of interest so finding where they lie only gets me the start point and the final end point. The image I've attached here shows what amounts to (on this part type at least) the areas I'm concerned with.

0 Kudos
Message 10 of 23
(3,874 Views)