Difference between revisions of "Beam Setup and Measurement - May 2018"

From Ciswikidb
Jump to: navigation, search
(Set energy)
 
(57 intermediate revisions by 3 users not shown)
Line 14: Line 14:
 
= Energy Setup and Measurement =
 
= Energy Setup and Measurement =
  
: ...
+
===Set energy===
 +
 
 +
{| class="wikitable"
 +
|-
 +
| '''Momentum (MeV/c)'''
 +
| '''Kinetic Energy (MeV)'''
 +
| '''Calculated dipole setting (G-cm)'''
 +
|-
 +
| 5.84
 +
| 5.35
 +
| 8246.344
 +
|-
 +
| 5.74
 +
| 5.25
 +
| 8105.146
 +
|-
 +
| 5.64
 +
| 5.15
 +
| 7963.949
 +
|-
 +
| 5.54
 +
| 5.05
 +
| 7822.752
 +
|-
 +
| 5.44
 +
| 4.95
 +
| 7681.557
 +
|-
 +
| 5.34
 +
| 4.85
 +
| 7540.363
 +
|-
 +
| 5.24
 +
| 4.75
 +
| 7399.170
 +
|}
 +
 
 +
:'''First energy/momentum (p=5.74 MeV/c)'''
 +
:#Set MDL0L02.BDL according to the setpoint in the table or from the '''''MDL0L02_calculator.pl''''' in '''''/a/opsdata/bubble/energy'''''.
 +
:#: > '''''/a/opsdata/bubble/energy/MDL0L02_calculator.pl p 5.64'''''
 +
:#: p 5.64 MeV/c -> 5D line (25 deg.) BDL 7963.94855360974 G-cm
 +
:#: p 5.64 MeV/c -> 2D line (-30 deg.) BDL -9437.96774120548 G-cm
 +
:#Note the Hall probe readback and set up parameters on the MDL0L02 dipole and DTM 151 Digital Teslameter screens (put snapshots in logbook) as this is the reference for the other energy changes.
 +
:#Alternately adjust the quarter cavity 2-7 and 2-8 GSETs in small increments (0.01-0.1) until the BPM absolute positions in the 5D line are within 5 mm in x (aim for less than 5 mm if possible; smaller relative differences are better).  Getting them both to zero with good signal is difficult to achieve, and it may be necessary to split the difference (have one positive and the other negative).
 +
:#Adjust, if necessary MBH0L01H/V, to get IPM0L02 to zero in x and y absolute positions.  MHB0L02H/V can be used to move the beam on ITV5D00.
 +
:#Check that the quarter cavities are on crest in the 5D line if possible; otherwise, put beam in the 2D line to check cresting.
 +
:#If the quarter phases changed, with beam in the 5D line, alternately adjust the 2-7 and 2-8 GSETs in small increments to restore the BPM settings found before cresting.  If changes are large, iterate phasing, steering with MBH0L01H/V t zero IPM0L02, and adjusting GSETs steps until changes are negligibly small.
 +
:#Note the position of the beam on the 5D viewers (put snapshots in logbook).
 +
:#Zero pos
 +
:#Allsave saying momentum set, intended momentum, and BUBBLE.
 +
:#Log allsave number, cavity GSETs and phases, and BPMs.
 +
:#Centering Beam on X-Ray Screen/Radiator
 +
:##If the X-ray screen is available, steer beam to the center.
 +
:##Zero pos.
 +
:##Do an allsave noting the beam is centered on the radiator (plus the momentum setting and BUBBLE).
 +
 
 +
:'''Subsequent energy/momentum changes'''
 +
::If Hall probe readback is not available or continuously available, follow the procedure for setting the first energy/momentum.
 +
:#Calculate &Delta;p/p=(p<sub>desired</sub>-p<sub>previous</sub>)/p<sub>previous</sub>
 +
:#Calculate &Delta;B<sub>Hall probe</sub>=B<sub>previous Hall probe</sub>(&Delta;p/p)
 +
:#Calculate B<sub>desired Hall probe</sub>=B<sub>previous Hall probe</sub>+&Delta;B<sub>Hall probe</sub>
 +
:#Set MDL0L02.BDL to setting from table or MDL0L02_calculator.pl and adjust the setting until the Hall probe is at the desired setting.
 +
:#Cycle the dipole twice.
 +
:#Log the Hall probe and dipole readbacks (MDL0L02 dipole and DTM 151 Digital Teslameter screens).
 +
:#Set the 5D line horizontal correctors to zero.
 +
:#:MBH5D00H
 +
:#:MBH5D00AH
 +
:#:MBH5D01H
 +
:#Alternately adjust the quarter cavity 2-7 and 2-8 GSETs in small increments (0.01-0.1) until the BPM absolute positions in the 5D line are within 5 mm in x.  Getting them both to zero with good signal is difficult to achieve, and it may be necessary to split the difference (have one positive and the other negative).  If the energy is "large", consider inserting the viewer ITV5D00 and adjusting the gradients to get beam on the viewer, and then repeat with ITV5D01.  This should get the energy close, and then steering to the BPMs can be used to fine tune the energy/momentum setting.
 +
