LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY plot data interpretation

Hello,

I am trying to manipulate some of the data gathered by my program. My goal is to take the resulting "parabola like" graph and project lines along each of the two arms. I then have to see where they intercept along the x-axis and find the distance between them. after i will show the resultant number on a meter on the front panel. Please see the pictures i have posted for more clarification, the screen capture of the front panel is the resultant XY graph, the two signals on the right are the x and y axis's data represented in a wave form. The picture of the plot in excel is essential what i am trying to do. I do not need to show the lines, i just need to find the slope of the left arm and the slope of the right arm, find where they intercept x and then calculate the distance between them.  

 

Kind regards,

 

Beginner2020_0-1596121762337.png

Beginner2020_1-1596121812479.png

 

0 Kudos
Message 1 of 9
(2,135 Views)

Hi beginner,

 

some easy steps:

Find the minimum point of the curve

Get a subset of the plot data left and right of the minimum.

Do a 1st order interpolation on both subsets to get the parameters of the desired lines.

Use simple math to find the crossing point of both lines...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(2,124 Views)

Im trying to find the appropriate functions in the block diagram to accomplish this, i do not want this done in excel. is there a function i can use to easily find the bottom most point? then to also find the left and right hand side? 

 

regards,

0 Kudos
Message 3 of 9
(2,121 Views)

Hi,

 

Try finding the array max and min vi, in the Array tool pallet. That will get you both the min value and its index in the array.

 

Then use the linear fit vi in the Maths > Fitting pallet to fit a linear function to each arm.  That will return the slope and intercept of each line.

 

Then use maths to get the intercept.

 

Good luck

 

 

0 Kudos
Message 4 of 9
(2,098 Views)

This is my block diagram (see picture) i cant find a way to separate the graph into its left and right hand sides. 

Beginner2020_0-1596137481497.png

 

0 Kudos
Message 5 of 9
(2,054 Views)

What do you mean by Left and Right hand sides?

 

  • The extra wire branches on the waveform that stop at the sequence structure.  Get rid of them.
  • Index Array is resizable.  No need to copy it and wire up a 0 and 1 to get two waveforms.  Drop one, drag the bottom border downwards.  Now you'll have two outputs that are automatically index 0 and 1.
  • Delete the sequence structure.
  • There is no point multiplying something by 1.
0 Kudos
Message 6 of 9
(2,045 Views)

i have the multiplication by 1 just as a scaling, i would some times change it to 0.5 or 2 if i wanted to increase the size,i ts not their permanently. Here is the re wired diagram, now when i say 2 half's i mean that i want to separate the data on my XY plot and find the slope of each line. Maybe separate was not the right word. maybe the following pictures will help...

Beginner2020_0-1596139174907.png

Beginner2020_2-1596139296003.png

 

Beginner2020_1-1596139226126.png

 

The excel is an example of what i want to do, my goal is to find out where the projected lines intercept the x axis, then find the distance. 

0 Kudos
Message 7 of 9
(2,041 Views)

I'm sorry, when the new messages popped up, I didn't see the previous ones that showed the graph that described the right vs left.

 

You can use array subset of your original data (or waveform subset) to get just the respective sides.

But the tricky part is determining where each side begins and ends.  You could start by finding the lowest Y value and make that break point.  But it looks like you want to eliminate some of the points that are down in the valley of the overall graph.

 

So exactly where along the side would you consider the start of the side, and where do you consider part of the valley?  If there is some mathematical relationship, you can apply that to your data to determine which indices meet the conditions.

 

0 Kudos
Message 8 of 9
(2,032 Views)

I was thinking along the lines of RavensFan before I got to his last message.  I agree that the tricky part is how to decide which data to consider *representative* of both the left and right legs.

 

It looks to me like you have a lot of data points with a decent amount of high freq noise (possibly random) such that the raw graph makes a pretty fuzzy curve.   However, the general trend of the data appears pretty linear except near the turnaround point.

 

Here's the kind of thing I'd start inspecting over several runs of fairly typical data:

 

1. As already recommended, start by finding the index of the minimum value.  Due to the noise in the data, this may not be in the middle of the turnaround area.  That's one of the things to account for.

2. I'd use that index to split the data into left leg and right leg.

3. I'd then start by retaining only the first 50% of the left leg and the last 50% of the right leg.  With only this limited amount of data, far from the curvature of the turnaround point, I'd see what kind of results I got (slopes, intersection points, difference of intersection points).

4. I'd then further iterate and increment the %age until I got all the way to 100%.

5. With your large # of data points, you'll probably see very little difference from retaining 50% of each leg vs. 75% of each leg.  There *should* be a noticeable difference when you retain all 100%.  Somewhere in between is where the curvature starts to distort your results.

6. As you repeat this over a number of your data sets, you'll be able to develop some justification for choosing the %age of data to retain rather than merely estimating by eyeball.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 9 of 9
(1,989 Views)