SEPIA user manual

1 Introduction

The sepia program is a graphical user interface for all three SEPIA channels:

  • SEPIA180 is the band 5 receiver tunable between 165.36 and 203.64 GHz (LO).
  • SEPIA345 is the band 7 receiver tunable between 283.00 and 365.00 GHz (LO).
  • SEPIA660 is the band 9 receiver tunable between 608.00 and 714.00 GHz (LO).

All bands are 2SB receivers providing upper and lower sideband in two polarizations, eventually covering 8 GHz of IF (4-12 GHz).

Note: As of August 2018, only band 5 and 9 are installed using an IF of 4-8 GHz, SEPIA band 7 installation will happen at a later time.

1.1 Running the program

Connect via vnc to sepia:1 (sepia is 10.0.2.147 on the APEX network).

You can start the program by either

  • double clicking on the SEPIA icon on the desktop
  • via the menu in the bottom panel: Applications -> Education -> SEPIA control program
  • from a command shell

The official version to be used will reside in directory /usr/local/bin and therefore will be in your PATH. Do not launch the program from the /home/apex/SEPIA folder, as this may contain a new, experimental version of the program.

Note: Typically, only the band selection (see Switching channels) and its initialization or shutdown is done via the GUI. All other commanding will normally be performed via SCPI commands from the APECS control system, including tuning and device monitoring. In fact, also initialization and shutdown is possible via SCPI, but is currently not used by APECS.

This was the TL;DR version of this manual. All of the following information is really only interesting for operating SEPIA manually via the GUI rather than via APECS.

If you prefer, you can read this manual in your browser here.

1.2 The graphical user interface

The central widget of the program is a tab widget, allowing to switch between four different pages by clicking on the respective tab:

  • The Status tab shows the current state of the instrument, including the state of the local oscillator, the PLL and the mixers associated with each of the two polarizations. Pay particular attention to the last reading field in the Environment group at the top, see the description of The Status tab.
  • The M&C monitor tab shows the latest readings taken via the Monitor and Control unit, which is connected to the system via a USB-based CANbus interface. More detail in The M&C Monitor tab.
  • The SCPI & Script log tab shows a log of all SCPI commands that have been received from the APECS server for the currently connected channel. See The SCPI & Script log tab.
  • The Atmosphere tab shows a representative (i.e. for 0.5 mm water vapour) plot of the atmospheric transmission for the currently commanded LO frequency. The locations of the upper and lower sidebands are also marked. See The Atmosphere tab.

Above the central widget is a menu bar providing the following entries:

  • The File menu has a single item Quit allowing the user to exit the application. Note, that in case of an active band, the quit action will imply a band shutdown.
  • The Band menu allows to switch between bands and to perform band initialization and band shutdown. Switching from one active band to another will imply a band shutdown of the former. The Reset menu item performs the same actions like the Initialize, i.e restores all default LNA settings and coil currents, but skips the demagnetization and defluxing of the mixers. Both end with a mixer scan.
  • The Tune menu allows to choose a sky frequency and subsequently to tune the local oscillator and the mixers. The Tuning tables... entry will bring up a view of the database tables providing the tuning parameters for the various bands.
  • The Tools menu has entries for performing an IV scan of a mixer, as well as defluxing a mixer. The GP I/O, IF switch and Backend switch provide simple graphical user interfaces in order to control the Acromag (used to select cartridge and LO system) and Minicircuit devices (used to select IF connection and backend). Again, a band selection will imply proper setup of all the hardware connection, the menu entries here are meant as a diagnostic tool. The Exec script... entry allows the user to run procedures stored as JavaScript source files on disk. The scripting interface is described in some detail in section Exec script. Low level access to hardware functions of the various cartridges is only possible if Expert mode has been turned on, this will require the input of a password.
  • The Mirror menu allows to position the selection mirror to align with the entry windows of the various cartridges. Note, that a positioning of the mirror is part of the band selection procedure, so this menu should normally not be used. The RESET entry allows a hardware reset of the selection mirror, should the device behave erroneously e.g. after a power failure.
  • The Help menu will bring up a simple HTML reader, showing you the contents of this document.

