Issue with AD8495 (Type 61) Thermocouple Temp Table
I'm in the process of building a new printer and I've run into an issue with the extruder temperature sensor displaying the wrong temp.
My setup is as follows:
Repetier Firmware: v1.0.1dev
RADDS 1.5
Arduino DUE R3e (genuine)
Adafruit AD8495 Thermocouple amplifier - https://www.adafruit.com/product/1778
Type-K Insulated Thermocouple - https://www.adafruit.com/product/3245
I've wired the AD8495 up to the AUX ADC pins on the RADDS board (3.3v - ADC - GND) and verified that everything is working. When i check the temperature, it is showing as 256°C on the printers LCD display. I've tried swapping out the AD8495 and the thermocouple and every time I get around the same reading. I tried manually heating and cooling the thermocouple and verified that the temp displayed rose and fell accordingly.
After much head scratching, I happened to notice that the enclosure temp display in Octopi was sitting at 25.6°C.
It would appear that the temp table for Type 61 thermocouple is off by one full decimal place. Anyone have any ideas on how to correct?
Comments
case 61: // AD8495 1.25V Vref offset (like Adafruit 8495 breakout board)
#if CPU_ARCH == ARCH_AVR
currentTemperatureC = ((float)currentTemperature * 1000.0f / (1024 << (2 - ANALOG_REDUCE_BITS))) - 250.0f;
#else
currentTemperatureC = ((float)currentTemperature * 660.0f / (1024 << (2 - ANALOG_REDUCE_BITS))) - 250.0f;
#endif
currentTemperature is the read analog value 0-4095 so temperature will vary between -250 and 410°C. It might be necessary to use the same equation as AVR if voltage is scaled with 5V base, so replace 660 by 1000.
It is also very important to use the ADC at the side and not the themistor inputs which are in series with a 4.7K resistor!
#if CPU_ARCH == ARCH_AVR
currentTemperatureC = ((float)currentTemperature * 1000.0f / (1024 << (2 - ANALOG_REDUCE_BITS))) - 250.0f;
#else
// currentTemperatureC = ((float)currentTemperature * 660.0f / (1024 << (2 - ANALOG_REDUCE_BITS))) - 250.0f;
currentTemperatureC = ((float)currentTemperature * 1000.0f / (1024 << (2 - ANALOG_REDUCE_BITS))) - 250.0f;
#endif