Compton DAQ Dev

From Hall A Wiki
Revision as of 12:35, 14 November 2022 by Rom (Talk | contribs) (Current Problems)

Jump to: navigation, search

Here are some notes on the project of developing the Compton counting mode DAQ. The original work was done mainly by Bryan Moffit and Ben Raydo in 2020, with input from others.

It is foreseen to be a precurser of a moller polarimeter DAQ as well as a counting-mode DAQ for the MOLLER project, etc.

See earlier work https://hallaweb.jlab.org/wiki/index.php/Compton_Counting_DAQ_Software_HOWTO

Budget and Plan

          Budget and Plan

 Upgrade of Compton and Moller polarimeter DAQ in halls A and C.

 The 4 systems are approximately the same.  The FADC will be modified
 to support both counting mode and integrating mode.  

 Item      Price each      Qty       Line cost

 VXS crate   16.5 k        4         66 k
 VTP         10 k          4         40 k
 FADC (was not in budget)
 cpu (ATOM)   3 k          4         12 k
 SD           2 k          4          8 k
 scaler       4 k          4         16 k
 VETROC       2 k          8         16 k
 TI           2 k          4          8 k
 I/O          1.5 k        4          6 k
 Spares                              43 k
 ==========================================
 TOTAL                              215 k$
 
It's essentially 43k$ per DAQ (times 5 since we need spares)
except we must scrounge the FADCs.  We'll buy the first system
for the hall C moller in FY2023.  This 43k$ is in the FY2023 budget.
After that we may need to refine the design.  Then in FY2024 we'll
purchase/build 3 more DAQs.  Finally, buy spares in FY2025.

Documents

VTP manual https://userweb.jlab.org/~rom/compton/VTP-Manual.pdf

Compton Trigger https://userweb.jlab.org/~rom/compton/Compton_Trigger_2020.pdf

Current Test Setup

updated R. Michaels Oct 12, 2022

Here is a picture https://userweb.jlab.org/~rom/compton/polarimeter_daq.xfig.pdf

The basic configuration of the DAQ

DAQ config: https://userweb.jlab.org/~rom/compton/haVTP_config.png

ROC1 : https://userweb.jlab.org/~rom/compton/roc1_config.png

VTP : https://userweb.jlab.org/~rom/compton/vtpROC_config.png

How to Run the Current Setup

This is a VXS crate located in the TEDF building cubicle 11. The crate is at the top of the rack. The crate was formerly installed in hall A during PREX/CREX.

updated Oct 12, 2022.  R. Michaels

How to login to the two ROCs and start the ROC

ssh -X amoll1 -l sbs-onl
./startroc1

ssh -X havtp1 -l sbs-onl
./startRoc

How to start CODA on atedf3.  Username adaq.

kcoda

startcoda

VTP readout
havtp1:/home/sbs-onl/comptonDaq/vtp/rol/vtp_list.so
ROC1 readout
amoll1:/home/sbs-onl/comptonDaq/rol/vtpCompton_list.so

Oct 12, 2022.
Currently using a 50 Hz front-panel pulser trigger on TI.
Later want to modify this to use a trigger from VTP based on data
from FADC and/or the VETROC.

If I drop the VTP from the readout and remove tiRocEnable(2)
from amoll1:/home/sbs-onl/comptonDaq/rol/vtpCompton_list.c
then the DAQ runs fine and both the FADC and VETROC data
make sense.

Next I added the VTP.  Still a FP trigger.  It downloads
and prestarts. But here is where the problems start. 

Current Problems

Specific problem with vtpLib. This affects both the Compton version and the HCAL version. I think if I fix this I will understand the rash of "Bus error"s and "Segmentation Fault"s when running CODA.

This code causes a Bus Error.  Actually lots of code causes Bus Error 
but let's focus on this one.  BTW, the Chip 0 FW type is 15

int
vtpGetFW_Type(int chip)
{
  int rval=0;
  CHECKINIT;

  if(chip == 1) {
      VLOCK;
      printf("here 1111\n");
      rval = vtp->clk.FW_Type;
// NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// The following line never happens because of a Bus Error.
      printf("here 2222  chip %d   rval %d\n",chip,rval);
      VUNLOCK;
    }else{
      VLOCK;
      rval = vtp->v7.clk.FW_Type;
      VUNLOCK;
    }

  return rval;
}

