MPET DAQ

From DaqWiki
Jump to navigation Jump to search

Links

Hardware

MPET has:

  • A PPG for programming pulses
  • A 2-channel Tektronix AFG for generating RF (was previously two Agilent AFGs)
  • An 8-channel GSC 16ao16 to control the trap voltages (was previously an Alphi Softdac). There is a breakout box to convert to BNC connections. The breakout box has many connectors, but only 8 channels are actually controllable!
  • An older VT2 TDC for recording timestamps
  • A position analyzer to determine X/Y positions of ions
  • A Lecroy LRS1190 memory buffer that records the X/Y position
  • A newer CAEN V1290 25ps TDC for recording timestamps

Note that the VT2/V1290 TDCs are enabled in different ways:

  • The VT2 has a "gate" that is set to 1 for the entire period that timestamps should be recorded
  • The V1290 has a "trigger" that is issued at the end of the desired period; the times of any hits within the "trigger window" (normally 50us) before the trigger are recorded

The wiring diagram for the MPET DAQ is:

MPET wiring.png

Software

The DAQ system is based on the MIDAS DAQ package. Software written for MPET is linked with the MIDAS libraries and uses common framework for MPET/CPET/EBIT.

The MPET software can be found at /home/mpet/packages/mpet on titan06 (note that historical versions of the software were located in /home/mpet/online).

Run control is done using the MIDAS webserver mhttpd with Custom Pages written for mpet users so that they can easily enter the parameters required to program the PPG and to run the DAQ.

The default login shell for the mpet user is now bash. If you want to use the legacy DAQ (which only supports the VT2/VT4 and Softdac, not the CAEN V1290 and GSC 16ao16), then change to the tcsh shell by typing 'tcsh'.

Program listing

In the order that programs appear on the Programs page:

  • mserver - midas RPC server that allows the programs on lxebit to talk to the main experiment on titan06
  • fempet - main MPET frontend that talks to the PPG, scans EPICS values etc. Runs on lxmpet.
  • mhttpd - midas web server
  • PPGCompilerFrontend - converts a user-supplied PPG program into bytecode that can be loaded onto the PPG
  • saveload - helps save and load scan settings
  • AfgFrontend - frontend that configures the Agilent Quad/Dipole AFGs at the start of each run (written in python)
  • AfgTekFrontend - frontend that configures the Tektronix AFG at the start of each run (written in python)
  • Logger - midas data logger
  • mpetana - python analyzer that creates plots based on live data (plots are viewed via the Web plots page)

Starting and stopping DAQ programs

If the MPET webpage is unavailable, log in to mpet@titan06.triumf.ca, and type

 mhttpd -D

Then you can use the Midas programs page to start/stop the remaining DAQ programs.

At the very least, the following programs should be running:

  • mserver (start this before fempet!)
  • fempet
  • mhttpd
  • PPGCompilerFrontend
  • saveload
  • AfgFrontend OR AfgTekFrontend (depending on which device you're using)
  • Logger
  • mpetana

The following programs may be started if they are useful for your analysis:

  • Sequencer
  • midas_to_df_scan_live
  • mpetana_df

The following programs are not required during normal operation:

  • feCrossTest

Pulling the latest version of the MPET DAQ software

 cd ~/packages/mpet
 git pull
 git submodule update

Building the MPET DAQ software

cd ~/packages/mpet/build
cmake ..
make install

This will build the appropriate 32-bit frontend program that can be used by lxmpet.

16ao16 driver and software

The 16ao16 is used to control the trap voltages. It is mounted on lxmpet as a PMC board, and requires a kernel module and software. GSC seem very good at supporting this and continue releasing updates for newer linux versions.

There is one tweak we need to make for the build to work vs what is documented in the manual.

1. Download the latest 16ao16.linux.******.tar.gz bundle from http://www.generalstandards.com/downloads/ and copy it to ~/packages. Extract it using tar. It should create the directory ~/packages/16ao16.

2. Run `uname -r` to find your current kernel version.

3. Check if a file exists called /usr/src/linux-headers-<kernel_version>-common/scripts/file-size.sh. 
   If not, create it and fill it with this content:
   #!/bin/sh  
   #SPDX-License-Identifier: GPL-2.0  
   set -- $(ls -dn "$1")  
   printf '%s\n' "$5"
  
4. Build the software:
   cd ~/packages/16ao16
   ./make_all

5. Do the final installation of library and driver as root:
   su - root
   cd ~/packages/16ao16
   ./make_all

6. Verify that the driver has been loaded, by seeing if /proc/16ao16 exists.

7. Configure things so the driver loads each time lxmpet boots, by adding the following line to /etc/rc.local:
   /home/mpet/packages/16ao16/driver/start

The make_all script builds both the driver and the software libraries. The mpet software builds and links against the GSC library. By default it looks for the headers/libraries in /home/mpet/packages/16ao16, but if you've built it elsewhere you can specify an alternate directory using the -DGSC_16AO16_DIR=/path/to/somewhere argument when running cmake.

Agilent vs Tektronix AFGs

In summer 2022, MPET bought a Tektronix 35052 2-channel AFG to replace two Agilent AFGs (both types of AFG are used to generate RF signals).

The Agilent AFGs could be programmed with a list of frequencies, with the next frequency being loaded when a PPG signal was issued. This allowed the frequencies to be scanned within a single PPG loop. The Tektronix AFG does have a sequencing option (if you pay extra money), but has severe limitations that do not allow it to be used the way we need (especially if wanting to run both channels simultaneously).

Therefore, when using the Tektronix AFG, the frequency must be scanned outside of the PPG loop (same as if you were scanning an EPICS PV or trap voltage).

AfgFrontend vs AfgTekFrontend

There are two separate programs that may be run:

  • AfgFrontend is the program that controls the Agilent AFGs
  • AfgTekFrontend is the program that controls the Tektronix AFG

The code has some sanity-checks to make it easier for you to determine which AFG was being used when looking at the midas files:

  • The run will not start if both the Agilent and Tektronix frontends are running
  • The run will not start if an Agilent AFG is set as "enabled" in the ODB, but the Tektronix frontend is running (or vice-versa)

Changing between the AFGs

To change from using the Agilent to Agilent AFG:

  • Stop the AfgFrontend program on the Programs page
  • Start the AfgTekFrontend program on the Programs page
  • Go to the "RF (Tek)" page and configure the frequencies

To change from using the Tektronix to Agilent AFG:

  • Stop the AfgTekFrontend program on the Programs page
  • Start the AfgFrontend program on the Programs page
  • Go to the "RF (Agilent)" page and configure the frequencies

For the Agilent AFG, the number of frequencies is determined by the number of loops of the "begin_ramp" loop of the PPG program.

For the Tektronix AFG, the number of frequencies is determined by the number of X/Y/Z scan steps. You may still have > 1 loops in the "begin_ramp" loop of the PPG program, but they will all be taken with the same frequency (take care of this when doing analysis!). Having > 1 loops is the lowest-latency (most efficient) way of increasing your statistics as the DAQ won't do anything until all the loops have completed; only then will there be some deadtime as the DAQ moves to the next scan point.

X/Y/Z scan ordering

For a 2D scan, all the Y points are covered at a given X point before moving to the next X point.

For a 3D scan, all the Z points are covered at a given X+Y point before moving to the next Y point. After all the Y points have been covered we move to the next X point.

So for a 3D scan, the Z variable is changed a lot more often than the X variable. For maximum efficiency, it is recommended that you use the Z variable for the parameter that is quickest to react to the change (e.g. EPICS voltages can be slow to react, so changing EPICS in the X variable and the frequency in the Z variable is likely to be most efficient).