-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Junction temperature errors #192
Comments
I'm not doing the junction temperature offset correctly. I need to back-calculate the respective thermocouple voltage for the junction temperature and subtract it from the measured voltage. That then gives the correct thermocouple voltage. I changed the firmware to display the measured voltage rather than calculated temperature. Then I connected a small voltage source made from a battery and voltage divider to simulate a low temperature reading. The voltage displayed on the T400 was consistent with the voltage measured using a Fluke 89. |
The thermocouple temperature equation we've implemented works as follows:
This is how we should implement it:
If we do things the wrong way, the difference between the calculated temperature and the actual temperature increase as the thermocouple temperature increases. |
But is this consistent with observations? From my testing I know the ADC can measure down to the voltages we expect to see when measuring liquid nitrogen. However, this does not explain whey the numbers disappear from the screen and data stream. |
Commit 5b3b107 builds in Arduino hourly 2015/12/14 11:26, using 28,648 bytes of the total 28,672 bytes leaving 24 bytes available. We can grab some extra bytes by truncating the temperature lookup table, with each entry giving us an additional four bytes. Liquid nitrogen boils at −195.79 °C, so we really don't need to measure anything below -200 °C. That frees up seven table entries, leaving us with 52 bytes. A propane torch will get to around 1200 °C. Truncating the high end to 1210 °C frees up sixteen entries, leaving us with a total with a total 116 bytes. We can go further in grabbing bytes. probably better to take from the low end. I would rather release a firmware update later that increases the measurement range than ship a device that gives nonsense numbers and release a bug fix later. I think a reasonable approach is to truncate the table to free up bytes, implement the bug fix, then re-add lookup entries to use any remaining bytes. We could move some things to the SPI flash (chip #191) to free up space. The lookup table, font, and strings are good candidates. I think this would require a fair amount of work, so we should only do it if necessary. Let's see what kind of temperature range we get with the table truncation method first. The lookup table uses the int32_t (4 bytes) variable type. The measured thermocouple voltage ranges from -6458 to +54819. We can switch to uin16_t (2 bytes) if we add 6458 uV to the measured thermocouple voltage and shift all the lookup table numbers accordingly. Everything would functionally remain the same. Voltage range in the lookup table would range from 0 to 62,277, which is with in 0 to 65,535 range of uint16_t. This would give us an extra 328 bytes for a total of 352 bytes if this is the only change we make. |
…an int32_t. This frees some flash space. See #192.
Okay, in commit 313d4b2 I converted the lookup table from int32_t to uint16_t and made the necessary adjustments to the lookup function. Flashed to a T400. Appears to function as it has been. The code compiles to 28,364 bytes. we have 284 bytes available. |
In commit 1a8832b I added an empty function GetJunctionVoltage(double jTemp) to functions.cpp. This is where we would implement code that takes the junction temperature and determines the corresponding thermocouple voltage from the lookup table. We still have 266 bytes available. |
In commit f6c471e I think I've actually implemented the junction temperature compensation properly. I have to do more testing, but initial casual tests don't reveal any problems. There are now 166 bytes available. |
…ion for issues #192. Must test this more.
It looks like there's more to this. The T400 I'm using is measuring voltages too high. This is a v12 modified to be v13, so there may be something else going on here. I'm making another v14 board to test again. |
The messed up measurements I was getting were form a crappy device I made to output voltage. I thought it was the filtration circuit causing problems, so I tried several hardware configurations, measuring the output voltage on a Fluke 89 and on a T400 and calculating the offset (fluke - t400). Here is a plot of the the offset vs voltage. Here is the offset as a percentage of the Fluke 89 measured value. After realizing the problem was coming from my measurement setup I configured the board with the original filtration configuration and performed the measurements again. In this graph the purple line shows the offset voltage vs. measured voltage. Since it's nice and linear we can apply a calibration factor. The red line is approximately what we would expect from a calibrated measurement. Taking new measurements with calibrated firmware gives wonderful results. Here you can see we're pretty tight in on the Fluke 89 temperatures. There's still some work to do on this. In the above measurements, the junction voltage was calculated manually and programmed into the firmware. The cold junction voltage function needs to be implemented properly. See #196 |
Fluke reference: http://assets.fluke.com/manuals/87_89iv_umeng0300.pdf |
I dipped two k-type thermocouples into liquid nitrogen (−195.79 °C 77 K; −320 °F) today. I recorded to the MicroSD card in K and again in °C. The thermocouples registered as disconnected at low temperatures. The ADC and lookup table should be able to measure down at that voltage (-6458 uV at -270 °C).
The defined temperature range is defined well enough:
Here are the plots:
There must be something else happening here. The lowest measured temperature is -235.30 °C, but liquid nitrogen should be around −195.79 °C. Maybe it was actually liquid H2 (about −269 °C 4 K or −452.2 °F), but that's doubtful. I'll have to confirm. Even if it were H2, we should still be able to measure the corresponding thermocouple voltage. Probably a firmware issue.
Here's the data:
The text was updated successfully, but these errors were encountered: