LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to tell if line is straight

 

I want the opinion of others as to the best way to approach this situation.

Is there a way to tell if a line is straight using LabVIEW function? Can you provide an example? 

 

 

I have attached four images of results I am getting. The straighter the line is, the better the result are.

 

Image A is good and mean the test should pass.

Image b is kinda bad.

Image C is bad.

Image D is very bad.

 

 

 

Thanks!!

Download All
0 Kudos
Message 1 of 4
(3,301 Views)

Hey,

 

you could calculate the slope from the some datapoints and then check if all following datapoints are within a specific range around the calculated "ideal" curve.

 

Regards,

CMW...

0 Kudos
Message 2 of 4
(3,292 Views)

Hi finger,

 


The straighter the line is, the better the result are.


Then you need to define a "number of quality" to express that straightness!

 

Some thoughts:

- You can use a polynomial regression function on your data (using atleast order 2). When the square/higher term(s) exceed a limit the line isn't straight enough…

- In your image(s) you don't define the Y scale as linear or logarithmic. That might be of interest here…

- From your "good, bad, and ugly" description it seems you want a "straight" line to be flat (meaning a slope around zero). Is that what you want?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 4
(3,284 Views)

Start with Help>> Find examples and look into "Robust linear fit.vi"

 

Once you've done that you may have already answered your own question.... Or you may have found some new questions to ask.  But, do try starting there.Smiley Wink


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 4
(3,272 Views)