Running vtpStatus causes a Bus Error when asking Chip 1 for the vtp->clk.FW_Type

[sbs-onl@havtp1 test]$ ./vtpStatus
 size = 131072
vtpSPIOpen: 
	spi mode:      0x0
	bits per word: 8
	max speed:     781250 Hz (781 KHz)
vtpCheckAddresses:
	 ---------- Checking VTP register map ---------- 
vtpLock: ERROR: EOWNERDEAD
vtpLock: WARN: Previous owner of VTP (mutex) died unexpectedly
  Attempting to recover..
  Successful!
vtpInit: Setting up VTP PLL for 250MHz VXS reference
si5341_checkBasePart: ID=5341
si5341_readStatus: status = 00, OK
	SYSINCAL      0, OK
	LOSXAXB       0, OK
	LOSREF        0, OK
	LOL           0, OK
	SMBUS_TIMEOUT 0, OK

vtpV7PllReset: PLL successfully locked
vtpV7PllReset: PLL successfully locked
vtpV7PllLocked: PLL successfully locked
here 1111
Bus error

Archive of Problems

See Current Problems instead. But I don't want to lose this for now.


Nov 9, 2022 (Nov 10 below)

Current status, globally, is that without the VTP the DAQ runs with a front panel trigger at 50 Hz and reads
the FADC and VETROC. Data looks ok. Adding the VTP causes problems.

See READOUT LIST .... https://userweb.jlab.org/~rom/compton/vtp_list_9Nov22.c


Problems today (Nov 9, 2022)

1. There are complaints that I cannot vtpSetCompton_EnableScalerReadout
using firwmare 15.  Probably the least of my problems.

2. Something wrong with VTP Serdes links.  

It takes several seconds to time out.
Waiting on links: PP1 PP2 PP3 PP4 ... (etc)
vtpSerdesCheckLinks: ERROR - all serdes links not up!

3. What library to use ?

vtpEbResetFifo defined in /mnt/SBS/coda/3.10_arm/Linux-armv7l/lib/libvtp.so
but not in /home/sbs-onl/comptonDaq/vtp/libvtp.so
I'm told not to use /mnt/SBS/coda/3.10_arm/Linux-armv7l/lib/

Pulling the libvtp from the SBS HCAL setup, I see that it
is also quite different.  Which one to use ?

Generally, the fact that the readout code I got referred to routines that
are not in my libraries, I assume I must have a mismatch of readout code
and library from the Compton polarimeter.

4. Bus errors for (I think) any code with the string "Ti" in it.  

See "Bob1" in the readout list to show the lines that are commented out.

It looks like any code with the string "Ti" in it (presumably tries to talk 
to the TI) causes a bus error.   

5. To USE_DMA or not ?

Different behavior whether I do
#define USE_DMA
or
//#define USE_DMA

Whether I USE_DMA or not ...

With all the lines commented out that causes bus error, 
the DAQ goes into an active state but usually gets no events
i.e. rocTrigger() is not entered.

The DAQ does go through all the transitions without problems.
if those lines are commented out.
Again, see "Bob1" in the readout list.


Update Nov 10, 2022

I got the test code in 
havtp1:/home/sbs-onl/comptonDaq/vtp/test

to compile using, I think, the recommended vtpLib and header,
and no mixing of versions.  Aren't the codes supposed to just
work ?  Unfortunately, depending on the code, the either do a 
"Bus error", a "segmentation fault" or report an error like
vtpLock: ERROR: EOWNERDEAD
vtpV7SetReset: ERROR: VTP not initialized

Chip #0 reports the firmware type is 15 (what we want, right ?)
Chip 0  FW type 15
But when I try to address Chip #1 it does a Bus error,
specifically on this line
rval = vtp->clk.FW_Type;
and never makes it to the next line.

I like the idea of these test codes.  You can learn a lot,
like how the configuration works (that seems to work).
I know everyone is busy with more important tasks, but it
does seem fair to ask for a hardware VTP to go along with a
working set of test codes.  However, maybe I screwed them 
up somehow.


---------------------------------------------------------------------------------

Analysis Software

Nothing here yet. Work in progress. But there was software for the DAQ used during PREX/CREX.

Old Results