浏览代码

Chamber temperature monitoring and auto fan control.

This is an initial cut for feedback, updated for 2.0.x.

Chamber temperature is currently reported along with hot end and bed
temperatures to serial. The format is just like that used for hot end
and bed temperatures, but using 'C' prefix. As there is no heater,
target is always 0. Is this appropriate, is there a better way to report
chamber temperatures?

Chamber temperatures are not reported on the LCD in any way.

When auto chamber fan is enabled, it currently just uses the same
temperature threshold as the other auto controlled fans.

As the chamber temperature is not connected to any heater, it doesn't
undergo mintemp/maxtemp monitoring. This would need to change in the
future if chamber heating became a feature.
Lenbok 7 年前
父节点
当前提交
0e8242180d

+ 1
- 0
Marlin/Configuration.h 查看文件

316
 #define TEMP_SENSOR_3 0
316
 #define TEMP_SENSOR_3 0
317
 #define TEMP_SENSOR_4 0
317
 #define TEMP_SENSOR_4 0
318
 #define TEMP_SENSOR_BED 0
318
 #define TEMP_SENSOR_BED 0
319
+#define TEMP_SENSOR_CHAMBER 0
319
 
320
 
320
 // Dummy thermistor constant temperature readings, for use with 998 and 999
321
 // Dummy thermistor constant temperature readings, for use with 998 and 999
321
 #define DUMMY_THERMISTOR_998_VALUE 25
322
 #define DUMMY_THERMISTOR_998_VALUE 25

+ 1
- 0
Marlin/Configuration_adv.h 查看文件

230
 #define E2_AUTO_FAN_PIN -1
230
 #define E2_AUTO_FAN_PIN -1
231
 #define E3_AUTO_FAN_PIN -1
231
 #define E3_AUTO_FAN_PIN -1
232
 #define E4_AUTO_FAN_PIN -1
232
 #define E4_AUTO_FAN_PIN -1
233
+#define CHAMBER_AUTO_FAN_PIN -1
233
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
234
 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50
234
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
235
 #define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
235
 
236
 

+ 2
- 2
Marlin/src/HAL/HAL_AVR/fastio_AVR.h 查看文件

242
 
242
 
243
 //find out which harware PWMs are already in use
243
 //find out which harware PWMs are already in use
244
 #if PIN_EXISTS(CONTROLLER_FAN)
244
 #if PIN_EXISTS(CONTROLLER_FAN)
245
-  #define PWM_CHK_FAN_B(p) (p == CONTROLLER_FAN_PIN || p == E0_AUTO_FAN_PIN || p ==  E1_AUTO_FAN_PIN || p ==  E2_AUTO_FAN_PIN || p ==  E3_AUTO_FAN_PIN || p ==  E4_AUTO_FAN_PIN)
245
+  #define PWM_CHK_FAN_B(p) (p == CONTROLLER_FAN_PIN || p == E0_AUTO_FAN_PIN || p ==  E1_AUTO_FAN_PIN || p ==  E2_AUTO_FAN_PIN || p ==  E3_AUTO_FAN_PIN || p ==  E4_AUTO_FAN_PIN || p == CHAMBER_AUTO_FAN_PIN)
246
 #else
246
 #else
247
-  #define PWM_CHK_FAN_B(p) (p == E0_AUTO_FAN_PIN || p ==  E1_AUTO_FAN_PIN || p ==  E2_AUTO_FAN_PIN || p ==  E3_AUTO_FAN_PIN || p ==  E4_AUTO_FAN_PIN)
247
+  #define PWM_CHK_FAN_B(p) (p == E0_AUTO_FAN_PIN || p ==  E1_AUTO_FAN_PIN || p ==  E2_AUTO_FAN_PIN || p ==  E3_AUTO_FAN_PIN || p ==  E4_AUTO_FAN_PIN || p == CHAMBER_AUTO_FAN_PIN)
248
 #endif
248
 #endif
249
 
249
 
250
 #if PIN_EXISTS(FAN) || PIN_EXISTS(FAN1) || PIN_EXISTS(FAN2)
250
 #if PIN_EXISTS(FAN) || PIN_EXISTS(FAN1) || PIN_EXISTS(FAN2)

+ 18
- 2
Marlin/src/inc/Conditionals_post.h 查看文件

389
   #define BED_USES_THERMISTOR
389
   #define BED_USES_THERMISTOR
390
 #endif
390
 #endif
391
 
391
 
