There I was looking at an uncertainty budget and a calculator used by my predecessor to convert all the measurements into a single format, °C in this case. But I didn’t like it as I didn’t understand it, so I pulled it out and tried to pull it apart to work out how and why it works. This is why documentation on how things work is so important and shouldn’t just be assumed that people will know what it does and how it does it.
This is what I managed to figure out. This takes two points and draws a straight line between them and then converts the measurement to the °C. This is totally wrong for thermocouples because the line isn’t straight. Though over short distances it would be ok if you used values that were close together. Otherwise, you get errors like the ones below.
I believe this is what some thermometers do, they look up the nearest mV/temp in a table and do some basic maths to fill in the blanks. Because in most cases the regular k-type thermometer display has only got a resolution of 0.1 or 0.01°C the rest is just noise. There are many other things that make k-type thermocouples a nightmare to the regular voltnut as the quality of the metals can cause dramatic differences in the specifications. I am interested only because part of my job as Head of Lab (HoL) doing 17025 calibrations for temperature simulation is that I want to reduce the UoM I have, which currently is quite high, and so gives me a challenge when you look at Decision Rules (like TUR).
This lead me down the path of looking at the NIST Temperature Tables which are based on ITS-90, the International Temperature Standard from 1990. There is plenty of information about that on the internet and the agreements they made. I still feel it needs work but there is not a lot of money for exciting futures in the subject so it's
possibly off to the side until someone can do something clever with reflected-sound-of-underground-spirits. I tried to look for online calculators for this, but I couldn’t find any and that annoyed me, so I looked at the Coefficients stated by NIST and in the Monograph 175 and tried to do the maths. I wasn’t prepared for the madness that is mathematics, I did some at school, but I am no way an expert at it. But through a few sources on the internet, I managed to get one to work that converts mV into °C which I was proud of myself until I spotted that the calculation has a massive amount of error compared to the NIST tables, 0.054°C at its worst but enough to annoy me.
Side notes if you see T
90 and t
90 they referred to K and °C respectively,
mV to °C
The above is the formula for calculating mV to °C. In basic terms is,
D
0+D
1*E+D
2*E
2+D
3*E
3+D
4*E
4+D
5*E
5+D
6*E
6+D
7*E
7+D
8*E
8+D
9*E
9Using the information from NIST,
https://srdata.nist.gov/its90/download/type_k.tab************************************
* This section contains coefficients of approximate inverse
* functions for type K thermocouples for the subranges of
* temperature and voltage listed below. The range of errors of
* the approximate inverse function for each subrange is also given.
* The coefficients are in units of °C and mV and are listed in
* the order of constant term up to the highest order.
* The equation is of the form t_90 = d_0 + d_1*E + d_2*E^2 + ...
* + d_n*E^n,
* where E is in mV and t_90 is in °C.
*
* Temperature Voltage Error
* range range range
* (°C) (mV) (° C)
* -200. to 0. -5.891 to 0.000 -0.02 to 0.04
* 0. to 500. 0.000 to 20.644 -0.05 to 0.04
* 500. to 1372. 20.644 to 54.886 -0.05 to 0.06
********************************************************
Inverse coefficients for type K:
Temperature -200. 0. 500.
Range: 0. 500. 1372.
Voltage -5.891 0.000 20.644
Range: 0.000 20.644 54.886
0.0000000E+00 0.000000E+00 -1.318058E+02
2.5173462E+01 2.508355E+01 4.830222E+01
-1.1662878E+00 7.860106E-02 -1.646031E+00
-1.0833638E+00 -2.503131E-01 5.464731E-02
-8.9773540E-01 8.315270E-02 -9.650715E-04
-3.7342377E-01 -1.228034E-02 8.802193E-06
-8.6632643E-02 9.804036E-04 -3.110810E-08
-1.0450598E-02 -4.413030E-05 0.000000E+00
-5.1920577E-04 1.057734E-06 0.000000E+00
0.0000000E+00 -1.052755E-08 0.000000E+00
Error -0.02 -0.05 -0.05
Range: 0.04 0.04 0.06
If you want to copy the formulas, I will attach the excel file for you.
While looking for the above information I found
Mosaic Industries else had published their calculator for reverse calculating the mV to °C and that is better as it has got the error down to 0.02°C. I also got this formula to work and it's okay but still, the ppb (parts per butterfly) voltnut in me doesn’t like it.
http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/temperature-measurement/thermocouple/type-k-calibration-tableBy now I was starting to question the idea of why I was doing this to myself but as with many of the rabbit holes that voltnuts/timenuts etc end up going down we don’t really know why we just go mad with the experience. I was starting to wonder which should be seen as the master mV to °C or °C to mV, this meant to truly know it I must solve the formula.
Looking at the °C to mV formula it’s a big old SUM thing with a small e thing that just makes me cry.
But thanks to the snake charmers I was able to find the formula in an accessible format,
https://learn.adafruit.com/calibrating-sensors?view=allE = sum(i=0 to n) c_i t^i
While still confusing there were hints,
Alternative form: C0 + C1*internalTemp + C2*internalTemp^2 + C3*internalTemp^3 + ... + C10*internaltemp^10 + A0*e^(A1*(internalTemp - A2)^2)
Now using the data from NIST,
************************************
* This section contains coefficients for type K thermocouples for
* the two subranges of temperature listed below. The coefficients
* are in units of °C and mV and are listed in the order of constant
* term up to the highest order. The equation below 0 °C is of the form
* E = sum(i=0 to n) c_i t^i.
*
* The equation above 0 °C is of the form
* E = sum(i=0 to n) c_i t^i + a0 exp(a1 (t - a2)^2).
*
* Temperature Range (°C)
* -270.000 to 0.000
* 0.000 to 1372.000
************************************
name: reference function on ITS-90
type: K
temperature units: °C
emf units: mV
range: -270.000, 0.000, 10
0.000000000000E+00
0.394501280250E-01
0.236223735980E-04
-0.328589067840E-06
-0.499048287770E-08
-0.675090591730E-10
-0.574103274280E-12
-0.310888728940E-14
-0.104516093650E-16
-0.198892668780E-19
-0.163226974860E-22
range: 0.000, 1372.000, 9
-0.176004136860E-01
0.389212049750E-01
0.185587700320E-04
-0.994575928740E-07
0.318409457190E-09
-0.560728448890E-12
0.560750590590E-15
-0.320207200030E-18
0.971511471520E-22
-0.121047212750E-25
exponential:
a0 = 0.118597600000E+00
a1 = -0.118343200000E-03
a2 = 0.126968600000E+03
I started work and got the basics working for negative numbers, and thanks to the Monograph 175 I was able to confirm my maths as that document has the temperature tables in µV rather than mV and to a few extra decimal places. I started on the next one, and for some reason the maths was wrong, and I couldn't get it right, then I went and had a cup of tea and then looked at it again and did a quick google for “natural logarithm constant” aka 2.718281828459 and that e started to make more sense. Got it working and decided to generate myself a table with all the voltages calculated in 0.01°C this I plan to use to make some sort of look-up table and select the nearest mV to the 0.01°C, I might even take it to 0.001°C
From -200 to 0°C
C
0+(C
1*t
90)+(C
2*t
902)+(C
3*t
903)+(C
4*t
904)+(C
5*t
905)+(C
6*t
906)+(C
7*t
907)+(C
8*t
908)+(C
9*t
909)+(C
10*t
9010)
And the 0 to 1372°C is more complicated due to magnetic issues.
It’s the same as the above but you don’t need the C10 instead, you add
(A
0*2.718281828459^(A
1*(t
90-A
2)
2))
I still must work out how I am going to use this in my calculations, but I feel I at least have a chance to get it right. It might be worth noting that I haven’t gone down the route of calculating the CJC (Cold Junction Correction) that is because the bit, I have for work is using a simulated CJC or 0°C. I hope this helps the next person that gets the itch and falls down the rabbit hole.