# RDB calibrations

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
RDB Build Documentation

# Temperatures and thermistors

## Background and context

Why do we use thermistor tables? Why not a single generic formula like that beta and stuff?

There are indeed more than one formula or function to approximate thermistors behaviors. Unfortunatelly thats all they are: approximations, and none gives a perfect fit, and most of times not even close.

The real behavior is more like a set of different functions for different intervals. Using a single function for the entire set wont produce a snug fit for the entire interval from 0 to 300C. If we want to use a single function, for example we try to use the beta to get a better fit at higher temperatures, shape will come off at lower temps. And again if we try to get a better fit at lower end, it will come off at higher end instead.

Dunno if this comparation is proper, but tables are like a linear "snake" which will "flex" on any of its intervals to better fit the reality from 0 to 300C. Tables are tweak-able at any interval and point. More importantly, eventual errors will be consistent regardless of the current position. So with tables, we can get a method which gives better fit over the entire range.

Thermistors are "interchangeable"

This is a key concept about thermistors, and it does not refer to different manufacturers or different models, but refers to same model. If we go in the factory and take from production line 2 thermistors that were produced one after another, they will be "interchangeable", but only up to a point. After that, each will behave differently, as if each has its own mind. Operating range is bigger than interchangeability range, so of course we can use the thermistor beyond its interchangeability. Just when we replace such a thermistor, we have to take care to re-adjust or re-calibrate the system again.

Thermistors are generally interchangeable in the usual range of 0 - 105C, or lets say perhaps up to 150C just to be generous for all the varieties used in reprap and even to account for reprappers being willing to accept variations of more than implied precision. Which means for heated bed yes, thermistors are interchangeable. But for our extruders at 240-250C, the thermistors are not interchangeable, not anymore. If you buy 2 thermistors of same kind, for extruder, and if you want accuracy, then one should NOT treat them as identical, because they will behave slightly differently at 250C. There may be premium products on the market, like using matched pairs of hermetically sealed thermistors, and there are other sensors like RTC (Pt thin film), thermocouples, etc. But we reprapers use the cheapest things possible, and along these lines we are likely to face the worst, not the best. All in all, suitable thermistors are working very smooth with reprap, its not a bad solution or anything like that, but one needs to understand the implications.

When in firmware we use the thermistor tables made by someone else, by doing that we assume that our thermistors are interchangeable, but that is not always the case. Sometimes two reprappers extruding with same abs filament, one reports printing at 200C and another is printing with same thing but at 260C. Or some ppls report printing at temperatures where abs should not yet melt. Most likely biggest part of these differences can be explained by non-calibrated thermistors, and generally speaking ppls should be be aware of this.

## Leaving thermistor not calibrated

The absolute temperature of the hotend is not really such a big deal. What matters is to find a setting that works, and to have the printer reach that setting and keep it up for the duration of the print. What is the absolute value of that setting doesnt matter all that much.

What does matter, is to be aware of the fact that your temperature readings are not real ones. For example say your printer reports a temperature of 240C, but the real can be different like 200C. If you try to extrude abs like this, it probably wont be melted enough and you will force your extruder. And if you push too much something might break.

In reprap printers the temperature comes from firmware interpolating the ends of the current interval of thermistor table. Firmware by itself has no absolute temperature reference and therefore has no clue what these numbers mean. If you upload a thermistor table with temperature column with values in range of millions, then ofc your firmware will report back temperatures of millions degrees.

Caveats when working with non-calibrated thermistor table:

• dont assume your 200C setting is actually that: it can easily be +/- 30C or virtually any difference between display and reality;
• if somebody on forum says "extrude this at xxx temp", dont assume if you heat up to "xxx temp" you actually get same temperature, coz you probably wont;
• trust your hand more than numbers on display: test the extruding force by hand (as described bellow), and find the best setting;

### Checking extruder motor effort by hand

Dismantle the idler bearing that presses the filament against the hobbed bolt. Now you can directly push the filament by hand into the melting chamber. Assume an estimate, but start with a slightly lower temperature setting. Heat up the hotend at different temperatures, slowly increasing the temp setting, and try push the filament by hand -gently- at each of the settings. As the temp increases, you will first find a point where the filament starts to melt, and starts to be "push-able". Following that point, it becomes easier and easier, untill the effect levels down at a second point. Meaning regardless how much if you increase the temp, the plastic doesnt seem to be any different in pushing through. The poly chains broke down, plastic is fully melted. Basically the force required stops being related to temperature, and wont become any easier to push. This is a good setting, see what temp indication is, add 5-10C like temperature swing, and thats it. Extruder will need least amount of force to do its job, and will be happiest with that setting. It takes some time to get a "feel" of "pushing", but afterwards this is a good way to find a good temperature setting for extrusion of different plastics. Its pretty weird to try explain the "hand pusing" thingy so its probably easier to just go ahead and do it.

