From 73800fccc2f62d189f50d9ff4749bd63cd48e88f Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Tue, 15 Sep 2026 17:35:13 +0200 Subject: [PATCH] muwaba: update to current frappy version --- cfg/muwaba_cfg.py | 90 +++++++++++++++++++------------------- frappy_psi/muwaba.py | 13 +++--- frappy_psi/thermofisher.py | 8 ++-- 3 files changed, 56 insertions(+), 55 deletions(-) diff --git a/cfg/muwaba_cfg.py b/cfg/muwaba_cfg.py index 3bd8dc68..1d448b66 100644 --- a/cfg/muwaba_cfg.py +++ b/cfg/muwaba_cfg.py @@ -3,74 +3,61 @@ Node('muwaba.psi.ch', 'tcp://5000', ) -Mod('wio_1', - 'frappy_psi.thermofisher.ThermFishIO', +Mod('io1', + 'frappy_psi.thermofisher.IO', 'connection for water bath', uri='serial:///dev/ttyUSB0?baudrate=19200', # 3001 = Port 1, 3002 = Port 2 ... ) -Mod('wio_2', - 'frappy_psi.thermofisher.ThermFishIO', +Mod('io2', + 'frappy_psi.thermofisher.IO', 'connection for water bath', uri='serial:///dev/ttyUSB1?baudrate=19200', # 3001 = Port 1, 3002 = Port 2 ... ) -Mod('wio_3', - 'frappy_psi.thermofisher.ThermFishIO', +Mod('io3', + 'frappy_psi.thermofisher.IO', 'connection for water bath', uri='serial:///dev/ttyUSB2?baudrate=19200', # 3001 = Port 1, 3002 = Port 2 ... ) Mod('Tbath_1', - 'frappy_psi.thermofisher.TemperatureLoopA10', - 'water_bath_1', - io='wio_1', + 'frappy_psi.thermofisher.TemperatureLoop', + 'water bath 1', + io='io1', control_active=0, target=25, - tolerance=0.1, + tolerance=1.0, settling_time=20, ) Mod('Tbath_2', - 'frappy_psi.thermofisher.TemperatureLoopA10', - 'water_bath_2', - io='wio_2', + 'frappy_psi.thermofisher.TemperatureLoop', + 'water bath 2', + io='io2', control_active=0, target=25, - tolerance=0.1, + tolerance=1.0, settling_time=20, ) Mod('Tbath_3', - 'frappy_psi.thermofisher.TemperatureLoopA10', - 'water_bath_3', - io='wio_3', + 'frappy_psi.thermofisher.TemperatureLoop', + 'water bath 3', + io='io3', control_active=0, target=25, - tolerance=0.1, + tolerance=1.0, settling_time=20, ) -Mod('valve_1', - 'frappy_psi.ionopimax.DigitalOutput', - 'valve_for_fast_water_temperature_changing', - addr = 'o1', - target = 0, - ) - -Mod('valve_2', - 'frappy_psi.ionopimax.DigitalOutput', - 'valve_for_fast_water_temperature_changing', - addr = 'o2', - target = 0, - ) - -Mod('valve_3', - 'frappy_psi.ionopimax.DigitalOutput', - 'valve_for_fast_water_temperature_changing', - addr = 'o3', - target = 0, - ) +Mod('switcher', + 'frappy_psi.muwaba.Switcher', + 'waterbath switcher', + valve1 = 'valve1', + valve2 = 'valve2', + valve3 = 'valve3', + ) Mod('temp_sensor_tc', 'frappy_psi.ionopimax.SimpleVoltageInput', @@ -91,10 +78,23 @@ Mod('temp_sensor_pt1000', addr = 'ai2_mv', ) -Mod('switcher', - 'frappy_psi.muwaba.Switcher', - 'waterbath switcher', - valve1 = 'valve_1', - valve2 = 'valve_2', - valve3 = 'valve_3', - ) +Mod('valve1', + 'frappy_psi.ionopimax.DigitalOutput', + 'valve_for_fast_water_temperature_changing', + addr = 'o1', + target = 0, + ) + +Mod('valve2', + 'frappy_psi.ionopimax.DigitalOutput', + 'valve_for_fast_water_temperature_changing', + addr = 'o2', + target = 0, + ) + +Mod('valve3', + 'frappy_psi.ionopimax.DigitalOutput', + 'valve_for_fast_water_temperature_changing', + addr = 'o3', + target = 0, + ) diff --git a/frappy_psi/muwaba.py b/frappy_psi/muwaba.py index 47d5bbe1..17decffb 100644 --- a/frappy_psi/muwaba.py +++ b/frappy_psi/muwaba.py @@ -21,7 +21,7 @@ """ Multiple waterbath switching """ - +import time from frappy.core import Readable, Writable, Parameter, Property, IntRange, Attached,ERROR, IDLE, WARN class Switcher(Writable): @@ -36,11 +36,13 @@ class Switcher(Writable): def initModule(self): super().initModule() self.valves = {1:self.valve1, 2:self.valve2, 3:self.valve3} - + def write_target(self, target): for nr, valve in self.valves.items(): - if nr != target: - valve.write_target(False) + valve.write_target(False) + time.sleep(0.5) +# if nr != target: +# valve.write_target(False) if target != 0: self.valves[target].write_target(True) self._idle_status = IDLE, '' @@ -55,7 +57,6 @@ class Switcher(Writable): self.write_target(self.target) self._idle_status = WARN, 'superfluous valves closed' return self.target - + def read_status(self): return self._idle_status - \ No newline at end of file diff --git a/frappy_psi/thermofisher.py b/frappy_psi/thermofisher.py index 3aadc1d0..de9b49cb 100644 --- a/frappy_psi/thermofisher.py +++ b/frappy_psi/thermofisher.py @@ -57,11 +57,11 @@ class TemperatureLoop(HasConvergence, Base, Drivable): target = Parameter('setpoint/target', datatype=FloatRange, unit='degC', default=0) control_active = Parameter('circulation and control is on', BoolType(), default=False) ctrlpars = StructParam('control parameters struct', dict( - p_heat = Parameter('proportional heat parameter', FloatRange()), - i_heat = Parameter('integral heat parameter', FloatRange()), + p_heat = Parameter('proportional heat parameter', FloatRange(), value=3), + i_heat = Parameter('integral heat parameter', FloatRange(), value=3), d_heat = Parameter('derivative heat parameter', FloatRange()), - p_cool = Parameter('proportional cool parameter', FloatRange()), - i_cool = Parameter('integral cool parameter', FloatRange()), + p_cool = Parameter('proportional cool parameter', FloatRange(), value=3), + i_cool = Parameter('integral cool parameter', FloatRange(), value=3), d_cool = Parameter('derivative cool parameter', FloatRange()), ), readonly=False) target_min = Limit(default=-99)