I made a python script for relocking PMC.
It currently lives in /opt/rtcds/caltech/c1/scripts/PSL/PMC/PMClocker.py.
I think the hardest part for this kind of locker is the scan speed. I could make the scan relatively fast by using pyNDS.
The basic algorithm is as follows.
1. Turns off the servo by C1:PSL-PMC_SW1.
2. Scans C1:PSL-PMC_RAMP using ezcastep.bin. Default settings for ezcastep is
ezcastep.bin C1:PSL-PMC_RAMP -s 0.1 0.01 10000
So, it steps by 0.01 for 10000 times with interval of 0.1 sec.
3. Get C1:PSL-PMC_PMCTRANSPD and C1:PSL-PMC_RAMP online 1 sec data using pyNDS.
4. If it finds a tall peak in C1:PSL-PMC_PMCTRANSPD, kills ezcastep.bin process, sets C1:PSL-PMC_RAMP to the value where the tall peak was found, and then turns on the servo.
5. If tall peak wasn't found, go back to 3 and get data again.
6. If C1:PSL-PMC_RAMP reaches near -7 V or 0 V, it kills previous ezcastep.bin process and turns the sign of the scan.
I tested this script several times. It sometimes passes over TEM00 (because of the dead time in online pyNDS?), but it locks PMC with in ~10 sec.
Currently, you have to run this to relock PMC because I don't know how to make this an autolocker.
I think use of pyNDS can be applied for finding IR resonance using ALS, too.
I haven't checked it yet becuase c1ioo is down, but ALS version lives in /users/yuta/scripts/findIRresonance.py. ALS may be easier in that we can use fast channels and nice filter modules.
Other scripts:
I updated /opt/rtcds/caltech/c1/scripts/general/toggler.py. It now has "lazymode". When lazymode, it toggles automatically with interval of 1 sec until you Ctrl-c.
Also, I moved damprestore.py from my users directory to /opt/rtcds/caltech/c1/scripts/SUS/damprestore.py. It restores suspension damping of a specified mirror when watchdog shuts down the damping. |