:#Adjust, if necessary MBH0L01H/V, to get IPM0L02 to zero in x and y in absolute positions.  MHB0L02H/V can be used to move the beam on ITV5D00.
 +
:#Scale the quads by the ratio p<sub>new</sub>/p<sub>previous</sub> if beam spot is too diffuse.
 +
:#:MQJ0L02
 +
:#:MQJ0L02A
 +
:#:MQD5D00
 +
:#:MQD5D01
 +
:#Check that the quarter cavities are on crest in the 5D line if possible.  If necessary, put beam in the 2D line to check cresting.
 +
:#If the quarter phases changed, with beam in the 5D line, alternately adjust the 2-7 and 2-8 GSETs in small increments to restore the BPM settings.  If changes are large, iterate phasing, 0L01 steering to zero IPM0L02, and adjusting GSETs steps until changes are negligibly small.
 +
:#Beam should be in the same locations on the 5D line viewers.
 +
:#Zero pos
 +
:#Allsave saying momentum set, intended momentum, and BUBBLE.
 +
:#Log allsave number, cavity GSETs and phases, and BPMs.
 +
:#Centering Beam on X-Ray Screen/Radiator
 +
:##If the X-ray screen is available, steer beam to the center.
 +
:##Zero pos.
 +
:##Do an allsave noting the beam is centered on the radiator (plus the momentum setting and BUBBLE).
 +
 
 +
===Measure energy (optionally energy spread and emittance)===
 +
 
 +
:'''Set up for energy measurement (not necessary after initial quad centering session)'''
 +
:#Check centering in MQJ0L02, MQJ0L03A, MQD5D00, and MQD5D01.
 +
:#''Skip this step for the Engineering run.''  Set the 0L correctors to zero.
 +
 
 +
:'''Measurements'''
 +
 
 +
::Note MBH0L01H/V, MHB0L02H/V, and the MDL0L02 dipole settings are the only free "knobs" in the energy measurement portions of the procedure.  All other magnet settings have fixed values or are set to zero at different steps in the procedure.
 +
 
 +
::'''Undeflected (straight ahead) orbit data collection for energy measurement'''
 +
::#Set MDL0L02 to zero and degauss using Degauss script accessible from MDL0L02 dipole screen.
 +
::#If this is not the first energy measurement, restore the MHB0L02AH/V, MHB0L02BH/V, and MBH0L03H/V corrector settings from the initial energy measurement ('''''allsave 18717''''').  These corrector settings are considered to be fixed and must be restored for each undeflected orbit measurement.
 +
::#Set magnets on 2D and 3D (Mott Measurement Control) lines to zero and cycle to eliminate additional sources of stray fields.
 +
::#:MAD3D00H/V
 +
::#:MDT3D00
 +
::#:MDT3D01
 +
::#Set skew and normal quads between IPM0L02 and IPM0L03 to zero and cycle.
 +
::#:MQS0L02
 +
::#:MQJ0L02A
 +
::#:MQS0L02B
 +
::#:MQJ0L03A
 +
::#Adjust MBH0L01H/V and MHB0L02H/V to restore IPM0L02 and IPM0L03 to zero in x and y absolute positions if necessary.
 +
::#Zero pos.
 +
::#Do an allsave and in the comment box include the assumed momentum and the keywords "undeflected orbit" or "straight ahead orbit" for energy measurement and BUBBLE.
 +
::#Record the undeflected orbit conditions in the logbook.
 +
::#:Intended or assumed energy/momentum
 +
::#:Laser/Slit configuration (slit setting, source laser, etc.)
 +
::#:allsave number
 +
::#:MDL0L02 screen
 +
::#:DTM 151 Digital Teslameter screen
 +
::#:0L BPMs
 +
::#:0L and 5D line correctors and quads
 +
::#:Quarter cavity gradients
 +
 
 +
::'''Emittance measurement (additional information is further down the page)'''
 +
::#If necessary, with correctors downstream of MDL0L02, steer beam to zero in x and y absolute positions on IPM0L03.
 +
::#Use eDT (Alt) (eDT_alternate) to set MQJ0L02 and MQJ0L02A.
 +
::##Select INJ-R as the endpoint in the box labeled Step 1.
 +
::##In the box labeled Step 2, set the Preinjector momentum to the target value.
 +
::##In the box labeled FILTERS on the right, double click on INJ-L.
 +
::##In the box labeled Step 3, click on GO (i.e. Fetch Elements and Design Setpoints for the selected endpoint).
 +
::##Manually set MQJ0L02 and MQJ0L02A to the Design values shown.
 +
::#Perform 0L02 quad/0L03 horizontal and vertical scans and analyze results with qsUtility using
 +
::#:'''''/a/opsdata/fiefdata/fileio/q/qsUtility/config/F3-0/Bubble/IHA0L03_x_zigzag_p-5.74_2018_05_11.xml'''''
 +
::#:'''''/a/opsdata/fiefdata/fileio/q/qsUtility/config/F3-0/Bubble/IHA0L03_y_zigzag_p-5.74_2018_05_11.xml'''''
 +
::#:or similar.  Remember to change the momentum from the default 6.279 MeV/c to the intended momentum in the qsUtility GUI!
 +
::#Back out any quad and steering changes.
 +
