1629 */ |
1629 */ |
1630 if (unit->heater_address) { |
1630 if (unit->heater_address) { |
1631 /* |
1631 /* |
1632 * Prevent extreme heating |
1632 * Prevent extreme heating |
1633 */ |
1633 */ |
1634 if ((unit->mode == UNITMODE_BEER) && ((unit->air_temperature / 1000.0) > (unit->PID_heat->Input + 5.0))) { |
1634 if ((unit->mode == UNITMODE_BEER) && ((unit->air_temperature / 1000.0) > (unit->PID_heat->Input + 8.0))) { |
1635 unit->PID_heat->OutP = 0.0; |
1635 unit->PID_heat->OutP = 0.0; |
1636 } |
1636 } |
1637 if (debug) |
1637 if (debug) |
1638 fprintf(stdout, "Heat: sp=%.2f Input=%.2f iState=%.2f Err=%.2f Out=%.2f\n", |
1638 fprintf(stdout, "Heat: sp=%.2f Input=%.2f iState=%.2f Err=%.2f Out=%.2f\n", |
1639 unit->PID_heat->SetP, unit->PID_heat->Input, unit->PID_heat->iState, unit->PID_heat->Err, unit->PID_heat->OutP); |
1639 unit->PID_heat->SetP, unit->PID_heat->Input, unit->PID_heat->iState, unit->PID_heat->Err, unit->PID_heat->OutP); |
1646 } |
1646 } |
1647 if (unit->cooler_address) { |
1647 if (unit->cooler_address) { |
1648 /* |
1648 /* |
1649 * Prevent extreme cooling |
1649 * Prevent extreme cooling |
1650 */ |
1650 */ |
1651 if ((unit->mode == UNITMODE_BEER) && ((unit->air_temperature / 1000.0) < (unit->PID_cool->Input - 5.0))) { |
1651 if ((unit->mode == UNITMODE_BEER) && ((unit->air_temperature / 1000.0) < (unit->PID_cool->Input - 8.0))) { |
1652 unit->PID_cool->OutP = 0.0; |
1652 unit->PID_cool->OutP = 0.0; |
1653 } |
1653 } |
1654 /* |
1654 /* |
1655 * Prevent cooling if we use a chiller and the chiller temperature is not low enough. |
1655 * Prevent cooling if we use a chiller and the chiller temperature is not low enough. |
1656 */ |
1656 */ |