[WIP] fixes for linse-fi

Change-Id: Iac28e9654a764331cd903896879834cd6127a919
This commit is contained in:
zolliker 2025-04-14 11:46:02 +02:00
parent fcf867675e
commit 94859fe2ef
4 changed files with 25 additions and 15 deletions

View File

@ -9,14 +9,14 @@ Mod('htr_io',
uri='serial:///dev/ttyUSB0?baudrate=9600', uri='serial:///dev/ttyUSB0?baudrate=9600',
) )
Mod('htr', Mod('htr_power',
'frappy_psi.tdkpower.Power', 'frappy_psi.tdkpower.Power',
'heater power', 'heater power',
io='htr_io', io='htr_io',
) )
Mod('out', Mod('htr',
'frappy_psi.tdkpower.Output', 'frappy_psi.furnace.TdkOutput',
'heater output', 'heater output',
io='htr_io', io='htr_io',
maxvolt=8, maxvolt=8,
@ -29,7 +29,6 @@ Mod('T_main',
addr='ai4', addr='ai4',
valuerange=(0, 1372), valuerange=(0, 1372),
value=Param(unit='degC'), value=Param(unit='degC'),
) )
Mod('T_extra', Mod('T_extra',
@ -38,7 +37,6 @@ Mod('T_extra',
addr='ai3', addr='ai3',
valuerange=(0, 1372), valuerange=(0, 1372),
value=Param(unit='degC'), value=Param(unit='degC'),
) )
Mod('T_wall', Mod('T_wall',
@ -51,11 +49,11 @@ Mod('T_wall',
) )
Mod('T', Mod('T',
'frappy_psi.furnace.PI', 'frappy_psi.picontrol.PI',
'controlled Temperature', 'controlled Temperature',
input='T_htr', input_module='T_main',
output='htr', output_module='htr',
relais='relais', # relais='relais',
p=2, p=2,
i=0.01, i=0.01,
) )

View File

@ -17,12 +17,16 @@
# Markus Zolliker <markus.zolliker@psi.ch> # Markus Zolliker <markus.zolliker@psi.ch>
# ***************************************************************************** # *****************************************************************************
"""interlocks for furnance""" """interlocks for furnace"""
import time import time
from frappy.core import Module, Writable, Attached, Parameter, FloatRange, Readable,\ from frappy.core import Module, Writable, Attached, Parameter, FloatRange, Readable,\
BoolType, ERROR, IDLE BoolType, ERROR, IDLE
from frappy.mixins import HasControlledBy
from frappy_psi.picontrol import PImixin from frappy_psi.picontrol import PImixin
from frappy_psi.convergence import HasConvergence
import frappy_psi.tdkpower as tdkpower
import frappy_psi.bkpower as bkpower
class Interlocks(Module): class Interlocks(Module):
@ -76,8 +80,8 @@ class Interlocks(Module):
self.relais.write_target(False) self.relais.write_target(False)
class PI(PImixin, Writable): class PI(HasConvergence, PImixin):
input = Attached(Readable, 'the input module') input_module = Attached(Readable, 'the input module')
relais = Attached(Writable, 'the interlock relais', mandatory=False) relais = Attached(Writable, 'the interlock relais', mandatory=False)
def read_value(self): def read_value(self):
@ -87,3 +91,11 @@ class PI(PImixin, Writable):
super().write_target(value) super().write_target(value)
if self.relais: if self.relais:
self.relais.write_target(1) self.relais.write_target(1)
class TdkOutput(HasControlledBy, tdkpower.Output):
pass
class BkOutput(HasControlledBy, bkpower.Output):
pass

View File

@ -48,8 +48,8 @@ example cfg:
Mod('T_softloop', Mod('T_softloop',
'frappy_psi.picontrol.PI', 'frappy_psi.picontrol.PI',
'softloop controlled Temperature mixing chamber', 'softloop controlled Temperature mixing chamber',
input = 'ts', input_module = 'ts',
output = 'htr_mix', output_module = 'htr_mix',
control_active = 1, control_active = 1,
output_max = 80000, output_max = 80000,
p = 2E6, p = 2E6,

View File

@ -41,7 +41,7 @@ class Power(HasIO, Readable):
class Output(HasIO, Writable): class Output(HasIO, Writable):
value = Parameter(datatype=FloatRange(0,100,unit='%')) value = Parameter(datatype=FloatRange(0,100,unit='%'), default=0)
target = Parameter(datatype=FloatRange(0,100,unit='%')) target = Parameter(datatype=FloatRange(0,100,unit='%'))
mode = Parameter('regulation mode', EnumType(voltage=1, current=2, both=3), mode = Parameter('regulation mode', EnumType(voltage=1, current=2, both=3),
default='voltage', readonly=False) default='voltage', readonly=False)