392
+#if TEMP_SENSOR_CHAMBER <= -2
393
+  #error "MAX6675 / MAX31855 Thermocouples not supported for TEMP_SENSOR_CHAMBER"
394
+#elif TEMP_SENSOR_CHAMBER == -1
395
+  #define CHAMBER_USES_AD595
396
+#elif TEMP_SENSOR_CHAMBER > 0
397
+  #define THERMISTORCHAMBER TEMP_SENSOR_CHAMBER
398
+  #define CHAMBER_USES_THERMISTOR
399
+#endif
400
+
392
 #ifdef __SAM3X8E__
401
 #ifdef __SAM3X8E__
393
   #define HEATER_USES_AD595 (ENABLED(HEATER_0_USES_AD595) || ENABLED(HEATER_1_USES_AD595) || ENABLED(HEATER_2_USES_AD595) || ENABLED(HEATER_3_USES_AD595))
402
   #define HEATER_USES_AD595 (ENABLED(HEATER_0_USES_AD595) || ENABLED(HEATER_1_USES_AD595) || ENABLED(HEATER_2_USES_AD595) || ENABLED(HEATER_3_USES_AD595))
394
 #endif
403
 #endif
754
 #define HAS_TEMP_4 (PIN_EXISTS(TEMP_4) && TEMP_SENSOR_4 != 0 && TEMP_SENSOR_4 > -2)
763
 #define HAS_TEMP_4 (PIN_EXISTS(TEMP_4) && TEMP_SENSOR_4 != 0 && TEMP_SENSOR_4 > -2)
755
 #define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
764
 #define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
756
 #define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2)
765
 #define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2)
757
-#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || HAS_TEMP_BED)
766
+#define HAS_TEMP_CHAMBER (PIN_EXISTS(TEMP_CHAMBER) && TEMP_SENSOR_CHAMBER != 0 && TEMP_SENSOR_CHAMBER > -2)
767
+#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || HAS_TEMP_BED || HAS_TEMP_CHAMBER)
758
 
768
 
759
 // Heaters
769
 // Heaters
760
 #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
770
 #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
775
 #define HAS_AUTO_FAN_2 (HOTENDS > 2 && PIN_EXISTS(E2_AUTO_FAN))
785
 #define HAS_AUTO_FAN_2 (HOTENDS > 2 && PIN_EXISTS(E2_AUTO_FAN))
776
 #define HAS_AUTO_FAN_3 (HOTENDS > 3 && PIN_EXISTS(E3_AUTO_FAN))
786
 #define HAS_AUTO_FAN_3 (HOTENDS > 3 && PIN_EXISTS(E3_AUTO_FAN))
777
 #define HAS_AUTO_FAN_4 (HOTENDS > 4 && PIN_EXISTS(E4_AUTO_FAN))
787
 #define HAS_AUTO_FAN_4 (HOTENDS > 4 && PIN_EXISTS(E4_AUTO_FAN))
778
-#define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3)
788
+#define HAS_AUTO_CHAMBER_FAN (PIN_EXISTS(CHAMBER_AUTO_FAN))
789
+#define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3 || HAS_AUTO_CHAMBER_FAN)
779
 #define AUTO_1_IS_0 (E1_AUTO_FAN_PIN == E0_AUTO_FAN_PIN)
790
 #define AUTO_1_IS_0 (E1_AUTO_FAN_PIN == E0_AUTO_FAN_PIN)
780
 #define AUTO_2_IS_0 (E2_AUTO_FAN_PIN == E0_AUTO_FAN_PIN)
791
 #define AUTO_2_IS_0 (E2_AUTO_FAN_PIN == E0_AUTO_FAN_PIN)
781
 #define AUTO_2_IS_1 (E2_AUTO_FAN_PIN == E1_AUTO_FAN_PIN)
792
 #define AUTO_2_IS_1 (E2_AUTO_FAN_PIN == E1_AUTO_FAN_PIN)
786
 #define AUTO_4_IS_1 (E4_AUTO_FAN_PIN == E1_AUTO_FAN_PIN)
797
 #define AUTO_4_IS_1 (E4_AUTO_FAN_PIN == E1_AUTO_FAN_PIN)
787
 #define AUTO_4_IS_2 (E4_AUTO_FAN_PIN == E2_AUTO_FAN_PIN)
798
 #define AUTO_4_IS_2 (E4_AUTO_FAN_PIN == E2_AUTO_FAN_PIN)
788
 #define AUTO_4_IS_3 (E4_AUTO_FAN_PIN == E3_AUTO_FAN_PIN)
799
 #define AUTO_4_IS_3 (E4_AUTO_FAN_PIN == E3_AUTO_FAN_PIN)
