thermferm/server.c

changeset 313
8448fcf3d799
parent 312
7b0f819a3805
child 325
35b6f6605ae3
--- a/thermferm/server.c	Mon Feb 16 19:52:42 2015 +0100
+++ b/thermferm/server.c	Mon Feb 16 20:41:09 2015 +0100
@@ -1505,7 +1505,7 @@
 	unit->idle_rangeL = -1.0;
 	unit->prof_started = unit->prof_paused = unit->prof_primary_done = (time_t)0;
 	unit->prof_percent = 0;
-	unit->PID_err_old = unit->PID_I_err = unit->PID_Kp = unit->PID_Kd = unit->PID_Ki = 0.0;
+	unit->PID_dState = unit->PID_iState = unit->PID_Kp = unit->PID_Kd = unit->PID_Ki = 0.0;
 
 	/*
 	 * Block main process
@@ -1851,7 +1851,7 @@
 					syslog(LOG_NOTICE, "Fermenter unit %s mode %s to %s", unit->uuid, UNITMODE[unit->mode], UNITMODE[i]);
 					unit->mode = i;
 					/* Allways turn everything off after a mode change */
-					unit->PID_I_err = unit->PID_err_old = 0.0;
+					unit->PID_iState = unit->PID_dState = 0.0;
 					unit->heater_state = unit->cooler_state = unit->fan_state = unit->light_state = 0;
 					unit->heater_wait = unit->cooler_wait = unit->fan_wait = unit->light_wait = 0;
 					device_out(unit->heater_address, unit->heater_state);
@@ -1921,7 +1921,7 @@
 				    /*
 				     * Reset all output devices
 				     */
-				    unit->PID_I_err = unit->PID_err_old = 0.0;
+				    unit->PID_iState = unit->PID_dState = 0.0;
 				    unit->heater_state = unit->cooler_state = unit->fan_state = unit->light_state = 0;
 				    unit->heater_wait = unit->cooler_wait = unit->fan_wait = unit->light_wait = 0;
 				    device_out(unit->heater_address, unit->heater_state);

mercurial