CHECKLIST
BEAM CONDITIONS and SETUP
To check before and during data taking.
- CURRENT (on ATF Status screen): Make sure "EXT" is > 0.6. If it isn't, ask shifter to increase current. You can also do this by going to "BEAM ON/OFF" and increasing "BUNCH" SET to a higher percentage.
- REP RATE (on ATF Status screen): Should be 1.56 Hz. If not, on Desktop 1, go to "BEAM ON/OFF"" "REPRATE CONTROL" and select "1.56 Hz" (Single Bunch)
- MAGNETS: On Desktop1, go to "MAG" -> "EXT QUAD" and look at the "FILE" and "SET" columns. Make sure that the "SET" column entries are non-zero.
- KICKER: On Desktop1, go to "KICKER". The settings for the Extraction Kicker should read something like: DELAY 5.036 s. The important thing is the timing of 5.036 s, or close to there.
- TIMING: On Desktop1, go to "TIMING" -> "DIR/EXT TIMING" -> "Cavity BPM". Look at "CBPM" for both START and GATE: DELAY 1.070us. The important thing here is that the delay is set to 1.070us, or close to there. We saved the settings: 17E
- Delta-f RAMP: On Desktop1, make sure that for "Deltaf Ramp", it is set at: "Ramp OFF", "Hold OFF"
- BPM TIMING (Reading BPMs from last turn of DR): On Desktop1, go to "MONITOR" -> under "BEAM POSITION" go to -> "DR" -> "READER CONTROL" -> "CHANGE".. Can verify BPM reading in last turn of DR by incrementing turn # by one until ring BPMs show zero beam... then put it back! It is usually somewhere around 996169 so try around there.
DAQ and Strip Charts
- Make sure that matlab and text files are non-zero! This is very important... There have been a few times when the matlab/ascii files were not being saved properly.
- Bring up all waveforms and make sure we see signals and not pedestals. You can bring up the waveforms by going to the menu that says "NanoBPM Stripcharts", then go to "Histograms" and then "Raw Waveforms". You can also use these waveforms to see if they are too saturated and the BPMs need to be steered down, etc.
- If stripcharts and waveforms are not showing anything, it is usually a problem with DAQ/trigger/LO/etc.. See trouble-shooting tips below.
Other Trouble-Shooting Tips:
- Make sure LO's are on! If waveforms are just pedestal, then the LO may not be on.
- If something is wrong with the data being stored (such as the number of pulses per RUN), the matlab scripts (such as nanorun.m) may have been edited..
- Other things to check if you see just nothing/pedestals:
- Is LO RF on? Amps?
- Trigger WF?
- Kicker timing looks OK?
- Is the gateway server up? Glen or Stewart should know how to fix this.
- Is the record length correct (250)? Glen or Stewart should know how to fix this.
- If strip charts are all flat, make sure trigger WF is being read. You can check this by looking at the trigger waveform (waveform0). If this is completely flat, make sure timing is OK.
- Make sure nanoRH (stripcharts computer) is seeing waveforms via EPICS. you can check this by doing a "testca lsis1:waveform1" on nanoRH in the workdir (see instructions below).
NANOBPM Shifter Manual
To Begin:
1) Go to Desktop 2
2) Bring up a few terminals
3) Be sure to go through CHECKLIST at beginning of data taking! See Page _____ for checklist.
4) Make sure to take notes in the LOG BOOK! Notes should also be taken in the ATF log book.
5) The convention is that > stands for linux prompt and >> stands for matlab prompt. You can run linux commands in the matlab prompt by putting an ! in front of the command.
To Prep MatLab DAQ:
1) login to nanosun on one terminal:
- > ssh user1@nanosun.kek.jp
- Password:
- > cd nanorun/
2) Do it again in another terminal. (You'll have to do this in a separate terminal rather than doing "xterm &".)
3) Run matlab in both of the terminals.
- matlab1 >> will indicate the main matlab prompt.
- matlab2 >> will indicate the helper matlab prompt.
Note: As Marc has explained, one of the terminals will act as sort of the "master" terminal and the other is the "helper".. This is because when we are doing strut/leg moves in one matlab session, the other will be taking data so we can see the moves in the stripcharts. Be sure to do a "dostop" for nanorun if you want to start a motmov calibration.
Note: If you want to run unix commands at the matlab prompt, just put a "!" in front of whatever command. For instance: !ls -rt msaves/
To Do Regular Run (nanorun):
0) For a regular run, it would be good to have the X and Y's steered down, close to zero...
1) Run nanorun in one of the terminals
2) If you want to stop it, DO NOT do control-C !!! Rather, do a "dostop" in the *OTHER* matlab session.
(At the linux prompt, it would simply be "dostop" with no exclamation point. Be sure that this is done in the nanorun directory.)
To Do Calibration Run (motmove and motmove_reduced):
1) At matlab prompt, run all the y & dx calibration runs:
2) At matlab prompt, run all the x & dy calibration runs:
3) Write down the calibration steps, BPM#, file names, etc in the log book. The way to find out the file names is to do (at the OTHER matlab prompt):
- matlab2 >> !ls -rt msaves/
This lists the files in the msaves directory, in reverse chronological order.
4) *DO NOT* do a dostop in the middle of a calibration run, because the BPMs will not be left at zero, otherwise.. and you will have to manually put them to zero. Rather, if wait til the motmov's are done so that everything will be returned to zero.
5) IF RUN IS INTERUPPTED or really screwed up for some reason..
For instance, if the beam is out for one of the y cal runs but not all, and you don't want to rerun all of them (since it will take ~20 minutes), you can run them individually like:
- matlab1 >> motmove(-100,100,50,1,'x')
- matlab1 >> motmove(-100,100,50,2,'x')
- matlab1 >> motmove(-100,100,50,3,'x')
- matlab1 >> motmove(-1000,1000,500,1,'dy')
- matlab1 >> motmove(-1000,1000,500,2,'dy')
- matlab1 >> motmove(-1000,1000,500,3,'dy')
- matlab1 >> motmove(-20,20,10,1,'y')
- matlab1 >> motmove(-20,20,10,2,'y')
- matlab1 >> motmove(-20,20,10,3,'y')
- matlab1 >> motmove(-500,500,250,1,'dx')
- matlab1 >> motmove(-500,500,250,2,'dx')
- matlab1 >> motmove(-500,500,250,3,'dx')
Note: The arguments go as motmove(min, max, stepsize, nBPM, 'direction') . This means the first one would be a x calibration for BPM 1, going from -100 to 100 microns in steps of 50 microns. Likewise, the last one would be a dx (aka, y prime) calibration for BPM 3 from -500 to 500 microradians in steps of 250 micro-radians.
Note: The max, min, and stepsize differ between the x and y runs.
6) Reduced calibration is:
- matlab1 >> motmoveallx_reduced
- matlab1 >> motmoveally_reduced
or individually as:
- matlab1 >> motmove_reduced(-20,20,1,'y')
- matlab1 >> motmove_reduced(-20,20,2,'y')
- matlab1 >> motmove_reduced(-20,20,3,'y')
- matlab1 >> motmove_reduced(-500,500,1,'dx')
- matlab1 >> motmove_reduced(-500,500,2,'dx')
- matlab1 >> motmove_reduced(-500,500,3,'dx')
- matlab1 >> motmove_reduced(-100,100,1,'x')
- matlab1 >> motmove_reduced(-100,100,2,'x')
- matlab1 >> motmove_reduced(-100,100,3,'x')
- matlab1 >> motmove_reduced(-500,500,1,'dy')
- matlab1 >> motmove_reduced(-500,500,2,'dy')
- matlab1 >> motmove_reduced(-500,500,3,'dy')
To Do More Complicated MatLab stuff (leg_move, motor_move, bpm_move):
1) leg_move: is used to make y movements (ie, move the entire structure vertically). The syntax is:
- matlab1 >> leg_move(nY,ndX) * NOT RECOMMEDED * because units are not in microns.
Try just using motor-moves!
We generally leave ndX = 0.
2) motor_move: is used to make dx (y') or dy (x') movements. The syntax is:
- matlab1 >> motor_move(nChannel,nSteps)
where nChannel is either 7, 8, 15, or 16 depending on which leg you want to move. (See diagram below.)
nSteps should be < 100 (which corresponds to 50 microns!).
There are software and hardware limits that you will hit, however.
? beam
7 _ 8
15 |_| 16
3) bpm_move: moves the struts. The syntax is:
- matlab1 >> bpm_move(nBPM,x,y,z,dx,dy,dz)
where nBPM is 1, 2, or 3, and x, y, z correspond the amount of movement in microns and dx, dy, dz correspond to the amout of movement in micro-radians.
4) There's a README file in nanorun/README and you can look at it by:
- >> !less README
press q to quit when you want to get out of "less"
To Run Root Strip Charts:
1) Login (i will tell you the password)
new
- > ssh -X user1@nanosun.kek.jp
- > ssh -X nanouser@nanoRH
2) Switch into the proper directory
- > cd nanobpm/NanoAnalysis/
3) Pull up another 3 xterms
- > xterm &; xterm &; xterm &;
4) Set the path properly. BE SURE to do this in the nanobpm/NanoAnalysis dir. Also, be sure to do it in ALL xterms, or things will not run properly. Then switch in to the workdir directory.
- > srtpath
- > 7.1.2 <enter>
- > Linux24 <enter>
- > cd workdir
Be sure to srtpath correctly, or this will not work properly!
5) Check the constants. They are kept in $E158CON/Nano/ directory, which is not a nanouser directory. The program (for now) reads BpmConst.r0 but other constant files are kept there for later use. You can check the constants by:
- > ls $E158CON/Nano/
- > cat $E158CON/Nano/BpmConst.r0
6) In one of your xterms, you can run the analysis, (while in the other, you will run the strips.. coming up in next step.)
- xterm1 > bin/Linux24/NanoApp ../NanoModules/online.tcl
7) Now run the strips using ROOT. here's a quick command;
- xterm2 > srtroot .x ../RooStripChart/nanogui.C
8) Pull up a couple waveforms to make sure that things look OK.
- xterm3 > srtroot .x ../RooStripChart/wfdisplay.C
Make sure the all waveforms are present and look OK!
Ordering of the waveforms for SIS1 (SLAC BPMs) are usually:
waveform0 Trigger
waveform1 Reference
waveform2 X 1
waveform3 Y 1
waveform4 X 2
waveform5 Y 2
waveform6 X 3
waveform7 Y 3
Alternatively to steps 4 through 8, you can use the new scripts: runNanoApp (for running NanoApp), runGUI (for running the stripcharts), runWF (for displaying the waveforms)
9) BE SURE to start NanoApp BEFORE you run the strips or it won't work. Also, you'll need to restart if you want to change constants, because they are read in at the beginning.
10) If you want to exit NanoApp, just do Control-C ONCE. If you want to exit RooStripChart, do ".q" (as in quit) at the root prompt.
Note: If you want to change the time (horizontal) range, you can set it by right clicking on the horizontal axis, selecting "SetRangeUser", and entering the range values you want.
OTHER TIPS for SHIFTERS:
1) WAVEFORMS: Keep an eye on the strip chart waveforms and make sure they are updating properly and look OK. You can look at these to see if the waveforms are too saturated, missing, or whatever else.
2) MATLAB stats: nanorun prints out some diagnostic info.
a) It prints out which pulses are missing.
b) It also prints out the efficiency, which corresponds to the fraction of pulses which have an reference signal rms > 50, compared with the total number of pulses. (So this wouldn't tell you if we aren't reading Trigger, X, or Y pulses.. just the Ref.)
3) FILES: Be sure that the files being written out aren't zero or unusually small in size. MatLab will crash if the files are too small in size.
FYI:
If you want to edit a file on nanosun, you will have to do it without popping up an emacs (or whatever) window. You can use "vi", or as I prefer, you can do:
To save a file in emacs: Control-X Control-S.
To (close) exit emacs: Control-X Control-C.
Note: If you run emacs like this in the matlab prompt instead of the linux one, you might have some trouble doing "Control-X Control-S". More specifically, the session might freeze up. In this case do "Control-Q" to get un-frozen. If you want to save the file, you can just do "Control-X Control-C" and it will ask you if you want to save the file before quitting.
Instructions for running NANOBPM DAQ (README file)
From xterm:
type matlab_nano for main DAQ running session (nanorun, motmove)
type matlab_nd for secondary session for monitoring data (temps)
--------------------------------------------------------------------
NB: stop runs with dostop command from command line in same directory as matlab
session
nanorun: main analysis routine, takes a number of sets of sis data for
8/16 channels together with consecutive sets of ATF bpm data.
motor/lvdt stuff is stored in motstruc
temperature readings etc are stored in tempstruc
SIS Digitiser output is stored in sisdata
-saves one file per data set in msaves/<date/time>/RUN1:RUNX
motmove: use for callibrating bpm movement
can also use motmovenew for doing multiple motmoves with motmoveally etc.
use bpm_return(bpm) to recover starting BPM position in case of error during
motmove
motor_callib(nstep,niter,dir,bpmleg): callibrate motor steps:lvdt reading slopes
and store in mcallib/ (should be performed before motor move routines used).
motor_move(mot,steps): use for moving individual motors, move 0 steps to
get lvdt readouts
bpm_move[_fast](bpm,x,y,z,dx,dy,dz): use to move a bpm in microns in the require
d way(dx=pitch dy=yaw dz=roll) (using bpm_move_fast is quicker- moves all struts
simulaniously- but is less tested)
bpm_moveto(bpm,posvec(6)): use to move to a specified point in 6D space, to
within tolerences defined in motsrtuc. use bpm_moveto(bpm,0) to return to
cllibrated zero point. (uses bpm_move_fast)
bpm_read(bpm): returns 6D current position of bpm
leg_move(y,dx): move whole alignment frame in y,dx (vertical, pitch) by moving l
eg motors (moves in um).
[y,dx] = leg_read: get current aligment frame y,dx position with respect to zero
s input in motor_init
setvdio(''ff00'',0:12,val): use to set IO card chanel 1:12 val=0,1- ATF
scalar is on channel 0.
evalc('!./get_atf_bpms NSAMP FREQ &'): use to take NSAMP bpm data sets at FREQ (
Hz) and save binary file to atf_bpms.txt.
atf_getbpm(npulse): read in ATF bpm data and scalar from atf_bpms.txt for
npulse(s)
sisdata=take_sn(NSAMP,0): takes 800 * 8 * NSAMP data
Taking continuous temperature readings:
-Start new matlab session on nanolinux with matlab_nd
-type temp_start
-type tempstop in command window to stop process (restart only from new matlab s
ession)
-temp data saved in /home/user1/nanorun/temp_saves
temp_read: get temperature readouts for all channels initialised in tempstruc.ch
(ch #).val (V).
temp_disp(len,dispmat,pic_format): displays strip charts of temp readings in mos
t recent run (displays past len (mins) of data for channels provided in dispmat
array- e.g. [1 2 3; 6 9 10] displays those channels in 2*3 subplots) and saves a
file in figs/director in given pic_format (e.g. jpeg) if arg provided.
rootcom(a,b,[c,d]): Sets the EPICS database record ROOTCOM:VAL (integer) for the
sychronisation of matlab routines with root. a is the running process (1= nanor
un, 2=motmove(2)(new)); b for nanorun is run number and bpm number for motmove;
c is direction for motmove ('x'/'y'/'z'/'dx'/'dy'/'dz'); d is the amount in um/u
rad being moved.