::#In the analysis, make sure the back propagate box near the bottom of the screen is set to MQJ0L02.
 +
 
 +
::'''Energy spread harp scan (additional information is further down the page)'''
 +
::#Put beam in 2D line using the MDL0L02 dipole.  Any steering must be performed with correctors in the 0L line only.
 +
::#Scale the quads by the ratio p<sub>new</sub>/p<sub>previous</sub> or manually adjust them if beam spot is too diffuse.
 +
::#Swipe harp.
 +
::#Log harp swipe and harp expert screen along with 0L quad and MDL0L02 dipole settings.
 +
::#Back out any quad and steering changes.
 +
 
 +
::'''Deflected (5D line) orbit data collection for energy measurement'''
 +
::#Restore MBH0L01H/V and MHB0L02H/V from the undeflected orbit allsave.
 +
::#Set steering coils between MDL0L02 and IPM0L03 to zero.
 +
::#:MHB0L02AH/V
 +
::#:MHB0L02BH/V
 +
::#:MBH0L03H/V
 +
::#Set the 5D line horizontal correctors to zero.
 +
::#:MBH5D00H
 +
::#:MBH5D00AH
 +
::#:MBH5D01H
 +
::#Set MQJ0L02, MQJ0L02A, MQD5D00, and MQD501 to calculated settings.
 +
::#Iteratively set and cycle MDL0L02 to establish beam in IPM5D00 and IPM5D01 to within 5 mm in x absolute position.  Getting them both to zero with good signal is difficult to achieve, and it may be necessary to split the difference (have one positive and the other negative).
 +
::#Cycle MDL0L02.
 +
::#Zero pos the orbit.
 +
::#Do an allsave and in the comment box include the assumed momentum and the keywords "deflected orbit" or "5D orbit" for energy measurement and BUBBLE.
 +
::#Record the deflected orbit conditions in the logbook.
 +
::#:Intended or assumed energy/momentum
 +
::#:Laser/Slit configuration (slit setting, source laser. etc.)
 +
::#:allsave number
 +
::#:MDL0L02 screen
 +
::#:DTM 151 Digital Teslameter screen
 +
::#:5D BPMs
 +
::#:0L and 5D line correctors and quads
 +
::#:Quarter cavity gradients
 +
::#Centering Beam on X-Ray Screen/Radiator
 +
::##If the X-ray screen is available, steer beam to the center.
 +
::##Zero pos.
 +
::##Do an allsave noting the beam is centered on the radiator (plus the momentum setting and BUBBLE).
 +
 
 +
===Quad centering===
 +
 
 +
{| class="wikitable"
 +
|-
 +
| '''Quad'''
 +
| '''BPM'''
 +
| '''Correctors'''
 +
| '''Viewer'''
 +
|-
 +
| MQJ0L02
 +
| IPM0L02
 +
| MHB0L01AH/V
 +
| ITV0L03
 +
|-
 +
| MQJ0L03A
 +
| MHB0L02AH/V, MHB0L02BH/V (most effective), MBH0L03H/V (not too useful)
 +
| IPM0L03
 +
| ITV0L04
 +
|-
 +
| MQD5D00
 +
| MBH5D00H/V
 +
| IPM5D00
 +
| ITV5D01
 +
|-
 +
| MQD5D01
 +
| MBH5D00AH/V
 +
| IPM5D01
 +
| ITV5D01
 +
|}
 +
 
 +
#Insert viewer.
 +
#Use Ditherer to change quad setting.
 +
##Set the signal to the quad_name.BDL.
 +
##Toggle the "Step Size (%)" button to "Set Step Size (abs)" and set the step to 30-50 G.
 +
##Set the "Delay (sec)" to 1.
 +
##Push the "Start Dither" button to start dithering the quad BDL.
 +
#Adjust the designated correctors to get the beam spot centroid to stay in one location on the viewer and (at most) change size.  Correctors downstream of the quad/BPM pair may be used to move beam on the viewer.  Note it may be necessary to center in intervening quads between the quad/BPM pair before centering in the targetted quad.
 +
#Stop dithering (push "Stop Dither") when the beam centroid stops moving with quad setting changes.
 +
#Put the quad on-loop and cycle.
 +
#Retract the viewer.
 +
#Run Tune beam to get a nice signal on the BPMs.
 +
#Change BPM SOFs if they changed and document in logbook whether or not they changed and by how much if they did.
 +
##Note present BPM SOFs.
 +
##:caget bpm_name.XSOF
 +
##:caget bpm_name.YSOF
 +
##Set BPM SOFs to zero.
 +
##:caput bpm_name.XSOF 0
 +
##:caput bpm_name.YSOF 0
 +
##Determine new SOFs.
 +
###Temporarily change the BPM's monitor deadband to 0 if not already 0.
 +
###:caget bpm_name.MDEL
 +
###:caput bpm_name.MDEL 0
 +
###Get present BPM positions.
 +
###:caget bpm_name.XPOS
 +
###:caget bpm_name.YPOS
 +
##Set new SOFs.
 +
###Set SOFs to present BPM positions.
 +
###:caput bpm_name.XSOF XPOS_value_rounded_to_2_decimal_places
 +