800
+#define AUTO_CHAMBER_IS_0 (CHAMBER_AUTO_FAN_PIN == E0_AUTO_FAN_PIN)
801
+#define AUTO_CHAMBER_IS_1 (CHAMBER_AUTO_FAN_PIN == E1_AUTO_FAN_PIN)
802
+#define AUTO_CHAMBER_IS_2 (CHAMBER_AUTO_FAN_PIN == E2_AUTO_FAN_PIN)
803
+#define AUTO_CHAMBER_IS_3 (CHAMBER_AUTO_FAN_PIN == E3_AUTO_FAN_PIN)
804
+#define AUTO_CHAMBER_IS_4 (CHAMBER_AUTO_FAN_PIN == E4_AUTO_FAN_PIN)
789
 
805
 
790
 // Other fans
806
 // Other fans
791
 #define HAS_FAN0 (PIN_EXISTS(FAN))
807
 #define HAS_FAN0 (PIN_EXISTS(FAN))

+ 85
- 6
Marlin/src/module/temperature.cpp 查看文件

83
 // public:
83
 // public:
84
 
84
 
85
 float Temperature::current_temperature[HOTENDS] = { 0.0 },
85
 float Temperature::current_temperature[HOTENDS] = { 0.0 },
86
+      Temperature::current_temperature_chamber = 0.0,
86
       Temperature::current_temperature_bed = 0.0;
87
       Temperature::current_temperature_bed = 0.0;
87
 
88
 
88
 int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 },
89
 int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 },
89
         Temperature::target_temperature[HOTENDS] = { 0 },
90
         Temperature::target_temperature[HOTENDS] = { 0 },
91
+        Temperature::current_temperature_chamber_raw = 0,
90
         Temperature::current_temperature_bed_raw = 0;
92
         Temperature::current_temperature_bed_raw = 0;
91
 
93
 
92
 #if ENABLED(AUTO_POWER_E_FANS)
94
 #if ENABLED(AUTO_POWER_E_FANS)
179
 #endif
181
 #endif
180
 
182
 
181
 uint16_t Temperature::raw_temp_value[MAX_EXTRUDERS] = { 0 },
183
 uint16_t Temperature::raw_temp_value[MAX_EXTRUDERS] = { 0 },
184
+         Temperature::raw_temp_chamber_value = 0,
182
          Temperature::raw_temp_bed_value = 0;
185
          Temperature::raw_temp_bed_value = 0;
183
 
186
 
184
 // Init min and max temp with extreme values to prevent false errors during startup
187
 // Init min and max temp with extreme values to prevent false errors during startup
550
 #if HAS_AUTO_FAN
553
 #if HAS_AUTO_FAN
551
 
554
 
