EPICS Lab 1 CA Clients 1999Ph 514 Lab
EPICS Lab #1 CA Clients 1999/Ph 514: Lab #1 : CA Clients 1
Lab #1 EPICS CA Clients EPICS u Real Life Example #1 : After assembling the ioc and configuring the EPICS database, the application developer left on vacation right before your scheduled commissioning shift. Using a variety of tools (Channel Access Clients), you will interact with the new LINAC and try to achieve your commissioning milestones. u Your goals for the shift are to : u u u Transport beam to the end of the LINAC Optimize beam transport Measure the beam energy using a bending magnet and faraday cup Stabilize beam current with simple closed-loop control Full documentation on the Knob Manger, BURT, and ALH can be found at : http: //csg. lbl. gov/EPICS/Recommended. Docs. html 1999/Ph 514: Lab #1 : CA Clients 2
“Virtual” LINAC Theory of Operation u u EPICS Beam is generated from the electron gun when the cathode temperature (studnt_: cathode. Temp. M) is > 130 degrees and the gun is enabled (studnt_: gun. On. C = 1). The cathode is heated by adjusting its current (studnt_: cathode. Current. C) Beam is steered down the linac using 5 sets of correctors. Each set consists of a horizontal corrector (studnt_: Hn: set. Current. C) and a vertical corrector (studnt_: Vn: set. Current. C) [n=1 -5] The gate valve must be opened to get beam past PM 2 (studnt_: GV 1: position. C = 1) Diagnostics: u u u one current monitor (studnt_: CM 1: intensity. M), five BPMs (studnt_: PMn: X: position. M, studnt_: PMn: Y: position. M, studnt_: PMn: intensity. M) two faraday cups (studnt_: FCn: intensity. M) 1999/Ph 514: Lab #1 : CA Clients 3
Tasks u u u u u EPICS Complete an medm display to interact with the virtual linac Write a shell script to calculate a useful parameter (transport efficiency) Use the Knob Manager to provide convenient control of power supplies to maximize transport Configure a Strip. Tool to trend important parameters Use burtrb/burtwb to save/restore settings Configure the Alarm Handler to monitor critical parameters Use some APS OAG tools to find optimum settings and implement closed loop control Write a script to automate linac startup/shutdown Experiment with other clients (cau, wingz, etc) HINT : If you need assistance, ~studnt 0 has already completed the lab exercises 1999/Ph 514: Lab #1 : CA Clients 4
MEDM u u Develop an medm display that allows interactive control of the power supplies, electron gun, and gate valve (begin with ‘~/host/medm/linac. adl’) Suggestions : u u EPICS Add ‘sliders’ for control of corrector power supplies Add ‘text entries’ for control of cathode heater and bending magnet supply Add ‘Choice Buttons ‘ for studnt_: gun. On. C and studnt_: GV 1: position. C Transport beam down your linac u u u Increase the cathode current until Cathode Temperature exceeds 120 degrees. Turn on beam using studnt_: gun. On. C Steer beam down linac using corrector supplies Open Gate Valve Optimize steering to end of linac 1999/Ph 514: Lab #1 : CA Clients 5
MEDM (cont. ) u EPICS More features … u u Make a warning message appear on the display whenever the “Beam On” button is depressed (studnt_: gun. On. C != 0). Use a text widget with ‘Visibility’ set appropriately. Create a new display that has a strip chart to trend the cathode temperature. Place a related display menu on the main display to call up the strip chart display. Try using the invisible attribute to make a hot button on the image of the gun that brings up the strip chart display. 1999/Ph 514: Lab #1 : CA Clients 6
Unix shell commands u Experiment with the shell tools provided in the EPICS distribution (type the command without any arguments for a usage line) : u u u u u EPICS caget caput cavget cavput ca. Get ca. Put cawait ca. Info Write a simple shell script (csh, perl, etc. ) to calculate transport efficiency (FC 1/CM 1). Write this calculated value (caput) to a spare PV in the ioc (studnt_: op. Variable 1). Add a text monitor on your medm screen to display this value. u Help files for c-shell and perl are located in ~/host/scripts. 1999/Ph 514: Lab #1 : CA Clients 7
Knob Manager (km) EPICS u Start the knob manager client (km &) u Drag and drop PV names of corrector supplies into knob manager knobs Use knobs to optimize steering down the LINAC Investigate Knob Manager capabilities u u u u Knob Disable Memory Up/Down Arrows Save the knob manager configuration in the ~/host/km directory Add a shell command menu to the medm display to call up a pre-configured knob manager u e. g. km -filename <config. File> & 1999/Ph 514: Lab #1 : CA Clients 8
Strip. Tool u u Start the Strip. Tool (Strip. Tool &) and create a configuration that trends the cathode temperature, cathode current, FC 1 current, and transport efficiency (updated by previous shell script) Attempt to achieve maximum transport efficiency of beam by steering while monitoring the strip chart. Save the Strip. Tool configuration in ~/host/strip. Tool/ Add a shell command menu on the medm display to call start a preconfigured Strip. Tool. u u EPICS Strip. Tool <config_file> & Investigate other features of Strip. Tool u u u Drag other PVs directly to plotting area Zoom In/Out Right mouse button on plotting area menu 1999/Ph 514: Lab #1 : CA Clients 9
Backup/Restore (burt) u burtrb : saves the value of a list of PVs that are listed in a “request file” (filename 1. req) to a snapshot file (filename 2. snap). u u u Type burtrb for a usage line Save settings : burtrb -f linac. req -o settings 1. snap Request file syntax u u One PV name per line If PV is preceded with RO (Read Only), the PV is stored in the snapshot file by burtrb but not restored by burtwb. Examine linac. req and settings 1. snap burtwb : restores the value of PVs as saved in the “snapshot” file u u u EPICS Type burtwb for a usage line Restore settings : burtwb -f settings 1. snap Add a shell command menu on the medm display to save and restore power supply settings from the medm display. Provide two commands that store in different files and two restore commands. 1999/Ph 514: Lab #1 : CA Clients 10
Alarm Handler (alh) u u u Start the alarm handler (alh &) and open the configuration file ~/host/alh/linac. alh. Config. Create alarm situations and interact with the alarm handler Investigate other alh capabilities u u u EPICS Add “alias” names for the PVs ($ALIAS) Add the capability to bring up the strip chart medm display from the alarm handler when the Cathode Temperature PV alarms ($COMMAND) Add simple HELP text for the operator for the Gate Valve PV ($GUIDANCE ) Configure the alarm handler to ignore the cathode temperature alarm if studnt_: gun. Bakeout. C = 1 ($FORCEPV) Add a $GUIDANCE command for the top group to bring up your favorite web page Add a ‘shell command’ menu on the medm display to call up this preconfigured alh (e. g. alh/ linac. alh. Config). 1999/Ph 514: Lab #1 : CA Clients 11
Miscellaneous OAG Tools u Use quick. Experiment to find the optimum BM 1 current to bend the beam to FC 2 u u Obtain as much beam current as possible at FC 1 cd to ~/host/sdds. Start quick. Experiment (a TCL/TK application) and configure : u u u u EPICS Measurement PV - studnt_: FC 2: intensity. M (use ‘NAME CAPTURE …’ to drag/drop) Variables PV - studnt_: BM 1: set. Current. C Steps : 50; Initial : 200; Final : 225 Output File -. /bm 1 Scan Press ‘Run’. Wait for it to complete the ramping cycle Press ‘Plot. /bm 1 Scan’ Select Mouse Tracker from the Options menu and determine optimum current for bending magnet. For more info on quick. Experiment , use the context sensitive Help 1999/Ph 514: Lab #1 : CA Clients 12
Miscellaneous OAG Tools u Use maintain. Readback to stabilize cathode beam current (observe result using the Strip. Tool). u u u Obtain as much beam current as possible at FC 1 Start the Strip. Tool to trend cathode temperature and FC 1 current (use the previously developed configuration file). Note the oscillation in cathode temeperature. cd to ~/host/sdds. Start maintain. Readback (a TCL/TK application) and configure : u u u EPICS Readback : studnt_: cathode. Temp. M Actuator : studnt_: cathode. Current. C Hold : 157 ; Change limit : 1 ; Gain : . 2 ; Action limit : 0 ; Pause : 1 ; Steps : 100 ; Samples : 1 ; Mode : Integral Press ‘Run’ Monitor the strip chart to see effect For more info on maintain. Readback, use the context sensitive Help 1999/Ph 514: Lab #1 : CA Clients 13
Automate Routine Sequences u Write a ‘LINAC ON’ shell script to perform the following: u u u u EPICS Launch medm with the appropriate display Heat up gun cathode to optimum temperature (studnt_: cathode. Temp. M. SEVR = 0) Restore optimum settings for best transport (use burwb and a previously saved snapshot file) Launch alarm handler to monitor LINAC Turn on the gun Open gate valve Write a ‘LINAC Off’ shell script to perform the following: u u u Turn off gun, lower cathode heater current Close gate valve Turn off all power supplies (set current to 0) 1999/Ph 514: Lab #1 : CA Clients 14
Additional Clients u Probe u Start probe : probe & u Drag/drop a PV from the medm display Investigate probe features u u wingz - Spreadsheet u u u EPICS cd to ~/hosts/wingz Start wingz : wingz ca. Wingz. wkz & Replace $(user): with studnt_: Select a cell to the right of a PV name. Hit ca. Get to retrieve, ca. Put to send Select multiple cells to perform backup and restore functions cau - Channel Access Utility u Start cau : cau u type ? for a list of commands “monitor” several PVs from the LINAC u 1999/Ph 514: Lab #1 : CA Clients 15
- Slides: 15