EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
<== Date ==> <== Thread ==>

Subject: RE: [External] Re: Use phoebus toggle to adjust sign for ao record?
From: "Leblanc, Gregory via Tech-talk" <tech-talk at aps.anl.gov>
To: "Kasemir, Kay" <kasemirk at ornl.gov>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 29 Jun 2023 18:40:39 +0000

Kay,

 

Thanks, that works amazingly well!  I wound up with the following 4 records:

 

record(bi, "$(P)$(R):Sign") {

    field(DESC, "Output Current Direction")

    field(ONAM, "Positive")

    field(ZNAM, "Negative")

    field(FLNK,  "$(P)$(R):CalcCurrent")

    field(VAL, "1")

}

 

record(ao, "$(P)$(R):Amplitude") {

    field(DESC, "Amplitude of Current")

    field(EGU,  "Amps")

    field(DRVL, "0")

    field(DRVH, "250")

    field(FLNK, "$(P)$(R):CalcCurrent")

}

 

record(calc, "$(P)$(R):CalcCurrent") {

    field(DESC, "Calculated Current")

    field(CALC, "A ? B: -B")

    field(INPA, "$(P)$(R):Sign")

    field(INPB, "$(P)$(R):Amplitude")

    field(FLNK, "$(P)$(R)SetCurrent")

}

 

# Interface commands for Heinzinger PCU50_300 (should work with others as well)

 

# Setting commands

 

record(ao, "$(P)$(R)SetCurrent") {

    field(DESC, "Write output current")

    field(DTYP, "stream")

    field(SCAN, "Passive")

    field(OUT, "@devPCU50_300.proto setCurrent(%d) $(PORT) $(A)")

    field(FLNK, "$(P)$(R)GetCurrent")

    field(EGU, "Amps")

    field(ESLO, "0.001")

    field(LINR, "SLOPE")

    field(DRVL, "0")

    field(DRVH, "300")

    field(DOL, "$(P)$(R):CalcCurrent")

    field(OMSL, "closed_loop")

}

 

I tried playing around with the OROC field on the Amplitude record and on the SetCurrent record, but neither of those seemed to make any behavioral changes that I could see.  I tested by running camonitor PCU50_300testSetCurrent and saw output that looked like:

 

PCU50_300testSetCurrent        2023-06-29 13:36:17.363253 68.0718

PCU50_300testSetCurrent        2023-06-29 13:36:17.379272 63.3797

PCU50_300testSetCurrent        2023-06-29 13:36:17.395914 59.2742

PCU50_300testSetCurrent        2023-06-29 13:36:17.413147 55.022

PCU50_300testSetCurrent        2023-06-29 13:36:17.429905 50.9164

PCU50_300testSetCurrent        2023-06-29 13:36:17.446571 48.717

PCU50_300testSetCurrent        2023-06-29 13:36:17.463580 46.8108

PCU50_300testSetCurrent        2023-06-29 13:36:17.479832 46.2243

PCU50_300testSetCurrent        2023-06-29 13:36:21.316094 -46.2243

PCU50_300testSetCurrent        2023-06-29 13:36:22.552344 46.2243

 

This was with the OROC value on the PCU50_300testSetCurrent record set to 1. 

 

I believe this is a non-issue, because the PCU is smart enough to ramp the current to 0 before allowing the polarity reversal switch to actuate.  Thanks for all of your help,

     Greg

 

 

From: Kasemir, Kay <kasemirk at ornl.gov>
Sent: Wednesday, June 28, 2023 8:58 AM
To: Leblanc, Gregory <leblanc at ohio.edu>
Subject: [External] Re: Use phoebus toggle to adjust sign for ao record?

 

Use caution with links and attachments.

  • think I can then add a CALC record to set the sign of the number as positive or negative

 

Exactly. Somewhat like that:

 

# changing either the sign or the amplitude will FLNK to the output chain

record(bi, “$(P):Sign”)

{

  field(ZNAM, “Negative”)

  field(ONAM, “Positive”)

  field(FLNK, “CalcVoltage”)

}

 

record(ao, “$(P):Amplitude”)

{

  field(DRVL, “0”)

# Configure maximum amplitude…

  field(DRVH, “25”)

  field(FLNK, “CalcVoltage”)

}

 

record(calc, “$(P): CalcVoltage”)

{

  field(INPA, “$(P):Sign”)

  field(INPB, “$(P): Amplitude”)

  field(CALC, “A ? B : -B”)

  field(FLNK, “SetVoltage”)

}

 

record(ao, “$(P): SetVoltage”)

{

  field(DOL, “$(P): CalcVoltage”)

  field(OMSL, “closed_loop”)

.. set DTYP and OUT as needed for asyn/stream device to write the voltage to the device

}

 

This does mean, however, that the output could toggle from +25 to -25 right away with a simple click on the GUI for the …Sign PV.

Can the system handle that?

Or do you actually need to change it in a more gentle way?

The AO record’s OROC (output rate of change) field might help with that.

 

-Kay

 

 

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Leblanc, Gregory via Tech-talk <tech-talk at aps.anl.gov>
Date: Tuesday, June 27, 2023 at 5:48 PM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: [EXTERNAL] Use phoebus toggle to adjust sign for ao record?

Hi folks,

One of my next steps is to get polarity reversal working on the Heinzinger supplies.  I've got the attached bob file where I am hoping to use the slider to tune the beam. The PCUs want me to send a negative value to indicate one polarity and a positive value to indicate the opposite polarity.  The command 'DA 0,025000' will run the supply to 25A.  The command 'DA 0,-025000' will reverse the polarity switch and run the supply to 25A (the software on the supply takes care of running everything down before switching).  I would prefer not to have a slider that goes from -300 to 300.  This makes it harder to run the supply down to 0 and is also more confusing for operators.  My thought is to implement a toggle button and display which deflection the user has selected.  I think I can then add a CALC record to set the sign of the number as positive or negative, and then send that composite out to the instrument.  Does it sound like I'm on the right track or feedback on how you've accomplished something like this? 
     Greg

--
Gregory Leblanc
Accelerator Engineer
Edwards Accelerator Lab - Ohio University
123 University Terrace
Athens, OH 45701 USA
leblanc at ohio.edu
M: (401) 52-OUAL1 or (401) 526-8251


References:
Use phoebus toggle to adjust sign for ao record? Leblanc, Gregory via Tech-talk

Navigate by Date:
Prev: Re: Question about fetching history data from MySQL by using phoebus Kasemir, Kay via Tech-talk
Next: Phoebus Increased Slider Sensitivity? Leblanc, Gregory via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
Navigate by Thread:
Prev: Use phoebus toggle to adjust sign for ao record? Leblanc, Gregory via Tech-talk
Next: Question about fetching history data from MySQL by using phoebus neu lzf via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
ANJ, 29 Jun 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·