Welcome! Log In Create A New Profile

Advanced

MARLIN: REVERSING SIGN OF THERMISTOR READINGS

Posted by ezakoch 
MARLIN: REVERSING SIGN OF THERMISTOR READINGS
September 29, 2015 08:41PM
Hey there, I'm looking for help with something that is probably very simple. I'm connecting a pressure sensor where the T0 thermistor goes. When I loosen the regulator, the pressure goes up, but the values go down on the Repetier plot because the resistance is actually going down. I'm just trying to understand how the thermistortables.h interacts with the C++ file and translates to a value that's sent to Repetier and plotted. I will need to create a custom table I realize for my own sensor. Alternatively, I'd appreciate any advice on a better way to do analog in sensor plotting with the following setup:

marlin firmware
repetier host UI
Panucatt Azteeg X3 3DP controller

Thanks!
Eza
Re: MARLIN: REVERSING SIGN OF THERMISTOR READINGS
October 10, 2015 07:17AM
Hi Ezakoch,
I included parts of my thermistortable.h and configuration.h. I mistakenly bought the
recommended thermistor which, of course, isn't included in the thermistor table. My table
creation was done with a script I found online. Sorry don't know where it is now.

Accessing the table through configuration.h is easy. I just added a comment to remind me,
decided on 2000 as the value for the table, used the following in the config,

// My B57560G104F temp table
// 2000 epcos b57560g104f

#define TEMP_SENSOR_0 2000 // epcos b57560g104f
#define TEMP_SENSOR_1 2000 // for monitoring chamber temperature. epcos b57560g104f
#define TEMP_SENSOR_2 0
#define TEMP_SENSOR_BED 2000 // epcos b57560g104f

I've cut a lot of the thermistortables out to get to the meat. The script generated raw values so you
can see the relationship between adc and temp. It is actually remarkably easy to do. You just have
to make sure to use the right naming format.

//
// B57560G104F epcos thermistor
// My value 2000 is here
const short temptable_2000[][2] PROGMEM = {
{ 366, 300 }, // r= 108 adc=22.90
{ 392, 295 }, // r= 115 adc=24.49
{ 420, 290 }, // r= 124 adc=26.23
{ 450, 285 }, // r= 133 adc=28.12
{ 483, 280 }, // r= 143 adc=30.17
{ 519, 275 }, // r= 154 adc=32.41
{ 558, 270 }, // r= 166 adc=34.86
{ 600, 265 }, // r= 179 adc=37.53
{ 647, 260 }, // r= 193 adc=40.44
{ 698, 255 }, // r= 209 adc=43.64
{ 754, 250 }, // r= 227 adc=47.13
{ 815, 245 }, // r= 246 adc=50.97
{ 883, 240 }, // r= 268 adc=55.17
{ 957, 235 }, // r= 292 adc=59.79
{ 1038, 230 }, // r= 318 adc=64.87
{ 1127, 225 }, // r= 348 adc=70.45
{ 1226, 220 }, // r= 380 adc=76.60
{ 1334, 215 }, // r= 417 adc=83.36
{ 1453, 210 }, // r= 458 adc=90.81
{ 1584, 205 }, // r= 504 adc=99.02
{ 1729, 200 }, // r= 555 adc=108.07
{ 1889, 195 }, // r= 613 adc=118.04
{ 2064, 190 }, // r= 678 adc=129.03
{ 2258, 185 }, // r= 752 adc=141.13
{ 2471, 180 }, // r= 836 adc=154.44
{ 2705, 175 }, // r= 931 adc=169.07
{ 2962, 170 }, // r= 1038 adc=185.13
{ 3244, 165 }, // r= 1162 adc=202.73
{ 3552, 160 }, // r= 1302 adc=221.97
{ 3887, 155 }, // r= 1464 adc=242.95
{ 4252, 150 }, // r= 1649 adc=265.75
{ 4647, 145 }, // r= 1863 adc=290.43
{ 5072, 140 }, // r= 2111 adc=317.03
{ 5529, 135 }, // r= 2397 adc=345.55
{ 6015, 130 }, // r= 2731 adc=375.96
{ 6530, 125 }, // r= 3120 adc=408.15
{ 7072, 120 }, // r= 3575 adc=441.98
{ 7636, 115 }, // r= 4110 adc=477.24
{ 8219, 110 }, // r= 4740 adc=513.67
{ 8815, 105 }, // r= 5485 adc=550.92
{ 9418, 100 }, // r= 6369 adc=588.62
{ 10022, 95 }, // r= 7422 adc=626.36
{ 10619, 90 }, // r= 8682 adc=663.69
{ 11203, 85 }, // r= 10194 adc=700.18
{ 11766, 80 }, // r= 12017 adc=735.39
{ 12303, 75 }, // r= 14226 adc=768.95
{ 12808, 70 }, // r= 16912 adc=800.52
{ 13278, 65 }, // r= 20194 adc=829.86
{ 13708, 60 }, // r= 24224 adc=856.77
{ 14099, 55 }, // r= 29198 adc=881.16
{ 14448, 50 }, // r= 35367 adc=903.00
{ 14757, 45 }, // r= 43059 adc=922.33
{ 15028, 40 }, // r= 52704 adc=939.24
{ 15262, 35 }, // r= 64868 adc=953.89
{ 15463, 30 }, // r= 80300 adc=966.43
{ 15633, 25 }, // r=100000 adc=977.08
{ 15776, 20 }, // r=125310 adc=986.02
{ 15895, 15 }, // r=158045 adc=993.46
{ 15993, 10 }, // r=200681 adc=999.59
{ 16074, 5 }, // r=256616 adc=1004.60
{ 16139, 0 }, // r=330553 adc=1008.66
};
#endif

With a sensor that generates inverted values I'd be worried about what Marlin
expects in the gaps between the table entries. Does it just extrapolate from one
table entry to the next? or does it expect a certain type of curve? That is a
complete guess by me.

Either way if you are going to generate your own table, generate a big table to be
safe.


Hope this starts you rolling,
Andrew
Attachments:
open | download - thermistortables - Copy.h (41.9 KB)
Sorry, only registered users may post in this forum.

Click here to login