Difference between revisions of "FELIX instructions for Petals"

From Atlas Wiki
Jump to navigation Jump to search
(format)
 
(75 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[DAQ systems|''Back to DAQ systems'']]
+
Author: Andrea García Alonso aalonso@nikhef.nl
[[File:20240516 114002.jpg|left|thumb|421x421px|R5 petal setup at Nikhef May 2024]]
 
  
 +
<math>\blacktriangleleft</math> [[DAQ systems|''<big>Back to DAQ systems</big>'']]
 +
----[[File:20240516 114002.jpg|thumb|623x623px|PPB-R5-petal setup at Nikhef May 2024|alt=]]
  
 +
Note on repositories: The YARR repo needs to be (at least) on commit 2169a65b63c94e5eda9789908b62eab325dffb3d: https://gitlab.cern.ch/desy-atlas/itk/YARR/-/blob/2169a65b63c94e5eda9789908b62eab325dffb3d
  
 +
Main instructions in this page were taken from DESY repo https://gitlab.cern.ch/desy-atlas/itk/petal-testing
  
 +
petal-testing/scantools is a copy of the repo https://gitlab.cern.ch/itk-strips-at-sr1/scan-tools-for-yarr, so be sure it's on the latest commit, branch EC-DESY
  
 +
NOTE: For Nikhef, the FELIX server should be renamed in the json files in /scantools/configs_PPB_Vancouver_R5:
  
 +