###:caput bpm_name.YSOF YPOS_value_rounded_to_2_decimal_places
 +
###Restore BPM's monitor deadband if changed previously.
 +
###:caput bpm_name.MDEL original_MDEL_value
 +
#If this is not the first quad centering session, back out any steering changes.
  
 
= Emittance Measurement =
 
= Emittance Measurement =
  
 
:Setup beam to FC2
 
:Setup beam to FC2
:Use qsUtility configuration files to scan MQJ0L02 and/or MQJ0L02A and uses harp IHA0L03 -- files in default fileio directory for zig-zag dataCollector <br>
+
:Use qsUtility configuration files to scan MQJ0L02 and/or MQJ0L02A and uses harp IHA0L03 (good scan is near IPM0L03X=Y=0). Files are in
'''''/a/opsdata/fiefdata/fileio/q/qsUtility/config/F3-0/Bubble/''''' named IHA0L03_[x,y]_zigzag_bubble_2018_05_02_DAY.xml
+
'''''/a/opsdata/fiefdata/fileio/q/qsUtility/config/F3-0/Bubble/''''' named '''''IHA0L03_[x,y]_zigzag_bubble_2018_05_02_DAY.xml'''''
 
:Be sure to enter the correct momentum in the configuration and/or analysis files
 
:Be sure to enter the correct momentum in the configuration and/or analysis files
 
:Elegant optics lattice begins at MQJ0L02 (that is, use or propagate optics to that location)
 
:Elegant optics lattice begins at MQJ0L02 (that is, use or propagate optics to that location)
Line 27: Line 260:
  
 
===Setup beam to 2D spectrometer dump===
 
===Setup beam to 2D spectrometer dump===
:Upstream quads MQJ0L02 and MQJ0L02A can be any value but their integrated gradient value B'L (.BL field) must be recorded
+
:Upstream quads MQJ0L02 and MQJ0L02A can be any value but their integrated gradient value B'L (.BDL field) must be recorded
 
:Use HarpFitterTool to scan IHA2D00 to measure horizontal beam size
 
:Use HarpFitterTool to scan IHA2D00 to measure horizontal beam size
  
Line 46: Line 279:
 
:: Type command '''''sddsprintout -col=ElementName -col=betax -col=etax energyspread.twi'''''
 
:: Type command '''''sddsprintout -col=ElementName -col=betax -col=etax energyspread.twi'''''
 
:: Record value of betax [m] and etax [m] at IHA2D00
 
:: Record value of betax [m] and etax [m] at IHA2D00
 +
:Calculate relative momentum spread (dp/p=sigma_dp (in elegant)) using the geometric emittance not normalized emittance and &sigma;<sub>x</sub> in m.
 +
:::(dp/p)=&radic;(&sigma;<sub>x</sub><sup>2</sup>+&beta;<sub>x</sub>&epsilon;<sub>x</sub>)
  
 
= Set Beam Size at Radiator =
 
= Set Beam Size at Radiator =
Line 76: Line 311:
 
:::&end
 
:::&end
  
===Run Elegant Optimization===
+
===Run Elegant Optimization on a '''RHEL7''' system (like opsl10)===
 
::Type command '''''elegant BubbleChamber_FIT.ele'''''
 
::Type command '''''elegant BubbleChamber_FIT.ele'''''
 
::Depending on difficulty of solution may take 20-30 min
 
::Depending on difficulty of solution may take 20-30 min
 
::Terminal output will show result of optimization and desired quad values (in units of K1)
 
::Terminal output will show result of optimization and desired quad values (in units of K1)
::You will need to convert from K1 to integrated field B'L (units of Gauss for EPICS .BL field)
+
::You will need to convert from K1 to integrated field B'L (units of Gauss for EPICS .BDL field)
 
::: '''K1 [1/m^2] = 2.998 * B_EPICS [G] / (L [cm] * p [MeV/c])''' ; note that L=15cm for both QJ and QD quads self-consistently  
 
::: '''K1 [1/m^2] = 2.998 * B_EPICS [G] / (L [cm] * p [MeV/c])''' ; note that L=15cm for both QJ and QD quads self-consistently  
 
::Run also generates a new lattice named NEW.lte (where the quad values have been updated)
 
::Run also generates a new lattice named NEW.lte (where the quad values have been updated)
Line 103: Line 338:
  
 
:To make a projection plot of a watch file, say, watch.W1 .... first generate a histogram and then plot it, e.g.:  '''(THANKS CHRIS!)'''
 
:To make a projection plot of a watch file, say, watch.W1 .... first generate a histogram and then plot it, e.g.:  '''(THANKS CHRIS!)'''
::'''''sddshist watch.W1 W1.hist -dataColumn=x -bins=100 -lowerLimit=-5e-3 -upperLimit=5e-3 -normalize=area'''''
+
::'''''sddshist BubbleChamber.HA5D01 HA5D01-x.hist -dataColumn=x -bins=100 -lowerLimit=-5e-3 -upperLimit=5e-3 -normalize=area'''''
::'''''sddsplot -col=x,frequency -graph=lines W1.hist'''''
+
::'''''sddsplot -col=x,frequency -graph=lines HA5D01-x.hist'''''
 +
