Show Temperature ADC values

If "SHOW_TEMP_ADC_VALUES" is defined in Configuration_adv.h, the M105
command will present, after tradicional temperatures, the ADC value read
from temp sensors. This is great for adjusting thermistor tables with
thermocouple.

From Pronterface you can see the ADC value and compare with a
thermocouple reading.. then you just need to create your own thermistor
table.

Since this merge doesnt change the original information, it doesnt mess
with PC software parsing (tested under Pronterface and Repetier-Host).
This commit is contained in:
Alex Borro 2013-10-12 10:41:23 -03:00
parent 7fad13a1e2
commit dd3086d3f2
3 changed files with 35 additions and 0 deletions

View file

@ -40,6 +40,10 @@
#define AUTOTEMP_OLDWEIGHT 0.98
#endif
//Show Temperature ADC value
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT

View file

@ -1570,6 +1570,23 @@ void process_commands()
SERIAL_PROTOCOLPGM(" B@:");
SERIAL_PROTOCOL(getHeaterPower(-1));
#ifdef SHOW_TEMP_ADC_VALUES
#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
SERIAL_PROTOCOLPGM(" ADC B:");
SERIAL_PROTOCOL_F(degBed(),1);
SERIAL_PROTOCOLPGM("C->");
SERIAL_PROTOCOL_F(rawBedTemp()/OVERSAMPLENR,0);
#endif
for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
SERIAL_PROTOCOLPGM(" T");
SERIAL_PROTOCOL(cur_extruder);
SERIAL_PROTOCOLPGM(":");
SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
SERIAL_PROTOCOLPGM("C->");
SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder)/OVERSAMPLENR,0);
}
#endif
SERIAL_PROTOCOLLN("");
return;
break;

View file

@ -35,6 +35,10 @@ void manage_heater(); //it is critical that this is called periodically.
// do not use these routines and variables outside of temperature.cpp
extern int target_temperature[EXTRUDERS];
extern float current_temperature[EXTRUDERS];
#ifdef SHOW_TEMP_ADC_VALUES
extern int current_temperature_raw[EXTRUDERS];
extern int current_temperature_bed_raw;
#endif
extern int target_temperature_bed;
extern float current_temperature_bed;
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
@ -66,6 +70,16 @@ FORCE_INLINE float degHotend(uint8_t extruder) {
return current_temperature[extruder];
};
#ifdef SHOW_TEMP_ADC_VALUES
FORCE_INLINE float rawHotendTemp(uint8_t extruder) {
return current_temperature_raw[extruder];
};
FORCE_INLINE float rawBedTemp() {
return current_temperature_bed_raw;
};
#endif
FORCE_INLINE float degBed() {
return current_temperature_bed;
};