Sfoglia il codice sorgente

Chamber vent/fan followup

Scott Lahteine 4 anni fa
parent
commit
6f6901180c
1 ha cambiato i file con 9 aggiunte e 9 eliminazioni
  1. 9
    9
      Marlin/src/module/temperature.cpp

+ 9
- 9
Marlin/src/module/temperature.cpp Vedi File

@@ -1210,13 +1210,13 @@ void Temperature::manage_heater() {
1210 1210
           #if CHAMBER_FAN_MODE == 0
1211 1211
             fan_chamber_pwm = CHAMBER_FAN_BASE
1212 1212
           #elif CHAMBER_FAN_MODE == 1
1213
-            fan_chamber_pwm = temp_chamber.celsius > temp_chamber.target ? CHAMBER_FAN_BASE + ((temp_chamber.celsius - temp_chamber.target)  * CHAMBER_FAN_FACTOR ) : 0;
1213
+            fan_chamber_pwm = (temp_chamber.celsius > temp_chamber.target) ? (CHAMBER_FAN_BASE) + (CHAMBER_FAN_FACTOR) * (temp_chamber.celsius - temp_chamber.target) : 0;
1214 1214
           #elif CHAMBER_FAN_MODE == 2
1215 1215
             fan_chamber_pwm = (CHAMBER_FAN_BASE) + (CHAMBER_FAN_FACTOR) * ABS(temp_chamber.celsius - temp_chamber.target);
1216 1216
             if (temp_chamber.soft_pwm_amount)
1217 1217
               fan_chamber_pwm += (CHAMBER_FAN_FACTOR) * 2;
1218 1218
           #endif
1219
-          fan_chamber_pwm = _MIN(225, fan_chamber_pwm);
1219
+          NOMORE(fan_chamber_pwm, 225);
1220 1220
           thermalManager.set_fan_speed(2, fan_chamber_pwm); // TODO: instead of fan 2, set to chamber fan
1221 1221
         #endif
1222 1222
 
@@ -1261,7 +1261,13 @@ void Temperature::manage_heater() {
1261 1261
       next_chamber_check_ms = ms + CHAMBER_CHECK_INTERVAL;
1262 1262
 
1263 1263
       if (WITHIN(temp_chamber.celsius, CHAMBER_MINTEMP, CHAMBER_MAXTEMP)) {
1264
-        if (!flag_chamber_excess_heat){
1264
+        if (flag_chamber_excess_heat) {
1265
+          temp_chamber.soft_pwm_amount = 0;
1266
+          #if ENABLED(CHAMBER_VENT)
1267
+            if (!flag_chamber_off) MOVE_SERVO(CHAMBER_VENT_SERVO_NR, temp_chamber.celsius <= temp_chamber.target ? 0 : 90);
1268
+          #endif
1269
+        }
1270
+        else {
1265 1271
           #if ENABLED(CHAMBER_LIMIT_SWITCHING)
1266 1272
             if (temp_chamber.celsius >= temp_chamber.target + TEMP_CHAMBER_HYSTERESIS)
1267 1273
               temp_chamber.soft_pwm_amount = 0;
@@ -1274,12 +1280,6 @@ void Temperature::manage_heater() {
1274 1280
             if (!flag_chamber_off) MOVE_SERVO(CHAMBER_VENT_SERVO_NR, 0);
1275 1281
           #endif
1276 1282
         }
1277
-        else {
1278
-          temp_chamber.soft_pwm_amount = 0;
1279
-          #if ENABLED(CHAMBER_VENT)
1280
-            if (!flag_chamber_off) MOVE_SERVO(CHAMBER_VENT_SERVO_NR, temp_chamber.celsius <= temp_chamber.target ? 0 : 90);
1281
-          #endif
1282
-        }
1283 1283
       }
1284 1284
       else {
1285 1285
         temp_chamber.soft_pwm_amount = 0;

Loading…
Annulla
Salva