This is a good way to find a temperature setting for a new kind of plastic, even with a calibrated thermistor table. Because this ensures that the force needed to extrude is as low as it can be, the extruder is not working hard, sharp accelerations of extruder stepper dont turn into missing steps and so on. If the extruding force is high, one can notice the chips of plastic in the hobbed bolt area. In such a context it requires regular cleaning (it shouldnt), and ofc those chips also mean the bolt was slipping and at least some plastic was not extruded. When the force required for extrusion is small, the hobbed bolt will never have plastic chips at all and normally shouldnt require cleaning.

## How to calibrate *any* thermistor table

Thermistor table is a simple 2 column table, left side column is adc values, right side column is temperature values. Usually there are 20 or 30 table rows.

This requires an instrument to read the real temperature of the hotend. Most common is to use a multimeter type which can read temperatures, and for this purpose has a thermocouple probe attachment. So in the following it is reffered as such. I believe it was originally mr Nophead's sugestion to place the thermocouple inside the barrel where is the effective melting area of the plastic.

The common reprap thermistor setup is like this here.

The thermistor is in a resistor divider with a fixed pullup resistor, so the voltage changes when thermistor changes its resistance in relation to temperature. Firmware "reads" the adc pin: its voltage is passed through a set of comparators and the firmware decides its equal to a certain adc value. Basically the voltage coming from thermistor becomes an ADC value. The thermistor table contains an interval where this value fits. Lets say this adc value is exactly in the middle of the adc interval, and in this interval the lowest adc has assigned a temp of 10C and the upper one 20C, then firmware should guess that temperature coresponding to the adc value that was just read is also in the middle of temperatures, hence it is 15C. This is to say the values inside the interval are interpolated from the value of the interval ends.

There are 2 things which can improve the quality of the readings:

- table structure: set up smaller intervals in region of interest (tweaking adc column)

- effective calibration: make sure that the temperatures assigned to a certain adc value are realistic ones

### Optional: Tweak table adc column

At this stage we are not really using this to get a definitive temperatures column, will change that later. We only aim to get a adc column that supposedly has smaller intervals in the region of 180-260C, or any region of importance. Lets say we need only 20 values. We can set the script to give us 100 values and hand pick a number of 20 rows, first the ends of interval, say 0C and 400C, then the other values mostly in the region that is important to us. For example from 180 to 260C we can pick one set of values at an interval of 10C, and in rest we can pick intervals say 30C or 50C from one reading to the next.

Some variants of the table:

- There are some scripts better than others for specifying the temperatures in the table (needs no handpicking or at least less than others).

- As a side note Teacup's table is made with right side column, temperatures x4, that is a neat feature so uC does not need to make a certain multiplication all the time.

- Later tables have the left side column, adc values, multiplied * 16, more on that [here].

### Effective calibration procedure steps simply 1-2-3 (right side temperatures column)

At this point we already have a table to work with, and we will change only the temperature column.

Following that we already have a table to work with, from now on it does not matter anymore what is thermistor type, value, r1, r2, alpha, beta, self heating, etc and nothing else matters. Calibration is made as a black-box abstraction, only considering the input and output. We dont actually care for what's inside it.

For a certain value in the table, its like 3 very easy steps:

#### Step1: Heat up at a certain temperature from the uploaded table

Command to heat up at exactly that temperature written in the table that is currently uploaded in the uC. This is a trick to command the system to heat up untill the input equals the corresponding adc value in the table.

#### Step2: Get the real temperature at exactly that adc level

In practice, temperature will slightly fluctuate around that adc point. Having a small hysteresis may ease the process. Wait for temp to stabilize. It is important to watch the reported temperature and when it coincides exactly with the table value, then to read real temperature, meaning when the read adc and the table adc are closest.

#### Step3: Put real temp in the new table

Note down the real temperature for that adc value, and when all adc values (of interest) have real temperature equivalents, it is time to upload again but with the temperature column being made by the real temperatures that have been measured.

This can be done for all table values, but most likely only the ones between 150C-260C will need adjustments. Obviously shouldnt try heating up to 300C or to temperatures which may damage your setup, just to find the differences at such points.

After uploading the newly revised thermistor table, it is time to double check it, in the same way, at least in the area of interest. Small tweak may be needed again, and with minor changes and another upload, the new thermistor table should give quite realistic temperatures. If process is done carefully and with patience, the temperature readings should be ~1-2C within the thermocouple readings for the entire range. Which is quite good.