Bed Heater monitoring in Controller Fan

In some cases the Bed Heater FET heats up more then stepper drivers, so
this change add the bed monitoring to the controller fan. As soon as the
bed heater is turned on, the controller fan will run as well.
This commit is contained in:
Alex Borro 2013-11-27 23:23:06 -02:00
parent b33375d438
commit 5c44f6c434
3 changed files with 8 additions and 2 deletions

View file

@ -3065,7 +3065,7 @@ void controllerFan()
{ {
lastMotorCheck = millis(); lastMotorCheck = millis();
if(!READ(X_ENABLE_PIN) || !READ(Y_ENABLE_PIN) || !READ(Z_ENABLE_PIN) if(!READ(X_ENABLE_PIN) || !READ(Y_ENABLE_PIN) || !READ(Z_ENABLE_PIN) || (soft_pwm_bed > 0)
#if EXTRUDERS > 2 #if EXTRUDERS > 2
|| !READ(E2_ENABLE_PIN) || !READ(E2_ENABLE_PIN)
#endif #endif

View file

@ -66,6 +66,8 @@ float current_temperature_bed = 0.0;
unsigned char fanSpeedSoftPwm; unsigned char fanSpeedSoftPwm;
#endif #endif
unsigned char soft_pwm_bed;
#ifdef BABYSTEPPING #ifdef BABYSTEPPING
volatile int babystepsTodo[3]={0,0,0}; volatile int babystepsTodo[3]={0,0,0};
#endif #endif
@ -105,7 +107,7 @@ static volatile bool temp_meas_ready = false;
static unsigned long previous_millis_bed_heater; static unsigned long previous_millis_bed_heater;
#endif //PIDTEMPBED #endif //PIDTEMPBED
static unsigned char soft_pwm[EXTRUDERS]; static unsigned char soft_pwm[EXTRUDERS];
static unsigned char soft_pwm_bed;
#ifdef FAN_SOFT_PWM #ifdef FAN_SOFT_PWM
static unsigned char soft_pwm_fan; static unsigned char soft_pwm_fan;
#endif #endif

View file

@ -45,6 +45,10 @@ extern float current_temperature_bed;
extern float redundant_temperature; extern float redundant_temperature;
#endif #endif
#if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
extern unsigned char soft_pwm_bed;
#endif
#ifdef PIDTEMP #ifdef PIDTEMP
extern float Kp,Ki,Kd,Kc; extern float Kp,Ki,Kd,Kc;
float scalePID_i(float i); float scalePID_i(float i);