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 <2023> 2024 2025 | 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 <2023> 2024 2025 |
<== 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>
Use caution with links and attachments.
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 |