Welcome! Log In Create A New Profile


FiveD - Thermistor tables

Posted by ElmarJongerius 
FiveD - Thermistor tables
January 24, 2011 11:19AM
I was checking out the temperature regulating of the FiveD firmware (not the official one but the Gen6) because Camiel found it was too unstable. When experimenting with very high temperatures (don`t ask me why winking smiley) he told me he had reading changing almost with ten`s of degrees at the same time.

What I found was that almost all the temperature tables are optimized for a working zone for about max 100 C.

Now the GEN6 firmware has the right firmware, I also think it is very usefull for everyone who wants this to be better. When creating tables please use some more measurement points in your working area!

For the Epcos B57550G104 sensors I made the following table and with IR camera this shows a whole lot better!

// Standardized R/T characteristic no. 8404
// RS thermistor 484-0183; EPCOS NTC
// Mendel-Parts thermistor G540 / G550
// Optimized for 100...300C working range.
// Max range: -20...300C
// Approx reading error on Gen 6 electronics: ~+5%, -3% in 100 - 300C range.

#define NUMTEMPS 28
short temptable[NUMTEMPS][2] = {

Hope you can use this.

Re: FiveD - Thermistor tables
January 25, 2011 04:53AM
Here is some more info, I will send it over the reprap dev list also.

See attached a plot of both tables (temp is in C). The original table has only a few points in the upper region. When the reading goes above 258 C precision is completely lost. And for the temperatures between 150 C and 258 C the reading is higher than your actual temp.

My point is not that you can add as much points as you like, I`m saying that it is very important how and where you choose your points for linearization. The table I posted is much better than the original in usable temperature ranges for the extruder.

Goodluck smiling smiley


Edited 1 time(s). Last edit at 01/25/2011 04:54AM by ElmarJongerius.
open | download - 20110125 Temperature table graph.pdf (35.2 KB)
Re: FiveD - Thermistor tables
January 25, 2011 11:14AM
I like the graph it's shiny! How difficult would it be to add the "real" values of the thermistor to give a point of comparison?

It also looks like you need even more values in the high range. Though they actually seem to follow fairly closely in the 150 to 250 range (it IS celcius, isn't it?). The new one has a LOT more values, you could usefully chop out a lot of those in the low end, where it follows fairly close anyway, AND we don't care about the value as much.

This is a useful comparison.

I'm building it with Baling Wire
Re: FiveD - Thermistor tables
January 31, 2011 02:11PM
Hello Elmar,

Can you create these temperature tables yourself? I have not the exact same thermistor as you use - I have a 10K one but it seems to be from the same manufacturer (I enclosed the Thermistor.pdf specification sheet with temperature table... I think your thermistor is also in this file...).
I have the following thermistor:

10 k ±1% B57550G1103+005

How can I set up the temp.h file correctly? I would appreciate if you could help!
thank you in advance!
Re: FiveD - Thermistor tables
February 04, 2011 06:32AM
See attached spreadsheet.

R2 is the resistance used to create the voltage divider with (on board).
Rt is the nominal resistance of your NTC.

Columns E...L are just for a simple kind of error calculation. This is not complete and/or reliable.

Fill in all the values you would like to use. T[c] is the temperature point with its corresponding Rt/R25 given in the datasheet. Column D will give you your corresponding ADC value.


open | download - 20110204 0070 Temperature table simple.xlsx (16.9 KB)
Re: FiveD - Thermistor tables
March 02, 2011 09:09PM
Thermistors are "up to 310C" but also manufacturers will usually have a note somewhere that thermistors are "replaceable only in 0-150C" range. So, beyond 150C, 2 pcs of the same thermistor will read enough discrepancies to "individualize", thus need calibration each. Which means that the Beta value after 150C is cake - and wave it goodbye. Tables are made from it, so after 150C are a thing like "not designed for, nor guaranteed, but might works so-so-maybe on my application" kind of thingy.

Many ppls have the misconception that if you just put a thermistor on extruder and borrow its table, it should read accurate up to 300C. It wont, and its not the table's fault, or better said, not only that. Making different tables can improve things but only up to a point, after that the thermistor has its own mind. Thermistors are described by their cold resistance and beta, and electronics industry and its standardization bodies worked a long way to ensure components "fungibility" for me to spoil it off. See [en.wikipedia.org]. Actually the efforts for standardization in electronics were quite huge (i assume coz i wasnt me doing that), and i guess that if it wasnt like that, we would still be in something like dark ages of electronics. As it seems to me, some of us still are, because I have no clue but to blame this misconception, as to why different thermistors got different names in firmware. I dont know why their digikey different tape and reel codes are not separated yet in our firmware. Imho, its like saying a 10k resistor 5% is different than the next 10k resistor 5%.

Basically to get proper readings, one would need individual thermistor calibration, and if you are going to do that, doesnt really matter much what was the table you were starting from, or how it was made. Put a thermocouple meter near the extruder thermistor with some kapton tape. Set the heater to each of the important temperatures in the table, one by one, lets say important ones are after 150. Note the difference between the true temp - thermocouple - and the thermistor read, and modify the table accordingly like if the thermistor reading is too high, deduct the amount from the temp column. Upload the changes and test it, maybe repeat to polish. You will end up with a half manually made table, but that should give the exact readings as the thermocouple did.

@Elmar: Why -20 & 0 and 864 temperatures in the table?

You can make your own tables. A python script is here [www.brokentoaster.com] which can set max temp to 300, which is an advantage over the official release script. If you use the official release, tweak it: set the number of temperatures like 1000 and hand pick some ends of the interesting interval, and adding alot more lines for the extruder working interval where you want extra precision, until you end up with only 20 lines (delete rest 980 lol). Sort of speaking, 1 line for 15C one for 100C, next for 150, then from160 and after that a line in table for each 10 degrees. Just install python, right click choose to edit the script with python (actual menu may differ), scroll down to see where the thermistor values are and put your own, then run it.
Or, try this table for that thermistor
// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=4036 --max-adc=1023
#define NUMTEMPS 20
short temptable[NUMTEMPS][2] = {
{32, 300},
{38, 285},
{46, 270},
{57, 255},
{70, 240},
{87, 225},
{109, 210},
{138, 195},
{176, 180},
{225, 165},
{287, 150},
{365, 135},
{458, 120},
{561, 105},
{669, 90},
{771, 75},
{857, 60},
{922, 45},
{967, 30},
{995, 15}

Edited 2 time(s). Last edit at 03/02/2011 09:58PM by NoobMan.
Re: FiveD - Thermistor tables
March 02, 2011 09:50PM
To be more clear, the page that was made with honesty here [content.honeywell.com] says in intro:

They are designed to cover the full temperature range of -60 °C to 300 °C.

and back down a note says:

Interchangeable, R-T Curve Matched: These Glass Encapsulated Chip Thermistor units are specifically designed to offer interchangeability over the standard temperature range of 0 °C to 100 °C.

I think i have seen that more often "up to 150 C" but cant make statistics from top of my head.
And note that actually this is the "interchangeable" type of thermistor. Too little changes imo, since 1962 [pubs.acs.org].
But its not "interchangeable" over the entire range, only the first part - which sadly is no interest for our extruder application.

Was just trying to explain what i think was a misconception, and i start feeling like i am exagerating. Thermistors are good, but if somewhat accurate results are required, i would say that the values after 150 C and up require individual calibration, e.g. "individual" as in both done by ourselves and also in the situation when a thermistor is replaced the calibration has to be done again. This can go a long way into improving our intimate relation with our extruders spinning smiley sticking its tongue out.
Re: FiveD - Thermistor tables
March 02, 2011 10:23PM
I followed nophead's suggestion and calibrated my thermistor by removing the filament from the extruder and sticking a thermocouple in it's place all the way to the tip. I measure from 150 to 260 and fitted it to the equation to get a new beta and r0 (at 25C). Now my temperature settings are usually within 5C of what the thermocouple reads. Of course, the reading at room temperature is way off, but it's not as important as around 200-250C.

Once I get parts for another hot end, I'm putting one together with a thermocouple A-D kit from techzone.
Re: FiveD - Thermistor tables
March 03, 2011 03:31AM
... look here - in the (actually) last post - i've measured a glasbead-thermistor (shown 2 pics above) from 100°C to 320°C and plotted the graph.

At room-temp it reads around 78 kOhm, but the logarhythmic fitting curve is only fitting good above 150°C, so this could be total different in the interesting range of 180°C to 260°C for another of this thermistors confused smiley

Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: FiveD - Thermistor tables
March 03, 2011 06:16AM
Indeed taking the thermocouple readings from inside makes much more sense, and getting the new beta and compiling a new table is definatelly faster and the best way to go.

On the other side, making incremental changes to the old table process is so unbelievable tedious and took like half of a day. Its due to the fact each adjustment needs slight changes split in two, basically each time one has to back-hack the temperature reading algorithm from firmware (spreadsheet helps), and it needs to start with a somewhat correct read value. Not impossible, but really tedious as a process and so easy to ruin it.

If half of the table is correct and half is bad, why not combine them. As i see the code it just makes a simple arithmetic interpolation so each potential error is kind of constrained between the nearest values, so combining two parts should work with minimal impact on each other. Imo this is the biggest benefit in using tables, the ease to tweak them. Alternatively making the firmware to use only the resistance and a beta would be possible, but then all tweaking capabilities would be lost and the read error would increase across the entire range.

I think what is needed for an accurate read across entire range would be something like a Beta 50/250, e.g. took at 50C and 250C, and again its not on the datasheets because it then would be an "average" B50/250 and would have a very significant dispersion factor. Which wouldnt quite help anyone in particular and would only change the general math and make the datasheet read error way bigger than the usual 1-2-3-5%.
Re: FiveD - Thermistor tables
March 03, 2011 08:17AM
The equation with beta is only an approximation to the actual thermistor response, which is why you get different beta values for different temperature ranges. You could take three measurements and use the Steinhart–Hart equation to generate the table. I expect that would be accurate over a much bigger range.

The only reason the firmware needs a table is because the temperature is sent in Celsius. If the M code was redefined to use ADC values you can do all the calculation on the PC and have no loss of accuracy due to a table.

Re: FiveD - Thermistor tables
March 03, 2011 08:27AM
... when i have the CNC-repstrap-kit running, then i'll repeat the measurement with ADC-values instead of Ohms - with the fitting equation i can calculate the temperature for the specific sensor without use of a table.

When building some more hot-ends, i can measure different sensors and refine this ... but my plan is to use PT100 or PT1000 sensors because of their good linearity compared to the logarithmic behaviour of the thermistors ...

Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Sorry, only registered users may post in this forum.

Click here to login