1.2.1 The Status tab

statusTab1.png

Figure 1: The status tab with no band selected.

This is the main tab providing an overview of the current instrument status. The main window will have a title of either SEPIA (no band selected), SEPIA 180 (band 5 selected), SEPIA 345 (band 7 selected) or SEPIA 660 (band 9 selected). The top left region (Environment) shows the latest values retrieved via the sepialogger, an independent system service which is automatically started after system reboot and which polls vacuum pressure and cryo temperatures every minute. Also, the status of the UPS unit is monitored. A cryo temperature above 5K, a vacuum pressure above 1.0e-4 mbar and a UPS running on battery power will all result in a flashing, red LED next to the timestamp.

If no message has arrived from the sepialogger for more than 10 minutes, the LED will instead turn yellow and start flashing and the user will need to investigate the possible cause of this, following this procedure. Note, however, that the control program is additionally monitoring mixer temperatures via the CANbus interface and will initiate a shutdown procedure, should the temperatures exceed the above limit.

The compass in the upper right corner of the status tab will show the current position of the band selection mirror. It will be updated after the band selection has changed. Note, that the LED next to it will only be on while the mirror is actually being commanded to move, so most of the time it will be off.

The Local Oscillator group box shows the currently commanded and actual frequencies, as well as the state of the synthesizer and vital data from the PLL.

For each of the four mixers the commanded biases and coil currents are shown, together with actual readings of bias, current, power (TBI) and coil current. In addition commanded and actual values from all three stages of the associated LNAs are displayed.

Finally, the status tab has two plot widgets where the latest results of mixer scans will be shown.

statusTab2.png

Figure 2: The status tab with band 9 selected and initialized.

1.2.2 The M&C Monitor tab

monitorTab.png

Figure 3: The M&C Monitor tab.

The M&C monitor tab shows a low level overview of control items which are monitored via the CANbus interface at one minute intervals. A Filter by text field allows one to enter regular expressions to limit the display to only those items with matching names, e.g. by filling in MAG would only show items related to coil current settings, as these all have the string MAG as part of their name.

1.2.3 The SCPI & Script log tab

scpiTab.png

Figure 4: The SCPI & Script log tab.

The third tab is divided vertically into two panes. The left half will be showing a log of all SCPI communication that has been going on between the sepia control program and the APECS control system in the left half of the page. The right half will be logging output from any scripts that the user has been executing during the course of the session.

1.2.4 The Atmosphere tab

atmosphereTab.png

Figure 5: The atmosphere tab.

Once the commanded sky frequency has been changed, this tab will show a representative profile of the atmospheric transmission (for a water vapor column of 0.5 mm) and marking the location of the LO frequency and the frequency regions of the lower and upper sideband.

1.3 Switching channels

Once running, you may connect to one of the SEPIA channels by selecting the band via the Band menu. Disconnecting from a band is done via selecting the None entry. Once a band is connected, the Initialize menu entry will be available and should be used to perform band initialization. Similarly the Shutdown menu item will allow to perform a proper shutdown procedure of a connected band. As already mentioned before, selecting the None option will perform a shutdown, should a connected band still be enabled. A label in the lower right corner of the main status tab will cycle between Initializing ..., Enabled, Shutdown ... and Disabled, providing the current status of the selected band.

1.4 Quick guide to tuning

Once a band has been initialized, tuning of the LO becomes possible via the Tune menu. After having selected a frequency the Tune LO menu is enabled and can be used to tune the local oscillator to the previously selected frequency, using the harmonic listed in the tuning table for the frequency in question. Once the LO has been tuned successfully, the mixers (i.e. both polarizations) can be tuned to the prescribed settings from the tuning table by using the Tune Mixer menu. The tuning tables may be viewed at any time via the Tuning tables ... menu item.

1.5 The Tools menu

1.5.1 Scan mixer

Using this menu item will bring up a dialog for selecting a bias range and number of steps in order to perform an IV scan of a user selectable mixer element.