::'''''sddshist BubbleChamber.HA5D01 HA5D01-y.hist -dataColumn=y -bins=100 -lowerLimit=-5e-3 -upperLimit=5e-3 -normalize=area'''''
 +
::'''''sddsplot -col=y,frequency -graph=lines HA5D01-y.hist'''''
  
 
:To make a plot of the optics:
 
:To make a plot of the optics:
::sddsplot -legend -graphic=line,vary BubbleChamber.twi -columnNames=s,'(betax,betay)' -yScalesGroup=id=beta -columnNames=s,'(alphax,alphay)' -yScalesGroup=id=alpha -columnNames=s,'(etax,etay)' -yScalesGroup=id=eta
+
::'''sddsplot -legend -graphic=line,vary BubbleChamber.twi -columnNames=s,'(betax,betay)' -yScalesGroup=id=beta -columnNames=s,'(alphax,alphay)' -yScalesGroup=id=alpha -columnNames=s,'(etax,etay)' -yScalesGroup=id=eta'''

Latest revision as of 12:17, 17 May 2018

Beamline Survey and Elegant Optics Model

September 2015 - Chris Tennant's Model copied here for reference /usr/opsdata/bubble/elegant/Sep2015
May 2018 - Updated to include 2D spectrometer line and new harp IHA5D01 /usr/opsdata/bubble/elegant/May2018
May 2018 Data Transmital media:DT_L1862.pdf

Operating the Cryounit at 4K

From past experience we have done a couple things...

Communicate to the cryo coordinator before turning on SRF
Generate a strip chart of liquid level, JT valve and the two unit gradients
Adjust the gradients in small enough steps (~0.5) to allow recover equilibrium LL (JT will be larger w/ higher gradient)

Energy Setup and Measurement

Set energy

Momentum (MeV/c) Kinetic Energy (MeV) Calculated dipole setting (G-cm)
5.84 5.35 8246.344
5.74 5.25 8105.146
5.64 5.15 7963.949
5.54 5.05 7822.752
5.44 4.95 7681.557
5.34 4.85 7540.363
5.24 4.75 7399.170
First energy/momentum (p=5.74 MeV/c)
  1. Set MDL0L02.BDL according to the setpoint in the table or from the MDL0L02_calculator.pl in /a/opsdata/bubble/energy.
    > /a/opsdata/bubble/energy/MDL0L02_calculator.pl p 5.64
    p 5.64 MeV/c -> 5D line (25 deg.) BDL 7963.94855360974 G-cm
    p 5.64 MeV/c -> 2D line (-30 deg.) BDL -9437.96774120548 G-cm
  2. Note the Hall probe readback and set up parameters on the MDL0L02 dipole and DTM 151 Digital Teslameter screens (put snapshots in logbook) as this is the reference for the other energy changes.
  3. Alternately adjust the quarter cavity 2-7 and 2-8 GSETs in small increments (0.01-0.1) until the BPM absolute positions in the 5D line are within 5 mm in x (aim for less than 5 mm if possible; smaller relative differences are better). Getting them both to zero with good signal is difficult to achieve, and it may be necessary to split the difference (have one positive and the other negative).
  4. Adjust, if necessary MBH0L01H/V, to get IPM0L02 to zero in x and y absolute positions. MHB0L02H/V can be used to move the beam on ITV5D00.
  5. Check that the quarter cavities are on crest in the 5D line if possible; otherwise, put beam in the 2D line to check cresting.
  6. If the quarter phases changed, with beam in the 5D line, alternately adjust the 2-7 and 2-8 GSETs in small increments to restore the BPM settings found before cresting. If changes are large, iterate phasing, steering with MBH0L01H/V t zero IPM0L02, and adjusting GSETs steps until changes are negligibly small.
  7. Note the position of the beam on the 5D viewers (put snapshots in logbook).
  8. Zero pos
  9. Allsave saying momentum set, intended momentum, and BUBBLE.
  10. Log allsave number, cavity GSETs and phases, and BPMs.
  11. Centering Beam on X-Ray Screen/Radiator
    1. If the X-ray screen is available, steer beam to the center.
    2. Zero pos.
    3. Do an allsave noting the beam is centered on the radiator (plus the momentum setting and BUBBLE).
