LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

data fit from a 2D calibration field

Dear Experts,

 

during sensor calibration pressure (P) and temperature (T) values from a sensor are read by a software.

The sensor values are some unit less digital numbers ... lets call them raw-values.

The result of such a calibration is a map, such as

 

Praw_1/Traw_1 ... Praw_2/Traw_1 ... Praw_n/Traw_1

Praw_1/Traw_2 ... Praw_2/Traw_2 ... Praw_n/Traw_2

            ...                           ...                         ...

Praw_1/Traw_m ... Praw_2/Traw_m ... Praw_n/Traw_m

 

For each measured P-T-combination, the real existing pressure value (e.g in hPa) is also recorded with a calibrated sensor.

 

The idea is to use such a calibration map in later measurements, to calculate the existing pressures.

 

I guess there is some 2D data fitting / interpolation involved here, and CVI seems to not really supporting these.

 

Note that the Praw / Traw values may differ from each other ... e.g.: Praw_1 is unqual Praw_2

 

Any idea?

 

Could LabViews 2D interpolation do the job, or would this have constrains regarding the Praw / Traw values?

 

Best regards,

Philipp

 

 

 

0 Kudos
Message 1 of 4
(285 Views)

@der_Phil wrote:

Could LabViews 2D interpolation do the job, or would this have constrains regarding the Praw / Traw values?


If the question is about LabVIEW, it probably belongs into the LabVIEW forum? (I can move it for you if you want)

 

Interpolation has nothing to do with fitting, it just fill in the blanks space between real data. If the surface can be described with a known model, you could do a 2D nonlinear fit instead and reduce it to a few parameters. Maybe a 2D polynomial is sufficient? Can you show us a typical surface? How much noise is in the data?

0 Kudos
Message 2 of 4
(270 Views)

Thank you for the reply:

 

[...]  If the question is about LabVIEW, it probably belongs into the LabVIEW forum?  [...] 

 

Well, since I am using CVI/Labwindows for me the question is LabWindows related. In other words: The problem at hand is for LabWindows, I just found a LabView function that seems promising. If useful, the LabView function would have to be made available as a *.dll for LabWindows ... which would be a different question. Reading some posts about this I know it should be possible, but I would not know how to do that...I never used LabView.

 

Example:

Please find attached an example image.

The resulting grid in this case can almost - but not quite - be described by a simple plane.

 

Interpolation vs data fit:

I guess, what I want/need is some sort of function  P = f(P_raw, T_raw).

The function should calculate   P_i = (P_raw_i / T_raw_i) exactly.

In other words:   If P_raw / T_raw from the calibration are entered into the function, it should calculate the exact P-values from the calibration.

 

[...] Interpolation has nothing to do with fitting, it just fill in the blanks space between real data [...] 

But is data fitting not just doing the same with a different approach?

E.g.: After performing a data fit one can calculate values in blank space between real data (?) ... one just get different values?

 

Best Regards,

Philipp

0 Kudos
Message 3 of 4
(229 Views)

My text programming years where from the early seventies the mid nineties when I permanently switched to LabVIEW, but your problem really has nothing to do with any specific programming language. It's a purely mathematical.

 

Fitting a surface in requires a model and the final surface might not even go exactly through all the points. (A plane in 3D can be described as z(x,y)=ax+by+c, and you could go to higher orders (e.g. z(x,y)=ax+by+cxy+dx²+ey²+f) and so on. Basically the entire plane is reduced to a small set of parameters (a, b, c, d, ... etc.), even if you fit a million points. More complex planes (e.g. the surface of a sphere, might need a parametric model or a different coordinate system). Most physical processes are not jagged, so fitting to a model will account for outliers and replace them with a better value even at coordinates where a measurement exists. (In LabVIEW, the code would be simple (example), but I cannot help you with CVI)

 

Interpolation retains all existing points, even if some are outliers due to noise or measurement errors. I just fill the data in the gaps according to some model based on the nearest measurements (e.g. closest, bilinear, spline, etc.)

0 Kudos
Message 4 of 4
(209 Views)