From f205bff2ccdaea55e2dc9e6fa1f98820a9761d42 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Wed, 19 Aug 2020 09:49:46 +0200 Subject: [PATCH] Fix PSU on for PID autotune (#19066) --- Marlin/src/feature/power.cpp | 5 ++--- Marlin/src/module/temperature.cpp | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 74850122c2..5be554e5e4 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -59,7 +59,6 @@ bool Power::is_power_needed() { // If any of the drivers or the bed are enabled... if (X_ENABLE_READ() == X_ENABLE_ON || Y_ENABLE_READ() == Y_ENABLE_ON || Z_ENABLE_READ() == Z_ENABLE_ON - || TERN0(HAS_HEATED_BED, thermalManager.temp_bed.soft_pwm_amount > 0) #if HAS_X2_ENABLE || X2_ENABLE_READ() == X_ENABLE_ON #endif @@ -75,8 +74,8 @@ bool Power::is_power_needed() { #endif ) return true; - HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0) return true; - if (TERN0(HAS_HEATED_BED, thermalManager.degTargetBed() > 0)) return true; + HOTEND_LOOP() if (thermalManager.degTargetHotend(e) > 0 || thermalManager.temp_hotend[e].soft_pwm_amount > 0) return true; + if (TERN0(HAS_HEATED_BED, thermalManager.degTargetBed() > 0 || thermalManager.temp_bed.soft_pwm_amount > 0)) return true; #if HAS_HOTEND && AUTO_POWER_E_TEMP HOTEND_LOOP() if (thermalManager.degHotend(e) >= AUTO_POWER_E_TEMP) return true; diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 1dc480a927..a217fc9ab8 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -444,6 +444,7 @@ volatile bool Temperature::raw_temps_ready = false; LEDColor color = ONHEATINGSTART(); #endif + TERN_(AUTO_POWER_CONTROL, powerManager.power_on()); TERN_(NO_FAN_SLOWING_IN_PID_TUNING, adaptive_fan_slowing = false); // PID Tuning loop