Subsequent energy/momentum changes
If Hall probe readback is not available or continuously available, follow the procedure for setting the first energy/momentum.
  1. Calculate Δp/p=(pdesired-pprevious)/pprevious
  2. Calculate ΔBHall probe=Bprevious Hall probe(Δp/p)
  3. Calculate Bdesired Hall probe=Bprevious Hall probe+ΔBHall probe
  4. Set MDL0L02.BDL to setting from table or MDL0L02_calculator.pl and adjust the setting until the Hall probe is at the desired setting.
  5. Cycle the dipole twice.
  6. Log the Hall probe and dipole readbacks (MDL0L02 dipole and DTM 151 Digital Teslameter screens).
  7. Set the 5D line horizontal correctors to zero.
    MBH5D00H
    MBH5D00AH
    MBH5D01H
  8. Alternately adjust the quarter cavity 2-7 and 2-8 GSETs in small increments (0.01-0.1) until the BPM absolute positions in the 5D line are within 5 mm in x. Getting them both to zero with good signal is difficult to achieve, and it may be necessary to split the difference (have one positive and the other negative). If the energy is "large", consider inserting the viewer ITV5D00 and adjusting the gradients to get beam on the viewer, and then repeat with ITV5D01. This should get the energy close, and then steering to the BPMs can be used to fine tune the energy/momentum setting.
  9. Adjust, if necessary MBH0L01H/V, to get IPM0L02 to zero in x and y in absolute positions. MHB0L02H/V can be used to move the beam on ITV5D00.
  10. Scale the quads by the ratio pnew/pprevious if beam spot is too diffuse.
    MQJ0L02
    MQJ0L02A
    MQD5D00
    MQD5D01
  11. Check that the quarter cavities are on crest in the 5D line if possible. If necessary, put beam in the 2D line to check cresting.
  12. If the quarter phases changed, with beam in the 5D line, alternately adjust the 2-7 and 2-8 GSETs in small increments to restore the BPM settings. If changes are large, iterate phasing, 0L01 steering to zero IPM0L02, and adjusting GSETs steps until changes are negligibly small.
  13. Beam should be in the same locations on the 5D line viewers.
  14. Zero pos
  15. Allsave saying momentum set, intended momentum, and BUBBLE.
  16. Log allsave number, cavity GSETs and phases, and BPMs.
  17. Centering Beam on X-Ray Screen/Radiator
    1. If the X-ray screen is available, steer beam to the center.
    2. Zero pos.
    3. Do an allsave noting the beam is centered on the radiator (plus the momentum setting and BUBBLE).

Measure energy (optionally energy spread and emittance)

Set up for energy measurement (not necessary after initial quad centering session)
  1. Check centering in MQJ0L02, MQJ0L03A, MQD5D00, and MQD5D01.
  2. Skip this step for the Engineering run. Set the 0L correctors to zero.
Measurements
Note MBH0L01H/V, MHB0L02H/V, and the MDL0L02 dipole settings are the only free "knobs" in the energy measurement portions of the procedure. All other magnet settings have fixed values or are set to zero at different steps in the procedure.
Undeflected (straight ahead) orbit data collection for energy measurement
  1. Set MDL0L02 to zero and degauss using Degauss script accessible from MDL0L02 dipole screen.
  2. If this is not the first energy measurement, restore the MHB0L02AH/V, MHB0L02BH/V, and MBH0L03H/V corrector settings from the initial energy measurement (allsave 18717). These corrector settings are considered to be fixed and must be restored for each undeflected orbit measurement.
  3. Set magnets on 2D and 3D (Mott Measurement Control) lines to zero and cycle to eliminate additional sources of stray fields.
    MAD3D00H/V
    MDT3D00
    MDT3D01
  4. Set skew and normal quads between IPM0L02 and IPM0L03 to zero and cycle.
    MQS0L02
    MQJ0L02A
    MQS0L02B
    MQJ0L03A
  5. Adjust MBH0L01H/V and MHB0L02H/V to restore IPM0L02 and IPM0L03 to zero in x and y absolute positions if necessary.
  6. Zero pos.
  7. Do an allsave and in the comment box include the assumed momentum and the keywords "undeflected orbit" or "straight ahead orbit" for energy measurement and BUBBLE.
  8. Record the undeflected orbit conditions in the logbook.
    Intended or assumed energy/momentum
    Laser/Slit configuration (slit setting, source laser, etc.)
    allsave number
    MDL0L02 screen
    DTM 151 Digital Teslameter screen
    0L BPMs
    0L and 5D line correctors and quads
    Quarter cavity gradients
Emittance measurement (additional information is further down the page)
  1. If necessary, with correctors downstream of MDL0L02, steer beam to zero in x and y absolute positions on IPM0L03.
  2. Use eDT (Alt) (eDT_alternate) to set MQJ0L02 and MQJ0L02A.
    1. Select INJ-R as the endpoint in the box labeled Step 1.
    2. In the box labeled Step 2, set the Preinjector momentum to the target value.
    3. In the box labeled FILTERS on the right, double click on INJ-L.
    4. In the box labeled Step 3, click on GO (i.e. Fetch Elements and Design Setpoints for the selected endpoint).
    5. Manually set MQJ0L02 and MQJ0L02A to the Design values shown.
  3. Perform 0L02 quad/0L03 horizontal and vertical scans and analyze results with qsUtility using
    /a/opsdata/fiefdata/fileio/q/qsUtility/config/F3-0/Bubble/IHA0L03_x_zigzag_p-5.74_2018_05_11.xml
    /a/opsdata/fiefdata/fileio/q/qsUtility/config/F3-0/Bubble/IHA0L03_y_zigzag_p-5.74_2018_05_11.xml
    or similar. Remember to change the momentum from the default 6.279 MeV/c to the intended momentum in the qsUtility GUI!
  4. Back out any quad and steering changes.
  5. In the analysis, make sure the back propagate box near the bottom of the screen is set to MQJ0L02.