<code>    "Server_config": {</code> 
  
How to configure a petal (main instructions taken from DESY repo https://gitlab.cern.ch/desy-atlas/itk/petal-testing):
+
<code>"felix_host": "srvgst002"
 +
},</code>
  
 +
The FELIX card sits in the <code>srvgst002</code> server, and inside of it <code>/home/aalonso/petal-testing</code> is the working path. This info should also be displayed correctly in run_YARR.py and all the json files in /scantools/configs_PPB_Vancouver_R5.
 +
 +
= '''<big>How to configure a petal</big>''' =
 +
<u>Turn ON</u> the '''LV''' PSU: '''11V'''.
 +
 +
=== ''On TERMINAL 1'' ===
 
''cd'' into the ''petal-testing'' directory and then execute the following commands:
 
''cd'' into the ''petal-testing'' directory and then execute the following commands:
  
Line 31: Line 44:
 
Click on ''Read Cfg'', then you can ''Quit.''
 
Click on ''Read Cfg'', then you can ''Quit.''
  
* Push the lpGBT config to the petal chipset : <code>'''fice -G0 -I71 configs/lpgbt/lpgbt_PT_M_LH_V1_Pri_hex.cnf'''</code>
+
* Push the lpGBT config to the petal chipset: <code>'''fice -G0 -I71 configs/lpgbt/lpgbt_PT_M_LH_V1_Pri_hex.cnf'''</code>
  
 
If this command takes a long time, it's because of the LV PSU, probably due to have been providing power for a long time.
 
If this command takes a long time, it's because of the LV PSU, probably due to have been providing power for a long time.
Line 40: Line 53:
  
  
 +
===''On TERMINAL 2''===
 +
On a second remote terminal session ''cd'' into the ''petal-testing'' directory and then execute the following commands:
 +
* Configure the YARR dependencies: <code>'''source dependencies/setupYARR.sh'''</code>
 +
 +
* Activate the AMAC:  <code>'''write_amac_ppb 9 1 0 0'''</code>
 +
 +
This will increase the current in the LV PSU, typically from 165 mA to 405 mA, at least these are the numbers at Nikhef with the R5 Vancouver petal. It's important to check this change in the consumption, since it confirms there's communication with the chips. In the terminal running Felixcore, a new line will appear saying "Opening DEVICE 0 for the To-FLX thread". <u>NOTE</u>: If the consumption doesn't change and in the Felixcore terminal we don't get the new line, it means that the AMAC didn't get activated. Check the IPs, since that would be an IP address problem.
 +
 +
<u>Turn ON</u> the CAEN '''HV''' PSU: 200μA compliance for R5 module (full petal is different): '''500V'''. It will ramp up at 10V/s. The consumption in the HV PSU will rise till 115 μA when the 500V are reached.
 +
 +
* Confirm there's communication with the HCCs via a register dump scan: <code>'''python3 scantools/run_YARR.py -c scanSetup_regDump.json --infile-dir scantools/configs_PPB_Vancouver_R5'''</code>    execute it '''twice'''!! (once per HCC)
 +
 +
After the 2nd time, there shouldn't be lines like "There were no results for chip Stave_PPB_hcc1".
 +
 +
Also: after the first register dump scan, the current in the LV PSU will increase from 405 mA to 514 mA, and Felixcore will show the lines "Subscription from endpoint 127.0.0.1:37645 for elink 0" and "Subscription from endpoint 127.0.0.1:39225 for elink 2". After the second regsiter dump scan the current will increase from 514 mA to 605 mA, and Felixcore will show the lines "Subscription from endpoint 127.0.0.1:42045 for elink 0" and "Subscription from endpoint 127.0.0.1:46479 for elink 2".
 +
 +
 +
 +
= '''<big>FELIX DAQ Petal Scans</big>''' =
 +
 +
== '''Trim Scan''' ==
 +
The ''trimScanWithRange'' optimizes the trim and threshold values of the chip at the same time, thus this scan takes a while (around 45'): <code>'''python3 scantools/run_YARR.py -c scanSetup_trim.json --infile-dir scantools/configs_PPB_Vancouver_R5'''</code>
 +
 +
This scan uses the following json files:
 +
 +
- to configure which scans to use: ''/petal-testing/scantools/configs_PPB_Vancouver_R5/scanSetup_trim.json''
 +
 +
- to define the actual scan (scan config): ''/YARR/configs/scans/star/std_trimScanWithRange.json''
 +
 +
So if you want to use a different scan from YARR, you need to change it in ''/scantools''.
 +
 +
In /''data'', you should now find a subdirectory called ''XXXXXX_std_trimScanWithRange'', with ''TrimDacVsThreshold'' plots looking like the following ones (for HCCs 0 and 1):
 +
 +
For an unbiased R5 Petal:
 +
 +
<gallery caption="'''UnBiased''' PPB-R5 Triumph petal plots (only LV on)">
 +
File:HCC0 chip0 trim.png|HCC0 Chip 0 trim scan. Run 102
 +
File:HCC1 trim chip0.png|HCC1 Chip 0 trim scan. Run 102
 +
File:HCC0 trim scan.pdf|HCC0 rest of chips trim scans. Run 102
 +
File:HCC1 trim scan.pdf|HCC1 rest of chips trim scans. Run 102
 +
</gallery>Check that for both HCCs, the ''StarTrimDACResult'' JSON files exist.
 +
 +
 +
== '''Strobe Delay Scan''' ==
 +
Before performing the scan, enter the results of the previous trim scan in the configuration of the strobe delay (SD) scan:
 +
 +
1) '''<u>Important:</u>''' Edit the ''scantools/configs_PPB_Vancouver_R5/scanSetup_SD.json'' and '''enter the previous run number''' in the field ''"input_trim_from_run": "/XXXXXX"''.
 +
 +
2) Run the scan (this one takes 5') using the command: <code>python3 scantools/run_YARR.py -c scanSetup_SD.json --infile-dir scantools/configs_PPB_Vancouver_R5</code>
 +
 +
'''<u>NOTE:</u>''' In my case, the run_YARR.py file had some issues for the strobe delay scan: lines 121 and 156 contained "for iABC in range(10):" trying to access 10 ABCs, when there's only 9. I modified them to "for iABC in range(9):"
 +
 +
In the output directory, the ''OccVsStrobeDelayVsChan'' plots should look somewhat like this:
 +
[[File:Strobe_delay_plots_PPB_R5_petal_unbiased.png|alt=Strobe delay signal vs channel number for unbiased PPB-R5-petal HCC0 Chip 0 Row 1, both at DESY and at Nikhef|none|thumb|1110x1110px|Strobe delay signal vs channel number for unbiased PPB-R5-petal HCC0 Chip 0 Row 1, both at DESY and at Nikhef]]
  
 +
These two plots (scans with no HV) should have been the same. The occupancy scale differs, which could partially explain the difference in colors for strobe delays above 30, but for the channel distribution differences it might be normal that each scan adjusts differently, let's see how the rest of scans go. Maybe the external light conditions could explain the difference. The Nikhef petal was tested without any cover from the light.
  
  
 +
If everything worked correctly, you should see the ''XXX_StarStrobeDelayResult.json'' files in the /data folder.
  
In a second remote terminal session ''cd'' into the ''petal-testing'' directory and then execute the following commands:
 
  
* Configure the YARR dependencies: <code>'''source dependencies/setupYARR.sh'''</code>
 
  
* Activate the AMAC:  <code>'''write_amac_ppb 9 1 0 0'''</code>
 
  
This will increase the current in the LV PSU, typically from 165 mA to 405 mA, at least these are the numbers at Nikhef with the R5 Vancouver petal. It's important to check this changes in the consumption, since it confirms there's communication with the chips.
+
== '''3 Point Gain Scan''' ==
 +
1) '''Important:''' Edit the ''scantools/configs_PPB_Vancouver_R5/scanSetup_3PG.json'' and '''enter the corresponding run numbers''' in the fields ''"input_'''trim'''_from_run": "/XXXXXX" and "input_'''strobeDelay'''_from_run": "/XXXXXX"''.
 +
 
 +
2) Run the scan (this one takes 5') using the command: <code>'''python3 scantools/run_YARR.py -c scanSetup_3PG.json --infile-dir scantools/configs_PPB_Vancouver_R5'''</code>
 +
 
 +
'''<u>NOTE:</u>''' Also in this scan, I got the same issue with the IDs of the ABC chips (as happened with the strobe delay scan).
 +
 
 +
[[File:3PG_issue_with_the_ABC_chips_IDs.png|alt=|frameless|640x640px]]
 +
 
 +
 
 +
The ''responseCurve'' plots should contain three points and look like this:
 +
 
 +
PLOTS
 +
 
 +
 
 +
== '''Response Curve Scan''' ==
 +
1) '''Important:''' Edit the ''scantools/configs_PPB_Vancouver_R5/scanSetup_rcurve.json'' and '''enter the corresponding run numbers''' in the fields ''"input_'''trim'''_from_run": "/XXXXXX" and "input_'''strobeDelay'''_from_run": "/XXXXXX".''
 +
 
 +
2) Run the scan (this one takes 5') using the command: <code>'''python3 scantools/run_YARR.py -c scanSetup_rcurve.json --infile-dir scantools/configs_PPB_Vancouver_R5'''</code>
 +
 
 +
'''<u>NOTE</u>''': Scan failed for me because ''petal-testing/dependencies/YARR/configs/scans/star/std_responsecurve.json'' didn't exist. Comparing with the <code>devel_SR1 branch</code>, I saw this file contains for them the same as the file std_npointscan.json which does exist in my directory. So I copied this file and renamed it as ''std_responsecurve.json'' (so now both exist in ''petal-testing/dependencies/YARR/configs/scans/star/'' with equals contents which is not right). Then J-H sent me the correct values for the <code>loops</code> section, which is the only difference between the two json files (3PG and rcurve).
 +
 
 +
The ''responseCurve'' plots should contain 16 points and look like this:
 +
 
 +
 
 +
== '''Noise Occupancy Scan''' ==
 +
1) '''Important:''' Edit the ''scantools/configs_PPB_Vancouver_R5/scanSetup_NO.json'' and '''enter the corresponding run numbers''' in the fields ''"input_'''trim'''_from_run": "/XXXXXX" and "input_'''strobeDelay'''_from_run": "/XXXXXX".''
 +
 
 +
2) Run the scan (this one takes 5') using the command:<code>'''python3 scantools/run_YARR.py -c scanSetup_NO.json --infile-dir scantools/configs_PPB_Vancouver_R5'''</code>
 +
 
 +
NOTE: for this one I got an error message saying "<code>Careful! l0_latency in this scan is not the same as in the scan used to obtain the optimized strobe delay values. Check your config.</code>". In the json file of the NO scan, the latency was set to 2, while in the SD scan it was 20, after modifying the NO json file to l0_latency 20 the run went through.
 +
 
 +
The ''OccupancyMap'' plots should look like this:
 +
 
 +
 
 +
 
  
* Confirm there's communication with the HCCs via a register dump scan: <code>'''python3 scantools/run_YARR.py -c scanSetup_regDump.json --infile-dir scantools/configs_PPB_Vancouver_R5'''</code>   execute it '''twice'''!!
+
= '''<big>How to turn off the system</big>''' =
 +
1) <u>Turn OFF</u> the (500V) CAEN '''HV''' PSU. It will do a power ramp of 10V/s till full shut down.
  
After the 2nd time, there shouldn't be lines like "There were no results for chip Stave_PPB_hcc1".
+
2) With felixcore running, go to the felix server and do <code>'''source dependencies/setupYARR.sh'''</code> and then turn all off: <code>'''write_amac_ppb 9 0 0 0'''</code>
  
Also: after the first regsiter dump scan, the current in the LV PSU will increase from 405 mA to 514 mA, and after the second one it will increase from 514 mA to 605 mA.
+
3) <u>Turn OFF</u> the (11V) '''LV''' PSU.

Latest revision as of 12:20, 3 October 2024

Author: Andrea García Alonso aalonso@nikhef.nl

Back to DAQ systems


PPB-R5-petal setup at Nikhef May 2024

Note on repositories: The YARR repo needs to be (at least) on commit 2169a65b63c94e5eda9789908b62eab325dffb3d: https://gitlab.cern.ch/desy-atlas/itk/YARR/-/blob/2169a65b63c94e5eda9789908b62eab325dffb3d

Main instructions in this page were taken from DESY repo https://gitlab.cern.ch/desy-atlas/itk/petal-testing

petal-testing/scantools is a copy of the repo https://gitlab.cern.ch/itk-strips-at-sr1/scan-tools-for-yarr, so be sure it's on the latest commit, branch EC-DESY

NOTE: For Nikhef, the FELIX server should be renamed in the json files in /scantools/configs_PPB_Vancouver_R5:

"Server_config": {

"felix_host": "srvgst002" },

The FELIX card sits in the srvgst002 server, and inside of it /home/aalonso/petal-testing is the working path. This info should also be displayed correctly in run_YARR.py and all the json files in /scantools/configs_PPB_Vancouver_R5.

How to configure a petal

Turn ON the LV PSU: 11V.

On TERMINAL 1

cd into the petal-testing directory and then execute the following commands:

  • Setup the FELIX dependencies: source dependencies/setupFELIX.sh
  • Initialize the FLX card: flx-init

It's normal if it says that all the channels are not aligned even if at least one actually is, we don't know why, but SR1 with staves sees the same.

  • Invert the polarity (for lpGBTv1): flx-config set GBT_RXPOLARITY=0xFFFFFFFF
  • Verify the status of the PODs: flx-info POD
  • Check that all connected links are aligned: flx-info GBT

If testing the PPB R5 Vancouver Petal:

  • Configure the elinks on your FELIX card: source configs/elinks/elinks_petal_R5_640Mbs.sh
  • Check your config: elinkconfig

Click on Read Cfg, then you can Quit.

  • Push the lpGBT config to the petal chipset: fice -G0 -I71 configs/lpgbt/lpgbt_PT_M_LH_V1_Pri_hex.cnf

If this command takes a long time, it's because of the LV PSU, probably due to have been providing power for a long time.

  • Verify this has worked (you should see the line "Compared 336 values, found 0 differences"): fice -G0 -I71 -C configs/lpgbt/lpgbt_PT_M_LH_V1_Pri_hex.cnf
  • Start FELIXCore and don't close this terminal: startFelixcore


On TERMINAL 2

On a second remote terminal session cd into the petal-testing directory and then execute the following commands:

  • Configure the YARR dependencies: source dependencies/setupYARR.sh
  • Activate the AMAC: write_amac_ppb 9 1 0 0

This will increase the current in the LV PSU, typically from 165 mA to 405 mA, at least these are the numbers at Nikhef with the R5 Vancouver petal. It's important to check this change in the consumption, since it confirms there's communication with the chips. In the terminal running Felixcore, a new line will appear saying "Opening DEVICE 0 for the To-FLX thread". NOTE: If the consumption doesn't change and in the Felixcore terminal we don't get the new line, it means that the AMAC didn't get activated. Check the IPs, since that would be an IP address problem.

Turn ON the CAEN HV PSU: 200μA compliance for R5 module (full petal is different): 500V. It will ramp up at 10V/s. The consumption in the HV PSU will rise till 115 μA when the 500V are reached.

  • Confirm there's communication with the HCCs via a register dump scan: python3 scantools/run_YARR.py -c scanSetup_regDump.json --infile-dir scantools/configs_PPB_Vancouver_R5 execute it twice!! (once per HCC)

After the 2nd time, there shouldn't be lines like "There were no results for chip Stave_PPB_hcc1".

Also: after the first register dump scan, the current in the LV PSU will increase from 405 mA to 514 mA, and Felixcore will show the lines "Subscription from endpoint 127.0.0.1:37645 for elink 0" and "Subscription from endpoint 127.0.0.1:39225 for elink 2". After the second regsiter dump scan the current will increase from 514 mA to 605 mA, and Felixcore will show the lines "Subscription from endpoint 127.0.0.1:42045 for elink 0" and "Subscription from endpoint 127.0.0.1:46479 for elink 2".


FELIX DAQ Petal Scans

Trim Scan

The trimScanWithRange optimizes the trim and threshold values of the chip at the same time, thus this scan takes a while (around 45'): python3 scantools/run_YARR.py -c scanSetup_trim.json --infile-dir scantools/configs_PPB_Vancouver_R5

This scan uses the following json files:

- to configure which scans to use: /petal-testing/scantools/configs_PPB_Vancouver_R5/scanSetup_trim.json

- to define the actual scan (scan config): /YARR/configs/scans/star/std_trimScanWithRange.json

So if you want to use a different scan from YARR, you need to change it in /scantools.

In /data, you should now find a subdirectory called XXXXXX_std_trimScanWithRange, with TrimDacVsThreshold plots looking like the following ones (for HCCs 0 and 1):

For an unbiased R5 Petal:

Check that for both HCCs, the StarTrimDACResult JSON files exist.


Strobe Delay Scan

Before performing the scan, enter the results of the previous trim scan in the configuration of the strobe delay (SD) scan:

1) Important: Edit the scantools/configs_PPB_Vancouver_R5/scanSetup_SD.json and enter the previous run number in the field "input_trim_from_run": "/XXXXXX".

2) Run the scan (this one takes 5') using the command: python3 scantools/run_YARR.py -c scanSetup_SD.json --infile-dir scantools/configs_PPB_Vancouver_R5

NOTE: In my case, the run_YARR.py file had some issues for the strobe delay scan: lines 121 and 156 contained "for iABC in range(10):" trying to access 10 ABCs, when there's only 9. I modified them to "for iABC in range(9):"

In the output directory, the OccVsStrobeDelayVsChan plots should look somewhat like this:

Strobe delay signal vs channel number for unbiased PPB-R5-petal HCC0 Chip 0 Row 1, both at DESY and at Nikhef
Strobe delay signal vs channel number for unbiased PPB-R5-petal HCC0 Chip 0 Row 1, both at DESY and at Nikhef

These two plots (scans with no HV) should have been the same. The occupancy scale differs, which could partially explain the difference in colors for strobe delays above 30, but for the channel distribution differences it might be normal that each scan adjusts differently, let's see how the rest of scans go. Maybe the external light conditions could explain the difference. The Nikhef petal was tested without any cover from the light.


If everything worked correctly, you should see the XXX_StarStrobeDelayResult.json files in the /data folder.



3 Point Gain Scan

1) Important: Edit the scantools/configs_PPB_Vancouver_R5/scanSetup_3PG.json and enter the corresponding run numbers in the fields "input_trim_from_run": "/XXXXXX" and "input_strobeDelay_from_run": "/XXXXXX".

2) Run the scan (this one takes 5') using the command: python3 scantools/run_YARR.py -c scanSetup_3PG.json --infile-dir scantools/configs_PPB_Vancouver_R5

NOTE: Also in this scan, I got the same issue with the IDs of the ABC chips (as happened with the strobe delay scan).


The responseCurve plots should contain three points and look like this:

PLOTS


Response Curve Scan

1) Important: Edit the scantools/configs_PPB_Vancouver_R5/scanSetup_rcurve.json and enter the corresponding run numbers in the fields "input_trim_from_run": "/XXXXXX" and "input_strobeDelay_from_run": "/XXXXXX".

2) Run the scan (this one takes 5') using the command: python3 scantools/run_YARR.py -c scanSetup_rcurve.json --infile-dir scantools/configs_PPB_Vancouver_R5

NOTE: Scan failed for me because petal-testing/dependencies/YARR/configs/scans/star/std_responsecurve.json didn't exist. Comparing with the devel_SR1 branch, I saw this file contains for them the same as the file std_npointscan.json which does exist in my directory. So I copied this file and renamed it as std_responsecurve.json (so now both exist in petal-testing/dependencies/YARR/configs/scans/star/ with equals contents which is not right). Then J-H sent me the correct values for the loops section, which is the only difference between the two json files (3PG and rcurve).

The responseCurve plots should contain 16 points and look like this:


Noise Occupancy Scan

1) Important: Edit the scantools/configs_PPB_Vancouver_R5/scanSetup_NO.json and enter the corresponding run numbers in the fields "input_trim_from_run": "/XXXXXX" and "input_strobeDelay_from_run": "/XXXXXX".

2) Run the scan (this one takes 5') using the command:python3 scantools/run_YARR.py -c scanSetup_NO.json --infile-dir scantools/configs_PPB_Vancouver_R5

NOTE: for this one I got an error message saying "Careful! l0_latency in this scan is not the same as in the scan used to obtain the optimized strobe delay values. Check your config.". In the json file of the NO scan, the latency was set to 2, while in the SD scan it was 20, after modifying the NO json file to l0_latency 20 the run went through.

The OccupancyMap plots should look like this:



How to turn off the system

1) Turn OFF the (500V) CAEN HV PSU. It will do a power ramp of 10V/s till full shut down.

2) With felixcore running, go to the felix server and do source dependencies/setupYARR.sh and then turn all off: write_amac_ppb 9 0 0 0

3) Turn OFF the (11V) LV PSU.