40m QIL Cryo_Lab CTN SUS_Lab TCS_Lab OMC_Lab CRIME_Lab FEA ENG_Labs OptContFac Mariner WBEEShop
  PSL  Not logged in ELOG logo
Message ID: 2124     Entry time: Wed Mar 7 21:07:10 2018
Author: Craig, awade, Johannes, Gautam, oh my 
Type: DailyProgress 
Category: DAQ 
Subject: Frequency Counter added as Precav Beatnote Monitor  

Last night we had an issue where my PLL autolocker lost the lock at some point during the night.  The PLL autolocker (located on acromag1 at ~/Git/labutils/netgpibdata/Marconi2023A_BeatnoteTrack.py) relies on the linearity of the mixing of the Marconi signal and the beatnote, and most of the time this is okay.  However, sometimes FSS ringing and fast temperature slewing can cause the beatnote to move in frequency too fast for the Marconi to keep up, causing the autolocker to fail.
What's worse, sometimes the autolocker fails to realize it has failed, since the mixer error signal goes to zero as the frequencies of the local oscillator and beatnote diverge.  The autolocker sits there thinking it's doing a great job locking the Marconi to the beatnote when it fact it's doing NOTHING.
What's EVEN worse, we use the PLL autolocker calculated beatnote frequency soft channel as the error signal for our North Cavity Shield Temperature PID.  If the PLL autolocker fails, the error signal it sends to the NCST PID is completely wrong, causing the North cavity shield heater to actuate as hard as it can to control the beatnote frequency, but it can't because the PLL autolocker is constantly lying to it.

In order to counter this issue, we scrounged up a frequency counter for use as the error signal for the North Cavity Shield Temp PID.
Gautam gave us a spare 40m UFC-6000 frequency counter.
Johannes kindly lent us his script ufc.py and associated service ufc.service, as well as some instructions for communicating with the frequency counter which I will go over.  What Johannes sent me is attached as ufc-6000.tar.gz.
awade modified the python script ufc.py to be a bit more pythonic, which is attached as ufc2.py, and increased the precav beatnote signal strength so the frequency counter could detect the beatnote.
I made the dang thing work with ws1.


Johannes sent some instructions to allow USB devices to communicate with python directly.  Apparently USBs are often restricted from talking with the rest of the computer directly unless you define some udev rules to allow some specifically identified USB devices through.
To do this, I went to the directory /etc/udev/rules.d/, and created a file 99-usb-serial.rules.  Inside this file I typed:
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="20ce", ATTR{idProduct}=="0010", MODE="0666", GROUP="plugdev"
Then, when I ran python ufc.py, I was able to retrieve the UFC-6000's reported frequency on ws1.

Some commands that were useful for figuring all of this out:
lsusb, which tells you about your usb devices connected to your computer
man udev, which tells you everything you need to know about udev on your particular Linux machine, and how to configure the .rules files.
lsusb -v -d ????x???? (where ????x???? represents the idVendor and idProduct attributes of your USB device), which tells you even more about a single USB device.
groups, which tells you what groups your username is a member of.  Not sure what a group is though.  controls was a member of plugdev, I guess this is enough.


Next steps, create a soft channel for the precav beatnote, and switch out the North Cavity Shield Temp PID error signal in the .ini file.
Also, I can modify the PLL Autolocker Marconi2023A_BeatnoteTrack.py to read in the beatnote soft channel value first to get the PLL into the linear region, then start it's locking process.  It can also use the new soft channel as a constant check to see if the Marconi has gone completely haywire.  Finally, the PLL Autolocker must have ANDChannels added to it to make sure that both North and South RAMP_EN channels are true.


EDIT: Added soft channel C3:PSL-PRECAV_BEATNOTE_FREQ which is monitoring the frequency counter in real time.

Attachment 2: ufc-6000.tar.gz  944 Bytes
Attachment 3: ufc2.tar  5 kB
ELOG V3.1.3-