Energy spread harp scan (additional information is further down the page)
  1. Put beam in 2D line using the MDL0L02 dipole. Any steering must be performed with correctors in the 0L line only.
  2. Scale the quads by the ratio pnew/pprevious or manually adjust them if beam spot is too diffuse.
  3. Swipe harp.
  4. Log harp swipe and harp expert screen along with 0L quad and MDL0L02 dipole settings.
  5. Back out any quad and steering changes.
Deflected (5D line) orbit data collection for energy measurement
  1. Restore MBH0L01H/V and MHB0L02H/V from the undeflected orbit allsave.
  2. Set steering coils between MDL0L02 and IPM0L03 to zero.
    MHB0L02AH/V
    MHB0L02BH/V
    MBH0L03H/V
  3. Set the 5D line horizontal correctors to zero.
    MBH5D00H
    MBH5D00AH
    MBH5D01H
  4. Set MQJ0L02, MQJ0L02A, MQD5D00, and MQD501 to calculated settings.
  5. Iteratively set and cycle MDL0L02 to establish beam in IPM5D00 and IPM5D01 to within 5 mm in x absolute position. Getting them both to zero with good signal is difficult to achieve, and it may be necessary to split the difference (have one positive and the other negative).
  6. Cycle MDL0L02.
  7. Zero pos the orbit.
  8. Do an allsave and in the comment box include the assumed momentum and the keywords "deflected orbit" or "5D orbit" for energy measurement and BUBBLE.
  9. Record the deflected orbit conditions in the logbook.
    Intended or assumed energy/momentum
    Laser/Slit configuration (slit setting, source laser. etc.)
    allsave number
    MDL0L02 screen
    DTM 151 Digital Teslameter screen
    5D BPMs
    0L and 5D line correctors and quads
    Quarter cavity gradients
  10. Centering Beam on X-Ray Screen/Radiator
    1. If the X-ray screen is available, steer beam to the center.
    2. Zero pos.
    3. Do an allsave noting the beam is centered on the radiator (plus the momentum setting and BUBBLE).

Quad centering

Quad BPM Correctors Viewer
MQJ0L02 IPM0L02 MHB0L01AH/V ITV0L03
MQJ0L03A MHB0L02AH/V, MHB0L02BH/V (most effective), MBH0L03H/V (not too useful) IPM0L03 ITV0L04
MQD5D00 MBH5D00H/V IPM5D00 ITV5D01
MQD5D01 MBH5D00AH/V IPM5D01 ITV5D01
  1. Insert viewer.
  2. Use Ditherer to change quad setting.
    1. Set the signal to the quad_name.BDL.
    2. Toggle the "Step Size (%)" button to "Set Step Size (abs)" and set the step to 30-50 G.
    3. Set the "Delay (sec)" to 1.
    4. Push the "Start Dither" button to start dithering the quad BDL.
  3. Adjust the designated correctors to get the beam spot centroid to stay in one location on the viewer and (at most) change size. Correctors downstream of the quad/BPM pair may be used to move beam on the viewer. Note it may be necessary to center in intervening quads between the quad/BPM pair before centering in the targetted quad.
  4. Stop dithering (push "Stop Dither") when the beam centroid stops moving with quad setting changes.
  5. Put the quad on-loop and cycle.
  6. Retract the viewer.
  7. Run Tune beam to get a nice signal on the BPMs.
  8. Change BPM SOFs if they changed and document in logbook whether or not they changed and by how much if they did.
    1. Note present BPM SOFs.
      caget bpm_name.XSOF
      caget bpm_name.YSOF
    2. Set BPM SOFs to zero.
      caput bpm_name.XSOF 0
      caput bpm_name.YSOF 0
    3. Determine new SOFs.
      1. Temporarily change the BPM's monitor deadband to 0 if not already 0.
        caget bpm_name.MDEL
        caput bpm_name.MDEL 0
      2. Get present BPM positions.
        caget bpm_name.XPOS
        caget bpm_name.YPOS
    4. Set new SOFs.
      1. Set SOFs to present BPM positions.
        caput bpm_name.XSOF XPOS_value_rounded_to_2_decimal_places
        caput bpm_name.YSOF YPOS_value_rounded_to_2_decimal_places
      2. Restore BPM's monitor deadband if changed previously.
        caput bpm_name.MDEL original_MDEL_value
  9. If this is not the first quad centering session, back out any steering changes.

Emittance Measurement

Setup beam to FC2
Use qsUtility configuration files to scan MQJ0L02 and/or MQJ0L02A and uses harp IHA0L03 (good scan is near IPM0L03X=Y=0). Files are in

/a/opsdata/fiefdata/fileio/q/qsUtility/config/F3-0/Bubble/ named IHA0L03_[x,y]_zigzag_bubble_2018_05_02_DAY.xml

Be sure to enter the correct momentum in the configuration and/or analysis files
Elegant optics lattice begins at MQJ0L02 (that is, use or propagate optics to that location)

Energy Spread Measurement

Setup beam to 2D spectrometer dump

Upstream quads MQJ0L02 and MQJ0L02A can be any value but their integrated gradient value B'L (.BDL field) must be recorded
Use HarpFitterTool to scan IHA2D00 to measure horizontal beam size

Use Elegant to calculate the horizontal beta (betax) and the horizontal dispersion (etax) at the harp location