1.5.2 Deflux

This menu item let's the user perform a de-magnetization operation on any of the available mixer elements, this operation will typically be followed by a warm-up sequence to get rid of any trapped magnetic flux.

1.5.3 GP I/O

The menu item brings up a dialog to control which cartridge channel(s) and which LO chain should be powered. Selecting a band via the Band menu will automatically connect the right cartridge and LO, but this dialog will allow to connect and supply power to additional cartridges.

1.5.4 IF switch

In expert mode, a dialog is available to allow setting of the individual switches of the Minicircuit device which controls the routing of the IF signal from the various WCAs.

1.5.5 Backend switch

Similarly to the IF switch, a second dialog is available to allow setting of the individual switches of the Minicircuit device which control the further routing of the IF signal to either the APEX backend or to the spectrum analyzer supplied by GARD.

1.5.6 Expert mode

Lets the user turn on/off the expert mode of the program. Upon successful entry of a password, certain features (like scripting) become available.

1.5.7 Exec script

Low level control of the receivers for the purpose of health checks and/or trouble shooting is made possible via the scripting interface, which will be enabled in expert mode and once a band has been selected. The Qt GUI development framework, which has been used to develop the SEPIA control program provides support for application scripting with ECMAScript (i.e. JavaScript), which the developer may use to make certain features of the program controllable via scripts. The features which were chosen to be exposed to this interface are listed below, demonstrating at the same time the JavaScript syntax necessary to address these features. For further reference to the script syntax you may also consult Qt Script:Language Reference. Please look at Scripting to learn about how to script operations on a connected cartridge.

1.6 Scripting

The scripting language knows about the connected cartridge and allows to create variables representing a

  1. mixer
  2. power amplifier
  3. low noise amplifier
  4. local oscillator
  5. active multiplier chain
  6. phase lock loop

each with their own properties and methods (see below). In addition there is support for delay statements and logging of results.

delay(100);            // wait for a given number of milliseconds, here 0.1 sec
// create a log file with given name
var logfile = new LogFile("foo.log");
logfile.open();       // open the file for logging
// log variables, a timestamp will be added automatically
logfile.write(var1, var2 [,var3]);
logfile.close();      // close the log file

In the following the use of the connected cartridge with its methods and pre-defined constants is explained, as well as how to create local variables to access various parts of a receiver.

Note: At this stage the scripting interface only supports operations on the M&C unit as well as the LO reference synthesizer. Operations on the Acromag GPIO, the Minicircuit units and the selection mirror are currently not supported, and the various dialogs available from the GUI should be used for these.

1.6.1 Cartridge

// Whenever one has connected to a cartridge, the variable "cartridge" is defined:
print(cartridge);

// We can test its name (which will produce "sepia180", "sepia345" or "sepia660"
print(cartridge.objectName);

// This code shows how to check that the right cartridge is connected
if (cartridge.objectName != "sepia180") {
    throw new Error("not connected to SEPIA band 5");
}

// It is strongly recommended to use predefined indices to address
// polarization, SIS element and LNA stage.
// E.g. when cartridge is sepia180 then the script will know about
print(sepia180.POL0);
print(sepia180.POL1);
print(sepia180.SIS1);
print(sepia180.SIS2);
print(sepia180.STAGE1);
print(sepia180.STAGE2);
print(sepia180.STAGE3);
print(sepia180.AMCA);
print(sepia180.AMCB);
print(sepia180.AMCE);

// For a cartridge, the following methods are available:
var withDeflux = true;
cartridge.initBand(withDeflux);   // initialize band with demagnetization and deflux
cartridge.shutdownBand();         // shut down the band
cartridge.resetSisVoltages();     // reset all mixer biases to 0.0
cartridge.resetCoilCurrents();    // reset all mixer coil currents to 0.0
cartridge.resetLNAs();            // reset all LNA voltages/currents to 0.0

