PRT: Error Propagation - Callendar Van-Dusen - Page 1
Forum section: electronics / general

author: okti
author_rank: Contributor
timestamp: November 16, 2021, 04:31:20 pm
content: Hey everyone! My daily job is a software engineering but I do love electronics and spend too much time and money on it! I’m currently working on several libraries in Python just for fun. Some are in early stages, some are pretty advanced.Now my problem is how to calculate the error propagation from calibration pairs, pass it through model and factor in the resistance measured uncertainty into final RMS error in C/K.Callendar Van-DusenCalibration pairs all with uncertainty:Code:Temperature(0.0 ± 0.012, unit: .celsius)ElectricResistance(100.0 ± 0.001, unit: .ohms)Temperature(100.0 ± 0.019, unit: .celsius)ElectricResistance(138.50 ± 0.001, unit: .ohms)Temperature(-200 ± 0.03, unit: .celsius)ElectricResistance(18.53 ± 0.001, unit: .ohms)Temperature(600 ± 0.08, unit: .celsius)ElectricResistance(313.65 ± 0.001, unit: .ohms)I can calculate this model:Code:A = 3.9078333333333335e-03B = -5.783333333333349e-07C = -4.166666666666635e-12r0 = 100.0Then I can calculate the temperature from resistance using this model:Code:// T > 0Z1 = -AZ2 = pow(A, 2) - 4.0 * BZ3 = 4.0 * B / r0Z4 = 2.0 * Bcelsius = (sqrt(Z2 + Z3 * resistanceOhms) + Z1) / Z4But what is the uncertainty after the calculation?Searched the internet for clues but no luck.These were my reads so far that were helpful:-https://www.gilsoneng.com/reference/rtdinfo.pdf-https://www.itsirl.com/images/references/datasheets/1399021951CalVan.pdf-https://doi.org/10.1080/23311916.2018.1558687-https://www.ele.uva.es/~lourdes/docencia/itl/Data_Sheets/Sensors/Pt100.pdfMaybe you can point me at your own methods used in your lab or some non-paywalled literature?(Side note: I have the same problem with ITS-90 coefs but the library is in early stages, still didn’t figure out the coefficients fitting but I’m slowly getting there.)Thank you for reading this and considering help!

author: MaxTesla
author_rank: Contributor
timestamp: November 16, 2021, 05:10:38 pm
content: Hey,so i am no expert in programming (so no help to be expected there) but i use this tool for uncertainty propergation:https://www.metas.ch/metas/en/home/fabe/hochfrequenz/unclib.htmlThis is a free tool from the swiss national laboratory (METAS) which they use themself. I am using it on a regular basis with Matlab, so no experience with Python, but there is a library for it.I meet the guy who did the software, very nice dude. The have there own forum for specific questions related to the UncLib.This tool can do some fancy stuff including error propergation and error budgets. It does Monte Carlo as well, but i didn't touch it till now.BR,Max

author: okti
author_rank: Contributor
timestamp: November 16, 2021, 06:23:59 pm
content: Quote from: MaxTesla on November 16, 2021, 05:10:38 pmOh wow, this tool is superb!Why not open sourced is beyond my comprehension.I guess I can write to the author and ask for help or access to codebase.Thank you so much Max!

