A dive into K-Type Thermocouple Maths - Page 1
Forum section: electronics / general

author: mendip_discovery
author_rank: Super Contributor
timestamp: June 22, 2022, 08:22:39 pm
content: 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'spossibly 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 T90and t90they referred to K and °C respectively,mV to °CThe above is the formula for calculating mV to °C. In basic terms is,D0+D1*E+D2*E2+D3*E3+D4*E4+D5*E5+D6*E6+D7*E7+D8*E8+D9*E9Using 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.644Range: 0.000 20.644 54.8860.0000000E+00 0.000000E+00 -1.318058E+022.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+000.0000000E+00 -1.052755E-08 0.000000E+00Error -0.02 -0.05 -0.05Range: 0.04 0.04 0.06If you want to copy the formulas, I will attach the excel file for you.While looking for the above information I foundMosaic Industrieselse 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=allQuoteWhile still confusing there were hints,QuoteNow 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-90type: Ktemperature units: °Cemf units: mVrange: -270.000, 0.000, 100.000000000000E+000.394501280250E-010.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-22range: 0.000, 1372.000, 9-0.176004136860E-010.389212049750E-010.185587700320E-04-0.994575928740E-070.318409457190E-09-0.560728448890E-120.560750590590E-15-0.320207200030E-180.971511471520E-22-0.121047212750E-25exponential:a0 = 0.118597600000E+00a1 = -0.118343200000E-03a2 = 0.126968600000E+03I 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°CFrom -200 to 0°CC0+(C1*t90)+(C2*t902)+(C3*t903)+(C4*t904)+(C5*t905)+(C6*t906)+(C7*t907)+(C8*t908)+(C9*t909)+(C10*t9010)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(A0*2.718281828459^(A1*(t90-A2)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.

author: binary01
author_rank: Contributor
timestamp: June 23, 2022, 11:00:14 am
content: Yes, thermocouples and EMF is quite a rabbit hole for the electrical metrologist! I have recently been through a similar journey to gain accreditation for calibration of thermocouple scales by electrical simulation (mV EMF <> temperature conversion).I certainly avoided any consideration of linearly interpolating between tabled values (as you note, the scale is non-linear and this approach will introduce error). Instead I only consider conversion using the ITS-90 functions published by NIST (Monograph 175), or actually in my case I refer to EN 60584:2013, which based on the same coefficients. The functions are high-order, but once you have them established and validated in your code, they are not so badIn my calculation of results and uncertainties, I need to be able to easily determine EMF for a given temperature (forward direction), temperature for a given EMF (inverse direction), and Seebeck coefficient, and do so interchangeably without loss of fidelity. As stated in the reference documents, the inverse direction functions are imperfect and there are additional errors to consider - these can add up and compound, so you should take care to minimise the number of times the inverse direction functions are used in any single chain of calculations.Personally I don't use the inverse functions, and instead I calculate the inverse direction by solving the forward direction functions iteratively until I converge on the result with insignificant residual. I wouldn't enjoy doing it manually, but it's not hard for a computer to do the number crunchingI believe you are correct that different digital indicators use different qualities/methods of EMF > temp conversion, and this can contribute to their stated accuracy specifications.Developing a method and uncertainty budget for low uncertainty with ACJC enabled was the real battle!Best of luck on your journey. And yes, I encourage you to document your journey/findings for the time when someone else needs to take up your role!BTW - Fluke provide some online calculators which can be handy for verifying your own calculations, and can handle CJ <> 0. However, I have noticed a few errors in their calculator (i.e. E type at -200C looks incorrect to me), so take some care.https://au.flukecal.com/Thermocouple-Table-Voltage-Calculatorhttps://au.flukecal.com/Thermocouple-Temperature-CalculatorOverall, I much prefer working with the RTD <> resistance conversions. No CJ to consider