// Default settings for each receiver are stored in configuration
// files in directory ~/.config/APEX/, e.g. in file sepia180.conf for SEPIA band 5.
cartridge.setCoilCurrents();      // set all coil currents to default values (from configuration file)
cartridge.setLNADefaults();       // set all LNAs to default values (from configuration file)
cartridge.setPAGateVoltages();    // set all PA gate voltages to default values (from configuration file)

// The following are high level tuning methods, using information from
// the tuning tables to perform their function. Compare with the low
// level routines below, which allow you to tune to arbitrary values.
cartridge.tuneLO(183.0);          // tune LO to 183 GHz, using harmonic from tuning table
cartridge.tuneMixer(sepia180.POL0);  // tune specific mixer polarization
cartridge.tuneSystem(183.0);      // LO tuning followed by tuning of both Polarizations

1.6.2 Mixer

// create some local variables to hold results:
var mV, mA, T;

// create a local object representing a mixer element
var mixer = new cartridge.Mixer(sepia180.POL0, sepia180.SIS1);
print(mixer);                 // will result in name "POL0_SIS1"
mixer.bias = 0.0;             // set mixer bias (in mV)
mV = mixer.bias;              // get mixer bias (in mV)
mA = mixer.current;           // get mixer current (in mA)
mixer.coilCurrent = 0.0;      // set mixer coil current (in mA)
mA = mixer.coilCurrent;       // get mixer coil current (in mA)
mixer.setLNAenable(true);     // enable LNAs
mixer.setSisOpenLoop(false);  // set mixer in closed loop
mixer.deflux();               // perform a deflux operation
mixer.scan(-2.0, 2.0, 100);   // perform a mixer scan (from, to, steps) and save the trace to disk ...
mixer.saveTrace();            // ... file name will be "POL0SIS1.<timestamp>"

// the following functions act on both mixer elements for a given polarization
T = mixer.mixerTemperature;   // get the mixer temperature (in K)
mA = mixer.heaterCurrent;     // get the heater current (in mA)
mixer.toggleHeater();         // toggle the heater, i.e. switch off, then on
mixer.setHeaterState(false);  // turn the heater on (true) or off (false)

1.6.3 Power amplifier

// create some local variables to hold results:
var V, A;

// create a local object representing a power amplifier (PA)
// (it uses just one argument (polarization) in its constructor)
var pa = new cartridge.Amplifier(sepia180.POL0);
print(pa);                    // will result in name "PA_POL0"
pa.gateVoltage = 0.0;         // set the PA gate voltage (in V)
V = pa.gateVoltage;           // get the PA gate voltage (in V)
pa.drainVoltage = 0.0;        // set the PA drain voltage (in V)
V = pa.drainVoltage;          // get the PA drain voltage (in V)
A = pa.drainCurrent;          // get the PA drain current (in A)

1.6.4 Low noise amplifier

// create some local variables to hold results:
var V, A;

// create a local object representing a low noise amplifier (LNA)
// (it uses just three arguments (pol, sis and stage) in its constructor)
var lna = new cartridge.Amplifier(sepia180.POL0, sepia180.SIS1, sepia180.STAGE1);
print(lna);                   // will result in name "LNA_POL0_SIS1_STAGE1"
lna.drainVoltage = 0.0;       // set drain voltage (in V)
V = lna.drainVoltage;         // get drain voltage (in V)
lna.drainCurrent = 0.0;       // set drain current (in A)
A = lna.drainCurrent;         // get drain current (in A)
V = lna.gateVoltage;          // get gate voltage (in V)

1.6.5 Local Oscillator

// create some local variables to hold results:
var ghz, dbm, yig, flag;

// create a local object representing a local oscillator
var LO = new cartridge.Oscillator();
print(LO);                    // will result in name "LO"
LO.yig = 1000;                // set the YIG oscillator (0..4095)
yig = LO.yig;                 // get the last YIG setting
LO.synthFreq = 15.0;          // set the synthesizer frequency (in GHz)
ghz = LO.synthFreq;           // get the synthesizer frequency (in GHz)
LO.synthLevel = 12.0;         // set the synthesizer level (in dBm)
dbm = LO.synthLevel;          // get the synthesizer level (in dBm)
LO.tune(180.0, 6);            // tune the LO to 180 GHz, using 6th harmonic
flag = LO.lockLatch;          // get state of unlock detect latch
LO.clearLatch();              // clear the latch