author: mzzj
author_rank: Super Contributor
timestamp: November 16, 2021, 07:45:11 pm
content: Lets start with the easy stuff:Fiqure out sensitivity factors from ohms to degrees at each calibration point so that you can combine the uncertainties.You can derive the equations or just "step" the ohm value like 138,5 and 138,6 ohms. dT/dRLets say you have 2.8 Cel/Ohms sensitivity at 100Cel = 0.001 ohm*2.8 Cel/Ohms = 0.0028 Cel uncertainty from resistance measurement and 0.0190 Cel from reference temperature.RSS together and you get 0,019205 Cel combined uncertainty.Pain in the butt comes when you attempt to interpolate between calibration values (I think you don't have enough many calibration points to even start with)Unless you are math genius you probably get results easiest by calculating one set of values for example every 10 ohms, introduce known error at one of the calibration points and recalculate the values every 20ohms.Repeat for other calibration points and plot the differences between the curves.For ITS-90 the BIPM has the holy bible of them all:https://www.bipm.org/documents/20126/41773843/Guide_ITS-90_5_SPRT_2021.pdf/c4bbbe56-4118-eef7-47cb-3ea234db40b8Section 6 deals with error propagation between calibration points and it looks like lots of fun!

author: okti
author_rank: Contributor
timestamp: November 17, 2021, 08:18:37 pm
content: QuoteThank you @mzzj! This is sort of like my approach now. It's logical, it seems to make sense and the results are believable but would feel better to link to some literature for sanity sake.This is how I do it now (this is pseudocode):Code:T // calculated temperature kelvin using CVD// Get two calibration points encompassing the measured temperature:pointLower // Pair T,R below measuredpointHigher // Pair T,R above measured// Resistance error in measurementdR = measuredResistance.uncertaintyrMinus = measuredResistance - dRrPlus = measuredResistance + dRtMinus = calculateTemperatureCelsius(from: rMinus) + 273.15 // using CVDtPlus = calculateTemperatureCelsius(from: rPlus) + 273.15 // using CVDuncertaintyFromMeasuredResistance = max(abs(T-tMinus), abs(T-tPlus)) // is this correct approach?// Temperature error in calibration pointsdifferenceOfTemperature = temperatureHigher - temperatureLowerslopeOfUncertaintyPerTemperature = (temperatureHigher.uncertainty - temperatureLower.uncertainty) / differenceOfTemperatureuncertaintyFromCalibrationTemperature = temperatureLower.uncertainty + (slopeOfUncertaintyPerTemperature * (T - temperatureLower.quantity))// Resistance error in calibration pointslowerRError = uncertaintyFromResistance(at: pointLower)higherRError = uncertaintyFromResistance(at: pointHigher)slopeOfCalibrationResistanceErrorPerOhm = (higherRError - lowerRError) / differenceOfTemperatureuncertaintyFromCalibrationResistance = lowerRError + (slopeOfCalibrationResistanceErrorPerOhm * (T - temperatureLower.quantity))// how `uncertaintyFromResistance(at:)` is calculated:R = point.resistance.quantitydR = point.resistance.uncertaintystep = 0.001rMinus = R - steprPlus = R + steptMinus = calculateTemperatureCelsius(from: rMinus) + 273.15tPlus = calculateTemperatureCelsius(from: rPlus) + 273.15tChange = tPlus - tMinusslope = tChange / (step * 2.0)uncertainty = slope * dR// finally:error = sqrt(pow(uncertaintyFromCalibrationTemperature, 2.0) + pow(uncertaintyFromMeasuredResistance, 2.0) + pow(uncertaintyFromCalibrationResistance, 2.0))As you can see I'm using sensitivity everywhere and just approximate the uncertainty linearly between two nearest calibration points.This is not ideal but I don't see how I can guess what is happening with uncertainty gradient between points, this is the best I've got so far.Example results:Code:Temperature(0.0 ± 0.01, unit: .celsius)ElectricResistance(100.0 ± 0.0017, unit: .ohms)Temperature(100.0 ± 0.019, unit: .celsius)ElectricResistance(138.50 ± 0.0022, unit: .ohms)Temperature(uncertainQuantity: -200 ± 0.03, unit: .celsius)ElectricResistance(18.53 ± 0.0005, unit: .ohms)Temperature(uncertainQuantity: 600 ± 0.08, unit: .celsius)ElectricResistance(313.65 ± 0.0067, unit: .ohms)// Generated coefficients:A 0.0039078333333333335B -5.783333333333349e-07C -4.166666666666635e-12Measured resistance: 119.40 ± 0.002 (ohms)Result:50.0146 ± 0.0162 (celsius)

author: mzzj
author_rank: Super Contributor
timestamp: November 18, 2021, 04:23:25 am
content: Quote from: okti on November 17, 2021, 08:18:37 pmSome further readinghttps://www.isobudgets.com/how-to-calculate-sensitivity-coefficients-for-measurement-uncertainty/http://download.flukecal.com/pub/literature/3084747_6203_ENG_B_W%5B1%5D.pdf

author: mzzj
author_rank: Super Contributor
timestamp: November 18, 2021, 04:52:06 am
content: Quote from: okti on November 17, 2021, 08:18:37 pmYou can "step" the R0 value for example and see what happens with the calculated temperature.0.1 ohm step at 0 Cel calibration would be equal to 0,255 Cel error at at 0 CelBUT the error is multiplied/compounded/propagated to bigger value when you move up in temperature as the R0 is always involved in the calculation.Here is example pulled from "my" PRT calculator: (it uses CVD coefficients matched to this particular probe so your results might look slightly different)R0 100,0 ohmref ohm uut error0,0000 100,000 0,0000 0,000030,16544201 111,77407 30,16544201 037,15656518 114,48628 37,15656518 060,16327607 123,36780 60,16327607 090,28305371 134,89336 90,28305371 0121,1740922 146,59404 121,1740922 0140,2327223 153,75231 140,2327223 0190,4062961 172,37592 190,4062961 0599,9394029 312,40000 599,9394029 0R0 100,1 ohmref ohm uut error0,0000 100,0000 -0,254682474 -0,25468247430,16544201 111,77407 29,87795905 -0,28748295737,15656518 114,48628 36,86143028 -0,29513490560,16327607 123,36780 59,84282395 -0,32045212690,28305371 134,89336 89,92913568 -0,353918034121,1740922 146,59404 120,7854622 -0,388630014140,2327223 153,75231 139,8224743 -0,410247922190,4062961 172,37592 189,9383748 -0,467921227599,9394029 312,40000 598,9514612 -0,987941663at 600 celsius the measurement error at 0 cel has been multiplied to 4x larger error.

author: TUMEMBER
author_rank: Regular Contributor
timestamp: November 18, 2021, 11:21:04 am
content: Do you have the individual characteristics of your sensor determined or do you only "assume" that it is compliant with the normalized?Sorry, I use google translate and it may come out with "wild translations".

author: okti
author_rank: Contributor
timestamp: November 18, 2021, 06:34:10 pm
content: Thank you @TUMEMBER! What's the software generated this file?Thanks again @mzzj!- R0 error propagation is kinda easy and solved using sensitivity at measured temperature times absolute error.- measured R is solved by calculating temperature at R+error and R-error and picking the larger one (tested it and it works)What is more complicated and not exactly solved is this:Code:// CALIBRATION DATA// temperature resistance0.0 ± 0.01 100.0 ± 0.0017100.0 ± 0.019 138.50 ± 0.0022-200 ± 0.03 18.53 ± 0.0005600 ± 0.08 313.65 ± 0.0067What is the uncertainty added by error of temperature and resistance at calibration points?So my current approach is just calculating slope between nearest points and sliding between uncertainties, thus:- At 0C the uncertainty added from calibration point is 0.01- At 50C the uncertainty added from calibration point is 0.0145- At 100C the uncertainty added from calibration point is 0.019It kinda makes sense but seems way too simplistic for this purpose, Fluke disagrees with me and calls it reasonable:QuoteAnother solution (not tested yet, but soon!) is to use modified values (both temperature and resistance!) to "skew" the CVD coefficients and use them to calculate the caused error at measured point.The only downside is that the temperature calculator will be dependent on CVD model creating component... Not exactly clean code.WDYT? Makes sense?

author: mzzj
author_rank: Super Contributor
timestamp: November 18, 2021, 07:43:36 pm
content: Quote from: okti on November 18, 2021, 06:34:10 pmThis was more or less my idea. Yeah its kinda complicated but the alternative is headache from maths.IMO this is all still sort of theoretical: Your calibration points are too sparse to tell much anything.I'd calibrate the PRT on something like 3 points below zero and 4 or 5 points above zero. Fit the CVD coefficients to that and only after that you have some sort of idea how well the PRT interpolates.Industrial PRT's have all sort of wonkiness in the curve and there is no way to tell what the error would be for example at +350celSPRT(Standard Platinum Resistance Thermometers) are totally different construction and made of high-purity platinum and even with them there is lot more calibration points used normally.(And CVD is a bad match for SPRT, you should really use ITS-90 equations with these)

author: mzzj
author_rank: Super Contributor
timestamp: November 18, 2021, 08:06:11 pm
content: Here is difference between "ideal" ITS-90 reference function and attempted CVD fit to the data:There is a reason why ITS-90 reference function is 9th or 12th order polynomial and not 2-order CVD!

author: TUMEMBER
author_rank: Regular Contributor
timestamp: November 18, 2021, 09:59:09 pm
content: You have assumed that the CvD is an exact mapping of the R / t conversion to ITS-90. It's not like that. It's just an approximation for the convenience of presenting on the digital meter directly in the "degrees". Very inaccurate metrologically, sufficient for industry.Only sporadically industrial Ro sensors have 100,000 ohms. Usually it is different and you need to know it. 99.994 or 100.05 ohms. The A, B and C coefficients also differ from the "ideal" ITS-90. The constant for conversion is not linear but "S".Without determining the "sensor constants" at the fixed points (cells), the actual characteristic cannot be matched to the ITS-90.Bez wyznaczenia "stałych czujnika" w punktach stałych (komórkach) nie można dopasować rzeczywistej charakterystyki do ITS-90.Unless I misunderstood your needs and that was not what you meant.

author: okti
author_rank: Contributor
timestamp: November 19, 2021, 07:37:42 pm
content: Agreed, CVD is definitely not made for SPRTs. We are talking about converting R to T using calibrated industrial IEC751 Class A pt100. But still I would want to be able to estimate the error the proper way.My current CVD coef. generating implementation is not using any fitting (not sure CVD is accurate enough to use such big guns?), it's just a simple method calculating from TL+RL, TH+RH, T0+Ro, T100+R100.There is separate ITS-90 drama to be unfolded soon as a separate topic but this time it seems to be A LOT of literature. I feel like I'm getting there with the CVD and then will switch to ITS-90.

author: mzzj
author_rank: Super Contributor
timestamp: November 20, 2021, 07:44:39 am
content: Quote from: okti on November 19, 2021, 07:37:42 pmProper way?Easy:Do a calibration at couple of points and use the IEC751 error limits. Yes, the error margin is huge but it already accounts most of the error sources from the IPRT.Hardcore: test dozen of IPRT’s from different manufacturers for stability and hysteresis, anneal the best ones above projected temp range. Calibrate at 10 different temperatures and curve fit error correction to your result or fit to ITS-90. Use the stability, hysteresis and curve fit residual errors to calculate your uncertainty.You can get approx 20mK…30mK accuracy over limited temperature range tested and characerized that way.-80 to +250 cel would be acceptable range for GOOD IPRT but I’m yet to see IPRT that is stable above 300 cel.You really need wound-type IPRT to attain any sort of accuracy, Film type PT100 sensors have too much hysteresis.https://www.pentronic.se/wp-content/uploads/2019/05/15-2-what-affects-a-pt100-sensors-precision.pdf

author: mzzj
author_rank: Super Contributor
timestamp: November 20, 2021, 08:03:34 am
content: https://isotech.co.uk/wp-content/uploads/2020/09/changes-to-the-international-standard-for-industrial-prts.pdf

author: okti
author_rank: Contributor
timestamp: November 24, 2021, 10:29:52 am
content: Thank you @mmzj @TUMEMBER!Maybe you have any PRT/SPRT calibration reports handy? Especially for extreme sub ranges like 13.8033 K to 273.16 K or 0 °C to +961.78 °C.That would be immensely valuable as test data: measurements at FP, coefficients and tables.Again, thank you so much.

author: mzzj
author_rank: Super Contributor
timestamp: November 24, 2021, 12:30:00 pm
content: Here is actual calibration data from one IPRT (wound type, selected per my earlier post)REF UUT UUT2 Error(curve fit residual error)-79,42000 68,3822 -79,419 0,001-59,99330 76,2044 -59,993 0,000-40,23530 84,0984 -40,234 0,001-19,95850 92,1408 -19,956 0,0030,010000 100,0051 0,011 0,00149,98850 119,45203 49,990 0,00299,99600 138,58865 99,999 0,003150,00450 157,40899 150,006 0,002200,00200 175,91577 200,005 0,003249,92720 194,0912 249,930 0,003UUT2 is calculated from ITS-90 reference function and two (a4,b4) correction coefficients for <0cel and three coefficients (a7,b7,c7) for >0Cel.As can be seen the residual error is very small.It looks like this was not even optimum fit for data. I think I used same coefficients as previous year as the error was rather small.

author: TUMEMBER
author_rank: Regular Contributor
timestamp: November 24, 2021, 05:18:08 pm
content: Quote from: okti on November 24, 2021, 10:29:52 amFor this lower temperature range, different types of sensors (different design and materials) are used as for temperatures "positive" to -200 degrees Celsius. Measuring temperatures above 500 degrees with a "low temperature" sensor generally causes a strong shift of the Ro point. This is not the case, read the technotes on the ISOTECH website.https://isotech.co.uk/products/isotech-model-909/https://isotech.co.uk/products/semi-standard-prts/Compare the essential difference between the 935-14-95 L and H versions.They (SPRT) can have a resistance of 25.5 ohms or even 0.1 ohms for temperatures above 700o Celsius. These sensors are not identical to the banal industrial IPRT sensors in the "sputter" thin film version.Do you work in a lab. industrial, or lab. primary or secondary? Perhaps you crush the copy by 1 mK and 100mK is enough for you. on the sensor and in the uncertainty budget + - 0.5 K

author: okti
author_rank: Contributor
timestamp: November 26, 2021, 10:06:51 am
content: One take away here is that I went overboard with estimating uncertainty propagation for CVD. Not needed really, CVD is not uniform enough for it to matter except for some really botched calibrations. Over-engineered it at best BUT! BUT! it was fun indeed!I can now confirm the CVD is functionally closed. The code is still a bit raw.(guys who helped me here: go ahead and share your github handle , I will share the source code with you)It's still not ready to be public but working on it.Thank you guys.Now moving on to ITS-90 - oh boy, the sensitivity calculations for fixed points and SRI are fun! 🙂

author: TUMEMBER
author_rank: Regular Contributor
timestamp: November 26, 2021, 11:58:20 am
content: Well, you've come to the turning point - the Needs Assessment, not the Dreams Assessment. Now there is a way to the Opportunity Assessment and it's ready