Step 1.... Unit Test.. Step2.... Integration Test

One aspect of the software controlling the brewery is that the domestic fridge shouldn't run for extended periods of time (>30 minutes). A normal fridge isn't trying to move the temperature of >20litres of liquid down by large amounts (start of fermentation/crash cooling).

This code is the main poll loop of the relay code controlling the fridge/heater.

....

heating_required = self._is_heating_required()
cooling_required = self._is_cooling_required()
if heating_required:
self._turn_cooling_off()
self._turn_heating_on()
self._turn_recirc_fan_on()
elif cooling_required:
self._turn_heating_off()
if self._safety_check_will_starting_the_fridge_damage_the_compressor():
self._turn_recirc_fan_off()
elif self._safety_check_has_fridge_been_running_too_long_if_so_turn_off():
self._turn_recirc_fan_off()
else:
self._turn_recirc_fan_on()
self._turn_cooling_on()
if self.fridgeHeat and self.zoneTemp > self.zoneTarget - 0.15:
self.groot.log("Target Reached stopping heat active for %s" % (time.time() - self.fermHeatActiveFor))
self._turn_cooling_off()
self._turn_heating_off()
self._turn_recirc_fan_

So this reads well, if cooling is required the we have two safety checks.....

but....

def _is_cooling_required(self):

if self.zoneTemp > self.zoneDownTarget and not self.fridgeCool:
self.groot.log("Cooling Required %s > %s" % (self.zoneTemp, self.zoneDownTarget))
return True
return False
The _is_cooling_required method only runs if the fridge isn't on!


TODO:


But the fridge didn't die this time, bottling went well, fermetntation seemed to go well, and it was reasonable coming out the fermenter.

Comments

Popular Posts