Electronics > Projects, Designs, and Technical Stuff

4th order polynomial coefficients for pressure at temperature readings, Help!!!

<< < (3/12) > >>

Jay_Diddy_B:
Hi,

I am not sure that you have enough data.

If am reading the data that you provided correctly:

1) at 21C the device reads the nominal pressure and no correction is required.

2) at 0 pressure the device reads 0 at all three temperatures.

If I plot the error, that is the difference between the nominal reading and the measured reading, on a surface plot I get a shape which is twisted like a propeller:





I am not sure how you correct for this with a single polynomial.

Jay_Diddy_B

IanB:

--- Quote from: itsbiodiversity on August 18, 2020, 10:35:12 pm ---I am working with an instrument that contains an RTD to account for temperature in precise pressure measurements. The designer used a fourth order polynomial to calculate correction factors a0, a1, a2, a3, and a4. Pressure readings of a standard (STD) versus a unit under test (UUT) are taken at multiple temperatures (3 temperatures) related to an ADC Count Value (3 count settings, directly correlating to temperature). Pressure readings are taken from a low range to a high range at each temperature. Can anyone help direct me to how to calculate these coefficients? I can provide an excel sheet with data if it helps. Thanks so much.  Data presented below for copy/paste, but an excel sheet is shared below.  Any help would be appreciated.
--- End quote ---

This is a regression problem.

You have a measurement value compared to a standard (known) value.

Therefore your measurement error is:

   error = standard value − measurement value

Over the range of measurements you have an error function:

   error = f(T, P)

You want to fit a polynomial that best represents this error so you can apply it as a correction to the measured values.

You say the correction factors are a0, a1, a2, a3, a4, but you need to know the form of the polynomial before you can do anything.

I did a bit of experimenting in Excel and found a correction polynomial of this form was able to fit the error quite well:

   correction = (T-21) * (A + B*P + C*P*(T-21) + D*P^2)

However, this may not be the correction polynomial you have to work with. You need to know what it is.

Here is a chart showing the measurement error (blue bars) and the calculated correction (orange bars) that I obtained:

(A = 5.177e-5, B = -1.131e-4, C = 5.213e-6, D = 1.565e-6)


itsbiodiversity:

--- Quote from: DrG on August 19, 2020, 02:52:24 am ---
--- Quote from: itsbiodiversity on August 19, 2020, 01:34:12 am ---you are correct.  I find now the correction factors "go into a programmed" 4th degree polynomial.  I was very confused.  I am looking for correction factors for the uut to match std psi at any temperature.  I apologize for any miscommunication.

--- End quote ---

If I am understanding you, this is what you want to do.... You will collect UUT temperatures and you want to express them as STD temperatures. In order to do that, you will determine the function between the UUT temperatures and the STD temperatures based on the data that has already been collected [what is in the spread sheet], using a 4th degree polynomial. When you have determined that function, you will have the coefficients for the polynomial. With those, you can translate a UUT temperature to a STD temperature.


Now, when you have any UUT temperature, you can derive a STD temperature based upon the calculated relationship between the two using the sample points that were provided. (Please stop saying correction, but I know what you mean and you are not completely wrong)

So that I don't feel like I am, literally, doing homework for you, you should be able to figure out which coefficients go where  :)  I don't know where/how you enter the coefficients into whatever spreadsheet or quattro file or whatever, but you can run a number of sample point with a decent calculator or program and see if you are doing it correctly.

I understand the urgency, but I hope that you will give it more thought to get it straight what you are doing and why. Good luck and hope it helps.

--- End quote ---


Condescend much?  Especially while answering incorrectly. 

I am not looking for help with temperature information.  If you think I cannot calculate RTD coefficients then please pack it up.  And yes, I am using a previous manual that used the term "correction factor" - I spoke to the inventor yesterday who called it such.  I'm going to say I'm safe using the term as they invented and designed it to use "correction factors".  Please do not tell people how to speak - it's extremely condescending as well.


I am looking to correct the PRESSURE readings across the temperature spectrum.  I AM NOT LOOKING TO CORRECT THE RTD READING!  I am only looking to correct for pressure at the given temperatures.  There may be a specific formula used by the author of the unit that gave these "coefficients" a0 to a4 - I am going off of available information.  I've had three or four engineers look at this today and we all were lacking an answer.

itsbiodiversity:
Is this for the pressure readings over temperature?  The temperature and it's accuracy does not matter in this case - I am trying to tie factors to the pressure so that readings taken by a module at say 20 C are the same as measurements taken at 28 C.  I do know the data I presented was used by the original programmer to do the statistics.  I have attached an example with the columns and regression analysis.  Any help figuring out what a0 through a4 would be in a scenario like this would be appreciated.

Nominal Animal:

--- Quote from: itsbiodiversity on August 19, 2020, 08:10:52 am ---I am using a previous manual that used the term "correction factor" - I spoke to the inventor yesterday who called it such.
--- End quote ---
The naming depends on approach.

Because the device behaviour is almost linear (and often modeled as linear), it makes sense to call the adjustments necessary as correction factors.  This is the device-based approach.

When the behaviour is modeled using a polynomial (a quartic one, in this case: \$f(x) = F_0 + F_1 x + F_2 x^2 + F_3 x^3 + F_4 x^4\$), the parameters to be fitted are the polynomial coefficients (\$F_0\$, \$F_1\$, \$F_2\$, \$F_3\$, and \$F_4\$).  This is the measurement-based approach.

No need for anyone to get snippy, just because they're looking at the situation from different angles, and using different nomenclature because of that.


As a computational materials physicist, I do believe that in this particular case, it would be better to use a bivariate polynomial, rather than two separate polynomials (one for the RTD resistance-to-temperature curve, the other for pressure reading compensation as a function of temperature).  Essentially, you would have $$f(x, y) = \sum_{i=0, j=0} F_{i j} x^i y^j$$ where \$F_{i j}\$ are the coefficients fitted to sample data (via least-squares fitting; one of the easiest tools for this is Gnuplot), \$x\$ being e.g. the ADC reading for the RTD, and \$y\$ the ADC reading for the pressure sensor, and \$f(x,y)\$ yielding the normalized pressure.

Yes, I know: the original inventor didn't do it this way.  It does not matter.  It is a sensor combination whose behaviour is continuous and almost-but-not-exactly linear, and for this, the best model is a bivariate polynomial fitted to measured parameters, then verified that the fit looks sane (\$F(x, C)\$ and \$F(C, y)\$ look sane and predictable for all constants \$C\$), i.e. have the form predicted in literature.  This is very, very common in physics, and indeed in my own field, non-QM (AKA traditional potential model) molecular dynamics with millions of atoms and more, where the potential function has a form based upon theory and mathematical approximation, but the individual coefficients are fitted from real-world measurements.  (In particular, it is very common to use one set of coefficients when modeling surfaces, and another when modeling bulk properties.)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod