def full_test_with_pumps(pgain, itime, dtime=0, sp=37, start_temp=FULL_TEST_START_TEMP): """ Make the body of a recipe for a single off-to-auto-to-auto temp PID test, using addition pump A connected to the sample line to pump warm water out of the reactor, and media pump to pump water into the reactor. These pump steps occur at the end of an otherwise standard Temp PID test recipe to cool the liquid far faster than otherwise possible. @param pgain: pgain @type pgain: float | int @param itime: itime @type itime: float | int @param dtime: dtime @type dtime: float | int @param sp: temp setpoint @type sp: float | int @return: Recipe @rtype: Recipe """ recipe = Recipe() # set max level high (with pumps off!) to ensure # that level max interlock doesn't randomly shut heater off. recipe.set("LevelMax(L)", 5) recipe.set("TempHeatDutyControl.PGain(min)", pgain) recipe.set("TempHeatDutyControl.ITime(min)", itime) recipe.set("TempHeatDutyControl.DTime(min)", dtime) # Off to Auto Start recipe.set("TempSP(C)", sp) recipe.wait(5) recipe.set("TempModeUser", "Auto") recipe.waituntil('TempPV(C)', ">=", sp) recipe.wait(3600) # Auto to Auto Start recipe.set("TempSP(C)", sp + 2) recipe.waituntil("TempPV(C)", ">=", sp + 2) recipe.wait(3600) # Full test end' recipe.set("TempModeUser", "Off") # Max level will interlock pumps if level gets high # Otherwise, drain and fill simultaneously until # temp reaches target, then fill until full, then # turn final pump off. recipe.set("LevelMax(L)", 3) recipe.set("Pumps&ValvesPumpUser1", "100%") recipe.wait_until("LevelPV(L)", "<=", 2.5) recipe.set("Pumps&ValvesFillSpeed(RPM)", 500) recipe.wait_until("TempPV(C)", "<=", start_temp) recipe.set("Pumps&ValvesPumpUser1", "Off") recipe.wait_until("LevelPV(L)", ">=", 2.95) recipe.set("Pumps&ValvesFillSpeed(RPM)", 0) return recipe
tpid_cool_start.set("TempSP(C)", FULL_TEST_START_TEMP + 2) tpid_cool_start.wait(5) tpid_cool_start.set("TempModeUser", "Auto") tpid_cool_start.wait(5) tpid_cool_start.waituntil("TempPV(C)", ">", FULL_TEST_START_TEMP) tpid_cool_start.set("TempModeUser", "Off") tpid_cool_start.wait(60) tpid_cool_start.waituntil("TempPV(C)", "<=", FULL_TEST_START_TEMP) COOL_START_STEPS = len(tpid_cool_start) tpid_hot_start = Recipe() tpid_hot_start.set("TempModeUser", "Off") tpid_hot_start.set("LevelMax(L)", 3) tpid_hot_start.set("Pumps&ValvesPumpUser1", "100%") tpid_hot_start.wait_until("LevelPV(L)", "<=", 2.5) tpid_hot_start.set("Pumps&ValvesFillSpeed(RPM)", 500) tpid_hot_start.wait_until("TempPV(C)", "<=", 28.5) tpid_hot_start.set("Pumps&ValvesPumpUser1", "Off") tpid_hot_start.wait_until("LevelPV(L)", '>=', 2.95) tpid_hot_start.set("Pumps&ValvesFillSpeed(RPM)", 0) tpid_hot_start.wait(5) tpid_hot_start.wait_until("TempPV(C)", "<=", 28) def make_auto2auto(pgain, itime, dtime): recipe = Recipe() recipe.set("TempHeatDutyControl.PGain(min)", pgain) recipe.set("TempHeatDutyControl.ITime(min)", itime) recipe.set("TempHeatDutyControl.DTime(min)", dtime)