Update lattice file
Type command cd /usr/opsdata/bubble/elegant/May2018/lattice
Edit lattice file BubbleChamber.lte
Update K1 values for MQJ0L02/MQJ0L02A (they appear in only one place)
Update energy spread elegant file
Type command cd /usr/opsdata/bubble/elegant/May2018/energy_spread
Edit command file energyspread.ele
Update p_central_mev [MeV/c]
Update beta_x [m] and beta_y [m] with qsUtility values computed at MQJ0L02
Update emit_nx [m-rad] and emit_ny [m-rad] with qsUtility values compated at MQJ0L02
Run Elegant model
Type command cd /usr/opsdata/bubble/elegant/May2018/energy_spread
Type command elegant energyspread.ele
Type command sddsprintout -col=ElementName -col=betax -col=etax energyspread.twi
Record value of betax [m] and etax [m] at IHA2D00
Calculate relative momentum spread (dp/p=sigma_dp (in elegant)) using the geometric emittance not normalized emittance and σx in m.
(dp/p)=√(σx2xεx)

Set Beam Size at Radiator

Pre-requisite measurements

Measured beam momentum in units of MeV/c
Measured normalized emittance and Twiss parameters at MQJ0L02 (e.g. from qsUtility)
Measured relative momentum spread (dp/p) (e.g. 1% is 0.01)

Define Elegant optimization (MQJ0L02, MQJ0L02A, MQD5D00, MQD5D01) to set beam size at radiator IDL5D01

Update elegant optimization file with measured beam parameters
Type command cd /usr/opsdata/bubble/elegant/May2018/beam_size
Edit command file BubbleChamber_FIT.ele
Update measured p_central_mev [MeV/c]
Update measured beta_x [m] and beta_y [m] with qsUtility values computed at MQJ0L02
Update measured emit_nx [m-rad] and emit_ny [m-rad] with qsUtility values compated at MQJ0L02
Update measured relative momentum spread sigma_dp
Update elegant optimization file with desired beam size and horizontal dispersion (there is no vertical dispersion)
Update desired horizontal beam size by choosing a value of RMSX in this line: term="RADIATOR#1.Sx RMSX 1e-5 sene",
Update desired vertical beam size by choosing a value of RMSY in this line: term="RADIATOR#1.Sx RMSY 1e-5 sene",
Solution is normally calculated with zero dispersion at the radiator. IF this is not desired then comment (put ! in first column) following lines:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! COMMENT (!) or UNCOMMENT FOR HORIZONTAL DISPERSION AT RADIATOR [m] (e.g. 0 is zero dispersion)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
&optimization_term
weight=1,
term="RADIATOR#1.etax 0 1e-2 sene",
verbose = 1,
&end

Run Elegant Optimization on a RHEL7 system (like opsl10)

Type command elegant BubbleChamber_FIT.ele
Depending on difficulty of solution may take 20-30 min
Terminal output will show result of optimization and desired quad values (in units of K1)
You will need to convert from K1 to integrated field B'L (units of Gauss for EPICS .BDL field)
K1 [1/m^2] = 2.998 * B_EPICS [G] / (L [cm] * p [MeV/c]) ; note that L=15cm for both QJ and QD quads self-consistently
Run also generates a new lattice named NEW.lte (where the quad values have been updated)

Generate final Elegant output of optimized solution

Edit command file BubbleChamber.ele
Update measured p_central_mev [MeV/c]
Update measured beta_x [m] and beta_y [m] with qsUtility values computed at MQJ0L02
Update measured emit_nx [m-rad] and emit_ny [m-rad] with qsUtility values compated at MQJ0L02
Update measured relative momentum spread sigma_dp
Type command elegant BubbleChamber.ele

Produce plots for comparison to viewer image and harp

To view a 2D plot of the (x,y) distribution at one of the "watch" elements (ITV5D00, ITV5D01, IHA5D01) use correspond suffix e.g.,
sddsplot -col=x,y -graph=dots BubbleChamber.TV5D01
To print the numerical values of beam size at each element,
sddsprintout -col=ElementName -col=s -col=Sx -col=Sy BubbleChamber.sig
To make a scatter plot of RMS beam size,
sddsplot -legend -graphic=line,vary BubbleChamber.sig -columnNames=s,'(Sx,Sy)'
To make a projection plot of a watch file, say, watch.W1 .... first generate a histogram and then plot it, e.g.: (THANKS CHRIS!)
sddshist BubbleChamber.HA5D01 HA5D01-x.hist -dataColumn=x -bins=100 -lowerLimit=-5e-3 -upperLimit=5e-3 -normalize=area
sddsplot -col=x,frequency -graph=lines HA5D01-x.hist
sddshist BubbleChamber.HA5D01 HA5D01-y.hist -dataColumn=y -bins=100 -lowerLimit=-5e-3 -upperLimit=5e-3 -normalize=area
sddsplot -col=y,frequency -graph=lines HA5D01-y.hist
To make a plot of the optics:
sddsplot -legend -graphic=line,vary BubbleChamber.twi -columnNames=s,'(betax,betay)' -yScalesGroup=id=beta -columnNames=s,'(alphax,alphay)' -yScalesGroup=id=alpha -columnNames=s,'(etax,etay)' -yScalesGroup=id=eta