1.6.6 Active multiplier chain

// create some local variables to hold results:
var V, A;

// create a local object representing an active multiplier chain (AMC)
var amc = new cartridge.Multiplier();
print(amc);                                // will result in name "AMC"
V = amc.drainVoltage(sepia660.AMCA);       // get drain voltage of AMCA (in V)
amc.setDrainVoltage(sepia660.AMCA, 0.0);   // set drain voltage of AMCA (in V)
V = amc.gateVoltage(sepia660.AMCA);        // get drain current of AMCA (in V)
A = amc.drainCurrent(sepia660.AMCA);       // set drain current of AMCA (in V)
V = amc.monitor5V();
V = amc.multiDVoltage();

1.6.7 Phase lock loop

// create some local variables to hold results:
var V, p, T;

// create a local object representing the PLL
var pll = new cartridge.PLL();
print(PLL);                   // will result in name "PLL"
if (pll.locked) ...;          // check if locked
V = pll.corrVoltage;          // PLL correction voltage (in V)
V = pll.lockVoltage;          // PLL lock voltage (in V)
p = pll.refTotalPower;        // PLL reference total power
p = pll.ifTotalPower;         // PLL IF total power
T = pll.assemblyTemperature;  // PLL asssembly temperature (in C)

1.6.8 Low level tuning

// By first looking up tuning parameters from the tuning table, and
// then perform the actual tunings using those values , we can mimic
// what the high level tuning methods from above would do.
var params = Tuning(183.0);   // look up given LO frequency in the tuning table
// The returned array of parameter values consists of the following:
var ghz      = params[ 0];
var harmonic = params[ 1];
var maxPower = params[ 2];
var bias1    = params[ 3];
var bias2    = params[ 4];
var imix1    = params[ 5];
var imix2    = params[ 6];
var paa      = params[ 7];
var bias3    = params[ 8];
var bias4    = params[ 9];
var imix3    = params[10];
var imix4    = params[11];
var pab      = params[12];

// low level routine for tuning the LO
LO.tune(ghz, harmonic);

// low level routine for tuning the mixers
mixer = new cartridge.Mixer(sepia180.POL0, sepia180.SIS1);
var Igoal = imix1;
mixer.tune(bias1, bias2, Igoal, maxPower);  // tune the mixer

// same for other polarization
mixer = new cartridge.Mixer(sepia180.POL1, sepia180.SIS1);
var Igoal = imix3;
mixer.tune(bias3, bias4, Igoal, maxPower);  // tune the mixer

1.7 The SEPIA logger

The SEPIA logger is implemented as a systmed service, which is enabled in order to start automatically when the SEPIA control computer is rebooted. It will start to monitor periodically (every 10 minutes) the state of the cryostat (temperature and pressure) and the UPS. These data are both stored in a database (table sepiaenv) as well as broadcasted via a UDP socket. This ensures that the health of SEPIA is monitored whenever the control computer is running, independently if the sepia application is being running or not. When sepia is running, it will pick up these messages and display them in The Status tab. Here is how you can check that the service is enabled and running:

$ sudo systemctl status sepialogger

If everything is well, it will inform you that the service is active (running), together with the last ten readings. If the system is down, you can try to restart it with

$ sudo systemctl restart sepialogger

after which you should check the status again. If the restart succeeded, the LED associated with the last reading field should turn green again after one minute.

1.8 Re-compiling the program

The complete source code of the sepia control program is kept in a git repository. In case new changes to the program have been made available you can update to the latest version by performing the following steps, provided that you are logged in as user apex on the control computer (sepia.apex-telescope.org):

$ cd ~/SEPIA         # change into directory SEPIA
$ git pull           # get the latest changes from the git repository
$ make               # re-compile the program
$ sudo make install  # install program in /usr/local/bin