BNMR: Difference between revisions

From DaqWiki
Jump to navigation Jump to search
en>Suz
No edit summary
 
(46 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Pagelinks}}
{{Pagelinks}}


= BNMR and BNQR Experiments at TRIUMF =
== BNMR and BNQR Experiments at TRIUMF ==
Main Page
This is the main page of the documentation for the Data Acquisition System (DAQ) for the BetaNMR (BNMR) and BetaNQR (BNQR) experiments at TRIUMF


= Purpose =
[[:Category:BNMR|Click here for a full list of all the pages in the BNMR documentation]].
These pages describe the Data Acquisition System (DAQ) for the BetaNMR (BNMR) and BetaNQR (BNQR) experiments at TRIUMF


= Introduction =
== Introduction ==
The Data Acquisition System is based on the [https://midas.triumf.ca/MidasWiki/index.php/Midas_documentation MIDAS] data acquisition package.  
The Data Acquisition System is based on the [https://midas.triumf.ca/MidasWiki/index.php/Midas_documentation MIDAS] data acquisition package.  


There are two separate experimental setups :
There are two separate '''beamlines''', BNMR and BNQR, each with its own experimental setup :


*     <span style="color:#7b68ee; font-style=italic">bnmr</span> running on the BNMR high-voltage platform
* {{bnmr}} running on the BNMR high-voltage platform
*     <span style="color:#20b2aa; font-style=italic">bnqr</span> running on the BNQR high-voltage platform
* {{bnqr}} running on the BNQR high-voltage platform


Each experimental setup has its own  [[#Hardware Components]] (i.e. a VME crate containing DAQ modules).  Each runs as a separate MIDAS experiment named {{bnmqr|join=or}}. DAQ software specific to these experiments (MIDAS clients) run the experiments - see [[#Software Components]]. Experimenters control the experiment using the MIDAS Web Server (mhttpd).
Each experimental setup has its own  [[#Hardware Components]] (i.e. a VME crate containing DAQ modules).  Each runs as a separate MIDAS experiment named {{bnmqr|join=or}}. DAQ software specific to these experiments (MIDAS clients) run the experiments - see [[#Software Components]]. Experimenters control the experiment using the MIDAS Web Server (mhttpd).
    
    
= Beam Control =
== Beam Control ==
The main TRIUMF EPICS Control System is used to control the beam, which can be switched to either experiment's beamline.  There are two '''Beam Modes''' that the experiments can be run in:
The main TRIUMF EPICS Control System is used to control the beam, which can be switched to either experiment's '''beamline'''.  There are two '''Beam Modes''' that the experiments can be run in:


;   single channel mode
;     [[BNMR Dual Channel Mode #Single Channel Mode|single channel mode]]
: where the beam is sent to one channel only, either BNMR or BNQR. Only '''one''' of the DAQ systems <span style="color:#7b68ee; font-style=italic">bnmr </span> or <span style="color:#20b2aa; font-style=italic">bnqr</span> is active.
: where the beam is sent to one beamline (channel) only, either BNMR or BNQR. Only '''one''' of the DAQ systems <span style="color:#7b68ee; font-style=italic">bnmr </span> or <span style="color:#20b2aa; font-style=italic">bnqr</span> is active.
;    '''dual channel mode'''
;    [[BNMR Dual Channel Mode|dual channel mode]]
: where the beam is switched between the two channels BNMR and BNQR at regular intervals. '''Both''' DAQ systems  <span style="color:#7b68ee; font-style=italic">bnmr </span> and <span style="color:#20b2aa; font-style=italic">bnqr</span> are active.
: where the beam is switched between the two beamlines (channels) BNMR and BNQR at regular intervals. '''Both''' DAQ systems  <span style="color:#7b68ee; font-style=italic">bnmr </span> and <span style="color:#20b2aa; font-style=italic">bnqr</span> are active.


= Environment =


== Experimental modes ==
For both experiments, two types of environment are defined (cf MUSR experiments):
For both experiments, two types of environment are defined (cf MUSR experiments):


*    '''Integral (Type 1)'''
*    '''Integral or TI (Type 1)'''
*    '''Time Differential or TD (Type 2)'''
*    '''Time Differential or TD (Type 2)'''
*    Combination of the above two types


There are two separate concepts that use similar naming schemes (e.g. 1f, 20) - the timing of pulses issued by the PPG and the name of the overall experimental mode. The overall mode determines both which timing scheme is run, as well as which hardware is scanned during the run (e.g. RF frequency, Na cell voltage). Multiple experimental modes may use the same PPG timing scheme (e.g. modes 1c, 1d, 1e, 1n use the PPG timing scheme called 1n).


Below is a full list of experimental modes, with the most common ones highlighted in bold. More details about each mode can be found on the [https://isdaq01.triumf.ca:8447/?cmd=custom&page=Modes BNMR mode changer] page and the [https://isdaq01.triumf.ca:8448/?cmd=custom&page=Modes BNQR mode changer] page.


= Experimental (PPG) Modes =
{| class="wikitable"
A number of different experimental modes are defined for each of Type 1 (Integral) and Type 2 (TD) [[#Environment]]s. These allow different experimental modes to be run (e.g. Frequency scan, Na Cell scan).  The modes used in recent years are shown in a brighter colour. These modes correspond to different programs downloaded into the [[#Hardware Components|PPG]] (i.e. to different pulse sequences) so are also known as '''PPG Modes'''.  To understand what each experimental mode does, consult the appropriate '''timing diagram''' listed below and see [[BNMR: Experimental Modes|experimental (PPG) modes]].
|+ Experimental modes
 
|-
{| class="wikitable" border=0 cellspacing=3 cellpadding=1 width=70% style="background-color:white"
! Mode name !! PPG timing !! BNMR? !! BNQR? !! Comment
|+ <b><center>Table 1 INTEGRAL and TIME DIFFERENTIAL Experimental (PPG) Modes</center></b>
|-
| '''10''' || 10 || &#10003; || &#10003; || No RF, nothing scanned
|-
| 1a || 1a || &#10003; || &#10003; || Scan RF frequency
|-
| 1b || 1b || &#10003; || &#10003; || Scan RF frequency
|-
| 1c || 1n || &#10003; || &#10003; || Scan settings on a Camp device
|-
| 1d || 1n || &#10003; || &#10003; || Scan the laser intensity
|-
| 1e || 1n || || &#10003; || Scan the magnetic field strength
|-
| '''1f''' || 1f || &#10003; || &#10003; || Scan RF frequency
|-
| 1g || 20 || &#10003; || &#10003; || Scan RF frequency
|-
| 1j || 20 || &#10003; || &#10003; || Scan settings on a Camp device
|-
| '''1n''' || 1n || &#10003; || &#10003; || Scan the Rb cell voltage or any other EPICS device
|-
| 1w || 1w || &#10003; || || Parametric scan of RF frequencies
|-
|-
|
| '''1x''' || 1f || &#10003; || &#10003; || Scan RF frequency with one region at higher resolution
{| class="wikitable" border=0 cellspacing=3 cellpadding=2  width=100% style="background-color:#e6ffe6"
|+ <b><center> Table 1a: Type 1 Integral Modes</center></b>
|-  style="background-color: #ccffcc"
! Mode Name !! Run Parameters !! Timing Figure
|- style="background-color: #80ff80"
| Scalers || 10 || Same as 1f
|- 
| 1a      || 1a || [https://www.triumf.info/wiki/DAQwiki/images/6/6c/1a_timing_ps.pdf 1a]
|-
|-
| 1b      || 1b || [http://www.triumf.info/wiki/DAQwiki/images/4/4a/1b_timing_ps.pdf 1b]     
| '''20''' || 20 || &#10003; || &#10003; || Nothing scanned
|- style="background-color: #80ff80"
| Freq    || 1f || [http://www.triumf.info/wiki/DAQwiki/images/a/a0/1f_timing_ps.pdf 1f] 
|- style="background-color: #80ff80"
| NaCell  || 1n || [http://www.triumf.info/wiki/DAQwiki/images/1/17/1n_timing_ps.pdf 1n]     
|- 
| Laser  || 1d || Same as 1n     
|-
|-
| Camp    || 1c || Same as 1f     
| 2a || 2a || &#10003; || &#10003; || Scan RF frequency
|
| Fast *    || 1g || Not available
|-
|-
| LCR  **  || 1j || Not available 
| 2b || 2b || &#10003; || &#10003; || Scan RF frequency
|-
|-
| colspan=3 style="font-size:80%"|*Combination of Modes 20 and 1f <br>  **Combination of Modes 20 and 1c   
| 2d || 1b || &#10003; || &#10003; || RF on, nothing scanned
|}
| style="color:white"|spacer
 
|rowspan="1"  style="color:white"|
 
 
{| class="wikitable" border=0 cellspacing=3 cellpadding=2  width=100% style="background-color:#ffe6ff"
|+ <b><center> Table 1b: Type 2 Differential Modes</center></b>
|-  style="background-color: #ffccff"
! Mode Name !! [[BNMR Mode Parameters|Mode Parameters]] !! Timing Figure
|- style="background-color: #ff99ff"
| SLR    || 20 || [http://www.triumf.info/wiki/DAQwiki/images/5/5e/20_timing_ps.pdf 20]     
|-               
| 2a      || 2a || [http://www.triumf.info/wiki/DAQwiki/images/b/bb/2a_timing_ps.pdf 2a]     
|-
|-
| 2b      || 2b || [http://www.triumf.info/wiki/DAQwiki/images/2/2b/2b_timing_ps.pdf 2b]     
| 2e || 2e || &#10003; || &#10003; || Scan RF frequency
|-
|-
| 2c      || 2c || [http://www.triumf.info/wiki/DAQwiki/images/4/4a/2c_timing_ps.pdf 2c]
| 2f || 2f || &#10003; || &#10003; || Scan RF frequency
|-
|-
| 2d      || 2d || same as [http://www.triumf.info/wiki/DAQwiki/images/4/4a/1b_timing_ps.pdf 1b]
| 2h || 20 || || &#10003; || Read alpha channels from scalers
|- style="background-color: #ff99ff"
| 2e      || 2e || [http://www.triumf.info/wiki/DAQwiki/images/f/fb/2e_timing_ps.pdf 2e] 
|- style="background-color:white; color:white "
|  this<br>is<br> a<br> spacer <br> a ||  ||        
|-
|-
|}style="color:#20b2aa"|
| 2s || 2s || &#10003; ||  || Spin-echo
 
|-
|-
| 2w || 2w || &#10003; ||  || RF Wurst modulation
|}
|}


= Hardware Components =
Any of these modes may be run in [[#Beam Control|single channel mode]]. Only Type 2 modes may be run in [[#Beam Control|dual channel mode]].
 
Users change which mode is active using the webpages for each experiment, which in turn interact with the [[#Software_Components|mode changer]] python script.
 
== Hardware Components ==


DAQ hardware components for each DAQ system (BNMR/BNQR) include the following VME modules:
DAQ hardware components for each DAQ system (BNMR/BNQR) include the following VME modules:
{| class="wikitable" border=1 cellspacing=3 cellpadding=10 style="background-color:#f0f0f5"
{| class="wikitable" border=1 cellspacing=3 cellpadding=10
|+ <b><center> Table 2: VME Modules for each Experiment</center></b>
|+ <b><center> Table 2: VME Modules for each Experiment</center></b>
|- style="background-color:#e0e0eb; "
! Module  !! Description  !! VME Base Address !! style="color:#7b68ee "| BNMR !! style="color:#20b2aa"|BNQR !! style="background-color: whitesmoke"| Manual
|-
| SIS3801 version E || multichannel scaler  A || 0x2800 ||style="color:#7b68ee "| yes ||style="color:#20b2aa"| yes ||rowspan="2" style="background-color: white"| [http://www.triumf.info/wiki/DAQwiki/images/b/b1/Sis3801_V5_to_VE.pdf SIS3801]
|- style="background-color: #e0e0eb;"
| SIS3801 version E || multichannel scaler  B || 0x1800 ||style="color:#7b68ee "| yes ||style="color:#20b2aa"| no
|-  
|-  
| PPG (Pulseblaster)|| Pulse Programmer ||0x8000 ||style="color:#7b68ee "| yes ||style="color:#20b2aa"|yes||style="background-color: whitesmoke"|[https://www.triumf.info/wiki/DAQwiki/images/7/74/PPG.pdf PPG] <br> [http://www.triumf.info/wiki/DAQwiki/images/6/6c/Spincore.pdf Spincore Pulseblaster]
! Module !! Description !! VME Base Address !! BNMR? !! BNQR? !! Manual
|- style="background-color: #e0e0eb;"
| PSM || Pol Synthesizer module (RF)||  0xC00000 ||style="color:#7b68ee "| no ||style="color:#20b2aa"| yes ||rowspan="2" style="background-color: white"|[http://www.triumf.info/wiki/DAQwiki/images/8/8c/PSM.pdf PSM] <br> [http://www.triumf.info/wiki/DAQwiki/images/5/50/AD9857_c_ps.pdf AD9857 Quadrature<br>Digital Upconverter] <br> Programming Guides:<br>[http://www.triumf.info/wiki/DAQwiki/images/e/eb/Psm_ps.pdf PSM] / [http://www.triumf.info/wiki/DAQwiki/images/8/85/Psmii_ps.pdf PSMII]
|-
|-
 
| SIS3801 version E || multichannel scaler  A || 0x2800 || &#10003; || ||rowspan="2" | [[Media:Sis3801_V5_to_VE.pdf|SIS3801 manual (PDF)]]
| PSMII || Pol Synthesizer module II (RF) || 0xC00000 ||style="color:#7b68ee "| yes ||style="color:#20b2aa"| no
|- style="background-color: #e0e0eb;"
| NIMIO32 || Input/Output Register  ||0x100000 ||style="color:#7b68ee "|yes ||style="color:#20b2aa"|yes ||style="background-color: whitesmoke"| [[VME-NIMIO32| NIMIO32]]
|-
|-
| MVME162 || 68040 board, cpu runs CAMP (VxWorks) || ||style="color:#7b68ee "|bnmrvw || style="color:#20b2aa"| polvw ||style="background-color: white"|
| SIS3801 version E || multichannel scaler  B || 0x1800 || &#10003; ||
|-
| SIS3820  || multichannel scaler  B || 0x38000000 ||  || &#10003; || [[Media:Sis3820-M-0-001-v186-scaler.pdf|SIS3820 manual (PDF)]]
|-
| PPG (Pulseblaster)|| Pulse Programmer  ||0x8000 || &#10003; || &#10003;|| [[Media:PPG.pdf|PPG manual (PDF)]] [[Media:Spincore.pdf|Spincore Pulseblaster (PDF)]]
|-
| PSM || Pol Synthesizer module (RF)||  0x820000 ||  || &#10003; ||rowspan="3" |[[BNMR:_PSM_(Pol_Synth_Module)|PSM]]
|-
|-
|- style="background-color: #e0e0eb;"
| PSMII || Pol Synthesizer module II (RF) || 0x820000 || ||
| VMIC|| cpu runs frontend (Linux)  || ||style="color:#7b68ee "| lxbnmr || style="color:#20b2aa"|lxbnqr ||style="background-color: whitesmoke"|
|-  
| PSMIII|| Pol Synthesizer module III(RF) || 0x820000 || &#10003; ||
|-  
| NIMIO32 || Input/Output Register  ||0x100000 || &#10003; || &#10003; || [[VME-NIMIO32| NIMIO32]]
|-
| MVME162 || 68040 board (VxWorks) that runs CAMP || || &#10003; (bnmrvw) || &#10003; (polvw) || <div id=VMIC></div>
|-
| VMIC|| Linux machine in VME crate that runs frontend || || &#10003; (lxbnmr) || &#10003; (lxbnqr) ||  
|}
|}


The connections between the DAQ VME Modules are shown in [[BNMR DAQ Hardware Connections]].


The names of the VMIC running the frontend and MVME162 (the CAMP host) for each experiment are shown in Table 2 above.
== Software Components ==
 
The DAQ system is based on the [https://midas.triumf.ca/MidasWiki/index.php/Midas_documentation MIDAS] package. Data acquisition software to run the  {{bnmqr|join=and}} experiments has been written to run under MIDAS. This includes the frontend, custom logger etc. This software is mostly common to both experiments, with the differences between each experiment handled by Midas ODB settings (most things) and a compile-time flag (choosing whether to build the febnmr or febnqr frontend).
= Software Components =
The DAQ system is based on the [https://midas.triumf.ca/MidasWiki/index.php/Midas_documentation MIDAS] package. Data acquisition software to run the  {{bnmqr|join=and}} experiments has been written to run under MIDAS. This includes the frontend, custom logger etc. This software is mostly common to both experiments (differences between the two experiments are handled with '''ifdefs''').


The experiment is controlled using the MIDAS webserver (mhttpd). Due to the large number of experimental parameters required, Midas custom pages have been written for the experimenters to control and monitor their experiment.  
The experiment is controlled using the MIDAS webserver (mhttpd). Due to the large number of experimental parameters required, Midas custom pages have been written for the experimenters to control and monitor their experiment.  
Line 135: Line 127:
The DAQ software components are started by the script ''start-all'' and stopped by the script ''kill-all''. These include '''standard MIDAS utilities''' (e.g. [https://midas.triumf.ca/MidasWiki/index.php/Mhttpd mhttpd], [https://midas.triumf.ca/MidasWiki/index.php/Mlogger mlogger], [https://midas.triumf.ca/MidasWiki/index.php/Mserver mserver]) as well as components specific to the  {{bnmqr|join=and}} experiments.
The DAQ software components are started by the script ''start-all'' and stopped by the script ''kill-all''. These include '''standard MIDAS utilities''' (e.g. [https://midas.triumf.ca/MidasWiki/index.php/Mhttpd mhttpd], [https://midas.triumf.ca/MidasWiki/index.php/Mlogger mlogger], [https://midas.triumf.ca/MidasWiki/index.php/Mserver mserver]) as well as components specific to the  {{bnmqr|join=and}} experiments.


The main DAQ software components specific to the {{bnmqr|join=and}} experiments are
The main DAQ software components specific to the {{bnmqr|join=and}} experiments are shown in the table below. A full ist can be found on the [[BNMR:_Software_overview|software overview page]].


{| class="wikitable" border=1 cellspacing=3 cellpadding=2 style="background-color:#f0f0f5"
{| class="wikitable" border=1 cellspacing=3 cellpadding=2 style="background-color:#f0f0f5"
|+  <b><center> Table 3: DAQ Software Components</center></b>
|+  <b><center> Table 3: DAQ Software Components</center></b>
|- style="background-color: #e0e0eb;"
|- style="background-color: #e0e0eb;"
 
! Component !! Host !! Experiment !! Purpose
! Component !! Hostname !!  Purpose
|-
|-
| colspan=4| ''Midas frontends''
|- style="background-color:floralwhite;"
| [[BNMR: frontend|febnmr_32bit.exe]] || '''lxbnmr''' || bnmr || rowspan=2| the '''frontend''' sets up, reads out hardware modules, sends histograms.<br>The frontend code for both experiments is identical.
|-  style="background-color:floralwhite;"
|-  style="background-color:floralwhite;"
| [[BNMR_frontend|frontend]]* || lxbn[mq]r**||the '''frontend''' sets up, reads out hardware modules, sends histograms
| [[BNMR: frontend|febnqr_32bit.exe]] || '''lxbnqr''' || bnqr
|-
| colspan=4| ''Midas clients - configuration''
|- style="background-color:mintcream"
|- style="background-color:mintcream"
| [[BNMR_rf_config|rf_config]]||isdaq01|| check PPG parameters, download program to PPG 
| [[BNMR:_Mode_changer|mode_changer.py]]|| isdaq01|| both || changes between experimental modes and between real/test runs
|- style="background-color:mintcream"
|- style="background-color:mintcream"
| [[BNMR_mdarc|mdarc]]|| isdaq01|| custom data logger saves data in MUD format
| [[BNMR:_RF_calculator|rf_calculator_fe.py]]|| isdaq01|| both || generates PPG program based on user-specified ODB parameters; reports calculated quantities in the ODB; sets up links in the ODB that should be stored in MUD files
|- style="background-color:mintcream;"
|- style="background-color:mintcream"
| midbnmr ||isdaq01|| converts MIDAS format saved data files to save in MUD format
| [[BNMR:_PPG_compiler|ppg_compiler_fe.py]]|| isdaq01|| both || low-level conversion of PPG program to PPG bytecode
|- style="background-color:mintcream"
|-  
| mheader ||isdaq01|| sends out CAMP and EPICS slow-control data to be saved in the MUD data file
| colspan=4| ''Midas clients - logging''
|- style="background-color: mintcream;"
|- style="background-color: mintcream;"
| fe_epics ||isdaq01|| sends experimental data to EPICS (can be read by control-room)
| [[BNMR:_Data_Logging|bnxr_logger.exe]]|| isdaq01|| both|| writes data to MUD files. Reads information from midas banks (for scaler histograms), EPICS, and CAMP
|- style="background-color: mintcream;"
|- style="background-color: mintcream;"
| autorun||isdaq01|| automatic run controller
| [[BNMR:_Data_Logging#Cleaning_up_if_end-of-run_fails|logger_cleanup.exe]]|| isdaq01|| both|| cleans up and archives any saved run files that were not properly archived. Run by user occasionally as needed.
|- style="background-color:lightyellow"
|- style="background-color:mintcream"
| perlscripts|| isdaq01 || various perlscripts control changing experimental mode, checking and maintaining run numbering, etc.
| [[BNMR:_Data_Logging#Run_comments|run_comment_editor.py ]]|| isdaq01|| both || responds to comments written by user in text box on the status page, saving to disk and/or midas banks
|-
| colspan=4| ''Other''
|- style="background-color:#ffe6e6;"
| [[BNMR: autorun|autorun]]|| isdaq01|| both|| automatic run controller
|- style="background-color:#ffe6e6"
| [[BNMR: Scripts|scripts]]|| isdaq01 || both|| scripts perform important functions e.g. kill-all, start-all. Scripts run at the begin and end of each run send information to the elog etc.  
|- style="background-color:#ffe6e6"
| rowspan=2| [[BNMR: CAMP|camp]] || '''bnmrvw''' || bnmr || rowspan=2| MUSR slow control system
|- style="background-color:#ffe6e6"
| '''polvw''' || bnqr
|}
|}
<br>
: * Frontend code for both experiments are identical and called febnmr_vmic or febnqr_vmic
: ** see [[#Nomenclature]]


Each of the DAQ components is described in more detail (click on the appropriate link in Table 3).  With the exception of the perlscripts, all components in Table 3 are MIDAS clients. The perlscripts use the MIDAS utility [https://midas.triumf.ca/MidasWiki/index.php/Odbedit odbedit] to communicate with the ODB, and may be run by one of the MIDAS clients, or by a (custom)script button on a MIDAS web page.


Analysis of the data is done by '''physica''', and plotting by '''lcrplot'''.  
Click the links in the above table for more details of each program.


Not listed above are various [[BNMR:_Tests|automated test]] programs for both the C++ and python programs. There are also some interactive test programs for [[BNMR: Hardware Debugging|debugging hardware issues]].


Note that the DAQ was rewritten in 2020. Details of the rewritten in 2020. Details of the differences between the new DAQ (documented here) and legacy DAQ (documentation removed) can be found on the [[BNMR:_Rewrite_2020|2020 rewrite]] page.


= DAQ  Summary =
== DAQ  Summary ==
;The VMIC front end computer runs the frontend code which
;The VMIC front end computer  
*  controls PSM,PPG, VMEIO
* runs the [[BNMR: frontend|frontend code]]''' which
*    acquires data from SIS MCS module(s), builds histograms
**  controls PSM,PPG, VMEIO, Scaler modules
*    acquires data from CAMP, EPICS  
**    acquires data from SIS MCS (scaler) module(s), builds [[BNMR: Histograms and Scalers|histograms]]
*    sends the data out into the data buffer
**    uses channel access to control EPICS variable(s) (e.g. helicity)
**    periodically sends the data out into the data buffer


;The host computer (isdaq01)
;The host computer (isdaq01)
* run all other software components
* runs all other software components which
* starts/stops runs
** acquire the data from the data buffer
* acquires the data from the data buffer
** log the data
* logs the data
** monitor the experiment
* monitors the experiment
** start/stop runs


== Tasks to be done before each beamtime ==


* <b>If this is the first beamtime of the year</b>, [[BNMR:_Data_Logging#Resetting_the_run_numbers|create a new data directory and reset the run numbers]].
* <b>If there have been changes to the code that affect the ODB structure</b>, [[BNMR:_Mode_changer#Handling_changes_to_the_ODB_structure|ensure saved settings have been updated to contain the new variables]].
* <b>Always</b> edit the bnmr user's cronjob (using <code>crontab -e</code>) to specify the schedule number and date range to include in the generated Excel file. See the [[BNMR:_Shift_Monitor#beamtime_to_excel.py|supported arguments to beamtime_to_excel.py]] and the [https://mis.triumf.ca/science/schedules.jsf TRIUMF beamtime schedule].
* <b>Strongly recommended</b> to try changing between a few common modes (e.g. 20, 1f, 1n, and back to 20) and ensure the run can start (in test mode, not real mode). You may need to disable "switching" checks on the [[BNMR:_Custom_Status_page|status page]] if the beamline is not currently configured for BNMR/BNQR.


= Nomenclature =
== Nomenclature ==
In this document, " ''bnmr'' or ''bnqr'' " may be written as " ''bn['''mq''']r'' " or "''''' <beamline> '''''". 
In this document, " ''bnmr'' or ''bnqr'' " may be written as " ''bn['''mq''']r'' "  


For example,  directories :
For example,  directories :
: <span style="color:#004d4d; font-weight:normal; font-style:italic ">/home/<span style="font-weight:bold;">bnmr</span>/online/<span style="font-weight:bold;">bnmr</span></span> <span style="color:white">spc</span>  or <span style="color:white">spc</span>  <span style="color:#004d4d; font-weight:normal; font-style:italic ">/home/<span style="font-weight:bold;">bnqr</span>/online/<span style="font-weight:bold;">bnqr</span></span>
: <span style="color:#004d4d; font-weight:normal; font-style:italic ">/home/<span style="font-weight:bold;">bnmr</span>/online/<span style="font-weight:bold;">bnmr</span></span> <span style="color:white">spc</span>  and <span style="color:white">spc</span>  <span style="color:#004d4d; font-weight:normal; font-style:italic ">/home/<span style="font-weight:bold;">bnqr</span>/online/<span style="font-weight:bold;">bnqr</span></span>


are referred to by '''shortcuts''' such as
are referred to by '''shortcuts''' such as


<span style="color:white">space</span> {{Filepath|path=/home/bn<span style="font-weight:bold;">[nm]</span>r/online/b<span style="font-weight:bold;">[nm]</span>r}} <span style="color:white">spc</span> or <span style="color:white">spc</span> {{Filepath|path=~/online/b<span style="font-weight:bold;">[nm]</span>r}}
<span style="color:white">space</span> {{Filepath|path=/home/bn<span style="font-weight:bold;">[nm]</span>r/online/b<span style="font-weight:bold;">[nm]</span>r}} <span style="color:white">spc</span> and <span style="color:white">spc</span> {{Filepath|path=~/online/b<span style="font-weight:bold;">[nm]</span>r}}
 
and


<span style="color:white">space</span> {{Filepath|path=/home/<beamline>/online/<beamline>}} <span style="color:white">bl</span> or <span style="color:white">bl</span> {{Filepath|path=~/online/<beamline>}}, <span style="color:white">bl</span> where {{Filepath|path=<beamline>}} is {{bnmqr|join=or}}
Alternatively, these directories may be written as
<ul>
<li> {{Filepath|path=/home/<experiment>/online/<beamline>}}
<li> {{Filepath|path=/home/<expt>/online/<beamline>}}  
<li> {{Filepath|path=~/online/<beamline>}}
</ul>
where {{Filepath|path=<experiment>}} {{Filepath|path=<expt>}} and {{Filepath|path=<beamline>}} are {{bnmqr|join=or}}.


[[Category:BNMR]]
[[Category:BNMR]]

Latest revision as of 13:33, 2 October 2024

BNMR and BNQR Experiments at TRIUMF

This is the main page of the documentation for the Data Acquisition System (DAQ) for the BetaNMR (BNMR) and BetaNQR (BNQR) experiments at TRIUMF

Click here for a full list of all the pages in the BNMR documentation.

Introduction

The Data Acquisition System is based on the MIDAS data acquisition package.

There are two separate beamlines, BNMR and BNQR, each with its own experimental setup :

  • bnmr running on the BNMR high-voltage platform
  • bnqr running on the BNQR high-voltage platform

Each experimental setup has its own #Hardware Components (i.e. a VME crate containing DAQ modules). Each runs as a separate MIDAS experiment named bnmr or bnqr. DAQ software specific to these experiments (MIDAS clients) run the experiments - see #Software Components. Experimenters control the experiment using the MIDAS Web Server (mhttpd).

Beam Control

The main TRIUMF EPICS Control System is used to control the beam, which can be switched to either experiment's beamline. There are two Beam Modes that the experiments can be run in:

single channel mode
where the beam is sent to one beamline (channel) only, either BNMR or BNQR. Only one of the DAQ systems bnmr or bnqr is active.
dual channel mode
where the beam is switched between the two beamlines (channels) BNMR and BNQR at regular intervals. Both DAQ systems bnmr and bnqr are active.


Experimental modes

For both experiments, two types of environment are defined (cf MUSR experiments):

  • Integral or TI (Type 1)
  • Time Differential or TD (Type 2)

There are two separate concepts that use similar naming schemes (e.g. 1f, 20) - the timing of pulses issued by the PPG and the name of the overall experimental mode. The overall mode determines both which timing scheme is run, as well as which hardware is scanned during the run (e.g. RF frequency, Na cell voltage). Multiple experimental modes may use the same PPG timing scheme (e.g. modes 1c, 1d, 1e, 1n use the PPG timing scheme called 1n).

Below is a full list of experimental modes, with the most common ones highlighted in bold. More details about each mode can be found on the BNMR mode changer page and the BNQR mode changer page.

Experimental modes
Mode name PPG timing BNMR? BNQR? Comment
10 10 No RF, nothing scanned
1a 1a Scan RF frequency
1b 1b Scan RF frequency
1c 1n Scan settings on a Camp device
1d 1n Scan the laser intensity
1e 1n Scan the magnetic field strength
1f 1f Scan RF frequency
1g 20 Scan RF frequency
1j 20 Scan settings on a Camp device
1n 1n Scan the Rb cell voltage or any other EPICS device
1w 1w Parametric scan of RF frequencies
1x 1f Scan RF frequency with one region at higher resolution
20 20 Nothing scanned
2a 2a Scan RF frequency
2b 2b Scan RF frequency
2d 1b RF on, nothing scanned
2e 2e Scan RF frequency
2f 2f Scan RF frequency
2h 20 Read alpha channels from scalers
2s 2s Spin-echo
2w 2w RF Wurst modulation

Any of these modes may be run in single channel mode. Only Type 2 modes may be run in dual channel mode.

Users change which mode is active using the webpages for each experiment, which in turn interact with the mode changer python script.

Hardware Components

DAQ hardware components for each DAQ system (BNMR/BNQR) include the following VME modules:

Table 2: VME Modules for each Experiment
Module Description VME Base Address BNMR? BNQR? Manual
SIS3801 version E multichannel scaler A 0x2800 SIS3801 manual (PDF)
SIS3801 version E multichannel scaler B 0x1800
SIS3820 multichannel scaler B 0x38000000 SIS3820 manual (PDF)
PPG (Pulseblaster) Pulse Programmer 0x8000 PPG manual (PDF) Spincore Pulseblaster (PDF)
PSM Pol Synthesizer module (RF) 0x820000 PSM
PSMII Pol Synthesizer module II (RF) 0x820000
PSMIII Pol Synthesizer module III(RF) 0x820000
NIMIO32 Input/Output Register 0x100000 NIMIO32
MVME162 68040 board (VxWorks) that runs CAMP ✓ (bnmrvw) ✓ (polvw)
VMIC Linux machine in VME crate that runs frontend ✓ (lxbnmr) ✓ (lxbnqr)

The connections between the DAQ VME Modules are shown in BNMR DAQ Hardware Connections.

Software Components

The DAQ system is based on the MIDAS package. Data acquisition software to run the bnmr and bnqr experiments has been written to run under MIDAS. This includes the frontend, custom logger etc. This software is mostly common to both experiments, with the differences between each experiment handled by Midas ODB settings (most things) and a compile-time flag (choosing whether to build the febnmr or febnqr frontend).

The experiment is controlled using the MIDAS webserver (mhttpd). Due to the large number of experimental parameters required, Midas custom pages have been written for the experimenters to control and monitor their experiment.

The custom logger (mdarc/midbnmr) saves the data into MUSR MUD format files, and the MUSR CAMP slow control system is used for slow controls. Analysis is done by physica.

The DAQ software components are started by the script start-all and stopped by the script kill-all. These include standard MIDAS utilities (e.g. mhttpd, mlogger, mserver) as well as components specific to the bnmr and bnqr experiments.

The main DAQ software components specific to the bnmr and bnqr experiments are shown in the table below. A full ist can be found on the software overview page.

Table 3: DAQ Software Components
Component Host Experiment Purpose
Midas frontends
febnmr_32bit.exe lxbnmr bnmr the frontend sets up, reads out hardware modules, sends histograms.
The frontend code for both experiments is identical.
febnqr_32bit.exe lxbnqr bnqr
Midas clients - configuration
mode_changer.py isdaq01 both changes between experimental modes and between real/test runs
rf_calculator_fe.py isdaq01 both generates PPG program based on user-specified ODB parameters; reports calculated quantities in the ODB; sets up links in the ODB that should be stored in MUD files
ppg_compiler_fe.py isdaq01 both low-level conversion of PPG program to PPG bytecode
Midas clients - logging
bnxr_logger.exe isdaq01 both writes data to MUD files. Reads information from midas banks (for scaler histograms), EPICS, and CAMP
logger_cleanup.exe isdaq01 both cleans up and archives any saved run files that were not properly archived. Run by user occasionally as needed.
run_comment_editor.py isdaq01 both responds to comments written by user in text box on the status page, saving to disk and/or midas banks
Other
autorun isdaq01 both automatic run controller
scripts isdaq01 both scripts perform important functions e.g. kill-all, start-all. Scripts run at the begin and end of each run send information to the elog etc.
camp bnmrvw bnmr MUSR slow control system
polvw bnqr


Click the links in the above table for more details of each program.

Not listed above are various automated test programs for both the C++ and python programs. There are also some interactive test programs for debugging hardware issues.

Note that the DAQ was rewritten in 2020. Details of the rewritten in 2020. Details of the differences between the new DAQ (documented here) and legacy DAQ (documentation removed) can be found on the 2020 rewrite page.

DAQ Summary

The VMIC front end computer
  • runs the frontend code which
    • controls PSM,PPG, VMEIO, Scaler modules
    • acquires data from SIS MCS (scaler) module(s), builds histograms
    • uses channel access to control EPICS variable(s) (e.g. helicity)
    • periodically sends the data out into the data buffer
The host computer (isdaq01)
  • runs all other software components which
    • acquire the data from the data buffer
    • log the data
    • monitor the experiment
    • start/stop runs

Tasks to be done before each beamtime

Nomenclature

In this document, " bnmr or bnqr " may be written as " bn[mq]r "

For example, directories :

/home/bnmr/online/bnmr spc and spc /home/bnqr/online/bnqr

are referred to by shortcuts such as

space /home/bn[nm]r/online/b[nm]r spc and spc ~/online/b[nm]r

Alternatively, these directories may be written as

  • /home/<experiment>/online/<beamline>
  • /home/<expt>/online/<beamline>
  • ~/online/<beamline>

where <experiment> <expt> and <beamline> are bnmr or bnqr.