138 lines
5.3 KiB
Markdown
138 lines
5.3 KiB
Markdown
Various motor documents
|
|
-----------------------
|
|
- /home/zamofing_t/Documents/doc-ext/SwissFEL/ESB-MX
|
|
|
|
|
|
Repository structure and dependency (update:23.09.24)
|
|
-----------------------------------------------------
|
|
```
|
|
This repository contains PowerBrick documents and tool to generate trajectories and motion programs for SwissMX
|
|
|
|
for more info about SwissMX read:
|
|
psigithub git@git.psi.ch:grp-sf_cristallina/SwissMX.git --> ~/Documents/prj/SwissFEL/apps/SwissMX/Readme.md
|
|
|
|
For more details about triggerSync read:
|
|
~/Documents/prj/SwissFEL/apps/PBSwissMX/src/triggerSync/Readme.md
|
|
```
|
|
|
|
motion/frame synchronization
|
|
----------------------------
|
|
```
|
|
s.a. ~/Documents/prj/SwissFEL/apps/PBSwissMX/src/triggerSync/Readme.md
|
|
|
|
Coord[1].Q[0] : sync points indicator: (at whick point is the motion program)
|
|
val: desc set in code
|
|
-3: waiting at start position motion code generated in MXMotion.py:setup_sync(mode=?)
|
|
-2: got start trigger triggerSync.c:trigsync_func(mode&1) else motion code generated in MXMotion.py:setup_sync(mode=?)
|
|
0: after MXMotion.py:setup_sync call triggerSync.c:trigsync_func(mode&1)
|
|
idx: index of position during run triggerSync.c:trigsync_func(mode&1)
|
|
-1: motion is finished MXMotion.py:setup_sync(mode=?)
|
|
|
|
Gather.Enable : mode of gathering data
|
|
1: prepared (calculate Gather.MaxLines) MotionBase.py:setup_gather()
|
|
2: finite motion code: during data gathering
|
|
0: disabled motion code: when gather finished
|
|
|
|
Gather.Samples : number af gathered data samples
|
|
|
|
MXMotion.py:setup_sync():
|
|
sync_mode : default=2
|
|
0 : no sync at all
|
|
1 : synchronize start
|
|
2 : synchronize start and adapt motion speed
|
|
|
|
sync_flag : default=0
|
|
bit 0=1 : simulated start trigger
|
|
bit 1=2 : simulated frame trigger
|
|
|
|
triggerSync.c mode:
|
|
bit0:1: sync mode
|
|
bit1:2: simulate start trigger
|
|
bit2:4: simulate frame trigger
|
|
bit3:8: verbose
|
|
|
|
Acquisition start event:
|
|
sim: Coord[1].Q[10]
|
|
EVR: Gate3[1].Chan[0].UserFlag == (gate3_1->Chan[0].Status&0x800) == FrontUnivOut4 -> Pulser0 -> (active Low, 5000us delay 0us) Map: 214
|
|
|
|
Frame event:
|
|
sim: Coord[1].Q[11]
|
|
EVR: Gate3[1].Chan[1].UserFlag == (gate3_1->Chan[1].Status&0x800) == FrontUnivOut5 -> Pulser1 -> (active Low, 5000us delay 750us) Map: 40
|
|
```
|
|
|
|
testing shapepath.py in different modes (tunneling)
|
|
---------------------------------------------------
|
|
```
|
|
zamofing_t@ganymede:~$
|
|
>>> kill previous tunnels 127.0.0.1:100??
|
|
ps -f `lsof -i -n | grep '127.0.0.1:100.. (LISTEN)' | awk '{print $2}'`
|
|
kill `lsof -i -n | grep '127.0.0.1:100.. (LISTEN)' | awk '{print $2}'`
|
|
#lsof -i -n | grep '127.0.0.1:100.. (LISTEN)' | tee /tmp/0.log | awk '{print $2}' | tee /tmp/1.log && grep -n '' /tmp/*.log
|
|
|
|
>>> open cameras in chrome
|
|
ssh -L 10010:cristallina-cam-top:80 saresc-vcons-01 'uname -a'
|
|
google-chrome --app-url 127.0.0.1:10010
|
|
google-chrome --app-url http://cristallina-cam-north.psi.ch/camera/index.html#/video
|
|
|
|
|
|
>>> prepare debug environment
|
|
cmdt.py -p EXPMX -tpb # select SAR-CPPM-EXPMX1
|
|
|
|
>>> prepare shapepath and ssh tunneling
|
|
cd ~/Documents/prj/SwissFEL/apps/PBSwissMX/python/
|
|
subl shapepath.py
|
|
./shapepath.py -h
|
|
|
|
PPMAC=SAR-CPPM-EXPMX1
|
|
ssh -L 10001:localhost:22 root@$PPMAC 'uname -a'
|
|
ssh -L 10002:localhost:2332 root@$PPMAC 'uname -a'
|
|
|
|
gather_server triggerSync are copied with sftp. This does not work with tunneling:
|
|
gather_server: ~/Documents/prj/SwissFEL/PBTools/build/lib/pbtools/misc/pp_comm.py:889
|
|
triggerSync: ~/Documents/prj/SwissFEL/apps/PBSwissMX/python/MXMotion.py:122
|
|
|
|
rsync -vai ~/Documents/prj/SwissFEL/PBTools/pbtools/gather/gather_server root@$PPMAC:/tmp/
|
|
rsync -vai ~/Documents/prj/SwissFEL/apps/PBSwissMX/src/triggerSync/triggerSync root@$PPMAC:/tmp/
|
|
|
|
gather_server needs to be started explicitly in tunneling:
|
|
ssh root@$PPMAC
|
|
LD_LIBRARY_PATH=/opt/ppmac/libppmac/ /tmp/gather_server
|
|
|
|
triggerSync is started if required at each acquisition and exits when done.
|
|
|
|
mode:
|
|
0 unused
|
|
1 pvt motion
|
|
2 unused
|
|
3 pvt motion using inverse fft velocity
|
|
4 pvt motion short code using grid parameters
|
|
5 pvt motion short code using grid parameters. Instead of continous motion it moves and waits as give in the parameter time
|
|
|
|
sync:
|
|
0 real start and frame trigger with sync
|
|
1 direct start
|
|
2 simulated start and frame trigger no sync
|
|
3 simulated start and frame trigger with sync
|
|
4 simulated start real frame trigger no sync
|
|
5 simulated start real frame trigger with sync
|
|
|
|
|
|
# set start EVT to value 0 (=Force Hi)
|
|
caput SAR-EXPMX-EVR0:FrontUnivOut4-Src-Scale-SP 9
|
|
./shapepath.py --host=localhost:10001:10002 -v 0x59 -m4 -s0 # works
|
|
# set start EVT to value 1 (=Force Lo)
|
|
caput SAR-EXPMX-EVR0:FrontUnivOut4-Src-Scale-SP 8
|
|
# reset EVT default value (Pulser 0)
|
|
caput SAR-EXPMX-EVR0:FrontUnivOut4-Src-Pulse-SP 0
|
|
./shapepath.py --host=localhost:10001:10002 -v 0x59 -m4 -s1 # works
|
|
./shapepath.py --host=localhost:10001:10002 -v 0x59 -m4 -s2 # works
|
|
./shapepath.py --host=localhost:10001:10002 -v 0x59 -m4 -s3 # works
|
|
./shapepath.py --host=localhost:10001:10002 -v 0x59 -m4 -s4 # works
|
|
./shapepath.py --host=localhost:10001:10002 -v 0x59 -m4 -s5 # works
|
|
|
|
Debugging were the coordinate program counter is:
|
|
&1 list pc,10
|
|
|
|
```
|
|
|