firmware /FiveD_GCode/FiveD_GCode_Interpreter/Temperature.h

Language C/C++ Header Lines 344
MD5 Hash 42a0c59dabbd7dbbe90e702fc2a40ab1
Repository https://github.com/kartenkarsten/firmware.git View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
#ifndef TEMPERATURE_H
#define TEMPERATURE_H

// HINT: To decide which Thermistor/s are used, you no longer need to change this file!
// please just change the two definitions in your configuration.h file that are:
//  TEMP_SENSOR       ( choose what to set it to based on the options in features.h )
//  BED_TEMP_SENSOR    ( as per above, or leave it unset, and it will automatically be set the same as TEMP_SENSOR )
//
// Developers please note:   the "Tables" defined in this .h file are arbitrarily identified by unique prefixes 
// such as a_  and b_, etc.  this is so that you can use a different temperature table for your extruder
// and your heated bed.  ( or perhaps use a thermocouple of one, and a thermistor on the other ). 
//  If you add your own "Table", please give it a unique prefix, following the existing conventions below
//    ( and update setupThermistors() function too )

// The temperature control dead zone in deg C

#define HALF_DEAD_ZONE 5

// ie max6675 or AD595 or similar  we just declare a dummy :
#ifndef USE_THERMISTOR 
short temptable[0][2] = { };
short bedtemptable[0][2] = { };
#endif 

// now we can ignore the rest of this file unless we are using a thermistor somewhere! 
#ifdef USE_THERMISTOR

// theoretically we could change this number on a per-thermistor basis, 
//but in reality this is a fixed constant that applies to both thermistor/s you use.  
#define NUMTEMPS 20

// convenience typedefs
typedef short Pair[2];
typedef Pair Table[NUMTEMPS]; 

// for direct PIC temperature control of the extruder without a separate extruder CPU, we define the 
// thermistor table/s we want to use in this file.
#if ( EXTRUDER_CONTROLLER == EXTRUDER_CONTROLLER_INTERNAL )  || ( EXTRUDER_CONTROLLER == EXTRUDER_CONTROLLER_DC ) 
Pair *temptable; // a pointer to the first "Pair" is equivalient to a "Table" type, but conveniently modifiable.
#endif 


// ... And this is the heated bed thermistor (if any)
#if HEATED_BED == HEATED_BED_ON 
Pair *bedtemptable; 
#endif


// using "Jaycar 125deg 10k thermistor" and 4.7k R  ( not  temperature rated for extruder/s, heated bed only)
#if TEMP_SENSOR == TEMP_JAYCAR_NTC_125DEG_10K_THERMISTOR ||  BED_TEMP_SENSOR == TEMP_JAYCAR_NTC_125DEG_10K_THERMISTOR

Table a_temptable = {
	{1, 599},
	{40, 130},
	{60, 120},
	{81, 110},
	{106, 100},
	{133, 90},
	{177, 80},
	{235, 70},
	{295, 60},
	{346, 55},
	{373, 50},
	{309, 45},
	{451, 43},
	{490, 37},
	{637, 31},
	{690, 25},
	{743, 19},
	{796, 12},
	{849, 5},
    {999, 0}
};


#endif 


// "RS 10k thermistor" RS Part: 484-0149; EPCOS B57550G103J
// Made with createTemperatureLookup.py (http://svn.reprap.org/trunk/reprap/firmware/Arduino/utilities/createTemperatureLookup.py)
// ./createTemperatureLookup.py --r0=10000 --t0=25 --r1=0 --r2=4700 --beta=3480 --max-adc=1023
// r0: 10000
// t0: 25
// r1: 0
// r2: 4700
// beta: 3480
// max adc: 1023
#if TEMP_SENSOR == TEMP_SENSOR_RS10K_THERMISTOR || BED_TEMP_SENSOR == TEMP_SENSOR_RS10K_THERMISTOR
Table b_temptable = {
   {1, 599},
   {54, 160},
   {107, 123},
   {160, 103},
   {213, 90},
   {266, 79},
   {319, 70},
   {372, 62},
   {425, 55},
   {478, 49},
   {531, 43},
   {584, 37},
   {637, 31},
   {690, 25},
   {743, 19},
   {796, 12},
   {849, 5},
   {902, -3},
   {955, -16},
   {1008, -42}
};

#endif

 

 
// "RS 100k thermistor" Rs Part: 528-8592; "EPCOS NTC G540" B57540G0104J
// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=4036 --max-adc=1023
// r0: 100000
// t0: 25
// r1: 0
// r2: 4700
// beta: 4036
// max adc: 1023
#if TEMP_SENSOR == TEMP_SENSOR_EPCOS540_THERMISTOR || BED_TEMP_SENSOR == TEMP_SENSOR_EPCOS540_THERMISTOR
Table c_temptable = {
   {1, 864},
   {54, 258},
   {107, 211},
   {160, 185},
   {213, 168},
   {266, 154},
   {319, 143},
   {372, 133},
   {425, 125},
   {478, 116},
   {531, 109},
   {584, 101},
   {637, 94},
   {690, 87},
   {743, 79},
   {796, 70},
   {849, 61},
   {902, 50},
   {955, 34},
   {1008, 2}
};

#endif


