10-17-2020 03:51 AM
Hi everyone, I made this script on labview which shows the temperature values calculated with the use of a multimeter and a calibrator. These values are stored in an array and plotted on an XY graph to obtain the calibration curve.
Now note the curve and the vectors, how can I calculate the gain, offset and non-linearity errors?
10-17-2020 04:04 AM
Your VI (this is not a script!) makes little sense, for example if there is a permanent error, your while loop cannot be stopped. We also don't have any of the subVIs. Does it work correctly?
I assume you are talking about the xy data exiting the FOR loop. We don't have that data. Can you include it?
I assume you want to do a linear fit, so have a look in the math...fitting palette. How do you define non-linearity errors?
10-17-2020 04:16 AM
I have already tested the VI and it works perfectly. I have not entered the data in the arrays because I need to perform a new calibration test.
On output on the XY graph I get a linear curve, could you be clearer about the errors?
10-17-2020 04:23 AM
@giu95se wrote:On output on the XY graph I get a linear curve, could you be clearer about the errors?
Well, once you have actual data, just do a linear fit. Do you have problems with that?
You said you wanted to measure "non-linearity errors", but you didn't say how you define that term. Please do.
10-17-2020 04:38 AM
what do you mean by term?
On the output XY graph I already have a linear curve why should I fit it?
10-17-2020 04:44 AM
@giu95se wrote:On the output XY graph I already have a linear curve why should I fit it?
To get the slope and offset.
10-17-2020 05:34 AM
these are the values i got, i hope the setting is right, now how should i proceed?
10-17-2020 06:42 AM
OK, so now you have a linear fit, something your original VI did not include. It's difficult to tell anything from a picture of a front panel.
@giu95se wrote:
... now how should i proceed?
What other items are in the requirements document?
10-17-2020 09:40 AM
what elements are you referring to? I have to calculate gain error, offset error and non-linearity error.
How can I do with this model? What else do i need? Or what else would you need to see?
10-17-2020 12:34 PM - edited 10-17-2020 12:36 PM
Ah, OK. When you said:
@giu95se wrote:
Now note the curve and the vectors, how can I calculate the gain, offset and non-linearity errors?
This sentence was ambiguous! You actually meant "...gain error, offset error and non-linearity", already having the gain and offset. You still have not defined what you mean by "non-linearity".( If you suspect some curvature, you could see how much the fit would improve by adding a quadratic term, for example.)
There are plenty of hits when using a google search for e.g. "linear fit slope offset error". for example this document gives you some formulas. Have you tried implementing them?
You can also use "Linear Fit Intervals VI" To further analyze the fit. Try it! Do all points have the same error in Y? Can we assume that X is error free?