LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Non lineair calibration of signal

Solved!
Go to solution

Hi,

I have a rather complex question... at least i think it is. I've solved this once way back in LabVIEW 7. But when i look at my old vi's i can't recall what i did.

The problem: I have a large set of data let's say 4000 samples, my data should go from 10Volts to -10Volts but my recorded data goes from 12,8Volts to --6,4Volts, i can use a lineair calibration, with a calculated gain and offset:

Offset = (12,8 + -6,4) / 2 = 3,2
gain = (10 - -10) / (12,8 - -6,4) = 1,041

applied for max value: 12,8 - 3,2(offset) * 1,041 (gain) = 10
applied for min value: -6,4 -3,2 (offset) * 1,041(gain) = -10

 

See example:

 

But now i know there is a way to do a non-lineair calibration with more data points let's say 5, i thought it was something with a polynomal fit, but i can't rember...

 

Does anyone know how to do that?

 

Best regards,

Thijs

0 Kudos
Message 1 of 9
(3,182 Views)

Hi Thijs,

 

you could use a LUT (look-up table) from your 5 samples and Array-Interpolation functions to "scale" your measurement values.

 

Or you use the polynomial fit function on your 5 samples to calculate polynomial coefficients and apply them on your measurement data. The GeneralPolynomialFit function comes with an example in the example finder…

Best regards,
GerdW


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

Okay, but where do i place the polynomial function in my given "lineair calibration" example?

 

I have 4000 samples and only 3 to 5 fitting points...

 

Best regards,

Thijs

0 Kudos
Message 3 of 9
(3,153 Views)

Hi Thijs,

 

please convert your VI to LV2011 to get an answer…

Best regards,
GerdW


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

Here is a version 2011

 

Thanks for your help!

0 Kudos
Message 5 of 9
(3,141 Views)
Solution
Accepted by topic author ThijsBoeree

Hi Thijs,

 

this way:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 9
(3,138 Views)

Do you mean with the XY values, the one that it should be and the raw one...?

0 Kudos
Message 7 of 9
(3,134 Views)

And what is the name of the VI you are using...?

0 Kudos
Message 8 of 9
(3,133 Views)

Thank you so much, i figured it out!

 

Best regards!

Thijs

0 Kudos
Message 9 of 9
(3,127 Views)