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