552
   void Temperature::checkExtruderAutoFans() {
555
   void Temperature::checkExtruderAutoFans() {
553
-    static const pin_t fanPin[] PROGMEM = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN };
556
+    static const pin_t fanPin[] PROGMEM = { E0_AUTO_FAN_PIN, E1_AUTO_FAN_PIN, E2_AUTO_FAN_PIN, E3_AUTO_FAN_PIN, E4_AUTO_FAN_PIN, CHAMBER_AUTO_FAN_PIN };
554
     static const uint8_t fanBit[] PROGMEM = {
557
     static const uint8_t fanBit[] PROGMEM = {
555
                     0,
558
                     0,
556
       AUTO_1_IS_0 ? 0 :               1,
559
       AUTO_1_IS_0 ? 0 :               1,
557
       AUTO_2_IS_0 ? 0 : AUTO_2_IS_1 ? 1 :               2,
560
       AUTO_2_IS_0 ? 0 : AUTO_2_IS_1 ? 1 :               2,
558
       AUTO_3_IS_0 ? 0 : AUTO_3_IS_1 ? 1 : AUTO_3_IS_2 ? 2 :               3,
561
       AUTO_3_IS_0 ? 0 : AUTO_3_IS_1 ? 1 : AUTO_3_IS_2 ? 2 :               3,
559
-      AUTO_4_IS_0 ? 0 : AUTO_4_IS_1 ? 1 : AUTO_4_IS_2 ? 2 : AUTO_4_IS_3 ? 3 : 4
562
+      AUTO_4_IS_0 ? 0 : AUTO_4_IS_1 ? 1 : AUTO_4_IS_2 ? 2 : AUTO_4_IS_3 ? 3 : 4,
563
+      AUTO_CHAMBER_IS_0 ? 0 : AUTO_CHAMBER_IS_1 ? 1 : AUTO_CHAMBER_IS_2 ? 2 : AUTO_CHAMBER_IS_3 ? 3 : AUTO_CHAMBER_IS_4 ? 4 : 5
560
     };
564
     };
561
     uint8_t fanState = 0;
565
     uint8_t fanState = 0;
562
 
566
 
563
     HOTEND_LOOP()
567
     HOTEND_LOOP()
564
       if (current_temperature[e] > EXTRUDER_AUTO_FAN_TEMPERATURE)
568
       if (current_temperature[e] > EXTRUDER_AUTO_FAN_TEMPERATURE)
565
         SBI(fanState, pgm_read_byte(&fanBit[e]));
569
         SBI(fanState, pgm_read_byte(&fanBit[e]));
570
+    if (current_temperature_chamber > EXTRUDER_AUTO_FAN_TEMPERATURE)
571
+      SBI(fanState, pgm_read_byte(&fanBit[5]));
566
 
572
 
567
     uint8_t fanDone = 0;
573
     uint8_t fanDone = 0;
568
     for (uint8_t f = 0; f < COUNT(fanPin); f++) {
574
     for (uint8_t f = 0; f < COUNT(fanPin); f++) {
998
   }
1004
   }
999
 #endif // HAS_TEMP_BED
1005
 #endif // HAS_TEMP_BED
1000
 
1006
 
1007
+#if HAS_TEMP_CHAMBER
1008
+  // Derived from RepRap FiveD extruder::getTemperature()
1009
+  // For chamber temperature measurement.
1010
+  float Temperature::analog2tempChamber(const int raw) {
1011
+    #if ENABLED(CHAMBER_USES_THERMISTOR)
1012
+      float celsius = 0;
1013
+      byte i;
1014
+
1015
+      for (i = 1; i < CHAMBERTEMPTABLE_LEN; i++) {
1016
+        if (PGM_RD_W(CHAMBERTEMPTABLE[i][0]) > raw) {
1017
+          celsius  = PGM_RD_W(CHAMBERTEMPTABLE[i - 1][1]) +
1018
+                     (raw - PGM_RD_W(CHAMBERTEMPTABLE[i - 1][0])) *
1019
+                     (float)(PGM_RD_W(CHAMBERTEMPTABLE[i][1]) - PGM_RD_W(CHAMBERTEMPTABLE[i - 1][1])) /
1020
+                     (float)(PGM_RD_W(CHAMBERTEMPTABLE[i][0]) - PGM_RD_W(CHAMBERTEMPTABLE[i - 1][0]));
1021
+          break;
1022
+        }
1023
+      }
1024
+
1025
+      // Overflow: Set to last value in the table
1026
+      if (i == CHAMBERTEMPTABLE_LEN) celsius = PGM_RD_W(CHAMBERTEMPTABLE[i - 1][1]);
1027
+
1028
+      return celsius;
1029
+
1030
+    #elif defined(CHAMBER_USES_AD595)
1031
+
1032
+      return ((raw * ((5.0 * 100.0) / 1024.0) / OVERSAMPLENR) * (TEMP_SENSOR_AD595_GAIN)) + TEMP_SENSOR_AD595_OFFSET;
1033
+
1034
+    #else
1035
+
1036
+      UNUSED(raw);
1037
+      return 0;
1038
+
1039
+    #endif
1040
+  }
1041
+#endif // HAS_TEMP_CHAMBER
1042
+
1001
 /**
1043
 /**
1002
  * Get the raw values into the actual temperatures.
1044
  * Get the raw values into the actual temperatures.
1003
  * The raw values are created in interrupt context,
1045
  * The raw values are created in interrupt context,
1013
   #if HAS_TEMP_BED
1055
   #if HAS_TEMP_BED
1014
     current_temperature_bed = Temperature::analog2tempBed(current_temperature_bed_raw);
1056
     current_temperature_bed = Temperature::analog2tempBed(current_temperature_bed_raw);
1015
   #endif
1057
   #endif
1058
+  #if HAS_TEMP_CHAMBER
1059
+    current_temperature_chamber = Temperature::analog2tempChamber(current_temperature_chamber_raw);
1060
+  #endif
1016
   #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
1061
   #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
1017
     redundant_temperature = Temperature::analog2temp(redundant_temperature_raw, 1);
1062
     redundant_temperature = Temperature::analog2temp(redundant_temperature_raw, 1);
1018
   #endif
1063
   #endif
1076
     inited = true;
1121
     inited = true;
1077
   #endif
1122
   #endif
1078
 
1123
 
1079
-  #if MB(RUMBA) && (TEMP_SENSOR_0 == -1 || TEMP_SENSOR_1 == -1 || TEMP_SENSOR_2 == -1 || TEMP_SENSOR_BED == -1)
1124
+  #if MB(RUMBA) && (TEMP_SENSOR_0 == -1 || TEMP_SENSOR_1 == -1 || TEMP_SENSOR_2 == -1 || TEMP_SENSOR_BED == -1 || TEMP_SENSOR_CHAMBER == -1)
1080
     // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
1125
     // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
1081
     MCUCR = _BV(JTD);
1126
     MCUCR = _BV(JTD);
1082
     MCUCR = _BV(JTD);
1127
     MCUCR = _BV(JTD);
1162
   #if HAS_TEMP_BED
1207
   #if HAS_TEMP_BED
1163
     HAL_ANALOG_SELECT(TEMP_BED_PIN);
1208
     HAL_ANALOG_SELECT(TEMP_BED_PIN);
1164
   #endif
1209
   #endif
1210
+  #if HAS_TEMP_CHAMBER
1211
+    HAL_ANALOG_SELECT(TEMP_CHAMBER_PIN);
1212
+  #endif
1165
   #if ENABLED(FILAMENT_WIDTH_SENSOR)
1213
   #if ENABLED(FILAMENT_WIDTH_SENSOR)
1166
     HAL_ANALOG_SELECT(FILWIDTH_PIN);
1214
     HAL_ANALOG_SELECT(FILWIDTH_PIN);
1167
   #endif
1215
   #endif
1227
       SET_OUTPUT(E4_AUTO_FAN_PIN);
1275
       SET_OUTPUT(E4_AUTO_FAN_PIN);
1228
     #endif
1276
     #endif
1229
   #endif
1277
   #endif
1278
+  #if HAS_AUTO_CHAMBER_FAN && !AUTO_CHAMBER_IS_0 && !AUTO_CHAMBER_IS_1 && !AUTO_CHAMBER_IS_2 && !AUTO_CHAMBER_IS_3 && ! AUTO_CHAMBER_IS_4
1279
+    #if CHAMBER_AUTO_FAN_PIN == FAN1_PIN
1280
+      SET_OUTPUT(CHAMBER_AUTO_FAN_PIN);
1281
+      #if ENABLED(FAST_PWM_FAN)
1282
+        setPwmFrequency(CHAMBER_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
1283
+      #endif
1284
+    #else
1285
+      SET_OUTPUT(CHAMBER_AUTO_FAN_PIN);
1286
+    #endif
1287
+  #endif
1230
 
1288
 
1231
   // Wait for temperature measurement to settle
1289
   // Wait for temperature measurement to settle
1232
   delay(250);
1290
   delay(250);
1630
     #endif
1688
     #endif
1631
   #endif
1689
   #endif
1632
   current_temperature_bed_raw = raw_temp_bed_value;
1690
   current_temperature_bed_raw = raw_temp_bed_value;
1691
+  current_temperature_chamber_raw = raw_temp_chamber_value;
1633
   temp_meas_ready = true;
1692
   temp_meas_ready = true;
1634
 }
1693
 }
1635
 
1694
 
1994
         break;
2053
         break;
1995
     #endif
2054
     #endif
1996
 
2055
 
2056
+    #if HAS_TEMP_CHAMBER
2057
+      case PrepareTemp_CHAMBER:
2058
+        HAL_START_ADC(TEMP_CHAMBER_PIN);
2059
+        break;
2060
+      case MeasureTemp_CHAMBER:
2061
+        raw_temp_chamber_value += ADC;
2062
+        break;
2063
+    #endif
2064
+
1997
     #if HAS_TEMP_1
2065
     #if HAS_TEMP_1
1998
       case PrepareTemp_1:
2066
       case PrepareTemp_1:
1999
         HAL_START_ADC(TEMP_1_PIN);
2067
         HAL_START_ADC(TEMP_1_PIN);
2080
 
2148
 
2081
     ZERO(raw_temp_value);
2149
     ZERO(raw_temp_value);
2082
     raw_temp_bed_value = 0;
2150
     raw_temp_bed_value = 0;
2151
+    raw_temp_chamber_value = 0;
2083
 
2152
 
2084
     #define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) > (HEATER_##N##_RAW_HI_TEMP) ? -1 : 1)
2153
     #define TEMPDIR(N) ((HEATER_##N##_RAW_LO_TEMP) > (HEATER_##N##_RAW_HI_TEMP) ? -1 : 1)
2085
 
2154
 
2191
     #if NUM_SERIAL > 1
2260
     #if NUM_SERIAL > 1
2192
       , const int8_t port=-1
2261
       , const int8_t port=-1
2193
     #endif
2262
     #endif
2194
-    , const int8_t e=-2
2263
+    , const int8_t e=-3
2195
   ) {
2264
   ) {
2196
-    #if !(HAS_TEMP_BED && HAS_TEMP_HOTEND) && HOTENDS <= 1
2265
+    #if !(HAS_TEMP_BED && HAS_TEMP_HOTEND && HAS_TEMP_CHAMBER) && HOTENDS <= 1
2197
       UNUSED(e);
2266
       UNUSED(e);
2198
     #endif
2267
     #endif
2199
 
2268
 
2200
     SERIAL_PROTOCOLCHAR_P(port, ' ');
2269
     SERIAL_PROTOCOLCHAR_P(port, ' ');
2201
     SERIAL_PROTOCOLCHAR_P(port,
2270
     SERIAL_PROTOCOLCHAR_P(port,
2202
-      #if HAS_TEMP_BED && HAS_TEMP_HOTEND
2271
+      #if HAS_TEMP_CHAMBER && HAS_TEMP_BED && HAS_TEMP_HOTEND
2272
+        e == -2 ? 'C' : e == -1 ? 'B' : 'T'
2273
+      #elif HAS_TEMP_BED && HAS_TEMP_HOTEND
2203
         e == -1 ? 'B' : 'T'
2274
         e == -1 ? 'B' : 'T'
2204
       #elif HAS_TEMP_HOTEND
2275
       #elif HAS_TEMP_HOTEND
2205
         'T'
2276
         'T'
2246
         , -1 // BED
2317
         , -1 // BED
2247
       );
2318
       );
2248
     #endif
2319
     #endif
2320
+    #if HAS_TEMP_CHAMBER
2321
+      print_heater_state(degChamber(), 0
2322
+        #if ENABLED(SHOW_TEMP_ADC_VALUES)
2323
+          , rawChamberTemp()
2324
+        #endif
2325
+        , -2 // CHAMBER
2326
+      );
2327
+    #endif
2249
     #if HOTENDS > 1
2328
     #if HOTENDS > 1
2250
       HOTEND_LOOP() print_heater_state(degHotend(e), degTargetHotend(e)
2329
       HOTEND_LOOP() print_heater_state(degHotend(e), degTargetHotend(e)
2251
         #if ENABLED(SHOW_TEMP_ADC_VALUES)
2330
         #if ENABLED(SHOW_TEMP_ADC_VALUES)

+ 12
- 0
Marlin/src/module/temperature.h 查看文件

74
     PrepareTemp_BED,
74
     PrepareTemp_BED,
75
     MeasureTemp_BED,
75
     MeasureTemp_BED,
76
   #endif
76
   #endif
77
+  #if HAS_TEMP_CHAMBER
78
+    PrepareTemp_CHAMBER,
79
+    MeasureTemp_CHAMBER,
80
+  #endif
77
   #if ENABLED(FILAMENT_WIDTH_SENSOR)
81
   #if ENABLED(FILAMENT_WIDTH_SENSOR)
78
     Prepare_FILWIDTH,
82
     Prepare_FILWIDTH,
79
     Measure_FILWIDTH,
83
     Measure_FILWIDTH,
113
   public:
117
   public:
114
 
118
 
115
     static float current_temperature[HOTENDS],
119
     static float current_temperature[HOTENDS],
120
+                 current_temperature_chamber,
116
                  current_temperature_bed;
121
                  current_temperature_bed;
117
     static int16_t current_temperature_raw[HOTENDS],
122
     static int16_t current_temperature_raw[HOTENDS],
118
                    target_temperature[HOTENDS],
123
                    target_temperature[HOTENDS],
124
+                   current_temperature_chamber_raw,
119
                    current_temperature_bed_raw;
125
                    current_temperature_bed_raw;
120
 
126
 
121
     #if ENABLED(AUTO_POWER_E_FANS)
127
     #if ENABLED(AUTO_POWER_E_FANS)
244
     #endif
250
     #endif
245
 
251
 
246
     static uint16_t raw_temp_value[MAX_EXTRUDERS],
252
     static uint16_t raw_temp_value[MAX_EXTRUDERS],
253
+                    raw_temp_chamber_value,
247
                     raw_temp_bed_value;
254
                     raw_temp_bed_value;
248
 
255
 
249
     // Init min and max temp with extreme values to prevent false errors during startup
256
     // Init min and max temp with extreme values to prevent false errors during startup
315
     #if HAS_TEMP_BED
322
     #if HAS_TEMP_BED
316
       static float analog2tempBed(const int raw);
323
       static float analog2tempBed(const int raw);
317
     #endif
324
     #endif
325
+    #if HAS_TEMP_CHAMBER
326
+      static float analog2tempChamber(const int raw);
327
+    #endif
318
 
328
 
319
     /**
329
     /**
320
      * Called from the Temperature ISR
330
      * Called from the Temperature ISR
369
       return current_temperature[HOTEND_INDEX];
379
       return current_temperature[HOTEND_INDEX];
370
     }
380
     }
371
     FORCE_INLINE static float degBed() { return current_temperature_bed; }
381
     FORCE_INLINE static float degBed() { return current_temperature_bed; }
382
+    FORCE_INLINE static float degChamber() { return current_temperature_chamber; }
372
 
383
 
373
     #if ENABLED(SHOW_TEMP_ADC_VALUES)
384
     #if ENABLED(SHOW_TEMP_ADC_VALUES)
374
       FORCE_INLINE static int16_t rawHotendTemp(const uint8_t e) {
385
       FORCE_INLINE static int16_t rawHotendTemp(const uint8_t e) {
378
         return current_temperature_raw[HOTEND_INDEX];
389
         return current_temperature_raw[HOTEND_INDEX];
379
       }
390
       }
380
       FORCE_INLINE static int16_t rawBedTemp() { return current_temperature_bed_raw; }
391
       FORCE_INLINE static int16_t rawBedTemp() { return current_temperature_bed_raw; }
392
+      FORCE_INLINE static int16_t rawChamberTemp() { return current_temperature_chamber_raw; }
381
     #endif
393
     #endif
382
 
394
 
383
     FORCE_INLINE static int16_t degTargetHotend(const uint8_t e) {
395
     FORCE_INLINE static int16_t degTargetHotend(const uint8_t e) {

+ 4
- 0
Marlin/src/module/thermistor/thermistor_20.h 查看文件

47
   #define HEATER_BED_RAW_HI_TEMP 16383
47
   #define HEATER_BED_RAW_HI_TEMP 16383
48
   #define HEATER_BED_RAW_LO_TEMP 0
48
   #define HEATER_BED_RAW_LO_TEMP 0
49
 #endif
49
 #endif
50
+#if THERMISTORCHAMBER == 20
51
+  #define HEATER_CHAMBER_RAW_HI_TEMP 16383
52
+  #define HEATER_CHAMBER_RAW_LO_TEMP 0
53
+#endif
50
 const short temptable_20[][2] PROGMEM = {
54
 const short temptable_20[][2] PROGMEM = {
51
   { OV(  0),    0 },
55
   { OV(  0),    0 },
52
   { OV(227),    1 },
56
   { OV(227),    1 },

+ 19
- 1
Marlin/src/module/thermistor/thermistors.h 查看文件

28
 #define OVERSAMPLENR 16
28
 #define OVERSAMPLENR 16
29
 #define OV(N) int16_t((N) * (OVERSAMPLENR))
29
 #define OV(N) int16_t((N) * (OVERSAMPLENR))
30
 
30
 
31
-#define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORHEATER_4 == n || THERMISTORBED == n)
31
+#define ANY_THERMISTOR_IS(n) (THERMISTORHEATER_0 == n || THERMISTORHEATER_1 == n || THERMISTORHEATER_2 == n || THERMISTORHEATER_3 == n || THERMISTORHEATER_4 == n || THERMISTORBED == n || THERMISTORCHAMBER == n)
32
 
32
 
33
 // Pt1000 and Pt100 handling
33
 // Pt1000 and Pt100 handling
34
 //
34
 //
190
   #endif
190
   #endif
191
 #endif
191
 #endif
192
 
192
 
193
+#ifdef THERMISTORCHAMBER
194
+  #define CHAMBERTEMPTABLE TT_NAME(THERMISTORCHAMBER)
195
+  #define CHAMBERTEMPTABLE_LEN COUNT(CHAMBERTEMPTABLE)
196
+#else
197
+  #ifdef CHAMBER_USES_THERMISTOR
198
+    #error "No chamber thermistor table specified"
199
+  #endif
200
+#endif
201
+
193
 // Set the high and low raw values for the heaters
202
 // Set the high and low raw values for the heaters
194
 // For thermistors the highest temperature results in the lowest ADC value
203
 // For thermistors the highest temperature results in the lowest ADC value
195
 // For thermocouples the highest temperature results in the highest ADC value
204
 // For thermocouples the highest temperature results in the highest ADC value
247
     #define HEATER_BED_RAW_LO_TEMP 0
256
     #define HEATER_BED_RAW_LO_TEMP 0
248
   #endif
257
   #endif
249
 #endif
258
 #endif
259
+#ifndef HEATER_CHAMBER_RAW_HI_TEMP
260
+  #ifdef CHAMBER_USES_THERMISTOR
261
+    #define HEATER_CHAMBER_RAW_HI_TEMP 0
262
+    #define HEATER_CHAMBER_RAW_LO_TEMP 16383
263
+  #else
264
+    #define HEATER_CHAMBER_RAW_HI_TEMP 16383
265
+    #define HEATER_CHAMBER_RAW_LO_TEMP 0
266
+  #endif
267
+#endif
250
 
268
 
251
 #endif // THERMISTORS_H_
269
 #endif // THERMISTORS_H_

+ 7
- 0
Marlin/src/pins/pins.h 查看文件

618
     #define E4_AUTO_FAN_PIN -1
618
     #define E4_AUTO_FAN_PIN -1
619
   #endif
619
   #endif
620
 #endif
620
 #endif
621
+#ifndef CHAMBER_AUTO_FAN_PIN
622
+  #ifdef ORIG_CHAMBER_AUTO_FAN_PIN
623
+    #define CHAMBER_AUTO_FAN_PIN ORIG_CHAMBER_AUTO_FAN_PIN
624
+  #else
625
+    #define CHAMBER_AUTO_FAN_PIN -1
626
+  #endif
627
+#endif
621
 
628
 
622
 // List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
629
 // List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
623
 #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN, E0_CS_PIN,
630
 #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN, E0_CS_PIN,

+ 3
- 3
Marlin/src/pins/pinsDebug_list.h 查看文件

83
 #if PIN_EXISTS(TEMP_CHAMBER) && TEMP_CHAMBER_PIN < NUM_ANALOG_INPUTS
83
 #if PIN_EXISTS(TEMP_CHAMBER) && TEMP_CHAMBER_PIN < NUM_ANALOG_INPUTS
84
   REPORT_NAME_ANALOG(__LINE__, TEMP_CHAMBER_PIN)
84
   REPORT_NAME_ANALOG(__LINE__, TEMP_CHAMBER_PIN)
85
 #endif
85
 #endif
86
-#if PIN_EXISTS(TEMP_X) && TEMP_X_PIN < NUM_ANALOG_INPUTS
87
-  REPORT_NAME_ANALOG(__LINE__, TEMP_X_PIN)
88
-#endif
89
 #if PIN_EXISTS(ADC_KEYPAD) && ADC_KEYPAD_PIN < NUM_ANALOG_INPUTS
86
 #if PIN_EXISTS(ADC_KEYPAD) && ADC_KEYPAD_PIN < NUM_ANALOG_INPUTS
90
   REPORT_NAME_ANALOG(__LINE__, ADC_KEYPAD_PIN)
87
   REPORT_NAME_ANALOG(__LINE__, ADC_KEYPAD_PIN)
91
 #endif
88
 #endif
166
 #if PIN_EXISTS(CASE_LIGHT)
163
 #if PIN_EXISTS(CASE_LIGHT)
167
   REPORT_NAME_DIGITAL(__LINE__, CASE_LIGHT_PIN)
164
   REPORT_NAME_DIGITAL(__LINE__, CASE_LIGHT_PIN)
168
 #endif
165
 #endif
166
+#if PIN_EXISTS(CHAMBER_AUTO_FAN)
167
+  REPORT_NAME_DIGITAL(__LINE__, CHAMBER_AUTO_FAN_PIN)
168
+#endif
169
 #if PIN_EXISTS(CONTROLLER_FAN)
169
 #if PIN_EXISTS(CONTROLLER_FAN)
170
   REPORT_NAME_DIGITAL(__LINE__, CONTROLLER_FAN_PIN)
170
   REPORT_NAME_DIGITAL(__LINE__, CONTROLLER_FAN_PIN)
171
 #endif
171
 #endif

+ 1
- 0
Marlin/src/pins/pins_RUMBA.h 查看文件

107
 
107
 
108
 // optional for extruder 4 or chamber:
108
 // optional for extruder 4 or chamber:
109
 //#define TEMP_X_PIN         12   // Analog Input (default connector for thermistor *T3* on rumba board is used)
109
 //#define TEMP_X_PIN         12   // Analog Input (default connector for thermistor *T3* on rumba board is used)
110
+//#define TEMP_CHAMBER_PIN   12   // Analog Input (default connector for thermistor *T3* on rumba board is used)
110
 
111
 
111
 #if TEMP_SENSOR_BED == -1
112
 #if TEMP_SENSOR_BED == -1
112
   #define TEMP_BED_PIN      7   // Analog Input (connector *K3* on RUMBA thermocouple ADD ON is used <-- this can't be used when TEMP_SENSOR_2 is defined as thermocouple)
113
   #define TEMP_BED_PIN      7   // Analog Input (connector *K3* on RUMBA thermocouple ADD ON is used <-- this can't be used when TEMP_SENSOR_2 is defined as thermocouple)

正在加载...
取消
保存