From 4e6fe658cbfd70e6e47eb9747444ac07bc353cc4 Mon Sep 17 00:00:00 2001 From: jay Date: Fri, 23 Oct 2015 21:56:46 -0700 Subject: [PATCH] fix PWM limit control --- src/ArduinoAVR/Repetier/Extruder.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ArduinoAVR/Repetier/Extruder.cpp b/src/ArduinoAVR/Repetier/Extruder.cpp index da4ba370f..4722a630b 100644 --- a/src/ArduinoAVR/Repetier/Extruder.cpp +++ b/src/ArduinoAVR/Repetier/Extruder.cpp @@ -252,14 +252,20 @@ void Extruder::manageTemperatures() if(act->currentTemperatureC > MAXTEMP) // Force heater off if MAXTEMP is exceeded output = 0; #endif - if (controller == 0) + // limit PMW if we are not a bed controller, to support stock 12V or 19V heaters + if (act != &heatedBedController) { - output *= EXT0_MAX_PWM; - } - else if (controller == 1) - { - output *= EXT1_MAX_PWM; + if (controller == 0) + { + output *= EXT0_MAX_PWM; + } + else if (controller == 1) + { + output *= EXT1_MAX_PWM; + } } + + pwm_pos[act->pwmIndex] = output; // set pwm signal #if LED_PIN > -1 if(act == &Extruder::current->tempControl)