Browse Source

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).
Alex Borro 11 years ago
parent
commit
dd3086d3f2
3 changed files with 35 additions and 0 deletions
  1. 4
    0
      Marlin/Configuration_adv.h
  2. 17
    0
      Marlin/Marlin_main.cpp
  3. 14
    0
      Marlin/temperature.h

+ 4
- 0
Marlin/Configuration_adv.h View File

40
   #define AUTOTEMP_OLDWEIGHT 0.98
40
   #define AUTOTEMP_OLDWEIGHT 0.98
41
 #endif
41
 #endif
42
 
42
 
43
+//Show Temperature ADC value
44
+//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
45
+//#define SHOW_TEMP_ADC_VALUES
46
+
43
 //  extruder run-out prevention. 
47
 //  extruder run-out prevention. 
44
 //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
48
 //if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
45
 //#define EXTRUDER_RUNOUT_PREVENT  
49
 //#define EXTRUDER_RUNOUT_PREVENT  

+ 17
- 0
Marlin/Marlin_main.cpp View File

1570
         SERIAL_PROTOCOLPGM(" B@:");
1570
         SERIAL_PROTOCOLPGM(" B@:");
1571
         SERIAL_PROTOCOL(getHeaterPower(-1));
1571
         SERIAL_PROTOCOL(getHeaterPower(-1));
1572
 
1572
 
1573
+        #ifdef SHOW_TEMP_ADC_VALUES
1574
+          #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
1575
+            SERIAL_PROTOCOLPGM("    ADC B:");
1576
+            SERIAL_PROTOCOL_F(degBed(),1);
1577
+            SERIAL_PROTOCOLPGM("C->");
1578
+            SERIAL_PROTOCOL_F(rawBedTemp()/OVERSAMPLENR,0);
1579
+          #endif
1580
+          for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
1581
+            SERIAL_PROTOCOLPGM("  T");
1582
+            SERIAL_PROTOCOL(cur_extruder);
1583
+            SERIAL_PROTOCOLPGM(":");
1584
+            SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
1585
+            SERIAL_PROTOCOLPGM("C->");
1586
+            SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder)/OVERSAMPLENR,0);
1587
+          }
1588
+        #endif
1589
+		
1573
         SERIAL_PROTOCOLLN("");
1590
         SERIAL_PROTOCOLLN("");
1574
       return;
1591
       return;
1575
       break;
1592
       break;

+ 14
- 0
Marlin/temperature.h View File

35
 // do not use these routines and variables outside of temperature.cpp
35
 // do not use these routines and variables outside of temperature.cpp
36
 extern int target_temperature[EXTRUDERS];  
36
 extern int target_temperature[EXTRUDERS];  
37
 extern float current_temperature[EXTRUDERS];
37
 extern float current_temperature[EXTRUDERS];
38
+#ifdef SHOW_TEMP_ADC_VALUES
39
+  extern int current_temperature_raw[EXTRUDERS];
40
+  extern int current_temperature_bed_raw;
41
+#endif
38
 extern int target_temperature_bed;
42
 extern int target_temperature_bed;
39
 extern float current_temperature_bed;
43
 extern float current_temperature_bed;
40
 #ifdef TEMP_SENSOR_1_AS_REDUNDANT
44
 #ifdef TEMP_SENSOR_1_AS_REDUNDANT
66
   return current_temperature[extruder];
70
   return current_temperature[extruder];
67
 };
71
 };
68
 
72
 
73
+#ifdef SHOW_TEMP_ADC_VALUES
74
+  FORCE_INLINE float rawHotendTemp(uint8_t extruder) {  
75
+    return current_temperature_raw[extruder];
76
+  };
77
+
78
+  FORCE_INLINE float rawBedTemp() {  
79
+    return current_temperature_bed_raw;
80
+  };
81
+#endif
82
+
69
 FORCE_INLINE float degBed() {
83
 FORCE_INLINE float degBed() {
70
   return current_temperature_bed;
84
   return current_temperature_bed;
71
 };
85
 };

Loading…
Cancel
Save