thermferm/thermferm.c

changeset 494
092b45686a75
parent 492
750f2468dec5
child 496
5cf6f099c897
--- a/thermferm/thermferm.c	Thu Mar 17 17:10:41 2016 +0100
+++ b/thermferm/thermferm.c	Thu Mar 17 17:25:02 2016 +0100
@@ -1377,7 +1377,6 @@
 							 * This is our current step
 							 */
 							valid_step = TRUE;
-//							unit->prof_fridge_mode = step->fridge_mode;
 							if (debug)
 							    fprintf(stdout, "step=%d step_pos=%d step=%d/%d target=%.1f..%.1f ", 
 									    current_step, run_hours - time_until_now,
@@ -1564,6 +1563,8 @@
 			    syslog(LOG_NOTICE, "Heat: sp=%.2f Input=%.2f iState=%.2f Err=%.2f Out=%.2f",
 				unit->PID_heat->SetP, unit->PID_heat->Input, unit->PID_heat->iState, unit->PID_heat->Err, unit->PID_heat->OutP);
 			}
+		    } else {
+			unit->PID_heat->OutP = 0.0;
 		    }
 		    if (unit->cooler_address) {
 			/*
@@ -1579,18 +1580,18 @@
 			    syslog(LOG_NOTICE, "Cool: sp=%.2f Input=%.2f iState=%.2f Err=%.2f Out=%.2f",
 				unit->PID_cool->SetP, unit->PID_cool->Input, unit->PID_cool->iState, unit->PID_cool->Err, unit->PID_cool->OutP);
 		    	}
+		    } else {
+			unit->PID_cool->OutP = 0.0;
 		    }
 
 		    /*
-		     * Deadlock
+		     * Deadlock, kill lowest value.
 		     */
 		    if (unit->PID_cool->OutP && unit->PID_heat->OutP) {
-			syslog(LOG_NOTICE, "Heat and Cool lockdown");
 			if (unit->PID_cool->OutP > unit->PID_heat->OutP)
 			    unit->PID_heat->OutP = 0.0;
 			else
 			    unit->PID_cool->OutP = 0.0;
-//			unit->PID_cool->OutP = unit->PID_heat->OutP = 0.0;
 		    }
 
 		    if (unit->heater_address && ! unit->cooler_state) {

mercurial