author: Henrik_V
author_rank: Regular Contributor
timestamp: June 23, 2022, 12:08:31 pm
content: 25a ago I did my master thesis in a cal lab building a temperature calibration system ...One of my favorite source of knowledge at that time :Manual on the Use of Thermocouples in Temperature Measurement,Fourth Edition, Sponsored by ASTM Committee E20 on Temperature MeasurementCite of Chapter 1 :Regadless of how many facts are presented herein and regadless of the percentage retained, all will be for naught unless one simple important fact is kept firmly in mind. The thermocouple reports only what it "feels." This may or may not be the temperature of interest.For an ideal TC the tables provided (in standards, ITS90 (at that time, don't know what the actual scale is, NIST, ..) are the reference, the interpolation math are validated interpolation but still interpolationsand the material effects on TCs are so high, that even a 0.1K uncertainty in the interpolation is sufficient (in my opinion) . If you need low absolut incertainties with TCs calibrate them build in.... and estinate an individual interpolation. Doing so at higher temperatures (>400°C ) is not an easy task .. and interpolation errors will be buried in other uncertaintiesCite:"Personally I don't use the inverse functions, and instead I calculate the inverse direction by solving the forward direction functions iteratively until I converge on the result with insignificant residual. I wouldn't enjoy doing it manually, but it's not hard for a computer to do the number crunching"Did the same thing ..95 in Excel on WIN NT for TCs and PT100sEdit:I remember calling our NMI (PTB) at that time, asking about standards/formats for digital calibration certificates ....Now +25 years later they come up with somethinghttps://www.ptb.de/cms/en/research-development/into-the-future-with-metrology/the-challenges-of-digital-transformation/kernziel1einheitlichkeitim/digital-calibration-certificate-dcc.html

author: mendip_discovery
author_rank: Super Contributor
timestamp: June 23, 2022, 12:28:43 pm
content: One of the things I have to do is convert the mV to C for a few elements so it can go into the uncertainty budget.Another is that I have to do regular checks on the unit to verify it's not drifting out. I would like to measure this with the agilent and make use of the 6.5digits to check the unit.I dont have to any maths with the unit I use as it does it all for me. Problem is that my uncertainties are high becuase they used a rtd for the CJC and that has a spec of 2C and a imported uncertainty of 2C, and that is where a lot of my error is from another is the resolution of the CJC which is 0.1C. If I could ditch the CJC and diy that then I could get a better rtd for measuring it and work in 0.01. It's all ideas swimming about my head. I wanted to get the whole coefficients down and noted, then though I might as well share that so that others can also learn from it. This is just temperature simulation.

author: RYcal
author_rank: Contributor
timestamp: June 23, 2022, 08:09:23 pm
content: Having read your last post may I suggest the following instead of using your RTD swap the "lag bath" out for a well-made "ice point".Typically if the unit under test specs are too much for my "calibrator" I will do all the tests with the internal ref junction set at 0 using ITS-90 scales and published data from "Traceable Temperatures" book then do a single ice point test using a characterized thermocouple probe with the internal junction set back to internal to prove its within specs.

author: mendip_discovery
author_rank: Super Contributor
timestamp: June 23, 2022, 08:16:00 pm
content: It's an option it's not a great amount of our work but I always look to improve. I was just annoyed that I couldn't find much on the maths and it was just assumed that all of us know it.

author: MK
author_rank: Regular Contributor
timestamp: June 23, 2022, 08:24:09 pm
content: the slope change between temperature breakpoints in the nist tables also gives problems in differential scanning calorimetry, you need to do some smoothing and use better than 1uV resolution in your temperature table, then use all the calibration points available over your temps of interest, then you have a fudge of the curie point in the k type that gives a shift of ~.06 degrees from memory? depending on whether you are going up or down. N type is supposed to be free of curie point issues, and has a tighter specification of the composition.

author: mzzj
author_rank: Super Contributor
timestamp: June 24, 2022, 02:24:54 pm
content: Quote from: MK on June 23, 2022, 08:24:09 pmNone of the base-metal thermocouples is good to 0.06 degrees at elevated temperatures. 0.6 degrees could be realistic with a pinch of salt and bag of disclaimers.Latest EA guidelines also say it is more or less waste of time to recalibrate base-metal thermocouples:https://www.euramet.org/download/?tx_eurametfiles_download%5Bfiles%5D=39999&tx_eurametfiles_download%5Bidentifier%5D=%252Fdocs%252FPublications%252Fcalguides%252FI-CAL-GUI-008_Calibration_Guideline_No._8_web.pdf&tx_eurametfiles_download%5Baction%5D=download&tx_eurametfiles_download%5Bcontroller%5D=File&cHash=23815e4817cde3d7cb63a5dc60589954and New Zealand MSL:https://www.measurement.govt.nz/download/23"Calibration of thermocouples can be a waste of time as theend user will seldom employ the thermocouple at the sameimmersion depth as was used in calibration. To make mattersworse, if the wire is inhomogeneous, the thermocouplevoltage will change as a temperature gradient is moved todifferent sections of wire (e.g., by changing the immersioninto an oil bath). Therefore, the calibration is only useful ifit is carried out with the same temperature profile along thethermocouple as when the thermocouple is used. If any inhomogeneities,left behind from the calibration or prioruse, lie somewhere near the new temperature gradient, asignificant error will result."I'm waiting for the next 17025 audit with horror after the latest EURAMET Calibration Guide No. 8

author: mzzj
author_rank: Super Contributor
timestamp: June 24, 2022, 02:36:35 pm
content: This might be also interesting to anyone attempting precision measurements with thermocouples:https://www.researchgate.net/publication/319875320_The_Type_N_Thermocouple_The_Good_the_Bad_and_the_Ugly

author: MK
author_rank: Regular Contributor
timestamp: June 25, 2022, 08:22:49 am
content: In differential scanning calorimetry we measure the temperature at two points on a NiCr plate to 0,0001C resolution, the sudden jump at the curie point stood out very badly, and the heating and cooling curves were different at that point.

author: mendip_discovery
author_rank: Super Contributor
timestamp: June 26, 2022, 07:55:27 pm
content: QuoteI find this kind of statement very annoying. They are not the best thing in the world, but the industry has been using them happily for years. The real world use of many tools doesn't follow the way it is used in calibration or lab mode. Last week I was calibrating multimeters used by mechanics working on cars in a workshop that has the doors open most of the year so the temperature swing is massive. Anyone who calibrates torque wrenches will also understand how the calibration is massively different to the way they are actually used. Half the time its about picking a good practical tool for the work you are doing, Steel Rule, Vernier Caliper, Micrometer, sigma comparator etc etc. being ok for measurement and they all get calibrated even though they have their flaws.One of the issues I do have is the manufacturers that skim around the specs of equipment, digital thermometers with 0.4C+0.1% specs from -100 to +1300 but not saying they need to add an additional for the probe. I have been into engineering firms and food places where they are using a handheld k-type thermometer and the person in the quality office insists they measure a temperature to +/-2C, I have even had to explain asking a walk in oven to maintain a +/-2C throughout the whole oven space is asking a bit much. But that is down to a lack of understanding as with a lot of things these days.For general purpose use I think the k-type is ok, having measured many against PRT and the dry block calibrators I have in the lab (not to 17025) we have had ok results and often within 0.5C for the points tested. I think that calibration of probes is a bit pointless mostly because I usually only see ones that work or are broken not much in the way of drifting. Though I do often suggest that customers that use them for testing stuff should have a method for calibrating them before use if only to make sure they are working as often its where the insulation breaks down and the wires touch that causes odd readings (taking a reading outside the door seal of the oven and not on the part.My dive into the maths was to provide an example of the calculations to help the next person who has to go through the stress of working it all out. The C to mV seems to me as being the master as its what was used to generate the tables, the mV to C seems pointless as its got to much error to be of use.I don't need to use it at the 0.001C level, I just want to be able to know the maths I am using for converting the standard deviation I have for some of the repeatability tests I have done are as good as I can get them.I have at least added EN 60584:2013 to my shopping list of standards to get, I had a copy but that was the older one and I should have an up to date copy to hand in the laboratory if I ever get more than 1 day a month in the lab.https://thermometer.co.uk/industrial-thermometers/1313-therma-1-industrial-thermometer.html

author: Pip
author_rank: Contributor
timestamp: July 14, 2022, 06:52:27 am
content: As you have already worked out, the temperature to emf conversion using polynomial coefficients will provide exact values. The "inverse polynomial" emf to temperature conversion will only provide approximate values, although the error is relatively small. The standard publications ASTM E230 and IEC 60584 and 62460 provide the approximate equations because most people will want to convert a thermocouple emf into an equivalent temperature rather than the other way around. This can be sufficient for lower accuracy applications, uncertainty calculations, or for finding a starting value to plug into the temperature to emf calculator with subsequent manual iterations to find the exact value.