Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

add PTC10 heater #519

Closed
prjemian opened this issue Sep 27, 2021 · 18 comments
Closed

add PTC10 heater #519

prjemian opened this issue Sep 27, 2021 · 18 comments
Assignees
Labels
enhancement New feature or request

Comments

@prjemian
Copy link
Contributor

prjemian commented Sep 27, 2021

[Yesterday 5:22 PM] Ilavsky, Jan

... add PTC10 device (heater) and make that as one of the options in this heater program (#490). ... Should be heater with same commands as Linkams... (#494)

see: https://www.thinksrs.com/products/ptc10.html

@prjemian prjemian added the enhancement New feature or request label Sep 27, 2021
@prjemian
Copy link
Contributor Author

Support for PTC10 is an issue (BCDA-APS/apstools#491) in the milestone for release in apstools due this week.

@prjemian
Copy link
Contributor Author

from Jan:

... We use PTC10 routinely (like next few days) and it is supported in spec. I want to have basic stuff covered for bluesky... We use number of heaters with it,. I can test it for you On Thursday or Friday when there is no beam.

@prjemian
Copy link
Contributor Author

GUI used by USAXS
Clipboard01

@prjemian
Copy link
Contributor Author

This device might benefit from the apstools.devices.PVPositionerSoftDone, currently in review as a pull request. The PVPositionerSoftDone device provides a software done signal that compares readback and setpoint to see if a move is approximately complete (within a tolerance). This device will be useful for temperature controllers that do not provide an at temperature signal.

BUT, where does the user provide a set point in terms of temperature?

@prjemian
Copy link
Contributor Author

from Jan:

Some of the PV names are not intuitive. "High limit" is really target temperature,. This is ugly and complicated device and naming matches that.

@prjemian
Copy link
Contributor Author

prjemian commented Sep 27, 2021

Good, we can reconfigure the temperature Component as an ophyd.PVPositioner (or apstools.devices.PVPositionerSoftDone when it is ready) using:

attribute EPICS PV ophyd class
readback $(P)2A:temperature ophyd.PVPositioner (or apstools.devices.PVPositionerSoftDone)
setpoint $(P)5A:highLimit ophyd.EpicsSignalWithRBV

@prjemian
Copy link
Contributor Author

The PTC10 support here is not ready for synApps yet.

@kmpeters describes:

All of the existing displays are developer displays which are very confusing for end users. The PTC10 is very user-configurable. Cards can be added to it to expand its functionality. Default channel names depend on where the cards are installed. Users can rename channels from the front panel of the device and EPICS support needs to be modified to match the user-defined name. Any analog output channel can be associated with any temperature-reading channel. So far I think only the TC card is supported, but I think there is an RTD card as well.

​Getting the impression that a single, complete ophyd.Device will not describe all variations that could be installed. But the parts have some standardization. I'll create support for the parts that require some assembly for each specific installation.

@prjemian
Copy link
Contributor Author

I will refactor this from ophyd.Device to ophyd.PVPositioner. For an example, see how it is used in the temperature controller simulator in the APS bluesky instrument training.

@prjemian
Copy link
Contributor Author

Also will refactor RTD and AIO parts to be compatible with plans in apstools.

prjemian added a commit that referenced this issue Sep 27, 2021
prjemian added a commit that referenced this issue Sep 27, 2021
@prjemian
Copy link
Contributor Author

Here's what the ptc10 object shows (both summary and EPICS values):
(Could change aio to pid for more meaningful name)

In [54]: ptc10.summary()
data keys (* hints)
-------------------
*ptc10
 ptc10_coldj2
*ptc10_setpoint
*ptc10_temperatureB
 ptc10_temperatureC

read attrs
----------
readback             EpicsSignalRO       ('ptc10')
setpoint             EpicsSignalWithRBV  ('ptc10_setpoint')
temperatureB         EpicsSignalRO       ('ptc10_temperatureB')
temperatureC         EpicsSignalRO       ('ptc10_temperatureC')
coldj2               EpicsSignalRO       ('ptc10_coldj2')
rtd                  PTC10RtdChannel     ('ptc10_rtd')
aio                  PTC10AioChannel     ('ptc10_aio')

config keys
-----------
ptc10_aio_D
ptc10_aio_I
ptc10_aio_P
ptc10_aio_inputchoice
ptc10_aio_iotype
ptc10_aio_lowlimit
ptc10_aio_pidmode
ptc10_aio_ramprate
ptc10_aio_setpoint
ptc10_aio_tunelag
ptc10_aio_tunemode
ptc10_aio_tunestep
ptc10_aio_tunetype
ptc10_aio_voltage
ptc10_enable
ptc10_rtd_channelrange
ptc10_rtd_current
ptc10_rtd_power
ptc10_rtd_sensor
ptc10_rtd_units
ptc10_tolerance

configuration attrs
-------------------
tolerance            Signal              ('ptc10_tolerance')
enable               EpicsSignalWithRBV  ('ptc10_enable')
rtd                  PTC10RtdChannel     ('ptc10_rtd')
rtd.units            EpicsSignalRO       ('ptc10_rtd_units')
rtd.sensor           EpicsSignalWithRBV  ('ptc10_rtd_sensor')
rtd.channelrange     EpicsSignalWithRBV  ('ptc10_rtd_channelrange')
rtd.current          EpicsSignalWithRBV  ('ptc10_rtd_current')
rtd.power            EpicsSignalWithRBV  ('ptc10_rtd_power')
aio                  PTC10AioChannel     ('ptc10_aio')
aio.voltage          EpicsSignalRO       ('ptc10_aio_voltage')
aio.lowlimit         EpicsSignalWithRBV  ('ptc10_aio_lowlimit')
aio.iotype           EpicsSignalWithRBV  ('ptc10_aio_iotype')
aio.setpoint         EpicsSignalWithRBV  ('ptc10_aio_setpoint')
aio.ramprate         EpicsSignalWithRBV  ('ptc10_aio_ramprate')
aio.pidmode          EpicsSignalWithRBV  ('ptc10_aio_pidmode')
aio.P                EpicsSignalWithRBV  ('ptc10_aio_P')
aio.I                EpicsSignalWithRBV  ('ptc10_aio_I')
aio.D                EpicsSignalWithRBV  ('ptc10_aio_D')
aio.inputchoice      EpicsSignalWithRBV  ('ptc10_aio_inputchoice')
aio.tunelag          EpicsSignalWithRBV  ('ptc10_aio_tunelag')
aio.tunestep         EpicsSignalWithRBV  ('ptc10_aio_tunestep')
aio.tunemode         EpicsSignalWithRBV  ('ptc10_aio_tunemode')
aio.tunetype         EpicsSignalWithRBV  ('ptc10_aio_tunetype')

unused attrs
------------
done                 Signal              ('ptc10_done')
report_dmov_changes  Signal              ('ptc10_report_dmov_changes')

In [52]: %run -i ptc10_controller.py

In [53]: object_explorer(ptc10)
================ =============================== ========
name             PV reference                    value   
================ =============================== ========
aio.D            9idcTEMP:tc1:5A:pid:D_RBV       10.0    
aio.I            9idcTEMP:tc1:5A:pid:I_RBV       0.01    
aio.P            9idcTEMP:tc1:5A:pid:P_RBV       0.5     
aio.inputchoice  9idcTEMP:tc1:5A:pid:input_RBV   2A      
aio.iotype       9idcTEMP:tc1:5A:ioType_RBV      Meas out
aio.lowlimit     9idcTEMP:tc1:5A:lowLimit_RBV    0.0     
aio.pidmode      9idcTEMP:tc1:5A:pid:mode_RBV    Off     
aio.ramprate     9idcTEMP:tc1:5A:rampRate_RBV    1.0     
aio.setpoint     9idcTEMP:tc1:5A:setPoint_RBV    20.0    
aio.tunelag      9idcTEMP:tc1:5A:tune:lag_RBV    30.0    
aio.tunemode     9idcTEMP:tc1:5A:tune:mode_RBV   Off     
aio.tunestep     9idcTEMP:tc1:5A:tune:step_RBV   0.5     
aio.tunetype     9idcTEMP:tc1:5A:tune:type_RBV   Cons    
aio.voltage      9idcTEMP:tc1:5A:voltage_RBV     0.007   
coldj2           9idcTEMP:tc1:ColdJ2:temperature 0.0     
enable           9idcTEMP:tc1:outputEnable_RBV   0       
readback         9idcTEMP:tc1:2A:temperature     17.69   
rtd.channelrange 9idcTEMP:tc1:3A:range_RBV       Auto    
rtd.current      9idcTEMP:tc1:3A:current_RBV     Forward 
rtd.power        9idcTEMP:tc1:3A:power_RBV       Auto    
rtd.sensor       9idcTEMP:tc1:3A:sensor_RBV      Diode   
rtd.units        9idcTEMP:tc1:3A:units_RBV       Ohm     
setpoint         9idcTEMP:tc1:5A:highLimit_RBV   1200.0  
temperatureB     9idcTEMP:tc1:2B:temperature     17.393  
temperatureC     9idcTEMP:tc1:2C:temperature     0.0     
================ =============================== ========

@prjemian
Copy link
Contributor Author

In [55]: ptc10.read()
Out[55]: 
OrderedDict([('ptc10', {'value': 17.664, 'timestamp': 1632769269.70712}),
             ('ptc10_setpoint',
              {'value': 1200.0, 'timestamp': 1632768657.286077}),
             ('ptc10_temperatureB',
              {'value': 17.349, 'timestamp': 1632769269.754152}),
             ('ptc10_temperatureC', {'value': 0.0, 'timestamp': 631152000.0}),
             ('ptc10_coldj2', {'value': 0.0, 'timestamp': 631152000.0})])

@prjemian
Copy link
Contributor Author

reformatting that:

In [59]: listdevice(ptc10)
================== ====== ==========================
name               value  timestamp                 
================== ====== ==========================
ptc10              17.648 2021-09-27 14:02:14.701061
ptc10_setpoint     1200.0 2021-09-27 13:50:57.286077
ptc10_temperatureB 17.358 2021-09-27 14:02:14.849055
ptc10_temperatureC 0.0    1989-12-31 18:00:00       
ptc10_coldj2       0.0    1989-12-31 18:00:00       
================== ====== ==========================

@prjemian
Copy link
Contributor Author

@jilavsky Except for possible name changes, this is ready for testing later this week.

@prjemian
Copy link
Contributor Author

In [60]: ptc10.position
Out[60]: 17.664

prjemian added a commit that referenced this issue Sep 27, 2021
@prjemian
Copy link
Contributor Author

now

In [62]: object_explorer(ptc10)
================ =============================== ========
name             PV reference                    value   
================ =============================== ========
coldj2           9idcTEMP:tc1:ColdJ2:temperature 0.0     
enable           9idcTEMP:tc1:outputEnable_RBV   0       
pid.D            9idcTEMP:tc1:5A:pid:D_RBV       10.0    
pid.I            9idcTEMP:tc1:5A:pid:I_RBV       0.01    
pid.P            9idcTEMP:tc1:5A:pid:P_RBV       0.5     
pid.inputchoice  9idcTEMP:tc1:5A:pid:input_RBV   2A      
pid.iotype       9idcTEMP:tc1:5A:ioType_RBV      Meas out
pid.lowlimit     9idcTEMP:tc1:5A:lowLimit_RBV    0.0     
pid.pidmode      9idcTEMP:tc1:5A:pid:mode_RBV    Off     
pid.ramprate     9idcTEMP:tc1:5A:rampRate_RBV    1.0     
pid.setpoint     9idcTEMP:tc1:5A:setPoint_RBV    20.0    
pid.tunelag      9idcTEMP:tc1:5A:tune:lag_RBV    30.0    
pid.tunemode     9idcTEMP:tc1:5A:tune:mode_RBV   Off     
pid.tunestep     9idcTEMP:tc1:5A:tune:step_RBV   0.5     
pid.tunetype     9idcTEMP:tc1:5A:tune:type_RBV   Cons    
pid.voltage      9idcTEMP:tc1:5A:voltage_RBV     0.007   
readback         9idcTEMP:tc1:2A:temperature     17.621  
rtd.channelrange 9idcTEMP:tc1:3A:range_RBV       Auto    
rtd.current      9idcTEMP:tc1:3A:current_RBV     Forward 
rtd.power        9idcTEMP:tc1:3A:power_RBV       Auto    
rtd.sensor       9idcTEMP:tc1:3A:sensor_RBV      Diode   
rtd.units        9idcTEMP:tc1:3A:units_RBV       Ohm     
setpoint         9idcTEMP:tc1:5A:highLimit_RBV   1200.0  
temperatureB     9idcTEMP:tc1:2B:temperature     17.346  
temperatureC     9idcTEMP:tc1:2C:temperature     0.0     
================ =============================== ========

@prjemian
Copy link
Contributor Author

Suggest adding a STOP feature per BCDA-APS/bluesky_training#35

Add a STOP feature so the controller will hold the current readback temperature when the stop() method is called.

prjemian added a commit that referenced this issue Sep 29, 2021
prjemian added a commit that referenced this issue Sep 29, 2021
@jilavsky
Copy link
Contributor

This will happen with installation of new release (1.6.0rc5+) of apstools.

@prjemian prjemian added this to the 2022-01 operations milestone Jan 21, 2022
@prjemian
Copy link
Contributor Author

Follow the example:

from apstools.devices import PTC10PositionerMixin
from ophyd import PVPositioner

class MyPTC10(PTC10PositionerMixin, PVPositioner):
      readback = Component(EpicsSignalRO, "2A:temperature", kind="hinted")
      setpoint = Component(EpicsSignalWithRBV, "5A:setPoint", kind="hinted")
      rtd = Component(PTC10RtdChannel, "3A:")
      pid = Component(PTC10AioChannel, "5A:")

ptc10 = MyPTC10("9idcTEMP:tc1:", name="ptc10")
ptc10.report_dmov_changes.put(True)  # a diagnostic
ptc10.tolerance.put(1.0)  # done when |readback-setpoint|<=tolerance

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants