frappy_psi.thermofisher improvements
- merge Loop with Sensor - make convergence work Change-Id: Iba0cafc524ada6d490b7a5c30f4127e77fd163f3
This commit is contained in:
parent
9e52665b88
commit
720d010c47
@ -14,10 +14,6 @@ Mod('T',
|
|||||||
'holder temperature',
|
'holder temperature',
|
||||||
io='io',
|
io='io',
|
||||||
target=Param(max=100),
|
target=Param(max=100),
|
||||||
)
|
tolerance=0.5,
|
||||||
|
settling_time=20,
|
||||||
Mod('Th',
|
|
||||||
'frappy_psi.thermofisher.SensorA10',
|
|
||||||
'heat exch. temperature',
|
|
||||||
io='io',
|
|
||||||
)
|
)
|
||||||
|
@ -73,8 +73,8 @@
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from frappy.core import StringIO, Parameter, Readable, HasIO, \
|
from frappy.core import StringIO, Parameter, HasIO, \
|
||||||
Drivable, FloatRange, IDLE, ERROR, WARN, BoolType
|
Drivable, FloatRange, IDLE, BUSY, ERROR, WARN, BoolType
|
||||||
from frappy_psi.convergence import HasConvergence
|
from frappy_psi.convergence import HasConvergence
|
||||||
|
|
||||||
|
|
||||||
@ -83,9 +83,20 @@ class ThermFishIO(StringIO):
|
|||||||
identification = [('RVER', r'.*')] # Firmware Version
|
identification = [('RVER', r'.*')] # Firmware Version
|
||||||
|
|
||||||
|
|
||||||
class SensorA10(HasIO, Readable):
|
class TemperatureLoopA10(HasConvergence, HasIO, Drivable):
|
||||||
ioClass = ThermFishIO
|
ioClass = ThermFishIO
|
||||||
value = Parameter('internal temperature', unit='degC')
|
value = Parameter('internal temperature', unit='degC')
|
||||||
|
value = Parameter('temperature', unit='degC')
|
||||||
|
target = Parameter('setpoint/target', datatype=FloatRange, unit='degC', default=0)
|
||||||
|
circ_on = Parameter('is circulation running', BoolType(), readonly=False, default=False)
|
||||||
|
# pids
|
||||||
|
p_heat = Parameter('proportional heat parameter', FloatRange(), readonly=False)
|
||||||
|
i_heat = Parameter('integral heat parameter', FloatRange(), readonly=False)
|
||||||
|
d_heat = Parameter('derivative heat parameter', FloatRange(), readonly=False)
|
||||||
|
p_cool = Parameter('proportional cool parameter', FloatRange(), readonly=False)
|
||||||
|
i_cool = Parameter('integral cool parameter', FloatRange(), readonly=False)
|
||||||
|
d_cool = Parameter('derivative cool parameter', FloatRange(), readonly=False)
|
||||||
|
|
||||||
status_messages = [
|
status_messages = [
|
||||||
(ERROR, 'high tempr. cutout fault', 2, 0),
|
(ERROR, 'high tempr. cutout fault', 2, 0),
|
||||||
(ERROR, 'high RA tempr. fault', 2, 1),
|
(ERROR, 'high RA tempr. fault', 2, 1),
|
||||||
@ -138,22 +149,14 @@ class SensorA10(HasIO, Readable):
|
|||||||
|
|
||||||
for status_type, status_msg, vi, bit in self.status_messages:
|
for status_type, status_msg, vi, bit in self.status_messages:
|
||||||
if values_int[vi-1] & (1 << bit):
|
if values_int[vi-1] & (1 << bit):
|
||||||
|
conv_status = HasConvergence.read_status(self)
|
||||||
|
if self.isBusy(conv_status):
|
||||||
|
# use 'inside tolerance' and 'outside tolerance' from HasConvergence,
|
||||||
|
# else our own status
|
||||||
|
return BUSY, conv_status[1] if 'tolerance' in conv_status[1] else status_msg
|
||||||
return status_type, status_msg
|
return status_type, status_msg
|
||||||
return WARN, 'circulation off'
|
return WARN, 'circulation off'
|
||||||
|
|
||||||
|
|
||||||
class TemperatureLoopA10(SensorA10, Drivable):
|
|
||||||
value = Parameter('temperature', unit='degC')
|
|
||||||
target = Parameter('setpoint/target', datatype=FloatRange, unit='degC', default=0)
|
|
||||||
circ_on = Parameter('is circulation running', BoolType(), readonly=False, default=False)
|
|
||||||
# pids
|
|
||||||
p_heat = Parameter('proportional heat parameter', FloatRange(), readonly=False)
|
|
||||||
i_heat = Parameter('integral heat parameter', FloatRange(), readonly=False)
|
|
||||||
d_heat = Parameter('derivative heat parameter', FloatRange(), readonly=False)
|
|
||||||
p_cool = Parameter('proportional cool parameter', FloatRange(), readonly=False)
|
|
||||||
i_cool = Parameter('integral cool parameter', FloatRange(), readonly=False)
|
|
||||||
d_cool = Parameter('derivative cool parameter', FloatRange(), readonly=False)
|
|
||||||
|
|
||||||
def read_circ_on(self):
|
def read_circ_on(self):
|
||||||
return self.communicate('RO')
|
return self.communicate('RO')
|
||||||
|
|
||||||
@ -171,7 +174,7 @@ class TemperatureLoopA10(SensorA10, Drivable):
|
|||||||
"""
|
"""
|
||||||
self.write_circ_on('1')
|
self.write_circ_on('1')
|
||||||
self.communicate(f'SS {target}')
|
self.communicate(f'SS {target}')
|
||||||
# self.start_state()
|
self.convergence_start()
|
||||||
return target
|
return target
|
||||||
|
|
||||||
## heat PID
|
## heat PID
|
||||||
|
Loading…
x
Reference in New Issue
Block a user