// RRRF 100K Thermistor 
// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=3960 --max-adc=1023
// r0: 100000
// t0: 25
// r1: 0
// r2: 4700
// beta: 3960
// max adc: 1023
#if TEMP_SENSOR == TEMP_SENSOR_RRRF100K_THERMISTOR || BED_TEMP_SENSOR == TEMP_SENSOR_RRRF100K_THERMISTOR
Table d_temptable = {
   {1, 929},
   {54, 266},
   {107, 217},
   {160, 190},
   {213, 172},
   {266, 158},
   {319, 146},
   {372, 136},
   {425, 127},
   {478, 119},
   {531, 111},
   {584, 103},
   {637, 96},
   {690, 88},
   {743, 80},
   {796, 71},
   {849, 62},
   {902, 50},
   {955, 34},
   {1008, 2}
};

#endif



// RRRF 10K Thermistor 
// ./createTemperatureLookup.py --r0=10000 --t0=25 --r1=680 --r2=1600 --beta=3964 --max-adc=305
// r0: 10000
// t0: 25
// r1: 680
// r2: 1600
// beta: 3964
// max adc: 305
#if TEMP_SENSOR == TEMP_SENSOR_RRRF10K_THERMISTOR || BED_TEMP_SENSOR == TEMP_SENSOR_RRRF10K_THERMISTOR
Table e_temptable = {
   {1, 601},
   {17, 260},
   {33, 213},
   {49, 187},
   {65, 170},
   {81, 156},
   {97, 144},
   {113, 134},
   {129, 125},
   {145, 117},
   {161, 109},
   {177, 101},
   {193, 94},
   {209, 86},
   {225, 78},
   {241, 69},
   {257, 59},
   {273, 46},
   {289, 28},
   {999, 0}  // added to make NUMTEMPS 20 same as the others.
};

#endif



// Farnell code for this thermistor: 882-9586
// Made with createTemperatureLookup.py (http://svn.reprap.org/trunk/reprap/firmware/Arduino/utilities/createTemperatureLookup.py)
// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=4066 --max-adc=1023
// r0: 100000
// t0: 25
// r1: 0
// r2: 4700
// beta: 4066
// max adc: 1023
//Developer note:  does anyone have any accurate uptodate info on supplier/s of this part, please tell reprap-dev mailing list.
/* 
 Table temptable = {
 {1, 841},
 {54, 255},
 {107, 209},
 {160, 184},
 {213, 166},
 {266, 153},
 {319, 142},
 {372, 132},
 {425, 124},
 {478, 116},
 {531, 108},
 {584, 101},
 {637, 93},
 {690, 86},
 {743, 78},
 {796, 70},
 {849, 61},
 {902, 50},
 {955, 34},
 {1008, 3}
 };
 */


// Farnell code for this thermistor: 882-9586
// Made with createTemperatureLookup.py (http://svn.reprap.org/trunk/reprap/firmware/Arduino/utilities/createTemperatureLookup.py)
// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=4066 --max-adc=1023
// r0: 100000
// t0: 25
// r1: 0
// r2: 4700
// beta: 4066
// max adc: 1023
//Developer note:  does anyone have any accurate uptodate info on supplier/s of this part, please tell reprap-dev mailing list.
/*
 Table temptable = {
 {1, 841},
 {54, 255},
 {107, 209},
 {160, 184},
 {213, 166},
 {266, 153},
 {319, 142},
 {372, 132},
 {425, 124},
 {478, 116},
 {531, 108},
 {584, 101},
 {637, 93},
 {690, 86},
 {743, 78},
 {796, 70},
 {849, 61},
 {902, 50},
 {955, 34},
 {1008, 3}
 };
 */



// * Other thermistors...
// See this page:  
// http://www.reprap.org/wiki/Thermistor
// for details of what goes in this table, and how to make your own.

#endif //USE_THERMISTOR


void setupThermistors() {
  #if TEMP_SENSOR == TEMP_JAYCAR_NTC_125DEG_10K_THERMISTOR
  temptable = &a_temptable[0]; 
  #endif
  #if BED_TEMP_SENSOR == TEMP_JAYCAR_NTC_125DEG_10K_THERMISTOR
  bedtemptable = &a_temptable[0]; 
  #endif
  
  #if TEMP_SENSOR == TEMP_SENSOR_RS10K_THERMISTOR
  temptable = &b_temptable[0]; 
  #endif
  #if BED_TEMP_SENSOR == TEMP_SENSOR_RS10K_THERMISTOR
  bedtemptable = &b_temptable[0]; 
  #endif
  
  #if TEMP_SENSOR == TEMP_SENSOR_EPCOS540_THERMISTOR
  temptable = &c_temptable[0]; 
  #endif
  #if BED_TEMP_SENSOR == TEMP_SENSOR_EPCOS540_THERMISTOR
  bedtemptable = &c_temptable[0]; 
  #endif
  
  #if TEMP_SENSOR == TEMP_SENSOR_RRRF100K_THERMISTOR
  temptable = &d_temptable[0]; 
  #endif
  #if BED_TEMP_SENSOR == TEMP_SENSOR_RRRF100K_THERMISTOR
  bedtemptable = &d_temptable[0]; 
  #endif
  
  #if TEMP_SENSOR == TEMP_SENSOR_RRRF10K_THERMISTOR
  temptable = &e_temptable[0]; 
  #endif
  #if BED_TEMP_SENSOR == TEMP_SENSOR_RRRF10K_THERMISTOR
  bedtemptable = &e_temptable[0]; 
  #endif
}

#endif
Back to Top