<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://daq00.triumf.ca/AgWiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Acapra</id>
	<title>AgWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://daq00.triumf.ca/AgWiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Acapra"/>
	<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php/Special:Contributions/Acapra"/>
	<updated>2026-05-17T20:32:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Equipment&amp;diff=958</id>
		<title>Equipment</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Equipment&amp;diff=958"/>
		<updated>2022-07-19T08:40:00Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Main Page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= UPS - Tripp-Lite - Model SUINT1500LCD2U =&lt;br /&gt;
&lt;br /&gt;
SmartOnline 208/230V 1.5kVA 1.35kW Double-Conversion UPS, 2U, Extended Run, no(SNMP Card Option), LCD, USB, DB9, ENERGY STAR&lt;br /&gt;
* [[Image:UPS-TRIPP LITE-SUINT1500LCD2U.pdf|thumb|UPS-Tripp-Lite]]&lt;br /&gt;
&lt;br /&gt;
= PL512 - WIENER - Low Voltage Power unit =&lt;br /&gt;
&lt;br /&gt;
Cable plug STAK3N with the locking retainer STASI3&lt;br /&gt;
&lt;br /&gt;
Hirschmann connector: https://sc2.premierfarnell.com/sc/product.aspx?productid=1176412&lt;br /&gt;
* [[Image:Manual_PL512_PL506_00679_A4.pdf|thumb|LV-PL512]]&lt;br /&gt;
&lt;br /&gt;
= R1471 - CAEN - High Voltage Power Supply =&lt;br /&gt;
4 channels 0..8KV 3mA&lt;br /&gt;
&lt;br /&gt;
* [[Image:R14xx_rev7.pdf|thumb|HV-R1470]]&lt;br /&gt;
&lt;br /&gt;
= MV2 - Metrolab - 3-axis Hall device =&lt;br /&gt;
&lt;br /&gt;
* [[Image:MagVector-MV2-Datasheet-v1.1.pdf|thumb|MV2]]&lt;br /&gt;
&lt;br /&gt;
= ETH002 - 2 x 16A ethernet relay =&lt;br /&gt;
&lt;br /&gt;
[http://www.robot-electronics.co.uk/eth002-16amp-2-channel-ethernet-relay.html Online Documentation]&lt;br /&gt;
* [[File:Eth002.pdf|thumb]]&lt;br /&gt;
&lt;br /&gt;
= Quantel Laser power supply ICE450 and Laser system Ultra =&lt;br /&gt;
* [[File:Brio_ICE450_Power_Supply_Manual.pdf|thumb]]&lt;br /&gt;
* [[File:Full Laser System Short Manual.pdf|thumb|Full Laser System Short Manual]]&lt;br /&gt;
* [[File:LaserSpecs.pdf|thumb|Laser Specifications]]&lt;br /&gt;
&lt;br /&gt;
= ThermoFisher ThermoChill III chiller =&lt;br /&gt;
* [[File:Thermochill 3 Manual.pdf|thumb|Thermochill 3 Manual]]&lt;br /&gt;
&lt;br /&gt;
= Alpha Omega Instruments Trace Oxygen Analyzer SERIES 3000 =&lt;br /&gt;
* [[File:Series_3000_Manual.pdf|thumb|Oxygen Analyzer Manual]]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:Series_3000_Manual.pdf&amp;diff=957</id>
		<title>File:Series 3000 Manual.pdf</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:Series_3000_Manual.pdf&amp;diff=957"/>
		<updated>2022-07-19T08:39:18Z</updated>

		<summary type="html">&lt;p&gt;Acapra: Alpha Omega Instruments Corp. SERIES 3000 TRACE OXYGEN ANALYZER USER MANUAL
Rev 3.0517, May 2017&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Alpha Omega Instruments Corp. SERIES 3000 TRACE OXYGEN ANALYZER USER MANUAL&lt;br /&gt;
Rev 3.0517, May 2017&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Equipment&amp;diff=956</id>
		<title>Equipment</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Equipment&amp;diff=956"/>
		<updated>2022-07-19T08:37:12Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Main Page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= UPS - Tripp-Lite - Model SUINT1500LCD2U =&lt;br /&gt;
&lt;br /&gt;
SmartOnline 208/230V 1.5kVA 1.35kW Double-Conversion UPS, 2U, Extended Run, no(SNMP Card Option), LCD, USB, DB9, ENERGY STAR&lt;br /&gt;
* [[Image:UPS-TRIPP LITE-SUINT1500LCD2U.pdf|thumb|UPS-Tripp-Lite]]&lt;br /&gt;
&lt;br /&gt;
= PL512 - WIENER - Low Voltage Power unit =&lt;br /&gt;
&lt;br /&gt;
Cable plug STAK3N with the locking retainer STASI3&lt;br /&gt;
&lt;br /&gt;
Hirschmann connector: https://sc2.premierfarnell.com/sc/product.aspx?productid=1176412&lt;br /&gt;
* [[Image:Manual_PL512_PL506_00679_A4.pdf|thumb|LV-PL512]]&lt;br /&gt;
&lt;br /&gt;
= R1471 - CAEN - High Voltage Power Supply =&lt;br /&gt;
4 channels 0..8KV 3mA&lt;br /&gt;
&lt;br /&gt;
* [[Image:R14xx_rev7.pdf|thumb|HV-R1470]]&lt;br /&gt;
&lt;br /&gt;
= MV2 - Metrolab - 3-axis Hall device =&lt;br /&gt;
&lt;br /&gt;
* [[Image:MagVector-MV2-Datasheet-v1.1.pdf|thumb|MV2]]&lt;br /&gt;
&lt;br /&gt;
= ETH002 - 2 x 16A ethernet relay =&lt;br /&gt;
&lt;br /&gt;
[http://www.robot-electronics.co.uk/eth002-16amp-2-channel-ethernet-relay.html Online Documentation]&lt;br /&gt;
* [[File:Eth002.pdf|thumb]]&lt;br /&gt;
&lt;br /&gt;
= Quantel Laser power supply ICE450 and Laser system Ultra =&lt;br /&gt;
* [[File:Brio_ICE450_Power_Supply_Manual.pdf|thumb]]&lt;br /&gt;
* [[File:Full Laser System Short Manual.pdf|thumb|Full Laser System Short Manual]]&lt;br /&gt;
* [[File:LaserSpecs.pdf|thumb|Laser Specifications]]&lt;br /&gt;
&lt;br /&gt;
= ThermoFisher ThermoChill III chiller =&lt;br /&gt;
* [[File:Thermochill 3 Manual.pdf|thumb|Thermochill 3 Manual]]&lt;br /&gt;
&lt;br /&gt;
= Alpha Omega Instruments Trace Oxygen Analyzer SERIES 3000 =&lt;br /&gt;
* [[File:Series 3000 Manual.pdf|thumb|Oxygen Analyzer Manual]]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Magnetometry&amp;diff=921</id>
		<title>Magnetometry</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Magnetometry&amp;diff=921"/>
		<updated>2022-06-29T17:56:11Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;gt; &amp;gt; &amp;gt; &amp;gt; NMRxy: NMR probe combined with MV2 Hall probe&lt;br /&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Mxy: MV2 Hall probe only  &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! NMR+Hall !! PWB  !! Column !! Row !! Approx. Location&lt;br /&gt;
|-&lt;br /&gt;
| NMR1 || PWB08&lt;br /&gt;
|-&lt;br /&gt;
| NMR2 || PWB06&lt;br /&gt;
|-&lt;br /&gt;
| NMR3 || PWB02&lt;br /&gt;
|-&lt;br /&gt;
| NMR4 || PWB78&lt;br /&gt;
|-&lt;br /&gt;
| NMR5 || PWB33&lt;br /&gt;
|-&lt;br /&gt;
| NMR6 || PWB65&lt;br /&gt;
|-&lt;br /&gt;
| NMR7 || PWB18&lt;br /&gt;
|-&lt;br /&gt;
| NMR8 || PWB45&lt;br /&gt;
|-&lt;br /&gt;
| NMR9 || PWB10&lt;br /&gt;
|-&lt;br /&gt;
| NMR10 ||  PWB64&lt;br /&gt;
|-&lt;br /&gt;
| M11 ||  PWB13&lt;br /&gt;
|-&lt;br /&gt;
| M12 ||  PWB49&lt;br /&gt;
|-&lt;br /&gt;
| M13 ||  PWB11&lt;br /&gt;
|-&lt;br /&gt;
| M14 ||  PWB03&lt;br /&gt;
|-&lt;br /&gt;
| M15 ||  PWB35&lt;br /&gt;
|-&lt;br /&gt;
| M16 ||  PWB67&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:TPC magnetometer locations.pdf|thumb|Location of NMR+Hall in the TPC]]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Magnetometry&amp;diff=920</id>
		<title>Magnetometry</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Magnetometry&amp;diff=920"/>
		<updated>2022-06-29T17:54:54Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! NMR+Hall !! PWB  !! Column !! Row !! Approx. Location&lt;br /&gt;
|-&lt;br /&gt;
| NMR1 || PWB08&lt;br /&gt;
|-&lt;br /&gt;
| NMR2 || PWB06&lt;br /&gt;
|-&lt;br /&gt;
| NMR3 || PWB02&lt;br /&gt;
|-&lt;br /&gt;
| NMR4 || PWB78&lt;br /&gt;
|-&lt;br /&gt;
| NMR5 || PWB33&lt;br /&gt;
|-&lt;br /&gt;
| NMR6 || PWB65&lt;br /&gt;
|-&lt;br /&gt;
| NMR7 || PWB18&lt;br /&gt;
|-&lt;br /&gt;
| NMR8 || PWB45&lt;br /&gt;
|-&lt;br /&gt;
| NMR9 || PWB10&lt;br /&gt;
|-&lt;br /&gt;
| NMR10 ||  PWB64&lt;br /&gt;
|-&lt;br /&gt;
| M11 ||  PWB13&lt;br /&gt;
|-&lt;br /&gt;
| M12 ||  PWB49&lt;br /&gt;
|-&lt;br /&gt;
| M13 ||  PWB11&lt;br /&gt;
|-&lt;br /&gt;
| M14 ||  PWB03&lt;br /&gt;
|-&lt;br /&gt;
| M15 ||  PWB35&lt;br /&gt;
|-&lt;br /&gt;
| M16 ||  PWB67&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:TPC magnetometer locations.pdf|thumb|Location of NMR+Hall in the TPC]]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=PWB&amp;diff=797</id>
		<title>PWB</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=PWB&amp;diff=797"/>
		<updated>2021-08-03T05:10:35Z</updated>

		<summary type="html">&lt;p&gt;Acapra: /* Hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Links =&lt;br /&gt;
&lt;br /&gt;
* https://bitbucket.org/expalpha/pwb_rev1_firmware&lt;br /&gt;
* https://edev-group.triumf.ca/fw/exp/alphag/feam/rev1&lt;br /&gt;
* https://edev-group.triumf.ca/hw/alphag/feam/rev1&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/170 - PWB inventory database&lt;br /&gt;
&lt;br /&gt;
= Schematics =&lt;br /&gt;
&lt;br /&gt;
* [[Image:pwb_rev0.pdf]]&lt;br /&gt;
* [[Image:Pwb-rev1-after.pdf]]&lt;br /&gt;
* [[Image:AlphaG Rev1.pdf]]&lt;br /&gt;
&lt;br /&gt;
= Manuals =&lt;br /&gt;
&lt;br /&gt;
* [[Image:AFTER_MANUAL_V1.pdf]] AFTER SCA manual v1&lt;br /&gt;
* [[Image:AFTER_DataSheet1_1.pdf]] AFTER SCA manual v1.1&lt;br /&gt;
* [[Image:AFTER_SCA_table2.pdf]] AFTER SCA channel map&lt;br /&gt;
&lt;br /&gt;
= Hardware =&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
External power supply is:&lt;br /&gt;
* +5V&lt;br /&gt;
* +2V&lt;br /&gt;
&lt;br /&gt;
Central board:&lt;br /&gt;
&lt;br /&gt;
* Ext_5V - F1 - RS1 (0.1R) - Fuse_5V&lt;br /&gt;
* Ext_2V - F2/F3 - RS2 (0.1R) - Idig2-&lt;br /&gt;
* LDO3 - Fuse_5V - DIG_3.3V - selfenable - ADM7154&lt;br /&gt;
* LDO5 - Fuse_5V - DIG_2.5V - selfenable - ADM7154&lt;br /&gt;
* LDO_CLN - Fuse5V - CLN_3.3V - selfenable - &lt;br /&gt;
* VREG - DIG_3.3V - -2.5V SCA BIAS - selfenable - LTC1983ES6-3#TRMPBF&lt;br /&gt;
* LDO7 - DIG_2.5V - DDR3_VRef - enable DDR3_1P5V, DDR3_PG, DDR3_VttEN&lt;br /&gt;
* LDO2 - Idig2V- - DIG_1.1V - enable DIG_3.3V - LT3071&lt;br /&gt;
* LDO6 - Idig2V- - DDR3_1P5V - enable DIG_3.3V - LT3083&lt;br /&gt;
&lt;br /&gt;
SCA Wing:&lt;br /&gt;
&lt;br /&gt;
* Ext_5V - F1 - RS1 (0.3R) - Isca- - SCA_Fuse5V&lt;br /&gt;
* LDO1 - SCA_Fuse5V - SCA3.3V - enable ADC_PWR_EN - ADM7154&lt;br /&gt;
* LDO2 - SCA3.3V - ADC1.8V - selfenable - ADM7154&lt;br /&gt;
* LDO3 - SCA3.3V - TRN2.5V - selfenable - LT1761&lt;br /&gt;
* REF - SCA3.3V - 1.45V Vicm - selfenable - LM4121&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Trigger and Clock distribution ==&lt;br /&gt;
&lt;br /&gt;
Clock (62.5MHz) and trigger are distributed to the PWB columns via the [https://edev-group.triumf.ca/hw/alphag/trigger-card-sata-adapter/rev1 trigger SATA adapter].&lt;br /&gt;
&lt;br /&gt;
The two miniSAS cables from cdm03 port 5 and 6 are connected to a miniSAS-SATA splitter 1-to-4 (CS Electronics &amp;quot;iSAS SATA adapter&amp;quot; ADP-887P-1X). Since there are only 8 columns and the clock and trigger signals are daisy-chained across the 8 rows, this scheme is sufficient to provide the necessary inputs to all 64 PWBs.&lt;br /&gt;
&lt;br /&gt;
[https://www.techcable.com/sas-mini-sas-cables/sata-cables/ SATA 6Gb/s Cable with Latching Clip. Straight Pinout 1-1 247726-L  40in]&lt;br /&gt;
&lt;br /&gt;
== Optical Link ==&lt;br /&gt;
&lt;br /&gt;
Main data uplink.&lt;br /&gt;
&lt;br /&gt;
SFP (Small Form Pluggable) Avago Technologies AFBR-57M5APZ [[File:AVAGO SFP specs.pdf|SFP (Small Form Pluggable) Avago Technologies AFBR-57M5APZ]]&lt;br /&gt;
&lt;br /&gt;
Fiber optic Tripp Lite N820 - 10 m [[File:FiberOptic TrippLite specs.pdf|Fiber optic Tripp Lite N820 - 10 m]]&lt;br /&gt;
&lt;br /&gt;
== SATA Link ==&lt;br /&gt;
&lt;br /&gt;
Secondary data uplink, capable also to deliver clock and trigger.&lt;br /&gt;
&lt;br /&gt;
The SATA link connects PWB from adjacent columuns on the same row.&lt;br /&gt;
&lt;br /&gt;
The SATA cable is a &amp;quot;crossed cable&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Firmware =&lt;br /&gt;
&lt;br /&gt;
== Firmware update ==&lt;br /&gt;
&lt;br /&gt;
PWB firmware update is done using &amp;quot;esper-tool&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
esper-tool -v upload -f file.rpd http://pwbNN update factory_rpd&lt;br /&gt;
esper-tool -v upload -f file.rpd http://pwbNN update file_rpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of PWB firmware pwb_rev1_20200706_ko:&lt;br /&gt;
&lt;br /&gt;
Permission to write into the flash memory is controlled by esper variables:&lt;br /&gt;
&lt;br /&gt;
* allow_write set to &amp;quot;false&amp;quot;: &amp;quot;esper-tool upload&amp;quot; does a &amp;quot;verify&amp;quot;: successful upload means epcq flash content is same as rpd file, error means content is not the same.&lt;br /&gt;
* allow_write set to &amp;quot;true&amp;quot;: &amp;quot;esper-tool upload&amp;quot; updates the epcq flash from the rpd file: for each data block, read the epcq flash, compare to rpd data, if different, erase the flash block, write the flash, read the flash, if there is a mismatch (bad write), return an error.&lt;br /&gt;
* allow_factory_write set to &amp;quot;true&amp;quot; to enable writing to the &amp;quot;factory_rpd&amp;quot;. DO NOT SET IT TO &amp;quot;true&amp;quot; UNLESS YOU MEAN TO UPDATE THE PWB BOOTLOADER. IF YOU FLASH BUM FIRMWARE or IF THERE IS A POWER OUTAGE WHILE UPDATING, THE PWB WILL BE BRICKED and has to be recovered by connecting a USB blaster.&lt;br /&gt;
&lt;br /&gt;
To update firmware of multiple boards to correct version, recommended is the script &amp;quot;update_pwb.perl&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/online/src&lt;br /&gt;
./update_pwb.perl pwb12 pwb06 pwb78&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Factory page and user page firmware boot ==&lt;br /&gt;
&lt;br /&gt;
Each PWB board has 2 firmware images: boot loader (factory page)&lt;br /&gt;
and data acquisition (user page). On power up, the FPGA loads and runs&lt;br /&gt;
the boot loader firmware from the factory page, later the control&lt;br /&gt;
software reboots the FPGA into the data acquisition firmware from&lt;br /&gt;
the user page.&lt;br /&gt;
&lt;br /&gt;
Because loading defective firmware can brick https://en.wikipedia.org/wiki/Brick_(electronics)&lt;br /&gt;
the PWB, new firmware images are loaded into the user page, if anything is wrong,&lt;br /&gt;
the PWB can still boot from the factory page and one can use the firmware update&lt;br /&gt;
function to load a good firmware image into the user page.&lt;br /&gt;
&lt;br /&gt;
The boot loader firmware in the factory page is not intended for data acquisition, it is only meant to provide three functions:&lt;br /&gt;
* boot enough hardware and software to communicate via the ethernet and the sata link&lt;br /&gt;
* firmware update (both factory page and user page)&lt;br /&gt;
* reboot into the user page&lt;br /&gt;
&lt;br /&gt;
The boot loader firmware in the factory page is usually never updated unless absolutely&lt;br /&gt;
needed to fix a problem with these three functions (i.e. compatibility with sata link communications).&lt;br /&gt;
&lt;br /&gt;
If factory image is corrupted or the contains defective firmware and the PWB does not boot (no dhcp, no ping, no esper),&lt;br /&gt;
the only way to unbrick it is by loading good firmware using a jtag flash programmer (usb-blaster). Connecting it requires&lt;br /&gt;
physical access to the jtag connector on the PWB board. It is impossible when the detector is fully assembled in the experiment.&lt;br /&gt;
&lt;br /&gt;
The PWB has a 32 Mbyte EPCQ flash memory chip, it is divided into 2 pages 16 Mbytes of factory page and 16 Mbytes of user page.&lt;br /&gt;
&lt;br /&gt;
A complete firmware image generally contains 3 pieces:&lt;br /&gt;
* FPGA firmware and NIOS &amp;quot;feam_bootloader&amp;quot; software RAM image (sof file)&lt;br /&gt;
* NIOS &amp;quot;feam&amp;quot; software RAM image (feam.elf.flash.hex) - all the C code for esper communications and PWB data acquisition&lt;br /&gt;
* NIOS filesystem image (feam.webpkg.hex) - esper web pages&lt;br /&gt;
&lt;br /&gt;
This is the boot sequence:&lt;br /&gt;
* on power-up the FPGA automatically loads the sof file from address 0 of the EPCQ flash (this is the factory image sof file)&lt;br /&gt;
* the FPGA is &amp;quot;started&amp;quot;&lt;br /&gt;
* the NIOS CPU starts executing the &amp;quot;feam_bootloader&amp;quot; C code embedded in the sof file (NIOS project hdl/software/feam_bootloader)&lt;br /&gt;
* feam_bootloader initializes the hardware (clocks, DDR memory, etc)&lt;br /&gt;
* feam_bootloader write-protects the EPCQ flash memory&lt;br /&gt;
* feam_bootloader copies the &amp;quot;feam&amp;quot; software from EPCQ flash to the DDR memory (after checking for correct checkum)&lt;br /&gt;
* feam_bootloader restarts the NIOS CPU&lt;br /&gt;
* the NIOS CPU starts running from DDR memory, executes the &amp;quot;feam&amp;quot; software (NIOS project hdl/software/feam)&lt;br /&gt;
* call main() in hdl/software/feam/src/task_init.c&lt;br /&gt;
* call task_init() in the same file&lt;br /&gt;
* infinite loop waiting for IP address via DHCP&lt;br /&gt;
* after have IP address, call task_esper() from hdl/software/feam/src/task_esper.c&lt;br /&gt;
* task_esper() creates all the esper modules, esper variables, etc,&lt;br /&gt;
* mod_http.c starts the mongoose web server&lt;br /&gt;
* PWB is open for business&lt;br /&gt;
&lt;br /&gt;
This is the protection against booting corrupted firmware:&lt;br /&gt;
* FPGA hardware loads the sof file from epcq flash and checks for correct checksum before &amp;quot;starting&amp;quot; it&lt;br /&gt;
* NIOS CPU is part of the sof file, protected by sof file checksum&lt;br /&gt;
* NIOS feam_bootloader C code is part of the sof file, protected by the sof checksum&lt;br /&gt;
* feam_bootloader checks for correct signatures and checksums of the DDR memory image&lt;br /&gt;
* &amp;quot;feam&amp;quot; C code is protected by the checksum of the DDR memory image&lt;br /&gt;
&lt;br /&gt;
== NIOS terminal ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ /opt/intelFPGA/16.1/quartus/bin/jtagconfig&lt;br /&gt;
1) USB-Blaster [2-1.2]&lt;br /&gt;
  02B030DD   5CGTFD7(B5|C5|D5)/5CGXBC7B6/..&lt;br /&gt;
$ /opt/intelFPGA/17.0/quartus/bin/nios2-terminal&lt;br /&gt;
nios2-terminal: connected to hardware target using JTAG UART on cable&lt;br /&gt;
nios2-terminal: &amp;quot;USB-Blaster [2-1.2]&amp;quot;, device 1, instance 0&lt;br /&gt;
nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate)&lt;br /&gt;
PWB Revision 1 Boot Loader&lt;br /&gt;
Ver 2.0  Build 357 - Wed Jun  6 15:05:35 PDT 2018&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flash boot loader firmware via jtag ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ /opt/intelFPGA/16.1/quartus/bin/jtagconfig&lt;br /&gt;
1) USB-Blaster [2-1.2]&lt;br /&gt;
  02B030DD   5CGTFD7(B5|C5|D5)/5CGXBC7B6/..&lt;br /&gt;
$ cd ~/online/firmware/pwb_rev1&lt;br /&gt;
$ ls -l&lt;br /&gt;
$ /opt/intelFPGA/17.1/quartus/bin/quartus_pgmw&lt;br /&gt;
... auto detect&lt;br /&gt;
... load the jic file&lt;br /&gt;
... in menu tools-&amp;gt;programmer, enable &amp;quot;unprotect device&amp;quot;&lt;br /&gt;
... start program/configure operation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flash user page firmware via esper-tool ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ cd online/src&lt;br /&gt;
$ more update_pwb.perl ### check that $fw is set to the desired firmware file&lt;br /&gt;
$ ./update_pwb.perl pwb06 ### or give more PWB names or give &amp;quot;all&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build firmware ==&lt;br /&gt;
&lt;br /&gt;
=== quartus version to use ===&lt;br /&gt;
&lt;br /&gt;
* quartus 16.1 should be used for jtag (jtagconfig and jtagd)&lt;br /&gt;
* quartus 17.0 should be used to build the PWB firmware (17.1 is not compatible)&lt;br /&gt;
&lt;br /&gt;
=== start license server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh agmini@daq16&lt;br /&gt;
/opt/intelFPGA/17.0/quartus/linux64/lmgrd -c ~agmini/online/license-daq16.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== prepare the build environment ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ /opt/intelFPGA/17.0/nios2eds/nios2_command_shell.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== get latest version of the code and build it ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd online/firmware/git/pwb_rev1_firmware&lt;br /&gt;
$ git pull&lt;br /&gt;
$ git checkout alphag&lt;br /&gt;
$ git pull&lt;br /&gt;
$ ./scripts/compile_project.sh&lt;br /&gt;
... about 30-40 minutes ...&lt;br /&gt;
$ ls -l bin/*.sof bin/*.jic bin/*.rpd&lt;br /&gt;
-rw-r--r-- 1 agmini alpha 12727389 Jan 24  2018 bin/feam_rev1_auto.rpd&lt;br /&gt;
-rw-r--r-- 1 agmini alpha 33554661 Jan 24  2018 bin/feam_rev1.jic&lt;br /&gt;
-rw-r--r-- 1 agmini alpha  6974754 Jan 24  2018 bin/rev1.sof&lt;br /&gt;
$ ### feam.jic is loaded via jtag&lt;br /&gt;
$ ### feam_auto.rpd is loaded via esper&lt;br /&gt;
$ ### feam.sof is used to attach the quartus signal tap logic analyzer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== firmware build order and sequence ===&lt;br /&gt;
&lt;br /&gt;
* erase previous build&lt;br /&gt;
* regenerate qsys&lt;br /&gt;
* regenerate NIOS BSP &amp;quot;feam_bootloader_bsp&amp;quot; and &amp;quot;feam_bsp&amp;quot;&lt;br /&gt;
* build NIOS projects &amp;quot;feam_bootloader&amp;quot; and &amp;quot;feam&amp;quot;&lt;br /&gt;
* build quartus sof file (with the &amp;quot;feam_bootloader&amp;quot; nios project inside)&lt;br /&gt;
* build jic and rpd files (with the quartus sof file and the &amp;quot;feam&amp;quot; nios project inside)&lt;br /&gt;
* load sof file into the FPGA using jtag (be careful about compatible &amp;quot;feam&amp;quot; nios project already in the epcq flash)&lt;br /&gt;
* load jic file into the epcq factory page using jtag (cycle power for them to take effect)&lt;br /&gt;
* load rpd file into the epcq factory or user page using esper&lt;br /&gt;
&lt;br /&gt;
=== scripts for building the firmware ===&lt;br /&gt;
&lt;br /&gt;
* scripts/compile_project.sh - build everything from scratch:&lt;br /&gt;
* scripts/compile_qsys.sh - regenerate the main qsys component&lt;br /&gt;
* scripts/compile_nios.sh - regenerate the BSPs, then same as compile_elf.sh&lt;br /&gt;
* scripts/compile_elf.sh - build the BSPs, &amp;quot;feam_bootloader&amp;quot; and &amp;quot;feam&amp;quot; NIOS projects&lt;br /&gt;
* scripts/update_elf.sh - regenerate the rpd and jic files to include the new &amp;quot;feam&amp;quot; NIOS build (keeps the old &amp;quot;feam_bootloader&amp;quot; in the sof file)&lt;br /&gt;
* scripts/update_bootloader.sh - also regenerate the sof file to include the new &amp;quot;feam_bootloader&amp;quot; build&lt;br /&gt;
* scripts/clean_quartus.sh - prepare quartus fpga sof file to build from scratch&lt;br /&gt;
* scripts/compile_quartus.sh - build the quartus fpga sof file incrementally (run clean_quartus.sh to build from scratch).&lt;br /&gt;
* scripts/load_jtag_sof.pl bin/rev1.sof - load sof file into the FPGA. this will boot the new fpga firmware, the new feam_bootloader (if update_bootloader.sh was run), but with the old &amp;quot;feam&amp;quot; already in epcq flash. (beware of incompatible sof, &amp;quot;feam_bootloader&amp;quot; and &amp;quot;feam&amp;quot; builds!)&lt;br /&gt;
* scripts/load_jtag_jic.pl bin/feam_rev1.jic - load jic file into the EPCQ flash, same as using the graphical flash programmer tool. (this will leave the FPGA running the quartus jtag flash loader firmware, not the PWB firmware. Cycle power for new jic file to take effect).&lt;br /&gt;
&lt;br /&gt;
== ESPER Variables ==&lt;br /&gt;
&lt;br /&gt;
* Board&lt;br /&gt;
** invert_ext_trig - invert trigger signal from CDM before it drives any logic (to undo incorrect signal polarity)&lt;br /&gt;
** reset_nios - goggle up, them down to reset NIOS subsystem&lt;br /&gt;
&lt;br /&gt;
* Signalproc&lt;br /&gt;
** test_mode - ADC data is replaced with a test pattern, see test mode bits in sca_x_ch_ctrl.&lt;br /&gt;
** sca_a_ch_ctrl, sca_b_ch_ctrl, sca_c_ch_ctrl, sca_d_ch_ctrl - channel control bits:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11..0 - threshold - channel suppression threshold&lt;br /&gt;
14..12 - ctrl_test_mode - test mode:&lt;br /&gt;
         0=fixed patter 0xa5a,&lt;br /&gt;
         1=time bin counter,&lt;br /&gt;
         2=time bin counter with channel number,&lt;br /&gt;
         3=sequential adc sample counter,&lt;br /&gt;
         4={ch_crossed_out,trig_pos,trig_neg,adc[8:0]},&lt;br /&gt;
         5={trig,adc[10:0]},&lt;br /&gt;
         6={ch_crossed_min,adc[10:0]}&lt;br /&gt;
15 - ctrl_supp_mode - channel suppression mode: 0=adc&amp;lt;=(baseline-threshold), 1=adc&amp;lt;=threshold&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Link&lt;br /&gt;
** link_ctrl - sata link control. The bits are:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 - sata_link_udp_stream_in_enable - permit data flow from sata link to OFFLOAD_SATA&lt;br /&gt;
1 - udp_stream_out_enable - permit sca data flow to sata link&lt;br /&gt;
2 - sata_to_eth_enable - permit ethernet data flow from sata link to TSE_MAC&lt;br /&gt;
3 - eth_to_sata_enable - permit ethernet data flow from TSE MAC to sata link&lt;br /&gt;
4 - enable_stop_our_tx - enable flow control: allow stop_tx&lt;br /&gt;
#5 - stop_our_tx - manually activate the flow control signal into link_tx&lt;br /&gt;
6 - enable_stop_remote_tx - enable flow control: allow send &amp;quot;stop_tx&amp;quot;&lt;br /&gt;
#7 - stop_remote_tx - manually activate the flow control signal into link_tx&lt;br /&gt;
8 - tx_test_pattern_udp - udp data is replaced by test pattern 0x11111111, 0x22222222, etc.&lt;br /&gt;
9 - tx_test_pattern_eth - nios-to-sata data is replaced by test pattern 0x11111111, 0x22222222, etc.&lt;br /&gt;
10 - udp_delay_enable - delay between udp packets, see udp_delay_value below&lt;br /&gt;
11 - reboot_tx - send K_REBOOT command to the sata link mate, where it has same effect as board/reset_nios.&lt;br /&gt;
12 - sata_to_nios_disable&lt;br /&gt;
13 - nios_to_sata_disable&lt;br /&gt;
14 - &lt;br /&gt;
15 - &lt;br /&gt;
16 -&lt;br /&gt;
24..31 - udp_delay_value - delay between udp packets (top 8 bits of a 20-bit counter)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firmware data path ==&lt;br /&gt;
&lt;br /&gt;
Main data path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feam_top&lt;br /&gt;
|&lt;br /&gt;
sca_sigproc&lt;br /&gt;
|&lt;br /&gt;
sca_event_control&lt;br /&gt;
4 * sca_control (sca_channel.sv)&lt;br /&gt;
4 * channel_fifo (1024 samples)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sca_control (sca_channel.sv)&lt;br /&gt;
|&lt;br /&gt;
state machine to control SCA read and write enables&lt;br /&gt;
|&lt;br /&gt;
sca_write_control (what does it do?!?)&lt;br /&gt;
sca_read_control&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sca_read_control&lt;br /&gt;
|&lt;br /&gt;
state machine to store ADC samples into per-channel FIFOs (channel_fifo)&lt;br /&gt;
selector to replace ADC samples with a test pattern&lt;br /&gt;
79*sca_trig_one -&amp;gt; ch_crossed_out - channel hit detector&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sca_event_control&lt;br /&gt;
|&lt;br /&gt;
event_fifo (hdl/mf/event_descriptor_fifo)&lt;br /&gt;
state machine to take ADC data from 4 per-channel FIFOs (channel_fifo) and store it into DDR memory (write addr increment is 510*8 (number of samples)*8 = 4080).&lt;br /&gt;
state machine to read transposed ADC data from DDR memory (read addr increment is 8+8=16 - 2 samples * 2 bytes * 4 sca = 16) and create 4 per-sca data streams&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data stream:&lt;br /&gt;
4 per-sca data streams from sca_event_control -&amp;gt; sca_sigproc(event_dat)&lt;br /&gt;
|&lt;br /&gt;
packet_chunker (hdl/lib/packet_chunker.sv) (4*event_dat -&amp;gt; event_segment_dat) - multiplex 4 data streams into 1 stream of UDP-sized packets&lt;br /&gt;
|&lt;br /&gt;
packet_length_prepender (hdl/lib/packet_length_prepender.sv)  (event_segment_dat -&amp;gt; udp_event_val_out)&lt;br /&gt;
|&lt;br /&gt;
udp_event_val -&amp;gt; info qsys (udp_stream_sca) and into sata link (mux channel 2).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firmware build instructions from Bryerton (obsolete) ==&lt;br /&gt;
&lt;br /&gt;
This is the old README.md file from the firmware git repository.&lt;br /&gt;
&lt;br /&gt;
These instructions are not used to build the firmware (use scrips/compile_project.sh).&lt;br /&gt;
&lt;br /&gt;
They are still useful for figuring out which buttons to push in the altera gui programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ALPHAg FrontEnd Acquisition Module (FEAM) - REV0&lt;br /&gt;
&lt;br /&gt;
Welcome to the ALPHAg FEAM Project &lt;br /&gt;
&lt;br /&gt;
# Table of Contents&lt;br /&gt;
&lt;br /&gt;
* [Overview](#overview)&lt;br /&gt;
* [Inital Setup](#initial-setup)&lt;br /&gt;
    * [Quartus Setup](#quartus-setup)&lt;br /&gt;
        * [Create the .cdf](#create-the-cdf)&lt;br /&gt;
    * [NIOS Setup](#nios-Setup)&lt;br /&gt;
        * [Create the project files](#create-the-project-files) &lt;br /&gt;
* [Build Instructions](#build-instructions)&lt;br /&gt;
    * [Building from Quartus GUI](#building-from-quartus-gui)&lt;br /&gt;
        * [Generate the QSys File](#generate-the-qsys-file)&lt;br /&gt;
        * [Compile the NIOSII Project](#compile-the-niosii-project)&lt;br /&gt;
        * [Compile the Quartus Project](#compile-the-quartus-project)&lt;br /&gt;
    * [Building from Scripts](#building-from-scripts)&lt;br /&gt;
    * [Installing from JTAG](#installing-from-jtag)&lt;br /&gt;
    * [Installing from ESPER](#installing-from-esper)&lt;br /&gt;
&lt;br /&gt;
# Overview&lt;br /&gt;
&lt;br /&gt;
The FEAM is a digitizer located on the ALPHAg detector. Each FEAM consists of 4 AFTER SCAs for a total of 288 channels.&lt;br /&gt;
&lt;br /&gt;
# Initial Setup&lt;br /&gt;
&lt;br /&gt;
## Quartus Setup&lt;br /&gt;
&lt;br /&gt;
### Create the .cdf&lt;br /&gt;
1. Open Quartus Prime Standard Edition&lt;br /&gt;
2. Click on **Tools -&amp;gt; Programmer**. The **Programmer** window will appear&lt;br /&gt;
3. In the **Programmer** window, click **Auto Detect**. A **Select Device** dialog box will appear&lt;br /&gt;
    1. (Optional) If **Auto Detect** is greyed out, click on **Hardware Setup**. The **Hardware Setup** dialog box will appear&lt;br /&gt;
    2. Under **Hardware Settings**, double-click on the USB JTAG hardware you wish to use&lt;br /&gt;
    3. Click **Close**. The **Hardware Setup** dialog box will close&lt;br /&gt;
5. Click on **File -&amp;gt; Save As**. The **Save As** dialog box will appear&lt;br /&gt;
6. In the **Save As** dialog box, browse to the **/\&amp;lt;project_dir\&amp;gt;/bin/** directory&lt;br /&gt;
7. Make sure the **Add file to current project** checkbox is checked&lt;br /&gt;
7. In the **File name** input box, type &amp;quot;alphag_feam.cdf&amp;quot; and click **Save**&lt;br /&gt;
8. Close the **Programmer** window&lt;br /&gt;
9. Done!&lt;br /&gt;
&lt;br /&gt;
## NIOS Setup&lt;br /&gt;
&lt;br /&gt;
### Create the project files&lt;br /&gt;
1. Open Quartus Prime Standard Edition&lt;br /&gt;
2. Open the NIOS II Software Build Tools by clicking **Tools -&amp;gt; NIOS II Software Build Tools for Eclipse**&lt;br /&gt;
3. The **Workspace Launcher** window will appear, click *OK* to accept the default workspace.&lt;br /&gt;
4. Click **File -&amp;gt; Import...**. The **Import** dialog box will appear&lt;br /&gt;
5. Click on **General -&amp;gt; Existing Projects into Workspace**&lt;br /&gt;
6. Click **Next \&amp;gt;**&lt;br /&gt;
7. Next to **Select root directory** click **Browse...**. A **Browse for Folder** dialog box will appear&lt;br /&gt;
8. Browse to **/\&amp;lt;project_dir\&amp;gt;/hdl/software** and click **OK**&lt;br /&gt;
8. Four Projects should appear in the **Projects** panel: &lt;br /&gt;
    * alphag_feam&lt;br /&gt;
    * alphag\_feam\_bsp &lt;br /&gt;
    * alphag\_feam\_bootloader&lt;br /&gt;
    * alphag\_feam\_bootloader\_bsp&lt;br /&gt;
9. Click **Select All**&lt;br /&gt;
10. Click **Finish**&lt;br /&gt;
11. Done!&lt;br /&gt;
 &lt;br /&gt;
# Build Instructions&lt;br /&gt;
&lt;br /&gt;
## Building from Quartus GUI&lt;br /&gt;
&lt;br /&gt;
**Warning: Please use Quartus Prime Standard Edition 16.1**&lt;br /&gt;
### Generate the QSys File&lt;br /&gt;
1. Open Quartus Standard Edition 16.1&lt;br /&gt;
1. Open QSys by clicking **Tools -&amp;gt; QSys**&lt;br /&gt;
2. Click on **File -&amp;gt; Open** (CTRL+O). An **Open File** dialog box should appear.&lt;br /&gt;
3. Select the **alphag_feam.qsys** file from the **/\&amp;lt;project_dir\&amp;gt;/hdl** directory and click **Open**&lt;br /&gt;
4. Modify as necessary. NOTE: Any change to the QSys, even cosmetic such as expanding or collapsing components will cause the QSys to desire a re-generate. &lt;br /&gt;
5. Click **File -&amp;gt; Save** (CTRL+S)&lt;br /&gt;
6. Click **Generate HDL**. A **Generation** dialog box will appear &lt;br /&gt;
7. Select the settings you desire to be changed, if any&lt;br /&gt;
8. Click **Generate**&lt;br /&gt;
9. Wait for the generation to complete.&lt;br /&gt;
10. Done!&lt;br /&gt;
&lt;br /&gt;
### Compile the NIOSII Project&lt;br /&gt;
1. Open the NIOS II Software Build Tools by clicking **Tools -&amp;gt; NIOS II Software Build Tools for Eclipse**&lt;br /&gt;
2. (Optional) If the QSys file has been re-generated performing the following&lt;br /&gt;
    1. Right-click on **alphag\_feam\_bsp** and select **NIOS II -&amp;gt; Generate BSP**. The BSP will regenerate&lt;br /&gt;
    2. Right-click on **alphag\_feam\_bootloader\_bsp** and select **NIOS II -&amp;gt; Generate BSP**. The BSP will regenerate&lt;br /&gt;
3. Modify files as needed. WARNING: Do not modify any BSP files by hand! All changes will be lost on next generate.&lt;br /&gt;
4. Click **Project -&amp;gt; Build All** (CTRL+B). If your workspace as multiple projects, it is recommend to close all but the ones related to the FEAM.&lt;br /&gt;
5. Right-click on **alphag\_feam\_bootloader** and select **Make Targets -&amp;gt; Build...**. The **Make Targets** dialog box will appear&lt;br /&gt;
6. In the **Make Targets** dialog box, select **mem\_init\_generate** and click **Build**&lt;br /&gt;
7. Done!&lt;br /&gt;
&lt;br /&gt;
### Compile the Quartus Project&lt;br /&gt;
1. Open Quartus Standard Edition 16.1&lt;br /&gt;
1. Under **Processing** click **Start Compilation** (CTRL+L)&lt;br /&gt;
2. Wait about 16-30 minutes.&lt;br /&gt;
3. Done!&lt;br /&gt;
  &lt;br /&gt;
**Note:** If Quartus crashed while compiling, delete the **\&amp;lt;project_dir\&amp;gt;/hdl/db** and **\&amp;lt;project_dir\&amp;gt;/hdl/incremental_db** directories and try again&lt;br /&gt;
  &lt;br /&gt;
## Installing from JTAG&lt;br /&gt;
1. Generate the .jic file using the provided /bin/alphag\_feam\_jic.cof&lt;br /&gt;
    1. In the main Quartus window, click **File -&amp;gt; Convert Programming Files**, A **Convert Programming Files** window will appear&lt;br /&gt;
    2. In the **Convert Programming Files** window, click **Open Conversion Setup Data**. An **Open** dialog box will appear&lt;br /&gt;
    3. In the **Open** dialog box, select the **alphag_feam.cof** file located in **/bin/**&lt;br /&gt;
    4. Click **Open**. The **Open dialog box will close&lt;br /&gt;
        * Note the **File name** field, it should display /\&amp;lt;project\_dir\&amp;gt;/bin/alphag\_feam.jic&lt;br /&gt;
    5. In the **Convert Programming Files** window, click **Generate**&lt;br /&gt;
    6. When the .jic is done being generated, a small dialog box will appear, click **OK**&lt;br /&gt;
    7. In the **Convert Programming Files** window, click **Close**&lt;br /&gt;
2. Load the .JIC file using the Programmer&lt;br /&gt;
    1. In the main Quartus window in the **Project Navigator** drop-down input select **Files**.&lt;br /&gt;
    2. Scroll down the window and find the **alphag_feam.cdf**, and double-click it. The **Programmer** window will open&lt;br /&gt;
    3. Click on the icon labelled **5CGXFC4C6**&lt;br /&gt;
    4. Click on the **Change File** button. The **Select New Programming File** dialog box will appear&lt;br /&gt;
    5. Browse to **/\&amp;lt;project_dir\&amp;gt;/bin/** and select **alphag\_feam.jic**&lt;br /&gt;
    6. Click Open. The **Select New Programming File** dialog box will close&lt;br /&gt;
    7. In the main panel, check the **Program/Configure** box on the line that starts **./bin/alphag\_feam.jic**&lt;br /&gt;
    8. Click the **Start** button&lt;br /&gt;
    9. Wait for the **Progress** bar to go to 100% and stop&lt;br /&gt;
    10. Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Internal test pulser =&lt;br /&gt;
&lt;br /&gt;
Documentation from Bryerton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---------- Forwarded message ---------&lt;br /&gt;
From: Bryerton Shaw &amp;lt;bryerton@triumf.ca&amp;gt;&lt;br /&gt;
Date: Tue, 24 Apr 2018 at 16:18&lt;br /&gt;
Subject: RE: PWB/FEAM internal test pulse&lt;br /&gt;
To: Lars Martin &amp;lt;lmartin@triumf.ca&amp;gt;&lt;br /&gt;
Cc: Andrea Capra &amp;lt;acapra@triumf.ca&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi Lars (and Andrea),&lt;br /&gt;
&lt;br /&gt;
In the new(er) firmware the test pulse code has been modified slightly to&lt;br /&gt;
fit in better with the upgraded trigger system. I can add an option to&lt;br /&gt;
allow it to be triggered by the external trigger (currently it has an&lt;br /&gt;
interval option, or you can hit the manual trigger to fire it, if it’s&lt;br /&gt;
enabled)&lt;br /&gt;
&lt;br /&gt;
The *options for the test pulser* are under the *signalproc module*:&lt;br /&gt;
&lt;br /&gt;
*test_pulse_ena*&lt;br /&gt;
&lt;br /&gt;
An array of four booleans, that control turning on the test pulse for each&lt;br /&gt;
SCA. If this is False, the other options below will do nothings for that SCA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_interval_ena*&lt;br /&gt;
&lt;br /&gt;
An array of four booleans, that control turning on the interval trigger for&lt;br /&gt;
each SCA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_interval*&lt;br /&gt;
&lt;br /&gt;
An unsigned 32-bit value that marks how many 16ns clock cycles occur&lt;br /&gt;
between interval triggers. Only one value, as there is only one interval&lt;br /&gt;
timer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_wdt*&lt;br /&gt;
&lt;br /&gt;
An array of four 16-bit unsigned integers that control the width of the&lt;br /&gt;
pulse for each SCA when the trigger occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, there is a second set of options to control the delay of the *test&lt;br /&gt;
pulse interval trigger*. These options are located under the *trigger&lt;br /&gt;
module*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*intp_trig_ena*&lt;br /&gt;
&lt;br /&gt;
Boolean value enabling/disabling the interval test pulse trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*intp_trig_delay*&lt;br /&gt;
&lt;br /&gt;
Unsigned 32-bit integer controlling the trigger delay, which is the time&lt;br /&gt;
between when the trigger is requested, and when the trigger actually fires.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can setup the interval trigger and use that to create event packets&lt;br /&gt;
with the test pulse on set intervals. If the interval trigger is&lt;br /&gt;
insufficient, I can create another option, which is to fire the test pulse&lt;br /&gt;
for enabled SCAs when the external trigger goes. If so, I’ll add this&lt;br /&gt;
option in the *signalproc *module for you:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_on_ext*&lt;br /&gt;
&lt;br /&gt;
An array of four Booleans, that control if the test pulse for that SCA&lt;br /&gt;
fires on external trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember, in order to use the SCA test pulse at all, you must also set the&lt;br /&gt;
SCA to test mode. You can do this by going into the *sca0-3 modules* and&lt;br /&gt;
setting *test* to *functionality *(the value is *3* if you want to set it&lt;br /&gt;
via esper-tool)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Btw currently the SCAs are hard-coded to have all 72 channels receive the&lt;br /&gt;
test pulse on firing, and the option to de-select/select which channels to&lt;br /&gt;
fire is not offered. Would you like this ability? And if so do you want it&lt;br /&gt;
to set all four SCAs the same, or have an option for all 288 channels?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The waveform viewer on the webpage was removed for technical reasons, and&lt;br /&gt;
so all viewing is done via the MIDAS DAQ. There are some preliminary tools&lt;br /&gt;
I’ve created to verify the event packets and their waveforms, but I&lt;br /&gt;
wouldn’t call them easy to setup or use at the moment. (Or very  useful for&lt;br /&gt;
fine comparisons). If KO doesn’t have a way of saving the events to disk, I&lt;br /&gt;
could deliver something that captured and saved waveforms quite quickly.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Bryerton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*From:* Lars Martin&lt;br /&gt;
*Sent:* April 23, 2018 5:10 PM&lt;br /&gt;
*To:* Bryerton Shaw &amp;lt;bryerton@triumf.ca&amp;gt;&lt;br /&gt;
*Cc:* Andrea Capra &amp;lt;acapra@triumf.ca&amp;gt;&lt;br /&gt;
*Subject:* PWB/FEAM internal test pulse&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi Bryerton,&lt;br /&gt;
&lt;br /&gt;
Andrea and I would like to check the response function of the PWBs. For&lt;br /&gt;
that Daryl suggested to first look at the internal test pulse.&lt;br /&gt;
&lt;br /&gt;
Can you point us to what settings are required to make that go? And to use&lt;br /&gt;
the external trigger if we want to acquire the data?&lt;br /&gt;
&lt;br /&gt;
Ideally we would acquire Midas data from that, but it&#039;s unclear if KO&#039;s&lt;br /&gt;
frontend allows for that right now. Can we access the data with Esper&lt;br /&gt;
instead?&lt;br /&gt;
&lt;br /&gt;
Finally, we haven&#039;t had the waveform display on the web page for a while,&lt;br /&gt;
but Daryl said you guys use it. Are we using a different page somehow?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hope all is well with the baby, cheers,&lt;br /&gt;
&lt;br /&gt;
Lars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= TODO =&lt;br /&gt;
&lt;br /&gt;
* IMPOSSIBLE (ext clock only connected to clock cleaner) add frequency counter for the external clock (62.5 MHz)&lt;br /&gt;
* DONE add random delay before memtest&lt;br /&gt;
* DONE add 4 more bits to udp_delay&lt;br /&gt;
* DONE fix crash on boot if run is active and triggers arrive (check that trigger is off on boot) (do not set trigger/enable_all, ext_trig_ena, inp_trig_ena, signal_proc/force_run to 1 after boot)&lt;br /&gt;
* DONE (kludge jtag uart write()) increase size of jtag uart output buffer, make it unlimited if possible.&lt;br /&gt;
* DONE (kludge jtag uart write()) on dhcp timeout, reboot the fpga - reboot of nios does not clear the jtag uart, which becomes full and nios stops.&lt;br /&gt;
* DONE add NIOS watchdog timeout for fectrl&lt;br /&gt;
* DONE do not use external clock until instructed by fectrl (clock cleaner default is pin select mode, default pin mode is input with pull down, so clock 0 is selected, this is the ext clock. but we can drive clock select pins from the fpga).&lt;br /&gt;
* DONE change clock cleaner power up: use the 2 lines status_clkin0 and status_clkin1 to tell clock cleaner to use the internal clock (clkin2) - from the FPGA drive first line low, second line high. Also change all NIOS code that programs the clock cleaner to keep these two lines in the &amp;quot;input&amp;quot; mode. Current code switches them to &amp;quot;output&amp;quot; mode.&lt;br /&gt;
* DONE clock cleaner power up state is wrong for both choices of clock: 62.5 MHz ext clock and 125 MHz internal clock, see explanation in feam_top.sv. It looks like I need to drive status_clkin0 and status_clkin1 to &amp;quot;holdover&amp;quot; mode, both logic level 1. Currently status_clkin0 is used as SPI read line, this has to be moved to a different line first.&lt;br /&gt;
* add watchdog timeout that works in factory mode (&amp;quot;remote update&amp;quot; watchdog only works in user mode)&lt;br /&gt;
* enable HTTP pipelining - copy changes on mongoose from ADC project.&lt;br /&gt;
* reset everything if it looks like NIOS TCP/IP code has crashed, but enough code is still running to prevent tripping of the fpga-remote-update watchdog timer. such crash tends to happens when the sata link mate is rebooted and incomplete data arrives from the disrupted ethernet data path.&lt;br /&gt;
* when loading AFTER ASIC do not go into infinite loop if read-back is broken (always mismatch).&lt;br /&gt;
* read and report error status information bits for 2983fc.pdf&lt;br /&gt;
&lt;br /&gt;
= ZZZ =&lt;br /&gt;
&lt;br /&gt;
ZZZ&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=PWB&amp;diff=796</id>
		<title>PWB</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=PWB&amp;diff=796"/>
		<updated>2021-08-03T05:06:42Z</updated>

		<summary type="html">&lt;p&gt;Acapra: /* Hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Links =&lt;br /&gt;
&lt;br /&gt;
* https://bitbucket.org/expalpha/pwb_rev1_firmware&lt;br /&gt;
* https://edev-group.triumf.ca/fw/exp/alphag/feam/rev1&lt;br /&gt;
* https://edev-group.triumf.ca/hw/alphag/feam/rev1&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/170 - PWB inventory database&lt;br /&gt;
&lt;br /&gt;
= Schematics =&lt;br /&gt;
&lt;br /&gt;
* [[Image:pwb_rev0.pdf]]&lt;br /&gt;
* [[Image:Pwb-rev1-after.pdf]]&lt;br /&gt;
* [[Image:AlphaG Rev1.pdf]]&lt;br /&gt;
&lt;br /&gt;
= Manuals =&lt;br /&gt;
&lt;br /&gt;
* [[Image:AFTER_MANUAL_V1.pdf]] AFTER SCA manual v1&lt;br /&gt;
* [[Image:AFTER_DataSheet1_1.pdf]] AFTER SCA manual v1.1&lt;br /&gt;
* [[Image:AFTER_SCA_table2.pdf]] AFTER SCA channel map&lt;br /&gt;
&lt;br /&gt;
= Hardware =&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
External power supply is:&lt;br /&gt;
* +5V&lt;br /&gt;
* +2V&lt;br /&gt;
&lt;br /&gt;
Central board:&lt;br /&gt;
&lt;br /&gt;
* Ext_5V - F1 - RS1 (0.1R) - Fuse_5V&lt;br /&gt;
* Ext_2V - F2/F3 - RS2 (0.1R) - Idig2-&lt;br /&gt;
* LDO3 - Fuse_5V - DIG_3.3V - selfenable - ADM7154&lt;br /&gt;
* LDO5 - Fuse_5V - DIG_2.5V - selfenable - ADM7154&lt;br /&gt;
* LDO_CLN - Fuse5V - CLN_3.3V - selfenable - &lt;br /&gt;
* VREG - DIG_3.3V - -2.5V SCA BIAS - selfenable - LTC1983ES6-3#TRMPBF&lt;br /&gt;
* LDO7 - DIG_2.5V - DDR3_VRef - enable DDR3_1P5V, DDR3_PG, DDR3_VttEN&lt;br /&gt;
* LDO2 - Idig2V- - DIG_1.1V - enable DIG_3.3V - LT3071&lt;br /&gt;
* LDO6 - Idig2V- - DDR3_1P5V - enable DIG_3.3V - LT3083&lt;br /&gt;
&lt;br /&gt;
SCA Wing:&lt;br /&gt;
&lt;br /&gt;
* Ext_5V - F1 - RS1 (0.3R) - Isca- - SCA_Fuse5V&lt;br /&gt;
* LDO1 - SCA_Fuse5V - SCA3.3V - enable ADC_PWR_EN - ADM7154&lt;br /&gt;
* LDO2 - SCA3.3V - ADC1.8V - selfenable - ADM7154&lt;br /&gt;
* LDO3 - SCA3.3V - TRN2.5V - selfenable - LT1761&lt;br /&gt;
* REF - SCA3.3V - 1.45V Vicm - selfenable - LM4121&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Trigger and Clock distribution ==&lt;br /&gt;
&lt;br /&gt;
Clock (62.5MHz) and trigger are distributed to the PWB columns via the [https://edev-group.triumf.ca/hw/alphag/trigger-card-sata-adapter/rev1 trigger SATA adapter].&lt;br /&gt;
&lt;br /&gt;
The two miniSAS cables from cdm03 port 5 and 6 are connected to a miniSAS-SATA splitter 1-to-4 (CS Electronics &amp;quot;iSAS SATA adapter&amp;quot; ADP-887P-1X). Since there are only 8 columns and the clock and trigger signals are daisy-chained across the 8 rows, this scheme is sufficient to provide the necessary inputs to all 64 PWBs.&lt;br /&gt;
&lt;br /&gt;
[https://www.techcable.com/sas-mini-sas-cables/sata-cables/ SATA 6Gb/s Cable with Latching Clip. Straight Pinout 1-1 247726-L  40in]&lt;br /&gt;
&lt;br /&gt;
== Optical Link ==&lt;br /&gt;
&lt;br /&gt;
Main data uplink.&lt;br /&gt;
&lt;br /&gt;
[[File:AVAGO SFP specs.pdf|SFP (Small Form Pluggable) Avago Technologies AFBR-57M5APZ]]&lt;br /&gt;
&lt;br /&gt;
[[File:FiberOptic TrippLite specs.pdf|Fiber optic Tripp Lite N820 - 10 m]]&lt;br /&gt;
&lt;br /&gt;
== SATA Link ==&lt;br /&gt;
&lt;br /&gt;
Secondary data uplink, capable also to deliver clock and trigger.&lt;br /&gt;
The SATA link connects PWB from adjacent columuns on the same row.&lt;br /&gt;
The SATA cable is a &amp;quot;crossed cable&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Firmware =&lt;br /&gt;
&lt;br /&gt;
== Firmware update ==&lt;br /&gt;
&lt;br /&gt;
PWB firmware update is done using &amp;quot;esper-tool&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
esper-tool -v upload -f file.rpd http://pwbNN update factory_rpd&lt;br /&gt;
esper-tool -v upload -f file.rpd http://pwbNN update file_rpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of PWB firmware pwb_rev1_20200706_ko:&lt;br /&gt;
&lt;br /&gt;
Permission to write into the flash memory is controlled by esper variables:&lt;br /&gt;
&lt;br /&gt;
* allow_write set to &amp;quot;false&amp;quot;: &amp;quot;esper-tool upload&amp;quot; does a &amp;quot;verify&amp;quot;: successful upload means epcq flash content is same as rpd file, error means content is not the same.&lt;br /&gt;
* allow_write set to &amp;quot;true&amp;quot;: &amp;quot;esper-tool upload&amp;quot; updates the epcq flash from the rpd file: for each data block, read the epcq flash, compare to rpd data, if different, erase the flash block, write the flash, read the flash, if there is a mismatch (bad write), return an error.&lt;br /&gt;
* allow_factory_write set to &amp;quot;true&amp;quot; to enable writing to the &amp;quot;factory_rpd&amp;quot;. DO NOT SET IT TO &amp;quot;true&amp;quot; UNLESS YOU MEAN TO UPDATE THE PWB BOOTLOADER. IF YOU FLASH BUM FIRMWARE or IF THERE IS A POWER OUTAGE WHILE UPDATING, THE PWB WILL BE BRICKED and has to be recovered by connecting a USB blaster.&lt;br /&gt;
&lt;br /&gt;
To update firmware of multiple boards to correct version, recommended is the script &amp;quot;update_pwb.perl&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/online/src&lt;br /&gt;
./update_pwb.perl pwb12 pwb06 pwb78&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Factory page and user page firmware boot ==&lt;br /&gt;
&lt;br /&gt;
Each PWB board has 2 firmware images: boot loader (factory page)&lt;br /&gt;
and data acquisition (user page). On power up, the FPGA loads and runs&lt;br /&gt;
the boot loader firmware from the factory page, later the control&lt;br /&gt;
software reboots the FPGA into the data acquisition firmware from&lt;br /&gt;
the user page.&lt;br /&gt;
&lt;br /&gt;
Because loading defective firmware can brick https://en.wikipedia.org/wiki/Brick_(electronics)&lt;br /&gt;
the PWB, new firmware images are loaded into the user page, if anything is wrong,&lt;br /&gt;
the PWB can still boot from the factory page and one can use the firmware update&lt;br /&gt;
function to load a good firmware image into the user page.&lt;br /&gt;
&lt;br /&gt;
The boot loader firmware in the factory page is not intended for data acquisition, it is only meant to provide three functions:&lt;br /&gt;
* boot enough hardware and software to communicate via the ethernet and the sata link&lt;br /&gt;
* firmware update (both factory page and user page)&lt;br /&gt;
* reboot into the user page&lt;br /&gt;
&lt;br /&gt;
The boot loader firmware in the factory page is usually never updated unless absolutely&lt;br /&gt;
needed to fix a problem with these three functions (i.e. compatibility with sata link communications).&lt;br /&gt;
&lt;br /&gt;
If factory image is corrupted or the contains defective firmware and the PWB does not boot (no dhcp, no ping, no esper),&lt;br /&gt;
the only way to unbrick it is by loading good firmware using a jtag flash programmer (usb-blaster). Connecting it requires&lt;br /&gt;
physical access to the jtag connector on the PWB board. It is impossible when the detector is fully assembled in the experiment.&lt;br /&gt;
&lt;br /&gt;
The PWB has a 32 Mbyte EPCQ flash memory chip, it is divided into 2 pages 16 Mbytes of factory page and 16 Mbytes of user page.&lt;br /&gt;
&lt;br /&gt;
A complete firmware image generally contains 3 pieces:&lt;br /&gt;
* FPGA firmware and NIOS &amp;quot;feam_bootloader&amp;quot; software RAM image (sof file)&lt;br /&gt;
* NIOS &amp;quot;feam&amp;quot; software RAM image (feam.elf.flash.hex) - all the C code for esper communications and PWB data acquisition&lt;br /&gt;
* NIOS filesystem image (feam.webpkg.hex) - esper web pages&lt;br /&gt;
&lt;br /&gt;
This is the boot sequence:&lt;br /&gt;
* on power-up the FPGA automatically loads the sof file from address 0 of the EPCQ flash (this is the factory image sof file)&lt;br /&gt;
* the FPGA is &amp;quot;started&amp;quot;&lt;br /&gt;
* the NIOS CPU starts executing the &amp;quot;feam_bootloader&amp;quot; C code embedded in the sof file (NIOS project hdl/software/feam_bootloader)&lt;br /&gt;
* feam_bootloader initializes the hardware (clocks, DDR memory, etc)&lt;br /&gt;
* feam_bootloader write-protects the EPCQ flash memory&lt;br /&gt;
* feam_bootloader copies the &amp;quot;feam&amp;quot; software from EPCQ flash to the DDR memory (after checking for correct checkum)&lt;br /&gt;
* feam_bootloader restarts the NIOS CPU&lt;br /&gt;
* the NIOS CPU starts running from DDR memory, executes the &amp;quot;feam&amp;quot; software (NIOS project hdl/software/feam)&lt;br /&gt;
* call main() in hdl/software/feam/src/task_init.c&lt;br /&gt;
* call task_init() in the same file&lt;br /&gt;
* infinite loop waiting for IP address via DHCP&lt;br /&gt;
* after have IP address, call task_esper() from hdl/software/feam/src/task_esper.c&lt;br /&gt;
* task_esper() creates all the esper modules, esper variables, etc,&lt;br /&gt;
* mod_http.c starts the mongoose web server&lt;br /&gt;
* PWB is open for business&lt;br /&gt;
&lt;br /&gt;
This is the protection against booting corrupted firmware:&lt;br /&gt;
* FPGA hardware loads the sof file from epcq flash and checks for correct checksum before &amp;quot;starting&amp;quot; it&lt;br /&gt;
* NIOS CPU is part of the sof file, protected by sof file checksum&lt;br /&gt;
* NIOS feam_bootloader C code is part of the sof file, protected by the sof checksum&lt;br /&gt;
* feam_bootloader checks for correct signatures and checksums of the DDR memory image&lt;br /&gt;
* &amp;quot;feam&amp;quot; C code is protected by the checksum of the DDR memory image&lt;br /&gt;
&lt;br /&gt;
== NIOS terminal ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ /opt/intelFPGA/16.1/quartus/bin/jtagconfig&lt;br /&gt;
1) USB-Blaster [2-1.2]&lt;br /&gt;
  02B030DD   5CGTFD7(B5|C5|D5)/5CGXBC7B6/..&lt;br /&gt;
$ /opt/intelFPGA/17.0/quartus/bin/nios2-terminal&lt;br /&gt;
nios2-terminal: connected to hardware target using JTAG UART on cable&lt;br /&gt;
nios2-terminal: &amp;quot;USB-Blaster [2-1.2]&amp;quot;, device 1, instance 0&lt;br /&gt;
nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate)&lt;br /&gt;
PWB Revision 1 Boot Loader&lt;br /&gt;
Ver 2.0  Build 357 - Wed Jun  6 15:05:35 PDT 2018&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flash boot loader firmware via jtag ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ /opt/intelFPGA/16.1/quartus/bin/jtagconfig&lt;br /&gt;
1) USB-Blaster [2-1.2]&lt;br /&gt;
  02B030DD   5CGTFD7(B5|C5|D5)/5CGXBC7B6/..&lt;br /&gt;
$ cd ~/online/firmware/pwb_rev1&lt;br /&gt;
$ ls -l&lt;br /&gt;
$ /opt/intelFPGA/17.1/quartus/bin/quartus_pgmw&lt;br /&gt;
... auto detect&lt;br /&gt;
... load the jic file&lt;br /&gt;
... in menu tools-&amp;gt;programmer, enable &amp;quot;unprotect device&amp;quot;&lt;br /&gt;
... start program/configure operation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flash user page firmware via esper-tool ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ cd online/src&lt;br /&gt;
$ more update_pwb.perl ### check that $fw is set to the desired firmware file&lt;br /&gt;
$ ./update_pwb.perl pwb06 ### or give more PWB names or give &amp;quot;all&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build firmware ==&lt;br /&gt;
&lt;br /&gt;
=== quartus version to use ===&lt;br /&gt;
&lt;br /&gt;
* quartus 16.1 should be used for jtag (jtagconfig and jtagd)&lt;br /&gt;
* quartus 17.0 should be used to build the PWB firmware (17.1 is not compatible)&lt;br /&gt;
&lt;br /&gt;
=== start license server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh agmini@daq16&lt;br /&gt;
/opt/intelFPGA/17.0/quartus/linux64/lmgrd -c ~agmini/online/license-daq16.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== prepare the build environment ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ /opt/intelFPGA/17.0/nios2eds/nios2_command_shell.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== get latest version of the code and build it ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd online/firmware/git/pwb_rev1_firmware&lt;br /&gt;
$ git pull&lt;br /&gt;
$ git checkout alphag&lt;br /&gt;
$ git pull&lt;br /&gt;
$ ./scripts/compile_project.sh&lt;br /&gt;
... about 30-40 minutes ...&lt;br /&gt;
$ ls -l bin/*.sof bin/*.jic bin/*.rpd&lt;br /&gt;
-rw-r--r-- 1 agmini alpha 12727389 Jan 24  2018 bin/feam_rev1_auto.rpd&lt;br /&gt;
-rw-r--r-- 1 agmini alpha 33554661 Jan 24  2018 bin/feam_rev1.jic&lt;br /&gt;
-rw-r--r-- 1 agmini alpha  6974754 Jan 24  2018 bin/rev1.sof&lt;br /&gt;
$ ### feam.jic is loaded via jtag&lt;br /&gt;
$ ### feam_auto.rpd is loaded via esper&lt;br /&gt;
$ ### feam.sof is used to attach the quartus signal tap logic analyzer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== firmware build order and sequence ===&lt;br /&gt;
&lt;br /&gt;
* erase previous build&lt;br /&gt;
* regenerate qsys&lt;br /&gt;
* regenerate NIOS BSP &amp;quot;feam_bootloader_bsp&amp;quot; and &amp;quot;feam_bsp&amp;quot;&lt;br /&gt;
* build NIOS projects &amp;quot;feam_bootloader&amp;quot; and &amp;quot;feam&amp;quot;&lt;br /&gt;
* build quartus sof file (with the &amp;quot;feam_bootloader&amp;quot; nios project inside)&lt;br /&gt;
* build jic and rpd files (with the quartus sof file and the &amp;quot;feam&amp;quot; nios project inside)&lt;br /&gt;
* load sof file into the FPGA using jtag (be careful about compatible &amp;quot;feam&amp;quot; nios project already in the epcq flash)&lt;br /&gt;
* load jic file into the epcq factory page using jtag (cycle power for them to take effect)&lt;br /&gt;
* load rpd file into the epcq factory or user page using esper&lt;br /&gt;
&lt;br /&gt;
=== scripts for building the firmware ===&lt;br /&gt;
&lt;br /&gt;
* scripts/compile_project.sh - build everything from scratch:&lt;br /&gt;
* scripts/compile_qsys.sh - regenerate the main qsys component&lt;br /&gt;
* scripts/compile_nios.sh - regenerate the BSPs, then same as compile_elf.sh&lt;br /&gt;
* scripts/compile_elf.sh - build the BSPs, &amp;quot;feam_bootloader&amp;quot; and &amp;quot;feam&amp;quot; NIOS projects&lt;br /&gt;
* scripts/update_elf.sh - regenerate the rpd and jic files to include the new &amp;quot;feam&amp;quot; NIOS build (keeps the old &amp;quot;feam_bootloader&amp;quot; in the sof file)&lt;br /&gt;
* scripts/update_bootloader.sh - also regenerate the sof file to include the new &amp;quot;feam_bootloader&amp;quot; build&lt;br /&gt;
* scripts/clean_quartus.sh - prepare quartus fpga sof file to build from scratch&lt;br /&gt;
* scripts/compile_quartus.sh - build the quartus fpga sof file incrementally (run clean_quartus.sh to build from scratch).&lt;br /&gt;
* scripts/load_jtag_sof.pl bin/rev1.sof - load sof file into the FPGA. this will boot the new fpga firmware, the new feam_bootloader (if update_bootloader.sh was run), but with the old &amp;quot;feam&amp;quot; already in epcq flash. (beware of incompatible sof, &amp;quot;feam_bootloader&amp;quot; and &amp;quot;feam&amp;quot; builds!)&lt;br /&gt;
* scripts/load_jtag_jic.pl bin/feam_rev1.jic - load jic file into the EPCQ flash, same as using the graphical flash programmer tool. (this will leave the FPGA running the quartus jtag flash loader firmware, not the PWB firmware. Cycle power for new jic file to take effect).&lt;br /&gt;
&lt;br /&gt;
== ESPER Variables ==&lt;br /&gt;
&lt;br /&gt;
* Board&lt;br /&gt;
** invert_ext_trig - invert trigger signal from CDM before it drives any logic (to undo incorrect signal polarity)&lt;br /&gt;
** reset_nios - goggle up, them down to reset NIOS subsystem&lt;br /&gt;
&lt;br /&gt;
* Signalproc&lt;br /&gt;
** test_mode - ADC data is replaced with a test pattern, see test mode bits in sca_x_ch_ctrl.&lt;br /&gt;
** sca_a_ch_ctrl, sca_b_ch_ctrl, sca_c_ch_ctrl, sca_d_ch_ctrl - channel control bits:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11..0 - threshold - channel suppression threshold&lt;br /&gt;
14..12 - ctrl_test_mode - test mode:&lt;br /&gt;
         0=fixed patter 0xa5a,&lt;br /&gt;
         1=time bin counter,&lt;br /&gt;
         2=time bin counter with channel number,&lt;br /&gt;
         3=sequential adc sample counter,&lt;br /&gt;
         4={ch_crossed_out,trig_pos,trig_neg,adc[8:0]},&lt;br /&gt;
         5={trig,adc[10:0]},&lt;br /&gt;
         6={ch_crossed_min,adc[10:0]}&lt;br /&gt;
15 - ctrl_supp_mode - channel suppression mode: 0=adc&amp;lt;=(baseline-threshold), 1=adc&amp;lt;=threshold&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Link&lt;br /&gt;
** link_ctrl - sata link control. The bits are:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 - sata_link_udp_stream_in_enable - permit data flow from sata link to OFFLOAD_SATA&lt;br /&gt;
1 - udp_stream_out_enable - permit sca data flow to sata link&lt;br /&gt;
2 - sata_to_eth_enable - permit ethernet data flow from sata link to TSE_MAC&lt;br /&gt;
3 - eth_to_sata_enable - permit ethernet data flow from TSE MAC to sata link&lt;br /&gt;
4 - enable_stop_our_tx - enable flow control: allow stop_tx&lt;br /&gt;
#5 - stop_our_tx - manually activate the flow control signal into link_tx&lt;br /&gt;
6 - enable_stop_remote_tx - enable flow control: allow send &amp;quot;stop_tx&amp;quot;&lt;br /&gt;
#7 - stop_remote_tx - manually activate the flow control signal into link_tx&lt;br /&gt;
8 - tx_test_pattern_udp - udp data is replaced by test pattern 0x11111111, 0x22222222, etc.&lt;br /&gt;
9 - tx_test_pattern_eth - nios-to-sata data is replaced by test pattern 0x11111111, 0x22222222, etc.&lt;br /&gt;
10 - udp_delay_enable - delay between udp packets, see udp_delay_value below&lt;br /&gt;
11 - reboot_tx - send K_REBOOT command to the sata link mate, where it has same effect as board/reset_nios.&lt;br /&gt;
12 - sata_to_nios_disable&lt;br /&gt;
13 - nios_to_sata_disable&lt;br /&gt;
14 - &lt;br /&gt;
15 - &lt;br /&gt;
16 -&lt;br /&gt;
24..31 - udp_delay_value - delay between udp packets (top 8 bits of a 20-bit counter)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firmware data path ==&lt;br /&gt;
&lt;br /&gt;
Main data path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feam_top&lt;br /&gt;
|&lt;br /&gt;
sca_sigproc&lt;br /&gt;
|&lt;br /&gt;
sca_event_control&lt;br /&gt;
4 * sca_control (sca_channel.sv)&lt;br /&gt;
4 * channel_fifo (1024 samples)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sca_control (sca_channel.sv)&lt;br /&gt;
|&lt;br /&gt;
state machine to control SCA read and write enables&lt;br /&gt;
|&lt;br /&gt;
sca_write_control (what does it do?!?)&lt;br /&gt;
sca_read_control&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sca_read_control&lt;br /&gt;
|&lt;br /&gt;
state machine to store ADC samples into per-channel FIFOs (channel_fifo)&lt;br /&gt;
selector to replace ADC samples with a test pattern&lt;br /&gt;
79*sca_trig_one -&amp;gt; ch_crossed_out - channel hit detector&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sca_event_control&lt;br /&gt;
|&lt;br /&gt;
event_fifo (hdl/mf/event_descriptor_fifo)&lt;br /&gt;
state machine to take ADC data from 4 per-channel FIFOs (channel_fifo) and store it into DDR memory (write addr increment is 510*8 (number of samples)*8 = 4080).&lt;br /&gt;
state machine to read transposed ADC data from DDR memory (read addr increment is 8+8=16 - 2 samples * 2 bytes * 4 sca = 16) and create 4 per-sca data streams&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data stream:&lt;br /&gt;
4 per-sca data streams from sca_event_control -&amp;gt; sca_sigproc(event_dat)&lt;br /&gt;
|&lt;br /&gt;
packet_chunker (hdl/lib/packet_chunker.sv) (4*event_dat -&amp;gt; event_segment_dat) - multiplex 4 data streams into 1 stream of UDP-sized packets&lt;br /&gt;
|&lt;br /&gt;
packet_length_prepender (hdl/lib/packet_length_prepender.sv)  (event_segment_dat -&amp;gt; udp_event_val_out)&lt;br /&gt;
|&lt;br /&gt;
udp_event_val -&amp;gt; info qsys (udp_stream_sca) and into sata link (mux channel 2).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firmware build instructions from Bryerton (obsolete) ==&lt;br /&gt;
&lt;br /&gt;
This is the old README.md file from the firmware git repository.&lt;br /&gt;
&lt;br /&gt;
These instructions are not used to build the firmware (use scrips/compile_project.sh).&lt;br /&gt;
&lt;br /&gt;
They are still useful for figuring out which buttons to push in the altera gui programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ALPHAg FrontEnd Acquisition Module (FEAM) - REV0&lt;br /&gt;
&lt;br /&gt;
Welcome to the ALPHAg FEAM Project &lt;br /&gt;
&lt;br /&gt;
# Table of Contents&lt;br /&gt;
&lt;br /&gt;
* [Overview](#overview)&lt;br /&gt;
* [Inital Setup](#initial-setup)&lt;br /&gt;
    * [Quartus Setup](#quartus-setup)&lt;br /&gt;
        * [Create the .cdf](#create-the-cdf)&lt;br /&gt;
    * [NIOS Setup](#nios-Setup)&lt;br /&gt;
        * [Create the project files](#create-the-project-files) &lt;br /&gt;
* [Build Instructions](#build-instructions)&lt;br /&gt;
    * [Building from Quartus GUI](#building-from-quartus-gui)&lt;br /&gt;
        * [Generate the QSys File](#generate-the-qsys-file)&lt;br /&gt;
        * [Compile the NIOSII Project](#compile-the-niosii-project)&lt;br /&gt;
        * [Compile the Quartus Project](#compile-the-quartus-project)&lt;br /&gt;
    * [Building from Scripts](#building-from-scripts)&lt;br /&gt;
    * [Installing from JTAG](#installing-from-jtag)&lt;br /&gt;
    * [Installing from ESPER](#installing-from-esper)&lt;br /&gt;
&lt;br /&gt;
# Overview&lt;br /&gt;
&lt;br /&gt;
The FEAM is a digitizer located on the ALPHAg detector. Each FEAM consists of 4 AFTER SCAs for a total of 288 channels.&lt;br /&gt;
&lt;br /&gt;
# Initial Setup&lt;br /&gt;
&lt;br /&gt;
## Quartus Setup&lt;br /&gt;
&lt;br /&gt;
### Create the .cdf&lt;br /&gt;
1. Open Quartus Prime Standard Edition&lt;br /&gt;
2. Click on **Tools -&amp;gt; Programmer**. The **Programmer** window will appear&lt;br /&gt;
3. In the **Programmer** window, click **Auto Detect**. A **Select Device** dialog box will appear&lt;br /&gt;
    1. (Optional) If **Auto Detect** is greyed out, click on **Hardware Setup**. The **Hardware Setup** dialog box will appear&lt;br /&gt;
    2. Under **Hardware Settings**, double-click on the USB JTAG hardware you wish to use&lt;br /&gt;
    3. Click **Close**. The **Hardware Setup** dialog box will close&lt;br /&gt;
5. Click on **File -&amp;gt; Save As**. The **Save As** dialog box will appear&lt;br /&gt;
6. In the **Save As** dialog box, browse to the **/\&amp;lt;project_dir\&amp;gt;/bin/** directory&lt;br /&gt;
7. Make sure the **Add file to current project** checkbox is checked&lt;br /&gt;
7. In the **File name** input box, type &amp;quot;alphag_feam.cdf&amp;quot; and click **Save**&lt;br /&gt;
8. Close the **Programmer** window&lt;br /&gt;
9. Done!&lt;br /&gt;
&lt;br /&gt;
## NIOS Setup&lt;br /&gt;
&lt;br /&gt;
### Create the project files&lt;br /&gt;
1. Open Quartus Prime Standard Edition&lt;br /&gt;
2. Open the NIOS II Software Build Tools by clicking **Tools -&amp;gt; NIOS II Software Build Tools for Eclipse**&lt;br /&gt;
3. The **Workspace Launcher** window will appear, click *OK* to accept the default workspace.&lt;br /&gt;
4. Click **File -&amp;gt; Import...**. The **Import** dialog box will appear&lt;br /&gt;
5. Click on **General -&amp;gt; Existing Projects into Workspace**&lt;br /&gt;
6. Click **Next \&amp;gt;**&lt;br /&gt;
7. Next to **Select root directory** click **Browse...**. A **Browse for Folder** dialog box will appear&lt;br /&gt;
8. Browse to **/\&amp;lt;project_dir\&amp;gt;/hdl/software** and click **OK**&lt;br /&gt;
8. Four Projects should appear in the **Projects** panel: &lt;br /&gt;
    * alphag_feam&lt;br /&gt;
    * alphag\_feam\_bsp &lt;br /&gt;
    * alphag\_feam\_bootloader&lt;br /&gt;
    * alphag\_feam\_bootloader\_bsp&lt;br /&gt;
9. Click **Select All**&lt;br /&gt;
10. Click **Finish**&lt;br /&gt;
11. Done!&lt;br /&gt;
 &lt;br /&gt;
# Build Instructions&lt;br /&gt;
&lt;br /&gt;
## Building from Quartus GUI&lt;br /&gt;
&lt;br /&gt;
**Warning: Please use Quartus Prime Standard Edition 16.1**&lt;br /&gt;
### Generate the QSys File&lt;br /&gt;
1. Open Quartus Standard Edition 16.1&lt;br /&gt;
1. Open QSys by clicking **Tools -&amp;gt; QSys**&lt;br /&gt;
2. Click on **File -&amp;gt; Open** (CTRL+O). An **Open File** dialog box should appear.&lt;br /&gt;
3. Select the **alphag_feam.qsys** file from the **/\&amp;lt;project_dir\&amp;gt;/hdl** directory and click **Open**&lt;br /&gt;
4. Modify as necessary. NOTE: Any change to the QSys, even cosmetic such as expanding or collapsing components will cause the QSys to desire a re-generate. &lt;br /&gt;
5. Click **File -&amp;gt; Save** (CTRL+S)&lt;br /&gt;
6. Click **Generate HDL**. A **Generation** dialog box will appear &lt;br /&gt;
7. Select the settings you desire to be changed, if any&lt;br /&gt;
8. Click **Generate**&lt;br /&gt;
9. Wait for the generation to complete.&lt;br /&gt;
10. Done!&lt;br /&gt;
&lt;br /&gt;
### Compile the NIOSII Project&lt;br /&gt;
1. Open the NIOS II Software Build Tools by clicking **Tools -&amp;gt; NIOS II Software Build Tools for Eclipse**&lt;br /&gt;
2. (Optional) If the QSys file has been re-generated performing the following&lt;br /&gt;
    1. Right-click on **alphag\_feam\_bsp** and select **NIOS II -&amp;gt; Generate BSP**. The BSP will regenerate&lt;br /&gt;
    2. Right-click on **alphag\_feam\_bootloader\_bsp** and select **NIOS II -&amp;gt; Generate BSP**. The BSP will regenerate&lt;br /&gt;
3. Modify files as needed. WARNING: Do not modify any BSP files by hand! All changes will be lost on next generate.&lt;br /&gt;
4. Click **Project -&amp;gt; Build All** (CTRL+B). If your workspace as multiple projects, it is recommend to close all but the ones related to the FEAM.&lt;br /&gt;
5. Right-click on **alphag\_feam\_bootloader** and select **Make Targets -&amp;gt; Build...**. The **Make Targets** dialog box will appear&lt;br /&gt;
6. In the **Make Targets** dialog box, select **mem\_init\_generate** and click **Build**&lt;br /&gt;
7. Done!&lt;br /&gt;
&lt;br /&gt;
### Compile the Quartus Project&lt;br /&gt;
1. Open Quartus Standard Edition 16.1&lt;br /&gt;
1. Under **Processing** click **Start Compilation** (CTRL+L)&lt;br /&gt;
2. Wait about 16-30 minutes.&lt;br /&gt;
3. Done!&lt;br /&gt;
  &lt;br /&gt;
**Note:** If Quartus crashed while compiling, delete the **\&amp;lt;project_dir\&amp;gt;/hdl/db** and **\&amp;lt;project_dir\&amp;gt;/hdl/incremental_db** directories and try again&lt;br /&gt;
  &lt;br /&gt;
## Installing from JTAG&lt;br /&gt;
1. Generate the .jic file using the provided /bin/alphag\_feam\_jic.cof&lt;br /&gt;
    1. In the main Quartus window, click **File -&amp;gt; Convert Programming Files**, A **Convert Programming Files** window will appear&lt;br /&gt;
    2. In the **Convert Programming Files** window, click **Open Conversion Setup Data**. An **Open** dialog box will appear&lt;br /&gt;
    3. In the **Open** dialog box, select the **alphag_feam.cof** file located in **/bin/**&lt;br /&gt;
    4. Click **Open**. The **Open dialog box will close&lt;br /&gt;
        * Note the **File name** field, it should display /\&amp;lt;project\_dir\&amp;gt;/bin/alphag\_feam.jic&lt;br /&gt;
    5. In the **Convert Programming Files** window, click **Generate**&lt;br /&gt;
    6. When the .jic is done being generated, a small dialog box will appear, click **OK**&lt;br /&gt;
    7. In the **Convert Programming Files** window, click **Close**&lt;br /&gt;
2. Load the .JIC file using the Programmer&lt;br /&gt;
    1. In the main Quartus window in the **Project Navigator** drop-down input select **Files**.&lt;br /&gt;
    2. Scroll down the window and find the **alphag_feam.cdf**, and double-click it. The **Programmer** window will open&lt;br /&gt;
    3. Click on the icon labelled **5CGXFC4C6**&lt;br /&gt;
    4. Click on the **Change File** button. The **Select New Programming File** dialog box will appear&lt;br /&gt;
    5. Browse to **/\&amp;lt;project_dir\&amp;gt;/bin/** and select **alphag\_feam.jic**&lt;br /&gt;
    6. Click Open. The **Select New Programming File** dialog box will close&lt;br /&gt;
    7. In the main panel, check the **Program/Configure** box on the line that starts **./bin/alphag\_feam.jic**&lt;br /&gt;
    8. Click the **Start** button&lt;br /&gt;
    9. Wait for the **Progress** bar to go to 100% and stop&lt;br /&gt;
    10. Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Internal test pulser =&lt;br /&gt;
&lt;br /&gt;
Documentation from Bryerton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---------- Forwarded message ---------&lt;br /&gt;
From: Bryerton Shaw &amp;lt;bryerton@triumf.ca&amp;gt;&lt;br /&gt;
Date: Tue, 24 Apr 2018 at 16:18&lt;br /&gt;
Subject: RE: PWB/FEAM internal test pulse&lt;br /&gt;
To: Lars Martin &amp;lt;lmartin@triumf.ca&amp;gt;&lt;br /&gt;
Cc: Andrea Capra &amp;lt;acapra@triumf.ca&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi Lars (and Andrea),&lt;br /&gt;
&lt;br /&gt;
In the new(er) firmware the test pulse code has been modified slightly to&lt;br /&gt;
fit in better with the upgraded trigger system. I can add an option to&lt;br /&gt;
allow it to be triggered by the external trigger (currently it has an&lt;br /&gt;
interval option, or you can hit the manual trigger to fire it, if it’s&lt;br /&gt;
enabled)&lt;br /&gt;
&lt;br /&gt;
The *options for the test pulser* are under the *signalproc module*:&lt;br /&gt;
&lt;br /&gt;
*test_pulse_ena*&lt;br /&gt;
&lt;br /&gt;
An array of four booleans, that control turning on the test pulse for each&lt;br /&gt;
SCA. If this is False, the other options below will do nothings for that SCA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_interval_ena*&lt;br /&gt;
&lt;br /&gt;
An array of four booleans, that control turning on the interval trigger for&lt;br /&gt;
each SCA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_interval*&lt;br /&gt;
&lt;br /&gt;
An unsigned 32-bit value that marks how many 16ns clock cycles occur&lt;br /&gt;
between interval triggers. Only one value, as there is only one interval&lt;br /&gt;
timer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_wdt*&lt;br /&gt;
&lt;br /&gt;
An array of four 16-bit unsigned integers that control the width of the&lt;br /&gt;
pulse for each SCA when the trigger occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, there is a second set of options to control the delay of the *test&lt;br /&gt;
pulse interval trigger*. These options are located under the *trigger&lt;br /&gt;
module*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*intp_trig_ena*&lt;br /&gt;
&lt;br /&gt;
Boolean value enabling/disabling the interval test pulse trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*intp_trig_delay*&lt;br /&gt;
&lt;br /&gt;
Unsigned 32-bit integer controlling the trigger delay, which is the time&lt;br /&gt;
between when the trigger is requested, and when the trigger actually fires.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can setup the interval trigger and use that to create event packets&lt;br /&gt;
with the test pulse on set intervals. If the interval trigger is&lt;br /&gt;
insufficient, I can create another option, which is to fire the test pulse&lt;br /&gt;
for enabled SCAs when the external trigger goes. If so, I’ll add this&lt;br /&gt;
option in the *signalproc *module for you:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_on_ext*&lt;br /&gt;
&lt;br /&gt;
An array of four Booleans, that control if the test pulse for that SCA&lt;br /&gt;
fires on external trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember, in order to use the SCA test pulse at all, you must also set the&lt;br /&gt;
SCA to test mode. You can do this by going into the *sca0-3 modules* and&lt;br /&gt;
setting *test* to *functionality *(the value is *3* if you want to set it&lt;br /&gt;
via esper-tool)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Btw currently the SCAs are hard-coded to have all 72 channels receive the&lt;br /&gt;
test pulse on firing, and the option to de-select/select which channels to&lt;br /&gt;
fire is not offered. Would you like this ability? And if so do you want it&lt;br /&gt;
to set all four SCAs the same, or have an option for all 288 channels?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The waveform viewer on the webpage was removed for technical reasons, and&lt;br /&gt;
so all viewing is done via the MIDAS DAQ. There are some preliminary tools&lt;br /&gt;
I’ve created to verify the event packets and their waveforms, but I&lt;br /&gt;
wouldn’t call them easy to setup or use at the moment. (Or very  useful for&lt;br /&gt;
fine comparisons). If KO doesn’t have a way of saving the events to disk, I&lt;br /&gt;
could deliver something that captured and saved waveforms quite quickly.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Bryerton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*From:* Lars Martin&lt;br /&gt;
*Sent:* April 23, 2018 5:10 PM&lt;br /&gt;
*To:* Bryerton Shaw &amp;lt;bryerton@triumf.ca&amp;gt;&lt;br /&gt;
*Cc:* Andrea Capra &amp;lt;acapra@triumf.ca&amp;gt;&lt;br /&gt;
*Subject:* PWB/FEAM internal test pulse&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi Bryerton,&lt;br /&gt;
&lt;br /&gt;
Andrea and I would like to check the response function of the PWBs. For&lt;br /&gt;
that Daryl suggested to first look at the internal test pulse.&lt;br /&gt;
&lt;br /&gt;
Can you point us to what settings are required to make that go? And to use&lt;br /&gt;
the external trigger if we want to acquire the data?&lt;br /&gt;
&lt;br /&gt;
Ideally we would acquire Midas data from that, but it&#039;s unclear if KO&#039;s&lt;br /&gt;
frontend allows for that right now. Can we access the data with Esper&lt;br /&gt;
instead?&lt;br /&gt;
&lt;br /&gt;
Finally, we haven&#039;t had the waveform display on the web page for a while,&lt;br /&gt;
but Daryl said you guys use it. Are we using a different page somehow?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hope all is well with the baby, cheers,&lt;br /&gt;
&lt;br /&gt;
Lars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= TODO =&lt;br /&gt;
&lt;br /&gt;
* IMPOSSIBLE (ext clock only connected to clock cleaner) add frequency counter for the external clock (62.5 MHz)&lt;br /&gt;
* DONE add random delay before memtest&lt;br /&gt;
* DONE add 4 more bits to udp_delay&lt;br /&gt;
* DONE fix crash on boot if run is active and triggers arrive (check that trigger is off on boot) (do not set trigger/enable_all, ext_trig_ena, inp_trig_ena, signal_proc/force_run to 1 after boot)&lt;br /&gt;
* DONE (kludge jtag uart write()) increase size of jtag uart output buffer, make it unlimited if possible.&lt;br /&gt;
* DONE (kludge jtag uart write()) on dhcp timeout, reboot the fpga - reboot of nios does not clear the jtag uart, which becomes full and nios stops.&lt;br /&gt;
* DONE add NIOS watchdog timeout for fectrl&lt;br /&gt;
* DONE do not use external clock until instructed by fectrl (clock cleaner default is pin select mode, default pin mode is input with pull down, so clock 0 is selected, this is the ext clock. but we can drive clock select pins from the fpga).&lt;br /&gt;
* DONE change clock cleaner power up: use the 2 lines status_clkin0 and status_clkin1 to tell clock cleaner to use the internal clock (clkin2) - from the FPGA drive first line low, second line high. Also change all NIOS code that programs the clock cleaner to keep these two lines in the &amp;quot;input&amp;quot; mode. Current code switches them to &amp;quot;output&amp;quot; mode.&lt;br /&gt;
* DONE clock cleaner power up state is wrong for both choices of clock: 62.5 MHz ext clock and 125 MHz internal clock, see explanation in feam_top.sv. It looks like I need to drive status_clkin0 and status_clkin1 to &amp;quot;holdover&amp;quot; mode, both logic level 1. Currently status_clkin0 is used as SPI read line, this has to be moved to a different line first.&lt;br /&gt;
* add watchdog timeout that works in factory mode (&amp;quot;remote update&amp;quot; watchdog only works in user mode)&lt;br /&gt;
* enable HTTP pipelining - copy changes on mongoose from ADC project.&lt;br /&gt;
* reset everything if it looks like NIOS TCP/IP code has crashed, but enough code is still running to prevent tripping of the fpga-remote-update watchdog timer. such crash tends to happens when the sata link mate is rebooted and incomplete data arrives from the disrupted ethernet data path.&lt;br /&gt;
* when loading AFTER ASIC do not go into infinite loop if read-back is broken (always mismatch).&lt;br /&gt;
* read and report error status information bits for 2983fc.pdf&lt;br /&gt;
&lt;br /&gt;
= ZZZ =&lt;br /&gt;
&lt;br /&gt;
ZZZ&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:FiberOptic_TrippLite_specs.pdf&amp;diff=795</id>
		<title>File:FiberOptic TrippLite specs.pdf</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:FiberOptic_TrippLite_specs.pdf&amp;diff=795"/>
		<updated>2021-08-03T04:58:16Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:AVAGO_SFP_specs.pdf&amp;diff=794</id>
		<title>File:AVAGO SFP specs.pdf</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:AVAGO_SFP_specs.pdf&amp;diff=794"/>
		<updated>2021-08-03T04:57:41Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=PWB&amp;diff=793</id>
		<title>PWB</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=PWB&amp;diff=793"/>
		<updated>2021-08-03T04:56:39Z</updated>

		<summary type="html">&lt;p&gt;Acapra: /* Optical Link */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Links =&lt;br /&gt;
&lt;br /&gt;
* https://bitbucket.org/expalpha/pwb_rev1_firmware&lt;br /&gt;
* https://edev-group.triumf.ca/fw/exp/alphag/feam/rev1&lt;br /&gt;
* https://edev-group.triumf.ca/hw/alphag/feam/rev1&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/170 - PWB inventory database&lt;br /&gt;
&lt;br /&gt;
= Schematics =&lt;br /&gt;
&lt;br /&gt;
* [[Image:pwb_rev0.pdf]]&lt;br /&gt;
* [[Image:Pwb-rev1-after.pdf]]&lt;br /&gt;
* [[Image:AlphaG Rev1.pdf]]&lt;br /&gt;
&lt;br /&gt;
= Manuals =&lt;br /&gt;
&lt;br /&gt;
* [[Image:AFTER_MANUAL_V1.pdf]] AFTER SCA manual v1&lt;br /&gt;
* [[Image:AFTER_DataSheet1_1.pdf]] AFTER SCA manual v1.1&lt;br /&gt;
* [[Image:AFTER_SCA_table2.pdf]] AFTER SCA channel map&lt;br /&gt;
&lt;br /&gt;
= Hardware =&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
External power supply is:&lt;br /&gt;
* +5V&lt;br /&gt;
* +2V&lt;br /&gt;
&lt;br /&gt;
Central board:&lt;br /&gt;
&lt;br /&gt;
* Ext_5V - F1 - RS1 (0.1R) - Fuse_5V&lt;br /&gt;
* Ext_2V - F2/F3 - RS2 (0.1R) - Idig2-&lt;br /&gt;
* LDO3 - Fuse_5V - DIG_3.3V - selfenable - ADM7154&lt;br /&gt;
* LDO5 - Fuse_5V - DIG_2.5V - selfenable - ADM7154&lt;br /&gt;
* LDO_CLN - Fuse5V - CLN_3.3V - selfenable - &lt;br /&gt;
* VREG - DIG_3.3V - -2.5V SCA BIAS - selfenable - LTC1983ES6-3#TRMPBF&lt;br /&gt;
* LDO7 - DIG_2.5V - DDR3_VRef - enable DDR3_1P5V, DDR3_PG, DDR3_VttEN&lt;br /&gt;
* LDO2 - Idig2V- - DIG_1.1V - enable DIG_3.3V - LT3071&lt;br /&gt;
* LDO6 - Idig2V- - DDR3_1P5V - enable DIG_3.3V - LT3083&lt;br /&gt;
&lt;br /&gt;
SCA Wing:&lt;br /&gt;
&lt;br /&gt;
* Ext_5V - F1 - RS1 (0.3R) - Isca- - SCA_Fuse5V&lt;br /&gt;
* LDO1 - SCA_Fuse5V - SCA3.3V - enable ADC_PWR_EN - ADM7154&lt;br /&gt;
* LDO2 - SCA3.3V - ADC1.8V - selfenable - ADM7154&lt;br /&gt;
* LDO3 - SCA3.3V - TRN2.5V - selfenable - LT1761&lt;br /&gt;
* REF - SCA3.3V - 1.45V Vicm - selfenable - LM4121&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Trigger and Clock distribution ==&lt;br /&gt;
&lt;br /&gt;
Clock (62.5MHz) and trigger are distributed to the PWB columns via the [https://edev-group.triumf.ca/hw/alphag/trigger-card-sata-adapter/rev1 trigger SATA adapter].&lt;br /&gt;
&lt;br /&gt;
The two miniSAS cables from cdm03 port 5 and 6 are connected to a miniSAS-SATA splitter 1-to-4 (CS Electronics &amp;quot;iSAS SATA adapter&amp;quot; ADP-887P-1X). Since there are only 8 columns and the clock and trigger signals are daisy-chained across the 8 rows, this scheme is sufficient to provide the necessary inputs to all 64 PWBs.&lt;br /&gt;
&lt;br /&gt;
== Optical Link ==&lt;br /&gt;
&lt;br /&gt;
Main data uplink.&lt;br /&gt;
&lt;br /&gt;
SFP (Small Form Pluggable) Avago Technologies AFBR-57M5APZ&lt;br /&gt;
&lt;br /&gt;
Fiber optic Tripp Lite N820 - 10 m&lt;br /&gt;
&lt;br /&gt;
== SATA Link ==&lt;br /&gt;
&lt;br /&gt;
Secondary data uplink, capable also to deliver clock and trigger.&lt;br /&gt;
&lt;br /&gt;
= Firmware =&lt;br /&gt;
&lt;br /&gt;
== Firmware update ==&lt;br /&gt;
&lt;br /&gt;
PWB firmware update is done using &amp;quot;esper-tool&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
esper-tool -v upload -f file.rpd http://pwbNN update factory_rpd&lt;br /&gt;
esper-tool -v upload -f file.rpd http://pwbNN update file_rpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of PWB firmware pwb_rev1_20200706_ko:&lt;br /&gt;
&lt;br /&gt;
Permission to write into the flash memory is controlled by esper variables:&lt;br /&gt;
&lt;br /&gt;
* allow_write set to &amp;quot;false&amp;quot;: &amp;quot;esper-tool upload&amp;quot; does a &amp;quot;verify&amp;quot;: successful upload means epcq flash content is same as rpd file, error means content is not the same.&lt;br /&gt;
* allow_write set to &amp;quot;true&amp;quot;: &amp;quot;esper-tool upload&amp;quot; updates the epcq flash from the rpd file: for each data block, read the epcq flash, compare to rpd data, if different, erase the flash block, write the flash, read the flash, if there is a mismatch (bad write), return an error.&lt;br /&gt;
* allow_factory_write set to &amp;quot;true&amp;quot; to enable writing to the &amp;quot;factory_rpd&amp;quot;. DO NOT SET IT TO &amp;quot;true&amp;quot; UNLESS YOU MEAN TO UPDATE THE PWB BOOTLOADER. IF YOU FLASH BUM FIRMWARE or IF THERE IS A POWER OUTAGE WHILE UPDATING, THE PWB WILL BE BRICKED and has to be recovered by connecting a USB blaster.&lt;br /&gt;
&lt;br /&gt;
To update firmware of multiple boards to correct version, recommended is the script &amp;quot;update_pwb.perl&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/online/src&lt;br /&gt;
./update_pwb.perl pwb12 pwb06 pwb78&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Factory page and user page firmware boot ==&lt;br /&gt;
&lt;br /&gt;
Each PWB board has 2 firmware images: boot loader (factory page)&lt;br /&gt;
and data acquisition (user page). On power up, the FPGA loads and runs&lt;br /&gt;
the boot loader firmware from the factory page, later the control&lt;br /&gt;
software reboots the FPGA into the data acquisition firmware from&lt;br /&gt;
the user page.&lt;br /&gt;
&lt;br /&gt;
Because loading defective firmware can brick https://en.wikipedia.org/wiki/Brick_(electronics)&lt;br /&gt;
the PWB, new firmware images are loaded into the user page, if anything is wrong,&lt;br /&gt;
the PWB can still boot from the factory page and one can use the firmware update&lt;br /&gt;
function to load a good firmware image into the user page.&lt;br /&gt;
&lt;br /&gt;
The boot loader firmware in the factory page is not intended for data acquisition, it is only meant to provide three functions:&lt;br /&gt;
* boot enough hardware and software to communicate via the ethernet and the sata link&lt;br /&gt;
* firmware update (both factory page and user page)&lt;br /&gt;
* reboot into the user page&lt;br /&gt;
&lt;br /&gt;
The boot loader firmware in the factory page is usually never updated unless absolutely&lt;br /&gt;
needed to fix a problem with these three functions (i.e. compatibility with sata link communications).&lt;br /&gt;
&lt;br /&gt;
If factory image is corrupted or the contains defective firmware and the PWB does not boot (no dhcp, no ping, no esper),&lt;br /&gt;
the only way to unbrick it is by loading good firmware using a jtag flash programmer (usb-blaster). Connecting it requires&lt;br /&gt;
physical access to the jtag connector on the PWB board. It is impossible when the detector is fully assembled in the experiment.&lt;br /&gt;
&lt;br /&gt;
The PWB has a 32 Mbyte EPCQ flash memory chip, it is divided into 2 pages 16 Mbytes of factory page and 16 Mbytes of user page.&lt;br /&gt;
&lt;br /&gt;
A complete firmware image generally contains 3 pieces:&lt;br /&gt;
* FPGA firmware and NIOS &amp;quot;feam_bootloader&amp;quot; software RAM image (sof file)&lt;br /&gt;
* NIOS &amp;quot;feam&amp;quot; software RAM image (feam.elf.flash.hex) - all the C code for esper communications and PWB data acquisition&lt;br /&gt;
* NIOS filesystem image (feam.webpkg.hex) - esper web pages&lt;br /&gt;
&lt;br /&gt;
This is the boot sequence:&lt;br /&gt;
* on power-up the FPGA automatically loads the sof file from address 0 of the EPCQ flash (this is the factory image sof file)&lt;br /&gt;
* the FPGA is &amp;quot;started&amp;quot;&lt;br /&gt;
* the NIOS CPU starts executing the &amp;quot;feam_bootloader&amp;quot; C code embedded in the sof file (NIOS project hdl/software/feam_bootloader)&lt;br /&gt;
* feam_bootloader initializes the hardware (clocks, DDR memory, etc)&lt;br /&gt;
* feam_bootloader write-protects the EPCQ flash memory&lt;br /&gt;
* feam_bootloader copies the &amp;quot;feam&amp;quot; software from EPCQ flash to the DDR memory (after checking for correct checkum)&lt;br /&gt;
* feam_bootloader restarts the NIOS CPU&lt;br /&gt;
* the NIOS CPU starts running from DDR memory, executes the &amp;quot;feam&amp;quot; software (NIOS project hdl/software/feam)&lt;br /&gt;
* call main() in hdl/software/feam/src/task_init.c&lt;br /&gt;
* call task_init() in the same file&lt;br /&gt;
* infinite loop waiting for IP address via DHCP&lt;br /&gt;
* after have IP address, call task_esper() from hdl/software/feam/src/task_esper.c&lt;br /&gt;
* task_esper() creates all the esper modules, esper variables, etc,&lt;br /&gt;
* mod_http.c starts the mongoose web server&lt;br /&gt;
* PWB is open for business&lt;br /&gt;
&lt;br /&gt;
This is the protection against booting corrupted firmware:&lt;br /&gt;
* FPGA hardware loads the sof file from epcq flash and checks for correct checksum before &amp;quot;starting&amp;quot; it&lt;br /&gt;
* NIOS CPU is part of the sof file, protected by sof file checksum&lt;br /&gt;
* NIOS feam_bootloader C code is part of the sof file, protected by the sof checksum&lt;br /&gt;
* feam_bootloader checks for correct signatures and checksums of the DDR memory image&lt;br /&gt;
* &amp;quot;feam&amp;quot; C code is protected by the checksum of the DDR memory image&lt;br /&gt;
&lt;br /&gt;
== NIOS terminal ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ /opt/intelFPGA/16.1/quartus/bin/jtagconfig&lt;br /&gt;
1) USB-Blaster [2-1.2]&lt;br /&gt;
  02B030DD   5CGTFD7(B5|C5|D5)/5CGXBC7B6/..&lt;br /&gt;
$ /opt/intelFPGA/17.0/quartus/bin/nios2-terminal&lt;br /&gt;
nios2-terminal: connected to hardware target using JTAG UART on cable&lt;br /&gt;
nios2-terminal: &amp;quot;USB-Blaster [2-1.2]&amp;quot;, device 1, instance 0&lt;br /&gt;
nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate)&lt;br /&gt;
PWB Revision 1 Boot Loader&lt;br /&gt;
Ver 2.0  Build 357 - Wed Jun  6 15:05:35 PDT 2018&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flash boot loader firmware via jtag ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ /opt/intelFPGA/16.1/quartus/bin/jtagconfig&lt;br /&gt;
1) USB-Blaster [2-1.2]&lt;br /&gt;
  02B030DD   5CGTFD7(B5|C5|D5)/5CGXBC7B6/..&lt;br /&gt;
$ cd ~/online/firmware/pwb_rev1&lt;br /&gt;
$ ls -l&lt;br /&gt;
$ /opt/intelFPGA/17.1/quartus/bin/quartus_pgmw&lt;br /&gt;
... auto detect&lt;br /&gt;
... load the jic file&lt;br /&gt;
... in menu tools-&amp;gt;programmer, enable &amp;quot;unprotect device&amp;quot;&lt;br /&gt;
... start program/configure operation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flash user page firmware via esper-tool ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ cd online/src&lt;br /&gt;
$ more update_pwb.perl ### check that $fw is set to the desired firmware file&lt;br /&gt;
$ ./update_pwb.perl pwb06 ### or give more PWB names or give &amp;quot;all&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build firmware ==&lt;br /&gt;
&lt;br /&gt;
=== quartus version to use ===&lt;br /&gt;
&lt;br /&gt;
* quartus 16.1 should be used for jtag (jtagconfig and jtagd)&lt;br /&gt;
* quartus 17.0 should be used to build the PWB firmware (17.1 is not compatible)&lt;br /&gt;
&lt;br /&gt;
=== start license server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh agmini@daq16&lt;br /&gt;
/opt/intelFPGA/17.0/quartus/linux64/lmgrd -c ~agmini/online/license-daq16.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== prepare the build environment ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ /opt/intelFPGA/17.0/nios2eds/nios2_command_shell.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== get latest version of the code and build it ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd online/firmware/git/pwb_rev1_firmware&lt;br /&gt;
$ git pull&lt;br /&gt;
$ git checkout alphag&lt;br /&gt;
$ git pull&lt;br /&gt;
$ ./scripts/compile_project.sh&lt;br /&gt;
... about 30-40 minutes ...&lt;br /&gt;
$ ls -l bin/*.sof bin/*.jic bin/*.rpd&lt;br /&gt;
-rw-r--r-- 1 agmini alpha 12727389 Jan 24  2018 bin/feam_rev1_auto.rpd&lt;br /&gt;
-rw-r--r-- 1 agmini alpha 33554661 Jan 24  2018 bin/feam_rev1.jic&lt;br /&gt;
-rw-r--r-- 1 agmini alpha  6974754 Jan 24  2018 bin/rev1.sof&lt;br /&gt;
$ ### feam.jic is loaded via jtag&lt;br /&gt;
$ ### feam_auto.rpd is loaded via esper&lt;br /&gt;
$ ### feam.sof is used to attach the quartus signal tap logic analyzer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== firmware build order and sequence ===&lt;br /&gt;
&lt;br /&gt;
* erase previous build&lt;br /&gt;
* regenerate qsys&lt;br /&gt;
* regenerate NIOS BSP &amp;quot;feam_bootloader_bsp&amp;quot; and &amp;quot;feam_bsp&amp;quot;&lt;br /&gt;
* build NIOS projects &amp;quot;feam_bootloader&amp;quot; and &amp;quot;feam&amp;quot;&lt;br /&gt;
* build quartus sof file (with the &amp;quot;feam_bootloader&amp;quot; nios project inside)&lt;br /&gt;
* build jic and rpd files (with the quartus sof file and the &amp;quot;feam&amp;quot; nios project inside)&lt;br /&gt;
* load sof file into the FPGA using jtag (be careful about compatible &amp;quot;feam&amp;quot; nios project already in the epcq flash)&lt;br /&gt;
* load jic file into the epcq factory page using jtag (cycle power for them to take effect)&lt;br /&gt;
* load rpd file into the epcq factory or user page using esper&lt;br /&gt;
&lt;br /&gt;
=== scripts for building the firmware ===&lt;br /&gt;
&lt;br /&gt;
* scripts/compile_project.sh - build everything from scratch:&lt;br /&gt;
* scripts/compile_qsys.sh - regenerate the main qsys component&lt;br /&gt;
* scripts/compile_nios.sh - regenerate the BSPs, then same as compile_elf.sh&lt;br /&gt;
* scripts/compile_elf.sh - build the BSPs, &amp;quot;feam_bootloader&amp;quot; and &amp;quot;feam&amp;quot; NIOS projects&lt;br /&gt;
* scripts/update_elf.sh - regenerate the rpd and jic files to include the new &amp;quot;feam&amp;quot; NIOS build (keeps the old &amp;quot;feam_bootloader&amp;quot; in the sof file)&lt;br /&gt;
* scripts/update_bootloader.sh - also regenerate the sof file to include the new &amp;quot;feam_bootloader&amp;quot; build&lt;br /&gt;
* scripts/clean_quartus.sh - prepare quartus fpga sof file to build from scratch&lt;br /&gt;
* scripts/compile_quartus.sh - build the quartus fpga sof file incrementally (run clean_quartus.sh to build from scratch).&lt;br /&gt;
* scripts/load_jtag_sof.pl bin/rev1.sof - load sof file into the FPGA. this will boot the new fpga firmware, the new feam_bootloader (if update_bootloader.sh was run), but with the old &amp;quot;feam&amp;quot; already in epcq flash. (beware of incompatible sof, &amp;quot;feam_bootloader&amp;quot; and &amp;quot;feam&amp;quot; builds!)&lt;br /&gt;
* scripts/load_jtag_jic.pl bin/feam_rev1.jic - load jic file into the EPCQ flash, same as using the graphical flash programmer tool. (this will leave the FPGA running the quartus jtag flash loader firmware, not the PWB firmware. Cycle power for new jic file to take effect).&lt;br /&gt;
&lt;br /&gt;
== ESPER Variables ==&lt;br /&gt;
&lt;br /&gt;
* Board&lt;br /&gt;
** invert_ext_trig - invert trigger signal from CDM before it drives any logic (to undo incorrect signal polarity)&lt;br /&gt;
** reset_nios - goggle up, them down to reset NIOS subsystem&lt;br /&gt;
&lt;br /&gt;
* Signalproc&lt;br /&gt;
** test_mode - ADC data is replaced with a test pattern, see test mode bits in sca_x_ch_ctrl.&lt;br /&gt;
** sca_a_ch_ctrl, sca_b_ch_ctrl, sca_c_ch_ctrl, sca_d_ch_ctrl - channel control bits:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11..0 - threshold - channel suppression threshold&lt;br /&gt;
14..12 - ctrl_test_mode - test mode:&lt;br /&gt;
         0=fixed patter 0xa5a,&lt;br /&gt;
         1=time bin counter,&lt;br /&gt;
         2=time bin counter with channel number,&lt;br /&gt;
         3=sequential adc sample counter,&lt;br /&gt;
         4={ch_crossed_out,trig_pos,trig_neg,adc[8:0]},&lt;br /&gt;
         5={trig,adc[10:0]},&lt;br /&gt;
         6={ch_crossed_min,adc[10:0]}&lt;br /&gt;
15 - ctrl_supp_mode - channel suppression mode: 0=adc&amp;lt;=(baseline-threshold), 1=adc&amp;lt;=threshold&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Link&lt;br /&gt;
** link_ctrl - sata link control. The bits are:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 - sata_link_udp_stream_in_enable - permit data flow from sata link to OFFLOAD_SATA&lt;br /&gt;
1 - udp_stream_out_enable - permit sca data flow to sata link&lt;br /&gt;
2 - sata_to_eth_enable - permit ethernet data flow from sata link to TSE_MAC&lt;br /&gt;
3 - eth_to_sata_enable - permit ethernet data flow from TSE MAC to sata link&lt;br /&gt;
4 - enable_stop_our_tx - enable flow control: allow stop_tx&lt;br /&gt;
#5 - stop_our_tx - manually activate the flow control signal into link_tx&lt;br /&gt;
6 - enable_stop_remote_tx - enable flow control: allow send &amp;quot;stop_tx&amp;quot;&lt;br /&gt;
#7 - stop_remote_tx - manually activate the flow control signal into link_tx&lt;br /&gt;
8 - tx_test_pattern_udp - udp data is replaced by test pattern 0x11111111, 0x22222222, etc.&lt;br /&gt;
9 - tx_test_pattern_eth - nios-to-sata data is replaced by test pattern 0x11111111, 0x22222222, etc.&lt;br /&gt;
10 - udp_delay_enable - delay between udp packets, see udp_delay_value below&lt;br /&gt;
11 - reboot_tx - send K_REBOOT command to the sata link mate, where it has same effect as board/reset_nios.&lt;br /&gt;
12 - sata_to_nios_disable&lt;br /&gt;
13 - nios_to_sata_disable&lt;br /&gt;
14 - &lt;br /&gt;
15 - &lt;br /&gt;
16 -&lt;br /&gt;
24..31 - udp_delay_value - delay between udp packets (top 8 bits of a 20-bit counter)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firmware data path ==&lt;br /&gt;
&lt;br /&gt;
Main data path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feam_top&lt;br /&gt;
|&lt;br /&gt;
sca_sigproc&lt;br /&gt;
|&lt;br /&gt;
sca_event_control&lt;br /&gt;
4 * sca_control (sca_channel.sv)&lt;br /&gt;
4 * channel_fifo (1024 samples)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sca_control (sca_channel.sv)&lt;br /&gt;
|&lt;br /&gt;
state machine to control SCA read and write enables&lt;br /&gt;
|&lt;br /&gt;
sca_write_control (what does it do?!?)&lt;br /&gt;
sca_read_control&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sca_read_control&lt;br /&gt;
|&lt;br /&gt;
state machine to store ADC samples into per-channel FIFOs (channel_fifo)&lt;br /&gt;
selector to replace ADC samples with a test pattern&lt;br /&gt;
79*sca_trig_one -&amp;gt; ch_crossed_out - channel hit detector&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sca_event_control&lt;br /&gt;
|&lt;br /&gt;
event_fifo (hdl/mf/event_descriptor_fifo)&lt;br /&gt;
state machine to take ADC data from 4 per-channel FIFOs (channel_fifo) and store it into DDR memory (write addr increment is 510*8 (number of samples)*8 = 4080).&lt;br /&gt;
state machine to read transposed ADC data from DDR memory (read addr increment is 8+8=16 - 2 samples * 2 bytes * 4 sca = 16) and create 4 per-sca data streams&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data stream:&lt;br /&gt;
4 per-sca data streams from sca_event_control -&amp;gt; sca_sigproc(event_dat)&lt;br /&gt;
|&lt;br /&gt;
packet_chunker (hdl/lib/packet_chunker.sv) (4*event_dat -&amp;gt; event_segment_dat) - multiplex 4 data streams into 1 stream of UDP-sized packets&lt;br /&gt;
|&lt;br /&gt;
packet_length_prepender (hdl/lib/packet_length_prepender.sv)  (event_segment_dat -&amp;gt; udp_event_val_out)&lt;br /&gt;
|&lt;br /&gt;
udp_event_val -&amp;gt; info qsys (udp_stream_sca) and into sata link (mux channel 2).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firmware build instructions from Bryerton (obsolete) ==&lt;br /&gt;
&lt;br /&gt;
This is the old README.md file from the firmware git repository.&lt;br /&gt;
&lt;br /&gt;
These instructions are not used to build the firmware (use scrips/compile_project.sh).&lt;br /&gt;
&lt;br /&gt;
They are still useful for figuring out which buttons to push in the altera gui programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ALPHAg FrontEnd Acquisition Module (FEAM) - REV0&lt;br /&gt;
&lt;br /&gt;
Welcome to the ALPHAg FEAM Project &lt;br /&gt;
&lt;br /&gt;
# Table of Contents&lt;br /&gt;
&lt;br /&gt;
* [Overview](#overview)&lt;br /&gt;
* [Inital Setup](#initial-setup)&lt;br /&gt;
    * [Quartus Setup](#quartus-setup)&lt;br /&gt;
        * [Create the .cdf](#create-the-cdf)&lt;br /&gt;
    * [NIOS Setup](#nios-Setup)&lt;br /&gt;
        * [Create the project files](#create-the-project-files) &lt;br /&gt;
* [Build Instructions](#build-instructions)&lt;br /&gt;
    * [Building from Quartus GUI](#building-from-quartus-gui)&lt;br /&gt;
        * [Generate the QSys File](#generate-the-qsys-file)&lt;br /&gt;
        * [Compile the NIOSII Project](#compile-the-niosii-project)&lt;br /&gt;
        * [Compile the Quartus Project](#compile-the-quartus-project)&lt;br /&gt;
    * [Building from Scripts](#building-from-scripts)&lt;br /&gt;
    * [Installing from JTAG](#installing-from-jtag)&lt;br /&gt;
    * [Installing from ESPER](#installing-from-esper)&lt;br /&gt;
&lt;br /&gt;
# Overview&lt;br /&gt;
&lt;br /&gt;
The FEAM is a digitizer located on the ALPHAg detector. Each FEAM consists of 4 AFTER SCAs for a total of 288 channels.&lt;br /&gt;
&lt;br /&gt;
# Initial Setup&lt;br /&gt;
&lt;br /&gt;
## Quartus Setup&lt;br /&gt;
&lt;br /&gt;
### Create the .cdf&lt;br /&gt;
1. Open Quartus Prime Standard Edition&lt;br /&gt;
2. Click on **Tools -&amp;gt; Programmer**. The **Programmer** window will appear&lt;br /&gt;
3. In the **Programmer** window, click **Auto Detect**. A **Select Device** dialog box will appear&lt;br /&gt;
    1. (Optional) If **Auto Detect** is greyed out, click on **Hardware Setup**. The **Hardware Setup** dialog box will appear&lt;br /&gt;
    2. Under **Hardware Settings**, double-click on the USB JTAG hardware you wish to use&lt;br /&gt;
    3. Click **Close**. The **Hardware Setup** dialog box will close&lt;br /&gt;
5. Click on **File -&amp;gt; Save As**. The **Save As** dialog box will appear&lt;br /&gt;
6. In the **Save As** dialog box, browse to the **/\&amp;lt;project_dir\&amp;gt;/bin/** directory&lt;br /&gt;
7. Make sure the **Add file to current project** checkbox is checked&lt;br /&gt;
7. In the **File name** input box, type &amp;quot;alphag_feam.cdf&amp;quot; and click **Save**&lt;br /&gt;
8. Close the **Programmer** window&lt;br /&gt;
9. Done!&lt;br /&gt;
&lt;br /&gt;
## NIOS Setup&lt;br /&gt;
&lt;br /&gt;
### Create the project files&lt;br /&gt;
1. Open Quartus Prime Standard Edition&lt;br /&gt;
2. Open the NIOS II Software Build Tools by clicking **Tools -&amp;gt; NIOS II Software Build Tools for Eclipse**&lt;br /&gt;
3. The **Workspace Launcher** window will appear, click *OK* to accept the default workspace.&lt;br /&gt;
4. Click **File -&amp;gt; Import...**. The **Import** dialog box will appear&lt;br /&gt;
5. Click on **General -&amp;gt; Existing Projects into Workspace**&lt;br /&gt;
6. Click **Next \&amp;gt;**&lt;br /&gt;
7. Next to **Select root directory** click **Browse...**. A **Browse for Folder** dialog box will appear&lt;br /&gt;
8. Browse to **/\&amp;lt;project_dir\&amp;gt;/hdl/software** and click **OK**&lt;br /&gt;
8. Four Projects should appear in the **Projects** panel: &lt;br /&gt;
    * alphag_feam&lt;br /&gt;
    * alphag\_feam\_bsp &lt;br /&gt;
    * alphag\_feam\_bootloader&lt;br /&gt;
    * alphag\_feam\_bootloader\_bsp&lt;br /&gt;
9. Click **Select All**&lt;br /&gt;
10. Click **Finish**&lt;br /&gt;
11. Done!&lt;br /&gt;
 &lt;br /&gt;
# Build Instructions&lt;br /&gt;
&lt;br /&gt;
## Building from Quartus GUI&lt;br /&gt;
&lt;br /&gt;
**Warning: Please use Quartus Prime Standard Edition 16.1**&lt;br /&gt;
### Generate the QSys File&lt;br /&gt;
1. Open Quartus Standard Edition 16.1&lt;br /&gt;
1. Open QSys by clicking **Tools -&amp;gt; QSys**&lt;br /&gt;
2. Click on **File -&amp;gt; Open** (CTRL+O). An **Open File** dialog box should appear.&lt;br /&gt;
3. Select the **alphag_feam.qsys** file from the **/\&amp;lt;project_dir\&amp;gt;/hdl** directory and click **Open**&lt;br /&gt;
4. Modify as necessary. NOTE: Any change to the QSys, even cosmetic such as expanding or collapsing components will cause the QSys to desire a re-generate. &lt;br /&gt;
5. Click **File -&amp;gt; Save** (CTRL+S)&lt;br /&gt;
6. Click **Generate HDL**. A **Generation** dialog box will appear &lt;br /&gt;
7. Select the settings you desire to be changed, if any&lt;br /&gt;
8. Click **Generate**&lt;br /&gt;
9. Wait for the generation to complete.&lt;br /&gt;
10. Done!&lt;br /&gt;
&lt;br /&gt;
### Compile the NIOSII Project&lt;br /&gt;
1. Open the NIOS II Software Build Tools by clicking **Tools -&amp;gt; NIOS II Software Build Tools for Eclipse**&lt;br /&gt;
2. (Optional) If the QSys file has been re-generated performing the following&lt;br /&gt;
    1. Right-click on **alphag\_feam\_bsp** and select **NIOS II -&amp;gt; Generate BSP**. The BSP will regenerate&lt;br /&gt;
    2. Right-click on **alphag\_feam\_bootloader\_bsp** and select **NIOS II -&amp;gt; Generate BSP**. The BSP will regenerate&lt;br /&gt;
3. Modify files as needed. WARNING: Do not modify any BSP files by hand! All changes will be lost on next generate.&lt;br /&gt;
4. Click **Project -&amp;gt; Build All** (CTRL+B). If your workspace as multiple projects, it is recommend to close all but the ones related to the FEAM.&lt;br /&gt;
5. Right-click on **alphag\_feam\_bootloader** and select **Make Targets -&amp;gt; Build...**. The **Make Targets** dialog box will appear&lt;br /&gt;
6. In the **Make Targets** dialog box, select **mem\_init\_generate** and click **Build**&lt;br /&gt;
7. Done!&lt;br /&gt;
&lt;br /&gt;
### Compile the Quartus Project&lt;br /&gt;
1. Open Quartus Standard Edition 16.1&lt;br /&gt;
1. Under **Processing** click **Start Compilation** (CTRL+L)&lt;br /&gt;
2. Wait about 16-30 minutes.&lt;br /&gt;
3. Done!&lt;br /&gt;
  &lt;br /&gt;
**Note:** If Quartus crashed while compiling, delete the **\&amp;lt;project_dir\&amp;gt;/hdl/db** and **\&amp;lt;project_dir\&amp;gt;/hdl/incremental_db** directories and try again&lt;br /&gt;
  &lt;br /&gt;
## Installing from JTAG&lt;br /&gt;
1. Generate the .jic file using the provided /bin/alphag\_feam\_jic.cof&lt;br /&gt;
    1. In the main Quartus window, click **File -&amp;gt; Convert Programming Files**, A **Convert Programming Files** window will appear&lt;br /&gt;
    2. In the **Convert Programming Files** window, click **Open Conversion Setup Data**. An **Open** dialog box will appear&lt;br /&gt;
    3. In the **Open** dialog box, select the **alphag_feam.cof** file located in **/bin/**&lt;br /&gt;
    4. Click **Open**. The **Open dialog box will close&lt;br /&gt;
        * Note the **File name** field, it should display /\&amp;lt;project\_dir\&amp;gt;/bin/alphag\_feam.jic&lt;br /&gt;
    5. In the **Convert Programming Files** window, click **Generate**&lt;br /&gt;
    6. When the .jic is done being generated, a small dialog box will appear, click **OK**&lt;br /&gt;
    7. In the **Convert Programming Files** window, click **Close**&lt;br /&gt;
2. Load the .JIC file using the Programmer&lt;br /&gt;
    1. In the main Quartus window in the **Project Navigator** drop-down input select **Files**.&lt;br /&gt;
    2. Scroll down the window and find the **alphag_feam.cdf**, and double-click it. The **Programmer** window will open&lt;br /&gt;
    3. Click on the icon labelled **5CGXFC4C6**&lt;br /&gt;
    4. Click on the **Change File** button. The **Select New Programming File** dialog box will appear&lt;br /&gt;
    5. Browse to **/\&amp;lt;project_dir\&amp;gt;/bin/** and select **alphag\_feam.jic**&lt;br /&gt;
    6. Click Open. The **Select New Programming File** dialog box will close&lt;br /&gt;
    7. In the main panel, check the **Program/Configure** box on the line that starts **./bin/alphag\_feam.jic**&lt;br /&gt;
    8. Click the **Start** button&lt;br /&gt;
    9. Wait for the **Progress** bar to go to 100% and stop&lt;br /&gt;
    10. Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Internal test pulser =&lt;br /&gt;
&lt;br /&gt;
Documentation from Bryerton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---------- Forwarded message ---------&lt;br /&gt;
From: Bryerton Shaw &amp;lt;bryerton@triumf.ca&amp;gt;&lt;br /&gt;
Date: Tue, 24 Apr 2018 at 16:18&lt;br /&gt;
Subject: RE: PWB/FEAM internal test pulse&lt;br /&gt;
To: Lars Martin &amp;lt;lmartin@triumf.ca&amp;gt;&lt;br /&gt;
Cc: Andrea Capra &amp;lt;acapra@triumf.ca&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi Lars (and Andrea),&lt;br /&gt;
&lt;br /&gt;
In the new(er) firmware the test pulse code has been modified slightly to&lt;br /&gt;
fit in better with the upgraded trigger system. I can add an option to&lt;br /&gt;
allow it to be triggered by the external trigger (currently it has an&lt;br /&gt;
interval option, or you can hit the manual trigger to fire it, if it’s&lt;br /&gt;
enabled)&lt;br /&gt;
&lt;br /&gt;
The *options for the test pulser* are under the *signalproc module*:&lt;br /&gt;
&lt;br /&gt;
*test_pulse_ena*&lt;br /&gt;
&lt;br /&gt;
An array of four booleans, that control turning on the test pulse for each&lt;br /&gt;
SCA. If this is False, the other options below will do nothings for that SCA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_interval_ena*&lt;br /&gt;
&lt;br /&gt;
An array of four booleans, that control turning on the interval trigger for&lt;br /&gt;
each SCA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_interval*&lt;br /&gt;
&lt;br /&gt;
An unsigned 32-bit value that marks how many 16ns clock cycles occur&lt;br /&gt;
between interval triggers. Only one value, as there is only one interval&lt;br /&gt;
timer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_wdt*&lt;br /&gt;
&lt;br /&gt;
An array of four 16-bit unsigned integers that control the width of the&lt;br /&gt;
pulse for each SCA when the trigger occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, there is a second set of options to control the delay of the *test&lt;br /&gt;
pulse interval trigger*. These options are located under the *trigger&lt;br /&gt;
module*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*intp_trig_ena*&lt;br /&gt;
&lt;br /&gt;
Boolean value enabling/disabling the interval test pulse trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*intp_trig_delay*&lt;br /&gt;
&lt;br /&gt;
Unsigned 32-bit integer controlling the trigger delay, which is the time&lt;br /&gt;
between when the trigger is requested, and when the trigger actually fires.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can setup the interval trigger and use that to create event packets&lt;br /&gt;
with the test pulse on set intervals. If the interval trigger is&lt;br /&gt;
insufficient, I can create another option, which is to fire the test pulse&lt;br /&gt;
for enabled SCAs when the external trigger goes. If so, I’ll add this&lt;br /&gt;
option in the *signalproc *module for you:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_on_ext*&lt;br /&gt;
&lt;br /&gt;
An array of four Booleans, that control if the test pulse for that SCA&lt;br /&gt;
fires on external trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember, in order to use the SCA test pulse at all, you must also set the&lt;br /&gt;
SCA to test mode. You can do this by going into the *sca0-3 modules* and&lt;br /&gt;
setting *test* to *functionality *(the value is *3* if you want to set it&lt;br /&gt;
via esper-tool)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Btw currently the SCAs are hard-coded to have all 72 channels receive the&lt;br /&gt;
test pulse on firing, and the option to de-select/select which channels to&lt;br /&gt;
fire is not offered. Would you like this ability? And if so do you want it&lt;br /&gt;
to set all four SCAs the same, or have an option for all 288 channels?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The waveform viewer on the webpage was removed for technical reasons, and&lt;br /&gt;
so all viewing is done via the MIDAS DAQ. There are some preliminary tools&lt;br /&gt;
I’ve created to verify the event packets and their waveforms, but I&lt;br /&gt;
wouldn’t call them easy to setup or use at the moment. (Or very  useful for&lt;br /&gt;
fine comparisons). If KO doesn’t have a way of saving the events to disk, I&lt;br /&gt;
could deliver something that captured and saved waveforms quite quickly.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Bryerton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*From:* Lars Martin&lt;br /&gt;
*Sent:* April 23, 2018 5:10 PM&lt;br /&gt;
*To:* Bryerton Shaw &amp;lt;bryerton@triumf.ca&amp;gt;&lt;br /&gt;
*Cc:* Andrea Capra &amp;lt;acapra@triumf.ca&amp;gt;&lt;br /&gt;
*Subject:* PWB/FEAM internal test pulse&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi Bryerton,&lt;br /&gt;
&lt;br /&gt;
Andrea and I would like to check the response function of the PWBs. For&lt;br /&gt;
that Daryl suggested to first look at the internal test pulse.&lt;br /&gt;
&lt;br /&gt;
Can you point us to what settings are required to make that go? And to use&lt;br /&gt;
the external trigger if we want to acquire the data?&lt;br /&gt;
&lt;br /&gt;
Ideally we would acquire Midas data from that, but it&#039;s unclear if KO&#039;s&lt;br /&gt;
frontend allows for that right now. Can we access the data with Esper&lt;br /&gt;
instead?&lt;br /&gt;
&lt;br /&gt;
Finally, we haven&#039;t had the waveform display on the web page for a while,&lt;br /&gt;
but Daryl said you guys use it. Are we using a different page somehow?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hope all is well with the baby, cheers,&lt;br /&gt;
&lt;br /&gt;
Lars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= TODO =&lt;br /&gt;
&lt;br /&gt;
* IMPOSSIBLE (ext clock only connected to clock cleaner) add frequency counter for the external clock (62.5 MHz)&lt;br /&gt;
* DONE add random delay before memtest&lt;br /&gt;
* DONE add 4 more bits to udp_delay&lt;br /&gt;
* DONE fix crash on boot if run is active and triggers arrive (check that trigger is off on boot) (do not set trigger/enable_all, ext_trig_ena, inp_trig_ena, signal_proc/force_run to 1 after boot)&lt;br /&gt;
* DONE (kludge jtag uart write()) increase size of jtag uart output buffer, make it unlimited if possible.&lt;br /&gt;
* DONE (kludge jtag uart write()) on dhcp timeout, reboot the fpga - reboot of nios does not clear the jtag uart, which becomes full and nios stops.&lt;br /&gt;
* DONE add NIOS watchdog timeout for fectrl&lt;br /&gt;
* DONE do not use external clock until instructed by fectrl (clock cleaner default is pin select mode, default pin mode is input with pull down, so clock 0 is selected, this is the ext clock. but we can drive clock select pins from the fpga).&lt;br /&gt;
* DONE change clock cleaner power up: use the 2 lines status_clkin0 and status_clkin1 to tell clock cleaner to use the internal clock (clkin2) - from the FPGA drive first line low, second line high. Also change all NIOS code that programs the clock cleaner to keep these two lines in the &amp;quot;input&amp;quot; mode. Current code switches them to &amp;quot;output&amp;quot; mode.&lt;br /&gt;
* DONE clock cleaner power up state is wrong for both choices of clock: 62.5 MHz ext clock and 125 MHz internal clock, see explanation in feam_top.sv. It looks like I need to drive status_clkin0 and status_clkin1 to &amp;quot;holdover&amp;quot; mode, both logic level 1. Currently status_clkin0 is used as SPI read line, this has to be moved to a different line first.&lt;br /&gt;
* add watchdog timeout that works in factory mode (&amp;quot;remote update&amp;quot; watchdog only works in user mode)&lt;br /&gt;
* enable HTTP pipelining - copy changes on mongoose from ADC project.&lt;br /&gt;
* reset everything if it looks like NIOS TCP/IP code has crashed, but enough code is still running to prevent tripping of the fpga-remote-update watchdog timer. such crash tends to happens when the sata link mate is rebooted and incomplete data arrives from the disrupted ethernet data path.&lt;br /&gt;
* when loading AFTER ASIC do not go into infinite loop if read-back is broken (always mismatch).&lt;br /&gt;
* read and report error status information bits for 2983fc.pdf&lt;br /&gt;
&lt;br /&gt;
= ZZZ =&lt;br /&gt;
&lt;br /&gt;
ZZZ&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=PWB&amp;diff=792</id>
		<title>PWB</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=PWB&amp;diff=792"/>
		<updated>2021-07-31T19:56:42Z</updated>

		<summary type="html">&lt;p&gt;Acapra: added all the hardware on the PWSs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Links =&lt;br /&gt;
&lt;br /&gt;
* https://bitbucket.org/expalpha/pwb_rev1_firmware&lt;br /&gt;
* https://edev-group.triumf.ca/fw/exp/alphag/feam/rev1&lt;br /&gt;
* https://edev-group.triumf.ca/hw/alphag/feam/rev1&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/170 - PWB inventory database&lt;br /&gt;
&lt;br /&gt;
= Schematics =&lt;br /&gt;
&lt;br /&gt;
* [[Image:pwb_rev0.pdf]]&lt;br /&gt;
* [[Image:Pwb-rev1-after.pdf]]&lt;br /&gt;
* [[Image:AlphaG Rev1.pdf]]&lt;br /&gt;
&lt;br /&gt;
= Manuals =&lt;br /&gt;
&lt;br /&gt;
* [[Image:AFTER_MANUAL_V1.pdf]] AFTER SCA manual v1&lt;br /&gt;
* [[Image:AFTER_DataSheet1_1.pdf]] AFTER SCA manual v1.1&lt;br /&gt;
* [[Image:AFTER_SCA_table2.pdf]] AFTER SCA channel map&lt;br /&gt;
&lt;br /&gt;
= Hardware =&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
External power supply is:&lt;br /&gt;
* +5V&lt;br /&gt;
* +2V&lt;br /&gt;
&lt;br /&gt;
Central board:&lt;br /&gt;
&lt;br /&gt;
* Ext_5V - F1 - RS1 (0.1R) - Fuse_5V&lt;br /&gt;
* Ext_2V - F2/F3 - RS2 (0.1R) - Idig2-&lt;br /&gt;
* LDO3 - Fuse_5V - DIG_3.3V - selfenable - ADM7154&lt;br /&gt;
* LDO5 - Fuse_5V - DIG_2.5V - selfenable - ADM7154&lt;br /&gt;
* LDO_CLN - Fuse5V - CLN_3.3V - selfenable - &lt;br /&gt;
* VREG - DIG_3.3V - -2.5V SCA BIAS - selfenable - LTC1983ES6-3#TRMPBF&lt;br /&gt;
* LDO7 - DIG_2.5V - DDR3_VRef - enable DDR3_1P5V, DDR3_PG, DDR3_VttEN&lt;br /&gt;
* LDO2 - Idig2V- - DIG_1.1V - enable DIG_3.3V - LT3071&lt;br /&gt;
* LDO6 - Idig2V- - DDR3_1P5V - enable DIG_3.3V - LT3083&lt;br /&gt;
&lt;br /&gt;
SCA Wing:&lt;br /&gt;
&lt;br /&gt;
* Ext_5V - F1 - RS1 (0.3R) - Isca- - SCA_Fuse5V&lt;br /&gt;
* LDO1 - SCA_Fuse5V - SCA3.3V - enable ADC_PWR_EN - ADM7154&lt;br /&gt;
* LDO2 - SCA3.3V - ADC1.8V - selfenable - ADM7154&lt;br /&gt;
* LDO3 - SCA3.3V - TRN2.5V - selfenable - LT1761&lt;br /&gt;
* REF - SCA3.3V - 1.45V Vicm - selfenable - LM4121&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Trigger and Clock distribution ==&lt;br /&gt;
&lt;br /&gt;
Clock (62.5MHz) and trigger are distributed to the PWB columns via the [https://edev-group.triumf.ca/hw/alphag/trigger-card-sata-adapter/rev1 trigger SATA adapter].&lt;br /&gt;
&lt;br /&gt;
The two miniSAS cables from cdm03 port 5 and 6 are connected to a miniSAS-SATA splitter 1-to-4 (CS Electronics &amp;quot;iSAS SATA adapter&amp;quot; ADP-887P-1X). Since there are only 8 columns and the clock and trigger signals are daisy-chained across the 8 rows, this scheme is sufficient to provide the necessary inputs to all 64 PWBs.&lt;br /&gt;
&lt;br /&gt;
== Optical Link ==&lt;br /&gt;
&lt;br /&gt;
Main data uplink.&lt;br /&gt;
&lt;br /&gt;
SFP Avago&lt;br /&gt;
&lt;br /&gt;
Optical fiber 10m &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SATA Link ==&lt;br /&gt;
&lt;br /&gt;
Secondary data uplink, capable also to deliver clock and trigger.&lt;br /&gt;
&lt;br /&gt;
= Firmware =&lt;br /&gt;
&lt;br /&gt;
== Firmware update ==&lt;br /&gt;
&lt;br /&gt;
PWB firmware update is done using &amp;quot;esper-tool&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
esper-tool -v upload -f file.rpd http://pwbNN update factory_rpd&lt;br /&gt;
esper-tool -v upload -f file.rpd http://pwbNN update file_rpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of PWB firmware pwb_rev1_20200706_ko:&lt;br /&gt;
&lt;br /&gt;
Permission to write into the flash memory is controlled by esper variables:&lt;br /&gt;
&lt;br /&gt;
* allow_write set to &amp;quot;false&amp;quot;: &amp;quot;esper-tool upload&amp;quot; does a &amp;quot;verify&amp;quot;: successful upload means epcq flash content is same as rpd file, error means content is not the same.&lt;br /&gt;
* allow_write set to &amp;quot;true&amp;quot;: &amp;quot;esper-tool upload&amp;quot; updates the epcq flash from the rpd file: for each data block, read the epcq flash, compare to rpd data, if different, erase the flash block, write the flash, read the flash, if there is a mismatch (bad write), return an error.&lt;br /&gt;
* allow_factory_write set to &amp;quot;true&amp;quot; to enable writing to the &amp;quot;factory_rpd&amp;quot;. DO NOT SET IT TO &amp;quot;true&amp;quot; UNLESS YOU MEAN TO UPDATE THE PWB BOOTLOADER. IF YOU FLASH BUM FIRMWARE or IF THERE IS A POWER OUTAGE WHILE UPDATING, THE PWB WILL BE BRICKED and has to be recovered by connecting a USB blaster.&lt;br /&gt;
&lt;br /&gt;
To update firmware of multiple boards to correct version, recommended is the script &amp;quot;update_pwb.perl&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/online/src&lt;br /&gt;
./update_pwb.perl pwb12 pwb06 pwb78&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Factory page and user page firmware boot ==&lt;br /&gt;
&lt;br /&gt;
Each PWB board has 2 firmware images: boot loader (factory page)&lt;br /&gt;
and data acquisition (user page). On power up, the FPGA loads and runs&lt;br /&gt;
the boot loader firmware from the factory page, later the control&lt;br /&gt;
software reboots the FPGA into the data acquisition firmware from&lt;br /&gt;
the user page.&lt;br /&gt;
&lt;br /&gt;
Because loading defective firmware can brick https://en.wikipedia.org/wiki/Brick_(electronics)&lt;br /&gt;
the PWB, new firmware images are loaded into the user page, if anything is wrong,&lt;br /&gt;
the PWB can still boot from the factory page and one can use the firmware update&lt;br /&gt;
function to load a good firmware image into the user page.&lt;br /&gt;
&lt;br /&gt;
The boot loader firmware in the factory page is not intended for data acquisition, it is only meant to provide three functions:&lt;br /&gt;
* boot enough hardware and software to communicate via the ethernet and the sata link&lt;br /&gt;
* firmware update (both factory page and user page)&lt;br /&gt;
* reboot into the user page&lt;br /&gt;
&lt;br /&gt;
The boot loader firmware in the factory page is usually never updated unless absolutely&lt;br /&gt;
needed to fix a problem with these three functions (i.e. compatibility with sata link communications).&lt;br /&gt;
&lt;br /&gt;
If factory image is corrupted or the contains defective firmware and the PWB does not boot (no dhcp, no ping, no esper),&lt;br /&gt;
the only way to unbrick it is by loading good firmware using a jtag flash programmer (usb-blaster). Connecting it requires&lt;br /&gt;
physical access to the jtag connector on the PWB board. It is impossible when the detector is fully assembled in the experiment.&lt;br /&gt;
&lt;br /&gt;
The PWB has a 32 Mbyte EPCQ flash memory chip, it is divided into 2 pages 16 Mbytes of factory page and 16 Mbytes of user page.&lt;br /&gt;
&lt;br /&gt;
A complete firmware image generally contains 3 pieces:&lt;br /&gt;
* FPGA firmware and NIOS &amp;quot;feam_bootloader&amp;quot; software RAM image (sof file)&lt;br /&gt;
* NIOS &amp;quot;feam&amp;quot; software RAM image (feam.elf.flash.hex) - all the C code for esper communications and PWB data acquisition&lt;br /&gt;
* NIOS filesystem image (feam.webpkg.hex) - esper web pages&lt;br /&gt;
&lt;br /&gt;
This is the boot sequence:&lt;br /&gt;
* on power-up the FPGA automatically loads the sof file from address 0 of the EPCQ flash (this is the factory image sof file)&lt;br /&gt;
* the FPGA is &amp;quot;started&amp;quot;&lt;br /&gt;
* the NIOS CPU starts executing the &amp;quot;feam_bootloader&amp;quot; C code embedded in the sof file (NIOS project hdl/software/feam_bootloader)&lt;br /&gt;
* feam_bootloader initializes the hardware (clocks, DDR memory, etc)&lt;br /&gt;
* feam_bootloader write-protects the EPCQ flash memory&lt;br /&gt;
* feam_bootloader copies the &amp;quot;feam&amp;quot; software from EPCQ flash to the DDR memory (after checking for correct checkum)&lt;br /&gt;
* feam_bootloader restarts the NIOS CPU&lt;br /&gt;
* the NIOS CPU starts running from DDR memory, executes the &amp;quot;feam&amp;quot; software (NIOS project hdl/software/feam)&lt;br /&gt;
* call main() in hdl/software/feam/src/task_init.c&lt;br /&gt;
* call task_init() in the same file&lt;br /&gt;
* infinite loop waiting for IP address via DHCP&lt;br /&gt;
* after have IP address, call task_esper() from hdl/software/feam/src/task_esper.c&lt;br /&gt;
* task_esper() creates all the esper modules, esper variables, etc,&lt;br /&gt;
* mod_http.c starts the mongoose web server&lt;br /&gt;
* PWB is open for business&lt;br /&gt;
&lt;br /&gt;
This is the protection against booting corrupted firmware:&lt;br /&gt;
* FPGA hardware loads the sof file from epcq flash and checks for correct checksum before &amp;quot;starting&amp;quot; it&lt;br /&gt;
* NIOS CPU is part of the sof file, protected by sof file checksum&lt;br /&gt;
* NIOS feam_bootloader C code is part of the sof file, protected by the sof checksum&lt;br /&gt;
* feam_bootloader checks for correct signatures and checksums of the DDR memory image&lt;br /&gt;
* &amp;quot;feam&amp;quot; C code is protected by the checksum of the DDR memory image&lt;br /&gt;
&lt;br /&gt;
== NIOS terminal ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ /opt/intelFPGA/16.1/quartus/bin/jtagconfig&lt;br /&gt;
1) USB-Blaster [2-1.2]&lt;br /&gt;
  02B030DD   5CGTFD7(B5|C5|D5)/5CGXBC7B6/..&lt;br /&gt;
$ /opt/intelFPGA/17.0/quartus/bin/nios2-terminal&lt;br /&gt;
nios2-terminal: connected to hardware target using JTAG UART on cable&lt;br /&gt;
nios2-terminal: &amp;quot;USB-Blaster [2-1.2]&amp;quot;, device 1, instance 0&lt;br /&gt;
nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate)&lt;br /&gt;
PWB Revision 1 Boot Loader&lt;br /&gt;
Ver 2.0  Build 357 - Wed Jun  6 15:05:35 PDT 2018&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flash boot loader firmware via jtag ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ /opt/intelFPGA/16.1/quartus/bin/jtagconfig&lt;br /&gt;
1) USB-Blaster [2-1.2]&lt;br /&gt;
  02B030DD   5CGTFD7(B5|C5|D5)/5CGXBC7B6/..&lt;br /&gt;
$ cd ~/online/firmware/pwb_rev1&lt;br /&gt;
$ ls -l&lt;br /&gt;
$ /opt/intelFPGA/17.1/quartus/bin/quartus_pgmw&lt;br /&gt;
... auto detect&lt;br /&gt;
... load the jic file&lt;br /&gt;
... in menu tools-&amp;gt;programmer, enable &amp;quot;unprotect device&amp;quot;&lt;br /&gt;
... start program/configure operation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flash user page firmware via esper-tool ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ cd online/src&lt;br /&gt;
$ more update_pwb.perl ### check that $fw is set to the desired firmware file&lt;br /&gt;
$ ./update_pwb.perl pwb06 ### or give more PWB names or give &amp;quot;all&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build firmware ==&lt;br /&gt;
&lt;br /&gt;
=== quartus version to use ===&lt;br /&gt;
&lt;br /&gt;
* quartus 16.1 should be used for jtag (jtagconfig and jtagd)&lt;br /&gt;
* quartus 17.0 should be used to build the PWB firmware (17.1 is not compatible)&lt;br /&gt;
&lt;br /&gt;
=== start license server ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh agmini@daq16&lt;br /&gt;
/opt/intelFPGA/17.0/quartus/linux64/lmgrd -c ~agmini/online/license-daq16.dat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== prepare the build environment ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh agmini@daq16&lt;br /&gt;
$ /opt/intelFPGA/17.0/nios2eds/nios2_command_shell.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== get latest version of the code and build it ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd online/firmware/git/pwb_rev1_firmware&lt;br /&gt;
$ git pull&lt;br /&gt;
$ git checkout alphag&lt;br /&gt;
$ git pull&lt;br /&gt;
$ ./scripts/compile_project.sh&lt;br /&gt;
... about 30-40 minutes ...&lt;br /&gt;
$ ls -l bin/*.sof bin/*.jic bin/*.rpd&lt;br /&gt;
-rw-r--r-- 1 agmini alpha 12727389 Jan 24  2018 bin/feam_rev1_auto.rpd&lt;br /&gt;
-rw-r--r-- 1 agmini alpha 33554661 Jan 24  2018 bin/feam_rev1.jic&lt;br /&gt;
-rw-r--r-- 1 agmini alpha  6974754 Jan 24  2018 bin/rev1.sof&lt;br /&gt;
$ ### feam.jic is loaded via jtag&lt;br /&gt;
$ ### feam_auto.rpd is loaded via esper&lt;br /&gt;
$ ### feam.sof is used to attach the quartus signal tap logic analyzer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== firmware build order and sequence ===&lt;br /&gt;
&lt;br /&gt;
* erase previous build&lt;br /&gt;
* regenerate qsys&lt;br /&gt;
* regenerate NIOS BSP &amp;quot;feam_bootloader_bsp&amp;quot; and &amp;quot;feam_bsp&amp;quot;&lt;br /&gt;
* build NIOS projects &amp;quot;feam_bootloader&amp;quot; and &amp;quot;feam&amp;quot;&lt;br /&gt;
* build quartus sof file (with the &amp;quot;feam_bootloader&amp;quot; nios project inside)&lt;br /&gt;
* build jic and rpd files (with the quartus sof file and the &amp;quot;feam&amp;quot; nios project inside)&lt;br /&gt;
* load sof file into the FPGA using jtag (be careful about compatible &amp;quot;feam&amp;quot; nios project already in the epcq flash)&lt;br /&gt;
* load jic file into the epcq factory page using jtag (cycle power for them to take effect)&lt;br /&gt;
* load rpd file into the epcq factory or user page using esper&lt;br /&gt;
&lt;br /&gt;
=== scripts for building the firmware ===&lt;br /&gt;
&lt;br /&gt;
* scripts/compile_project.sh - build everything from scratch:&lt;br /&gt;
* scripts/compile_qsys.sh - regenerate the main qsys component&lt;br /&gt;
* scripts/compile_nios.sh - regenerate the BSPs, then same as compile_elf.sh&lt;br /&gt;
* scripts/compile_elf.sh - build the BSPs, &amp;quot;feam_bootloader&amp;quot; and &amp;quot;feam&amp;quot; NIOS projects&lt;br /&gt;
* scripts/update_elf.sh - regenerate the rpd and jic files to include the new &amp;quot;feam&amp;quot; NIOS build (keeps the old &amp;quot;feam_bootloader&amp;quot; in the sof file)&lt;br /&gt;
* scripts/update_bootloader.sh - also regenerate the sof file to include the new &amp;quot;feam_bootloader&amp;quot; build&lt;br /&gt;
* scripts/clean_quartus.sh - prepare quartus fpga sof file to build from scratch&lt;br /&gt;
* scripts/compile_quartus.sh - build the quartus fpga sof file incrementally (run clean_quartus.sh to build from scratch).&lt;br /&gt;
* scripts/load_jtag_sof.pl bin/rev1.sof - load sof file into the FPGA. this will boot the new fpga firmware, the new feam_bootloader (if update_bootloader.sh was run), but with the old &amp;quot;feam&amp;quot; already in epcq flash. (beware of incompatible sof, &amp;quot;feam_bootloader&amp;quot; and &amp;quot;feam&amp;quot; builds!)&lt;br /&gt;
* scripts/load_jtag_jic.pl bin/feam_rev1.jic - load jic file into the EPCQ flash, same as using the graphical flash programmer tool. (this will leave the FPGA running the quartus jtag flash loader firmware, not the PWB firmware. Cycle power for new jic file to take effect).&lt;br /&gt;
&lt;br /&gt;
== ESPER Variables ==&lt;br /&gt;
&lt;br /&gt;
* Board&lt;br /&gt;
** invert_ext_trig - invert trigger signal from CDM before it drives any logic (to undo incorrect signal polarity)&lt;br /&gt;
** reset_nios - goggle up, them down to reset NIOS subsystem&lt;br /&gt;
&lt;br /&gt;
* Signalproc&lt;br /&gt;
** test_mode - ADC data is replaced with a test pattern, see test mode bits in sca_x_ch_ctrl.&lt;br /&gt;
** sca_a_ch_ctrl, sca_b_ch_ctrl, sca_c_ch_ctrl, sca_d_ch_ctrl - channel control bits:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11..0 - threshold - channel suppression threshold&lt;br /&gt;
14..12 - ctrl_test_mode - test mode:&lt;br /&gt;
         0=fixed patter 0xa5a,&lt;br /&gt;
         1=time bin counter,&lt;br /&gt;
         2=time bin counter with channel number,&lt;br /&gt;
         3=sequential adc sample counter,&lt;br /&gt;
         4={ch_crossed_out,trig_pos,trig_neg,adc[8:0]},&lt;br /&gt;
         5={trig,adc[10:0]},&lt;br /&gt;
         6={ch_crossed_min,adc[10:0]}&lt;br /&gt;
15 - ctrl_supp_mode - channel suppression mode: 0=adc&amp;lt;=(baseline-threshold), 1=adc&amp;lt;=threshold&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Link&lt;br /&gt;
** link_ctrl - sata link control. The bits are:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 - sata_link_udp_stream_in_enable - permit data flow from sata link to OFFLOAD_SATA&lt;br /&gt;
1 - udp_stream_out_enable - permit sca data flow to sata link&lt;br /&gt;
2 - sata_to_eth_enable - permit ethernet data flow from sata link to TSE_MAC&lt;br /&gt;
3 - eth_to_sata_enable - permit ethernet data flow from TSE MAC to sata link&lt;br /&gt;
4 - enable_stop_our_tx - enable flow control: allow stop_tx&lt;br /&gt;
#5 - stop_our_tx - manually activate the flow control signal into link_tx&lt;br /&gt;
6 - enable_stop_remote_tx - enable flow control: allow send &amp;quot;stop_tx&amp;quot;&lt;br /&gt;
#7 - stop_remote_tx - manually activate the flow control signal into link_tx&lt;br /&gt;
8 - tx_test_pattern_udp - udp data is replaced by test pattern 0x11111111, 0x22222222, etc.&lt;br /&gt;
9 - tx_test_pattern_eth - nios-to-sata data is replaced by test pattern 0x11111111, 0x22222222, etc.&lt;br /&gt;
10 - udp_delay_enable - delay between udp packets, see udp_delay_value below&lt;br /&gt;
11 - reboot_tx - send K_REBOOT command to the sata link mate, where it has same effect as board/reset_nios.&lt;br /&gt;
12 - sata_to_nios_disable&lt;br /&gt;
13 - nios_to_sata_disable&lt;br /&gt;
14 - &lt;br /&gt;
15 - &lt;br /&gt;
16 -&lt;br /&gt;
24..31 - udp_delay_value - delay between udp packets (top 8 bits of a 20-bit counter)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firmware data path ==&lt;br /&gt;
&lt;br /&gt;
Main data path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
feam_top&lt;br /&gt;
|&lt;br /&gt;
sca_sigproc&lt;br /&gt;
|&lt;br /&gt;
sca_event_control&lt;br /&gt;
4 * sca_control (sca_channel.sv)&lt;br /&gt;
4 * channel_fifo (1024 samples)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sca_control (sca_channel.sv)&lt;br /&gt;
|&lt;br /&gt;
state machine to control SCA read and write enables&lt;br /&gt;
|&lt;br /&gt;
sca_write_control (what does it do?!?)&lt;br /&gt;
sca_read_control&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sca_read_control&lt;br /&gt;
|&lt;br /&gt;
state machine to store ADC samples into per-channel FIFOs (channel_fifo)&lt;br /&gt;
selector to replace ADC samples with a test pattern&lt;br /&gt;
79*sca_trig_one -&amp;gt; ch_crossed_out - channel hit detector&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sca_event_control&lt;br /&gt;
|&lt;br /&gt;
event_fifo (hdl/mf/event_descriptor_fifo)&lt;br /&gt;
state machine to take ADC data from 4 per-channel FIFOs (channel_fifo) and store it into DDR memory (write addr increment is 510*8 (number of samples)*8 = 4080).&lt;br /&gt;
state machine to read transposed ADC data from DDR memory (read addr increment is 8+8=16 - 2 samples * 2 bytes * 4 sca = 16) and create 4 per-sca data streams&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data stream:&lt;br /&gt;
4 per-sca data streams from sca_event_control -&amp;gt; sca_sigproc(event_dat)&lt;br /&gt;
|&lt;br /&gt;
packet_chunker (hdl/lib/packet_chunker.sv) (4*event_dat -&amp;gt; event_segment_dat) - multiplex 4 data streams into 1 stream of UDP-sized packets&lt;br /&gt;
|&lt;br /&gt;
packet_length_prepender (hdl/lib/packet_length_prepender.sv)  (event_segment_dat -&amp;gt; udp_event_val_out)&lt;br /&gt;
|&lt;br /&gt;
udp_event_val -&amp;gt; info qsys (udp_stream_sca) and into sata link (mux channel 2).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Firmware build instructions from Bryerton (obsolete) ==&lt;br /&gt;
&lt;br /&gt;
This is the old README.md file from the firmware git repository.&lt;br /&gt;
&lt;br /&gt;
These instructions are not used to build the firmware (use scrips/compile_project.sh).&lt;br /&gt;
&lt;br /&gt;
They are still useful for figuring out which buttons to push in the altera gui programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ALPHAg FrontEnd Acquisition Module (FEAM) - REV0&lt;br /&gt;
&lt;br /&gt;
Welcome to the ALPHAg FEAM Project &lt;br /&gt;
&lt;br /&gt;
# Table of Contents&lt;br /&gt;
&lt;br /&gt;
* [Overview](#overview)&lt;br /&gt;
* [Inital Setup](#initial-setup)&lt;br /&gt;
    * [Quartus Setup](#quartus-setup)&lt;br /&gt;
        * [Create the .cdf](#create-the-cdf)&lt;br /&gt;
    * [NIOS Setup](#nios-Setup)&lt;br /&gt;
        * [Create the project files](#create-the-project-files) &lt;br /&gt;
* [Build Instructions](#build-instructions)&lt;br /&gt;
    * [Building from Quartus GUI](#building-from-quartus-gui)&lt;br /&gt;
        * [Generate the QSys File](#generate-the-qsys-file)&lt;br /&gt;
        * [Compile the NIOSII Project](#compile-the-niosii-project)&lt;br /&gt;
        * [Compile the Quartus Project](#compile-the-quartus-project)&lt;br /&gt;
    * [Building from Scripts](#building-from-scripts)&lt;br /&gt;
    * [Installing from JTAG](#installing-from-jtag)&lt;br /&gt;
    * [Installing from ESPER](#installing-from-esper)&lt;br /&gt;
&lt;br /&gt;
# Overview&lt;br /&gt;
&lt;br /&gt;
The FEAM is a digitizer located on the ALPHAg detector. Each FEAM consists of 4 AFTER SCAs for a total of 288 channels.&lt;br /&gt;
&lt;br /&gt;
# Initial Setup&lt;br /&gt;
&lt;br /&gt;
## Quartus Setup&lt;br /&gt;
&lt;br /&gt;
### Create the .cdf&lt;br /&gt;
1. Open Quartus Prime Standard Edition&lt;br /&gt;
2. Click on **Tools -&amp;gt; Programmer**. The **Programmer** window will appear&lt;br /&gt;
3. In the **Programmer** window, click **Auto Detect**. A **Select Device** dialog box will appear&lt;br /&gt;
    1. (Optional) If **Auto Detect** is greyed out, click on **Hardware Setup**. The **Hardware Setup** dialog box will appear&lt;br /&gt;
    2. Under **Hardware Settings**, double-click on the USB JTAG hardware you wish to use&lt;br /&gt;
    3. Click **Close**. The **Hardware Setup** dialog box will close&lt;br /&gt;
5. Click on **File -&amp;gt; Save As**. The **Save As** dialog box will appear&lt;br /&gt;
6. In the **Save As** dialog box, browse to the **/\&amp;lt;project_dir\&amp;gt;/bin/** directory&lt;br /&gt;
7. Make sure the **Add file to current project** checkbox is checked&lt;br /&gt;
7. In the **File name** input box, type &amp;quot;alphag_feam.cdf&amp;quot; and click **Save**&lt;br /&gt;
8. Close the **Programmer** window&lt;br /&gt;
9. Done!&lt;br /&gt;
&lt;br /&gt;
## NIOS Setup&lt;br /&gt;
&lt;br /&gt;
### Create the project files&lt;br /&gt;
1. Open Quartus Prime Standard Edition&lt;br /&gt;
2. Open the NIOS II Software Build Tools by clicking **Tools -&amp;gt; NIOS II Software Build Tools for Eclipse**&lt;br /&gt;
3. The **Workspace Launcher** window will appear, click *OK* to accept the default workspace.&lt;br /&gt;
4. Click **File -&amp;gt; Import...**. The **Import** dialog box will appear&lt;br /&gt;
5. Click on **General -&amp;gt; Existing Projects into Workspace**&lt;br /&gt;
6. Click **Next \&amp;gt;**&lt;br /&gt;
7. Next to **Select root directory** click **Browse...**. A **Browse for Folder** dialog box will appear&lt;br /&gt;
8. Browse to **/\&amp;lt;project_dir\&amp;gt;/hdl/software** and click **OK**&lt;br /&gt;
8. Four Projects should appear in the **Projects** panel: &lt;br /&gt;
    * alphag_feam&lt;br /&gt;
    * alphag\_feam\_bsp &lt;br /&gt;
    * alphag\_feam\_bootloader&lt;br /&gt;
    * alphag\_feam\_bootloader\_bsp&lt;br /&gt;
9. Click **Select All**&lt;br /&gt;
10. Click **Finish**&lt;br /&gt;
11. Done!&lt;br /&gt;
 &lt;br /&gt;
# Build Instructions&lt;br /&gt;
&lt;br /&gt;
## Building from Quartus GUI&lt;br /&gt;
&lt;br /&gt;
**Warning: Please use Quartus Prime Standard Edition 16.1**&lt;br /&gt;
### Generate the QSys File&lt;br /&gt;
1. Open Quartus Standard Edition 16.1&lt;br /&gt;
1. Open QSys by clicking **Tools -&amp;gt; QSys**&lt;br /&gt;
2. Click on **File -&amp;gt; Open** (CTRL+O). An **Open File** dialog box should appear.&lt;br /&gt;
3. Select the **alphag_feam.qsys** file from the **/\&amp;lt;project_dir\&amp;gt;/hdl** directory and click **Open**&lt;br /&gt;
4. Modify as necessary. NOTE: Any change to the QSys, even cosmetic such as expanding or collapsing components will cause the QSys to desire a re-generate. &lt;br /&gt;
5. Click **File -&amp;gt; Save** (CTRL+S)&lt;br /&gt;
6. Click **Generate HDL**. A **Generation** dialog box will appear &lt;br /&gt;
7. Select the settings you desire to be changed, if any&lt;br /&gt;
8. Click **Generate**&lt;br /&gt;
9. Wait for the generation to complete.&lt;br /&gt;
10. Done!&lt;br /&gt;
&lt;br /&gt;
### Compile the NIOSII Project&lt;br /&gt;
1. Open the NIOS II Software Build Tools by clicking **Tools -&amp;gt; NIOS II Software Build Tools for Eclipse**&lt;br /&gt;
2. (Optional) If the QSys file has been re-generated performing the following&lt;br /&gt;
    1. Right-click on **alphag\_feam\_bsp** and select **NIOS II -&amp;gt; Generate BSP**. The BSP will regenerate&lt;br /&gt;
    2. Right-click on **alphag\_feam\_bootloader\_bsp** and select **NIOS II -&amp;gt; Generate BSP**. The BSP will regenerate&lt;br /&gt;
3. Modify files as needed. WARNING: Do not modify any BSP files by hand! All changes will be lost on next generate.&lt;br /&gt;
4. Click **Project -&amp;gt; Build All** (CTRL+B). If your workspace as multiple projects, it is recommend to close all but the ones related to the FEAM.&lt;br /&gt;
5. Right-click on **alphag\_feam\_bootloader** and select **Make Targets -&amp;gt; Build...**. The **Make Targets** dialog box will appear&lt;br /&gt;
6. In the **Make Targets** dialog box, select **mem\_init\_generate** and click **Build**&lt;br /&gt;
7. Done!&lt;br /&gt;
&lt;br /&gt;
### Compile the Quartus Project&lt;br /&gt;
1. Open Quartus Standard Edition 16.1&lt;br /&gt;
1. Under **Processing** click **Start Compilation** (CTRL+L)&lt;br /&gt;
2. Wait about 16-30 minutes.&lt;br /&gt;
3. Done!&lt;br /&gt;
  &lt;br /&gt;
**Note:** If Quartus crashed while compiling, delete the **\&amp;lt;project_dir\&amp;gt;/hdl/db** and **\&amp;lt;project_dir\&amp;gt;/hdl/incremental_db** directories and try again&lt;br /&gt;
  &lt;br /&gt;
## Installing from JTAG&lt;br /&gt;
1. Generate the .jic file using the provided /bin/alphag\_feam\_jic.cof&lt;br /&gt;
    1. In the main Quartus window, click **File -&amp;gt; Convert Programming Files**, A **Convert Programming Files** window will appear&lt;br /&gt;
    2. In the **Convert Programming Files** window, click **Open Conversion Setup Data**. An **Open** dialog box will appear&lt;br /&gt;
    3. In the **Open** dialog box, select the **alphag_feam.cof** file located in **/bin/**&lt;br /&gt;
    4. Click **Open**. The **Open dialog box will close&lt;br /&gt;
        * Note the **File name** field, it should display /\&amp;lt;project\_dir\&amp;gt;/bin/alphag\_feam.jic&lt;br /&gt;
    5. In the **Convert Programming Files** window, click **Generate**&lt;br /&gt;
    6. When the .jic is done being generated, a small dialog box will appear, click **OK**&lt;br /&gt;
    7. In the **Convert Programming Files** window, click **Close**&lt;br /&gt;
2. Load the .JIC file using the Programmer&lt;br /&gt;
    1. In the main Quartus window in the **Project Navigator** drop-down input select **Files**.&lt;br /&gt;
    2. Scroll down the window and find the **alphag_feam.cdf**, and double-click it. The **Programmer** window will open&lt;br /&gt;
    3. Click on the icon labelled **5CGXFC4C6**&lt;br /&gt;
    4. Click on the **Change File** button. The **Select New Programming File** dialog box will appear&lt;br /&gt;
    5. Browse to **/\&amp;lt;project_dir\&amp;gt;/bin/** and select **alphag\_feam.jic**&lt;br /&gt;
    6. Click Open. The **Select New Programming File** dialog box will close&lt;br /&gt;
    7. In the main panel, check the **Program/Configure** box on the line that starts **./bin/alphag\_feam.jic**&lt;br /&gt;
    8. Click the **Start** button&lt;br /&gt;
    9. Wait for the **Progress** bar to go to 100% and stop&lt;br /&gt;
    10. Done!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Internal test pulser =&lt;br /&gt;
&lt;br /&gt;
Documentation from Bryerton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---------- Forwarded message ---------&lt;br /&gt;
From: Bryerton Shaw &amp;lt;bryerton@triumf.ca&amp;gt;&lt;br /&gt;
Date: Tue, 24 Apr 2018 at 16:18&lt;br /&gt;
Subject: RE: PWB/FEAM internal test pulse&lt;br /&gt;
To: Lars Martin &amp;lt;lmartin@triumf.ca&amp;gt;&lt;br /&gt;
Cc: Andrea Capra &amp;lt;acapra@triumf.ca&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi Lars (and Andrea),&lt;br /&gt;
&lt;br /&gt;
In the new(er) firmware the test pulse code has been modified slightly to&lt;br /&gt;
fit in better with the upgraded trigger system. I can add an option to&lt;br /&gt;
allow it to be triggered by the external trigger (currently it has an&lt;br /&gt;
interval option, or you can hit the manual trigger to fire it, if it’s&lt;br /&gt;
enabled)&lt;br /&gt;
&lt;br /&gt;
The *options for the test pulser* are under the *signalproc module*:&lt;br /&gt;
&lt;br /&gt;
*test_pulse_ena*&lt;br /&gt;
&lt;br /&gt;
An array of four booleans, that control turning on the test pulse for each&lt;br /&gt;
SCA. If this is False, the other options below will do nothings for that SCA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_interval_ena*&lt;br /&gt;
&lt;br /&gt;
An array of four booleans, that control turning on the interval trigger for&lt;br /&gt;
each SCA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_interval*&lt;br /&gt;
&lt;br /&gt;
An unsigned 32-bit value that marks how many 16ns clock cycles occur&lt;br /&gt;
between interval triggers. Only one value, as there is only one interval&lt;br /&gt;
timer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_wdt*&lt;br /&gt;
&lt;br /&gt;
An array of four 16-bit unsigned integers that control the width of the&lt;br /&gt;
pulse for each SCA when the trigger occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, there is a second set of options to control the delay of the *test&lt;br /&gt;
pulse interval trigger*. These options are located under the *trigger&lt;br /&gt;
module*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*intp_trig_ena*&lt;br /&gt;
&lt;br /&gt;
Boolean value enabling/disabling the interval test pulse trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*intp_trig_delay*&lt;br /&gt;
&lt;br /&gt;
Unsigned 32-bit integer controlling the trigger delay, which is the time&lt;br /&gt;
between when the trigger is requested, and when the trigger actually fires.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can setup the interval trigger and use that to create event packets&lt;br /&gt;
with the test pulse on set intervals. If the interval trigger is&lt;br /&gt;
insufficient, I can create another option, which is to fire the test pulse&lt;br /&gt;
for enabled SCAs when the external trigger goes. If so, I’ll add this&lt;br /&gt;
option in the *signalproc *module for you:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*test_pulse_on_ext*&lt;br /&gt;
&lt;br /&gt;
An array of four Booleans, that control if the test pulse for that SCA&lt;br /&gt;
fires on external trigger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remember, in order to use the SCA test pulse at all, you must also set the&lt;br /&gt;
SCA to test mode. You can do this by going into the *sca0-3 modules* and&lt;br /&gt;
setting *test* to *functionality *(the value is *3* if you want to set it&lt;br /&gt;
via esper-tool)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Btw currently the SCAs are hard-coded to have all 72 channels receive the&lt;br /&gt;
test pulse on firing, and the option to de-select/select which channels to&lt;br /&gt;
fire is not offered. Would you like this ability? And if so do you want it&lt;br /&gt;
to set all four SCAs the same, or have an option for all 288 channels?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The waveform viewer on the webpage was removed for technical reasons, and&lt;br /&gt;
so all viewing is done via the MIDAS DAQ. There are some preliminary tools&lt;br /&gt;
I’ve created to verify the event packets and their waveforms, but I&lt;br /&gt;
wouldn’t call them easy to setup or use at the moment. (Or very  useful for&lt;br /&gt;
fine comparisons). If KO doesn’t have a way of saving the events to disk, I&lt;br /&gt;
could deliver something that captured and saved waveforms quite quickly.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Bryerton&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*From:* Lars Martin&lt;br /&gt;
*Sent:* April 23, 2018 5:10 PM&lt;br /&gt;
*To:* Bryerton Shaw &amp;lt;bryerton@triumf.ca&amp;gt;&lt;br /&gt;
*Cc:* Andrea Capra &amp;lt;acapra@triumf.ca&amp;gt;&lt;br /&gt;
*Subject:* PWB/FEAM internal test pulse&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hi Bryerton,&lt;br /&gt;
&lt;br /&gt;
Andrea and I would like to check the response function of the PWBs. For&lt;br /&gt;
that Daryl suggested to first look at the internal test pulse.&lt;br /&gt;
&lt;br /&gt;
Can you point us to what settings are required to make that go? And to use&lt;br /&gt;
the external trigger if we want to acquire the data?&lt;br /&gt;
&lt;br /&gt;
Ideally we would acquire Midas data from that, but it&#039;s unclear if KO&#039;s&lt;br /&gt;
frontend allows for that right now. Can we access the data with Esper&lt;br /&gt;
instead?&lt;br /&gt;
&lt;br /&gt;
Finally, we haven&#039;t had the waveform display on the web page for a while,&lt;br /&gt;
but Daryl said you guys use it. Are we using a different page somehow?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hope all is well with the baby, cheers,&lt;br /&gt;
&lt;br /&gt;
Lars&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= TODO =&lt;br /&gt;
&lt;br /&gt;
* IMPOSSIBLE (ext clock only connected to clock cleaner) add frequency counter for the external clock (62.5 MHz)&lt;br /&gt;
* DONE add random delay before memtest&lt;br /&gt;
* DONE add 4 more bits to udp_delay&lt;br /&gt;
* DONE fix crash on boot if run is active and triggers arrive (check that trigger is off on boot) (do not set trigger/enable_all, ext_trig_ena, inp_trig_ena, signal_proc/force_run to 1 after boot)&lt;br /&gt;
* DONE (kludge jtag uart write()) increase size of jtag uart output buffer, make it unlimited if possible.&lt;br /&gt;
* DONE (kludge jtag uart write()) on dhcp timeout, reboot the fpga - reboot of nios does not clear the jtag uart, which becomes full and nios stops.&lt;br /&gt;
* DONE add NIOS watchdog timeout for fectrl&lt;br /&gt;
* DONE do not use external clock until instructed by fectrl (clock cleaner default is pin select mode, default pin mode is input with pull down, so clock 0 is selected, this is the ext clock. but we can drive clock select pins from the fpga).&lt;br /&gt;
* DONE change clock cleaner power up: use the 2 lines status_clkin0 and status_clkin1 to tell clock cleaner to use the internal clock (clkin2) - from the FPGA drive first line low, second line high. Also change all NIOS code that programs the clock cleaner to keep these two lines in the &amp;quot;input&amp;quot; mode. Current code switches them to &amp;quot;output&amp;quot; mode.&lt;br /&gt;
* DONE clock cleaner power up state is wrong for both choices of clock: 62.5 MHz ext clock and 125 MHz internal clock, see explanation in feam_top.sv. It looks like I need to drive status_clkin0 and status_clkin1 to &amp;quot;holdover&amp;quot; mode, both logic level 1. Currently status_clkin0 is used as SPI read line, this has to be moved to a different line first.&lt;br /&gt;
* add watchdog timeout that works in factory mode (&amp;quot;remote update&amp;quot; watchdog only works in user mode)&lt;br /&gt;
* enable HTTP pipelining - copy changes on mongoose from ADC project.&lt;br /&gt;
* reset everything if it looks like NIOS TCP/IP code has crashed, but enough code is still running to prevent tripping of the fpga-remote-update watchdog timer. such crash tends to happens when the sata link mate is rebooted and incomplete data arrives from the disrupted ethernet data path.&lt;br /&gt;
* when loading AFTER ASIC do not go into infinite loop if read-back is broken (always mismatch).&lt;br /&gt;
* read and report error status information bits for 2983fc.pdf&lt;br /&gt;
&lt;br /&gt;
= ZZZ =&lt;br /&gt;
&lt;br /&gt;
ZZZ&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:TPC_magnetometer_locations.pdf&amp;diff=730</id>
		<title>File:TPC magnetometer locations.pdf</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:TPC_magnetometer_locations.pdf&amp;diff=730"/>
		<updated>2021-06-03T23:16:29Z</updated>

		<summary type="html">&lt;p&gt;Acapra: Acapra uploaded a new version of File:TPC magnetometer locations.pdf&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sketch of NMR+Hall in the TPC&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=688</id>
		<title>Detector Services</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=688"/>
		<updated>2021-04-10T04:12:24Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Main Page]]&lt;br /&gt;
&lt;br /&gt;
= Table of Figures =&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684884|Figure 1 - Gas system schematic 6]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684885|Figure 2 - A half-rack space is used for the gas control implementation. 7]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684886|Figure 3 - Gas system half rack ready for installation 8]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684887|Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684888|Figure 5 - Water cooling system during test. 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684889|Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system. 12]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684890|Figure 7 - Overall water cooling system 13]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684891|Figure 8 - Temperature Monitor Board 14]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684892|Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections 15]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684893|Figure 10 – Unpotted Anode Wire Card and Board with HV distribution 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684894|Figure 11 - Anode wire pins and Field wire pins under yellow cover 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684895|Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire 18]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684896|Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards 19]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684897|Figure 14 - Overall Low voltage distribution for anode wires and cathode pads 21]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684898|Figure 15 - High Voltage &amp;amp;amp; Grounding scheme for the rTPC 22]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684899|Figure 16- Alpha-g rTPC rack organization 23]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684457&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This document is to describe the different services for the rTPC detector. 3 main sections cover the &#039;&#039;Gas system&#039;&#039;, the &#039;&#039;Water cooling system&#039;&#039; and the &#039;&#039;Power distribution&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= References and related Documents =&lt;br /&gt;
&lt;br /&gt;
A dedicated TRIUMF Wiki site gathers all documentations for the rTPC detector system and equipment. Gas system, cooling water system and power distribution can be found there.&lt;br /&gt;
&lt;br /&gt;
= Gas system =&lt;br /&gt;
&lt;br /&gt;
The gas system as described below includes the entire gas infrastructure required to deliver gas to the detector, monitor and control the gas flow into the detector. It also includes the necessary equipment to notify any change from the nominal gas flow or gas mixture ratio delivered to the detector.&lt;br /&gt;
&lt;br /&gt;
This type of mixed gas system is well understood by the Triumf detector group staff and no issue in its realization is expected.&lt;br /&gt;
&lt;br /&gt;
This system is a stand-alone infrastructure assembled and delivered to CERN. It will be placed in the Alpha-g experimental area floor. The delivery of the different gases to the experimental area is under the responsibility of the Gas handling group from CERN.&lt;br /&gt;
&lt;br /&gt;
The gas delivery system for the radial TPC (rTPC) is to provide Ar/CO2 gas mixture between 90/10 to 50/50 depending on the user requirements. This system does not recycle the gas as the environmental impact of either gas is minimal and the operation cost versus a recycling system would not be economic.&lt;br /&gt;
&lt;br /&gt;
In the event of an additional quenching gas requirement, the overall gas system will have to be reconsidered and possible recycling system envisaged.&lt;br /&gt;
&lt;br /&gt;
A simple gas mixer using digital flow meters will provide the precise mixture dialed by hand in the control system.&lt;br /&gt;
&lt;br /&gt;
During the prototype phase, an ad-hoc gas system will be put in place. A portable gas system is available for such a test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameter&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Value&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Gas mixture&lt;br /&gt;
| Ar/CO2 (90/10..50/50)&lt;br /&gt;
|-&lt;br /&gt;
| Gas flow requirements&lt;br /&gt;
| 0.3l/min (50%), 0.3l/min (50%)&lt;br /&gt;
|-&lt;br /&gt;
| Detector gas Volume&lt;br /&gt;
| 0.18m&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Flushing time&lt;br /&gt;
| 5h @ 600cc/min&lt;br /&gt;
|-&lt;br /&gt;
| Flow rate&lt;br /&gt;
| 100 to 300 cc/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
This gas system is quite simple as it takes 2 or 3 (spare) gas supplies and mixes them in a manifold before delivery to the rTPC detector. Necessary valves for purging lines and by-passing the detector are foreseen. The individual in-flows are controlled by gas dedicated mass flow controllers (MFC-x). The return flow is measured for leak assessment. An additional manometer monitors the internal detector pressure for evaluation of the electron drift characteristics.&lt;br /&gt;
&lt;br /&gt;
­­­­[[File:imageservice2.png|575x315px|PA_doc-1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684492&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684884&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 1 - Gas system schematic&lt;br /&gt;
&lt;br /&gt;
The main flow controller and monitoring is performed by industrial devices from MKS. We added analog flowmeters on each gas line to provide a quick visual inspection of the gas mixing system.&lt;br /&gt;
&lt;br /&gt;
This system will be hooked to the CERN AD-Gas facility. The CERN gas delivers gas through 2 switchable packs of 12 bottles for each gas.&lt;br /&gt;
&lt;br /&gt;
The gas exhaust is evacuated to the exterior of the experimental area with an elevation of about 8m.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice3.png|366x263px|PA_doc-2.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684493&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684885&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 2 - A half-rack space is used for the gas control implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450557826&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice4.png|324x364px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684494&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684886&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 3 - Gas system half rack ready for installation&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
[[File:20181205 103217.jpg|thumb|Normal configuration of the manual valves of the GHS.]]&lt;br /&gt;
From-scratch (Neither gas supply lines to the GHS nor connections to and from the TPC connected) connection of the GHS should follow the following procedure:&lt;br /&gt;
# &#039;&#039;&#039;Flush supply lines:&#039;&#039;&#039; Gas lines from outside bottles going to the GHS should be briefly (5 min or so) flushed with a high gas flow &#039;&#039;before&#039;&#039; connecting to the GHS to remove possible dust, and to minimize the amount of air in the lines.&lt;br /&gt;
# &#039;&#039;&#039;Flush GHS:&#039;&#039;&#039;&lt;br /&gt;
## Close BV1 and BV3, open BV2 and BV4 to flush input lines, only briefly.&lt;br /&gt;
## Open BV1 and BV3, close BV2 and BV4 (normal operation configuration)&lt;br /&gt;
## With Midas frontend running, use the &amp;quot;Gas&amp;quot; custom page to set a desired flow, for flushing probably between 1l/min and 1.5l/min (Without Midas, use the telnet interface), then press the &amp;quot;Bypass Flow&amp;quot; button, and let flow for a while (5-15min?)&lt;br /&gt;
# &#039;&#039;&#039;Flush TPC input line:&#039;&#039;&#039;&lt;br /&gt;
## Connect the line that will go from the GHS to the TPC input-tee on the GHS side, but leave disconnected from the tee&lt;br /&gt;
## do the same for the pressure gauge line&lt;br /&gt;
## On the &amp;quot;Gas&amp;quot; custom page, press the &amp;quot;Flow TPC&amp;quot; button and let flow for 5 min (Without Midas, use the telnet interface).&lt;br /&gt;
# Make all remaining connections&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&#039;&#039;&#039; No flow &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure that the black valves on the gas rack at the entrance of the zone are open (right on the pictures).&lt;br /&gt;
&lt;br /&gt;
[[File:20190109 165410.jpg|thumb|The rightmost valve (black) must be open during operation.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Telnet Interface ==&lt;br /&gt;
If the Midas frontend is not available the GHS can be controlled via telnet. Connect with&lt;br /&gt;
 telnet algas&lt;br /&gt;
then use the following command to control solenoid valves:&lt;br /&gt;
 cowr do i 1&lt;br /&gt;
to energize SVi, i.e. to switch it from its normal closed or open state to the other state,&lt;br /&gt;
 cowr do i 0&lt;br /&gt;
to de-energize, i.e. switch to default state.&lt;br /&gt;
&lt;br /&gt;
Gas flow is set with:&lt;br /&gt;
 mfcwr ao i &amp;lt;desired flow&amp;gt;&lt;br /&gt;
where i is 1 for Ar and 2 for CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, and the desired flow is in the internal units of the system.&lt;br /&gt;
&lt;br /&gt;
= Water cooling system =&lt;br /&gt;
&lt;br /&gt;
The outer surface of the detector has an arrangement of 8x8 electronics boards handling the readout of the cathode pads. These boards require operating at a controlled temperature to prevent heat build-up at the surface of the detector and improving the reliability of the system. In order to do so, 8 independent water pipe loops running from the bottom-up and down in the longitudinal axis of the detector are in a thermal contact to 8 successive readout boards. From the bottom, a pair of water hoses connect to 2 custom 3D-printed manifolds supplying the water feed and return to the 8 water loops.&lt;br /&gt;
&lt;br /&gt;
These 8 loops are run in parallel to a negative pressure water cooling system. This negative pressure system is to ensure that no water leak will damage the electronics even during possible pipe or delivery hose breakage.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice5.png|516x273px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960816&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684495&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684887&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice6.jpg|249x429px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960817&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684496&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684888&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 5 - Water cooling system during test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameters&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Values&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Number of parallel water loops&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| Copper pipe OD/ID&lt;br /&gt;
| ¼” / 4.7mm&lt;br /&gt;
|-&lt;br /&gt;
| Length of one loop (on the rTPC)&lt;br /&gt;
| 4.6m&lt;br /&gt;
|-&lt;br /&gt;
| Water speed per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Pressure drop per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Power extraction per water loop&lt;br /&gt;
| 8x15W= 120W&lt;br /&gt;
|-&lt;br /&gt;
| Total cooling power&lt;br /&gt;
| 1KW&lt;br /&gt;
|-&lt;br /&gt;
| Inlet water temperature&lt;br /&gt;
| 16..20 degC (to be confirmed)&lt;br /&gt;
|-&lt;br /&gt;
| Outlet water temperature&lt;br /&gt;
| 20..24 degC&lt;br /&gt;
|-&lt;br /&gt;
| Total water flow&lt;br /&gt;
| 3..6 l/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This description corresponds to how we think the system should work, but doesn&#039;t seem fully comatible with the behaviour of the system. E.g. the air pump only seems to turn on when PID1 falls below a certain value.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Pressure PID (proportional/integral/differential controller), PID2, monitors the air pressure in the vacuum vessel. When the pressure rises above a trigger value (perhaps 350mbar) it activates the aspirator vacuum pump to bring the pressure down to maintain a long time averaged pressure (say 300mbar).&lt;br /&gt;
&lt;br /&gt;
This vacuum is then used to draw water through the detector into the vessel, from the Open Tank. The vacuum vessel&#039;s water level is monitored by PID1, using a differential pressure transducer measuring the weight of the water column by the difference between the air pressure in the top of the vessel and the water pressure at the bottom of the vessel. PID1 provides a variable signal to the Proportional Solenoid Valve, which varies the flow through the return loop around the (fixed flow) water pump, and thus changing the overall flow of water from the vacuum vessel to keep the water level in the vessel constant despite water being constantly drawn in by the vacuum. The water pulled from the vacuum vessel is pushed through the filter and into the Open Tank, completing the circulation.&lt;br /&gt;
&lt;br /&gt;
Cooling is accomplished in the water pump leg of the system, as coolant pulled from the vacuum vessel passes through a heat exchanger coupled to CERN’s cooling water supply on its way to the pump. The rate that water flows through the system can be determined by many obstacles in the loop, but ideally it should be dominated by the position of the main Throttle Valve. Other valves should generally be set either fully open of fully closed, except for the Proportional Valve, whose position responds to the setting of the Throttle Valve.&lt;br /&gt;
&lt;br /&gt;
Data outputs: there are five data outputs planned. The two process variables, the vacuum vessel absolute pressure, and differential water column pressure, will be sent to the Detector DAQ system. As well, the total flow rate is monitored by the flow meter, whose output is sent to the DAQ system. This data is not used by the circulation system itself. Likewise, the back pressure on the water filter is only sent to the DAQ system to indicate if the filter may need changing, and the temperature of the open tank is monitored and sent to the DAQ system, but currently there is no plan to use it in a temperature control feedback. The temperature of CERN&#039;s cooling water supply is not yet known, but we expect we can set the heat exchanger to run at a rate to hold the system temperature near 20°C without feedback control.&lt;br /&gt;
&lt;br /&gt;
For the negative pressure to work effectively to prevent leaks, the water pressure in the detector ought to be down at least to half an atmosphere. With the detector cooling tubes 8x 4.6m of parallel 4.7mm ID copper tubes (2.3m down then 2.3 back-ups), and the supply using (perhaps 6m, 3 to the detector then 3 back) 9.7mm ID (=1/2&amp;amp;quot; OD) poly tubing, the flow will need to be somewhat greater than the required 3 l/min in order to maintain that degree of vacuum in the detector, unless the Throttle Valve is placed upstream of the detector near the Open Tank, or an additional constriction is added in that region.&lt;br /&gt;
&lt;br /&gt;
The water pump leg of the circuit residing in the water cooling/gas rack is placed far enough from the fringe field of the superconducting magnet to prevent disruptive effects on the solenoid valves and electric motors. Therefore the main 1/2&amp;amp;quot; poly line to and from the water pump and its flow loop will add a pressure drop which is estimated at 0.4atm for a 10m line at 6 l/min (9.7mmID), which is within our requirements. As mentioned earlier, the splitting (and reassembly) of the line to the 8 cooling lines close to detector will be accomplished with the use of 2 separate manifolds equipped with temperature sensors for constant in/out global water temperature monitoring.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice7.png|286x206px]][[File:imageservice8.jpg|286x206px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684497&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684889&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system.&lt;br /&gt;
&lt;br /&gt;
Currently, PVC valves with &amp;amp;quot;true union&amp;amp;quot; couplings are planned to be provided around the water pump to permit it to be swapped out from the system for servicing and a valved bypass to the water filter is provided for the same purpose to allow easily changing filter elements with the system running. True union valves are generally only available to 1/2NPT and larger, so an adapter fitting is required. The vacuum pump for the system is a small (2 x 5 x 7.5cm) cascaded dual Venturi aspirator, which is operated with site air, switched with two simultaneously operated normally closed solenoid valves, one for the site air, and one for the vessel vacuum input. If the system is leak free, the vacuum in the vessel should only be degraded by the dissolved air absorbed in the Open Tank and extracted in the vacuum vessel, which from past experience might mean running for under a minute every six hours or so.&lt;br /&gt;
&lt;br /&gt;
The wetted surfaces of this system will be mainly PVC and Polyethylene for the valves, tubing and vessels, plus brass fittings, and the copper cooling tubes, and the surfaces of the heat exchanger, which will most likely be stainless steel. It may be possible to devise an equivalent of a bellows communicating with the Open Tank, so that it is only virtually open, thus sealing the cooling water from contaminants, which may allow us to run with just distilled water plus a strip of silver as a biocide (although I&#039;m not sure if the mix of metals, copper plus stainless, may not interfere with the function of the silver, which is mostly used in computer cooling systems which are copper and plastic only). Otherwise, we will need a biocide and corrosion inhibitor. We have the latter, tolyltriazole, but the biocide is problematic. They tend to be short-lived; for systems which are open to atmosphere, typical industrial practice is chlorination, regularly refreshed, which builds up NaCl as it degrades, making the coolant corrosive. For T2K in Japan, we used the (human-nontoxic) &amp;amp;quot;Germall&amp;amp;quot;, which has a two-year lifetime, after which when its effectiveness decays it turns into food, which is the case for any solute that is not actively biocidal. Eventually, any such additives build up and require the coolant to be flushed and replaced. Silver is a lovely method, but only works for extended periods with a sealed system which remains deoxygenated. My research so far has not turned up a good candidate which does not entail recurring changes of the coolant.&lt;br /&gt;
&lt;br /&gt;
Power: the system needs to be able to run on European 220VAC power, but also operate here for testing purposes. The PIDs (Omega CN76160s) will accept both; for the rest of the system, I will have an a universal 90-240VAC input to 24VDC (5A) supply which will drive all the other components, including the pump, which will be a brushless 24VDC centrifugal pump, 1 - 1.5A range. The whole system will run about 125W.&lt;br /&gt;
&lt;br /&gt;
Information on the temperature and flow rate of the CERN cooling water system will be provided later but we don’t anticipate any major issues about the sizing of the heat exchanger.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice9.png|603x344px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960818&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684498&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684890&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 7 - Overall water cooling system&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564356&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Temperature Measurement ==&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice10.jpeg|225x356px]] [[File:imageservice11.png|194x358px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684499&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684891&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 8 Temperature Monitor Board&lt;br /&gt;
&lt;br /&gt;
The water temperature is read by the Temperature Monitor Board (TEMPB). Thermistors located inside the manifold connect to a 16 bit ADC on the TEMPB which is read out by a Raspberry Pi mounted on board. In a similar manner the air system temperature is read with sensors in the air manifold. The TEMPB can provide temperature readout of 32 thermistors which connect to terminal blocks. The channels can also be readout differentially providing up to 16 channels for thermocouples. An on board thermistor allows for cold junction compensation. The board is powered via USB on the Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
This assumes all water lines and compressed air are connected, and both the blue water tank and the chiller are filled.&lt;br /&gt;
&lt;br /&gt;
=== Begin running ===&lt;br /&gt;
# Close vent valve and main valve (3-way valve in T position)&lt;br /&gt;
# Switch on control box with power switch in the back&lt;br /&gt;
# confirm water pump is off, i.e. blue button is not illuminated&lt;br /&gt;
# Vacuum pump should now be running&lt;br /&gt;
# Open main valve, i.e. vertical connection open, connection to vent valve closed [[File:PWBmainOpen.jpg|thumb|Cooling system main valve open]]&lt;br /&gt;
# water should start flowing through the PWB cooling system and coming back through the clear pipe connected to the vacuum vessel&lt;br /&gt;
# Default settings are PID1 = 200, PID2 = 300, but may have been adjusted&lt;br /&gt;
# once the water level in the vacuum vessel has risen to ~20cm, turn on the water pump&lt;br /&gt;
&lt;br /&gt;
=== Drain system ===&lt;br /&gt;
# from normal operation, i.e. vacuum pump and water pump running&lt;br /&gt;
# switch main valve to upside down T position &lt;br /&gt;
[[File:PWBmainVent.jpg|thumb|Cooling system main valve to vent valve]]&lt;br /&gt;
# open vent valve&lt;br /&gt;
# air should now enter the system, draining all water from the TPC pipes into the vacuum vessel&lt;br /&gt;
# water pump will drain the vacuum vessel into supply tank, turn it off before the vessel is completely empty to avoid air in the water pump&lt;br /&gt;
# switch off main power&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
The water system is temperamental, and not intuitive at all. Common problems and solution attempts:&lt;br /&gt;
&lt;br /&gt;
; water pump very loud, doesn&#039;t appear to pump water&lt;br /&gt;
: most likely air in the water pump. Open the vent of the vacuum vessel to allow water to enter pump by gravity alone, pump should stop screaming and start pumping. Close vent.&lt;br /&gt;
; vacuum pump comes on often (more then every 10-20 min)&lt;br /&gt;
: probably an air leak in the system. Check for bubbles and try to find leak.&lt;br /&gt;
; water level/flow/vacuum oscillate between extreme values&lt;br /&gt;
: unclear, try playing with PID settings, throttle valve, possibly orange ball valves by the water pump.&lt;br /&gt;
&lt;br /&gt;
= Air Cooling =&lt;br /&gt;
&lt;br /&gt;
This section describes the cooling system for the BSC.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The dry air flow in the BSC sleeve aims at reducing the risk of condensation due to the temperature gradient caused by the hotter PWB.&lt;br /&gt;
The constant flow has also affords a minimal control over the overall temperature of the BSC.&lt;br /&gt;
&lt;br /&gt;
The dry cold air in the SiPM enclosure is intended to set a fixed temperature for the SiPM operation and to cool &#039;Analog Sum Discriminator&#039; modules or &#039;ASD&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:Aircooling.svg|Schematic view of the distribution of cold air to the SiPM and the BSC sleeve.|292x523px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
Air cooling scheme mediated by heat exchangers, fueled by the water chiller is shown below.  &lt;br /&gt;
&lt;br /&gt;
[[File:Aircooling2.svg|Schematic view of the cooling circuit at the service rack]]&lt;br /&gt;
&lt;br /&gt;
Note that the circuit to cool the SiPM is going to be replaced in 2021 by &#039;Vortex cooler&#039;.&lt;br /&gt;
&lt;br /&gt;
= Power distribution =&lt;br /&gt;
&lt;br /&gt;
This section covers the different voltages and power requirements for the operation of the rTPC. This includes:&lt;br /&gt;
&lt;br /&gt;
# High Voltage for the rTPC electron drift and amplification operation&lt;br /&gt;
# Low Voltage to the Anode wire frontend electronics&lt;br /&gt;
# Low Voltage to the Barrel Scintillator frontend electronics&lt;br /&gt;
# Low Voltage to the Cathode Pads electronics&lt;br /&gt;
# Grounding scheme of the overall rTPC&lt;br /&gt;
&lt;br /&gt;
The provision of power to the different components of the detector is distributed from the top end plate of the rTPC.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice12.png|507x354px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965261&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684500&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684892&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections&lt;br /&gt;
&lt;br /&gt;
== High Voltage for the rTPC ==&lt;br /&gt;
&lt;br /&gt;
Three main components of the rTPC require High Voltage&lt;br /&gt;
&lt;br /&gt;
* Main cathode wall (Negative ~5KV)&lt;br /&gt;
* Field wires (Negative ~ few hundred volts)&lt;br /&gt;
* Anode wires (Positive ~3.2KV )&lt;br /&gt;
&lt;br /&gt;
These voltages are provided by a Quad High Voltage unit from CAEN. Three independent cables will be fed to the top of the rTPC.&lt;br /&gt;
&lt;br /&gt;
High Voltage provision to the bottom endplate HV ring is taken from the central cathode near the bottom endplate.&lt;br /&gt;
&lt;br /&gt;
The Field wire voltage is connected to all the field wire crimp-pins through a dedicated socket chain inserted on each of the crimp-pin on the top and bottom endplates. The field wires themselves interconnect the high voltage between the top and bottom pins.&amp;lt;span id=&amp;quot;OLE_LINK20&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK21&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK22&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The High Voltage for the anode wires is delivered to the Anode Wire Card (AWC) which will distribute it to its 16 wires, Figure 11. There are 16 AWC cards covering each end of the anode wires. All the top and bottom 32 AWC are connected serially. The anode wires themselves interconnect the high voltage between the top and bottom pins.&lt;br /&gt;
&lt;br /&gt;
The anode wires pre-amplifiers boards (AWB) are sitting on the top of the Anode Wire Card (AWC) Figure 10. As the wire is powered by the HV, each anode wire has a high Voltage decoupling capacitor to isolate the pre-amp stage from the HV. This circuit resides on the AWC. The AWB will see the AC coupled anode signal only. With a new design of the AWC Figure 12, the decoupling capacitors are potted in epoxy to ensure proper isolation of the HV toward the surrounding circuit as well to prevent corona discharge due to relative humidity of the surrounding.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice13.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684196&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684501&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684893&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 10 – Unpotted Anode Wire Card and Board with HV distribution&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice14.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684198&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684502&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684894&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 11 - Anode wire pins and Field wire pins under yellow cover&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice15.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684370&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684503&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684895&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Anode wire frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
The AWB pre-amp board requires 2 voltages (+5V, -5V) which are fed through dedicated cable connections to each of the AWB. There are 16 AWB per end of the rTPC, therefore, 16 individual cable bundle will be reaching the top and another 16 the bottom of the rTPC. The cable bundle is to also provide the power return lines to the Power Supply.&lt;br /&gt;
&lt;br /&gt;
The PL508 Low Voltage power Supply from Wiener will provide the main power source for all the 32 pre-amplifiers. A dedicated connection breakout board with current monitoring capability splits the source power to the 2 x 16 necessary connections to the Anode wire boards. Based on a RaspeberryPi card, a 16 power distribution board is already implemented for the prototype. This board has extra 4 channels of temperature monitoring which can be used later on. In the same process we produce a similar board for 16 channel of NTC, RTC temperature monitoring. They will be used for overall detector and cooling system monitoring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;-5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Anode Pre-amp&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice16.jpg|239x363px]] [[File:imageservice17.png|239x363px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965262&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684504&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684896&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Barrel Scintillator frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
Similar to the Anode wire pre-amplifier voltage distribution scheme, the Barrel Scintillators will require several low voltages for power and control. The Barrel Scintillator Boards (BSB) are mounted on both ends of the Scintillator bar with the same segmentation as the Anode wires i.e.: 16 BSB per end. The design of the electronic chain for the barrel scintillator is not fully designed yet.&lt;br /&gt;
&lt;br /&gt;
The SiPM sensors require a bias voltage of the order of 28V. This voltage will be provided through the same mean as the low voltage power. Expected threshold voltage for the local signal level discriminator is also foreseen.&amp;lt;span id=&amp;quot;_Toc450564363&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Low Voltage to the Cathode Pads electronics ==&lt;br /&gt;
&lt;br /&gt;
The cathode pads electronics mounted on the external cylinder surface is composed of the analog frontend and the digital conversion electronics. Two voltages are required (+5.3V, +2.3V). The delivery is done through dedicated “power bar” running the full length of the rTPC. A set of 3 bars covers the 8 axial cathode pad electronics boards. 8 of them cover the circumference of the rTPC.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+2.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Padwing board&lt;br /&gt;
| 10W (1.8A)&lt;br /&gt;
| 2W (0.8A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Overall the low power supplies are provided by a PL508-3U with 8 modules of either single or dual channels from Wiener.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice18.png|469x360px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684505&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684897&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 14 - Overall Low voltage distribution for anode wires and cathode pads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564365&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grounding scheme of the overall rTPC ==&lt;br /&gt;
&lt;br /&gt;
The grounding scheme challenge in this setup is the far distance between the 2 end of the rTPC (2.3m) and the lack of accessibility to the bottom of the detector. The proposal is to use a Copper sheet mounted on the inner surface of the inner cylinder. This ground path will connect the 2 endplates to the High Voltage return. All the pre-amps will merge their ground to this central ground.&lt;br /&gt;
&lt;br /&gt;
Additional ground lugs have been included in the Anode wire pre-amplifier boards to strengthen the ground as each anode wire is readout out from both end. This may be used once the full detector is assembled to address possible ground loop issues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684506&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;[[File:imageservice19.png|439x409px]]&lt;br /&gt;
&lt;br /&gt;
= Safety and Hazard considerations =&lt;br /&gt;
&lt;br /&gt;
== Gas ==&lt;br /&gt;
&lt;br /&gt;
The Ar and CO2 do not require special health safety system. The detector will be operated in the ventilated hall of the AD building at CERN.&lt;br /&gt;
&lt;br /&gt;
Gas flow, detector gas pressure, and gas inlet temperature are constantly monitored and can trigger adequate response for shutdown or closure of the gas system for safety purpose.&lt;br /&gt;
&lt;br /&gt;
== Cooling water ==&lt;br /&gt;
&lt;br /&gt;
The water cooling system operates in negative pressure mode preventing any water leak to flood the detector outer surface. In addition water flow and inlet/outlet temperature are constantly monitored to allow fast response to off range parameter in order to shut down the electronics. The cooling water system requires a primary cooling tap water loop from the AD building. Water quality, water flow and water temperature are not under our responsibility. This aspect will be dealt during the initial phase of the rTPC commissioning at CERN.&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
All electronics voltages are below 48V. No special safety circuits are envisaged.&lt;br /&gt;
&lt;br /&gt;
The high-voltage circuit is fully protected outside the detector. The access to the high-voltage on the detector is restricted to the two end-plates. Interlock scheme will be put in place to ensure the shutdown of the HV in case of manual access to the detector itself.&lt;br /&gt;
&lt;br /&gt;
The LV (Low Voltage) power units are also interlocked to prevent false powering sequence which can damage the downstream electronics modules.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice20.png|571x411px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684507&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684899&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 16- Alpha-g rTPC rack organization&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:Aircooling2.svg&amp;diff=687</id>
		<title>File:Aircooling2.svg</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:Aircooling2.svg&amp;diff=687"/>
		<updated>2021-04-10T04:07:06Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cooling schematics&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:Aircooling.svg&amp;diff=686</id>
		<title>File:Aircooling.svg</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:Aircooling.svg&amp;diff=686"/>
		<updated>2021-04-10T03:32:43Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Schematic view of the air distribution.&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Daq&amp;diff=651</id>
		<title>Daq</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Daq&amp;diff=651"/>
		<updated>2021-02-09T23:23:00Z</updated>

		<summary type="html">&lt;p&gt;Acapra: /* Schematic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Links =&lt;br /&gt;
&lt;br /&gt;
* https://alphacpc05.cern.ch/agdaq/ -- midas daq page for the agdaq system at CERN&lt;br /&gt;
* https://daq16.triumf.ca -- midas daq page for the agmini system at TRIUMF&lt;br /&gt;
* https://daq.triumf.ca/elog-alphag/alphag/ -- elog&lt;br /&gt;
* https://daqstore.triumf.ca/AgWiki/index.php/Main_Page -- this wiki&lt;br /&gt;
* https://bitbucket.org/ttriumfdaq/agdaq - git repository for agdaq&lt;br /&gt;
* https://bitbucket.org/expalpha  -- git repository on bitbucket&lt;br /&gt;
* https://edev-group.triumf.ca/fw/exp/alphag -- git repository on edev gitlab&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/170 - PWB inventory database&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/168 - ADC (GRIF-16) inventory, FMC-ADC32rev0,rev1 inventory&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/176 - FMC-ADC32rev1.1 inventory&lt;br /&gt;
&lt;br /&gt;
= Hardware manuals =&lt;br /&gt;
&lt;br /&gt;
* [[TRG]] - trigger board (GRIF-C) manual&lt;br /&gt;
* CDM - https://daq.triumf.ca/DaqWiki/index.php/VME-CDM -- clock VME-CDM manual&lt;br /&gt;
* ADC - https://daq.triumf.ca/DaqWiki/index.php/VME-GRIF-ADC16-Rev1 -- GRIF-16 ADC manual&lt;br /&gt;
* [[PWB]] - TPC Pad Wing Board manual&lt;br /&gt;
* TDC - https://www.triumf.info/wiki/DAQwiki/index.php/GSI_TRB3&lt;br /&gt;
* [[chronobox]] - chronobox manual&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
Full system: (ADC fw rel-20201112-ko, PWB fw 20201005_ko)&lt;br /&gt;
* 1 Hz stable, ADC adc32 9 supp off rate 0.3 M/s, adc16 off, PWB udp_delay 25 supp off active 64 rate 6.6+4+6+4.6=21.2 M/s, TDC off, total rate 21 M/s&lt;br /&gt;
* 500 Hz stable, ADC adc32 9 supp 1500 rate 6 M/s, adc16 off, PWB udp_delay 10 supp 100 active 63 rate 3+4+3+3=13 M/s, TDC off, total rate 19 M/s&lt;br /&gt;
&lt;br /&gt;
Single ADC: (fw rel-20201112-ko)&lt;br /&gt;
&lt;br /&gt;
Fully suppressed data, sthreshold 5000&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 500 Hz: stable (nominal max trigger rate)&lt;br /&gt;
* 6700 Hz: stable, 8 Mbytes/sec&lt;br /&gt;
* 6800 Hz: evb eventually confused&lt;br /&gt;
* 6850 Hz: evb confused, no lost triggers in the ADC, no crash in the ADC&lt;br /&gt;
&lt;br /&gt;
All data, 510 samples/event, sthreshold 10 (fw rel-20201122-ko)&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 100 Hz: stable, 3.4 Mbytes/sec&lt;br /&gt;
* 500 Hz: stable, 17 Mbytes/sec (nominal max trigger rate)&lt;br /&gt;
* 1000 Hz: stable, 32 Mbytes/sec&lt;br /&gt;
* 3100 Hz: stable, 106 M/s (approaching saturation of 1gige ethernet)&lt;br /&gt;
* 3200 Hz: stable, 110 M/s - TRG communication is in trouble&lt;br /&gt;
* 3300 Hz: stable, 116 M/s&lt;br /&gt;
* 3400 Hz: incomplete events, no ADC crash (&amp;quot;dropped due to full&amp;quot; counting, &amp;quot;dropped due to busy&amp;quot; are zero, this is as expected).&lt;br /&gt;
&lt;br /&gt;
no suppression (different fpga data path)&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 100 Hz: stable&lt;br /&gt;
* 500 Hz: stable, 17 M/s (nominal max trigger rate)&lt;br /&gt;
* 1000 Hz: stable, 32 M/s&lt;br /&gt;
* 3000 Hz: stable, 100 M/s (approaching saturation of 1gige ethernet)&lt;br /&gt;
* 3300 Hz: incomplete events, no ADC crash (&amp;quot;dropped due to full&amp;quot; counting, &amp;quot;dropped due to busy&amp;quot; are zero, this is as expected).&lt;br /&gt;
&lt;br /&gt;
= Network connections =&lt;br /&gt;
&lt;br /&gt;
The experiment private network number is: 192.168.1.x, gateway 192.168.1.1, netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
network map:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- TRIUMF/CERN network --1gige-- alphagdaq --10gige-- juniper switch --1gige-- centrecom switch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== alphagdaq network connections ==&lt;br /&gt;
&lt;br /&gt;
on the rear of the machine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
|   | rj45 | rj45 |         | sfp | sfp |&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
- left rj45 - copper 1gige - eno1 - spare (inactive)&lt;br /&gt;
- right rj45 - copper 1gige - eno2 - dhcp - cern/triumf network&lt;br /&gt;
- left sfp - 10gige - enp1s0f1 - spare (inactive)&lt;br /&gt;
- right sfp - 10gige - enp1s0f0 - static 192.168.1.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== connections between switches ==&lt;br /&gt;
&lt;br /&gt;
* alphagdaq to juniper switch: direct attach (DAC) 10gige cable into any port of juniper switch&lt;br /&gt;
* juniper switch to centrecom switch: rj45 sfp in any port of juniper switch - cat5e/cat6 cable - to any port of centrecom switch&lt;br /&gt;
* cat5e/cat6 cable from any port of centrecom switch to the XXX port on the back of the juniper switch&lt;br /&gt;
&lt;br /&gt;
== juniper switch ==&lt;br /&gt;
&lt;br /&gt;
connected to juniper switch front is:&lt;br /&gt;
&lt;br /&gt;
* everything that sends event data to alphagdaq, specifically:&lt;br /&gt;
** TRG (rj45 sfp)&lt;br /&gt;
** 16x ADC (fiber sfp)&lt;br /&gt;
** 64x PWB (fiber sfp)&lt;br /&gt;
* 10gige uplink to alphagdaq (10gige DAC cable)&lt;br /&gt;
* 1gige link to centrecom switch (rj45 sfp)&lt;br /&gt;
* 40gige ports are not used&lt;br /&gt;
&lt;br /&gt;
connected to the juniper switch rear:&lt;br /&gt;
&lt;br /&gt;
* CON is the serial console via RJ45-to-DB9 to USB-serial adapter to alphagdaq USB port (9600bps, 8N1, no flow control)&lt;br /&gt;
* C0 is the management ethernet interface port, connect to any port on the centrecom switch (juniper-private will ping)&lt;br /&gt;
&lt;br /&gt;
== centrecom switch ==&lt;br /&gt;
&lt;br /&gt;
* everything with copper rj45 connections, specifically:&lt;br /&gt;
** CDM boards&lt;br /&gt;
** HV, LV and VME power supplies&lt;br /&gt;
** RaspberryPi3 boards&lt;br /&gt;
** gas handling MFCs (algas)&lt;br /&gt;
** cooling system controller (moxa01)&lt;br /&gt;
&lt;br /&gt;
= USB connections =&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* alphagdaq has USB2 and USB3 connections. They are not the same, they are not generally interchangeable.&lt;br /&gt;
* USB3 connections and cables are generally blue coloured.&lt;br /&gt;
&lt;br /&gt;
List of USB connections from alphagdaq:&lt;br /&gt;
&lt;br /&gt;
* front USB3 port (blue): USB-A-to-B cable to USB blaster connected to the trigger board (front of rack)&lt;br /&gt;
* rear USB3 port (blue): USB3 short jumper to USB3 hub&lt;br /&gt;
* rear USB2 port (black): USB2 unpowered hub (Logiix) to USB-A-to-B cable to UPS USB connector&lt;br /&gt;
* rear USB2 port (black): USB-to-Serial adaper to DB9 to RJ45 adapter to Juniper switch console port&lt;br /&gt;
&lt;br /&gt;
Note: UPS USB connection does not work with alphagdaq USB ports (both usb2 and usb3), but combination&lt;br /&gt;
using the unpowered USB2 hub seems to work ok.&lt;br /&gt;
&lt;br /&gt;
List of USB connections from the USB hub:&lt;br /&gt;
&lt;br /&gt;
* this is a powered USB3 hub&lt;br /&gt;
* USB-A-to-MicroUSB - to lvdb boards&lt;br /&gt;
* USB-A-to-Wiener interlock cable&lt;br /&gt;
&lt;br /&gt;
= Clock and trigger distribution =&lt;br /&gt;
&lt;br /&gt;
== Explanation ==&lt;br /&gt;
&lt;br /&gt;
Trigger is generated by the trigger board (aka TRG, aka GRIF-C),&lt;br /&gt;
from the TRG eSATA output through the eSATA splitter it is fed into&lt;br /&gt;
the master CDM. The master CDM outputs the trigger on all MiniSAS output ports.&lt;br /&gt;
One of the master CDM MiniSAS outputs is connected to the CDM slave eSATA input.&lt;br /&gt;
The same as the master CDM, the slave CDM outputs the trigger on all MiniSAS output ports.&lt;br /&gt;
&lt;br /&gt;
The master 62.5MHz clock is generated by the master CDM using the internal 10MHz oscillator&lt;br /&gt;
or the external 10MHz AD clock. Also on MiniSAS port 6 the master CDM generates&lt;br /&gt;
the 200MHz clock for the TDC. This clock is frequency-locked to the master 62.5MHz clock.&lt;br /&gt;
&lt;br /&gt;
Master CDM clock selection (external CD 10MHz clock or internal oscillator 10MHz clock)&lt;br /&gt;
is done by a magic esper command (see below).&lt;br /&gt;
&lt;br /&gt;
From the master CDM, the clock is fed to: the slave CDM, the TRG (via the eSATA splitter)&lt;br /&gt;
and to the TDC (via the RJ45 splitter).&lt;br /&gt;
&lt;br /&gt;
The slave CDM sends the clock and the trigger to the ADCs and PWBs.&lt;br /&gt;
&lt;br /&gt;
== Schematic ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TRG (GRIF-C)&lt;br /&gt;
------------&lt;br /&gt;
eSATA &amp;lt;------&amp;gt; eSATA splitter&lt;br /&gt;
&lt;br /&gt;
eSATA splitter&lt;br /&gt;
--------------&lt;br /&gt;
trigger ---&amp;gt; eSATA ---&amp;gt; CDM-Master eSATA (trigger signal)&lt;br /&gt;
clock &amp;lt;--- (eSATA --- MiniSAS) &amp;lt;--- CDM MiniSAS (62.5MHz clock)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CDM-Master&lt;br /&gt;
----------&lt;br /&gt;
eSATA &amp;lt;--- eSATA splitter &amp;lt;--- eSATA from TRG (trigger signal)&lt;br /&gt;
MiniSAS 1 --&amp;gt; (MiniSAS --- eSATA) --&amp;gt; CDM-Slave eSATA (62.5 MHz)&lt;br /&gt;
MiniSAS 6 --&amp;gt; (MiniSAS --- eSATA) --&amp;gt; eSATA splitter --&amp;gt; RJ45 --&amp;gt; TDC (200 MHz)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CDM-Slave&lt;br /&gt;
---------&lt;br /&gt;
eSATA &amp;lt;--- trigger and 62.5MHz clock from CDM-Master&lt;br /&gt;
MiniSAS 1 --&amp;gt; ADC trigger and 62.5MHz clock&lt;br /&gt;
MiniSAS 2 --&amp;gt; same&lt;br /&gt;
MiniSAS 3 --&amp;gt; same&lt;br /&gt;
MiniSAS 4 --&amp;gt; same&lt;br /&gt;
MiniSAS 5 --&amp;gt; PWB trigger and 62.5MHz clock&lt;br /&gt;
MiniSAS 6 --&amp;gt; same&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VME_Crate_CERN.jpeg|800x450px|Layout of the VME crate at CERN.]]&lt;br /&gt;
&lt;br /&gt;
Layout of the VME crate at CERN. The ALPHA-T module is in the rightmost slot. The Master CDM is next to it and it&#039;s labelled as #02. The Slave CDM is on the lefmost position and labelled by #03.&lt;br /&gt;
&lt;br /&gt;
== Setup of CDM boards ==&lt;br /&gt;
&lt;br /&gt;
ALPHA-g uses the Rev3 CDM boards. The 4 CDM boards that belong to ALPHA-g&lt;br /&gt;
have serial numbers 0, 1, 2 and 3 and are labeled cdm00, cdm01, cdm02, cdm03.&lt;br /&gt;
&lt;br /&gt;
All the boards can be used as master and slave positions, but have to be&lt;br /&gt;
configured appropriately.&lt;br /&gt;
&lt;br /&gt;
=== Slave setup ===&lt;br /&gt;
&lt;br /&gt;
* install the board&lt;br /&gt;
* connect ethernet&lt;br /&gt;
* connect esata external clock&lt;br /&gt;
* esper-tool cdmNN ### i.e. esper-tool cdm01&lt;br /&gt;
* cd template&lt;br /&gt;
* write current_setup 4&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* read&lt;br /&gt;
* observe clock frequency counters report correct values. &amp;quot;ext_clk&amp;quot; will only count if the lemo jumper is installed (see below)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11    esata_clk        uint32           R                 [62500246]                      &lt;br /&gt;
12    ext_clk          uint32           R                 [62500246]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
156   ld1_counter      uint32           RW                [3]                             &lt;br /&gt;
157   ld2_counter      uint32           RW                [3]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, check correct operation of the pll lock monitoring:&lt;br /&gt;
&lt;br /&gt;
* unplug the esata cable from the master CDM&lt;br /&gt;
* &amp;quot;red&amp;quot; light should go off&lt;br /&gt;
* read of lmk should report &amp;quot;pll1_ld&amp;quot; value 0 and &amp;quot;ld1_counter&amp;quot; and &amp;quot;ld2_counter&amp;quot; should increment&lt;br /&gt;
* reconnect the esata cable&lt;br /&gt;
* &amp;quot;red&amp;quot; light should return&lt;br /&gt;
* read of lmk should report both pll1_ld and pll2_ld locked (values &amp;quot;1&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Master setup ===&lt;br /&gt;
&lt;br /&gt;
* install the board&lt;br /&gt;
* connect ethernet&lt;br /&gt;
* esper-tool cdmNN ### i.e. esper-tool cdm01&lt;br /&gt;
* cd template&lt;br /&gt;
* write current_setup 3&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* write clkin_sel_mode 0&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* read&lt;br /&gt;
* observe clock frequency counters report correct values. &amp;quot;ext_clk&amp;quot; will only count if the &amp;quot;clock loopback&amp;quot; lemo jumper is installed (see below)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
12    ext_clk          uint32           R                 [62500189]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
156   ld1_counter      uint32           RW                [3]                             &lt;br /&gt;
157   ld2_counter      uint32           RW                [3]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the 200MHz clock:&lt;br /&gt;
* connect MiniSAS-eSATA splitter cable to MiniSAS output 6, connect eSATA end to CDM eSATA input&lt;br /&gt;
* in esper-tool, read cdm: esata_clk should report 200MHz clock&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11    esata_clk        uint32           R                 [200000603]                     &lt;br /&gt;
12    ext_clk          uint32           R                 [62500188]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Master setup with external 10 MHz clock ===&lt;br /&gt;
&lt;br /&gt;
* setup master CDM as above (using internal clock)&lt;br /&gt;
* connect 10MHz external clock to right LEMO #1&lt;br /&gt;
* esper-tool cdmNN&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* write sel_nim 1 # if clock is NIM signal&lt;br /&gt;
* write sel_nim 0 # if clock is TTL signal (i.e. chronobox LEMO output)&lt;br /&gt;
* read ext_clk&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[http://cdm00:/cdm]&amp;gt; read ext_clk&lt;br /&gt;
9999556&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if ext_clk reads 0 or does not read something close to 10MHz, stop here. debug the signal, try changing sel_nim, etc.&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* write clkin_sel_mode 2 # select external clock&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
150   clkin2_sel       bool             R                 [True]                          &lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* on the MIDAS TRG page, observe that TRG measured external clock frequency is close to 62.5 MHz&lt;br /&gt;
&lt;br /&gt;
== clkin_sel_mode positions ==&lt;br /&gt;
&lt;br /&gt;
* 0 = 10MHz internal oscillator (use on master CDM in standalone mode)&lt;br /&gt;
* 1 = eSATA clock (use on slave CDM)&lt;br /&gt;
* 2 = external clock, should be 10MHz (use on master CDM to run from AD clock)&lt;br /&gt;
&lt;br /&gt;
== LEMO connections ==&lt;br /&gt;
&lt;br /&gt;
* clock loopback jumper: to read the frequency of the generated 62.5MHz clock, connect LEMO cable from left LEMO #2 to the right LEMO #1&lt;br /&gt;
* 10MHz internal clock jumper: to feed 10MHz internal oscillator to the external clock, connect LEMO cable from right  LEMO #3 to the right LEMO #1.&lt;br /&gt;
* 10MHz external clock: to feed 10MHz external clock, connect LEMO cable to right LEMO #1&lt;br /&gt;
&lt;br /&gt;
= MIDAS frontends =&lt;br /&gt;
&lt;br /&gt;
== UDP ==&lt;br /&gt;
&lt;br /&gt;
feudp receives udp packets from the ADC and PWB boards. For each udp packet 1 midas event is created,&lt;br /&gt;
with 1 data bank containing the udp data. Events are sent into the MIDAS event buffer BUFUDP. The names&lt;br /&gt;
of the data banks are assigned in ODB /eq/feudp/settings.&lt;br /&gt;
&lt;br /&gt;
{ADC,PWB} --&amp;gt; 1gige --&amp;gt; switch --&amp;gt; 10gige --&amp;gt; alphagdaq --&amp;gt; feudp -&amp;gt; BUFUDP&lt;br /&gt;
&lt;br /&gt;
== CTRL ==&lt;br /&gt;
&lt;br /&gt;
fectrl controls all the ADC, PWB and trigger boards. It provides run start and stop sequencing,&lt;br /&gt;
runs the event synchronization sequence at the begin of the run, and records slow controls data (temperatures,&lt;br /&gt;
voltages, etc).&lt;br /&gt;
&lt;br /&gt;
fectrl receives UDP data packets from the trigger board and sends them to the MIDAS event buffer BUFUDP.&lt;br /&gt;
&lt;br /&gt;
fectrl receives commands from the control web pages (for ADC, PWB and trigger) to reboot, initialize, etc the boards.&lt;br /&gt;
&lt;br /&gt;
fectrl configures the event builder via odb /eq/fectrl/evbconfig.&lt;br /&gt;
&lt;br /&gt;
ADC &amp;lt;-&amp;gt; http esper &amp;lt;-&amp;gt; fectrl -&amp;gt; slow control data into midas history&lt;br /&gt;
&lt;br /&gt;
PWB &amp;lt;-&amp;gt; http esper &amp;lt;-&amp;gt; fectrl -&amp;gt; slow control data into midas history&lt;br /&gt;
&lt;br /&gt;
TRG &amp;lt;-&amp;gt; udp comm &amp;lt;-&amp;gt; fectrl -&amp;gt; BUFUDP, slow control and counters into midas history&lt;br /&gt;
&lt;br /&gt;
fectrl &amp;lt;-&amp;gt; midas rpc &amp;lt;-&amp;gt; mhttpd &amp;lt;-&amp;gt; json rpc &amp;lt;-&amp;gt; control web pages for ADC, PWB and trigger&lt;br /&gt;
&lt;br /&gt;
== EVB ==&lt;br /&gt;
&lt;br /&gt;
feevb receives udp packet data from the MIDAS event buffer BUFUDP, inspects the packet timestamps&lt;br /&gt;
and collects the data with matching timestamps into physics events. feevb has provisions to do&lt;br /&gt;
data suppression, reduction and compression in addition to the data reduction done&lt;br /&gt;
in the ADC and PWB firmware.&lt;br /&gt;
&lt;br /&gt;
feevb event synchronization relies on the event synchronization sequence done by fectrl when a run is started.&lt;br /&gt;
&lt;br /&gt;
{ADC, PWB, TRG} -&amp;gt; BUFUDP -&amp;gt; feevb -&amp;gt; SYSTEM -&amp;gt; mlogger -&amp;gt; compression -&amp;gt; disk storage&lt;br /&gt;
&lt;br /&gt;
=== internal structure ===&lt;br /&gt;
&lt;br /&gt;
* event buffer readers, instances for BUFTRG, BUFTDC, BUFADC, BUFUDP&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BufferReader class - reads one midas event buffer:&lt;br /&gt;
- BufferReaderThread()&lt;br /&gt;
-- in batches of 1000 events&lt;br /&gt;
--- lock&lt;br /&gt;
--- TickLocked()&lt;br /&gt;
----- ReadEvent() -&amp;gt; bm_receive_event_alloc()&lt;br /&gt;
----- fHandler-&amp;gt;HandleEvent()&lt;br /&gt;
-- fHandler-&amp;gt;XMaybeFlushBank()&lt;br /&gt;
-- sleep 100 usec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* event header decoder and intermediate buffer&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Handler class - accumulates events, sends them to the EVB in batches&lt;br /&gt;
&lt;br /&gt;
- HandleEvent() &amp;lt;- BufferReaderThread() - receive incoming events&lt;br /&gt;
-- loop over all banks, examine bank name&lt;br /&gt;
--- call AddAdcBank(), AddPwbBank(), AddTrgBank(), AddTdcBank() according to bank name&lt;br /&gt;
----  AddXxxBank() -&amp;gt; XAddBank()&lt;br /&gt;
--- unknown banks go directly to evb-&amp;gt;SendQueue&lt;br /&gt;
-- check if synchronization has completed&lt;br /&gt;
&lt;br /&gt;
- XAddBank() - save BankBuf objects in a buffer&lt;br /&gt;
&lt;br /&gt;
- XMaybeFlushBank(), XFlushBank() - send all accumulated data to the Evb class&lt;br /&gt;
-- evb-&amp;gt;lock()&lt;br /&gt;
-- for each buffered BankBuf objects,&lt;br /&gt;
--- call evb-&amp;gt;AddBankLocked()&lt;br /&gt;
-- buffer is now empty&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* event builder&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Evb class - assemble event fragments according to timestamps&lt;br /&gt;
&lt;br /&gt;
- fEvents fifo (deque) - time sorted list of partially assembled events&lt;br /&gt;
-- new entries are added by FindEvent()&lt;br /&gt;
-- entries are modified by MergeSlot()&lt;br /&gt;
-- old entries are removed by GetLocked()&lt;br /&gt;
&lt;br /&gt;
- AddBankLocked() &amp;lt;- XFlushBank() &amp;lt;- BufferReaderThread()&lt;br /&gt;
-- call fSync-&amp;gt;Add()&lt;br /&gt;
-- transform BankBuf to EvbEventBuf&lt;br /&gt;
-- push it into per-module buffer fBuf[imodule]&lt;br /&gt;
&lt;br /&gt;
- EvbThread()&lt;br /&gt;
-- EvbTickLocked()&lt;br /&gt;
--- BuildLocked()&lt;br /&gt;
---- in a loop, for no more than 1 sec&lt;br /&gt;
----- loop over all per-module buffers fBuf&lt;br /&gt;
------ pop first entry, pass it to BuildSlot()&lt;br /&gt;
------- call FindEvent()&lt;br /&gt;
------- call MergeSlot()&lt;br /&gt;
------- call CheckEvent()&lt;br /&gt;
--- in a loop&lt;br /&gt;
---- get all completed events via GetLocked() pass them to SendQueue-&amp;gt;PushEvent()&lt;br /&gt;
-- if done nothing, sleep 100 usec, otherwise nominal sleep to free the evb lock&lt;br /&gt;
&lt;br /&gt;
- GetNext() &amp;lt;- GetLocked() &amp;lt;- EvbThread() - get completed events&lt;br /&gt;
-- examine oldest EvbEvent entry in fEvents:&lt;br /&gt;
-- pop it if it is complete&lt;br /&gt;
-- pop it if it is too old (to prevent old incomplete events from stalling the evb) (&amp;quot;pop age&amp;quot; on the evb page)&lt;br /&gt;
-- pop it if a following event is complete (&amp;quot;pop following&amp;quot; on the evb page)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* send queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SendQueue class - prepare events for writing to midas SYSTEM event buffer&lt;br /&gt;
&lt;br /&gt;
- PushEvent() &amp;lt;- EvbThread()&lt;br /&gt;
-- push FragmentBuf into the queue&lt;br /&gt;
&lt;br /&gt;
- SendQueueThread()&lt;br /&gt;
-- in a batch of 1000 events, call Tick()&lt;br /&gt;
--- pop FragmentBuf from the queue, call SendEvent()&lt;br /&gt;
--- compose midas event (memcpy()!)&lt;br /&gt;
--- TMFE fEq-&amp;gt;SendEvent()&lt;br /&gt;
--- bm_send_event()&lt;br /&gt;
-- sleep 100 usec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* equipment object&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EvbEq class - implements the midas equipment&lt;br /&gt;
- HandleBeginRun()&lt;br /&gt;
- HandleEndRun()&lt;br /&gt;
- HandlePeriodic()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== multithreading ===&lt;br /&gt;
&lt;br /&gt;
* BufferReaderThread() one per midas event buffer&lt;br /&gt;
** high CPU use: bm_receive_event(), AddXxxBank()&lt;br /&gt;
** lock contention: midas event buffer lock, evb lock into XFlushBank-&amp;gt;AddBankLocked()&lt;br /&gt;
* EvbThread()&lt;br /&gt;
** O(size of fEvents): FindEvent(), GetNext()&lt;br /&gt;
** lock contention: evb lock against XFlushBank(), SendQueue lock (1 per output event)&lt;br /&gt;
* SendQueueThread()&lt;br /&gt;
** high CPU use: memcpy() in SendEvent(), memcpy() in bm_send_event&lt;br /&gt;
** lock contention: event queue lock against EvbThread, midas event buffer lock&lt;br /&gt;
* main thread&lt;br /&gt;
** lock contention: evb lock in ReportEvb() and elsewhere&lt;br /&gt;
&lt;br /&gt;
= ODB entries =&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings ==&lt;br /&gt;
* TBW&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TrigSrc - trigger source selection ==&lt;br /&gt;
* TrigPulser                      - trigger on the pulser&lt;br /&gt;
* TrigEsataNimGrandOr             - trigger on external NIM inputs of GRIF-16 ADC modules&lt;br /&gt;
* TrigAdc16GrandOr                - trigger on any adc16 signals (see adc16_masks)&lt;br /&gt;
* TrigAdc32GrandOr                - trigger on any adc32 signals (see adc32_masks)&lt;br /&gt;
* Trig1ormore                     - trigger on adc16 multiplicity 1 or more&lt;br /&gt;
* Trig2ormore                     - ditto, 2 or more&lt;br /&gt;
* Trig3ormore                     - ditto, 3 or more&lt;br /&gt;
* Trig4ormore                     - ditto, 4 or more&lt;br /&gt;
* TrigAdcGrandOr                  - trigger on any ADC signal&lt;br /&gt;
* TrigAwCoincA                    - trigger on TPC AW coincidence (see [[TRG]] manual)&lt;br /&gt;
* TrigAwCoincB                    - ditto&lt;br /&gt;
* TrigAwCoincC                    - ditto&lt;br /&gt;
* TrigAwCoincD                    - ditto&lt;br /&gt;
* TrigAwCoinc                     - ditto&lt;br /&gt;
* TrigAw1ormore	- trigger on TPC AW per-preamp multiplicity 1 or more (see [[TRG]] manual)&lt;br /&gt;
* TrigAw2ormore	- ditto, 2 or more&lt;br /&gt;
* TrigAw3ormore	- ditto, 3 or more&lt;br /&gt;
* TrigAw4ormore - ditto, 4 or more&lt;br /&gt;
* TrigAwMLU                       - trigger on TPC AW MLU signal (see [[TRG]] manual)&lt;br /&gt;
* TrigBscGrandOr                  - trigger on any BSC signal&lt;br /&gt;
* TrigBscMult                     - trigger on predefined BSC multiplicity (see [[TRG]] manual)&lt;br /&gt;
* TrigCoinc                       - trigger on predefined coincidence of TPC AW, BSC and external signal (see [[TRG]] manual)&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TRG - trigger settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will not do anything with the trigger board. Normal value &amp;quot;y&amp;quot;&lt;br /&gt;
* Modules - hostnames of the trigger board. Normal value &amp;quot;alphat01&amp;quot;&lt;br /&gt;
* NimMask - 32-bit mask for the 32x NIM inputs (see TRG manual). Normal value 0, unless external trigger is in use.&lt;br /&gt;
* EsataMask - 32-bit mask for the 32x eSATA signals (see TRG manual). Normal value 0.&lt;br /&gt;
* adc16_mask[16] - 16x 16-bit mask for the 100MHz GRIF-16 onboard ADCs (see TRG manual). Normal value 0xFFFF for all 16 data links.&lt;br /&gt;
* adc32_mask[16] - 16x 32-bit mask for the 62.5MHz FMC-ADC32 ADCs (see TRG manual). Normal value 0xFFFFFFFF for all 16 data links.&lt;br /&gt;
* PassThrough - if set to &amp;quot;y&amp;quot;, trigger is passed through the trigger module without generating any events and without causing deadtime.&lt;br /&gt;
* AwCoincA, B, C and D - 32-bit masks for the aw16 coincidence trigger (see TRG manual)&lt;br /&gt;
* Aw16FromAdc16 - route AW trigger (aw16) from adc16 (100MHz ADCs 0..15)&lt;br /&gt;
* Aw16FromAdc32a - route AW trigger (aw16) from adc32 group 15..0 (62.5MHz FMC-ADC32 in ADCs 0..7)&lt;br /&gt;
* Aw16FromAdc32b - route AW trigger (aw16) from adc32 group 31..16 (62.5MHz FMC-ADC32 in ADCs 8..15)&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/PWB - PWB settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will not do anything with PWBs. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_boot_user_page - if set to &amp;quot;n&amp;quot;, fectrl will not try to reboot PWBs into the user page firmware. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_trigger - if set to &amp;quot;n&amp;quot;, all PWBs will be set to ignore the trigger. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_trigger_group_a - field wire pulser defeats the data suppression (every channel has a pulse) resulting in too much data overwhelming the DAQ (lost UDP packets). To permit correct data taking of field wire pulser data, PWBs are split into two groups (a and b), only one of the two groups should be enabled for field wire pulser runs. Both groups should be enabled for normal data taking. Normal value is &amp;quot;y&amp;quot;&lt;br /&gt;
* enable_trigger_group_b - see &amp;quot;enable_trigger_group_a&amp;quot;. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* modules[64] - hostnames of PWB boards&lt;br /&gt;
* boot_user_page[64] - if set to &amp;quot;y&amp;quot; and enable_boot_user_page is &amp;quot;y&amp;quot;, fectrl will reboot the corresponding PWB to the user page firmware.&lt;br /&gt;
* trigger[64] - if set to &amp;quot;y&amp;quot; and enable_trigget is &amp;quot;y&amp;quot;, fectrl will set the PWB to accept the trigger.&lt;br /&gt;
* ch_enable - if set to &amp;quot;n&amp;quot; disables all PWB channels. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* ch_force - is set to &amp;quot;y&amp;quot; disables channel suppression (all PWB channels are read)&lt;br /&gt;
* suppress_reset - if set to &amp;quot;y&amp;quot; enables channel suppression for reset channels (threshold has to be set correctly)&lt;br /&gt;
* suppress_fpn - if set to &amp;quot;y&amp;quot; enables channel suppression for fpn channels (threshold has to be set correctly)&lt;br /&gt;
* suppress_pads -  set to &amp;quot;y&amp;quot; enables channel suppression for TPC pad channels (threshold has to be set correctly)&lt;br /&gt;
* disable_reset1 - data suppression algorithm does not work for the channel &amp;quot;reset1&amp;quot; and it has to be suppressed explicitly by setting this value to &amp;quot;y&amp;quot;. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* baseline_{reset,fpn,pads}[64] - waveform baseline for each PWB position&lt;br /&gt;
* threshold_{reset,fpn,pads} - waveform suppression threshold, see below:&lt;br /&gt;
* ch_threshold - PWB sca_N_ch_threshold, if set to 0, threshold is computed as &amp;quot;baseline_pads[seqpwb]-threshold_pads&amp;quot;. Normal value is 0.&lt;br /&gt;
* test_mode - enable PWB test mode, the ADC data is replaced with a test pattern, see PWB esper variable signalproc/test_mode&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TDC - TDC settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will tell the event builder that the TDC is not running. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/EvbConfig - EVB configuration ==&lt;br /&gt;
All arrays have the same size corresponding to the number of EVB slots.&lt;br /&gt;
* name[] - slot name for the web page (trg01, adc01, adc01/adc32, pwb31/0, tdc01, etc)&lt;br /&gt;
* type[] - slot type: 1=TRG, 2=ADC16 and ADC32, 3=obsolete PWB, 4=obsolete PWB, 5=PWB, 6=TDC&lt;br /&gt;
* module[] - module number (adcNN, adcNN+100, pwbNN, etc)&lt;br /&gt;
* nbanks[] - number of expected banks (16 for ADC16, 32 for ADC32, not used, set to 1 for all others)&lt;br /&gt;
* tsfreq[] - timestamp frequency in Hz.&lt;br /&gt;
&lt;br /&gt;
= Trigger configuration =&lt;br /&gt;
&lt;br /&gt;
These trigger modes are implemented:&lt;br /&gt;
* (manual trigger from web page)&lt;br /&gt;
* software pulser trigger (from fectrl)&lt;br /&gt;
* hardware pulser trigger (from the trigger board)&lt;br /&gt;
* NIM and eSATA trigger from ADC front panel inputs&lt;br /&gt;
* adc16 and adc32 discriminator triggers:&lt;br /&gt;
** adc16 grand-or trigger&lt;br /&gt;
** adc32 grand-or trigger&lt;br /&gt;
** adc (adc16+adc32) grand-or trigger&lt;br /&gt;
** adc16 multiplicity trigger (1ormore, 2ormore, 3ormore, 4ormore) for use with barrel scintillator&lt;br /&gt;
** anode wire multiplicity trigger (1ormore, 2ormore, 3ormore, 4ormore) (anode wire signals can be fed from adc16 or from adc32 signals)&lt;br /&gt;
** anode wire coincidence trigger&lt;br /&gt;
** anode wire MLU (memory lookup) trigger&lt;br /&gt;
&lt;br /&gt;
== NIM trigger from ADC front panel ==&lt;br /&gt;
&lt;br /&gt;
Trigger path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NIM signal --&amp;gt; LEMO input on ADC front panel --&amp;gt; data encoder --&amp;gt; data link to trigger board --&amp;gt; data decoder --&amp;gt; mask --&amp;gt; nim-esata-grand-or --&amp;gt; trigger&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable NIM trigger, do this:&lt;br /&gt;
* connect NIM signal to ADC front panel input&lt;br /&gt;
** Note1: NIM signal must be inverted&lt;br /&gt;
** Note2: LEMO connectors should be set to &amp;quot;NIM input&amp;quot; mode by ADC on-board jumpers (see ADC manual)&lt;br /&gt;
* observe correct bit goes to zero in the TRG web page: data link high work should change:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0xNF00&#039;0000 (N is the module id) to&lt;br /&gt;
0xN700&#039;0000 (left lemo) or&lt;br /&gt;
0xNB00&#039;0000 (right lemo)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Note3: if data link bits do not change, most likely the LEMO connectors are set to &amp;quot;DAC output&amp;quot; mode. Try to use LEMO inputs of a different ADC.&lt;br /&gt;
* compute the NIM mask: there are 32 bits, 2 bits per ADC data link. Bit 0x1 is right LEMO, bit 0x2 is left LEMO&lt;br /&gt;
* for example, to use left LEMO of ADC data link 12, set nim mask to (0x2)&amp;lt;&amp;lt;(2*12) = 0x02000000&lt;br /&gt;
* development branch of the git repository contains &#039;&#039;scripts/nim_mask.py&#039;&#039;, which can compute forwards and backwards&lt;br /&gt;
* initialize the trigger board (on the TRG web page press button &amp;quot;initialize&amp;quot;), or start a new run&lt;br /&gt;
* on the history plot with &amp;quot;NIM grand or&amp;quot; counter, the rate should change from zero&lt;br /&gt;
* if a run is active, if one of the ADC LEMO outputs is set to output the trigger signal as a NIM pulse, one should see it fire use a scope. The delay or jitter between NIM trigger in and NIM trigger out should be around 100-200 ns (FIXME - measure this!)&lt;br /&gt;
* to set the DAQ to trigger on the NIM signal, on the run start page, check the box &amp;quot;TrigEsataNimGrandOr&amp;quot;.&lt;br /&gt;
** Note: remember to set the scaledown to 0 if so desired.&lt;br /&gt;
&lt;br /&gt;
= TPC field wire pulser =&lt;br /&gt;
&lt;br /&gt;
The TPC field wire pulser input should be connected directly to the DAC output of adc01 (right lemo connector).&lt;br /&gt;
&lt;br /&gt;
DAC settings in ODB /Equipment/CTRL/Settings/ADC/DAC/&lt;br /&gt;
&lt;br /&gt;
* for pulsing PWBs (maximum possible pulse height in PWBs. Overdrives the AW ADC waveforms)&lt;br /&gt;
** dac_baseline: -8000&lt;br /&gt;
** dac_amplitude: 8000&lt;br /&gt;
** ramp_up_rate: 128&lt;br /&gt;
** ramp_down_rate: 70&lt;br /&gt;
** ramp_top_len: 128&lt;br /&gt;
&lt;br /&gt;
* for pulsing AW: (AW ADC waveforms are in range. PWB waveforms are too small for goor time resolution)&lt;br /&gt;
** dac_baseline: -2000&lt;br /&gt;
** dac_amplitude: 4000&lt;br /&gt;
** ramp_up_rate: 20&lt;br /&gt;
** ramp_down_rate: 20&lt;br /&gt;
** ramp_top_len: 128&lt;br /&gt;
&lt;br /&gt;
= TDC connections =&lt;br /&gt;
&lt;br /&gt;
* SFP8 - fiber SFP to Juniper switch&lt;br /&gt;
* right RJ45 - 200MHz clock&lt;br /&gt;
* left RJ45 - external trigger&lt;br /&gt;
&lt;br /&gt;
= MIDAS Data banks =&lt;br /&gt;
&lt;br /&gt;
* ATAT - fectrl - UDP packets from GRIF-C/TRG trigger board&lt;br /&gt;
* TRBA - fetdc - TDC data&lt;br /&gt;
* TRTM - fetdc - TDC FPGA temperatures, TID_FLOAT[5].&lt;br /&gt;
* AAnn - feudp - UDP packets from GRIF-16 ADC (before the event builder), &amp;quot;nn&amp;quot; is the ADC module number: adc01 is AA01 through adc20 is AA20.&lt;br /&gt;
* BBxx - feudp - UDP packets from PWB, obsolete&lt;br /&gt;
* Bnnm, Cnnm - feevb - EVB output banks: ADC data, &amp;quot;nn&amp;quot; is the ADC module number (1..20), &amp;quot;m&amp;quot; is the channel number (0..9,A..F), format is same as AAnn banks.&lt;br /&gt;
* PAnn - feudp - UDP packets from PWB, &amp;quot;nn&amp;quot; is the PWB module number (00..99), obsolete&lt;br /&gt;
* PBnn - feudp - UDP packets from PWB, &amp;quot;nn&amp;quot; is the PWB module number (00..99), PB01 is pwb01, PB78 is pwb78&lt;br /&gt;
* PCnn - feevb - EVB output banks: PWB data, &amp;quot;nn&amp;quot; is the PWB module number (00..99), same as above, format is same as PBnn banks&lt;br /&gt;
&lt;br /&gt;
= ZZZ =&lt;br /&gt;
&lt;br /&gt;
ZZZ&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Daq&amp;diff=650</id>
		<title>Daq</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Daq&amp;diff=650"/>
		<updated>2021-02-09T23:22:44Z</updated>

		<summary type="html">&lt;p&gt;Acapra: /* Schematic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Links =&lt;br /&gt;
&lt;br /&gt;
* https://alphacpc05.cern.ch/agdaq/ -- midas daq page for the agdaq system at CERN&lt;br /&gt;
* https://daq16.triumf.ca -- midas daq page for the agmini system at TRIUMF&lt;br /&gt;
* https://daq.triumf.ca/elog-alphag/alphag/ -- elog&lt;br /&gt;
* https://daqstore.triumf.ca/AgWiki/index.php/Main_Page -- this wiki&lt;br /&gt;
* https://bitbucket.org/ttriumfdaq/agdaq - git repository for agdaq&lt;br /&gt;
* https://bitbucket.org/expalpha  -- git repository on bitbucket&lt;br /&gt;
* https://edev-group.triumf.ca/fw/exp/alphag -- git repository on edev gitlab&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/170 - PWB inventory database&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/168 - ADC (GRIF-16) inventory, FMC-ADC32rev0,rev1 inventory&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/176 - FMC-ADC32rev1.1 inventory&lt;br /&gt;
&lt;br /&gt;
= Hardware manuals =&lt;br /&gt;
&lt;br /&gt;
* [[TRG]] - trigger board (GRIF-C) manual&lt;br /&gt;
* CDM - https://daq.triumf.ca/DaqWiki/index.php/VME-CDM -- clock VME-CDM manual&lt;br /&gt;
* ADC - https://daq.triumf.ca/DaqWiki/index.php/VME-GRIF-ADC16-Rev1 -- GRIF-16 ADC manual&lt;br /&gt;
* [[PWB]] - TPC Pad Wing Board manual&lt;br /&gt;
* TDC - https://www.triumf.info/wiki/DAQwiki/index.php/GSI_TRB3&lt;br /&gt;
* [[chronobox]] - chronobox manual&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
Full system: (ADC fw rel-20201112-ko, PWB fw 20201005_ko)&lt;br /&gt;
* 1 Hz stable, ADC adc32 9 supp off rate 0.3 M/s, adc16 off, PWB udp_delay 25 supp off active 64 rate 6.6+4+6+4.6=21.2 M/s, TDC off, total rate 21 M/s&lt;br /&gt;
* 500 Hz stable, ADC adc32 9 supp 1500 rate 6 M/s, adc16 off, PWB udp_delay 10 supp 100 active 63 rate 3+4+3+3=13 M/s, TDC off, total rate 19 M/s&lt;br /&gt;
&lt;br /&gt;
Single ADC: (fw rel-20201112-ko)&lt;br /&gt;
&lt;br /&gt;
Fully suppressed data, sthreshold 5000&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 500 Hz: stable (nominal max trigger rate)&lt;br /&gt;
* 6700 Hz: stable, 8 Mbytes/sec&lt;br /&gt;
* 6800 Hz: evb eventually confused&lt;br /&gt;
* 6850 Hz: evb confused, no lost triggers in the ADC, no crash in the ADC&lt;br /&gt;
&lt;br /&gt;
All data, 510 samples/event, sthreshold 10 (fw rel-20201122-ko)&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 100 Hz: stable, 3.4 Mbytes/sec&lt;br /&gt;
* 500 Hz: stable, 17 Mbytes/sec (nominal max trigger rate)&lt;br /&gt;
* 1000 Hz: stable, 32 Mbytes/sec&lt;br /&gt;
* 3100 Hz: stable, 106 M/s (approaching saturation of 1gige ethernet)&lt;br /&gt;
* 3200 Hz: stable, 110 M/s - TRG communication is in trouble&lt;br /&gt;
* 3300 Hz: stable, 116 M/s&lt;br /&gt;
* 3400 Hz: incomplete events, no ADC crash (&amp;quot;dropped due to full&amp;quot; counting, &amp;quot;dropped due to busy&amp;quot; are zero, this is as expected).&lt;br /&gt;
&lt;br /&gt;
no suppression (different fpga data path)&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 100 Hz: stable&lt;br /&gt;
* 500 Hz: stable, 17 M/s (nominal max trigger rate)&lt;br /&gt;
* 1000 Hz: stable, 32 M/s&lt;br /&gt;
* 3000 Hz: stable, 100 M/s (approaching saturation of 1gige ethernet)&lt;br /&gt;
* 3300 Hz: incomplete events, no ADC crash (&amp;quot;dropped due to full&amp;quot; counting, &amp;quot;dropped due to busy&amp;quot; are zero, this is as expected).&lt;br /&gt;
&lt;br /&gt;
= Network connections =&lt;br /&gt;
&lt;br /&gt;
The experiment private network number is: 192.168.1.x, gateway 192.168.1.1, netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
network map:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- TRIUMF/CERN network --1gige-- alphagdaq --10gige-- juniper switch --1gige-- centrecom switch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== alphagdaq network connections ==&lt;br /&gt;
&lt;br /&gt;
on the rear of the machine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
|   | rj45 | rj45 |         | sfp | sfp |&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
- left rj45 - copper 1gige - eno1 - spare (inactive)&lt;br /&gt;
- right rj45 - copper 1gige - eno2 - dhcp - cern/triumf network&lt;br /&gt;
- left sfp - 10gige - enp1s0f1 - spare (inactive)&lt;br /&gt;
- right sfp - 10gige - enp1s0f0 - static 192.168.1.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== connections between switches ==&lt;br /&gt;
&lt;br /&gt;
* alphagdaq to juniper switch: direct attach (DAC) 10gige cable into any port of juniper switch&lt;br /&gt;
* juniper switch to centrecom switch: rj45 sfp in any port of juniper switch - cat5e/cat6 cable - to any port of centrecom switch&lt;br /&gt;
* cat5e/cat6 cable from any port of centrecom switch to the XXX port on the back of the juniper switch&lt;br /&gt;
&lt;br /&gt;
== juniper switch ==&lt;br /&gt;
&lt;br /&gt;
connected to juniper switch front is:&lt;br /&gt;
&lt;br /&gt;
* everything that sends event data to alphagdaq, specifically:&lt;br /&gt;
** TRG (rj45 sfp)&lt;br /&gt;
** 16x ADC (fiber sfp)&lt;br /&gt;
** 64x PWB (fiber sfp)&lt;br /&gt;
* 10gige uplink to alphagdaq (10gige DAC cable)&lt;br /&gt;
* 1gige link to centrecom switch (rj45 sfp)&lt;br /&gt;
* 40gige ports are not used&lt;br /&gt;
&lt;br /&gt;
connected to the juniper switch rear:&lt;br /&gt;
&lt;br /&gt;
* CON is the serial console via RJ45-to-DB9 to USB-serial adapter to alphagdaq USB port (9600bps, 8N1, no flow control)&lt;br /&gt;
* C0 is the management ethernet interface port, connect to any port on the centrecom switch (juniper-private will ping)&lt;br /&gt;
&lt;br /&gt;
== centrecom switch ==&lt;br /&gt;
&lt;br /&gt;
* everything with copper rj45 connections, specifically:&lt;br /&gt;
** CDM boards&lt;br /&gt;
** HV, LV and VME power supplies&lt;br /&gt;
** RaspberryPi3 boards&lt;br /&gt;
** gas handling MFCs (algas)&lt;br /&gt;
** cooling system controller (moxa01)&lt;br /&gt;
&lt;br /&gt;
= USB connections =&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* alphagdaq has USB2 and USB3 connections. They are not the same, they are not generally interchangeable.&lt;br /&gt;
* USB3 connections and cables are generally blue coloured.&lt;br /&gt;
&lt;br /&gt;
List of USB connections from alphagdaq:&lt;br /&gt;
&lt;br /&gt;
* front USB3 port (blue): USB-A-to-B cable to USB blaster connected to the trigger board (front of rack)&lt;br /&gt;
* rear USB3 port (blue): USB3 short jumper to USB3 hub&lt;br /&gt;
* rear USB2 port (black): USB2 unpowered hub (Logiix) to USB-A-to-B cable to UPS USB connector&lt;br /&gt;
* rear USB2 port (black): USB-to-Serial adaper to DB9 to RJ45 adapter to Juniper switch console port&lt;br /&gt;
&lt;br /&gt;
Note: UPS USB connection does not work with alphagdaq USB ports (both usb2 and usb3), but combination&lt;br /&gt;
using the unpowered USB2 hub seems to work ok.&lt;br /&gt;
&lt;br /&gt;
List of USB connections from the USB hub:&lt;br /&gt;
&lt;br /&gt;
* this is a powered USB3 hub&lt;br /&gt;
* USB-A-to-MicroUSB - to lvdb boards&lt;br /&gt;
* USB-A-to-Wiener interlock cable&lt;br /&gt;
&lt;br /&gt;
= Clock and trigger distribution =&lt;br /&gt;
&lt;br /&gt;
== Explanation ==&lt;br /&gt;
&lt;br /&gt;
Trigger is generated by the trigger board (aka TRG, aka GRIF-C),&lt;br /&gt;
from the TRG eSATA output through the eSATA splitter it is fed into&lt;br /&gt;
the master CDM. The master CDM outputs the trigger on all MiniSAS output ports.&lt;br /&gt;
One of the master CDM MiniSAS outputs is connected to the CDM slave eSATA input.&lt;br /&gt;
The same as the master CDM, the slave CDM outputs the trigger on all MiniSAS output ports.&lt;br /&gt;
&lt;br /&gt;
The master 62.5MHz clock is generated by the master CDM using the internal 10MHz oscillator&lt;br /&gt;
or the external 10MHz AD clock. Also on MiniSAS port 6 the master CDM generates&lt;br /&gt;
the 200MHz clock for the TDC. This clock is frequency-locked to the master 62.5MHz clock.&lt;br /&gt;
&lt;br /&gt;
Master CDM clock selection (external CD 10MHz clock or internal oscillator 10MHz clock)&lt;br /&gt;
is done by a magic esper command (see below).&lt;br /&gt;
&lt;br /&gt;
From the master CDM, the clock is fed to: the slave CDM, the TRG (via the eSATA splitter)&lt;br /&gt;
and to the TDC (via the RJ45 splitter).&lt;br /&gt;
&lt;br /&gt;
The slave CDM sends the clock and the trigger to the ADCs and PWBs.&lt;br /&gt;
&lt;br /&gt;
== Schematic ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TRG (GRIF-C)&lt;br /&gt;
------------&lt;br /&gt;
eSATA &amp;lt;------&amp;gt; eSATA splitter&lt;br /&gt;
&lt;br /&gt;
eSATA splitter&lt;br /&gt;
--------------&lt;br /&gt;
trigger ---&amp;gt; eSATA ---&amp;gt; CDM-Master eSATA (trigger signal)&lt;br /&gt;
clock &amp;lt;--- (eSATA --- MiniSAS) &amp;lt;--- CDM MiniSAS (62.5MHz clock)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CDM-Master&lt;br /&gt;
----------&lt;br /&gt;
eSATA &amp;lt;--- eSATA splitter &amp;lt;--- eSATA from TRG (trigger signal)&lt;br /&gt;
MiniSAS 1 --&amp;gt; (MiniSAS --- eSATA) --&amp;gt; CDM-Slave eSATA (62.5 MHz)&lt;br /&gt;
MiniSAS 6 --&amp;gt; (MiniSAS --- eSATA) --&amp;gt; eSATA splitter --&amp;gt; RJ45 --&amp;gt; TDC (200 MHz)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CDM-Slave&lt;br /&gt;
---------&lt;br /&gt;
eSATA &amp;lt;--- trigger and 62.5MHz clock from CDM-Master&lt;br /&gt;
MiniSAS 1 --&amp;gt; ADC trigger and 62.5MHz clock&lt;br /&gt;
MiniSAS 2 --&amp;gt; same&lt;br /&gt;
MiniSAS 3 --&amp;gt; same&lt;br /&gt;
MiniSAS 4 --&amp;gt; same&lt;br /&gt;
MiniSAS 5 --&amp;gt; PWB trigger and 62.5MHz clock&lt;br /&gt;
MiniSAS 6 --&amp;gt; same&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VME_Crate_CERN.jpeg|800x450px|Layout of the VME crate at CERN.]]&lt;br /&gt;
Layout of the VME crate at CERN. The ALPHA-T module is in the rightmost slot. The Master CDM is next to it and it&#039;s labelled as #02. The Slave CDM is on the lefmost position and labelled by #03.&lt;br /&gt;
&lt;br /&gt;
== Setup of CDM boards ==&lt;br /&gt;
&lt;br /&gt;
ALPHA-g uses the Rev3 CDM boards. The 4 CDM boards that belong to ALPHA-g&lt;br /&gt;
have serial numbers 0, 1, 2 and 3 and are labeled cdm00, cdm01, cdm02, cdm03.&lt;br /&gt;
&lt;br /&gt;
All the boards can be used as master and slave positions, but have to be&lt;br /&gt;
configured appropriately.&lt;br /&gt;
&lt;br /&gt;
=== Slave setup ===&lt;br /&gt;
&lt;br /&gt;
* install the board&lt;br /&gt;
* connect ethernet&lt;br /&gt;
* connect esata external clock&lt;br /&gt;
* esper-tool cdmNN ### i.e. esper-tool cdm01&lt;br /&gt;
* cd template&lt;br /&gt;
* write current_setup 4&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* read&lt;br /&gt;
* observe clock frequency counters report correct values. &amp;quot;ext_clk&amp;quot; will only count if the lemo jumper is installed (see below)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11    esata_clk        uint32           R                 [62500246]                      &lt;br /&gt;
12    ext_clk          uint32           R                 [62500246]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
156   ld1_counter      uint32           RW                [3]                             &lt;br /&gt;
157   ld2_counter      uint32           RW                [3]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, check correct operation of the pll lock monitoring:&lt;br /&gt;
&lt;br /&gt;
* unplug the esata cable from the master CDM&lt;br /&gt;
* &amp;quot;red&amp;quot; light should go off&lt;br /&gt;
* read of lmk should report &amp;quot;pll1_ld&amp;quot; value 0 and &amp;quot;ld1_counter&amp;quot; and &amp;quot;ld2_counter&amp;quot; should increment&lt;br /&gt;
* reconnect the esata cable&lt;br /&gt;
* &amp;quot;red&amp;quot; light should return&lt;br /&gt;
* read of lmk should report both pll1_ld and pll2_ld locked (values &amp;quot;1&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Master setup ===&lt;br /&gt;
&lt;br /&gt;
* install the board&lt;br /&gt;
* connect ethernet&lt;br /&gt;
* esper-tool cdmNN ### i.e. esper-tool cdm01&lt;br /&gt;
* cd template&lt;br /&gt;
* write current_setup 3&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* write clkin_sel_mode 0&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* read&lt;br /&gt;
* observe clock frequency counters report correct values. &amp;quot;ext_clk&amp;quot; will only count if the &amp;quot;clock loopback&amp;quot; lemo jumper is installed (see below)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
12    ext_clk          uint32           R                 [62500189]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
156   ld1_counter      uint32           RW                [3]                             &lt;br /&gt;
157   ld2_counter      uint32           RW                [3]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the 200MHz clock:&lt;br /&gt;
* connect MiniSAS-eSATA splitter cable to MiniSAS output 6, connect eSATA end to CDM eSATA input&lt;br /&gt;
* in esper-tool, read cdm: esata_clk should report 200MHz clock&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11    esata_clk        uint32           R                 [200000603]                     &lt;br /&gt;
12    ext_clk          uint32           R                 [62500188]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Master setup with external 10 MHz clock ===&lt;br /&gt;
&lt;br /&gt;
* setup master CDM as above (using internal clock)&lt;br /&gt;
* connect 10MHz external clock to right LEMO #1&lt;br /&gt;
* esper-tool cdmNN&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* write sel_nim 1 # if clock is NIM signal&lt;br /&gt;
* write sel_nim 0 # if clock is TTL signal (i.e. chronobox LEMO output)&lt;br /&gt;
* read ext_clk&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[http://cdm00:/cdm]&amp;gt; read ext_clk&lt;br /&gt;
9999556&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if ext_clk reads 0 or does not read something close to 10MHz, stop here. debug the signal, try changing sel_nim, etc.&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* write clkin_sel_mode 2 # select external clock&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
150   clkin2_sel       bool             R                 [True]                          &lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* on the MIDAS TRG page, observe that TRG measured external clock frequency is close to 62.5 MHz&lt;br /&gt;
&lt;br /&gt;
== clkin_sel_mode positions ==&lt;br /&gt;
&lt;br /&gt;
* 0 = 10MHz internal oscillator (use on master CDM in standalone mode)&lt;br /&gt;
* 1 = eSATA clock (use on slave CDM)&lt;br /&gt;
* 2 = external clock, should be 10MHz (use on master CDM to run from AD clock)&lt;br /&gt;
&lt;br /&gt;
== LEMO connections ==&lt;br /&gt;
&lt;br /&gt;
* clock loopback jumper: to read the frequency of the generated 62.5MHz clock, connect LEMO cable from left LEMO #2 to the right LEMO #1&lt;br /&gt;
* 10MHz internal clock jumper: to feed 10MHz internal oscillator to the external clock, connect LEMO cable from right  LEMO #3 to the right LEMO #1.&lt;br /&gt;
* 10MHz external clock: to feed 10MHz external clock, connect LEMO cable to right LEMO #1&lt;br /&gt;
&lt;br /&gt;
= MIDAS frontends =&lt;br /&gt;
&lt;br /&gt;
== UDP ==&lt;br /&gt;
&lt;br /&gt;
feudp receives udp packets from the ADC and PWB boards. For each udp packet 1 midas event is created,&lt;br /&gt;
with 1 data bank containing the udp data. Events are sent into the MIDAS event buffer BUFUDP. The names&lt;br /&gt;
of the data banks are assigned in ODB /eq/feudp/settings.&lt;br /&gt;
&lt;br /&gt;
{ADC,PWB} --&amp;gt; 1gige --&amp;gt; switch --&amp;gt; 10gige --&amp;gt; alphagdaq --&amp;gt; feudp -&amp;gt; BUFUDP&lt;br /&gt;
&lt;br /&gt;
== CTRL ==&lt;br /&gt;
&lt;br /&gt;
fectrl controls all the ADC, PWB and trigger boards. It provides run start and stop sequencing,&lt;br /&gt;
runs the event synchronization sequence at the begin of the run, and records slow controls data (temperatures,&lt;br /&gt;
voltages, etc).&lt;br /&gt;
&lt;br /&gt;
fectrl receives UDP data packets from the trigger board and sends them to the MIDAS event buffer BUFUDP.&lt;br /&gt;
&lt;br /&gt;
fectrl receives commands from the control web pages (for ADC, PWB and trigger) to reboot, initialize, etc the boards.&lt;br /&gt;
&lt;br /&gt;
fectrl configures the event builder via odb /eq/fectrl/evbconfig.&lt;br /&gt;
&lt;br /&gt;
ADC &amp;lt;-&amp;gt; http esper &amp;lt;-&amp;gt; fectrl -&amp;gt; slow control data into midas history&lt;br /&gt;
&lt;br /&gt;
PWB &amp;lt;-&amp;gt; http esper &amp;lt;-&amp;gt; fectrl -&amp;gt; slow control data into midas history&lt;br /&gt;
&lt;br /&gt;
TRG &amp;lt;-&amp;gt; udp comm &amp;lt;-&amp;gt; fectrl -&amp;gt; BUFUDP, slow control and counters into midas history&lt;br /&gt;
&lt;br /&gt;
fectrl &amp;lt;-&amp;gt; midas rpc &amp;lt;-&amp;gt; mhttpd &amp;lt;-&amp;gt; json rpc &amp;lt;-&amp;gt; control web pages for ADC, PWB and trigger&lt;br /&gt;
&lt;br /&gt;
== EVB ==&lt;br /&gt;
&lt;br /&gt;
feevb receives udp packet data from the MIDAS event buffer BUFUDP, inspects the packet timestamps&lt;br /&gt;
and collects the data with matching timestamps into physics events. feevb has provisions to do&lt;br /&gt;
data suppression, reduction and compression in addition to the data reduction done&lt;br /&gt;
in the ADC and PWB firmware.&lt;br /&gt;
&lt;br /&gt;
feevb event synchronization relies on the event synchronization sequence done by fectrl when a run is started.&lt;br /&gt;
&lt;br /&gt;
{ADC, PWB, TRG} -&amp;gt; BUFUDP -&amp;gt; feevb -&amp;gt; SYSTEM -&amp;gt; mlogger -&amp;gt; compression -&amp;gt; disk storage&lt;br /&gt;
&lt;br /&gt;
=== internal structure ===&lt;br /&gt;
&lt;br /&gt;
* event buffer readers, instances for BUFTRG, BUFTDC, BUFADC, BUFUDP&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BufferReader class - reads one midas event buffer:&lt;br /&gt;
- BufferReaderThread()&lt;br /&gt;
-- in batches of 1000 events&lt;br /&gt;
--- lock&lt;br /&gt;
--- TickLocked()&lt;br /&gt;
----- ReadEvent() -&amp;gt; bm_receive_event_alloc()&lt;br /&gt;
----- fHandler-&amp;gt;HandleEvent()&lt;br /&gt;
-- fHandler-&amp;gt;XMaybeFlushBank()&lt;br /&gt;
-- sleep 100 usec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* event header decoder and intermediate buffer&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Handler class - accumulates events, sends them to the EVB in batches&lt;br /&gt;
&lt;br /&gt;
- HandleEvent() &amp;lt;- BufferReaderThread() - receive incoming events&lt;br /&gt;
-- loop over all banks, examine bank name&lt;br /&gt;
--- call AddAdcBank(), AddPwbBank(), AddTrgBank(), AddTdcBank() according to bank name&lt;br /&gt;
----  AddXxxBank() -&amp;gt; XAddBank()&lt;br /&gt;
--- unknown banks go directly to evb-&amp;gt;SendQueue&lt;br /&gt;
-- check if synchronization has completed&lt;br /&gt;
&lt;br /&gt;
- XAddBank() - save BankBuf objects in a buffer&lt;br /&gt;
&lt;br /&gt;
- XMaybeFlushBank(), XFlushBank() - send all accumulated data to the Evb class&lt;br /&gt;
-- evb-&amp;gt;lock()&lt;br /&gt;
-- for each buffered BankBuf objects,&lt;br /&gt;
--- call evb-&amp;gt;AddBankLocked()&lt;br /&gt;
-- buffer is now empty&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* event builder&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Evb class - assemble event fragments according to timestamps&lt;br /&gt;
&lt;br /&gt;
- fEvents fifo (deque) - time sorted list of partially assembled events&lt;br /&gt;
-- new entries are added by FindEvent()&lt;br /&gt;
-- entries are modified by MergeSlot()&lt;br /&gt;
-- old entries are removed by GetLocked()&lt;br /&gt;
&lt;br /&gt;
- AddBankLocked() &amp;lt;- XFlushBank() &amp;lt;- BufferReaderThread()&lt;br /&gt;
-- call fSync-&amp;gt;Add()&lt;br /&gt;
-- transform BankBuf to EvbEventBuf&lt;br /&gt;
-- push it into per-module buffer fBuf[imodule]&lt;br /&gt;
&lt;br /&gt;
- EvbThread()&lt;br /&gt;
-- EvbTickLocked()&lt;br /&gt;
--- BuildLocked()&lt;br /&gt;
---- in a loop, for no more than 1 sec&lt;br /&gt;
----- loop over all per-module buffers fBuf&lt;br /&gt;
------ pop first entry, pass it to BuildSlot()&lt;br /&gt;
------- call FindEvent()&lt;br /&gt;
------- call MergeSlot()&lt;br /&gt;
------- call CheckEvent()&lt;br /&gt;
--- in a loop&lt;br /&gt;
---- get all completed events via GetLocked() pass them to SendQueue-&amp;gt;PushEvent()&lt;br /&gt;
-- if done nothing, sleep 100 usec, otherwise nominal sleep to free the evb lock&lt;br /&gt;
&lt;br /&gt;
- GetNext() &amp;lt;- GetLocked() &amp;lt;- EvbThread() - get completed events&lt;br /&gt;
-- examine oldest EvbEvent entry in fEvents:&lt;br /&gt;
-- pop it if it is complete&lt;br /&gt;
-- pop it if it is too old (to prevent old incomplete events from stalling the evb) (&amp;quot;pop age&amp;quot; on the evb page)&lt;br /&gt;
-- pop it if a following event is complete (&amp;quot;pop following&amp;quot; on the evb page)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* send queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SendQueue class - prepare events for writing to midas SYSTEM event buffer&lt;br /&gt;
&lt;br /&gt;
- PushEvent() &amp;lt;- EvbThread()&lt;br /&gt;
-- push FragmentBuf into the queue&lt;br /&gt;
&lt;br /&gt;
- SendQueueThread()&lt;br /&gt;
-- in a batch of 1000 events, call Tick()&lt;br /&gt;
--- pop FragmentBuf from the queue, call SendEvent()&lt;br /&gt;
--- compose midas event (memcpy()!)&lt;br /&gt;
--- TMFE fEq-&amp;gt;SendEvent()&lt;br /&gt;
--- bm_send_event()&lt;br /&gt;
-- sleep 100 usec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* equipment object&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EvbEq class - implements the midas equipment&lt;br /&gt;
- HandleBeginRun()&lt;br /&gt;
- HandleEndRun()&lt;br /&gt;
- HandlePeriodic()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== multithreading ===&lt;br /&gt;
&lt;br /&gt;
* BufferReaderThread() one per midas event buffer&lt;br /&gt;
** high CPU use: bm_receive_event(), AddXxxBank()&lt;br /&gt;
** lock contention: midas event buffer lock, evb lock into XFlushBank-&amp;gt;AddBankLocked()&lt;br /&gt;
* EvbThread()&lt;br /&gt;
** O(size of fEvents): FindEvent(), GetNext()&lt;br /&gt;
** lock contention: evb lock against XFlushBank(), SendQueue lock (1 per output event)&lt;br /&gt;
* SendQueueThread()&lt;br /&gt;
** high CPU use: memcpy() in SendEvent(), memcpy() in bm_send_event&lt;br /&gt;
** lock contention: event queue lock against EvbThread, midas event buffer lock&lt;br /&gt;
* main thread&lt;br /&gt;
** lock contention: evb lock in ReportEvb() and elsewhere&lt;br /&gt;
&lt;br /&gt;
= ODB entries =&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings ==&lt;br /&gt;
* TBW&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TrigSrc - trigger source selection ==&lt;br /&gt;
* TrigPulser                      - trigger on the pulser&lt;br /&gt;
* TrigEsataNimGrandOr             - trigger on external NIM inputs of GRIF-16 ADC modules&lt;br /&gt;
* TrigAdc16GrandOr                - trigger on any adc16 signals (see adc16_masks)&lt;br /&gt;
* TrigAdc32GrandOr                - trigger on any adc32 signals (see adc32_masks)&lt;br /&gt;
* Trig1ormore                     - trigger on adc16 multiplicity 1 or more&lt;br /&gt;
* Trig2ormore                     - ditto, 2 or more&lt;br /&gt;
* Trig3ormore                     - ditto, 3 or more&lt;br /&gt;
* Trig4ormore                     - ditto, 4 or more&lt;br /&gt;
* TrigAdcGrandOr                  - trigger on any ADC signal&lt;br /&gt;
* TrigAwCoincA                    - trigger on TPC AW coincidence (see [[TRG]] manual)&lt;br /&gt;
* TrigAwCoincB                    - ditto&lt;br /&gt;
* TrigAwCoincC                    - ditto&lt;br /&gt;
* TrigAwCoincD                    - ditto&lt;br /&gt;
* TrigAwCoinc                     - ditto&lt;br /&gt;
* TrigAw1ormore	- trigger on TPC AW per-preamp multiplicity 1 or more (see [[TRG]] manual)&lt;br /&gt;
* TrigAw2ormore	- ditto, 2 or more&lt;br /&gt;
* TrigAw3ormore	- ditto, 3 or more&lt;br /&gt;
* TrigAw4ormore - ditto, 4 or more&lt;br /&gt;
* TrigAwMLU                       - trigger on TPC AW MLU signal (see [[TRG]] manual)&lt;br /&gt;
* TrigBscGrandOr                  - trigger on any BSC signal&lt;br /&gt;
* TrigBscMult                     - trigger on predefined BSC multiplicity (see [[TRG]] manual)&lt;br /&gt;
* TrigCoinc                       - trigger on predefined coincidence of TPC AW, BSC and external signal (see [[TRG]] manual)&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TRG - trigger settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will not do anything with the trigger board. Normal value &amp;quot;y&amp;quot;&lt;br /&gt;
* Modules - hostnames of the trigger board. Normal value &amp;quot;alphat01&amp;quot;&lt;br /&gt;
* NimMask - 32-bit mask for the 32x NIM inputs (see TRG manual). Normal value 0, unless external trigger is in use.&lt;br /&gt;
* EsataMask - 32-bit mask for the 32x eSATA signals (see TRG manual). Normal value 0.&lt;br /&gt;
* adc16_mask[16] - 16x 16-bit mask for the 100MHz GRIF-16 onboard ADCs (see TRG manual). Normal value 0xFFFF for all 16 data links.&lt;br /&gt;
* adc32_mask[16] - 16x 32-bit mask for the 62.5MHz FMC-ADC32 ADCs (see TRG manual). Normal value 0xFFFFFFFF for all 16 data links.&lt;br /&gt;
* PassThrough - if set to &amp;quot;y&amp;quot;, trigger is passed through the trigger module without generating any events and without causing deadtime.&lt;br /&gt;
* AwCoincA, B, C and D - 32-bit masks for the aw16 coincidence trigger (see TRG manual)&lt;br /&gt;
* Aw16FromAdc16 - route AW trigger (aw16) from adc16 (100MHz ADCs 0..15)&lt;br /&gt;
* Aw16FromAdc32a - route AW trigger (aw16) from adc32 group 15..0 (62.5MHz FMC-ADC32 in ADCs 0..7)&lt;br /&gt;
* Aw16FromAdc32b - route AW trigger (aw16) from adc32 group 31..16 (62.5MHz FMC-ADC32 in ADCs 8..15)&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/PWB - PWB settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will not do anything with PWBs. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_boot_user_page - if set to &amp;quot;n&amp;quot;, fectrl will not try to reboot PWBs into the user page firmware. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_trigger - if set to &amp;quot;n&amp;quot;, all PWBs will be set to ignore the trigger. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_trigger_group_a - field wire pulser defeats the data suppression (every channel has a pulse) resulting in too much data overwhelming the DAQ (lost UDP packets). To permit correct data taking of field wire pulser data, PWBs are split into two groups (a and b), only one of the two groups should be enabled for field wire pulser runs. Both groups should be enabled for normal data taking. Normal value is &amp;quot;y&amp;quot;&lt;br /&gt;
* enable_trigger_group_b - see &amp;quot;enable_trigger_group_a&amp;quot;. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* modules[64] - hostnames of PWB boards&lt;br /&gt;
* boot_user_page[64] - if set to &amp;quot;y&amp;quot; and enable_boot_user_page is &amp;quot;y&amp;quot;, fectrl will reboot the corresponding PWB to the user page firmware.&lt;br /&gt;
* trigger[64] - if set to &amp;quot;y&amp;quot; and enable_trigget is &amp;quot;y&amp;quot;, fectrl will set the PWB to accept the trigger.&lt;br /&gt;
* ch_enable - if set to &amp;quot;n&amp;quot; disables all PWB channels. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* ch_force - is set to &amp;quot;y&amp;quot; disables channel suppression (all PWB channels are read)&lt;br /&gt;
* suppress_reset - if set to &amp;quot;y&amp;quot; enables channel suppression for reset channels (threshold has to be set correctly)&lt;br /&gt;
* suppress_fpn - if set to &amp;quot;y&amp;quot; enables channel suppression for fpn channels (threshold has to be set correctly)&lt;br /&gt;
* suppress_pads -  set to &amp;quot;y&amp;quot; enables channel suppression for TPC pad channels (threshold has to be set correctly)&lt;br /&gt;
* disable_reset1 - data suppression algorithm does not work for the channel &amp;quot;reset1&amp;quot; and it has to be suppressed explicitly by setting this value to &amp;quot;y&amp;quot;. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* baseline_{reset,fpn,pads}[64] - waveform baseline for each PWB position&lt;br /&gt;
* threshold_{reset,fpn,pads} - waveform suppression threshold, see below:&lt;br /&gt;
* ch_threshold - PWB sca_N_ch_threshold, if set to 0, threshold is computed as &amp;quot;baseline_pads[seqpwb]-threshold_pads&amp;quot;. Normal value is 0.&lt;br /&gt;
* test_mode - enable PWB test mode, the ADC data is replaced with a test pattern, see PWB esper variable signalproc/test_mode&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TDC - TDC settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will tell the event builder that the TDC is not running. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/EvbConfig - EVB configuration ==&lt;br /&gt;
All arrays have the same size corresponding to the number of EVB slots.&lt;br /&gt;
* name[] - slot name for the web page (trg01, adc01, adc01/adc32, pwb31/0, tdc01, etc)&lt;br /&gt;
* type[] - slot type: 1=TRG, 2=ADC16 and ADC32, 3=obsolete PWB, 4=obsolete PWB, 5=PWB, 6=TDC&lt;br /&gt;
* module[] - module number (adcNN, adcNN+100, pwbNN, etc)&lt;br /&gt;
* nbanks[] - number of expected banks (16 for ADC16, 32 for ADC32, not used, set to 1 for all others)&lt;br /&gt;
* tsfreq[] - timestamp frequency in Hz.&lt;br /&gt;
&lt;br /&gt;
= Trigger configuration =&lt;br /&gt;
&lt;br /&gt;
These trigger modes are implemented:&lt;br /&gt;
* (manual trigger from web page)&lt;br /&gt;
* software pulser trigger (from fectrl)&lt;br /&gt;
* hardware pulser trigger (from the trigger board)&lt;br /&gt;
* NIM and eSATA trigger from ADC front panel inputs&lt;br /&gt;
* adc16 and adc32 discriminator triggers:&lt;br /&gt;
** adc16 grand-or trigger&lt;br /&gt;
** adc32 grand-or trigger&lt;br /&gt;
** adc (adc16+adc32) grand-or trigger&lt;br /&gt;
** adc16 multiplicity trigger (1ormore, 2ormore, 3ormore, 4ormore) for use with barrel scintillator&lt;br /&gt;
** anode wire multiplicity trigger (1ormore, 2ormore, 3ormore, 4ormore) (anode wire signals can be fed from adc16 or from adc32 signals)&lt;br /&gt;
** anode wire coincidence trigger&lt;br /&gt;
** anode wire MLU (memory lookup) trigger&lt;br /&gt;
&lt;br /&gt;
== NIM trigger from ADC front panel ==&lt;br /&gt;
&lt;br /&gt;
Trigger path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NIM signal --&amp;gt; LEMO input on ADC front panel --&amp;gt; data encoder --&amp;gt; data link to trigger board --&amp;gt; data decoder --&amp;gt; mask --&amp;gt; nim-esata-grand-or --&amp;gt; trigger&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable NIM trigger, do this:&lt;br /&gt;
* connect NIM signal to ADC front panel input&lt;br /&gt;
** Note1: NIM signal must be inverted&lt;br /&gt;
** Note2: LEMO connectors should be set to &amp;quot;NIM input&amp;quot; mode by ADC on-board jumpers (see ADC manual)&lt;br /&gt;
* observe correct bit goes to zero in the TRG web page: data link high work should change:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0xNF00&#039;0000 (N is the module id) to&lt;br /&gt;
0xN700&#039;0000 (left lemo) or&lt;br /&gt;
0xNB00&#039;0000 (right lemo)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Note3: if data link bits do not change, most likely the LEMO connectors are set to &amp;quot;DAC output&amp;quot; mode. Try to use LEMO inputs of a different ADC.&lt;br /&gt;
* compute the NIM mask: there are 32 bits, 2 bits per ADC data link. Bit 0x1 is right LEMO, bit 0x2 is left LEMO&lt;br /&gt;
* for example, to use left LEMO of ADC data link 12, set nim mask to (0x2)&amp;lt;&amp;lt;(2*12) = 0x02000000&lt;br /&gt;
* development branch of the git repository contains &#039;&#039;scripts/nim_mask.py&#039;&#039;, which can compute forwards and backwards&lt;br /&gt;
* initialize the trigger board (on the TRG web page press button &amp;quot;initialize&amp;quot;), or start a new run&lt;br /&gt;
* on the history plot with &amp;quot;NIM grand or&amp;quot; counter, the rate should change from zero&lt;br /&gt;
* if a run is active, if one of the ADC LEMO outputs is set to output the trigger signal as a NIM pulse, one should see it fire use a scope. The delay or jitter between NIM trigger in and NIM trigger out should be around 100-200 ns (FIXME - measure this!)&lt;br /&gt;
* to set the DAQ to trigger on the NIM signal, on the run start page, check the box &amp;quot;TrigEsataNimGrandOr&amp;quot;.&lt;br /&gt;
** Note: remember to set the scaledown to 0 if so desired.&lt;br /&gt;
&lt;br /&gt;
= TPC field wire pulser =&lt;br /&gt;
&lt;br /&gt;
The TPC field wire pulser input should be connected directly to the DAC output of adc01 (right lemo connector).&lt;br /&gt;
&lt;br /&gt;
DAC settings in ODB /Equipment/CTRL/Settings/ADC/DAC/&lt;br /&gt;
&lt;br /&gt;
* for pulsing PWBs (maximum possible pulse height in PWBs. Overdrives the AW ADC waveforms)&lt;br /&gt;
** dac_baseline: -8000&lt;br /&gt;
** dac_amplitude: 8000&lt;br /&gt;
** ramp_up_rate: 128&lt;br /&gt;
** ramp_down_rate: 70&lt;br /&gt;
** ramp_top_len: 128&lt;br /&gt;
&lt;br /&gt;
* for pulsing AW: (AW ADC waveforms are in range. PWB waveforms are too small for goor time resolution)&lt;br /&gt;
** dac_baseline: -2000&lt;br /&gt;
** dac_amplitude: 4000&lt;br /&gt;
** ramp_up_rate: 20&lt;br /&gt;
** ramp_down_rate: 20&lt;br /&gt;
** ramp_top_len: 128&lt;br /&gt;
&lt;br /&gt;
= TDC connections =&lt;br /&gt;
&lt;br /&gt;
* SFP8 - fiber SFP to Juniper switch&lt;br /&gt;
* right RJ45 - 200MHz clock&lt;br /&gt;
* left RJ45 - external trigger&lt;br /&gt;
&lt;br /&gt;
= MIDAS Data banks =&lt;br /&gt;
&lt;br /&gt;
* ATAT - fectrl - UDP packets from GRIF-C/TRG trigger board&lt;br /&gt;
* TRBA - fetdc - TDC data&lt;br /&gt;
* TRTM - fetdc - TDC FPGA temperatures, TID_FLOAT[5].&lt;br /&gt;
* AAnn - feudp - UDP packets from GRIF-16 ADC (before the event builder), &amp;quot;nn&amp;quot; is the ADC module number: adc01 is AA01 through adc20 is AA20.&lt;br /&gt;
* BBxx - feudp - UDP packets from PWB, obsolete&lt;br /&gt;
* Bnnm, Cnnm - feevb - EVB output banks: ADC data, &amp;quot;nn&amp;quot; is the ADC module number (1..20), &amp;quot;m&amp;quot; is the channel number (0..9,A..F), format is same as AAnn banks.&lt;br /&gt;
* PAnn - feudp - UDP packets from PWB, &amp;quot;nn&amp;quot; is the PWB module number (00..99), obsolete&lt;br /&gt;
* PBnn - feudp - UDP packets from PWB, &amp;quot;nn&amp;quot; is the PWB module number (00..99), PB01 is pwb01, PB78 is pwb78&lt;br /&gt;
* PCnn - feevb - EVB output banks: PWB data, &amp;quot;nn&amp;quot; is the PWB module number (00..99), same as above, format is same as PBnn banks&lt;br /&gt;
&lt;br /&gt;
= ZZZ =&lt;br /&gt;
&lt;br /&gt;
ZZZ&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Daq&amp;diff=649</id>
		<title>Daq</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Daq&amp;diff=649"/>
		<updated>2021-02-09T23:21:43Z</updated>

		<summary type="html">&lt;p&gt;Acapra: /* Schematic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Links =&lt;br /&gt;
&lt;br /&gt;
* https://alphacpc05.cern.ch/agdaq/ -- midas daq page for the agdaq system at CERN&lt;br /&gt;
* https://daq16.triumf.ca -- midas daq page for the agmini system at TRIUMF&lt;br /&gt;
* https://daq.triumf.ca/elog-alphag/alphag/ -- elog&lt;br /&gt;
* https://daqstore.triumf.ca/AgWiki/index.php/Main_Page -- this wiki&lt;br /&gt;
* https://bitbucket.org/ttriumfdaq/agdaq - git repository for agdaq&lt;br /&gt;
* https://bitbucket.org/expalpha  -- git repository on bitbucket&lt;br /&gt;
* https://edev-group.triumf.ca/fw/exp/alphag -- git repository on edev gitlab&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/170 - PWB inventory database&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/168 - ADC (GRIF-16) inventory, FMC-ADC32rev0,rev1 inventory&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/176 - FMC-ADC32rev1.1 inventory&lt;br /&gt;
&lt;br /&gt;
= Hardware manuals =&lt;br /&gt;
&lt;br /&gt;
* [[TRG]] - trigger board (GRIF-C) manual&lt;br /&gt;
* CDM - https://daq.triumf.ca/DaqWiki/index.php/VME-CDM -- clock VME-CDM manual&lt;br /&gt;
* ADC - https://daq.triumf.ca/DaqWiki/index.php/VME-GRIF-ADC16-Rev1 -- GRIF-16 ADC manual&lt;br /&gt;
* [[PWB]] - TPC Pad Wing Board manual&lt;br /&gt;
* TDC - https://www.triumf.info/wiki/DAQwiki/index.php/GSI_TRB3&lt;br /&gt;
* [[chronobox]] - chronobox manual&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
Full system: (ADC fw rel-20201112-ko, PWB fw 20201005_ko)&lt;br /&gt;
* 1 Hz stable, ADC adc32 9 supp off rate 0.3 M/s, adc16 off, PWB udp_delay 25 supp off active 64 rate 6.6+4+6+4.6=21.2 M/s, TDC off, total rate 21 M/s&lt;br /&gt;
* 500 Hz stable, ADC adc32 9 supp 1500 rate 6 M/s, adc16 off, PWB udp_delay 10 supp 100 active 63 rate 3+4+3+3=13 M/s, TDC off, total rate 19 M/s&lt;br /&gt;
&lt;br /&gt;
Single ADC: (fw rel-20201112-ko)&lt;br /&gt;
&lt;br /&gt;
Fully suppressed data, sthreshold 5000&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 500 Hz: stable (nominal max trigger rate)&lt;br /&gt;
* 6700 Hz: stable, 8 Mbytes/sec&lt;br /&gt;
* 6800 Hz: evb eventually confused&lt;br /&gt;
* 6850 Hz: evb confused, no lost triggers in the ADC, no crash in the ADC&lt;br /&gt;
&lt;br /&gt;
All data, 510 samples/event, sthreshold 10 (fw rel-20201122-ko)&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 100 Hz: stable, 3.4 Mbytes/sec&lt;br /&gt;
* 500 Hz: stable, 17 Mbytes/sec (nominal max trigger rate)&lt;br /&gt;
* 1000 Hz: stable, 32 Mbytes/sec&lt;br /&gt;
* 3100 Hz: stable, 106 M/s (approaching saturation of 1gige ethernet)&lt;br /&gt;
* 3200 Hz: stable, 110 M/s - TRG communication is in trouble&lt;br /&gt;
* 3300 Hz: stable, 116 M/s&lt;br /&gt;
* 3400 Hz: incomplete events, no ADC crash (&amp;quot;dropped due to full&amp;quot; counting, &amp;quot;dropped due to busy&amp;quot; are zero, this is as expected).&lt;br /&gt;
&lt;br /&gt;
no suppression (different fpga data path)&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 100 Hz: stable&lt;br /&gt;
* 500 Hz: stable, 17 M/s (nominal max trigger rate)&lt;br /&gt;
* 1000 Hz: stable, 32 M/s&lt;br /&gt;
* 3000 Hz: stable, 100 M/s (approaching saturation of 1gige ethernet)&lt;br /&gt;
* 3300 Hz: incomplete events, no ADC crash (&amp;quot;dropped due to full&amp;quot; counting, &amp;quot;dropped due to busy&amp;quot; are zero, this is as expected).&lt;br /&gt;
&lt;br /&gt;
= Network connections =&lt;br /&gt;
&lt;br /&gt;
The experiment private network number is: 192.168.1.x, gateway 192.168.1.1, netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
network map:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- TRIUMF/CERN network --1gige-- alphagdaq --10gige-- juniper switch --1gige-- centrecom switch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== alphagdaq network connections ==&lt;br /&gt;
&lt;br /&gt;
on the rear of the machine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
|   | rj45 | rj45 |         | sfp | sfp |&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
- left rj45 - copper 1gige - eno1 - spare (inactive)&lt;br /&gt;
- right rj45 - copper 1gige - eno2 - dhcp - cern/triumf network&lt;br /&gt;
- left sfp - 10gige - enp1s0f1 - spare (inactive)&lt;br /&gt;
- right sfp - 10gige - enp1s0f0 - static 192.168.1.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== connections between switches ==&lt;br /&gt;
&lt;br /&gt;
* alphagdaq to juniper switch: direct attach (DAC) 10gige cable into any port of juniper switch&lt;br /&gt;
* juniper switch to centrecom switch: rj45 sfp in any port of juniper switch - cat5e/cat6 cable - to any port of centrecom switch&lt;br /&gt;
* cat5e/cat6 cable from any port of centrecom switch to the XXX port on the back of the juniper switch&lt;br /&gt;
&lt;br /&gt;
== juniper switch ==&lt;br /&gt;
&lt;br /&gt;
connected to juniper switch front is:&lt;br /&gt;
&lt;br /&gt;
* everything that sends event data to alphagdaq, specifically:&lt;br /&gt;
** TRG (rj45 sfp)&lt;br /&gt;
** 16x ADC (fiber sfp)&lt;br /&gt;
** 64x PWB (fiber sfp)&lt;br /&gt;
* 10gige uplink to alphagdaq (10gige DAC cable)&lt;br /&gt;
* 1gige link to centrecom switch (rj45 sfp)&lt;br /&gt;
* 40gige ports are not used&lt;br /&gt;
&lt;br /&gt;
connected to the juniper switch rear:&lt;br /&gt;
&lt;br /&gt;
* CON is the serial console via RJ45-to-DB9 to USB-serial adapter to alphagdaq USB port (9600bps, 8N1, no flow control)&lt;br /&gt;
* C0 is the management ethernet interface port, connect to any port on the centrecom switch (juniper-private will ping)&lt;br /&gt;
&lt;br /&gt;
== centrecom switch ==&lt;br /&gt;
&lt;br /&gt;
* everything with copper rj45 connections, specifically:&lt;br /&gt;
** CDM boards&lt;br /&gt;
** HV, LV and VME power supplies&lt;br /&gt;
** RaspberryPi3 boards&lt;br /&gt;
** gas handling MFCs (algas)&lt;br /&gt;
** cooling system controller (moxa01)&lt;br /&gt;
&lt;br /&gt;
= USB connections =&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* alphagdaq has USB2 and USB3 connections. They are not the same, they are not generally interchangeable.&lt;br /&gt;
* USB3 connections and cables are generally blue coloured.&lt;br /&gt;
&lt;br /&gt;
List of USB connections from alphagdaq:&lt;br /&gt;
&lt;br /&gt;
* front USB3 port (blue): USB-A-to-B cable to USB blaster connected to the trigger board (front of rack)&lt;br /&gt;
* rear USB3 port (blue): USB3 short jumper to USB3 hub&lt;br /&gt;
* rear USB2 port (black): USB2 unpowered hub (Logiix) to USB-A-to-B cable to UPS USB connector&lt;br /&gt;
* rear USB2 port (black): USB-to-Serial adaper to DB9 to RJ45 adapter to Juniper switch console port&lt;br /&gt;
&lt;br /&gt;
Note: UPS USB connection does not work with alphagdaq USB ports (both usb2 and usb3), but combination&lt;br /&gt;
using the unpowered USB2 hub seems to work ok.&lt;br /&gt;
&lt;br /&gt;
List of USB connections from the USB hub:&lt;br /&gt;
&lt;br /&gt;
* this is a powered USB3 hub&lt;br /&gt;
* USB-A-to-MicroUSB - to lvdb boards&lt;br /&gt;
* USB-A-to-Wiener interlock cable&lt;br /&gt;
&lt;br /&gt;
= Clock and trigger distribution =&lt;br /&gt;
&lt;br /&gt;
== Explanation ==&lt;br /&gt;
&lt;br /&gt;
Trigger is generated by the trigger board (aka TRG, aka GRIF-C),&lt;br /&gt;
from the TRG eSATA output through the eSATA splitter it is fed into&lt;br /&gt;
the master CDM. The master CDM outputs the trigger on all MiniSAS output ports.&lt;br /&gt;
One of the master CDM MiniSAS outputs is connected to the CDM slave eSATA input.&lt;br /&gt;
The same as the master CDM, the slave CDM outputs the trigger on all MiniSAS output ports.&lt;br /&gt;
&lt;br /&gt;
The master 62.5MHz clock is generated by the master CDM using the internal 10MHz oscillator&lt;br /&gt;
or the external 10MHz AD clock. Also on MiniSAS port 6 the master CDM generates&lt;br /&gt;
the 200MHz clock for the TDC. This clock is frequency-locked to the master 62.5MHz clock.&lt;br /&gt;
&lt;br /&gt;
Master CDM clock selection (external CD 10MHz clock or internal oscillator 10MHz clock)&lt;br /&gt;
is done by a magic esper command (see below).&lt;br /&gt;
&lt;br /&gt;
From the master CDM, the clock is fed to: the slave CDM, the TRG (via the eSATA splitter)&lt;br /&gt;
and to the TDC (via the RJ45 splitter).&lt;br /&gt;
&lt;br /&gt;
The slave CDM sends the clock and the trigger to the ADCs and PWBs.&lt;br /&gt;
&lt;br /&gt;
== Schematic ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TRG (GRIF-C)&lt;br /&gt;
------------&lt;br /&gt;
eSATA &amp;lt;------&amp;gt; eSATA splitter&lt;br /&gt;
&lt;br /&gt;
eSATA splitter&lt;br /&gt;
--------------&lt;br /&gt;
trigger ---&amp;gt; eSATA ---&amp;gt; CDM-Master eSATA (trigger signal)&lt;br /&gt;
clock &amp;lt;--- (eSATA --- MiniSAS) &amp;lt;--- CDM MiniSAS (62.5MHz clock)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CDM-Master&lt;br /&gt;
----------&lt;br /&gt;
eSATA &amp;lt;--- eSATA splitter &amp;lt;--- eSATA from TRG (trigger signal)&lt;br /&gt;
MiniSAS 1 --&amp;gt; (MiniSAS --- eSATA) --&amp;gt; CDM-Slave eSATA (62.5 MHz)&lt;br /&gt;
MiniSAS 6 --&amp;gt; (MiniSAS --- eSATA) --&amp;gt; eSATA splitter --&amp;gt; RJ45 --&amp;gt; TDC (200 MHz)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CDM-Slave&lt;br /&gt;
---------&lt;br /&gt;
eSATA &amp;lt;--- trigger and 62.5MHz clock from CDM-Master&lt;br /&gt;
MiniSAS 1 --&amp;gt; ADC trigger and 62.5MHz clock&lt;br /&gt;
MiniSAS 2 --&amp;gt; same&lt;br /&gt;
MiniSAS 3 --&amp;gt; same&lt;br /&gt;
MiniSAS 4 --&amp;gt; same&lt;br /&gt;
MiniSAS 5 --&amp;gt; PWB trigger and 62.5MHz clock&lt;br /&gt;
MiniSAS 6 --&amp;gt; same&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VME_Crate_CERN.jpeg|800x450px|Layout of the VME crate at CERN. The ALPHA-T module is in the rightmost slot. The Master CDM is next to it and it&#039;s labelled as #02. The Slave CDM is on the lefmost position and labelled by #03.]]&lt;br /&gt;
&lt;br /&gt;
== Setup of CDM boards ==&lt;br /&gt;
&lt;br /&gt;
ALPHA-g uses the Rev3 CDM boards. The 4 CDM boards that belong to ALPHA-g&lt;br /&gt;
have serial numbers 0, 1, 2 and 3 and are labeled cdm00, cdm01, cdm02, cdm03.&lt;br /&gt;
&lt;br /&gt;
All the boards can be used as master and slave positions, but have to be&lt;br /&gt;
configured appropriately.&lt;br /&gt;
&lt;br /&gt;
=== Slave setup ===&lt;br /&gt;
&lt;br /&gt;
* install the board&lt;br /&gt;
* connect ethernet&lt;br /&gt;
* connect esata external clock&lt;br /&gt;
* esper-tool cdmNN ### i.e. esper-tool cdm01&lt;br /&gt;
* cd template&lt;br /&gt;
* write current_setup 4&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* read&lt;br /&gt;
* observe clock frequency counters report correct values. &amp;quot;ext_clk&amp;quot; will only count if the lemo jumper is installed (see below)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11    esata_clk        uint32           R                 [62500246]                      &lt;br /&gt;
12    ext_clk          uint32           R                 [62500246]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
156   ld1_counter      uint32           RW                [3]                             &lt;br /&gt;
157   ld2_counter      uint32           RW                [3]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, check correct operation of the pll lock monitoring:&lt;br /&gt;
&lt;br /&gt;
* unplug the esata cable from the master CDM&lt;br /&gt;
* &amp;quot;red&amp;quot; light should go off&lt;br /&gt;
* read of lmk should report &amp;quot;pll1_ld&amp;quot; value 0 and &amp;quot;ld1_counter&amp;quot; and &amp;quot;ld2_counter&amp;quot; should increment&lt;br /&gt;
* reconnect the esata cable&lt;br /&gt;
* &amp;quot;red&amp;quot; light should return&lt;br /&gt;
* read of lmk should report both pll1_ld and pll2_ld locked (values &amp;quot;1&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Master setup ===&lt;br /&gt;
&lt;br /&gt;
* install the board&lt;br /&gt;
* connect ethernet&lt;br /&gt;
* esper-tool cdmNN ### i.e. esper-tool cdm01&lt;br /&gt;
* cd template&lt;br /&gt;
* write current_setup 3&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* write clkin_sel_mode 0&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* read&lt;br /&gt;
* observe clock frequency counters report correct values. &amp;quot;ext_clk&amp;quot; will only count if the &amp;quot;clock loopback&amp;quot; lemo jumper is installed (see below)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
12    ext_clk          uint32           R                 [62500189]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
156   ld1_counter      uint32           RW                [3]                             &lt;br /&gt;
157   ld2_counter      uint32           RW                [3]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the 200MHz clock:&lt;br /&gt;
* connect MiniSAS-eSATA splitter cable to MiniSAS output 6, connect eSATA end to CDM eSATA input&lt;br /&gt;
* in esper-tool, read cdm: esata_clk should report 200MHz clock&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11    esata_clk        uint32           R                 [200000603]                     &lt;br /&gt;
12    ext_clk          uint32           R                 [62500188]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Master setup with external 10 MHz clock ===&lt;br /&gt;
&lt;br /&gt;
* setup master CDM as above (using internal clock)&lt;br /&gt;
* connect 10MHz external clock to right LEMO #1&lt;br /&gt;
* esper-tool cdmNN&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* write sel_nim 1 # if clock is NIM signal&lt;br /&gt;
* write sel_nim 0 # if clock is TTL signal (i.e. chronobox LEMO output)&lt;br /&gt;
* read ext_clk&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[http://cdm00:/cdm]&amp;gt; read ext_clk&lt;br /&gt;
9999556&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if ext_clk reads 0 or does not read something close to 10MHz, stop here. debug the signal, try changing sel_nim, etc.&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* write clkin_sel_mode 2 # select external clock&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
150   clkin2_sel       bool             R                 [True]                          &lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* on the MIDAS TRG page, observe that TRG measured external clock frequency is close to 62.5 MHz&lt;br /&gt;
&lt;br /&gt;
== clkin_sel_mode positions ==&lt;br /&gt;
&lt;br /&gt;
* 0 = 10MHz internal oscillator (use on master CDM in standalone mode)&lt;br /&gt;
* 1 = eSATA clock (use on slave CDM)&lt;br /&gt;
* 2 = external clock, should be 10MHz (use on master CDM to run from AD clock)&lt;br /&gt;
&lt;br /&gt;
== LEMO connections ==&lt;br /&gt;
&lt;br /&gt;
* clock loopback jumper: to read the frequency of the generated 62.5MHz clock, connect LEMO cable from left LEMO #2 to the right LEMO #1&lt;br /&gt;
* 10MHz internal clock jumper: to feed 10MHz internal oscillator to the external clock, connect LEMO cable from right  LEMO #3 to the right LEMO #1.&lt;br /&gt;
* 10MHz external clock: to feed 10MHz external clock, connect LEMO cable to right LEMO #1&lt;br /&gt;
&lt;br /&gt;
= MIDAS frontends =&lt;br /&gt;
&lt;br /&gt;
== UDP ==&lt;br /&gt;
&lt;br /&gt;
feudp receives udp packets from the ADC and PWB boards. For each udp packet 1 midas event is created,&lt;br /&gt;
with 1 data bank containing the udp data. Events are sent into the MIDAS event buffer BUFUDP. The names&lt;br /&gt;
of the data banks are assigned in ODB /eq/feudp/settings.&lt;br /&gt;
&lt;br /&gt;
{ADC,PWB} --&amp;gt; 1gige --&amp;gt; switch --&amp;gt; 10gige --&amp;gt; alphagdaq --&amp;gt; feudp -&amp;gt; BUFUDP&lt;br /&gt;
&lt;br /&gt;
== CTRL ==&lt;br /&gt;
&lt;br /&gt;
fectrl controls all the ADC, PWB and trigger boards. It provides run start and stop sequencing,&lt;br /&gt;
runs the event synchronization sequence at the begin of the run, and records slow controls data (temperatures,&lt;br /&gt;
voltages, etc).&lt;br /&gt;
&lt;br /&gt;
fectrl receives UDP data packets from the trigger board and sends them to the MIDAS event buffer BUFUDP.&lt;br /&gt;
&lt;br /&gt;
fectrl receives commands from the control web pages (for ADC, PWB and trigger) to reboot, initialize, etc the boards.&lt;br /&gt;
&lt;br /&gt;
fectrl configures the event builder via odb /eq/fectrl/evbconfig.&lt;br /&gt;
&lt;br /&gt;
ADC &amp;lt;-&amp;gt; http esper &amp;lt;-&amp;gt; fectrl -&amp;gt; slow control data into midas history&lt;br /&gt;
&lt;br /&gt;
PWB &amp;lt;-&amp;gt; http esper &amp;lt;-&amp;gt; fectrl -&amp;gt; slow control data into midas history&lt;br /&gt;
&lt;br /&gt;
TRG &amp;lt;-&amp;gt; udp comm &amp;lt;-&amp;gt; fectrl -&amp;gt; BUFUDP, slow control and counters into midas history&lt;br /&gt;
&lt;br /&gt;
fectrl &amp;lt;-&amp;gt; midas rpc &amp;lt;-&amp;gt; mhttpd &amp;lt;-&amp;gt; json rpc &amp;lt;-&amp;gt; control web pages for ADC, PWB and trigger&lt;br /&gt;
&lt;br /&gt;
== EVB ==&lt;br /&gt;
&lt;br /&gt;
feevb receives udp packet data from the MIDAS event buffer BUFUDP, inspects the packet timestamps&lt;br /&gt;
and collects the data with matching timestamps into physics events. feevb has provisions to do&lt;br /&gt;
data suppression, reduction and compression in addition to the data reduction done&lt;br /&gt;
in the ADC and PWB firmware.&lt;br /&gt;
&lt;br /&gt;
feevb event synchronization relies on the event synchronization sequence done by fectrl when a run is started.&lt;br /&gt;
&lt;br /&gt;
{ADC, PWB, TRG} -&amp;gt; BUFUDP -&amp;gt; feevb -&amp;gt; SYSTEM -&amp;gt; mlogger -&amp;gt; compression -&amp;gt; disk storage&lt;br /&gt;
&lt;br /&gt;
=== internal structure ===&lt;br /&gt;
&lt;br /&gt;
* event buffer readers, instances for BUFTRG, BUFTDC, BUFADC, BUFUDP&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BufferReader class - reads one midas event buffer:&lt;br /&gt;
- BufferReaderThread()&lt;br /&gt;
-- in batches of 1000 events&lt;br /&gt;
--- lock&lt;br /&gt;
--- TickLocked()&lt;br /&gt;
----- ReadEvent() -&amp;gt; bm_receive_event_alloc()&lt;br /&gt;
----- fHandler-&amp;gt;HandleEvent()&lt;br /&gt;
-- fHandler-&amp;gt;XMaybeFlushBank()&lt;br /&gt;
-- sleep 100 usec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* event header decoder and intermediate buffer&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Handler class - accumulates events, sends them to the EVB in batches&lt;br /&gt;
&lt;br /&gt;
- HandleEvent() &amp;lt;- BufferReaderThread() - receive incoming events&lt;br /&gt;
-- loop over all banks, examine bank name&lt;br /&gt;
--- call AddAdcBank(), AddPwbBank(), AddTrgBank(), AddTdcBank() according to bank name&lt;br /&gt;
----  AddXxxBank() -&amp;gt; XAddBank()&lt;br /&gt;
--- unknown banks go directly to evb-&amp;gt;SendQueue&lt;br /&gt;
-- check if synchronization has completed&lt;br /&gt;
&lt;br /&gt;
- XAddBank() - save BankBuf objects in a buffer&lt;br /&gt;
&lt;br /&gt;
- XMaybeFlushBank(), XFlushBank() - send all accumulated data to the Evb class&lt;br /&gt;
-- evb-&amp;gt;lock()&lt;br /&gt;
-- for each buffered BankBuf objects,&lt;br /&gt;
--- call evb-&amp;gt;AddBankLocked()&lt;br /&gt;
-- buffer is now empty&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* event builder&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Evb class - assemble event fragments according to timestamps&lt;br /&gt;
&lt;br /&gt;
- fEvents fifo (deque) - time sorted list of partially assembled events&lt;br /&gt;
-- new entries are added by FindEvent()&lt;br /&gt;
-- entries are modified by MergeSlot()&lt;br /&gt;
-- old entries are removed by GetLocked()&lt;br /&gt;
&lt;br /&gt;
- AddBankLocked() &amp;lt;- XFlushBank() &amp;lt;- BufferReaderThread()&lt;br /&gt;
-- call fSync-&amp;gt;Add()&lt;br /&gt;
-- transform BankBuf to EvbEventBuf&lt;br /&gt;
-- push it into per-module buffer fBuf[imodule]&lt;br /&gt;
&lt;br /&gt;
- EvbThread()&lt;br /&gt;
-- EvbTickLocked()&lt;br /&gt;
--- BuildLocked()&lt;br /&gt;
---- in a loop, for no more than 1 sec&lt;br /&gt;
----- loop over all per-module buffers fBuf&lt;br /&gt;
------ pop first entry, pass it to BuildSlot()&lt;br /&gt;
------- call FindEvent()&lt;br /&gt;
------- call MergeSlot()&lt;br /&gt;
------- call CheckEvent()&lt;br /&gt;
--- in a loop&lt;br /&gt;
---- get all completed events via GetLocked() pass them to SendQueue-&amp;gt;PushEvent()&lt;br /&gt;
-- if done nothing, sleep 100 usec, otherwise nominal sleep to free the evb lock&lt;br /&gt;
&lt;br /&gt;
- GetNext() &amp;lt;- GetLocked() &amp;lt;- EvbThread() - get completed events&lt;br /&gt;
-- examine oldest EvbEvent entry in fEvents:&lt;br /&gt;
-- pop it if it is complete&lt;br /&gt;
-- pop it if it is too old (to prevent old incomplete events from stalling the evb) (&amp;quot;pop age&amp;quot; on the evb page)&lt;br /&gt;
-- pop it if a following event is complete (&amp;quot;pop following&amp;quot; on the evb page)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* send queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SendQueue class - prepare events for writing to midas SYSTEM event buffer&lt;br /&gt;
&lt;br /&gt;
- PushEvent() &amp;lt;- EvbThread()&lt;br /&gt;
-- push FragmentBuf into the queue&lt;br /&gt;
&lt;br /&gt;
- SendQueueThread()&lt;br /&gt;
-- in a batch of 1000 events, call Tick()&lt;br /&gt;
--- pop FragmentBuf from the queue, call SendEvent()&lt;br /&gt;
--- compose midas event (memcpy()!)&lt;br /&gt;
--- TMFE fEq-&amp;gt;SendEvent()&lt;br /&gt;
--- bm_send_event()&lt;br /&gt;
-- sleep 100 usec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* equipment object&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EvbEq class - implements the midas equipment&lt;br /&gt;
- HandleBeginRun()&lt;br /&gt;
- HandleEndRun()&lt;br /&gt;
- HandlePeriodic()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== multithreading ===&lt;br /&gt;
&lt;br /&gt;
* BufferReaderThread() one per midas event buffer&lt;br /&gt;
** high CPU use: bm_receive_event(), AddXxxBank()&lt;br /&gt;
** lock contention: midas event buffer lock, evb lock into XFlushBank-&amp;gt;AddBankLocked()&lt;br /&gt;
* EvbThread()&lt;br /&gt;
** O(size of fEvents): FindEvent(), GetNext()&lt;br /&gt;
** lock contention: evb lock against XFlushBank(), SendQueue lock (1 per output event)&lt;br /&gt;
* SendQueueThread()&lt;br /&gt;
** high CPU use: memcpy() in SendEvent(), memcpy() in bm_send_event&lt;br /&gt;
** lock contention: event queue lock against EvbThread, midas event buffer lock&lt;br /&gt;
* main thread&lt;br /&gt;
** lock contention: evb lock in ReportEvb() and elsewhere&lt;br /&gt;
&lt;br /&gt;
= ODB entries =&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings ==&lt;br /&gt;
* TBW&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TrigSrc - trigger source selection ==&lt;br /&gt;
* TrigPulser                      - trigger on the pulser&lt;br /&gt;
* TrigEsataNimGrandOr             - trigger on external NIM inputs of GRIF-16 ADC modules&lt;br /&gt;
* TrigAdc16GrandOr                - trigger on any adc16 signals (see adc16_masks)&lt;br /&gt;
* TrigAdc32GrandOr                - trigger on any adc32 signals (see adc32_masks)&lt;br /&gt;
* Trig1ormore                     - trigger on adc16 multiplicity 1 or more&lt;br /&gt;
* Trig2ormore                     - ditto, 2 or more&lt;br /&gt;
* Trig3ormore                     - ditto, 3 or more&lt;br /&gt;
* Trig4ormore                     - ditto, 4 or more&lt;br /&gt;
* TrigAdcGrandOr                  - trigger on any ADC signal&lt;br /&gt;
* TrigAwCoincA                    - trigger on TPC AW coincidence (see [[TRG]] manual)&lt;br /&gt;
* TrigAwCoincB                    - ditto&lt;br /&gt;
* TrigAwCoincC                    - ditto&lt;br /&gt;
* TrigAwCoincD                    - ditto&lt;br /&gt;
* TrigAwCoinc                     - ditto&lt;br /&gt;
* TrigAw1ormore	- trigger on TPC AW per-preamp multiplicity 1 or more (see [[TRG]] manual)&lt;br /&gt;
* TrigAw2ormore	- ditto, 2 or more&lt;br /&gt;
* TrigAw3ormore	- ditto, 3 or more&lt;br /&gt;
* TrigAw4ormore - ditto, 4 or more&lt;br /&gt;
* TrigAwMLU                       - trigger on TPC AW MLU signal (see [[TRG]] manual)&lt;br /&gt;
* TrigBscGrandOr                  - trigger on any BSC signal&lt;br /&gt;
* TrigBscMult                     - trigger on predefined BSC multiplicity (see [[TRG]] manual)&lt;br /&gt;
* TrigCoinc                       - trigger on predefined coincidence of TPC AW, BSC and external signal (see [[TRG]] manual)&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TRG - trigger settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will not do anything with the trigger board. Normal value &amp;quot;y&amp;quot;&lt;br /&gt;
* Modules - hostnames of the trigger board. Normal value &amp;quot;alphat01&amp;quot;&lt;br /&gt;
* NimMask - 32-bit mask for the 32x NIM inputs (see TRG manual). Normal value 0, unless external trigger is in use.&lt;br /&gt;
* EsataMask - 32-bit mask for the 32x eSATA signals (see TRG manual). Normal value 0.&lt;br /&gt;
* adc16_mask[16] - 16x 16-bit mask for the 100MHz GRIF-16 onboard ADCs (see TRG manual). Normal value 0xFFFF for all 16 data links.&lt;br /&gt;
* adc32_mask[16] - 16x 32-bit mask for the 62.5MHz FMC-ADC32 ADCs (see TRG manual). Normal value 0xFFFFFFFF for all 16 data links.&lt;br /&gt;
* PassThrough - if set to &amp;quot;y&amp;quot;, trigger is passed through the trigger module without generating any events and without causing deadtime.&lt;br /&gt;
* AwCoincA, B, C and D - 32-bit masks for the aw16 coincidence trigger (see TRG manual)&lt;br /&gt;
* Aw16FromAdc16 - route AW trigger (aw16) from adc16 (100MHz ADCs 0..15)&lt;br /&gt;
* Aw16FromAdc32a - route AW trigger (aw16) from adc32 group 15..0 (62.5MHz FMC-ADC32 in ADCs 0..7)&lt;br /&gt;
* Aw16FromAdc32b - route AW trigger (aw16) from adc32 group 31..16 (62.5MHz FMC-ADC32 in ADCs 8..15)&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/PWB - PWB settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will not do anything with PWBs. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_boot_user_page - if set to &amp;quot;n&amp;quot;, fectrl will not try to reboot PWBs into the user page firmware. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_trigger - if set to &amp;quot;n&amp;quot;, all PWBs will be set to ignore the trigger. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_trigger_group_a - field wire pulser defeats the data suppression (every channel has a pulse) resulting in too much data overwhelming the DAQ (lost UDP packets). To permit correct data taking of field wire pulser data, PWBs are split into two groups (a and b), only one of the two groups should be enabled for field wire pulser runs. Both groups should be enabled for normal data taking. Normal value is &amp;quot;y&amp;quot;&lt;br /&gt;
* enable_trigger_group_b - see &amp;quot;enable_trigger_group_a&amp;quot;. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* modules[64] - hostnames of PWB boards&lt;br /&gt;
* boot_user_page[64] - if set to &amp;quot;y&amp;quot; and enable_boot_user_page is &amp;quot;y&amp;quot;, fectrl will reboot the corresponding PWB to the user page firmware.&lt;br /&gt;
* trigger[64] - if set to &amp;quot;y&amp;quot; and enable_trigget is &amp;quot;y&amp;quot;, fectrl will set the PWB to accept the trigger.&lt;br /&gt;
* ch_enable - if set to &amp;quot;n&amp;quot; disables all PWB channels. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* ch_force - is set to &amp;quot;y&amp;quot; disables channel suppression (all PWB channels are read)&lt;br /&gt;
* suppress_reset - if set to &amp;quot;y&amp;quot; enables channel suppression for reset channels (threshold has to be set correctly)&lt;br /&gt;
* suppress_fpn - if set to &amp;quot;y&amp;quot; enables channel suppression for fpn channels (threshold has to be set correctly)&lt;br /&gt;
* suppress_pads -  set to &amp;quot;y&amp;quot; enables channel suppression for TPC pad channels (threshold has to be set correctly)&lt;br /&gt;
* disable_reset1 - data suppression algorithm does not work for the channel &amp;quot;reset1&amp;quot; and it has to be suppressed explicitly by setting this value to &amp;quot;y&amp;quot;. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* baseline_{reset,fpn,pads}[64] - waveform baseline for each PWB position&lt;br /&gt;
* threshold_{reset,fpn,pads} - waveform suppression threshold, see below:&lt;br /&gt;
* ch_threshold - PWB sca_N_ch_threshold, if set to 0, threshold is computed as &amp;quot;baseline_pads[seqpwb]-threshold_pads&amp;quot;. Normal value is 0.&lt;br /&gt;
* test_mode - enable PWB test mode, the ADC data is replaced with a test pattern, see PWB esper variable signalproc/test_mode&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TDC - TDC settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will tell the event builder that the TDC is not running. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/EvbConfig - EVB configuration ==&lt;br /&gt;
All arrays have the same size corresponding to the number of EVB slots.&lt;br /&gt;
* name[] - slot name for the web page (trg01, adc01, adc01/adc32, pwb31/0, tdc01, etc)&lt;br /&gt;
* type[] - slot type: 1=TRG, 2=ADC16 and ADC32, 3=obsolete PWB, 4=obsolete PWB, 5=PWB, 6=TDC&lt;br /&gt;
* module[] - module number (adcNN, adcNN+100, pwbNN, etc)&lt;br /&gt;
* nbanks[] - number of expected banks (16 for ADC16, 32 for ADC32, not used, set to 1 for all others)&lt;br /&gt;
* tsfreq[] - timestamp frequency in Hz.&lt;br /&gt;
&lt;br /&gt;
= Trigger configuration =&lt;br /&gt;
&lt;br /&gt;
These trigger modes are implemented:&lt;br /&gt;
* (manual trigger from web page)&lt;br /&gt;
* software pulser trigger (from fectrl)&lt;br /&gt;
* hardware pulser trigger (from the trigger board)&lt;br /&gt;
* NIM and eSATA trigger from ADC front panel inputs&lt;br /&gt;
* adc16 and adc32 discriminator triggers:&lt;br /&gt;
** adc16 grand-or trigger&lt;br /&gt;
** adc32 grand-or trigger&lt;br /&gt;
** adc (adc16+adc32) grand-or trigger&lt;br /&gt;
** adc16 multiplicity trigger (1ormore, 2ormore, 3ormore, 4ormore) for use with barrel scintillator&lt;br /&gt;
** anode wire multiplicity trigger (1ormore, 2ormore, 3ormore, 4ormore) (anode wire signals can be fed from adc16 or from adc32 signals)&lt;br /&gt;
** anode wire coincidence trigger&lt;br /&gt;
** anode wire MLU (memory lookup) trigger&lt;br /&gt;
&lt;br /&gt;
== NIM trigger from ADC front panel ==&lt;br /&gt;
&lt;br /&gt;
Trigger path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NIM signal --&amp;gt; LEMO input on ADC front panel --&amp;gt; data encoder --&amp;gt; data link to trigger board --&amp;gt; data decoder --&amp;gt; mask --&amp;gt; nim-esata-grand-or --&amp;gt; trigger&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable NIM trigger, do this:&lt;br /&gt;
* connect NIM signal to ADC front panel input&lt;br /&gt;
** Note1: NIM signal must be inverted&lt;br /&gt;
** Note2: LEMO connectors should be set to &amp;quot;NIM input&amp;quot; mode by ADC on-board jumpers (see ADC manual)&lt;br /&gt;
* observe correct bit goes to zero in the TRG web page: data link high work should change:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0xNF00&#039;0000 (N is the module id) to&lt;br /&gt;
0xN700&#039;0000 (left lemo) or&lt;br /&gt;
0xNB00&#039;0000 (right lemo)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Note3: if data link bits do not change, most likely the LEMO connectors are set to &amp;quot;DAC output&amp;quot; mode. Try to use LEMO inputs of a different ADC.&lt;br /&gt;
* compute the NIM mask: there are 32 bits, 2 bits per ADC data link. Bit 0x1 is right LEMO, bit 0x2 is left LEMO&lt;br /&gt;
* for example, to use left LEMO of ADC data link 12, set nim mask to (0x2)&amp;lt;&amp;lt;(2*12) = 0x02000000&lt;br /&gt;
* development branch of the git repository contains &#039;&#039;scripts/nim_mask.py&#039;&#039;, which can compute forwards and backwards&lt;br /&gt;
* initialize the trigger board (on the TRG web page press button &amp;quot;initialize&amp;quot;), or start a new run&lt;br /&gt;
* on the history plot with &amp;quot;NIM grand or&amp;quot; counter, the rate should change from zero&lt;br /&gt;
* if a run is active, if one of the ADC LEMO outputs is set to output the trigger signal as a NIM pulse, one should see it fire use a scope. The delay or jitter between NIM trigger in and NIM trigger out should be around 100-200 ns (FIXME - measure this!)&lt;br /&gt;
* to set the DAQ to trigger on the NIM signal, on the run start page, check the box &amp;quot;TrigEsataNimGrandOr&amp;quot;.&lt;br /&gt;
** Note: remember to set the scaledown to 0 if so desired.&lt;br /&gt;
&lt;br /&gt;
= TPC field wire pulser =&lt;br /&gt;
&lt;br /&gt;
The TPC field wire pulser input should be connected directly to the DAC output of adc01 (right lemo connector).&lt;br /&gt;
&lt;br /&gt;
DAC settings in ODB /Equipment/CTRL/Settings/ADC/DAC/&lt;br /&gt;
&lt;br /&gt;
* for pulsing PWBs (maximum possible pulse height in PWBs. Overdrives the AW ADC waveforms)&lt;br /&gt;
** dac_baseline: -8000&lt;br /&gt;
** dac_amplitude: 8000&lt;br /&gt;
** ramp_up_rate: 128&lt;br /&gt;
** ramp_down_rate: 70&lt;br /&gt;
** ramp_top_len: 128&lt;br /&gt;
&lt;br /&gt;
* for pulsing AW: (AW ADC waveforms are in range. PWB waveforms are too small for goor time resolution)&lt;br /&gt;
** dac_baseline: -2000&lt;br /&gt;
** dac_amplitude: 4000&lt;br /&gt;
** ramp_up_rate: 20&lt;br /&gt;
** ramp_down_rate: 20&lt;br /&gt;
** ramp_top_len: 128&lt;br /&gt;
&lt;br /&gt;
= TDC connections =&lt;br /&gt;
&lt;br /&gt;
* SFP8 - fiber SFP to Juniper switch&lt;br /&gt;
* right RJ45 - 200MHz clock&lt;br /&gt;
* left RJ45 - external trigger&lt;br /&gt;
&lt;br /&gt;
= MIDAS Data banks =&lt;br /&gt;
&lt;br /&gt;
* ATAT - fectrl - UDP packets from GRIF-C/TRG trigger board&lt;br /&gt;
* TRBA - fetdc - TDC data&lt;br /&gt;
* TRTM - fetdc - TDC FPGA temperatures, TID_FLOAT[5].&lt;br /&gt;
* AAnn - feudp - UDP packets from GRIF-16 ADC (before the event builder), &amp;quot;nn&amp;quot; is the ADC module number: adc01 is AA01 through adc20 is AA20.&lt;br /&gt;
* BBxx - feudp - UDP packets from PWB, obsolete&lt;br /&gt;
* Bnnm, Cnnm - feevb - EVB output banks: ADC data, &amp;quot;nn&amp;quot; is the ADC module number (1..20), &amp;quot;m&amp;quot; is the channel number (0..9,A..F), format is same as AAnn banks.&lt;br /&gt;
* PAnn - feudp - UDP packets from PWB, &amp;quot;nn&amp;quot; is the PWB module number (00..99), obsolete&lt;br /&gt;
* PBnn - feudp - UDP packets from PWB, &amp;quot;nn&amp;quot; is the PWB module number (00..99), PB01 is pwb01, PB78 is pwb78&lt;br /&gt;
* PCnn - feevb - EVB output banks: PWB data, &amp;quot;nn&amp;quot; is the PWB module number (00..99), same as above, format is same as PBnn banks&lt;br /&gt;
&lt;br /&gt;
= ZZZ =&lt;br /&gt;
&lt;br /&gt;
ZZZ&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Daq&amp;diff=648</id>
		<title>Daq</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Daq&amp;diff=648"/>
		<updated>2021-02-09T23:18:55Z</updated>

		<summary type="html">&lt;p&gt;Acapra: /* Schematic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Links =&lt;br /&gt;
&lt;br /&gt;
* https://alphacpc05.cern.ch/agdaq/ -- midas daq page for the agdaq system at CERN&lt;br /&gt;
* https://daq16.triumf.ca -- midas daq page for the agmini system at TRIUMF&lt;br /&gt;
* https://daq.triumf.ca/elog-alphag/alphag/ -- elog&lt;br /&gt;
* https://daqstore.triumf.ca/AgWiki/index.php/Main_Page -- this wiki&lt;br /&gt;
* https://bitbucket.org/ttriumfdaq/agdaq - git repository for agdaq&lt;br /&gt;
* https://bitbucket.org/expalpha  -- git repository on bitbucket&lt;br /&gt;
* https://edev-group.triumf.ca/fw/exp/alphag -- git repository on edev gitlab&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/170 - PWB inventory database&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/168 - ADC (GRIF-16) inventory, FMC-ADC32rev0,rev1 inventory&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/176 - FMC-ADC32rev1.1 inventory&lt;br /&gt;
&lt;br /&gt;
= Hardware manuals =&lt;br /&gt;
&lt;br /&gt;
* [[TRG]] - trigger board (GRIF-C) manual&lt;br /&gt;
* CDM - https://daq.triumf.ca/DaqWiki/index.php/VME-CDM -- clock VME-CDM manual&lt;br /&gt;
* ADC - https://daq.triumf.ca/DaqWiki/index.php/VME-GRIF-ADC16-Rev1 -- GRIF-16 ADC manual&lt;br /&gt;
* [[PWB]] - TPC Pad Wing Board manual&lt;br /&gt;
* TDC - https://www.triumf.info/wiki/DAQwiki/index.php/GSI_TRB3&lt;br /&gt;
* [[chronobox]] - chronobox manual&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
Full system: (ADC fw rel-20201112-ko, PWB fw 20201005_ko)&lt;br /&gt;
* 1 Hz stable, ADC adc32 9 supp off rate 0.3 M/s, adc16 off, PWB udp_delay 25 supp off active 64 rate 6.6+4+6+4.6=21.2 M/s, TDC off, total rate 21 M/s&lt;br /&gt;
* 500 Hz stable, ADC adc32 9 supp 1500 rate 6 M/s, adc16 off, PWB udp_delay 10 supp 100 active 63 rate 3+4+3+3=13 M/s, TDC off, total rate 19 M/s&lt;br /&gt;
&lt;br /&gt;
Single ADC: (fw rel-20201112-ko)&lt;br /&gt;
&lt;br /&gt;
Fully suppressed data, sthreshold 5000&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 500 Hz: stable (nominal max trigger rate)&lt;br /&gt;
* 6700 Hz: stable, 8 Mbytes/sec&lt;br /&gt;
* 6800 Hz: evb eventually confused&lt;br /&gt;
* 6850 Hz: evb confused, no lost triggers in the ADC, no crash in the ADC&lt;br /&gt;
&lt;br /&gt;
All data, 510 samples/event, sthreshold 10 (fw rel-20201122-ko)&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 100 Hz: stable, 3.4 Mbytes/sec&lt;br /&gt;
* 500 Hz: stable, 17 Mbytes/sec (nominal max trigger rate)&lt;br /&gt;
* 1000 Hz: stable, 32 Mbytes/sec&lt;br /&gt;
* 3100 Hz: stable, 106 M/s (approaching saturation of 1gige ethernet)&lt;br /&gt;
* 3200 Hz: stable, 110 M/s - TRG communication is in trouble&lt;br /&gt;
* 3300 Hz: stable, 116 M/s&lt;br /&gt;
* 3400 Hz: incomplete events, no ADC crash (&amp;quot;dropped due to full&amp;quot; counting, &amp;quot;dropped due to busy&amp;quot; are zero, this is as expected).&lt;br /&gt;
&lt;br /&gt;
no suppression (different fpga data path)&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 100 Hz: stable&lt;br /&gt;
* 500 Hz: stable, 17 M/s (nominal max trigger rate)&lt;br /&gt;
* 1000 Hz: stable, 32 M/s&lt;br /&gt;
* 3000 Hz: stable, 100 M/s (approaching saturation of 1gige ethernet)&lt;br /&gt;
* 3300 Hz: incomplete events, no ADC crash (&amp;quot;dropped due to full&amp;quot; counting, &amp;quot;dropped due to busy&amp;quot; are zero, this is as expected).&lt;br /&gt;
&lt;br /&gt;
= Network connections =&lt;br /&gt;
&lt;br /&gt;
The experiment private network number is: 192.168.1.x, gateway 192.168.1.1, netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
network map:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- TRIUMF/CERN network --1gige-- alphagdaq --10gige-- juniper switch --1gige-- centrecom switch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== alphagdaq network connections ==&lt;br /&gt;
&lt;br /&gt;
on the rear of the machine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
|   | rj45 | rj45 |         | sfp | sfp |&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
- left rj45 - copper 1gige - eno1 - spare (inactive)&lt;br /&gt;
- right rj45 - copper 1gige - eno2 - dhcp - cern/triumf network&lt;br /&gt;
- left sfp - 10gige - enp1s0f1 - spare (inactive)&lt;br /&gt;
- right sfp - 10gige - enp1s0f0 - static 192.168.1.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== connections between switches ==&lt;br /&gt;
&lt;br /&gt;
* alphagdaq to juniper switch: direct attach (DAC) 10gige cable into any port of juniper switch&lt;br /&gt;
* juniper switch to centrecom switch: rj45 sfp in any port of juniper switch - cat5e/cat6 cable - to any port of centrecom switch&lt;br /&gt;
* cat5e/cat6 cable from any port of centrecom switch to the XXX port on the back of the juniper switch&lt;br /&gt;
&lt;br /&gt;
== juniper switch ==&lt;br /&gt;
&lt;br /&gt;
connected to juniper switch front is:&lt;br /&gt;
&lt;br /&gt;
* everything that sends event data to alphagdaq, specifically:&lt;br /&gt;
** TRG (rj45 sfp)&lt;br /&gt;
** 16x ADC (fiber sfp)&lt;br /&gt;
** 64x PWB (fiber sfp)&lt;br /&gt;
* 10gige uplink to alphagdaq (10gige DAC cable)&lt;br /&gt;
* 1gige link to centrecom switch (rj45 sfp)&lt;br /&gt;
* 40gige ports are not used&lt;br /&gt;
&lt;br /&gt;
connected to the juniper switch rear:&lt;br /&gt;
&lt;br /&gt;
* CON is the serial console via RJ45-to-DB9 to USB-serial adapter to alphagdaq USB port (9600bps, 8N1, no flow control)&lt;br /&gt;
* C0 is the management ethernet interface port, connect to any port on the centrecom switch (juniper-private will ping)&lt;br /&gt;
&lt;br /&gt;
== centrecom switch ==&lt;br /&gt;
&lt;br /&gt;
* everything with copper rj45 connections, specifically:&lt;br /&gt;
** CDM boards&lt;br /&gt;
** HV, LV and VME power supplies&lt;br /&gt;
** RaspberryPi3 boards&lt;br /&gt;
** gas handling MFCs (algas)&lt;br /&gt;
** cooling system controller (moxa01)&lt;br /&gt;
&lt;br /&gt;
= USB connections =&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* alphagdaq has USB2 and USB3 connections. They are not the same, they are not generally interchangeable.&lt;br /&gt;
* USB3 connections and cables are generally blue coloured.&lt;br /&gt;
&lt;br /&gt;
List of USB connections from alphagdaq:&lt;br /&gt;
&lt;br /&gt;
* front USB3 port (blue): USB-A-to-B cable to USB blaster connected to the trigger board (front of rack)&lt;br /&gt;
* rear USB3 port (blue): USB3 short jumper to USB3 hub&lt;br /&gt;
* rear USB2 port (black): USB2 unpowered hub (Logiix) to USB-A-to-B cable to UPS USB connector&lt;br /&gt;
* rear USB2 port (black): USB-to-Serial adaper to DB9 to RJ45 adapter to Juniper switch console port&lt;br /&gt;
&lt;br /&gt;
Note: UPS USB connection does not work with alphagdaq USB ports (both usb2 and usb3), but combination&lt;br /&gt;
using the unpowered USB2 hub seems to work ok.&lt;br /&gt;
&lt;br /&gt;
List of USB connections from the USB hub:&lt;br /&gt;
&lt;br /&gt;
* this is a powered USB3 hub&lt;br /&gt;
* USB-A-to-MicroUSB - to lvdb boards&lt;br /&gt;
* USB-A-to-Wiener interlock cable&lt;br /&gt;
&lt;br /&gt;
= Clock and trigger distribution =&lt;br /&gt;
&lt;br /&gt;
== Explanation ==&lt;br /&gt;
&lt;br /&gt;
Trigger is generated by the trigger board (aka TRG, aka GRIF-C),&lt;br /&gt;
from the TRG eSATA output through the eSATA splitter it is fed into&lt;br /&gt;
the master CDM. The master CDM outputs the trigger on all MiniSAS output ports.&lt;br /&gt;
One of the master CDM MiniSAS outputs is connected to the CDM slave eSATA input.&lt;br /&gt;
The same as the master CDM, the slave CDM outputs the trigger on all MiniSAS output ports.&lt;br /&gt;
&lt;br /&gt;
The master 62.5MHz clock is generated by the master CDM using the internal 10MHz oscillator&lt;br /&gt;
or the external 10MHz AD clock. Also on MiniSAS port 6 the master CDM generates&lt;br /&gt;
the 200MHz clock for the TDC. This clock is frequency-locked to the master 62.5MHz clock.&lt;br /&gt;
&lt;br /&gt;
Master CDM clock selection (external CD 10MHz clock or internal oscillator 10MHz clock)&lt;br /&gt;
is done by a magic esper command (see below).&lt;br /&gt;
&lt;br /&gt;
From the master CDM, the clock is fed to: the slave CDM, the TRG (via the eSATA splitter)&lt;br /&gt;
and to the TDC (via the RJ45 splitter).&lt;br /&gt;
&lt;br /&gt;
The slave CDM sends the clock and the trigger to the ADCs and PWBs.&lt;br /&gt;
&lt;br /&gt;
== Schematic ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TRG (GRIF-C)&lt;br /&gt;
------------&lt;br /&gt;
eSATA &amp;lt;------&amp;gt; eSATA splitter&lt;br /&gt;
&lt;br /&gt;
eSATA splitter&lt;br /&gt;
--------------&lt;br /&gt;
trigger ---&amp;gt; eSATA ---&amp;gt; CDM-Master eSATA (trigger signal)&lt;br /&gt;
clock &amp;lt;--- (eSATA --- MiniSAS) &amp;lt;--- CDM MiniSAS (62.5MHz clock)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CDM-Master&lt;br /&gt;
----------&lt;br /&gt;
eSATA &amp;lt;--- eSATA splitter &amp;lt;--- eSATA from TRG (trigger signal)&lt;br /&gt;
MiniSAS 1 --&amp;gt; (MiniSAS --- eSATA) --&amp;gt; CDM-Slave eSATA (62.5 MHz)&lt;br /&gt;
MiniSAS 6 --&amp;gt; (MiniSAS --- eSATA) --&amp;gt; eSATA splitter --&amp;gt; RJ45 --&amp;gt; TDC (200 MHz)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CDM-Slave&lt;br /&gt;
---------&lt;br /&gt;
eSATA &amp;lt;--- trigger and 62.5MHz clock from CDM-Master&lt;br /&gt;
MiniSAS 1 --&amp;gt; ADC trigger and 62.5MHz clock&lt;br /&gt;
MiniSAS 2 --&amp;gt; same&lt;br /&gt;
MiniSAS 3 --&amp;gt; same&lt;br /&gt;
MiniSAS 4 --&amp;gt; same&lt;br /&gt;
MiniSAS 5 --&amp;gt; PWB trigger and 62.5MHz clock&lt;br /&gt;
MiniSAS 6 --&amp;gt; same&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VME_Crate_CERN.jpeg|frameless|left|Layout of the VME crate at CERN. The ALPHA-T module is in the rightmost slot. The Master CDM is next to it and it&#039;s labelled as #02. The Slave CDM is on the lefmost position and labelled by #03]]&lt;br /&gt;
&lt;br /&gt;
== Setup of CDM boards ==&lt;br /&gt;
&lt;br /&gt;
ALPHA-g uses the Rev3 CDM boards. The 4 CDM boards that belong to ALPHA-g&lt;br /&gt;
have serial numbers 0, 1, 2 and 3 and are labeled cdm00, cdm01, cdm02, cdm03.&lt;br /&gt;
&lt;br /&gt;
All the boards can be used as master and slave positions, but have to be&lt;br /&gt;
configured appropriately.&lt;br /&gt;
&lt;br /&gt;
=== Slave setup ===&lt;br /&gt;
&lt;br /&gt;
* install the board&lt;br /&gt;
* connect ethernet&lt;br /&gt;
* connect esata external clock&lt;br /&gt;
* esper-tool cdmNN ### i.e. esper-tool cdm01&lt;br /&gt;
* cd template&lt;br /&gt;
* write current_setup 4&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* read&lt;br /&gt;
* observe clock frequency counters report correct values. &amp;quot;ext_clk&amp;quot; will only count if the lemo jumper is installed (see below)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11    esata_clk        uint32           R                 [62500246]                      &lt;br /&gt;
12    ext_clk          uint32           R                 [62500246]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
156   ld1_counter      uint32           RW                [3]                             &lt;br /&gt;
157   ld2_counter      uint32           RW                [3]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, check correct operation of the pll lock monitoring:&lt;br /&gt;
&lt;br /&gt;
* unplug the esata cable from the master CDM&lt;br /&gt;
* &amp;quot;red&amp;quot; light should go off&lt;br /&gt;
* read of lmk should report &amp;quot;pll1_ld&amp;quot; value 0 and &amp;quot;ld1_counter&amp;quot; and &amp;quot;ld2_counter&amp;quot; should increment&lt;br /&gt;
* reconnect the esata cable&lt;br /&gt;
* &amp;quot;red&amp;quot; light should return&lt;br /&gt;
* read of lmk should report both pll1_ld and pll2_ld locked (values &amp;quot;1&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Master setup ===&lt;br /&gt;
&lt;br /&gt;
* install the board&lt;br /&gt;
* connect ethernet&lt;br /&gt;
* esper-tool cdmNN ### i.e. esper-tool cdm01&lt;br /&gt;
* cd template&lt;br /&gt;
* write current_setup 3&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* write clkin_sel_mode 0&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* read&lt;br /&gt;
* observe clock frequency counters report correct values. &amp;quot;ext_clk&amp;quot; will only count if the &amp;quot;clock loopback&amp;quot; lemo jumper is installed (see below)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
12    ext_clk          uint32           R                 [62500189]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
156   ld1_counter      uint32           RW                [3]                             &lt;br /&gt;
157   ld2_counter      uint32           RW                [3]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the 200MHz clock:&lt;br /&gt;
* connect MiniSAS-eSATA splitter cable to MiniSAS output 6, connect eSATA end to CDM eSATA input&lt;br /&gt;
* in esper-tool, read cdm: esata_clk should report 200MHz clock&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11    esata_clk        uint32           R                 [200000603]                     &lt;br /&gt;
12    ext_clk          uint32           R                 [62500188]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Master setup with external 10 MHz clock ===&lt;br /&gt;
&lt;br /&gt;
* setup master CDM as above (using internal clock)&lt;br /&gt;
* connect 10MHz external clock to right LEMO #1&lt;br /&gt;
* esper-tool cdmNN&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* write sel_nim 1 # if clock is NIM signal&lt;br /&gt;
* write sel_nim 0 # if clock is TTL signal (i.e. chronobox LEMO output)&lt;br /&gt;
* read ext_clk&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[http://cdm00:/cdm]&amp;gt; read ext_clk&lt;br /&gt;
9999556&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if ext_clk reads 0 or does not read something close to 10MHz, stop here. debug the signal, try changing sel_nim, etc.&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* write clkin_sel_mode 2 # select external clock&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
150   clkin2_sel       bool             R                 [True]                          &lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* on the MIDAS TRG page, observe that TRG measured external clock frequency is close to 62.5 MHz&lt;br /&gt;
&lt;br /&gt;
== clkin_sel_mode positions ==&lt;br /&gt;
&lt;br /&gt;
* 0 = 10MHz internal oscillator (use on master CDM in standalone mode)&lt;br /&gt;
* 1 = eSATA clock (use on slave CDM)&lt;br /&gt;
* 2 = external clock, should be 10MHz (use on master CDM to run from AD clock)&lt;br /&gt;
&lt;br /&gt;
== LEMO connections ==&lt;br /&gt;
&lt;br /&gt;
* clock loopback jumper: to read the frequency of the generated 62.5MHz clock, connect LEMO cable from left LEMO #2 to the right LEMO #1&lt;br /&gt;
* 10MHz internal clock jumper: to feed 10MHz internal oscillator to the external clock, connect LEMO cable from right  LEMO #3 to the right LEMO #1.&lt;br /&gt;
* 10MHz external clock: to feed 10MHz external clock, connect LEMO cable to right LEMO #1&lt;br /&gt;
&lt;br /&gt;
= MIDAS frontends =&lt;br /&gt;
&lt;br /&gt;
== UDP ==&lt;br /&gt;
&lt;br /&gt;
feudp receives udp packets from the ADC and PWB boards. For each udp packet 1 midas event is created,&lt;br /&gt;
with 1 data bank containing the udp data. Events are sent into the MIDAS event buffer BUFUDP. The names&lt;br /&gt;
of the data banks are assigned in ODB /eq/feudp/settings.&lt;br /&gt;
&lt;br /&gt;
{ADC,PWB} --&amp;gt; 1gige --&amp;gt; switch --&amp;gt; 10gige --&amp;gt; alphagdaq --&amp;gt; feudp -&amp;gt; BUFUDP&lt;br /&gt;
&lt;br /&gt;
== CTRL ==&lt;br /&gt;
&lt;br /&gt;
fectrl controls all the ADC, PWB and trigger boards. It provides run start and stop sequencing,&lt;br /&gt;
runs the event synchronization sequence at the begin of the run, and records slow controls data (temperatures,&lt;br /&gt;
voltages, etc).&lt;br /&gt;
&lt;br /&gt;
fectrl receives UDP data packets from the trigger board and sends them to the MIDAS event buffer BUFUDP.&lt;br /&gt;
&lt;br /&gt;
fectrl receives commands from the control web pages (for ADC, PWB and trigger) to reboot, initialize, etc the boards.&lt;br /&gt;
&lt;br /&gt;
fectrl configures the event builder via odb /eq/fectrl/evbconfig.&lt;br /&gt;
&lt;br /&gt;
ADC &amp;lt;-&amp;gt; http esper &amp;lt;-&amp;gt; fectrl -&amp;gt; slow control data into midas history&lt;br /&gt;
&lt;br /&gt;
PWB &amp;lt;-&amp;gt; http esper &amp;lt;-&amp;gt; fectrl -&amp;gt; slow control data into midas history&lt;br /&gt;
&lt;br /&gt;
TRG &amp;lt;-&amp;gt; udp comm &amp;lt;-&amp;gt; fectrl -&amp;gt; BUFUDP, slow control and counters into midas history&lt;br /&gt;
&lt;br /&gt;
fectrl &amp;lt;-&amp;gt; midas rpc &amp;lt;-&amp;gt; mhttpd &amp;lt;-&amp;gt; json rpc &amp;lt;-&amp;gt; control web pages for ADC, PWB and trigger&lt;br /&gt;
&lt;br /&gt;
== EVB ==&lt;br /&gt;
&lt;br /&gt;
feevb receives udp packet data from the MIDAS event buffer BUFUDP, inspects the packet timestamps&lt;br /&gt;
and collects the data with matching timestamps into physics events. feevb has provisions to do&lt;br /&gt;
data suppression, reduction and compression in addition to the data reduction done&lt;br /&gt;
in the ADC and PWB firmware.&lt;br /&gt;
&lt;br /&gt;
feevb event synchronization relies on the event synchronization sequence done by fectrl when a run is started.&lt;br /&gt;
&lt;br /&gt;
{ADC, PWB, TRG} -&amp;gt; BUFUDP -&amp;gt; feevb -&amp;gt; SYSTEM -&amp;gt; mlogger -&amp;gt; compression -&amp;gt; disk storage&lt;br /&gt;
&lt;br /&gt;
=== internal structure ===&lt;br /&gt;
&lt;br /&gt;
* event buffer readers, instances for BUFTRG, BUFTDC, BUFADC, BUFUDP&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BufferReader class - reads one midas event buffer:&lt;br /&gt;
- BufferReaderThread()&lt;br /&gt;
-- in batches of 1000 events&lt;br /&gt;
--- lock&lt;br /&gt;
--- TickLocked()&lt;br /&gt;
----- ReadEvent() -&amp;gt; bm_receive_event_alloc()&lt;br /&gt;
----- fHandler-&amp;gt;HandleEvent()&lt;br /&gt;
-- fHandler-&amp;gt;XMaybeFlushBank()&lt;br /&gt;
-- sleep 100 usec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* event header decoder and intermediate buffer&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Handler class - accumulates events, sends them to the EVB in batches&lt;br /&gt;
&lt;br /&gt;
- HandleEvent() &amp;lt;- BufferReaderThread() - receive incoming events&lt;br /&gt;
-- loop over all banks, examine bank name&lt;br /&gt;
--- call AddAdcBank(), AddPwbBank(), AddTrgBank(), AddTdcBank() according to bank name&lt;br /&gt;
----  AddXxxBank() -&amp;gt; XAddBank()&lt;br /&gt;
--- unknown banks go directly to evb-&amp;gt;SendQueue&lt;br /&gt;
-- check if synchronization has completed&lt;br /&gt;
&lt;br /&gt;
- XAddBank() - save BankBuf objects in a buffer&lt;br /&gt;
&lt;br /&gt;
- XMaybeFlushBank(), XFlushBank() - send all accumulated data to the Evb class&lt;br /&gt;
-- evb-&amp;gt;lock()&lt;br /&gt;
-- for each buffered BankBuf objects,&lt;br /&gt;
--- call evb-&amp;gt;AddBankLocked()&lt;br /&gt;
-- buffer is now empty&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* event builder&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Evb class - assemble event fragments according to timestamps&lt;br /&gt;
&lt;br /&gt;
- fEvents fifo (deque) - time sorted list of partially assembled events&lt;br /&gt;
-- new entries are added by FindEvent()&lt;br /&gt;
-- entries are modified by MergeSlot()&lt;br /&gt;
-- old entries are removed by GetLocked()&lt;br /&gt;
&lt;br /&gt;
- AddBankLocked() &amp;lt;- XFlushBank() &amp;lt;- BufferReaderThread()&lt;br /&gt;
-- call fSync-&amp;gt;Add()&lt;br /&gt;
-- transform BankBuf to EvbEventBuf&lt;br /&gt;
-- push it into per-module buffer fBuf[imodule]&lt;br /&gt;
&lt;br /&gt;
- EvbThread()&lt;br /&gt;
-- EvbTickLocked()&lt;br /&gt;
--- BuildLocked()&lt;br /&gt;
---- in a loop, for no more than 1 sec&lt;br /&gt;
----- loop over all per-module buffers fBuf&lt;br /&gt;
------ pop first entry, pass it to BuildSlot()&lt;br /&gt;
------- call FindEvent()&lt;br /&gt;
------- call MergeSlot()&lt;br /&gt;
------- call CheckEvent()&lt;br /&gt;
--- in a loop&lt;br /&gt;
---- get all completed events via GetLocked() pass them to SendQueue-&amp;gt;PushEvent()&lt;br /&gt;
-- if done nothing, sleep 100 usec, otherwise nominal sleep to free the evb lock&lt;br /&gt;
&lt;br /&gt;
- GetNext() &amp;lt;- GetLocked() &amp;lt;- EvbThread() - get completed events&lt;br /&gt;
-- examine oldest EvbEvent entry in fEvents:&lt;br /&gt;
-- pop it if it is complete&lt;br /&gt;
-- pop it if it is too old (to prevent old incomplete events from stalling the evb) (&amp;quot;pop age&amp;quot; on the evb page)&lt;br /&gt;
-- pop it if a following event is complete (&amp;quot;pop following&amp;quot; on the evb page)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* send queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SendQueue class - prepare events for writing to midas SYSTEM event buffer&lt;br /&gt;
&lt;br /&gt;
- PushEvent() &amp;lt;- EvbThread()&lt;br /&gt;
-- push FragmentBuf into the queue&lt;br /&gt;
&lt;br /&gt;
- SendQueueThread()&lt;br /&gt;
-- in a batch of 1000 events, call Tick()&lt;br /&gt;
--- pop FragmentBuf from the queue, call SendEvent()&lt;br /&gt;
--- compose midas event (memcpy()!)&lt;br /&gt;
--- TMFE fEq-&amp;gt;SendEvent()&lt;br /&gt;
--- bm_send_event()&lt;br /&gt;
-- sleep 100 usec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* equipment object&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EvbEq class - implements the midas equipment&lt;br /&gt;
- HandleBeginRun()&lt;br /&gt;
- HandleEndRun()&lt;br /&gt;
- HandlePeriodic()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== multithreading ===&lt;br /&gt;
&lt;br /&gt;
* BufferReaderThread() one per midas event buffer&lt;br /&gt;
** high CPU use: bm_receive_event(), AddXxxBank()&lt;br /&gt;
** lock contention: midas event buffer lock, evb lock into XFlushBank-&amp;gt;AddBankLocked()&lt;br /&gt;
* EvbThread()&lt;br /&gt;
** O(size of fEvents): FindEvent(), GetNext()&lt;br /&gt;
** lock contention: evb lock against XFlushBank(), SendQueue lock (1 per output event)&lt;br /&gt;
* SendQueueThread()&lt;br /&gt;
** high CPU use: memcpy() in SendEvent(), memcpy() in bm_send_event&lt;br /&gt;
** lock contention: event queue lock against EvbThread, midas event buffer lock&lt;br /&gt;
* main thread&lt;br /&gt;
** lock contention: evb lock in ReportEvb() and elsewhere&lt;br /&gt;
&lt;br /&gt;
= ODB entries =&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings ==&lt;br /&gt;
* TBW&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TrigSrc - trigger source selection ==&lt;br /&gt;
* TrigPulser                      - trigger on the pulser&lt;br /&gt;
* TrigEsataNimGrandOr             - trigger on external NIM inputs of GRIF-16 ADC modules&lt;br /&gt;
* TrigAdc16GrandOr                - trigger on any adc16 signals (see adc16_masks)&lt;br /&gt;
* TrigAdc32GrandOr                - trigger on any adc32 signals (see adc32_masks)&lt;br /&gt;
* Trig1ormore                     - trigger on adc16 multiplicity 1 or more&lt;br /&gt;
* Trig2ormore                     - ditto, 2 or more&lt;br /&gt;
* Trig3ormore                     - ditto, 3 or more&lt;br /&gt;
* Trig4ormore                     - ditto, 4 or more&lt;br /&gt;
* TrigAdcGrandOr                  - trigger on any ADC signal&lt;br /&gt;
* TrigAwCoincA                    - trigger on TPC AW coincidence (see [[TRG]] manual)&lt;br /&gt;
* TrigAwCoincB                    - ditto&lt;br /&gt;
* TrigAwCoincC                    - ditto&lt;br /&gt;
* TrigAwCoincD                    - ditto&lt;br /&gt;
* TrigAwCoinc                     - ditto&lt;br /&gt;
* TrigAw1ormore	- trigger on TPC AW per-preamp multiplicity 1 or more (see [[TRG]] manual)&lt;br /&gt;
* TrigAw2ormore	- ditto, 2 or more&lt;br /&gt;
* TrigAw3ormore	- ditto, 3 or more&lt;br /&gt;
* TrigAw4ormore - ditto, 4 or more&lt;br /&gt;
* TrigAwMLU                       - trigger on TPC AW MLU signal (see [[TRG]] manual)&lt;br /&gt;
* TrigBscGrandOr                  - trigger on any BSC signal&lt;br /&gt;
* TrigBscMult                     - trigger on predefined BSC multiplicity (see [[TRG]] manual)&lt;br /&gt;
* TrigCoinc                       - trigger on predefined coincidence of TPC AW, BSC and external signal (see [[TRG]] manual)&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TRG - trigger settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will not do anything with the trigger board. Normal value &amp;quot;y&amp;quot;&lt;br /&gt;
* Modules - hostnames of the trigger board. Normal value &amp;quot;alphat01&amp;quot;&lt;br /&gt;
* NimMask - 32-bit mask for the 32x NIM inputs (see TRG manual). Normal value 0, unless external trigger is in use.&lt;br /&gt;
* EsataMask - 32-bit mask for the 32x eSATA signals (see TRG manual). Normal value 0.&lt;br /&gt;
* adc16_mask[16] - 16x 16-bit mask for the 100MHz GRIF-16 onboard ADCs (see TRG manual). Normal value 0xFFFF for all 16 data links.&lt;br /&gt;
* adc32_mask[16] - 16x 32-bit mask for the 62.5MHz FMC-ADC32 ADCs (see TRG manual). Normal value 0xFFFFFFFF for all 16 data links.&lt;br /&gt;
* PassThrough - if set to &amp;quot;y&amp;quot;, trigger is passed through the trigger module without generating any events and without causing deadtime.&lt;br /&gt;
* AwCoincA, B, C and D - 32-bit masks for the aw16 coincidence trigger (see TRG manual)&lt;br /&gt;
* Aw16FromAdc16 - route AW trigger (aw16) from adc16 (100MHz ADCs 0..15)&lt;br /&gt;
* Aw16FromAdc32a - route AW trigger (aw16) from adc32 group 15..0 (62.5MHz FMC-ADC32 in ADCs 0..7)&lt;br /&gt;
* Aw16FromAdc32b - route AW trigger (aw16) from adc32 group 31..16 (62.5MHz FMC-ADC32 in ADCs 8..15)&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/PWB - PWB settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will not do anything with PWBs. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_boot_user_page - if set to &amp;quot;n&amp;quot;, fectrl will not try to reboot PWBs into the user page firmware. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_trigger - if set to &amp;quot;n&amp;quot;, all PWBs will be set to ignore the trigger. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_trigger_group_a - field wire pulser defeats the data suppression (every channel has a pulse) resulting in too much data overwhelming the DAQ (lost UDP packets). To permit correct data taking of field wire pulser data, PWBs are split into two groups (a and b), only one of the two groups should be enabled for field wire pulser runs. Both groups should be enabled for normal data taking. Normal value is &amp;quot;y&amp;quot;&lt;br /&gt;
* enable_trigger_group_b - see &amp;quot;enable_trigger_group_a&amp;quot;. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* modules[64] - hostnames of PWB boards&lt;br /&gt;
* boot_user_page[64] - if set to &amp;quot;y&amp;quot; and enable_boot_user_page is &amp;quot;y&amp;quot;, fectrl will reboot the corresponding PWB to the user page firmware.&lt;br /&gt;
* trigger[64] - if set to &amp;quot;y&amp;quot; and enable_trigget is &amp;quot;y&amp;quot;, fectrl will set the PWB to accept the trigger.&lt;br /&gt;
* ch_enable - if set to &amp;quot;n&amp;quot; disables all PWB channels. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* ch_force - is set to &amp;quot;y&amp;quot; disables channel suppression (all PWB channels are read)&lt;br /&gt;
* suppress_reset - if set to &amp;quot;y&amp;quot; enables channel suppression for reset channels (threshold has to be set correctly)&lt;br /&gt;
* suppress_fpn - if set to &amp;quot;y&amp;quot; enables channel suppression for fpn channels (threshold has to be set correctly)&lt;br /&gt;
* suppress_pads -  set to &amp;quot;y&amp;quot; enables channel suppression for TPC pad channels (threshold has to be set correctly)&lt;br /&gt;
* disable_reset1 - data suppression algorithm does not work for the channel &amp;quot;reset1&amp;quot; and it has to be suppressed explicitly by setting this value to &amp;quot;y&amp;quot;. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* baseline_{reset,fpn,pads}[64] - waveform baseline for each PWB position&lt;br /&gt;
* threshold_{reset,fpn,pads} - waveform suppression threshold, see below:&lt;br /&gt;
* ch_threshold - PWB sca_N_ch_threshold, if set to 0, threshold is computed as &amp;quot;baseline_pads[seqpwb]-threshold_pads&amp;quot;. Normal value is 0.&lt;br /&gt;
* test_mode - enable PWB test mode, the ADC data is replaced with a test pattern, see PWB esper variable signalproc/test_mode&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TDC - TDC settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will tell the event builder that the TDC is not running. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/EvbConfig - EVB configuration ==&lt;br /&gt;
All arrays have the same size corresponding to the number of EVB slots.&lt;br /&gt;
* name[] - slot name for the web page (trg01, adc01, adc01/adc32, pwb31/0, tdc01, etc)&lt;br /&gt;
* type[] - slot type: 1=TRG, 2=ADC16 and ADC32, 3=obsolete PWB, 4=obsolete PWB, 5=PWB, 6=TDC&lt;br /&gt;
* module[] - module number (adcNN, adcNN+100, pwbNN, etc)&lt;br /&gt;
* nbanks[] - number of expected banks (16 for ADC16, 32 for ADC32, not used, set to 1 for all others)&lt;br /&gt;
* tsfreq[] - timestamp frequency in Hz.&lt;br /&gt;
&lt;br /&gt;
= Trigger configuration =&lt;br /&gt;
&lt;br /&gt;
These trigger modes are implemented:&lt;br /&gt;
* (manual trigger from web page)&lt;br /&gt;
* software pulser trigger (from fectrl)&lt;br /&gt;
* hardware pulser trigger (from the trigger board)&lt;br /&gt;
* NIM and eSATA trigger from ADC front panel inputs&lt;br /&gt;
* adc16 and adc32 discriminator triggers:&lt;br /&gt;
** adc16 grand-or trigger&lt;br /&gt;
** adc32 grand-or trigger&lt;br /&gt;
** adc (adc16+adc32) grand-or trigger&lt;br /&gt;
** adc16 multiplicity trigger (1ormore, 2ormore, 3ormore, 4ormore) for use with barrel scintillator&lt;br /&gt;
** anode wire multiplicity trigger (1ormore, 2ormore, 3ormore, 4ormore) (anode wire signals can be fed from adc16 or from adc32 signals)&lt;br /&gt;
** anode wire coincidence trigger&lt;br /&gt;
** anode wire MLU (memory lookup) trigger&lt;br /&gt;
&lt;br /&gt;
== NIM trigger from ADC front panel ==&lt;br /&gt;
&lt;br /&gt;
Trigger path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NIM signal --&amp;gt; LEMO input on ADC front panel --&amp;gt; data encoder --&amp;gt; data link to trigger board --&amp;gt; data decoder --&amp;gt; mask --&amp;gt; nim-esata-grand-or --&amp;gt; trigger&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable NIM trigger, do this:&lt;br /&gt;
* connect NIM signal to ADC front panel input&lt;br /&gt;
** Note1: NIM signal must be inverted&lt;br /&gt;
** Note2: LEMO connectors should be set to &amp;quot;NIM input&amp;quot; mode by ADC on-board jumpers (see ADC manual)&lt;br /&gt;
* observe correct bit goes to zero in the TRG web page: data link high work should change:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0xNF00&#039;0000 (N is the module id) to&lt;br /&gt;
0xN700&#039;0000 (left lemo) or&lt;br /&gt;
0xNB00&#039;0000 (right lemo)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Note3: if data link bits do not change, most likely the LEMO connectors are set to &amp;quot;DAC output&amp;quot; mode. Try to use LEMO inputs of a different ADC.&lt;br /&gt;
* compute the NIM mask: there are 32 bits, 2 bits per ADC data link. Bit 0x1 is right LEMO, bit 0x2 is left LEMO&lt;br /&gt;
* for example, to use left LEMO of ADC data link 12, set nim mask to (0x2)&amp;lt;&amp;lt;(2*12) = 0x02000000&lt;br /&gt;
* development branch of the git repository contains &#039;&#039;scripts/nim_mask.py&#039;&#039;, which can compute forwards and backwards&lt;br /&gt;
* initialize the trigger board (on the TRG web page press button &amp;quot;initialize&amp;quot;), or start a new run&lt;br /&gt;
* on the history plot with &amp;quot;NIM grand or&amp;quot; counter, the rate should change from zero&lt;br /&gt;
* if a run is active, if one of the ADC LEMO outputs is set to output the trigger signal as a NIM pulse, one should see it fire use a scope. The delay or jitter between NIM trigger in and NIM trigger out should be around 100-200 ns (FIXME - measure this!)&lt;br /&gt;
* to set the DAQ to trigger on the NIM signal, on the run start page, check the box &amp;quot;TrigEsataNimGrandOr&amp;quot;.&lt;br /&gt;
** Note: remember to set the scaledown to 0 if so desired.&lt;br /&gt;
&lt;br /&gt;
= TPC field wire pulser =&lt;br /&gt;
&lt;br /&gt;
The TPC field wire pulser input should be connected directly to the DAC output of adc01 (right lemo connector).&lt;br /&gt;
&lt;br /&gt;
DAC settings in ODB /Equipment/CTRL/Settings/ADC/DAC/&lt;br /&gt;
&lt;br /&gt;
* for pulsing PWBs (maximum possible pulse height in PWBs. Overdrives the AW ADC waveforms)&lt;br /&gt;
** dac_baseline: -8000&lt;br /&gt;
** dac_amplitude: 8000&lt;br /&gt;
** ramp_up_rate: 128&lt;br /&gt;
** ramp_down_rate: 70&lt;br /&gt;
** ramp_top_len: 128&lt;br /&gt;
&lt;br /&gt;
* for pulsing AW: (AW ADC waveforms are in range. PWB waveforms are too small for goor time resolution)&lt;br /&gt;
** dac_baseline: -2000&lt;br /&gt;
** dac_amplitude: 4000&lt;br /&gt;
** ramp_up_rate: 20&lt;br /&gt;
** ramp_down_rate: 20&lt;br /&gt;
** ramp_top_len: 128&lt;br /&gt;
&lt;br /&gt;
= TDC connections =&lt;br /&gt;
&lt;br /&gt;
* SFP8 - fiber SFP to Juniper switch&lt;br /&gt;
* right RJ45 - 200MHz clock&lt;br /&gt;
* left RJ45 - external trigger&lt;br /&gt;
&lt;br /&gt;
= MIDAS Data banks =&lt;br /&gt;
&lt;br /&gt;
* ATAT - fectrl - UDP packets from GRIF-C/TRG trigger board&lt;br /&gt;
* TRBA - fetdc - TDC data&lt;br /&gt;
* TRTM - fetdc - TDC FPGA temperatures, TID_FLOAT[5].&lt;br /&gt;
* AAnn - feudp - UDP packets from GRIF-16 ADC (before the event builder), &amp;quot;nn&amp;quot; is the ADC module number: adc01 is AA01 through adc20 is AA20.&lt;br /&gt;
* BBxx - feudp - UDP packets from PWB, obsolete&lt;br /&gt;
* Bnnm, Cnnm - feevb - EVB output banks: ADC data, &amp;quot;nn&amp;quot; is the ADC module number (1..20), &amp;quot;m&amp;quot; is the channel number (0..9,A..F), format is same as AAnn banks.&lt;br /&gt;
* PAnn - feudp - UDP packets from PWB, &amp;quot;nn&amp;quot; is the PWB module number (00..99), obsolete&lt;br /&gt;
* PBnn - feudp - UDP packets from PWB, &amp;quot;nn&amp;quot; is the PWB module number (00..99), PB01 is pwb01, PB78 is pwb78&lt;br /&gt;
* PCnn - feevb - EVB output banks: PWB data, &amp;quot;nn&amp;quot; is the PWB module number (00..99), same as above, format is same as PBnn banks&lt;br /&gt;
&lt;br /&gt;
= ZZZ =&lt;br /&gt;
&lt;br /&gt;
ZZZ&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:VME_Crate_CERN.jpeg&amp;diff=647</id>
		<title>File:VME Crate CERN.jpeg</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:VME_Crate_CERN.jpeg&amp;diff=647"/>
		<updated>2021-02-09T23:18:19Z</updated>

		<summary type="html">&lt;p&gt;Acapra: Layout of VME crate at CERN with 8 ALPHA-16&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Layout of VME crate at CERN with 8 ALPHA-16&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=TRG&amp;diff=646</id>
		<title>TRG</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=TRG&amp;diff=646"/>
		<updated>2021-02-09T22:52:13Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= TRG, the trigger control board for the ALPHA-g detector =&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
* xxx&lt;br /&gt;
* https://bitbucket.org/expalpha/trg_firmware - firmware sources on bitbucket&lt;br /&gt;
&lt;br /&gt;
= General characteristics =&lt;br /&gt;
&lt;br /&gt;
== Photos ==&lt;br /&gt;
&lt;br /&gt;
== Board schematics ==&lt;br /&gt;
&lt;br /&gt;
== Available hardware ==&lt;br /&gt;
&lt;br /&gt;
= ALPHA-T front panel connections =&lt;br /&gt;
&lt;br /&gt;
From top to bottom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
| minisas-C - links 8-11&lt;br /&gt;
| minisas-D - links 12-15&lt;br /&gt;
|&lt;br /&gt;
| ethernet sfp - use copper sfp only&lt;br /&gt;
| minisas - not used, do not connect&lt;br /&gt;
| esata - clock in, trigger out&lt;br /&gt;
|&lt;br /&gt;
| minisas-A - links 0-3&lt;br /&gt;
| minisas-B - links 4-7&lt;br /&gt;
|&lt;br /&gt;
| LEDs&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MiniSAS and SATA flail cable connections:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
P1 &amp;lt;--&amp;gt; link 3&lt;br /&gt;
P2 &amp;lt;--&amp;gt; link 2&lt;br /&gt;
P3 &amp;lt;--&amp;gt; link 1&lt;br /&gt;
P4 &amp;lt;--&amp;gt; link 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LEDs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--PCB-- (left)&lt;br /&gt;
LED[0] - trigger out - ag_trig_out&lt;br /&gt;
LED[1] - network packet received - sfp_rx_data_valid&lt;br /&gt;
LED[2] - Xilinx FPGA boot ok - FMC1_CFG_DONE&lt;br /&gt;
LED[3] - not used&lt;br /&gt;
(right)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ALPHA-T onboard jumpers and switches =&lt;br /&gt;
&lt;br /&gt;
* rotary switches: select IP address: 00=192.168.1.50, 11=.51, 22=.52, 33=.53, 44=.54, otherwire=.251&lt;br /&gt;
&lt;br /&gt;
= Firmware update procedure =&lt;br /&gt;
&lt;br /&gt;
* use quartus to generate the grifc.pof file (use grifc.cof)&lt;br /&gt;
* open quartus programmer&lt;br /&gt;
* attach grifc.pof to the 1st CFI_512 flash&lt;br /&gt;
* mark program/configure for the same flash (3 marks: pof, page_0 and OPTION_BITS&lt;br /&gt;
* check that &amp;quot;initiate configuration after programming&amp;quot; is set in tools-&amp;gt;options&lt;br /&gt;
* say &amp;quot;start&amp;quot;&lt;br /&gt;
* should take about 5 minutes&lt;br /&gt;
* grifc should reboot into the new firmware&lt;br /&gt;
&lt;br /&gt;
If CFI_512 flash is not visible to the quartus programmer, load correct&lt;br /&gt;
code into the MaxV CPLD:&lt;br /&gt;
&lt;br /&gt;
* open quartus programmer,&lt;br /&gt;
* say &amp;quot;auto detect&amp;quot;&lt;br /&gt;
* change file for the 5M2210 device&lt;br /&gt;
* use .../boot/maxv_3xfmc_normal.pof from the firmware git repository&lt;br /&gt;
* say &amp;quot;program&amp;quot;, it should finish in 10-15 seconds&lt;br /&gt;
* say &amp;quot;auto detect&amp;quot;&lt;br /&gt;
* CFI_512 flash should be visible now.&lt;br /&gt;
&lt;br /&gt;
= Firmware revisions =&lt;br /&gt;
&lt;br /&gt;
= Firmware build =&lt;br /&gt;
&lt;br /&gt;
* use quartus 17.1&lt;br /&gt;
&lt;br /&gt;
= ALPHA-g trigger functions =&lt;br /&gt;
&lt;br /&gt;
Trigger modes:&lt;br /&gt;
* software trigger&lt;br /&gt;
* pulser trigger&lt;br /&gt;
* trigger on GRIF16 ADC NIM and ESATA inputs (&amp;quot;external trigger&amp;quot;)&lt;br /&gt;
* adc16 grand-or&lt;br /&gt;
* adc32 grand-or&lt;br /&gt;
* adc16 wire multiplicity&lt;br /&gt;
* TPC anode wire per-preamp trigger (aw16 section)&lt;br /&gt;
** trigger on coincidences of preamps&lt;br /&gt;
** trigger on multiplicity of preamps&lt;br /&gt;
** trigger on specific topology of preamps (multiplicity of preamp clusters, etc) via the aw16_mlu trigger&lt;br /&gt;
* BSC trigger&lt;br /&gt;
** BSC grand_or&lt;br /&gt;
** BSC bar multiplicity&lt;br /&gt;
* coincidence trigger - coincidence of external, TPC AW and BSC triggers&lt;br /&gt;
&lt;br /&gt;
== software trigger ==&lt;br /&gt;
&lt;br /&gt;
to programmatically fire the trigger, one should:&lt;br /&gt;
* set the conf_enable_sw_trigger bit in conf_trig_enable, this will permit the software trigger to fire the trigger&lt;br /&gt;
* write value 0x4 to register 0x2B, this will cause the trigger to fire&lt;br /&gt;
&lt;br /&gt;
== pulser trigger ==&lt;br /&gt;
&lt;br /&gt;
To use the pulser trigger, one should program:&lt;br /&gt;
* pulser period (in clocks)&lt;br /&gt;
* pulser width (in clocks, use value 5, the pulser no longer goes outside of the trigger board, so changing the width does not do anything)&lt;br /&gt;
* set the run_pulser bit in conf_trig_enable, this will cause the pulser to run&lt;br /&gt;
* set the enable_pulser bit in conf_trig_enable, this will cause the pulser to fire the trigger&lt;br /&gt;
* set the output_pulser bit in conf_trig_enable, this will cause the pulser to be output from the alphag firmware block (the pulser no longer goes outside of the trigger board, so changing the bit does not do anything)&lt;br /&gt;
&lt;br /&gt;
== timeout trigger ==&lt;br /&gt;
&lt;br /&gt;
The event builder uses event timestamps to assemble physics events. The timestamps&lt;br /&gt;
are usually 32 bit wide and run at 125 MHz (8 ns) or 62.5 MHz (16 ns). If&lt;br /&gt;
triggers are generated often (1 per second or more), timestamp wrap around&lt;br /&gt;
is easily detected by the event builder. If triggers come infrequently,&lt;br /&gt;
timestamp wrap around may occur while there are no triggers, not be seen&lt;br /&gt;
by the event builder causing loss of event synchronization.&lt;br /&gt;
&lt;br /&gt;
To avoid this problem in the event builder, a timeout trigger is generated&lt;br /&gt;
if no triggers were generated inside a 10 second interval.&lt;br /&gt;
&lt;br /&gt;
The guaranties that even if all physics triggers temporarily stop for any reason,&lt;br /&gt;
the event builder will stay synchronized. (0.1 Hz timeout trigger frequency).&lt;br /&gt;
&lt;br /&gt;
== adc16 multiplicity trigger ==&lt;br /&gt;
&lt;br /&gt;
This trigger is intended for use with the barrel scintillator signals connected to adc16 digitizers. It does not work well with TPC AW signals.&lt;br /&gt;
&lt;br /&gt;
The 16 adc16 trigger bits (16x16=256) are added together to form the hit multiplicity value (adc16_mult, 16 bits, actual range 0 to 256).&lt;br /&gt;
&lt;br /&gt;
Four threshold signals are computed: adc16_mult_1ormore = adc16_mult&amp;gt;=1, 2ormore, 3ormore, 4ormore.&lt;br /&gt;
&lt;br /&gt;
There is a counter for each of these four signals.&lt;br /&gt;
&lt;br /&gt;
Each of these four signals can fire the trigger, see conf_trig_enable bits.&lt;br /&gt;
&lt;br /&gt;
== TPC anode wire triggers ==&lt;br /&gt;
&lt;br /&gt;
TBW: mapping of adc16 and adc32 into aw16[15:0] signals&lt;br /&gt;
&lt;br /&gt;
=== aw16_grand_or ===&lt;br /&gt;
&lt;br /&gt;
TPC AW &amp;quot;grand or&amp;quot; trigger: use aw16_mult_1ormore&lt;br /&gt;
&lt;br /&gt;
=== aw16_mult ===&lt;br /&gt;
&lt;br /&gt;
TPC AW preamp multiplicity trigger: counts how many preamps&lt;br /&gt;
have hits, fires:&lt;br /&gt;
* aw16_mult_1ormore (same as aw16_grand_or)&lt;br /&gt;
* aw16_mult_2ormore&lt;br /&gt;
* aw16_mult_3ormore&lt;br /&gt;
* aw16_mult_4ormore&lt;br /&gt;
&lt;br /&gt;
(256 anode wires, 16 wires per preamp, 16 preamps, 16 aw16 signals)&lt;br /&gt;
&lt;br /&gt;
=== aw16_coinc ===&lt;br /&gt;
&lt;br /&gt;
TBW: TPC AW preamp coincidence trigger&lt;br /&gt;
&lt;br /&gt;
=== aw16_mlu ===&lt;br /&gt;
&lt;br /&gt;
TPC AW preamp MLU trigger: the MLU (memory lookup&lt;br /&gt;
table) implements an arbitrary logical function&lt;br /&gt;
to map the 16 aw16 preamp signals into 1 aw16_mlu_trig trigger output.&lt;br /&gt;
&lt;br /&gt;
Description of the aw16 mlu trigger.&lt;br /&gt;
&lt;br /&gt;
In words:&lt;br /&gt;
&lt;br /&gt;
* any aw16 signal starts the aw16_prompt_run gate&lt;br /&gt;
* aw16 signals are collected for the duration of conf_mlu_prompt (125MHz/8ns clock)&lt;br /&gt;
* this corresponds to time spread of TPC AW signals due to the drift time in the AW drift cell and to the variation in signal transmission time from the ADC to the TRG (digital trigger data link).&lt;br /&gt;
* when this prompt time expires, the MLU looks at the accumulated aw16_prompt bit pattern and makes the &amp;quot;yes/no&amp;quot; trigger decision&lt;br /&gt;
* after the trigger decision is made, we wait for the TPC to become quiet, meaning there is no aw16 signals for the duration of the aw16_prompt_wait gate (conf_mlu_wait), if any signals arrive during the gate, they restart the gate.&lt;br /&gt;
* after the TPC has been quiet for conf_mlu_wait time (125MHz/8ns clock), the MLU trigger is ready for the next event.&lt;br /&gt;
&lt;br /&gt;
In logic: (see alphag.v)&lt;br /&gt;
&lt;br /&gt;
* aw16_or &amp;lt;= grand-or of 16 aw16 signals&lt;br /&gt;
* &amp;quot;aw16_or&amp;quot; starts the &amp;quot;aw16_prompt_cnt&amp;quot; counter, opens the aw16_prompt_run gate&lt;br /&gt;
* during the aw16_prompt_run gate, aw16_prompt collects (latches) the aw16 bits (aw16_prompt &amp;lt;= aw16_prompt | aw16)&lt;br /&gt;
* this is the time when we wait for all &amp;quot;prompt&amp;quot; signals from the TPC to arrive into the trigger&lt;br /&gt;
* at the end of the aw16_prompt_run gate, the signal aw16_prompt_out is pulsed, latching the output of the MLU into aw16_mlu_trig&lt;br /&gt;
* this is the MLU trigger &amp;quot;yes/no&amp;quot; trigger decision.&lt;br /&gt;
* after the MLU trigger decision is made, we wait for the arrival and passing of all TPC drift signals&lt;br /&gt;
* the aw16_prompt_wait_cnt and aw_prompt_wait gate opens&lt;br /&gt;
* if any new aw16 signals arrive (they are TPC drift signals at this time), the aw16_prompt_wait gate is restarted&lt;br /&gt;
* if no aw16 signals arrive during the full run of the aw16_prompt_wait gate (&amp;quot;TPC quiet time&amp;quot;)&lt;br /&gt;
* the aw16_prompt_wait and aw16_prompt gates are cleared and the MLU trigger is ready for the next event.&lt;br /&gt;
&lt;br /&gt;
== BSC trigger ==&lt;br /&gt;
&lt;br /&gt;
TBW&lt;br /&gt;
&lt;br /&gt;
== Coincidence trigger ==&lt;br /&gt;
&lt;br /&gt;
Coincidence trigger inputs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   assign coinc_input[0] = aw16_mult_1ormore;&lt;br /&gt;
   assign coinc_input[1] = aw16_mlu_trig;&lt;br /&gt;
   assign coinc_input[2] = bsc_grand_or_trig;&lt;br /&gt;
   assign coinc_input[3] = bsc_mult_trig;&lt;br /&gt;
   assign coinc_input[4] = esata_nim_grand_or;&lt;br /&gt;
   assign coinc_input[5] = 0;&lt;br /&gt;
   assign coinc_input[6] = 0;&lt;br /&gt;
   assign coinc_input[7] = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coincidence trigger &amp;quot;start&amp;quot; mask selects which of the inputs can start the coincidence window.&lt;br /&gt;
&lt;br /&gt;
Coincidence trigger &amp;quot;require&amp;quot; mask selects which inputs must have a hits for the coincidence ot be satisfied.&lt;br /&gt;
&lt;br /&gt;
Input hits are collected for the duration of the coincidence window, if all required inputs have hits, coinc_trig is fired.&lt;br /&gt;
&lt;br /&gt;
Example settings:&lt;br /&gt;
&lt;br /&gt;
* coincidence of external scintillator, BSC and TPC AW &amp;quot;grand or&amp;quot; signals: start 0x10, required 0x15&lt;br /&gt;
* coincidence of BSC and TPC AW &amp;quot;grand or&amp;quot; signals: start 0x4, required 0x5&lt;br /&gt;
* coincidence of BSC and TPC AW MLU triggers: start 0x4, required 0x6&lt;br /&gt;
* coincidence of BSC multiplicity and TPC AW MLU triggers: start 0x8, required 0xA&lt;br /&gt;
&lt;br /&gt;
= Control registers =&lt;br /&gt;
&lt;br /&gt;
== Register addresses ==&lt;br /&gt;
&lt;br /&gt;
Note: all registers are 32 bits unless otherwise noted.&lt;br /&gt;
&lt;br /&gt;
Note: RW means read-write register, RO means read-only, ROL means read-only, contents is latched by the &amp;quot;latch_out&amp;quot; bit&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Address || Quartus Name || Access || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || num_sample || RW || GRIF-C || magic register to control UDP packet size&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F || compilation_time || RO || || Firmware revision&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || conf_trig_width     &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || conf_busy_width     &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || conf_pulser_width   &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 || conf_pulser_period   &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || sw_trigger_counter &amp;lt;= 10;&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || - || || 0x5b120c9f (01Jun18_20:18) || not used&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || conf_trig_enable   &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || conf_sas_trig_mask &amp;lt;= par_value; || obsolete&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 || conf_sas_trig_mask_a &amp;lt;= par_value; || obsolete&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || conf_sas_trig_mask_b &amp;lt;= par_value; || obsolete&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 || conf_nim_mask &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || conf_esata_mask &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B || reset_out, latch_out, trigger_out || pulsed || 0x5b120c9f (01Jun18_20:18) || see reg 0x2B bits&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || conf_aw16_coinc_a || RW || ??? || configure AW coincidence trigger&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D || conf_aw16_coinc_b || RW || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || conf_aw16_coinc_c || RW || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F || conf_aw16_coinc_d || RW || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || sas_sd[15:0] || ROL || 0x5b120c9f (01Jun18_20:18) || sas signal detect for each link&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 || pll_625_status || ROL || 0x5b2057f5 (12Jun18_16:32) || 62.5MHz PLL status, bits: 31=locked, 30=active clock, 29=esata_clk_bad, 28=clk625_bad, 27:0 not used, to be lock counter&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || clk_counter || ROL || 0x5b2057f5 (12Jun18_16:32) || frequency counter of the system 125 MHz clock&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 || clk_625_counter || ROL || 0x5b2057f5 (12Jun18_16:32) || frequency counter of the currently selected 62.5 MHz clock (my_clk_625)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || conf_control || RW || 0x5b398983 (01Jul18_19:10) || see conf_control bits below&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 || conf_drift_width || RW || 0x5b398983 (01Jul18_19:10) || width of drift time blank-out in 62.5MHz clocks&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 || conf_scaledown || RW || 0x5b398983 (01Jul18_19:10) || trigger scaledown, 0=no scaledown, 1=divide-by-2, 2=divide-by-3, etc&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 || conf_mlu || RW || 0x5b398983 (01Jul18_19:10) || aw trigger mlu control&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || conf_trig_delay || RW || 0x5baedfca (28Sep18_19:13) || delay the trigger pulse&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 || esata_clk_counter || ROL || 0x5baedfca (28Sep18_19:13) || frequency counter of the system 125 MHz clock&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A || esata_clk_esata_counter || ROL || 0x5baedfca (28Sep18_19:13) || requency counter of the external clock (eSATA clock)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B || conf_counter_adc_select || RW || 0x5bb7f6ae (05Oct18_16:41) || select which 16 ADCs are connected to the selected adc counters, 0..15 - connect the adc16 signals, 16..47 connect the adc32 signals&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C || sysreset_ts || RO || 0x5bb7f6ae (05Oct18_16:41) || 125MHz counter of VME-SYSRESET active state&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D || GRIF-C csr || RW || GRIF-C || &amp;lt;= csr &amp;amp; ~par_value; // Selective clear&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E || GRIF-C csr || RW || GRIF-C || &amp;lt;= csr |  par_value; // Selective set&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F || GRIF-C csr || RW || GRIF-C || &amp;lt;= par_value; // write&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || conf_bsc_control || RW || 0x5bc13541 (12Oct18_16:58) || Barrel Scintillator trigger control&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || conf_coinc_control || RW || 0x5bc13541 (12Oct18_16:58) || Coincidence trigger control&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || reconfig_out || WO || 0x5bc13541 (12Oct18_16:58) || reserved for rebooting the FPGA (does not work)&lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || conf_trigger_timeout || RW || 0x5bc8f90f (18Oct18_14:20) || Trigger timeout in 125MHz clocks (8ns)&lt;br /&gt;
|-&lt;br /&gt;
| 0x100 || ts_625 || ROL || || latched timestamp&lt;br /&gt;
|-&lt;br /&gt;
| 0x101 || counter_trig_out || ROL || || counter of issued triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x102 || counter_trig_in || ROL || || counter of triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x103 || counter_pulser || ROL || || counter of pulser&lt;br /&gt;
|-&lt;br /&gt;
| 0x104 || counter_adc16_grand_or || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x105 || counter_adc32_grand_or || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x106 || counter_adc_grand_or || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x107 || counter_esata_nim_grand_or || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x108 || counter_adc16_mult_1ormore || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x109 || counter_adc16_mult_2ormore || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10A || counter_adc16_mult_3ormore || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10B || counter_adc16_mult_4ormore || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10C || counter_aw16_coinc_a || ROL || ??? || counter of AW coincidence triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x10D || counter_aw16_coinc_b || ROL || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10E || counter_aw16_coinc_c || ROL || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10F || counter_aw16_coinc_d || ROL || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x110 || counter_drift || ROL || 0x5b398983 (01Jul18_19:10) || counter of triggers that passed the drift time blank-out&lt;br /&gt;
|-&lt;br /&gt;
| 0x111 || counter_scaledown || ROL || 0x5b398983 (01Jul18_19:10) || counter of triggers that passed the scaledown&lt;br /&gt;
|-&lt;br /&gt;
| 0x112 || counter_aw16_coinc || ROL || 0x5b398983 (01Jul18_19:10) || counter of AW coincidence triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x113 || counter_aw16_mlu || ROL || 0x5b398983 (01Jul18_19:10) || counter of AW MLU triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x114 || counter_aw16_mult_1ormore || ROL || 0x5bb7f6ae (05Oct18_16:41) || counter of AW 1ormore triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x115 || counter_aw16_mult_2ormore || ROL || 0x5bb7f6ae (05Oct18_16:41) || counter of AW 2ormore triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x116 || counter_aw16_mult_3ormore || ROL || 0x5bb7f6ae (05Oct18_16:41) || counter of AW 3ormore triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x117 || counter_aw16_mult_4ormore || ROL || 0x5bb7f6ae (05Oct18_16:41) || counter of AW 4ormore triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x118 || counter_bsc_grand_or || ROL || 0x5bc13541 (12Oct18_16:58) || counter of BSC grand-or triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x119 || counter_bsc_mult || ROL || 0x5bc13541 (12Oct18_16:58) || counter of BSC multiplicity triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x11A || counter_coinc_mult || ROL || 0x5bc13541 (12Oct18_16:58) || counter of coinidence triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x200..0x207 || conf_adc16_masks || RW || all || adc16 enable bits&lt;br /&gt;
|-&lt;br /&gt;
| 0x300..0x30F || conf_adc32_masks || RW || all || adc32 enable bits&lt;br /&gt;
|-&lt;br /&gt;
| 0x400..0x41F || sas_bits[15:0][63:0] || ROL || all || sas data bits for each link&lt;br /&gt;
|-&lt;br /&gt;
| 0x420..0x42F || sas_sd_counters[15:0] || ROL || 0x5b120c9f (01Jun18_20:18) || sas signal detect counter for each link&lt;br /&gt;
|-&lt;br /&gt;
| 0x430..0x43F || counters_adc16_or16[15:0] || ROL || 0x5b120c9f (01Jun18_20:18) || 16 counters of adc16 ORes&lt;br /&gt;
|-&lt;br /&gt;
| 0x440..0x45F || counters_adc32_or16[31:0] || ROL || 0x5b120c9f (01Jun18_20:18) || 32 counters of adc32 ORes&lt;br /&gt;
|-&lt;br /&gt;
| 0x460..0x46F || counters_adc_selected[15:0] || ROL || 0x5bb7f6ae (05Oct18_16:41) || 16 counters for selected group of adcs, see conf_counter_adc_select&lt;br /&gt;
|-&lt;br /&gt;
| 0x470..0x4AF || counters_bsc64[63:0] || ROL || 0x5bc13541 (12Oct18_16:58) || 64 counters for the BSC bars&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== conf_control bits ==&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Bit || Quartus Name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || conf_clock_select || 0x5b3aa19f (02Jul18_15:05) || select 0=internal 62.5 MHz clock or 1=esata 62.5 MHz clock&lt;br /&gt;
|-&lt;br /&gt;
| 1 || conf_enable_aw_adc16 || 0x5baedfca (28Sep18_19:13) || route AW trigger (aw16) from adc16&lt;br /&gt;
|-&lt;br /&gt;
| 2 || conf_enable_aw_adc32a || 0x5baedfca (28Sep18_19:13) || route AW trigger (aw16) from adc32 15..0&lt;br /&gt;
|-&lt;br /&gt;
| 3 || conf_enable_aw_adc32b || 0x5baedfca (28Sep18_19:13) || route AW trigger (aw16) from adc32 31..16&lt;br /&gt;
|-&lt;br /&gt;
| 15..4 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 23..16 || conf_mlu_prompt || 0x5b3aa19f (02Jul18_15:05) || MLU trigger prompt window&lt;br /&gt;
|-&lt;br /&gt;
| 31..24 || conf_mlu_wait || 0x5b3aa19f (02Jul18_15:05) || MLU trigger wait window&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== conf_mlu bits ==&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Bit || Quartus Name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 31 || mlu_reset || 0x5b3aa19f (02Jul18_15:05) || not used&lt;br /&gt;
|-&lt;br /&gt;
| 30 || mlu_write || 0x5b3aa19f (02Jul18_15:05) || 1=write data bit into given address&lt;br /&gt;
|-&lt;br /&gt;
| 16 || mlu_data || 0x5b3aa19f (02Jul18_15:05) || data bit for writing to MLU RAM&lt;br /&gt;
|-&lt;br /&gt;
| 15..0 || mlu_write_addr || 0x5b3aa19f (02Jul18_15:05) || MLU RAM write address for writing the data bit&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== conf_bsc_control bits ==&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Bit || Quartus Name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || conf_bsc_adc_a || 0x5bc13541 (12Oct18_16:58) || enable mapping of BSC ADCs to ADC links 0..7&lt;br /&gt;
|-&lt;br /&gt;
| 1 || conf_bsc_adc_b || 0x5bc13541 (12Oct18_16:58) || enable mapping of BSC ADCs to ADC links 8..15&lt;br /&gt;
|-&lt;br /&gt;
| 2 || conf_bsc64_bot_only || 0x5bc13541 (12Oct18_16:58) || bsc64 uses bottom channels only&lt;br /&gt;
|-&lt;br /&gt;
| 3 || conf_bsc64_top_only || 0x5bc13541 (12Oct18_16:58) || bsc64 uses top channels only&lt;br /&gt;
|-&lt;br /&gt;
| 4 || conf_bsc64_bot_top_or || 0x5bc13541 (12Oct18_16:58) || bsc64 uses &amp;quot;or&amp;quot; of top and bottom&lt;br /&gt;
|-&lt;br /&gt;
| 5 || conf_bsc64_bot_top_and || 0x5bc13541 (12Oct18_16:58) || bsc64 uses &amp;quot;and&amp;quot; of top and bottom&lt;br /&gt;
|-&lt;br /&gt;
| 6 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15..8 || conf_bsc64_mult || 0x5bc13541 (12Oct18_16:58) || bsc trigger fires if bsc64 multiplicity is equal or more than this value&lt;br /&gt;
|-&lt;br /&gt;
| 31..16 ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== conf_coinc_control bits ==&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Bit || Quartus Name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || conf_coinc_required[0] || 0x5bc13541 (12Oct18_16:58) || enable aw16_mult_1ormore&lt;br /&gt;
|-&lt;br /&gt;
| 1 || conf_coinc_required[1] || 0x5bc13541 (12Oct18_16:58) || enable aw16_mlu_trig&lt;br /&gt;
|-&lt;br /&gt;
| 2 || conf_coinc_required[2] || 0x5bc13541 (12Oct18_16:58) || enable bsc_grand_or_trig&lt;br /&gt;
|-&lt;br /&gt;
| 3 || conf_coinc_required[3] || 0x5bc13541 (12Oct18_16:58) || enable bsc_mult_trig&lt;br /&gt;
|-&lt;br /&gt;
| 4 || conf_coinc_required[4] || 0x5bc13541 (12Oct18_16:58) || enable esata_nim_grand_or&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15..8 || conf_coinc_window[7:0] || 0x5bc13541 (12Oct18_16:58) || coincidence window length in units of 125MHz clock (8 ns)&lt;br /&gt;
|-&lt;br /&gt;
| 23..16 || conf_coinc_start[7:0] || 0x5bc13541 (12Oct18_16:58) || start the coincidence window, same bits as &amp;quot;required&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 31..24 ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== conf_trig_enable bits ==&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Bit || Quartus Name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || conf_enable_sw_trigger || || trigger on software trigger (how generated???)&lt;br /&gt;
|-&lt;br /&gt;
| 1 || conf_enable_pulser || || trigger on pulser&lt;br /&gt;
|-&lt;br /&gt;
| 2 || conf_enable_sas_or || || obsolete&lt;br /&gt;
|-&lt;br /&gt;
| 2 || - || 0x5b120c9f (01Jun18_20:18) || not used&lt;br /&gt;
|-&lt;br /&gt;
| 3 || conf_run_pulser || || let the pulser run (frequency has to be set beforehand)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || conf_output_pulser || || enable external output of pulser signal&lt;br /&gt;
|-&lt;br /&gt;
| 5 || conf_enable_esata_nim || || trigger on ESATA and NIM grand-or (esata and nim masks should be set beforehand)&lt;br /&gt;
|-&lt;br /&gt;
| 6 || conf_enable_adc16 || || trigger on adc16 grand-or&lt;br /&gt;
|-&lt;br /&gt;
| 7 || conf_enable_adc32 || || trigger on adc32 grand-or&lt;br /&gt;
|-&lt;br /&gt;
| 8 || conf_enable_adc16_1ormore || || trigger on adc16 grand multiplicity &amp;quot;1 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 9 || conf_enable_adc16_2ormore || || same, &amp;quot;2 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || conf_enable_adc16_3ormore || || same, &amp;quot;3 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || conf_enable_adc16_4ormore || || same, &amp;quot;4 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || conf_enable_adc16_coinc || || trigger on special coincidence of adc16 links&lt;br /&gt;
|-&lt;br /&gt;
| 12 || - || 0x5b08938c (25May18_15:51) || not used&lt;br /&gt;
|-&lt;br /&gt;
| 13 || conf_enable_udp || 0x5a7a3fbd (06Feb18_15:52) || enable sending UDP packets&lt;br /&gt;
|-&lt;br /&gt;
| 14 || conf_enable_busy || 0x5a7a3fbd (06Feb18_15:52) || enable activation of busy counter&lt;br /&gt;
|-&lt;br /&gt;
| 15 || conf_enable_adc || 0x5b120c9f (01Jun18_20:18) || trigger on adc grand-or&lt;br /&gt;
|-&lt;br /&gt;
| 16 || conf_enable_aw16_coinc_a || ??? || enable AW coincidence trigger&lt;br /&gt;
|-&lt;br /&gt;
| 17 || conf_enable_aw16_coinc_b || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 18 || conf_enable_aw16_coinc_c || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || conf_enable_aw16_coinc_d || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || conf_clock_select || 0x5b2057f5 (12Jun18_16:32) || select 0=internal 62.5 MHz clock or 1=esata 62.5 MHz clock&lt;br /&gt;
|-&lt;br /&gt;
| 20 || not used || 0x5b3aa19f (02Jul18_15:05) || not used, clock select moved to the conf_control register&lt;br /&gt;
|-&lt;br /&gt;
| 21 || conf_enable_aw16_coinc || 0x5b3aa19f (02Jul18_15:05) || enable AW coincidence trigger&lt;br /&gt;
|-&lt;br /&gt;
| 22 || conf_enable_aw16_mlu || 0x5b3aa19f (02Jul18_15:05) || enable AW MLU trigger&lt;br /&gt;
|-&lt;br /&gt;
| 23 || conf_enable_timeout_trig || 0x5bc8f90f (18Oct18_14:20) || enable trigger timeout trigger&lt;br /&gt;
|-&lt;br /&gt;
| 24 || conf_enable_aw16_1ormore || 0x5b3aa19f (02Jul18_15:05) || trigger on AW preamp multiplicity &amp;quot;1 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 25 || conf_enable_aw16_2ormore || 0x5b3aa19f (02Jul18_15:05) || same, &amp;quot;2 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 26 || conf_enable_aw16_3ormore || 0x5b3aa19f (02Jul18_15:05) || same, &amp;quot;3 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 27 || conf_enable_aw16_4ormore || 0x5b3aa19f (02Jul18_15:05) || same, &amp;quot;4 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 28 || conf_enable_bsc_grand_or || 0x5bc13541 (12Oct18_16:58) || trigger on BSC grand-or&lt;br /&gt;
|-&lt;br /&gt;
| 29 || conf_enable_bsc_mult || 0x5bc13541 (12Oct18_16:58) || trigger on BSC multiplicity&lt;br /&gt;
|-&lt;br /&gt;
| 30 || conf_enable_coinc || 0x5bc13541 (12Oct18_16:58) || trigger on coincidence output&lt;br /&gt;
|-&lt;br /&gt;
| 31 ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== reg 0x2B bits ==&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Bit || Quartus Name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || reset_out || 0x5b120c9f (01Jun18_20:18) || reset counters, etc&lt;br /&gt;
|-&lt;br /&gt;
| 1 || latch_out || 0x5b120c9f (01Jun18_20:18) || latch counters, sas bits, etc&lt;br /&gt;
|-&lt;br /&gt;
| 2 || trigger_out || 0x5b120c9f (01Jun18_20:18) || generate a trigger&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UDP data format =&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Offset || Name || Quartus name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || packet counter || none || all || UDP packet counter, counting from 0, reset by reboot. Automatically added by UDP transmitter code in the GRIFC base firmware&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0x8 packet header || || all || 28 bits of counter_trig_out&lt;br /&gt;
|-&lt;br /&gt;
| 2 || trigger timestamp || trig_ts || all || 62.5MHz trigger timestamp&lt;br /&gt;
|-&lt;br /&gt;
| 3 || accepted triggers || counter_trig_out || all || counter of accepted triggers&lt;br /&gt;
|-&lt;br /&gt;
| 4 || input triggers || counter_trig_in || all || counter of trigger input&lt;br /&gt;
|-&lt;br /&gt;
| 5 || pulser triggers || counter_pulser || all || counter of pulser triggers&lt;br /&gt;
|-&lt;br /&gt;
| 6 || trigger bitmap || udp_trig_bits || 0x5a48448d (30Dec17_17:59) || bitmap of trigger information, see below&lt;br /&gt;
|-&lt;br /&gt;
| 7 || nim bits || udp_nim_bits_masked || ??? || 32 bits of ADC NIM inputs (2 bits per ADC)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || esata bits || udp_esata_bits_masked || ??? || 32 bits of ADC ESATA inputs (2 bits per ADC)&lt;br /&gt;
|-&lt;br /&gt;
| 9 || mlu bits || aw16_prompt || 0x5b398983 (01Jul18_19:10) || 16 bits of MLU input, 1 bit per preamp&lt;br /&gt;
|-&lt;br /&gt;
| 10 || drift-blank-off counter || udp_drift_counter || 0x5b3aa19f (02Jul18_15:05) || counter of triggers that passed the drift blank-off&lt;br /&gt;
|-&lt;br /&gt;
| 11 || scaledown counter || udp_scaledown_counter || 0x5b3aa19f (02Jul18_15:05) || counter of triggers that passed the scaledown&lt;br /&gt;
|-&lt;br /&gt;
| X ||  ||  ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 12 || 0x9 packet footer ||  || all || 28 bits of counter_trig_out&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== trigger bitmap ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
              udp_trig_bits[0] &amp;lt;= adc16_grand_or;&lt;br /&gt;
              udp_trig_bits[1] &amp;lt;= adc32_grand_or;&lt;br /&gt;
              udp_trig_bits[2] &amp;lt;= adc_grand_or;&lt;br /&gt;
              udp_trig_bits[3] &amp;lt;= esata_nim_grand_or;&lt;br /&gt;
              udp_trig_bits[4] &amp;lt;= adc16_coinc_top;&lt;br /&gt;
              udp_trig_bits[5] &amp;lt;= adc16_coinc_bot;&lt;br /&gt;
              udp_trig_bits[6] &amp;lt;= adc16_coinc;&lt;br /&gt;
              udp_trig_bits[7] &amp;lt;= 0;&lt;br /&gt;
              udp_trig_bits[23:8] &amp;lt;= adc16_coinc_dff[15:0];&lt;br /&gt;
              udp_trig_bits[31:24] &amp;lt;= mult16[7:0];&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Firmware 0x5b08938c (25May18_15:51)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
              udp_trig_bits[0] &amp;lt;= adc16_grand_or;&lt;br /&gt;
              udp_trig_bits[1] &amp;lt;= adc32_grand_or;&lt;br /&gt;
              udp_trig_bits[2] &amp;lt;= adc_grand_or;&lt;br /&gt;
              udp_trig_bits[3] &amp;lt;= esata_nim_grand_or;&lt;br /&gt;
              udp_trig_bits[4] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[5] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[6] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[7] &amp;lt;= 0;&lt;br /&gt;
              udp_trig_bits[23:8] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[31:24] &amp;lt;= mult16[7:0];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Firmware 0x5b217dc4 (13Jun18_13:25)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
              udp_trig_bits[0] &amp;lt;= adc16_grand_or;&lt;br /&gt;
              udp_trig_bits[1] &amp;lt;= adc32_grand_or;&lt;br /&gt;
              udp_trig_bits[2] &amp;lt;= adc_grand_or;&lt;br /&gt;
              udp_trig_bits[3] &amp;lt;= esata_nim_grand_or;&lt;br /&gt;
              udp_trig_bits[4] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[5] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[6] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[7] &amp;lt;= 0;&lt;br /&gt;
              udp_trig_bits[23:8] &amp;lt;= xadc16_or16[15:0]; // 16x AW preamps hits&lt;br /&gt;
              udp_trig_bits[31:24] &amp;lt;= xadc16_or16_mult[7:0]; // 16x AW preamp multiplicity (sum of xadc16_or16 bits)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Firmware 0x5b3aa19f (02Jul18_15:05)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
              udp_trig_bits[0] &amp;lt;= adc16_grand_or;&lt;br /&gt;
              udp_trig_bits[1] &amp;lt;= adc32_grand_or;&lt;br /&gt;
              udp_trig_bits[2] &amp;lt;= adc_grand_or;&lt;br /&gt;
              udp_trig_bits[3] &amp;lt;= esata_nim_grand_or;&lt;br /&gt;
              udp_trig_bits[4] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[5] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[6] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[7] &amp;lt;= udp_mlu_out;&lt;br /&gt;
              udp_trig_bits[23:8] &amp;lt;= xadc16_or16[15:0]; // 16x AW preamps hits&lt;br /&gt;
              udp_trig_bits[31:24] &amp;lt;= xadc16_or16_mult[7:0]; // 16x AW preamp multiplicity (sum of xadc16_or16 bits)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Firmware 0x5bc8f90f (18Oct18_14:20)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   assign trig32_in[0]  = trigger; // software trigger&lt;br /&gt;
   assign trig32_in[1]  = 0; // not used pulser trigger&lt;br /&gt;
   assign trig32_in[2]  = 0; // not used conf_enable_sas_or&lt;br /&gt;
   assign trig32_in[3]  = 0; // not used conf_run_pulser&lt;br /&gt;
   assign trig32_in[4]  = 0; // not used conf_output_pulser&lt;br /&gt;
   assign trig32_in[5]  = esata_nim_grand_or;&lt;br /&gt;
   assign trig32_in[6]  = adc16_grand_or;&lt;br /&gt;
   assign trig32_in[7]  = adc32_grand_or;&lt;br /&gt;
   assign trig32_in[8]  = adc16_mult_1ormore;&lt;br /&gt;
   assign trig32_in[9]  = adc16_mult_2ormore;&lt;br /&gt;
   assign trig32_in[10] = adc16_mult_3ormore;&lt;br /&gt;
   assign trig32_in[11] = adc16_mult_4ormore;&lt;br /&gt;
   assign trig32_in[12] = 0; // not used conf_enable_adc16_coinc&lt;br /&gt;
   assign trig32_in[13] = 0; // not used conf_enable_udp&lt;br /&gt;
   assign trig32_in[14] = 0; // not used conf_enable_busy&lt;br /&gt;
   assign trig32_in[15] = adc_grand_or;&lt;br /&gt;
   assign trig32_in[16] = aw16_coinc_a;&lt;br /&gt;
   assign trig32_in[17] = aw16_coinc_b;&lt;br /&gt;
   assign trig32_in[18] = aw16_coinc_c;&lt;br /&gt;
   assign trig32_in[19] = aw16_coinc_d;&lt;br /&gt;
   assign trig32_in[20] = 0; // not used conf_clock_select&lt;br /&gt;
   assign trig32_in[21] = aw16_coinc_trig;&lt;br /&gt;
   assign trig32_in[22] = aw16_mlu_trig;&lt;br /&gt;
   assign trig32_in[23] = timeout_trig;&lt;br /&gt;
   assign trig32_in[24] = aw16_mult_1ormore;&lt;br /&gt;
   assign trig32_in[25] = aw16_mult_2ormore;&lt;br /&gt;
   assign trig32_in[26] = aw16_mult_3ormore;&lt;br /&gt;
   assign trig32_in[27] = aw16_mult_4ormore;&lt;br /&gt;
   assign trig32_in[28] = bsc_grand_or_trig;&lt;br /&gt;
   assign trig32_in[29] = bsc_mult_trig;&lt;br /&gt;
   assign trig32_in[30] = coinc_trig;&lt;br /&gt;
   assign trig32_in[31] = 0; // not used&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= TODO =&lt;br /&gt;
&lt;br /&gt;
* add FwRev to the UDP data output&lt;br /&gt;
* fix &amp;quot;write did not happen&amp;quot; (send udp write command, there is no reply, read returns old data as if write never happened). suspect udp &amp;quot;write&amp;quot; packet is lost?&lt;br /&gt;
* fix reply to wrong socket - udp packets should reply to same socket as they came from, udp data packets should be sent to same socket as requested them, not same socket as last command.&lt;br /&gt;
* add fixes from Chris P. for the auto-negotiation and dhcp (see email from him).&lt;br /&gt;
* speed up programming the MLU by writing more than 1 bit at a time&lt;br /&gt;
&lt;br /&gt;
= End =&lt;br /&gt;
&lt;br /&gt;
//KO&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=TRG&amp;diff=645</id>
		<title>TRG</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=TRG&amp;diff=645"/>
		<updated>2021-02-09T22:50:54Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= TRG, the trigger control board for the ALPHA-g detector =&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
* xxx&lt;br /&gt;
* https://bitbucket.org/expalpha/alphat_firmware - firmware sources on bitbucket&lt;br /&gt;
&lt;br /&gt;
= General characteristics =&lt;br /&gt;
&lt;br /&gt;
== Photos ==&lt;br /&gt;
&lt;br /&gt;
== Board schematics ==&lt;br /&gt;
&lt;br /&gt;
== Available hardware ==&lt;br /&gt;
&lt;br /&gt;
= ALPHA-T front panel connections =&lt;br /&gt;
&lt;br /&gt;
From top to bottom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
| minisas-C - links 8-11&lt;br /&gt;
| minisas-D - links 12-15&lt;br /&gt;
|&lt;br /&gt;
| ethernet sfp - use copper sfp only&lt;br /&gt;
| minisas - not used, do not connect&lt;br /&gt;
| esata - clock in, trigger out&lt;br /&gt;
|&lt;br /&gt;
| minisas-A - links 0-3&lt;br /&gt;
| minisas-B - links 4-7&lt;br /&gt;
|&lt;br /&gt;
| LEDs&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MiniSAS and SATA flail cable connections:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
P1 &amp;lt;--&amp;gt; link 3&lt;br /&gt;
P2 &amp;lt;--&amp;gt; link 2&lt;br /&gt;
P3 &amp;lt;--&amp;gt; link 1&lt;br /&gt;
P4 &amp;lt;--&amp;gt; link 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
LEDs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--PCB-- (left)&lt;br /&gt;
LED[0] - trigger out - ag_trig_out&lt;br /&gt;
LED[1] - network packet received - sfp_rx_data_valid&lt;br /&gt;
LED[2] - Xilinx FPGA boot ok - FMC1_CFG_DONE&lt;br /&gt;
LED[3] - not used&lt;br /&gt;
(right)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ALPHA-T onboard jumpers and switches =&lt;br /&gt;
&lt;br /&gt;
* rotary switches: select IP address: 00=192.168.1.50, 11=.51, 22=.52, 33=.53, 44=.54, otherwire=.251&lt;br /&gt;
&lt;br /&gt;
= Firmware update procedure =&lt;br /&gt;
&lt;br /&gt;
* use quartus to generate the grifc.pof file (use grifc.cof)&lt;br /&gt;
* open quartus programmer&lt;br /&gt;
* attach grifc.pof to the 1st CFI_512 flash&lt;br /&gt;
* mark program/configure for the same flash (3 marks: pof, page_0 and OPTION_BITS&lt;br /&gt;
* check that &amp;quot;initiate configuration after programming&amp;quot; is set in tools-&amp;gt;options&lt;br /&gt;
* say &amp;quot;start&amp;quot;&lt;br /&gt;
* should take about 5 minutes&lt;br /&gt;
* grifc should reboot into the new firmware&lt;br /&gt;
&lt;br /&gt;
If CFI_512 flash is not visible to the quartus programmer, load correct&lt;br /&gt;
code into the MaxV CPLD:&lt;br /&gt;
&lt;br /&gt;
* open quartus programmer,&lt;br /&gt;
* say &amp;quot;auto detect&amp;quot;&lt;br /&gt;
* change file for the 5M2210 device&lt;br /&gt;
* use .../boot/maxv_3xfmc_normal.pof from the firmware git repository&lt;br /&gt;
* say &amp;quot;program&amp;quot;, it should finish in 10-15 seconds&lt;br /&gt;
* say &amp;quot;auto detect&amp;quot;&lt;br /&gt;
* CFI_512 flash should be visible now.&lt;br /&gt;
&lt;br /&gt;
= Firmware revisions =&lt;br /&gt;
&lt;br /&gt;
= Firmware build =&lt;br /&gt;
&lt;br /&gt;
* use quartus 17.1&lt;br /&gt;
&lt;br /&gt;
= ALPHA-g trigger functions =&lt;br /&gt;
&lt;br /&gt;
Trigger modes:&lt;br /&gt;
* software trigger&lt;br /&gt;
* pulser trigger&lt;br /&gt;
* trigger on GRIF16 ADC NIM and ESATA inputs (&amp;quot;external trigger&amp;quot;)&lt;br /&gt;
* adc16 grand-or&lt;br /&gt;
* adc32 grand-or&lt;br /&gt;
* adc16 wire multiplicity&lt;br /&gt;
* TPC anode wire per-preamp trigger (aw16 section)&lt;br /&gt;
** trigger on coincidences of preamps&lt;br /&gt;
** trigger on multiplicity of preamps&lt;br /&gt;
** trigger on specific topology of preamps (multiplicity of preamp clusters, etc) via the aw16_mlu trigger&lt;br /&gt;
* BSC trigger&lt;br /&gt;
** BSC grand_or&lt;br /&gt;
** BSC bar multiplicity&lt;br /&gt;
* coincidence trigger - coincidence of external, TPC AW and BSC triggers&lt;br /&gt;
&lt;br /&gt;
== software trigger ==&lt;br /&gt;
&lt;br /&gt;
to programmatically fire the trigger, one should:&lt;br /&gt;
* set the conf_enable_sw_trigger bit in conf_trig_enable, this will permit the software trigger to fire the trigger&lt;br /&gt;
* write value 0x4 to register 0x2B, this will cause the trigger to fire&lt;br /&gt;
&lt;br /&gt;
== pulser trigger ==&lt;br /&gt;
&lt;br /&gt;
To use the pulser trigger, one should program:&lt;br /&gt;
* pulser period (in clocks)&lt;br /&gt;
* pulser width (in clocks, use value 5, the pulser no longer goes outside of the trigger board, so changing the width does not do anything)&lt;br /&gt;
* set the run_pulser bit in conf_trig_enable, this will cause the pulser to run&lt;br /&gt;
* set the enable_pulser bit in conf_trig_enable, this will cause the pulser to fire the trigger&lt;br /&gt;
* set the output_pulser bit in conf_trig_enable, this will cause the pulser to be output from the alphag firmware block (the pulser no longer goes outside of the trigger board, so changing the bit does not do anything)&lt;br /&gt;
&lt;br /&gt;
== timeout trigger ==&lt;br /&gt;
&lt;br /&gt;
The event builder uses event timestamps to assemble physics events. The timestamps&lt;br /&gt;
are usually 32 bit wide and run at 125 MHz (8 ns) or 62.5 MHz (16 ns). If&lt;br /&gt;
triggers are generated often (1 per second or more), timestamp wrap around&lt;br /&gt;
is easily detected by the event builder. If triggers come infrequently,&lt;br /&gt;
timestamp wrap around may occur while there are no triggers, not be seen&lt;br /&gt;
by the event builder causing loss of event synchronization.&lt;br /&gt;
&lt;br /&gt;
To avoid this problem in the event builder, a timeout trigger is generated&lt;br /&gt;
if no triggers were generated inside a 10 second interval.&lt;br /&gt;
&lt;br /&gt;
The guaranties that even if all physics triggers temporarily stop for any reason,&lt;br /&gt;
the event builder will stay synchronized. (0.1 Hz timeout trigger frequency).&lt;br /&gt;
&lt;br /&gt;
== adc16 multiplicity trigger ==&lt;br /&gt;
&lt;br /&gt;
This trigger is intended for use with the barrel scintillator signals connected to adc16 digitizers. It does not work well with TPC AW signals.&lt;br /&gt;
&lt;br /&gt;
The 16 adc16 trigger bits (16x16=256) are added together to form the hit multiplicity value (adc16_mult, 16 bits, actual range 0 to 256).&lt;br /&gt;
&lt;br /&gt;
Four threshold signals are computed: adc16_mult_1ormore = adc16_mult&amp;gt;=1, 2ormore, 3ormore, 4ormore.&lt;br /&gt;
&lt;br /&gt;
There is a counter for each of these four signals.&lt;br /&gt;
&lt;br /&gt;
Each of these four signals can fire the trigger, see conf_trig_enable bits.&lt;br /&gt;
&lt;br /&gt;
== TPC anode wire triggers ==&lt;br /&gt;
&lt;br /&gt;
TBW: mapping of adc16 and adc32 into aw16[15:0] signals&lt;br /&gt;
&lt;br /&gt;
=== aw16_grand_or ===&lt;br /&gt;
&lt;br /&gt;
TPC AW &amp;quot;grand or&amp;quot; trigger: use aw16_mult_1ormore&lt;br /&gt;
&lt;br /&gt;
=== aw16_mult ===&lt;br /&gt;
&lt;br /&gt;
TPC AW preamp multiplicity trigger: counts how many preamps&lt;br /&gt;
have hits, fires:&lt;br /&gt;
* aw16_mult_1ormore (same as aw16_grand_or)&lt;br /&gt;
* aw16_mult_2ormore&lt;br /&gt;
* aw16_mult_3ormore&lt;br /&gt;
* aw16_mult_4ormore&lt;br /&gt;
&lt;br /&gt;
(256 anode wires, 16 wires per preamp, 16 preamps, 16 aw16 signals)&lt;br /&gt;
&lt;br /&gt;
=== aw16_coinc ===&lt;br /&gt;
&lt;br /&gt;
TBW: TPC AW preamp coincidence trigger&lt;br /&gt;
&lt;br /&gt;
=== aw16_mlu ===&lt;br /&gt;
&lt;br /&gt;
TPC AW preamp MLU trigger: the MLU (memory lookup&lt;br /&gt;
table) implements an arbitrary logical function&lt;br /&gt;
to map the 16 aw16 preamp signals into 1 aw16_mlu_trig trigger output.&lt;br /&gt;
&lt;br /&gt;
Description of the aw16 mlu trigger.&lt;br /&gt;
&lt;br /&gt;
In words:&lt;br /&gt;
&lt;br /&gt;
* any aw16 signal starts the aw16_prompt_run gate&lt;br /&gt;
* aw16 signals are collected for the duration of conf_mlu_prompt (125MHz/8ns clock)&lt;br /&gt;
* this corresponds to time spread of TPC AW signals due to the drift time in the AW drift cell and to the variation in signal transmission time from the ADC to the TRG (digital trigger data link).&lt;br /&gt;
* when this prompt time expires, the MLU looks at the accumulated aw16_prompt bit pattern and makes the &amp;quot;yes/no&amp;quot; trigger decision&lt;br /&gt;
* after the trigger decision is made, we wait for the TPC to become quiet, meaning there is no aw16 signals for the duration of the aw16_prompt_wait gate (conf_mlu_wait), if any signals arrive during the gate, they restart the gate.&lt;br /&gt;
* after the TPC has been quiet for conf_mlu_wait time (125MHz/8ns clock), the MLU trigger is ready for the next event.&lt;br /&gt;
&lt;br /&gt;
In logic: (see alphag.v)&lt;br /&gt;
&lt;br /&gt;
* aw16_or &amp;lt;= grand-or of 16 aw16 signals&lt;br /&gt;
* &amp;quot;aw16_or&amp;quot; starts the &amp;quot;aw16_prompt_cnt&amp;quot; counter, opens the aw16_prompt_run gate&lt;br /&gt;
* during the aw16_prompt_run gate, aw16_prompt collects (latches) the aw16 bits (aw16_prompt &amp;lt;= aw16_prompt | aw16)&lt;br /&gt;
* this is the time when we wait for all &amp;quot;prompt&amp;quot; signals from the TPC to arrive into the trigger&lt;br /&gt;
* at the end of the aw16_prompt_run gate, the signal aw16_prompt_out is pulsed, latching the output of the MLU into aw16_mlu_trig&lt;br /&gt;
* this is the MLU trigger &amp;quot;yes/no&amp;quot; trigger decision.&lt;br /&gt;
* after the MLU trigger decision is made, we wait for the arrival and passing of all TPC drift signals&lt;br /&gt;
* the aw16_prompt_wait_cnt and aw_prompt_wait gate opens&lt;br /&gt;
* if any new aw16 signals arrive (they are TPC drift signals at this time), the aw16_prompt_wait gate is restarted&lt;br /&gt;
* if no aw16 signals arrive during the full run of the aw16_prompt_wait gate (&amp;quot;TPC quiet time&amp;quot;)&lt;br /&gt;
* the aw16_prompt_wait and aw16_prompt gates are cleared and the MLU trigger is ready for the next event.&lt;br /&gt;
&lt;br /&gt;
== BSC trigger ==&lt;br /&gt;
&lt;br /&gt;
TBW&lt;br /&gt;
&lt;br /&gt;
== Coincidence trigger ==&lt;br /&gt;
&lt;br /&gt;
Coincidence trigger inputs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   assign coinc_input[0] = aw16_mult_1ormore;&lt;br /&gt;
   assign coinc_input[1] = aw16_mlu_trig;&lt;br /&gt;
   assign coinc_input[2] = bsc_grand_or_trig;&lt;br /&gt;
   assign coinc_input[3] = bsc_mult_trig;&lt;br /&gt;
   assign coinc_input[4] = esata_nim_grand_or;&lt;br /&gt;
   assign coinc_input[5] = 0;&lt;br /&gt;
   assign coinc_input[6] = 0;&lt;br /&gt;
   assign coinc_input[7] = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Coincidence trigger &amp;quot;start&amp;quot; mask selects which of the inputs can start the coincidence window.&lt;br /&gt;
&lt;br /&gt;
Coincidence trigger &amp;quot;require&amp;quot; mask selects which inputs must have a hits for the coincidence ot be satisfied.&lt;br /&gt;
&lt;br /&gt;
Input hits are collected for the duration of the coincidence window, if all required inputs have hits, coinc_trig is fired.&lt;br /&gt;
&lt;br /&gt;
Example settings:&lt;br /&gt;
&lt;br /&gt;
* coincidence of external scintillator, BSC and TPC AW &amp;quot;grand or&amp;quot; signals: start 0x10, required 0x15&lt;br /&gt;
* coincidence of BSC and TPC AW &amp;quot;grand or&amp;quot; signals: start 0x4, required 0x5&lt;br /&gt;
* coincidence of BSC and TPC AW MLU triggers: start 0x4, required 0x6&lt;br /&gt;
* coincidence of BSC multiplicity and TPC AW MLU triggers: start 0x8, required 0xA&lt;br /&gt;
&lt;br /&gt;
= Control registers =&lt;br /&gt;
&lt;br /&gt;
== Register addresses ==&lt;br /&gt;
&lt;br /&gt;
Note: all registers are 32 bits unless otherwise noted.&lt;br /&gt;
&lt;br /&gt;
Note: RW means read-write register, RO means read-only, ROL means read-only, contents is latched by the &amp;quot;latch_out&amp;quot; bit&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Address || Quartus Name || Access || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || num_sample || RW || GRIF-C || magic register to control UDP packet size&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F || compilation_time || RO || || Firmware revision&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || conf_trig_width     &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || conf_busy_width     &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || conf_pulser_width   &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x23 || conf_pulser_period   &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || sw_trigger_counter &amp;lt;= 10;&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || - || || 0x5b120c9f (01Jun18_20:18) || not used&lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || conf_trig_enable   &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || conf_sas_trig_mask &amp;lt;= par_value; || obsolete&lt;br /&gt;
|-&lt;br /&gt;
| 0x27 || conf_sas_trig_mask_a &amp;lt;= par_value; || obsolete&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || conf_sas_trig_mask_b &amp;lt;= par_value; || obsolete&lt;br /&gt;
|-&lt;br /&gt;
| 0x29 || conf_nim_mask &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || conf_esata_mask &amp;lt;= par_value;&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B || reset_out, latch_out, trigger_out || pulsed || 0x5b120c9f (01Jun18_20:18) || see reg 0x2B bits&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || conf_aw16_coinc_a || RW || ??? || configure AW coincidence trigger&lt;br /&gt;
|-&lt;br /&gt;
| 0x2D || conf_aw16_coinc_b || RW || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || conf_aw16_coinc_c || RW || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F || conf_aw16_coinc_d || RW || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || sas_sd[15:0] || ROL || 0x5b120c9f (01Jun18_20:18) || sas signal detect for each link&lt;br /&gt;
|-&lt;br /&gt;
| 0x31 || pll_625_status || ROL || 0x5b2057f5 (12Jun18_16:32) || 62.5MHz PLL status, bits: 31=locked, 30=active clock, 29=esata_clk_bad, 28=clk625_bad, 27:0 not used, to be lock counter&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || clk_counter || ROL || 0x5b2057f5 (12Jun18_16:32) || frequency counter of the system 125 MHz clock&lt;br /&gt;
|-&lt;br /&gt;
| 0x33 || clk_625_counter || ROL || 0x5b2057f5 (12Jun18_16:32) || frequency counter of the currently selected 62.5 MHz clock (my_clk_625)&lt;br /&gt;
|-&lt;br /&gt;
| 0x34 || conf_control || RW || 0x5b398983 (01Jul18_19:10) || see conf_control bits below&lt;br /&gt;
|-&lt;br /&gt;
| 0x35 || conf_drift_width || RW || 0x5b398983 (01Jul18_19:10) || width of drift time blank-out in 62.5MHz clocks&lt;br /&gt;
|-&lt;br /&gt;
| 0x36 || conf_scaledown || RW || 0x5b398983 (01Jul18_19:10) || trigger scaledown, 0=no scaledown, 1=divide-by-2, 2=divide-by-3, etc&lt;br /&gt;
|-&lt;br /&gt;
| 0x37 || conf_mlu || RW || 0x5b398983 (01Jul18_19:10) || aw trigger mlu control&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || conf_trig_delay || RW || 0x5baedfca (28Sep18_19:13) || delay the trigger pulse&lt;br /&gt;
|-&lt;br /&gt;
| 0x39 || esata_clk_counter || ROL || 0x5baedfca (28Sep18_19:13) || frequency counter of the system 125 MHz clock&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A || esata_clk_esata_counter || ROL || 0x5baedfca (28Sep18_19:13) || requency counter of the external clock (eSATA clock)&lt;br /&gt;
|-&lt;br /&gt;
| 0x3B || conf_counter_adc_select || RW || 0x5bb7f6ae (05Oct18_16:41) || select which 16 ADCs are connected to the selected adc counters, 0..15 - connect the adc16 signals, 16..47 connect the adc32 signals&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C || sysreset_ts || RO || 0x5bb7f6ae (05Oct18_16:41) || 125MHz counter of VME-SYSRESET active state&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D || GRIF-C csr || RW || GRIF-C || &amp;lt;= csr &amp;amp; ~par_value; // Selective clear&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E || GRIF-C csr || RW || GRIF-C || &amp;lt;= csr |  par_value; // Selective set&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F || GRIF-C csr || RW || GRIF-C || &amp;lt;= par_value; // write&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || conf_bsc_control || RW || 0x5bc13541 (12Oct18_16:58) || Barrel Scintillator trigger control&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || conf_coinc_control || RW || 0x5bc13541 (12Oct18_16:58) || Coincidence trigger control&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || reconfig_out || WO || 0x5bc13541 (12Oct18_16:58) || reserved for rebooting the FPGA (does not work)&lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || conf_trigger_timeout || RW || 0x5bc8f90f (18Oct18_14:20) || Trigger timeout in 125MHz clocks (8ns)&lt;br /&gt;
|-&lt;br /&gt;
| 0x100 || ts_625 || ROL || || latched timestamp&lt;br /&gt;
|-&lt;br /&gt;
| 0x101 || counter_trig_out || ROL || || counter of issued triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x102 || counter_trig_in || ROL || || counter of triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x103 || counter_pulser || ROL || || counter of pulser&lt;br /&gt;
|-&lt;br /&gt;
| 0x104 || counter_adc16_grand_or || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x105 || counter_adc32_grand_or || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x106 || counter_adc_grand_or || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x107 || counter_esata_nim_grand_or || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x108 || counter_adc16_mult_1ormore || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x109 || counter_adc16_mult_2ormore || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10A || counter_adc16_mult_3ormore || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10B || counter_adc16_mult_4ormore || ROL ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10C || counter_aw16_coinc_a || ROL || ??? || counter of AW coincidence triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x10D || counter_aw16_coinc_b || ROL || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10E || counter_aw16_coinc_c || ROL || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x10F || counter_aw16_coinc_d || ROL || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x110 || counter_drift || ROL || 0x5b398983 (01Jul18_19:10) || counter of triggers that passed the drift time blank-out&lt;br /&gt;
|-&lt;br /&gt;
| 0x111 || counter_scaledown || ROL || 0x5b398983 (01Jul18_19:10) || counter of triggers that passed the scaledown&lt;br /&gt;
|-&lt;br /&gt;
| 0x112 || counter_aw16_coinc || ROL || 0x5b398983 (01Jul18_19:10) || counter of AW coincidence triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x113 || counter_aw16_mlu || ROL || 0x5b398983 (01Jul18_19:10) || counter of AW MLU triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x114 || counter_aw16_mult_1ormore || ROL || 0x5bb7f6ae (05Oct18_16:41) || counter of AW 1ormore triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x115 || counter_aw16_mult_2ormore || ROL || 0x5bb7f6ae (05Oct18_16:41) || counter of AW 2ormore triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x116 || counter_aw16_mult_3ormore || ROL || 0x5bb7f6ae (05Oct18_16:41) || counter of AW 3ormore triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x117 || counter_aw16_mult_4ormore || ROL || 0x5bb7f6ae (05Oct18_16:41) || counter of AW 4ormore triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x118 || counter_bsc_grand_or || ROL || 0x5bc13541 (12Oct18_16:58) || counter of BSC grand-or triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x119 || counter_bsc_mult || ROL || 0x5bc13541 (12Oct18_16:58) || counter of BSC multiplicity triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x11A || counter_coinc_mult || ROL || 0x5bc13541 (12Oct18_16:58) || counter of coinidence triggers&lt;br /&gt;
|-&lt;br /&gt;
| 0x200..0x207 || conf_adc16_masks || RW || all || adc16 enable bits&lt;br /&gt;
|-&lt;br /&gt;
| 0x300..0x30F || conf_adc32_masks || RW || all || adc32 enable bits&lt;br /&gt;
|-&lt;br /&gt;
| 0x400..0x41F || sas_bits[15:0][63:0] || ROL || all || sas data bits for each link&lt;br /&gt;
|-&lt;br /&gt;
| 0x420..0x42F || sas_sd_counters[15:0] || ROL || 0x5b120c9f (01Jun18_20:18) || sas signal detect counter for each link&lt;br /&gt;
|-&lt;br /&gt;
| 0x430..0x43F || counters_adc16_or16[15:0] || ROL || 0x5b120c9f (01Jun18_20:18) || 16 counters of adc16 ORes&lt;br /&gt;
|-&lt;br /&gt;
| 0x440..0x45F || counters_adc32_or16[31:0] || ROL || 0x5b120c9f (01Jun18_20:18) || 32 counters of adc32 ORes&lt;br /&gt;
|-&lt;br /&gt;
| 0x460..0x46F || counters_adc_selected[15:0] || ROL || 0x5bb7f6ae (05Oct18_16:41) || 16 counters for selected group of adcs, see conf_counter_adc_select&lt;br /&gt;
|-&lt;br /&gt;
| 0x470..0x4AF || counters_bsc64[63:0] || ROL || 0x5bc13541 (12Oct18_16:58) || 64 counters for the BSC bars&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== conf_control bits ==&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Bit || Quartus Name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || conf_clock_select || 0x5b3aa19f (02Jul18_15:05) || select 0=internal 62.5 MHz clock or 1=esata 62.5 MHz clock&lt;br /&gt;
|-&lt;br /&gt;
| 1 || conf_enable_aw_adc16 || 0x5baedfca (28Sep18_19:13) || route AW trigger (aw16) from adc16&lt;br /&gt;
|-&lt;br /&gt;
| 2 || conf_enable_aw_adc32a || 0x5baedfca (28Sep18_19:13) || route AW trigger (aw16) from adc32 15..0&lt;br /&gt;
|-&lt;br /&gt;
| 3 || conf_enable_aw_adc32b || 0x5baedfca (28Sep18_19:13) || route AW trigger (aw16) from adc32 31..16&lt;br /&gt;
|-&lt;br /&gt;
| 15..4 || || ||&lt;br /&gt;
|-&lt;br /&gt;
| 23..16 || conf_mlu_prompt || 0x5b3aa19f (02Jul18_15:05) || MLU trigger prompt window&lt;br /&gt;
|-&lt;br /&gt;
| 31..24 || conf_mlu_wait || 0x5b3aa19f (02Jul18_15:05) || MLU trigger wait window&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== conf_mlu bits ==&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Bit || Quartus Name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 31 || mlu_reset || 0x5b3aa19f (02Jul18_15:05) || not used&lt;br /&gt;
|-&lt;br /&gt;
| 30 || mlu_write || 0x5b3aa19f (02Jul18_15:05) || 1=write data bit into given address&lt;br /&gt;
|-&lt;br /&gt;
| 16 || mlu_data || 0x5b3aa19f (02Jul18_15:05) || data bit for writing to MLU RAM&lt;br /&gt;
|-&lt;br /&gt;
| 15..0 || mlu_write_addr || 0x5b3aa19f (02Jul18_15:05) || MLU RAM write address for writing the data bit&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== conf_bsc_control bits ==&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Bit || Quartus Name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || conf_bsc_adc_a || 0x5bc13541 (12Oct18_16:58) || enable mapping of BSC ADCs to ADC links 0..7&lt;br /&gt;
|-&lt;br /&gt;
| 1 || conf_bsc_adc_b || 0x5bc13541 (12Oct18_16:58) || enable mapping of BSC ADCs to ADC links 8..15&lt;br /&gt;
|-&lt;br /&gt;
| 2 || conf_bsc64_bot_only || 0x5bc13541 (12Oct18_16:58) || bsc64 uses bottom channels only&lt;br /&gt;
|-&lt;br /&gt;
| 3 || conf_bsc64_top_only || 0x5bc13541 (12Oct18_16:58) || bsc64 uses top channels only&lt;br /&gt;
|-&lt;br /&gt;
| 4 || conf_bsc64_bot_top_or || 0x5bc13541 (12Oct18_16:58) || bsc64 uses &amp;quot;or&amp;quot; of top and bottom&lt;br /&gt;
|-&lt;br /&gt;
| 5 || conf_bsc64_bot_top_and || 0x5bc13541 (12Oct18_16:58) || bsc64 uses &amp;quot;and&amp;quot; of top and bottom&lt;br /&gt;
|-&lt;br /&gt;
| 6 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15..8 || conf_bsc64_mult || 0x5bc13541 (12Oct18_16:58) || bsc trigger fires if bsc64 multiplicity is equal or more than this value&lt;br /&gt;
|-&lt;br /&gt;
| 31..16 ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== conf_coinc_control bits ==&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Bit || Quartus Name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || conf_coinc_required[0] || 0x5bc13541 (12Oct18_16:58) || enable aw16_mult_1ormore&lt;br /&gt;
|-&lt;br /&gt;
| 1 || conf_coinc_required[1] || 0x5bc13541 (12Oct18_16:58) || enable aw16_mlu_trig&lt;br /&gt;
|-&lt;br /&gt;
| 2 || conf_coinc_required[2] || 0x5bc13541 (12Oct18_16:58) || enable bsc_grand_or_trig&lt;br /&gt;
|-&lt;br /&gt;
| 3 || conf_coinc_required[3] || 0x5bc13541 (12Oct18_16:58) || enable bsc_mult_trig&lt;br /&gt;
|-&lt;br /&gt;
| 4 || conf_coinc_required[4] || 0x5bc13541 (12Oct18_16:58) || enable esata_nim_grand_or&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15..8 || conf_coinc_window[7:0] || 0x5bc13541 (12Oct18_16:58) || coincidence window length in units of 125MHz clock (8 ns)&lt;br /&gt;
|-&lt;br /&gt;
| 23..16 || conf_coinc_start[7:0] || 0x5bc13541 (12Oct18_16:58) || start the coincidence window, same bits as &amp;quot;required&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 31..24 ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== conf_trig_enable bits ==&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Bit || Quartus Name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || conf_enable_sw_trigger || || trigger on software trigger (how generated???)&lt;br /&gt;
|-&lt;br /&gt;
| 1 || conf_enable_pulser || || trigger on pulser&lt;br /&gt;
|-&lt;br /&gt;
| 2 || conf_enable_sas_or || || obsolete&lt;br /&gt;
|-&lt;br /&gt;
| 2 || - || 0x5b120c9f (01Jun18_20:18) || not used&lt;br /&gt;
|-&lt;br /&gt;
| 3 || conf_run_pulser || || let the pulser run (frequency has to be set beforehand)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || conf_output_pulser || || enable external output of pulser signal&lt;br /&gt;
|-&lt;br /&gt;
| 5 || conf_enable_esata_nim || || trigger on ESATA and NIM grand-or (esata and nim masks should be set beforehand)&lt;br /&gt;
|-&lt;br /&gt;
| 6 || conf_enable_adc16 || || trigger on adc16 grand-or&lt;br /&gt;
|-&lt;br /&gt;
| 7 || conf_enable_adc32 || || trigger on adc32 grand-or&lt;br /&gt;
|-&lt;br /&gt;
| 8 || conf_enable_adc16_1ormore || || trigger on adc16 grand multiplicity &amp;quot;1 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 9 || conf_enable_adc16_2ormore || || same, &amp;quot;2 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || conf_enable_adc16_3ormore || || same, &amp;quot;3 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || conf_enable_adc16_4ormore || || same, &amp;quot;4 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || conf_enable_adc16_coinc || || trigger on special coincidence of adc16 links&lt;br /&gt;
|-&lt;br /&gt;
| 12 || - || 0x5b08938c (25May18_15:51) || not used&lt;br /&gt;
|-&lt;br /&gt;
| 13 || conf_enable_udp || 0x5a7a3fbd (06Feb18_15:52) || enable sending UDP packets&lt;br /&gt;
|-&lt;br /&gt;
| 14 || conf_enable_busy || 0x5a7a3fbd (06Feb18_15:52) || enable activation of busy counter&lt;br /&gt;
|-&lt;br /&gt;
| 15 || conf_enable_adc || 0x5b120c9f (01Jun18_20:18) || trigger on adc grand-or&lt;br /&gt;
|-&lt;br /&gt;
| 16 || conf_enable_aw16_coinc_a || ??? || enable AW coincidence trigger&lt;br /&gt;
|-&lt;br /&gt;
| 17 || conf_enable_aw16_coinc_b || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 18 || conf_enable_aw16_coinc_c || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 19 || conf_enable_aw16_coinc_d || ??? ||&lt;br /&gt;
|-&lt;br /&gt;
| 20 || conf_clock_select || 0x5b2057f5 (12Jun18_16:32) || select 0=internal 62.5 MHz clock or 1=esata 62.5 MHz clock&lt;br /&gt;
|-&lt;br /&gt;
| 20 || not used || 0x5b3aa19f (02Jul18_15:05) || not used, clock select moved to the conf_control register&lt;br /&gt;
|-&lt;br /&gt;
| 21 || conf_enable_aw16_coinc || 0x5b3aa19f (02Jul18_15:05) || enable AW coincidence trigger&lt;br /&gt;
|-&lt;br /&gt;
| 22 || conf_enable_aw16_mlu || 0x5b3aa19f (02Jul18_15:05) || enable AW MLU trigger&lt;br /&gt;
|-&lt;br /&gt;
| 23 || conf_enable_timeout_trig || 0x5bc8f90f (18Oct18_14:20) || enable trigger timeout trigger&lt;br /&gt;
|-&lt;br /&gt;
| 24 || conf_enable_aw16_1ormore || 0x5b3aa19f (02Jul18_15:05) || trigger on AW preamp multiplicity &amp;quot;1 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 25 || conf_enable_aw16_2ormore || 0x5b3aa19f (02Jul18_15:05) || same, &amp;quot;2 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 26 || conf_enable_aw16_3ormore || 0x5b3aa19f (02Jul18_15:05) || same, &amp;quot;3 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 27 || conf_enable_aw16_4ormore || 0x5b3aa19f (02Jul18_15:05) || same, &amp;quot;4 or more&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 28 || conf_enable_bsc_grand_or || 0x5bc13541 (12Oct18_16:58) || trigger on BSC grand-or&lt;br /&gt;
|-&lt;br /&gt;
| 29 || conf_enable_bsc_mult || 0x5bc13541 (12Oct18_16:58) || trigger on BSC multiplicity&lt;br /&gt;
|-&lt;br /&gt;
| 30 || conf_enable_coinc || 0x5bc13541 (12Oct18_16:58) || trigger on coincidence output&lt;br /&gt;
|-&lt;br /&gt;
| 31 ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== reg 0x2B bits ==&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Bit || Quartus Name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || reset_out || 0x5b120c9f (01Jun18_20:18) || reset counters, etc&lt;br /&gt;
|-&lt;br /&gt;
| 1 || latch_out || 0x5b120c9f (01Jun18_20:18) || latch counters, sas bits, etc&lt;br /&gt;
|-&lt;br /&gt;
| 2 || trigger_out || 0x5b120c9f (01Jun18_20:18) || generate a trigger&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UDP data format =&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Offset || Name || Quartus name || FwRev || Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || packet counter || none || all || UDP packet counter, counting from 0, reset by reboot. Automatically added by UDP transmitter code in the GRIFC base firmware&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0x8 packet header || || all || 28 bits of counter_trig_out&lt;br /&gt;
|-&lt;br /&gt;
| 2 || trigger timestamp || trig_ts || all || 62.5MHz trigger timestamp&lt;br /&gt;
|-&lt;br /&gt;
| 3 || accepted triggers || counter_trig_out || all || counter of accepted triggers&lt;br /&gt;
|-&lt;br /&gt;
| 4 || input triggers || counter_trig_in || all || counter of trigger input&lt;br /&gt;
|-&lt;br /&gt;
| 5 || pulser triggers || counter_pulser || all || counter of pulser triggers&lt;br /&gt;
|-&lt;br /&gt;
| 6 || trigger bitmap || udp_trig_bits || 0x5a48448d (30Dec17_17:59) || bitmap of trigger information, see below&lt;br /&gt;
|-&lt;br /&gt;
| 7 || nim bits || udp_nim_bits_masked || ??? || 32 bits of ADC NIM inputs (2 bits per ADC)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || esata bits || udp_esata_bits_masked || ??? || 32 bits of ADC ESATA inputs (2 bits per ADC)&lt;br /&gt;
|-&lt;br /&gt;
| 9 || mlu bits || aw16_prompt || 0x5b398983 (01Jul18_19:10) || 16 bits of MLU input, 1 bit per preamp&lt;br /&gt;
|-&lt;br /&gt;
| 10 || drift-blank-off counter || udp_drift_counter || 0x5b3aa19f (02Jul18_15:05) || counter of triggers that passed the drift blank-off&lt;br /&gt;
|-&lt;br /&gt;
| 11 || scaledown counter || udp_scaledown_counter || 0x5b3aa19f (02Jul18_15:05) || counter of triggers that passed the scaledown&lt;br /&gt;
|-&lt;br /&gt;
| X ||  ||  ||  || &lt;br /&gt;
|-&lt;br /&gt;
| 12 || 0x9 packet footer ||  || all || 28 bits of counter_trig_out&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== trigger bitmap ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
              udp_trig_bits[0] &amp;lt;= adc16_grand_or;&lt;br /&gt;
              udp_trig_bits[1] &amp;lt;= adc32_grand_or;&lt;br /&gt;
              udp_trig_bits[2] &amp;lt;= adc_grand_or;&lt;br /&gt;
              udp_trig_bits[3] &amp;lt;= esata_nim_grand_or;&lt;br /&gt;
              udp_trig_bits[4] &amp;lt;= adc16_coinc_top;&lt;br /&gt;
              udp_trig_bits[5] &amp;lt;= adc16_coinc_bot;&lt;br /&gt;
              udp_trig_bits[6] &amp;lt;= adc16_coinc;&lt;br /&gt;
              udp_trig_bits[7] &amp;lt;= 0;&lt;br /&gt;
              udp_trig_bits[23:8] &amp;lt;= adc16_coinc_dff[15:0];&lt;br /&gt;
              udp_trig_bits[31:24] &amp;lt;= mult16[7:0];&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Firmware 0x5b08938c (25May18_15:51)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
              udp_trig_bits[0] &amp;lt;= adc16_grand_or;&lt;br /&gt;
              udp_trig_bits[1] &amp;lt;= adc32_grand_or;&lt;br /&gt;
              udp_trig_bits[2] &amp;lt;= adc_grand_or;&lt;br /&gt;
              udp_trig_bits[3] &amp;lt;= esata_nim_grand_or;&lt;br /&gt;
              udp_trig_bits[4] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[5] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[6] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[7] &amp;lt;= 0;&lt;br /&gt;
              udp_trig_bits[23:8] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[31:24] &amp;lt;= mult16[7:0];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Firmware 0x5b217dc4 (13Jun18_13:25)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
              udp_trig_bits[0] &amp;lt;= adc16_grand_or;&lt;br /&gt;
              udp_trig_bits[1] &amp;lt;= adc32_grand_or;&lt;br /&gt;
              udp_trig_bits[2] &amp;lt;= adc_grand_or;&lt;br /&gt;
              udp_trig_bits[3] &amp;lt;= esata_nim_grand_or;&lt;br /&gt;
              udp_trig_bits[4] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[5] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[6] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[7] &amp;lt;= 0;&lt;br /&gt;
              udp_trig_bits[23:8] &amp;lt;= xadc16_or16[15:0]; // 16x AW preamps hits&lt;br /&gt;
              udp_trig_bits[31:24] &amp;lt;= xadc16_or16_mult[7:0]; // 16x AW preamp multiplicity (sum of xadc16_or16 bits)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Firmware 0x5b3aa19f (02Jul18_15:05)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
              udp_trig_bits[0] &amp;lt;= adc16_grand_or;&lt;br /&gt;
              udp_trig_bits[1] &amp;lt;= adc32_grand_or;&lt;br /&gt;
              udp_trig_bits[2] &amp;lt;= adc_grand_or;&lt;br /&gt;
              udp_trig_bits[3] &amp;lt;= esata_nim_grand_or;&lt;br /&gt;
              udp_trig_bits[4] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[5] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[6] &amp;lt;= 0; // not used&lt;br /&gt;
              udp_trig_bits[7] &amp;lt;= udp_mlu_out;&lt;br /&gt;
              udp_trig_bits[23:8] &amp;lt;= xadc16_or16[15:0]; // 16x AW preamps hits&lt;br /&gt;
              udp_trig_bits[31:24] &amp;lt;= xadc16_or16_mult[7:0]; // 16x AW preamp multiplicity (sum of xadc16_or16 bits)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Firmware 0x5bc8f90f (18Oct18_14:20)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   assign trig32_in[0]  = trigger; // software trigger&lt;br /&gt;
   assign trig32_in[1]  = 0; // not used pulser trigger&lt;br /&gt;
   assign trig32_in[2]  = 0; // not used conf_enable_sas_or&lt;br /&gt;
   assign trig32_in[3]  = 0; // not used conf_run_pulser&lt;br /&gt;
   assign trig32_in[4]  = 0; // not used conf_output_pulser&lt;br /&gt;
   assign trig32_in[5]  = esata_nim_grand_or;&lt;br /&gt;
   assign trig32_in[6]  = adc16_grand_or;&lt;br /&gt;
   assign trig32_in[7]  = adc32_grand_or;&lt;br /&gt;
   assign trig32_in[8]  = adc16_mult_1ormore;&lt;br /&gt;
   assign trig32_in[9]  = adc16_mult_2ormore;&lt;br /&gt;
   assign trig32_in[10] = adc16_mult_3ormore;&lt;br /&gt;
   assign trig32_in[11] = adc16_mult_4ormore;&lt;br /&gt;
   assign trig32_in[12] = 0; // not used conf_enable_adc16_coinc&lt;br /&gt;
   assign trig32_in[13] = 0; // not used conf_enable_udp&lt;br /&gt;
   assign trig32_in[14] = 0; // not used conf_enable_busy&lt;br /&gt;
   assign trig32_in[15] = adc_grand_or;&lt;br /&gt;
   assign trig32_in[16] = aw16_coinc_a;&lt;br /&gt;
   assign trig32_in[17] = aw16_coinc_b;&lt;br /&gt;
   assign trig32_in[18] = aw16_coinc_c;&lt;br /&gt;
   assign trig32_in[19] = aw16_coinc_d;&lt;br /&gt;
   assign trig32_in[20] = 0; // not used conf_clock_select&lt;br /&gt;
   assign trig32_in[21] = aw16_coinc_trig;&lt;br /&gt;
   assign trig32_in[22] = aw16_mlu_trig;&lt;br /&gt;
   assign trig32_in[23] = timeout_trig;&lt;br /&gt;
   assign trig32_in[24] = aw16_mult_1ormore;&lt;br /&gt;
   assign trig32_in[25] = aw16_mult_2ormore;&lt;br /&gt;
   assign trig32_in[26] = aw16_mult_3ormore;&lt;br /&gt;
   assign trig32_in[27] = aw16_mult_4ormore;&lt;br /&gt;
   assign trig32_in[28] = bsc_grand_or_trig;&lt;br /&gt;
   assign trig32_in[29] = bsc_mult_trig;&lt;br /&gt;
   assign trig32_in[30] = coinc_trig;&lt;br /&gt;
   assign trig32_in[31] = 0; // not used&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= TODO =&lt;br /&gt;
&lt;br /&gt;
* add FwRev to the UDP data output&lt;br /&gt;
* fix &amp;quot;write did not happen&amp;quot; (send udp write command, there is no reply, read returns old data as if write never happened). suspect udp &amp;quot;write&amp;quot; packet is lost?&lt;br /&gt;
* fix reply to wrong socket - udp packets should reply to same socket as they came from, udp data packets should be sent to same socket as requested them, not same socket as last command.&lt;br /&gt;
* add fixes from Chris P. for the auto-negotiation and dhcp (see email from him).&lt;br /&gt;
* speed up programming the MLU by writing more than 1 bit at a time&lt;br /&gt;
&lt;br /&gt;
= End =&lt;br /&gt;
&lt;br /&gt;
//KO&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Chronobox&amp;diff=643</id>
		<title>Chronobox</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Chronobox&amp;diff=643"/>
		<updated>2021-01-06T23:21:31Z</updated>

		<summary type="html">&lt;p&gt;Acapra: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Chronobox =&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
* https://daq.triumf.ca/DaqWiki/index.php/DE10-Nano&lt;br /&gt;
* https://bitbucket.org/expalpha/chronobox_firmware&lt;br /&gt;
* https://bitbucket.org/expalpha/chronobox_software&lt;br /&gt;
&lt;br /&gt;
= Chronobox connectors =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
| LEMO - CLK_IN - jumpers: SINE&amp;lt;-&amp;gt;CLK&amp;lt;-&amp;gt;NIM/TTL and NIM&amp;lt;-&amp;gt;CLK&amp;lt;-&amp;gt;TTL&lt;br /&gt;
|&lt;br /&gt;
| ECL P1&lt;br /&gt;
| 32&lt;br /&gt;
| |&lt;br /&gt;
| 1&lt;br /&gt;
|&lt;br /&gt;
| ECL P2&lt;br /&gt;
| 32&lt;br /&gt;
| |&lt;br /&gt;
| 1&lt;br /&gt;
|&lt;br /&gt;
| PLED - power-on LED&lt;br /&gt;
|&lt;br /&gt;
| jumper: bank A direction IN&amp;lt;-&amp;gt;X&amp;lt;-&amp;gt;OUT&lt;br /&gt;
| LEMO 0-1&lt;br /&gt;
| LED 0-1&lt;br /&gt;
| LEMO 2-3&lt;br /&gt;
| LED 2-3&lt;br /&gt;
|&lt;br /&gt;
| jumper: bank B direction IN&amp;lt;-&amp;gt;X&amp;lt;-&amp;gt;OUT&lt;br /&gt;
| LEMO 4-5&lt;br /&gt;
| LED 4-5&lt;br /&gt;
| LEMO 6-7&lt;br /&gt;
| LED 6-7&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Input channel mapping =&lt;br /&gt;
&lt;br /&gt;
* 0+16 : first ECL connector&lt;br /&gt;
* 16+16 : second ECL connector&lt;br /&gt;
* 32+8 : LEMO inputs (TTL)&lt;br /&gt;
* 40+18 : GPIO inputs (FPGA pins)&lt;br /&gt;
* 58 : external clock (10 MHz nominal)&lt;br /&gt;
* 59 : internal clock (100 MHz)&lt;br /&gt;
&lt;br /&gt;
= Install chronobox software =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://bitbucket.org/teamalphag/chronobox_software.git&lt;br /&gt;
cd chronobox_software&lt;br /&gt;
make clean&lt;br /&gt;
make&lt;br /&gt;
ls -l *.exe&lt;br /&gt;
-rwxr-xr-x 1 olchansk users 18808 Aug 16 15:26 reboot_cb.exe&lt;br /&gt;
-rwxr-xr-x 1 olchansk users 47256 Aug 16 15:26 srunner_cb.exe&lt;br /&gt;
-rwxr-xr-x 1 olchansk users 20732 Aug 16 15:26 test_cb.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Install chronobox quartus firmware project =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /home/agdaq/online/firmware/git&lt;br /&gt;
git clone https://bitbucket.org/teamalphag/chronobox_firmware.git&lt;br /&gt;
cd chronobox_firmware&lt;br /&gt;
cat timestamp.v&lt;br /&gt;
ls -l output_files/*.jic&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Firmware revisions =&lt;br /&gt;
&lt;br /&gt;
* 0x5aceaed2 - April 2018 - all inputs connected to counters (except ext clock), 58 inputs, 50 MHz clock&lt;br /&gt;
* 0x5b6de806 - August 2018 - added fpga boot flash programmer and fpga reboot&lt;br /&gt;
* 0x5b7c827d - August 2018 - bshaw added debounce on GPIO inputs (for flow meters), 100 MHz clock&lt;br /&gt;
* 0x5b873169 - August 2018 - rebuilt, no changes&lt;br /&gt;
* 0x5b89e4b4 - August 2018 - added external clock signal, 59 inputs, 100 MHz clock&lt;br /&gt;
* 0x5b8de2b0 - September 2018 - added data fifo and timestamp counters (TSCs) for the first 4 inputs&lt;br /&gt;
* 0x5b906c56 - September 2018 - improved overflow markers, added scalers readout into the data fifo&lt;br /&gt;
* 0x5da8e4c2 - October 2019 - timestamps for all inputs, inversion of inputs&lt;br /&gt;
* 0x5db764a7 - October 2019 - FPGA reboot works now.&lt;br /&gt;
&lt;br /&gt;
= Firmware update =&lt;br /&gt;
&lt;br /&gt;
If FPGA is not running compatible firmware srunner_cb will not work. To proceed,&lt;br /&gt;
load the correct SOF file via JTAG (https://daq.triumf.ca/DaqWiki/index.php/DE10-Nano#JTAG_load_sof_file),&lt;br /&gt;
then srunner_cb should work and will be able to load the jic or rpd file into the FPGA boot flash memory.&lt;br /&gt;
&lt;br /&gt;
Different revisions of the DE10-Nano board have different FPGA boot flash chips, some have EPCQ128 (use the &amp;quot;-128&amp;quot; option),&lt;br /&gt;
some have the EPCQ64 chip (use the &amp;quot;-64&amp;quot; option). Use &amp;quot;srunner_cb -id&amp;quot; per example below to identify which&lt;br /&gt;
flash chip is present on each specific chronobox. Note that the DE10-Nano documentation and the firmware quartus project&lt;br /&gt;
generally refer to the EPCS64/EPCQ64 chip. The only practical difference is the use of &amp;quot;-128&amp;quot; or &amp;quot;-64&amp;quot; srunner_cb options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./srunner_cb.exe -id -64 /dev/null # identify EPCS64 flash&lt;br /&gt;
./srunner_cb.exe -id -128 /dev/null # identify EPCQ128 flash&lt;br /&gt;
./srunner_cb.exe -read -128 test.rpd # read flash contents into a file&lt;br /&gt;
#./srunner_cb.exe -program -128 /home/olchansk/git/chronobox_firmware/output_files/DE10_NANO_SoC_GHRD_auto.rpd # write firmware rpd file into flash&lt;br /&gt;
./srunner_cb.exe -program -128 ~agmini/online/firmware/git/chronobox_firmware/output_files/DE10_NANO_SoC_GHRD_auto.rpd&lt;br /&gt;
./reboot_cb.exe # reboot the fpga into the new firmware&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Firmware build =&lt;br /&gt;
&lt;br /&gt;
* use quartus 17.1&lt;br /&gt;
&lt;br /&gt;
= Chronobox firmware registers =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reg | rw/ro | quartus name | firmware | description&lt;br /&gt;
0 | ro | sof_revision_in | all | firmware revision timestamp code&lt;br /&gt;
0 | wo | latch_scalers_out, zero_scalers_out | all | see [[#reg_0x00_write_bits]]&lt;br /&gt;
1 | rw | reg1_led_out | all | DE10-Nano LED output&lt;br /&gt;
2 | ro | switches_in | all | read DE10-Nano switches&lt;br /&gt;
3 | ro | buttons_in | all | read DE10-Nano buttons&lt;br /&gt;
4 | rw | reg4_test | all | 32-bit read-write test register&lt;br /&gt;
5 | rw | flash_programmer_in, reg5_flash_programmer_out | 0x5b6de806 | 0xABCD srunner flash programmer&lt;br /&gt;
6 | ro | ecl_in | all | read state of ECL inputs&lt;br /&gt;
7 | ro | reg7_test_in | all | ???&lt;br /&gt;
8 | rw | scaler_addr_out, reg8_scaler_data_in | all | top 16 bits of address becomes scaler bus address, 32 bit read is the corresponding scaler data&lt;br /&gt;
9 | ro | lemo_in | all | read state of LEMO inputs&lt;br /&gt;
A | ro | gpio_in | all | read state of GPIO inputs&lt;br /&gt;
B | rw | regB_lemo_out | all | LEMO output data&lt;br /&gt;
C | rw | regC_gpio_out | all | GPIO output data&lt;br /&gt;
D | rw | regD_out_enable_out | all | enable output tristates: [31:24] - LEMO_OUT, [17:0] - GPIO_OUT&lt;br /&gt;
E | rw | regE, reconfig_out | 0x5b6de806 | FPGA reboot: write inverted firmware revision (reg0) to reboot the FPGA&lt;br /&gt;
F | ro | regF_input_num_in | 0x5b89e4b4 | number of chronobox inputs (to read scalers, add 1 for the clock counter)&lt;br /&gt;
10 | ro | reg10_fifo_status | 0x5b8de2b0 | data fifo status, see below&lt;br /&gt;
11 | ro | reg11_fifo_data | 0x5b8de2b0 | data fifo data, see below&lt;br /&gt;
12 | rw | cb_invert_a | 0x5bf7557e | invert inputs 31..0&lt;br /&gt;
13 | rw | cb_invert_b | 0x5bf7557e | invert inputs 63..32&lt;br /&gt;
14 | rw | cb_enable_le_a | 0x5bf7557e | enable TSC leading edge&lt;br /&gt;
15 | rw | cb_enable_le_b | 0x5bf7557e | enable TSC leading edge&lt;br /&gt;
16 | rw | cb_enable_te_a | 0x5bf7557e | enable TSC trailing edge&lt;br /&gt;
17 | rw | cb_enable_te_b | 0x5bf7557e | enable TSC trailing edge&lt;br /&gt;
18 | ro | fc_ext_clk_100_counter | 0x5bf7557e | external clock frequency counter 100MHz reference&lt;br /&gt;
19 | ro | fc_ext_clk_ext_counter | 0x5bf7557e | external clock frequency counter&lt;br /&gt;
1A | ro | fc_ts_clk_100_counter | 0x5bf7557e | timestamp clock frequency counter 100MHz reference&lt;br /&gt;
1B | ro | fc_ts_clk_ts_counter | 0x5bf7557e | timestamp clock frequency counter&lt;br /&gt;
1C | ro | ts_clk_pll_status | 0x5bf7557e | timestamp clock PLL status&lt;br /&gt;
1D | rw | cb_lemo_out_mux_ctrl | 0x5bfdc798 | 8*4 bits to control 8 LEMO output multiplexers (4 bits/16 options each mux)&lt;br /&gt;
1E | rw | cb_sync_mask[31:0] | NEXT | source of chronobox sync signal, low bits&lt;br /&gt;
1F | rw | cb_sync_mask[63:32] | NEXT | source of chronobox sync signal, high bits&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== reg 0x00 write bits ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bit | fw revision | quartus signal | description&lt;br /&gt;
0 | all | | latch scalers&lt;br /&gt;
1 | all | | zero scalers&lt;br /&gt;
2 | ... | fifo_rdreq_out | fifo_rdreq_out&lt;br /&gt;
3 | ... | ts_clk_pll_extswitch_out | clear ts_clk_pll_extswitch_out&lt;br /&gt;
4 | ... | ts_clk_pll_extswitch_out | set ts_clk_pll_extswitch_out&lt;br /&gt;
5 | NEXT | sync_arm | arm the synchronization sequence&lt;br /&gt;
6 | NEXT | cb_sync | activate the synchronization&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== reg 0x10 ==&lt;br /&gt;
&lt;br /&gt;
Data FIFO status bits:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
31: fifo_full&lt;br /&gt;
30: fifo_empty&lt;br /&gt;
29: 0&lt;br /&gt;
28: 0&lt;br /&gt;
24+4: 0&lt;br /&gt;
0+24: fifo_usedw&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== reg 0x1C ==&lt;br /&gt;
&lt;br /&gt;
Timestamp clock PLL status bits:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
31 : PLL locked&lt;br /&gt;
30 : PLL active clock (0=internal, 1=external&lt;br /&gt;
29 : external clock bad&lt;br /&gt;
28 : internal clock bad&lt;br /&gt;
27 : ts_clk_pll_extswitch&lt;br /&gt;
0..26 : not used&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Timestamp clock ==&lt;br /&gt;
&lt;br /&gt;
Timestamp clock is 10 MHz selectable from internal oscillator or external reference on the CLK_IN input.&lt;br /&gt;
&lt;br /&gt;
CLK_IN input can be selected using 2 two-position jumpers:&lt;br /&gt;
* NIM input: CLK&amp;lt;-&amp;gt;NIM/TTL and CLK&amp;lt;-&amp;gt;NIM&lt;br /&gt;
&lt;br /&gt;
To select the clock from command line, use:&lt;br /&gt;
* test_cb.exe intclk # select internal clock&lt;br /&gt;
* test_cb.exe extclk # select external clock&lt;br /&gt;
&lt;br /&gt;
From software:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Chronobox* cb = ...;&lt;br /&gt;
cb-&amp;gt;cb_int_clock(); # select internal clock&lt;br /&gt;
cb-&amp;gt;cb_ext_clock(); # select external clock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see current status, run &amp;quot;test_cb.exe clocks&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ./test_cb.exe clocks&lt;br /&gt;
...&lt;br /&gt;
Chronobox firmware revision: 0x5bf7557e&lt;br /&gt;
...&lt;br /&gt;
clock status: ext_clk: counter 0x00cccf2a, freq 10000450.9 Hz, ts_clk: counter 0x00cccf2a, freq 10000450.9 Hz, PLL status 0xc0000000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reported is external clock frequency, currently selected timestamp clock frequency and PLL status (register 0x1C).&lt;br /&gt;
&lt;br /&gt;
Normal values for the PLL status:&lt;br /&gt;
* internal clock: 0x80000000&lt;br /&gt;
* external clock: 0xC0000000&lt;br /&gt;
* external clock selected, but invalid: 0x60000000&lt;br /&gt;
* internal clock selected, external clock invalid: 0xa0000000&lt;br /&gt;
&lt;br /&gt;
Disconnected/absent/broken external clock will report ext_clk frequency zero, bit 0x20000000 in the PLL status register 0x1C.&lt;br /&gt;
&lt;br /&gt;
== LEMO outputs ==&lt;br /&gt;
&lt;br /&gt;
LEMO connectors can be used as TTL level outputs:&lt;br /&gt;
&lt;br /&gt;
* set the &amp;quot;bank a&amp;quot; and/or &amp;quot;bank b&amp;quot; jumpers for &amp;quot;output&amp;quot;&lt;br /&gt;
* set the lemo output multiplexor bits in register 0x1D&lt;br /&gt;
* set the &amp;quot;lemo output enable&amp;quot; bit in register 0x0D, use bits 24..31 for LEMO outputs 0..7.&lt;br /&gt;
* observe the corresponding LED is on or off according to the LEMO output TTL logic level&lt;br /&gt;
&lt;br /&gt;
The function of each LEMO output is controlled by the lemo output multiplexor. Up to 16 different&lt;br /&gt;
signals can be routed into each output. This is controlled by register 0x1D.&lt;br /&gt;
&lt;br /&gt;
Register 0x1D multiplexor control is 32 bits organized into 8 groups of 4 bits, per each of the 8 LEMO outputs: 0x76543210,&lt;br /&gt;
i.e. value 0x00000001 routes signal function 1 into output 0, and signal function 0 into outputs 1..7.&lt;br /&gt;
&lt;br /&gt;
For each output, there are 16 possible signal functions (4 bits):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bit | firmware signal | firmware revision | signal description&lt;br /&gt;
0 | cb_lemo_out_reg[n] | 0x5bfdc798 | output is controlled by register 0xB bits 0..7 for outputs 0..7&lt;br /&gt;
1 | clk_ts | 0x5bfdc798 | output is the 10MHz timestamp clock&lt;br /&gt;
2 | cb_sync_out | NEXT | output the cb_sync signal&lt;br /&gt;
3..30 | gnd | 0x5bfdc798 | not used&lt;br /&gt;
31 | vcc | 0x5bfdc798 | logic level 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== front panel LEDs ==&lt;br /&gt;
&lt;br /&gt;
The front panel LEDs are numbered 0..7 per [[#Chronobox_connectors]]&lt;br /&gt;
&lt;br /&gt;
Each LED can be individually lit by setting a bit in register 0x1 bits 8..15.&lt;br /&gt;
&lt;br /&gt;
If LEMO outputs are active, corresponding LEDs will show LEMO output status (logic level 1 -&amp;gt; LED is on, logic level 0 -&amp;gt; LED is off).&lt;br /&gt;
&lt;br /&gt;
If LEMO inputs are active ...&lt;br /&gt;
&lt;br /&gt;
== Multiple chronobox connection ==&lt;br /&gt;
&lt;br /&gt;
To operate several chronoboxes as one unit, they have to have two common signals, a clock and a sync signal.&lt;br /&gt;
&lt;br /&gt;
Described is a master-slave configuration of 2 chronoboxes. Up to 2 slaves can be connected, number of LEMO outputs permitting. Alternately, slave chronoboxes can be daisy-chained for an unlimited number of slaves.&lt;br /&gt;
&lt;br /&gt;
In a master-slave configuration, the master unit provides the timestamp clock and drives the sync signal. (For daisy-chained configuration, the slave can repeat the clock and sync signals into the next slave).&lt;br /&gt;
&lt;br /&gt;
Electrical connection, lemo direction jumpers:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
master: bank A set to &amp;quot;out&amp;quot;&lt;br /&gt;
slave: bank B set to &amp;quot;in&amp;quot;&lt;br /&gt;
slave daisy-chain: bank A set to &amp;quot;out&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Electrical connection, 1st slave:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
master lemo out #0 -&amp;gt; slave clk_in (TTL mode)&lt;br /&gt;
master lemo out #1 -&amp;gt; slave lemo in #4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Electrical connection, 2nd slave:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
master lemo out #2 -&amp;gt; slave clk_in (TTL mode)&lt;br /&gt;
master lemo out #3 -&amp;gt; slave lemo in #4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Electrical connection, daisy-chained:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slave lemo out #0 -&amp;gt; next slave clk_in (TTL mode)&lt;br /&gt;
slave lemo out #1 -&amp;gt; next slave lemo in #4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clock configuration:&lt;br /&gt;
* master: set to internal clock or external clock&lt;br /&gt;
* slave: set to external clock&lt;br /&gt;
&lt;br /&gt;
Sync configuration:&lt;br /&gt;
* master: &amp;quot;sync_arm&amp;quot; activated by software, &amp;quot;sync&amp;quot; activated by software (cb_sync_mask set to zero)&lt;br /&gt;
** register 0x1D output mux to 0xXXXX&#039;XX21 (2=output sync signal, 1=output clock)&lt;br /&gt;
** register 0x0D output enable, set bits 0x3000&#039;0000 (output enable lemo #0 clock and #1 sync)&lt;br /&gt;
** register 0x1E and 0x1F, set to 0 (cb_sync external source)&lt;br /&gt;
* slave: &amp;quot;sync_arm&amp;quot; activated by software, &amp;quot;sync&amp;quot; activated by lemo in #4 (cb_sync_mask set bit 32+4).&lt;br /&gt;
** register 0x1E set to zero&lt;br /&gt;
** register 0x1F set to 0x0000&#039;0004&lt;br /&gt;
** for daisy-chain operation, set registers 0x1D and 0x0D same as master&lt;br /&gt;
&lt;br /&gt;
Sync operation:&lt;br /&gt;
* issue a &amp;quot;sync_arm&amp;quot; command. Scalers and timestamps will be stopped. Time counter will be reset to zero, scalers will be reset to zero.&lt;br /&gt;
* issue a &amp;quot;sync&amp;quot; command. Scalers and timestamps will be started at the same time in all units.&lt;br /&gt;
&lt;br /&gt;
== FIFO data format ==&lt;br /&gt;
&lt;br /&gt;
* 0x8ntttttt: TSC data, 24 bits &amp;quot;tttttt&amp;quot; of timestamp, 7 bits &amp;quot;nn&amp;quot; of channel number, top bit set to 1. Low bit of &amp;quot;t&amp;quot; indicates 0=leading edge, 1=trailing edge.&lt;br /&gt;
* 0xffTTmmmm: timestamp wrap around marker: &amp;quot;TT&amp;quot; is the top 8 bits of the timestamp, &amp;quot;mmmm&amp;quot; increments for each marker&lt;br /&gt;
* 0xfe00nnnn: scaler data, following &amp;quot;nnnn&amp;quot; words are the latched scalers&lt;br /&gt;
&lt;br /&gt;
== timestamp wrap around marker ==&lt;br /&gt;
&lt;br /&gt;
The timestamp data is only 24 bits, to allow timestamping&lt;br /&gt;
with longer time range, wrap around markers are added to the&lt;br /&gt;
data stream.&lt;br /&gt;
&lt;br /&gt;
For input signals that arrive close to the time of timestamp wrap around,&lt;br /&gt;
there is ambiguity in the ordering of the data fifo: does the wrap around&lt;br /&gt;
marker or the signal timestamp show up first? For example for rare&lt;br /&gt;
signals, one can see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wrap 1&lt;br /&gt;
wrap 2&lt;br /&gt;
timestamp 0x00000003&lt;br /&gt;
wrap 3&lt;br /&gt;
wrap 4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
does the hit belong with wrap marker 2 (written to the fifo just after wrap marker 2)&lt;br /&gt;
or with marker 3 (written to the fifo just before wrap marker 3)?&lt;br /&gt;
&lt;br /&gt;
To remove this ambiguity, additional markers are written to the data stream&lt;br /&gt;
half way between the wrap arounds, making it obvious that the signal&lt;br /&gt;
arrived right after wrap marker 3 (but was written to the FIFO before the marker):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wrap 1 0x00&lt;br /&gt;
wrap 1 0x80&lt;br /&gt;
wrap 2 0x00&lt;br /&gt;
wrap 2 0x80&lt;br /&gt;
timestamp 0x00000003&lt;br /&gt;
wrap 3 0x00&lt;br /&gt;
wrap 3 0x80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= test_cb.exe =&lt;br /&gt;
&lt;br /&gt;
test_cb.exe is the general test program for the chronobox.&lt;br /&gt;
&lt;br /&gt;
* test_cb.exe 0 # read chronobox register 0&lt;br /&gt;
* test_cb.exe 4 0x1234 # write to chronobox register 4&lt;br /&gt;
* test_cb.exe reboot # reboot the FPGA (the ARM CPU keeps running)&lt;br /&gt;
* test_cb.exe scalers # read all scalers in a loop&lt;br /&gt;
* test_cb.exe fifo # read the data fifo in a loop&lt;br /&gt;
* test_cb.exe intclk # select internal timestamp clock&lt;br /&gt;
* test_cb.exe extclk # select external timestamp clock (10MHz)&lt;br /&gt;
* test_cb.exe clocks # report current status of timstamp clock&lt;br /&gt;
&lt;br /&gt;
= ZZZ =&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Daq&amp;diff=642</id>
		<title>Daq</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Daq&amp;diff=642"/>
		<updated>2020-12-23T22:56:16Z</updated>

		<summary type="html">&lt;p&gt;Acapra: redo spaces&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Links =&lt;br /&gt;
&lt;br /&gt;
* https://alphacpc05.cern.ch/agdaq/ -- midas daq page for the agdaq system at CERN&lt;br /&gt;
* https://daq16.triumf.ca -- midas daq page for the agmini system at TRIUMF&lt;br /&gt;
* https://daq.triumf.ca/elog-alphag/alphag/ -- elog&lt;br /&gt;
* https://daqstore.triumf.ca/AgWiki/index.php/Main_Page -- this wiki&lt;br /&gt;
* https://bitbucket.org/ttriumfdaq/agdaq - git repository for agdaq&lt;br /&gt;
* https://bitbucket.org/expalpha  -- git repository on bitbucket&lt;br /&gt;
* https://edev-group.triumf.ca/fw/exp/alphag -- git repository on edev gitlab&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/170 - PWB inventory database&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/168 - ADC (GRIF-16) inventory, FMC-ADC32rev0,rev1 inventory&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/176 - FMC-ADC32rev1.1 inventory&lt;br /&gt;
&lt;br /&gt;
= Hardware manuals =&lt;br /&gt;
&lt;br /&gt;
* [[TRG]] - trigger board (GRIF-C) manual&lt;br /&gt;
* CDM - https://daq.triumf.ca/DaqWiki/index.php/VME-CDM -- clock VME-CDM manual&lt;br /&gt;
* ADC - https://daq.triumf.ca/DaqWiki/index.php/VME-GRIF-ADC16-Rev1 -- GRIF-16 ADC manual&lt;br /&gt;
* [[PWB]] - TPC Pad Wing Board manual&lt;br /&gt;
* TDC - https://www.triumf.info/wiki/DAQwiki/index.php/GSI_TRB3&lt;br /&gt;
* [[chronobox]] - chronobox manual&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
Full system: (ADC fw rel-20201112-ko, PWB fw 20201005_ko)&lt;br /&gt;
* 1 Hz stable, ADC adc32 9 supp off rate 0.3 M/s, adc16 off, PWB udp_delay 25 supp off active 64 rate 6.6+4+6+4.6=21.2 M/s, TDC off, total rate 21 M/s&lt;br /&gt;
* 500 Hz stable, ADC adc32 9 supp 1500 rate 6 M/s, adc16 off, PWB udp_delay 10 supp 100 active 63 rate 3+4+3+3=13 M/s, TDC off, total rate 19 M/s&lt;br /&gt;
&lt;br /&gt;
Single ADC: (fw rel-20201112-ko)&lt;br /&gt;
&lt;br /&gt;
Fully suppressed data, sthreshold 5000&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 500 Hz: stable (nominal max trigger rate)&lt;br /&gt;
* 6700 Hz: stable, 8 Mbytes/sec&lt;br /&gt;
* 6800 Hz: evb eventually confused&lt;br /&gt;
* 6850 Hz: evb confused, no lost triggers in the ADC, no crash in the ADC&lt;br /&gt;
&lt;br /&gt;
All data, 510 samples/event, sthreshold 10 (fw rel-20201122-ko)&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 100 Hz: stable, 3.4 Mbytes/sec&lt;br /&gt;
* 500 Hz: stable, 17 Mbytes/sec (nominal max trigger rate)&lt;br /&gt;
* 1000 Hz: stable, 32 Mbytes/sec&lt;br /&gt;
* 3100 Hz: stable, 106 M/s (approaching saturation of 1gige ethernet)&lt;br /&gt;
* 3200 Hz: stable, 110 M/s - TRG communication is in trouble&lt;br /&gt;
* 3300 Hz: stable, 116 M/s&lt;br /&gt;
* 3400 Hz: incomplete events, no ADC crash (&amp;quot;dropped due to full&amp;quot; counting, &amp;quot;dropped due to busy&amp;quot; are zero, this is as expected).&lt;br /&gt;
&lt;br /&gt;
no suppression (different fpga data path)&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 100 Hz: stable&lt;br /&gt;
* 500 Hz: stable, 17 M/s (nominal max trigger rate)&lt;br /&gt;
* 1000 Hz: stable, 32 M/s&lt;br /&gt;
* 3000 Hz: stable, 100 M/s (approaching saturation of 1gige ethernet)&lt;br /&gt;
* 3300 Hz: incomplete events, no ADC crash (&amp;quot;dropped due to full&amp;quot; counting, &amp;quot;dropped due to busy&amp;quot; are zero, this is as expected).&lt;br /&gt;
&lt;br /&gt;
= Network connections =&lt;br /&gt;
&lt;br /&gt;
The experiment private network number is: 192.168.1.x, gateway 192.168.1.1, netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
network map:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- TRIUMF/CERN network --1gige-- alphagdaq --10gige-- juniper switch --1gige-- centrecom switch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== alphagdaq network connections ==&lt;br /&gt;
&lt;br /&gt;
on the rear of the machine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
|   | rj45 | rj45 |         | sfp | sfp |&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
- left rj45 - copper 1gige - eno1 - spare (inactive)&lt;br /&gt;
- right rj45 - copper 1gige - eno2 - dhcp - cern/triumf network&lt;br /&gt;
- left sfp - 10gige - enp1s0f1 - spare (inactive)&lt;br /&gt;
- right sfp - 10gige - enp1s0f0 - static 192.168.1.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== connections between switches ==&lt;br /&gt;
&lt;br /&gt;
* alphagdaq to juniper switch: direct attach (DAC) 10gige cable into any port of juniper switch&lt;br /&gt;
* juniper switch to centrecom switch: rj45 sfp in any port of juniper switch - cat5e/cat6 cable - to any port of centrecom switch&lt;br /&gt;
* cat5e/cat6 cable from any port of centrecom switch to the XXX port on the back of the juniper switch&lt;br /&gt;
&lt;br /&gt;
== juniper switch ==&lt;br /&gt;
&lt;br /&gt;
connected to juniper switch front is:&lt;br /&gt;
&lt;br /&gt;
* everything that sends event data to alphagdaq, specifically:&lt;br /&gt;
** TRG (rj45 sfp)&lt;br /&gt;
** 16x ADC (fiber sfp)&lt;br /&gt;
** 64x PWB (fiber sfp)&lt;br /&gt;
* 10gige uplink to alphagdaq (10gige DAC cable)&lt;br /&gt;
* 1gige link to centrecom switch (rj45 sfp)&lt;br /&gt;
* 40gige ports are not used&lt;br /&gt;
&lt;br /&gt;
connected to the juniper switch rear:&lt;br /&gt;
&lt;br /&gt;
* CON is the serial console via RJ45-to-DB9 to USB-serial adapter to alphagdaq USB port (9600bps, 8N1, no flow control)&lt;br /&gt;
* C0 is the management ethernet interface port, connect to any port on the centrecom switch (juniper-private will ping)&lt;br /&gt;
&lt;br /&gt;
== centrecom switch ==&lt;br /&gt;
&lt;br /&gt;
* everything with copper rj45 connections, specifically:&lt;br /&gt;
** CDM boards&lt;br /&gt;
** HV, LV and VME power supplies&lt;br /&gt;
** RaspberryPi3 boards&lt;br /&gt;
** gas handling MFCs (algas)&lt;br /&gt;
** cooling system controller (moxa01)&lt;br /&gt;
&lt;br /&gt;
= USB connections =&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* alphagdaq has USB2 and USB3 connections. They are not the same, they are not generally interchangeable.&lt;br /&gt;
* USB3 connections and cables are generally blue coloured.&lt;br /&gt;
&lt;br /&gt;
List of USB connections from alphagdaq:&lt;br /&gt;
&lt;br /&gt;
* front USB3 port (blue): USB-A-to-B cable to USB blaster connected to the trigger board (front of rack)&lt;br /&gt;
* rear USB3 port (blue): USB3 short jumper to USB3 hub&lt;br /&gt;
* rear USB2 port (black): USB2 unpowered hub (Logiix) to USB-A-to-B cable to UPS USB connector&lt;br /&gt;
* rear USB2 port (black): USB-to-Serial adaper to DB9 to RJ45 adapter to Juniper switch console port&lt;br /&gt;
&lt;br /&gt;
Note: UPS USB connection does not work with alphagdaq USB ports (both usb2 and usb3), but combination&lt;br /&gt;
using the unpowered USB2 hub seems to work ok.&lt;br /&gt;
&lt;br /&gt;
List of USB connections from the USB hub:&lt;br /&gt;
&lt;br /&gt;
* this is a powered USB3 hub&lt;br /&gt;
* USB-A-to-MicroUSB - to lvdb boards&lt;br /&gt;
* USB-A-to-Wiener interlock cable&lt;br /&gt;
&lt;br /&gt;
= Clock and trigger distribution =&lt;br /&gt;
&lt;br /&gt;
== Explanation ==&lt;br /&gt;
&lt;br /&gt;
Trigger is generated by the trigger board (aka TRG, aka GRIF-C),&lt;br /&gt;
from the TRG eSATA output through the eSATA splitter it is fed into&lt;br /&gt;
the master CDM. The master CDM outputs the trigger on all MiniSAS output ports.&lt;br /&gt;
One of the master CDM MiniSAS outputs is connected to the CDM slave eSATA input.&lt;br /&gt;
The same as the master CDM, the slave CDM outputs the trigger on all MiniSAS output ports.&lt;br /&gt;
&lt;br /&gt;
The master 62.5MHz clock is generated by the master CDM using the internal 10MHz oscillator&lt;br /&gt;
or the external 10MHz AD clock. Also on MiniSAS port 6 the master CDM generates&lt;br /&gt;
the 200MHz clock for the TDC. This clock is frequency-locked to the master 62.5MHz clock.&lt;br /&gt;
&lt;br /&gt;
Master CDM clock selection (external CD 10MHz clock or internal oscillator 10MHz clock)&lt;br /&gt;
is done by a magic esper command (see below).&lt;br /&gt;
&lt;br /&gt;
From the master CDM, the clock is fed to: the slave CDM, the TRG (via the eSATA splitter)&lt;br /&gt;
and to the TDC (via the RJ45 splitter).&lt;br /&gt;
&lt;br /&gt;
The slave CDM sends the clock and the trigger to the ADCs and PWBs.&lt;br /&gt;
&lt;br /&gt;
== Schematic ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TRG (GRIF-C)&lt;br /&gt;
------------&lt;br /&gt;
eSATA &amp;lt;------&amp;gt; eSATA splitter&lt;br /&gt;
&lt;br /&gt;
eSATA splitter&lt;br /&gt;
--------------&lt;br /&gt;
trigger ---&amp;gt; eSATA ---&amp;gt; CDM-Master eSATA (trigger signal)&lt;br /&gt;
clock &amp;lt;--- (eSATA --- MiniSAS) &amp;lt;--- CDM MiniSAS (62.5MHz clock)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CDM-Master&lt;br /&gt;
----------&lt;br /&gt;
eSATA &amp;lt;--- eSATA splitter &amp;lt;--- eSATA from TRG (trigger signal)&lt;br /&gt;
MiniSAS 1 --&amp;gt; (MiniSAS --- eSATA) --&amp;gt; CDM-Slave eSATA (62.5 MHz)&lt;br /&gt;
MiniSAS 6 --&amp;gt; (MiniSAS --- eSATA) --&amp;gt; eSATA splitter --&amp;gt; RJ45 --&amp;gt; TDC (200 MHz)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CDM-Slave&lt;br /&gt;
---------&lt;br /&gt;
eSATA &amp;lt;--- trigger and 62.5MHz clock from CDM-Master&lt;br /&gt;
MiniSAS 1 --&amp;gt; ADC trigger and 62.5MHz clock&lt;br /&gt;
MiniSAS 2 --&amp;gt; same&lt;br /&gt;
MiniSAS 3 --&amp;gt; same&lt;br /&gt;
MiniSAS 4 --&amp;gt; same&lt;br /&gt;
MiniSAS 5 --&amp;gt; PWB trigger and 62.5MHz clock&lt;br /&gt;
MiniSAS 6 --&amp;gt; same&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup of CDM boards ==&lt;br /&gt;
&lt;br /&gt;
ALPHA-g uses the Rev3 CDM boards. The 4 CDM boards that belong to ALPHA-g&lt;br /&gt;
have serial numbers 0, 1, 2 and 3 and are labeled cdm00, cdm01, cdm02, cdm03.&lt;br /&gt;
&lt;br /&gt;
All the boards can be used as master and slave positions, but have to be&lt;br /&gt;
configured appropriately.&lt;br /&gt;
&lt;br /&gt;
=== Slave setup ===&lt;br /&gt;
&lt;br /&gt;
* install the board&lt;br /&gt;
* connect ethernet&lt;br /&gt;
* connect esata external clock&lt;br /&gt;
* esper-tool cdmNN ### i.e. esper-tool cdm01&lt;br /&gt;
* cd template&lt;br /&gt;
* write current_setup 4&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* read&lt;br /&gt;
* observe clock frequency counters report correct values. &amp;quot;ext_clk&amp;quot; will only count if the lemo jumper is installed (see below)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11    esata_clk        uint32           R                 [62500246]                      &lt;br /&gt;
12    ext_clk          uint32           R                 [62500246]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
156   ld1_counter      uint32           RW                [3]                             &lt;br /&gt;
157   ld2_counter      uint32           RW                [3]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, check correct operation of the pll lock monitoring:&lt;br /&gt;
&lt;br /&gt;
* unplug the esata cable from the master CDM&lt;br /&gt;
* &amp;quot;red&amp;quot; light should go off&lt;br /&gt;
* read of lmk should report &amp;quot;pll1_ld&amp;quot; value 0 and &amp;quot;ld1_counter&amp;quot; and &amp;quot;ld2_counter&amp;quot; should increment&lt;br /&gt;
* reconnect the esata cable&lt;br /&gt;
* &amp;quot;red&amp;quot; light should return&lt;br /&gt;
* read of lmk should report both pll1_ld and pll2_ld locked (values &amp;quot;1&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Master setup ===&lt;br /&gt;
&lt;br /&gt;
* install the board&lt;br /&gt;
* connect ethernet&lt;br /&gt;
* esper-tool cdmNN ### i.e. esper-tool cdm01&lt;br /&gt;
* cd template&lt;br /&gt;
* write current_setup 3&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* write clkin_sel_mode 0&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* read&lt;br /&gt;
* observe clock frequency counters report correct values. &amp;quot;ext_clk&amp;quot; will only count if the &amp;quot;clock loopback&amp;quot; lemo jumper is installed (see below)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
12    ext_clk          uint32           R                 [62500189]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
156   ld1_counter      uint32           RW                [3]                             &lt;br /&gt;
157   ld2_counter      uint32           RW                [3]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the 200MHz clock:&lt;br /&gt;
* connect MiniSAS-eSATA splitter cable to MiniSAS output 6, connect eSATA end to CDM eSATA input&lt;br /&gt;
* in esper-tool, read cdm: esata_clk should report 200MHz clock&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11    esata_clk        uint32           R                 [200000603]                     &lt;br /&gt;
12    ext_clk          uint32           R                 [62500188]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Master setup with external 10 MHz clock ===&lt;br /&gt;
&lt;br /&gt;
* setup master CDM as above (using internal clock)&lt;br /&gt;
* connect 10MHz external clock to right LEMO #1&lt;br /&gt;
* esper-tool cdmNN&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* write sel_nim 1 # if clock is NIM signal&lt;br /&gt;
* write sel_nim 0 # if clock is TTL signal (i.e. chronobox LEMO output)&lt;br /&gt;
* read ext_clk&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[http://cdm00:/cdm]&amp;gt; read ext_clk&lt;br /&gt;
9999556&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if ext_clk reads 0 or does not read something close to 10MHz, stop here. debug the signal, try changing sel_nim, etc.&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* write clkin_sel_mode 2 # select external clock&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
150   clkin2_sel       bool             R                 [True]                          &lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* on the MIDAS TRG page, observe that TRG measured external clock frequency is close to 62.5 MHz&lt;br /&gt;
&lt;br /&gt;
== clkin_sel_mode positions ==&lt;br /&gt;
&lt;br /&gt;
* 0 = 10MHz internal oscillator (use on master CDM in standalone mode)&lt;br /&gt;
* 1 = eSATA clock (use on slave CDM)&lt;br /&gt;
* 2 = external clock, should be 10MHz (use on master CDM to run from AD clock)&lt;br /&gt;
&lt;br /&gt;
== LEMO connections ==&lt;br /&gt;
&lt;br /&gt;
* clock loopback jumper: to read the frequency of the generated 62.5MHz clock, connect LEMO cable from left LEMO #2 to the right LEMO #1&lt;br /&gt;
* 10MHz internal clock jumper: to feed 10MHz internal oscillator to the external clock, connect LEMO cable from right  LEMO #3 to the right LEMO #1.&lt;br /&gt;
* 10MHz external clock: to feed 10MHz external clock, connect LEMO cable to right LEMO #1&lt;br /&gt;
&lt;br /&gt;
= MIDAS frontends =&lt;br /&gt;
&lt;br /&gt;
== UDP ==&lt;br /&gt;
&lt;br /&gt;
feudp receives udp packets from the ADC and PWB boards. For each udp packet 1 midas event is created,&lt;br /&gt;
with 1 data bank containing the udp data. Events are sent into the MIDAS event buffer BUFUDP. The names&lt;br /&gt;
of the data banks are assigned in ODB /eq/feudp/settings.&lt;br /&gt;
&lt;br /&gt;
{ADC,PWB} --&amp;gt; 1gige --&amp;gt; switch --&amp;gt; 10gige --&amp;gt; alphagdaq --&amp;gt; feudp -&amp;gt; BUFUDP&lt;br /&gt;
&lt;br /&gt;
== CTRL ==&lt;br /&gt;
&lt;br /&gt;
fectrl controls all the ADC, PWB and trigger boards. It provides run start and stop sequencing,&lt;br /&gt;
runs the event synchronization sequence at the begin of the run, and records slow controls data (temperatures,&lt;br /&gt;
voltages, etc).&lt;br /&gt;
&lt;br /&gt;
fectrl receives UDP data packets from the trigger board and sends them to the MIDAS event buffer BUFUDP.&lt;br /&gt;
&lt;br /&gt;
fectrl receives commands from the control web pages (for ADC, PWB and trigger) to reboot, initialize, etc the boards.&lt;br /&gt;
&lt;br /&gt;
fectrl configures the event builder via odb /eq/fectrl/evbconfig.&lt;br /&gt;
&lt;br /&gt;
ADC &amp;lt;-&amp;gt; http esper &amp;lt;-&amp;gt; fectrl -&amp;gt; slow control data into midas history&lt;br /&gt;
&lt;br /&gt;
PWB &amp;lt;-&amp;gt; http esper &amp;lt;-&amp;gt; fectrl -&amp;gt; slow control data into midas history&lt;br /&gt;
&lt;br /&gt;
TRG &amp;lt;-&amp;gt; udp comm &amp;lt;-&amp;gt; fectrl -&amp;gt; BUFUDP, slow control and counters into midas history&lt;br /&gt;
&lt;br /&gt;
fectrl &amp;lt;-&amp;gt; midas rpc &amp;lt;-&amp;gt; mhttpd &amp;lt;-&amp;gt; json rpc &amp;lt;-&amp;gt; control web pages for ADC, PWB and trigger&lt;br /&gt;
&lt;br /&gt;
== EVB ==&lt;br /&gt;
&lt;br /&gt;
feevb receives udp packet data from the MIDAS event buffer BUFUDP, inspects the packet timestamps&lt;br /&gt;
and collects the data with matching timestamps into physics events. feevb has provisions to do&lt;br /&gt;
data suppression, reduction and compression in addition to the data reduction done&lt;br /&gt;
in the ADC and PWB firmware.&lt;br /&gt;
&lt;br /&gt;
feevb event synchronization relies on the event synchronization sequence done by fectrl when a run is started.&lt;br /&gt;
&lt;br /&gt;
{ADC, PWB, TRG} -&amp;gt; BUFUDP -&amp;gt; feevb -&amp;gt; SYSTEM -&amp;gt; mlogger -&amp;gt; compression -&amp;gt; disk storage&lt;br /&gt;
&lt;br /&gt;
=== internal structure ===&lt;br /&gt;
&lt;br /&gt;
* event buffer readers, instances for BUFTRG, BUFTDC, BUFADC, BUFUDP&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BufferReader class - reads one midas event buffer:&lt;br /&gt;
- BufferReaderThread()&lt;br /&gt;
-- in batches of 1000 events&lt;br /&gt;
--- lock&lt;br /&gt;
--- TickLocked()&lt;br /&gt;
----- ReadEvent() -&amp;gt; bm_receive_event_alloc()&lt;br /&gt;
----- fHandler-&amp;gt;HandleEvent()&lt;br /&gt;
-- fHandler-&amp;gt;XMaybeFlushBank()&lt;br /&gt;
-- sleep 100 usec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* event header decoder and intermediate buffer&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Handler class - accumulates events, sends them to the EVB in batches&lt;br /&gt;
&lt;br /&gt;
- HandleEvent() &amp;lt;- BufferReaderThread() - receive incoming events&lt;br /&gt;
-- loop over all banks, examine bank name&lt;br /&gt;
--- call AddAdcBank(), AddPwbBank(), AddTrgBank(), AddTdcBank() according to bank name&lt;br /&gt;
----  AddXxxBank() -&amp;gt; XAddBank()&lt;br /&gt;
--- unknown banks go directly to evb-&amp;gt;SendQueue&lt;br /&gt;
-- check if synchronization has completed&lt;br /&gt;
&lt;br /&gt;
- XAddBank() - save BankBuf objects in a buffer&lt;br /&gt;
&lt;br /&gt;
- XMaybeFlushBank(), XFlushBank() - send all accumulated data to the Evb class&lt;br /&gt;
-- evb-&amp;gt;lock()&lt;br /&gt;
-- for each buffered BankBuf objects,&lt;br /&gt;
--- call evb-&amp;gt;AddBankLocked()&lt;br /&gt;
-- buffer is now empty&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* event builder&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Evb class - assemble event fragments according to timestamps&lt;br /&gt;
&lt;br /&gt;
- fEvents fifo (deque) - time sorted list of partially assembled events&lt;br /&gt;
-- new entries are added by FindEvent()&lt;br /&gt;
-- entries are modified by MergeSlot()&lt;br /&gt;
-- old entries are removed by GetLocked()&lt;br /&gt;
&lt;br /&gt;
- AddBankLocked() &amp;lt;- XFlushBank() &amp;lt;- BufferReaderThread()&lt;br /&gt;
-- call fSync-&amp;gt;Add()&lt;br /&gt;
-- transform BankBuf to EvbEventBuf&lt;br /&gt;
-- push it into per-module buffer fBuf[imodule]&lt;br /&gt;
&lt;br /&gt;
- EvbThread()&lt;br /&gt;
-- EvbTickLocked()&lt;br /&gt;
--- BuildLocked()&lt;br /&gt;
---- in a loop, for no more than 1 sec&lt;br /&gt;
----- loop over all per-module buffers fBuf&lt;br /&gt;
------ pop first entry, pass it to BuildSlot()&lt;br /&gt;
------- call FindEvent()&lt;br /&gt;
------- call MergeSlot()&lt;br /&gt;
------- call CheckEvent()&lt;br /&gt;
--- in a loop&lt;br /&gt;
---- get all completed events via GetLocked() pass them to SendQueue-&amp;gt;PushEvent()&lt;br /&gt;
-- if done nothing, sleep 100 usec, otherwise nominal sleep to free the evb lock&lt;br /&gt;
&lt;br /&gt;
- GetNext() &amp;lt;- GetLocked() &amp;lt;- EvbThread() - get completed events&lt;br /&gt;
-- examine oldest EvbEvent entry in fEvents:&lt;br /&gt;
-- pop it if it is complete&lt;br /&gt;
-- pop it if it is too old (to prevent old incomplete events from stalling the evb) (&amp;quot;pop age&amp;quot; on the evb page)&lt;br /&gt;
-- pop it if a following event is complete (&amp;quot;pop following&amp;quot; on the evb page)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* send queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SendQueue class - prepare events for writing to midas SYSTEM event buffer&lt;br /&gt;
&lt;br /&gt;
- PushEvent() &amp;lt;- EvbThread()&lt;br /&gt;
-- push FragmentBuf into the queue&lt;br /&gt;
&lt;br /&gt;
- SendQueueThread()&lt;br /&gt;
-- in a batch of 1000 events, call Tick()&lt;br /&gt;
--- pop FragmentBuf from the queue, call SendEvent()&lt;br /&gt;
--- compose midas event (memcpy()!)&lt;br /&gt;
--- TMFE fEq-&amp;gt;SendEvent()&lt;br /&gt;
--- bm_send_event()&lt;br /&gt;
-- sleep 100 usec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* equipment object&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EvbEq class - implements the midas equipment&lt;br /&gt;
- HandleBeginRun()&lt;br /&gt;
- HandleEndRun()&lt;br /&gt;
- HandlePeriodic()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== multithreading ===&lt;br /&gt;
&lt;br /&gt;
* BufferReaderThread() one per midas event buffer&lt;br /&gt;
** high CPU use: bm_receive_event(), AddXxxBank()&lt;br /&gt;
** lock contention: midas event buffer lock, evb lock into XFlushBank-&amp;gt;AddBankLocked()&lt;br /&gt;
* EvbThread()&lt;br /&gt;
** O(size of fEvents): FindEvent(), GetNext()&lt;br /&gt;
** lock contention: evb lock against XFlushBank(), SendQueue lock (1 per output event)&lt;br /&gt;
* SendQueueThread()&lt;br /&gt;
** high CPU use: memcpy() in SendEvent(), memcpy() in bm_send_event&lt;br /&gt;
** lock contention: event queue lock against EvbThread, midas event buffer lock&lt;br /&gt;
* main thread&lt;br /&gt;
** lock contention: evb lock in ReportEvb() and elsewhere&lt;br /&gt;
&lt;br /&gt;
= ODB entries =&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings ==&lt;br /&gt;
* TBW&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TrigSrc - trigger source selection ==&lt;br /&gt;
* TrigPulser                      - trigger on the pulser&lt;br /&gt;
* TrigEsataNimGrandOr             - trigger on external NIM inputs of GRIF-16 ADC modules&lt;br /&gt;
* TrigAdc16GrandOr                - trigger on any adc16 signals (see adc16_masks)&lt;br /&gt;
* TrigAdc32GrandOr                - trigger on any adc32 signals (see adc32_masks)&lt;br /&gt;
* Trig1ormore                     - trigger on adc16 multiplicity 1 or more&lt;br /&gt;
* Trig2ormore                     - ditto, 2 or more&lt;br /&gt;
* Trig3ormore                     - ditto, 3 or more&lt;br /&gt;
* Trig4ormore                     - ditto, 4 or more&lt;br /&gt;
* TrigAdcGrandOr                  - trigger on any ADC signal&lt;br /&gt;
* TrigAwCoincA                    - trigger on TPC AW coincidence (see [[TRG]] manual)&lt;br /&gt;
* TrigAwCoincB                    - ditto&lt;br /&gt;
* TrigAwCoincC                    - ditto&lt;br /&gt;
* TrigAwCoincD                    - ditto&lt;br /&gt;
* TrigAwCoinc                     - ditto&lt;br /&gt;
* TrigAw1ormore	- trigger on TPC AW per-preamp multiplicity 1 or more (see [[TRG]] manual)&lt;br /&gt;
* TrigAw2ormore	- ditto, 2 or more&lt;br /&gt;
* TrigAw3ormore	- ditto, 3 or more&lt;br /&gt;
* TrigAw4ormore - ditto, 4 or more&lt;br /&gt;
* TrigAwMLU                       - trigger on TPC AW MLU signal (see [[TRG]] manual)&lt;br /&gt;
* TrigBscGrandOr                  - trigger on any BSC signal&lt;br /&gt;
* TrigBscMult                     - trigger on predefined BSC multiplicity (see [[TRG]] manual)&lt;br /&gt;
* TrigCoinc                       - trigger on predefined coincidence of TPC AW, BSC and external signal (see [[TRG]] manual)&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TRG - trigger settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will not do anything with the trigger board. Normal value &amp;quot;y&amp;quot;&lt;br /&gt;
* Modules - hostnames of the trigger board. Normal value &amp;quot;alphat01&amp;quot;&lt;br /&gt;
* NimMask - 32-bit mask for the 32x NIM inputs (see TRG manual). Normal value 0, unless external trigger is in use.&lt;br /&gt;
* EsataMask - 32-bit mask for the 32x eSATA signals (see TRG manual). Normal value 0.&lt;br /&gt;
* adc16_mask[16] - 16x 16-bit mask for the 100MHz GRIF-16 onboard ADCs (see TRG manual). Normal value 0xFFFF for all 16 data links.&lt;br /&gt;
* adc32_mask[16] - 16x 32-bit mask for the 62.5MHz FMC-ADC32 ADCs (see TRG manual). Normal value 0xFFFFFFFF for all 16 data links.&lt;br /&gt;
* PassThrough - if set to &amp;quot;y&amp;quot;, trigger is passed through the trigger module without generating any events and without causing deadtime.&lt;br /&gt;
* AwCoincA, B, C and D - 32-bit masks for the aw16 coincidence trigger (see TRG manual)&lt;br /&gt;
* Aw16FromAdc16 - route AW trigger (aw16) from adc16 (100MHz ADCs 0..15)&lt;br /&gt;
* Aw16FromAdc32a - route AW trigger (aw16) from adc32 group 15..0 (62.5MHz FMC-ADC32 in ADCs 0..7)&lt;br /&gt;
* Aw16FromAdc32b - route AW trigger (aw16) from adc32 group 31..16 (62.5MHz FMC-ADC32 in ADCs 8..15)&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/PWB - PWB settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will not do anything with PWBs. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_boot_user_page - if set to &amp;quot;n&amp;quot;, fectrl will not try to reboot PWBs into the user page firmware. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_trigger - if set to &amp;quot;n&amp;quot;, all PWBs will be set to ignore the trigger. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_trigger_group_a - field wire pulser defeats the data suppression (every channel has a pulse) resulting in too much data overwhelming the DAQ (lost UDP packets). To permit correct data taking of field wire pulser data, PWBs are split into two groups (a and b), only one of the two groups should be enabled for field wire pulser runs. Both groups should be enabled for normal data taking. Normal value is &amp;quot;y&amp;quot;&lt;br /&gt;
* enable_trigger_group_b - see &amp;quot;enable_trigger_group_a&amp;quot;. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* modules[64] - hostnames of PWB boards&lt;br /&gt;
* boot_user_page[64] - if set to &amp;quot;y&amp;quot; and enable_boot_user_page is &amp;quot;y&amp;quot;, fectrl will reboot the corresponding PWB to the user page firmware.&lt;br /&gt;
* trigger[64] - if set to &amp;quot;y&amp;quot; and enable_trigget is &amp;quot;y&amp;quot;, fectrl will set the PWB to accept the trigger.&lt;br /&gt;
* ch_enable - if set to &amp;quot;n&amp;quot; disables all PWB channels. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* ch_force - is set to &amp;quot;y&amp;quot; disables channel suppression (all PWB channels are read)&lt;br /&gt;
* suppress_reset - if set to &amp;quot;y&amp;quot; enables channel suppression for reset channels (threshold has to be set correctly)&lt;br /&gt;
* suppress_fpn - if set to &amp;quot;y&amp;quot; enables channel suppression for fpn channels (threshold has to be set correctly)&lt;br /&gt;
* suppress_pads -  set to &amp;quot;y&amp;quot; enables channel suppression for TPC pad channels (threshold has to be set correctly)&lt;br /&gt;
* disable_reset1 - data suppression algorithm does not work for the channel &amp;quot;reset1&amp;quot; and it has to be suppressed explicitly by setting this value to &amp;quot;y&amp;quot;. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* baseline_{reset,fpn,pads}[64] - waveform baseline for each PWB position&lt;br /&gt;
* threshold_{reset,fpn,pads} - waveform suppression threshold, see below:&lt;br /&gt;
* ch_threshold - PWB sca_N_ch_threshold, if set to 0, threshold is computed as &amp;quot;baseline_pads[seqpwb]-threshold_pads&amp;quot;. Normal value is 0.&lt;br /&gt;
* test_mode - enable PWB test mode, the ADC data is replaced with a test pattern, see PWB esper variable signalproc/test_mode&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TDC - TDC settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will tell the event builder that the TDC is not running. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/EvbConfig - EVB configuration ==&lt;br /&gt;
All arrays have the same size corresponding to the number of EVB slots.&lt;br /&gt;
* name[] - slot name for the web page (trg01, adc01, adc01/adc32, pwb31/0, tdc01, etc)&lt;br /&gt;
* type[] - slot type: 1=TRG, 2=ADC16 and ADC32, 3=obsolete PWB, 4=obsolete PWB, 5=PWB, 6=TDC&lt;br /&gt;
* module[] - module number (adcNN, adcNN+100, pwbNN, etc)&lt;br /&gt;
* nbanks[] - number of expected banks (16 for ADC16, 32 for ADC32, not used, set to 1 for all others)&lt;br /&gt;
* tsfreq[] - timestamp frequency in Hz.&lt;br /&gt;
&lt;br /&gt;
= Trigger configuration =&lt;br /&gt;
&lt;br /&gt;
These trigger modes are implemented:&lt;br /&gt;
* (manual trigger from web page)&lt;br /&gt;
* software pulser trigger (from fectrl)&lt;br /&gt;
* hardware pulser trigger (from the trigger board)&lt;br /&gt;
* NIM and eSATA trigger from ADC front panel inputs&lt;br /&gt;
* adc16 and adc32 discriminator triggers:&lt;br /&gt;
** adc16 grand-or trigger&lt;br /&gt;
** adc32 grand-or trigger&lt;br /&gt;
** adc (adc16+adc32) grand-or trigger&lt;br /&gt;
** adc16 multiplicity trigger (1ormore, 2ormore, 3ormore, 4ormore) for use with barrel scintillator&lt;br /&gt;
** anode wire multiplicity trigger (1ormore, 2ormore, 3ormore, 4ormore) (anode wire signals can be fed from adc16 or from adc32 signals)&lt;br /&gt;
** anode wire coincidence trigger&lt;br /&gt;
** anode wire MLU (memory lookup) trigger&lt;br /&gt;
&lt;br /&gt;
== NIM trigger from ADC front panel ==&lt;br /&gt;
&lt;br /&gt;
Trigger path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NIM signal --&amp;gt; LEMO input on ADC front panel --&amp;gt; data encoder --&amp;gt; data link to trigger board --&amp;gt; data decoder --&amp;gt; mask --&amp;gt; nim-esata-grand-or --&amp;gt; trigger&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable NIM trigger, do this:&lt;br /&gt;
* connect NIM signal to ADC front panel input&lt;br /&gt;
** Note1: NIM signal must be inverted&lt;br /&gt;
** Note2: LEMO connectors should be set to &amp;quot;NIM input&amp;quot; mode by ADC on-board jumpers (see ADC manual)&lt;br /&gt;
* observe correct bit goes to zero in the TRG web page: data link high work should change:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0xNF00&#039;0000 (N is the module id) to&lt;br /&gt;
0xN700&#039;0000 (left lemo) or&lt;br /&gt;
0xNB00&#039;0000 (right lemo)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Note3: if data link bits do not change, most likely the LEMO connectors are set to &amp;quot;DAC output&amp;quot; mode. Try to use LEMO inputs of a different ADC.&lt;br /&gt;
* compute the NIM mask: there are 32 bits, 2 bits per ADC data link. Bit 0x1 is right LEMO, bit 0x2 is left LEMO&lt;br /&gt;
* for example, to use left LEMO of ADC data link 12, set nim mask to (0x2)&amp;lt;&amp;lt;(2*12) = 0x02000000&lt;br /&gt;
* development branch of the git repository contains &#039;&#039;scripts/nim_mask.py&#039;&#039;, which can compute forwards and backwards&lt;br /&gt;
* initialize the trigger board (on the TRG web page press button &amp;quot;initialize&amp;quot;), or start a new run&lt;br /&gt;
* on the history plot with &amp;quot;NIM grand or&amp;quot; counter, the rate should change from zero&lt;br /&gt;
* if a run is active, if one of the ADC LEMO outputs is set to output the trigger signal as a NIM pulse, one should see it fire use a scope. The delay or jitter between NIM trigger in and NIM trigger out should be around 100-200 ns (FIXME - measure this!)&lt;br /&gt;
* to set the DAQ to trigger on the NIM signal, on the run start page, check the box &amp;quot;TrigEsataNimGrandOr&amp;quot;.&lt;br /&gt;
** Note: remember to set the scaledown to 0 if so desired.&lt;br /&gt;
&lt;br /&gt;
= TPC field wire pulser =&lt;br /&gt;
&lt;br /&gt;
The TPC field wire pulser input should be connected directly to the DAC output of adc01 (right lemo connector).&lt;br /&gt;
&lt;br /&gt;
DAC settings in ODB /Equipment/CTRL/Settings/ADC/DAC/&lt;br /&gt;
&lt;br /&gt;
* for pulsing PWBs:&lt;br /&gt;
** dac_baseline: -8000&lt;br /&gt;
** dac_amplitude: 4000&lt;br /&gt;
** ramp_up_rate: 128&lt;br /&gt;
** ramp_down_rate: 70&lt;br /&gt;
** ramp_top_len: 128&lt;br /&gt;
&lt;br /&gt;
* for pulsing AW: (PWB settings drive the ADCs out of range!)&lt;br /&gt;
** dac_baseline: -2000&lt;br /&gt;
** dac_amplitude: 4000&lt;br /&gt;
** ramp_up_rate: 20&lt;br /&gt;
** ramp_down_rate: 20&lt;br /&gt;
** ramp_top_len: 128&lt;br /&gt;
&lt;br /&gt;
= TDC connections =&lt;br /&gt;
&lt;br /&gt;
* SFP8 - fiber SFP to Juniper switch&lt;br /&gt;
* right RJ45 - 200MHz clock&lt;br /&gt;
* left RJ45 - external trigger&lt;br /&gt;
&lt;br /&gt;
= MIDAS Data banks =&lt;br /&gt;
&lt;br /&gt;
* ATAT - fectrl - UDP packets from GRIF-C/TRG trigger board&lt;br /&gt;
* TRBA - fetdc - TDC data&lt;br /&gt;
* TRTM - fetdc - TDC FPGA temperatures, TID_FLOAT[5].&lt;br /&gt;
* AAnn - feudp - UDP packets from GRIF-16 ADC (before the event builder), &amp;quot;nn&amp;quot; is the ADC module number: adc01 is AA01 through adc20 is AA20.&lt;br /&gt;
* BBxx - feudp - UDP packets from PWB, obsolete&lt;br /&gt;
* Bnnm, Cnnm - feevb - EVB output banks: ADC data, &amp;quot;nn&amp;quot; is the ADC module number (1..20), &amp;quot;m&amp;quot; is the channel number (0..9,A..F), format is same as AAnn banks.&lt;br /&gt;
* PAnn - feudp - UDP packets from PWB, &amp;quot;nn&amp;quot; is the PWB module number (00..99), obsolete&lt;br /&gt;
* PBnn - feudp - UDP packets from PWB, &amp;quot;nn&amp;quot; is the PWB module number (00..99), PB01 is pwb01, PB78 is pwb78&lt;br /&gt;
* PCnn - feevb - EVB output banks: PWB data, &amp;quot;nn&amp;quot; is the PWB module number (00..99), same as above, format is same as PBnn banks&lt;br /&gt;
&lt;br /&gt;
= ZZZ =&lt;br /&gt;
&lt;br /&gt;
ZZZ&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Daq&amp;diff=641</id>
		<title>Daq</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Daq&amp;diff=641"/>
		<updated>2020-12-23T22:55:46Z</updated>

		<summary type="html">&lt;p&gt;Acapra: correct git repo link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Links =&lt;br /&gt;
&lt;br /&gt;
* https://alphacpc05.cern.ch/agdaq/ -- midas daq page for the agdaq system at CERN&lt;br /&gt;
* https://daq16.triumf.ca -- midas daq page for the agmini system at TRIUMF&lt;br /&gt;
* https://daq.triumf.ca/elog-alphag/alphag/ -- elog&lt;br /&gt;
* https://daqstore.triumf.ca/AgWiki/index.php/Main_Page -- this wiki&lt;br /&gt;
* https://bitbucket.org/ttriumfdaq/agdaq - git repository for agdaq&lt;br /&gt;
* https://bitbucket.org/expalpha-- git repository on bitbucket&lt;br /&gt;
* https://edev-group.triumf.ca/fw/exp/alphag -- git repository on edev gitlab&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/170 - PWB inventory database&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/168 - ADC (GRIF-16) inventory, FMC-ADC32rev0,rev1 inventory&lt;br /&gt;
* https://ladd00.triumf.ca/daqinv/frontend/list/176 - FMC-ADC32rev1.1 inventory&lt;br /&gt;
&lt;br /&gt;
= Hardware manuals =&lt;br /&gt;
&lt;br /&gt;
* [[TRG]] - trigger board (GRIF-C) manual&lt;br /&gt;
* CDM - https://daq.triumf.ca/DaqWiki/index.php/VME-CDM -- clock VME-CDM manual&lt;br /&gt;
* ADC - https://daq.triumf.ca/DaqWiki/index.php/VME-GRIF-ADC16-Rev1 -- GRIF-16 ADC manual&lt;br /&gt;
* [[PWB]] - TPC Pad Wing Board manual&lt;br /&gt;
* TDC - https://www.triumf.info/wiki/DAQwiki/index.php/GSI_TRB3&lt;br /&gt;
* [[chronobox]] - chronobox manual&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
Full system: (ADC fw rel-20201112-ko, PWB fw 20201005_ko)&lt;br /&gt;
* 1 Hz stable, ADC adc32 9 supp off rate 0.3 M/s, adc16 off, PWB udp_delay 25 supp off active 64 rate 6.6+4+6+4.6=21.2 M/s, TDC off, total rate 21 M/s&lt;br /&gt;
* 500 Hz stable, ADC adc32 9 supp 1500 rate 6 M/s, adc16 off, PWB udp_delay 10 supp 100 active 63 rate 3+4+3+3=13 M/s, TDC off, total rate 19 M/s&lt;br /&gt;
&lt;br /&gt;
Single ADC: (fw rel-20201112-ko)&lt;br /&gt;
&lt;br /&gt;
Fully suppressed data, sthreshold 5000&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 500 Hz: stable (nominal max trigger rate)&lt;br /&gt;
* 6700 Hz: stable, 8 Mbytes/sec&lt;br /&gt;
* 6800 Hz: evb eventually confused&lt;br /&gt;
* 6850 Hz: evb confused, no lost triggers in the ADC, no crash in the ADC&lt;br /&gt;
&lt;br /&gt;
All data, 510 samples/event, sthreshold 10 (fw rel-20201122-ko)&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 100 Hz: stable, 3.4 Mbytes/sec&lt;br /&gt;
* 500 Hz: stable, 17 Mbytes/sec (nominal max trigger rate)&lt;br /&gt;
* 1000 Hz: stable, 32 Mbytes/sec&lt;br /&gt;
* 3100 Hz: stable, 106 M/s (approaching saturation of 1gige ethernet)&lt;br /&gt;
* 3200 Hz: stable, 110 M/s - TRG communication is in trouble&lt;br /&gt;
* 3300 Hz: stable, 116 M/s&lt;br /&gt;
* 3400 Hz: incomplete events, no ADC crash (&amp;quot;dropped due to full&amp;quot; counting, &amp;quot;dropped due to busy&amp;quot; are zero, this is as expected).&lt;br /&gt;
&lt;br /&gt;
no suppression (different fpga data path)&lt;br /&gt;
* 1 Hz: stable&lt;br /&gt;
* 100 Hz: stable&lt;br /&gt;
* 500 Hz: stable, 17 M/s (nominal max trigger rate)&lt;br /&gt;
* 1000 Hz: stable, 32 M/s&lt;br /&gt;
* 3000 Hz: stable, 100 M/s (approaching saturation of 1gige ethernet)&lt;br /&gt;
* 3300 Hz: incomplete events, no ADC crash (&amp;quot;dropped due to full&amp;quot; counting, &amp;quot;dropped due to busy&amp;quot; are zero, this is as expected).&lt;br /&gt;
&lt;br /&gt;
= Network connections =&lt;br /&gt;
&lt;br /&gt;
The experiment private network number is: 192.168.1.x, gateway 192.168.1.1, netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
network map:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
---- TRIUMF/CERN network --1gige-- alphagdaq --10gige-- juniper switch --1gige-- centrecom switch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== alphagdaq network connections ==&lt;br /&gt;
&lt;br /&gt;
on the rear of the machine:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
|   | rj45 | rj45 |         | sfp | sfp |&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
- left rj45 - copper 1gige - eno1 - spare (inactive)&lt;br /&gt;
- right rj45 - copper 1gige - eno2 - dhcp - cern/triumf network&lt;br /&gt;
- left sfp - 10gige - enp1s0f1 - spare (inactive)&lt;br /&gt;
- right sfp - 10gige - enp1s0f0 - static 192.168.1.1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== connections between switches ==&lt;br /&gt;
&lt;br /&gt;
* alphagdaq to juniper switch: direct attach (DAC) 10gige cable into any port of juniper switch&lt;br /&gt;
* juniper switch to centrecom switch: rj45 sfp in any port of juniper switch - cat5e/cat6 cable - to any port of centrecom switch&lt;br /&gt;
* cat5e/cat6 cable from any port of centrecom switch to the XXX port on the back of the juniper switch&lt;br /&gt;
&lt;br /&gt;
== juniper switch ==&lt;br /&gt;
&lt;br /&gt;
connected to juniper switch front is:&lt;br /&gt;
&lt;br /&gt;
* everything that sends event data to alphagdaq, specifically:&lt;br /&gt;
** TRG (rj45 sfp)&lt;br /&gt;
** 16x ADC (fiber sfp)&lt;br /&gt;
** 64x PWB (fiber sfp)&lt;br /&gt;
* 10gige uplink to alphagdaq (10gige DAC cable)&lt;br /&gt;
* 1gige link to centrecom switch (rj45 sfp)&lt;br /&gt;
* 40gige ports are not used&lt;br /&gt;
&lt;br /&gt;
connected to the juniper switch rear:&lt;br /&gt;
&lt;br /&gt;
* CON is the serial console via RJ45-to-DB9 to USB-serial adapter to alphagdaq USB port (9600bps, 8N1, no flow control)&lt;br /&gt;
* C0 is the management ethernet interface port, connect to any port on the centrecom switch (juniper-private will ping)&lt;br /&gt;
&lt;br /&gt;
== centrecom switch ==&lt;br /&gt;
&lt;br /&gt;
* everything with copper rj45 connections, specifically:&lt;br /&gt;
** CDM boards&lt;br /&gt;
** HV, LV and VME power supplies&lt;br /&gt;
** RaspberryPi3 boards&lt;br /&gt;
** gas handling MFCs (algas)&lt;br /&gt;
** cooling system controller (moxa01)&lt;br /&gt;
&lt;br /&gt;
= USB connections =&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
* alphagdaq has USB2 and USB3 connections. They are not the same, they are not generally interchangeable.&lt;br /&gt;
* USB3 connections and cables are generally blue coloured.&lt;br /&gt;
&lt;br /&gt;
List of USB connections from alphagdaq:&lt;br /&gt;
&lt;br /&gt;
* front USB3 port (blue): USB-A-to-B cable to USB blaster connected to the trigger board (front of rack)&lt;br /&gt;
* rear USB3 port (blue): USB3 short jumper to USB3 hub&lt;br /&gt;
* rear USB2 port (black): USB2 unpowered hub (Logiix) to USB-A-to-B cable to UPS USB connector&lt;br /&gt;
* rear USB2 port (black): USB-to-Serial adaper to DB9 to RJ45 adapter to Juniper switch console port&lt;br /&gt;
&lt;br /&gt;
Note: UPS USB connection does not work with alphagdaq USB ports (both usb2 and usb3), but combination&lt;br /&gt;
using the unpowered USB2 hub seems to work ok.&lt;br /&gt;
&lt;br /&gt;
List of USB connections from the USB hub:&lt;br /&gt;
&lt;br /&gt;
* this is a powered USB3 hub&lt;br /&gt;
* USB-A-to-MicroUSB - to lvdb boards&lt;br /&gt;
* USB-A-to-Wiener interlock cable&lt;br /&gt;
&lt;br /&gt;
= Clock and trigger distribution =&lt;br /&gt;
&lt;br /&gt;
== Explanation ==&lt;br /&gt;
&lt;br /&gt;
Trigger is generated by the trigger board (aka TRG, aka GRIF-C),&lt;br /&gt;
from the TRG eSATA output through the eSATA splitter it is fed into&lt;br /&gt;
the master CDM. The master CDM outputs the trigger on all MiniSAS output ports.&lt;br /&gt;
One of the master CDM MiniSAS outputs is connected to the CDM slave eSATA input.&lt;br /&gt;
The same as the master CDM, the slave CDM outputs the trigger on all MiniSAS output ports.&lt;br /&gt;
&lt;br /&gt;
The master 62.5MHz clock is generated by the master CDM using the internal 10MHz oscillator&lt;br /&gt;
or the external 10MHz AD clock. Also on MiniSAS port 6 the master CDM generates&lt;br /&gt;
the 200MHz clock for the TDC. This clock is frequency-locked to the master 62.5MHz clock.&lt;br /&gt;
&lt;br /&gt;
Master CDM clock selection (external CD 10MHz clock or internal oscillator 10MHz clock)&lt;br /&gt;
is done by a magic esper command (see below).&lt;br /&gt;
&lt;br /&gt;
From the master CDM, the clock is fed to: the slave CDM, the TRG (via the eSATA splitter)&lt;br /&gt;
and to the TDC (via the RJ45 splitter).&lt;br /&gt;
&lt;br /&gt;
The slave CDM sends the clock and the trigger to the ADCs and PWBs.&lt;br /&gt;
&lt;br /&gt;
== Schematic ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TRG (GRIF-C)&lt;br /&gt;
------------&lt;br /&gt;
eSATA &amp;lt;------&amp;gt; eSATA splitter&lt;br /&gt;
&lt;br /&gt;
eSATA splitter&lt;br /&gt;
--------------&lt;br /&gt;
trigger ---&amp;gt; eSATA ---&amp;gt; CDM-Master eSATA (trigger signal)&lt;br /&gt;
clock &amp;lt;--- (eSATA --- MiniSAS) &amp;lt;--- CDM MiniSAS (62.5MHz clock)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CDM-Master&lt;br /&gt;
----------&lt;br /&gt;
eSATA &amp;lt;--- eSATA splitter &amp;lt;--- eSATA from TRG (trigger signal)&lt;br /&gt;
MiniSAS 1 --&amp;gt; (MiniSAS --- eSATA) --&amp;gt; CDM-Slave eSATA (62.5 MHz)&lt;br /&gt;
MiniSAS 6 --&amp;gt; (MiniSAS --- eSATA) --&amp;gt; eSATA splitter --&amp;gt; RJ45 --&amp;gt; TDC (200 MHz)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CDM-Slave&lt;br /&gt;
---------&lt;br /&gt;
eSATA &amp;lt;--- trigger and 62.5MHz clock from CDM-Master&lt;br /&gt;
MiniSAS 1 --&amp;gt; ADC trigger and 62.5MHz clock&lt;br /&gt;
MiniSAS 2 --&amp;gt; same&lt;br /&gt;
MiniSAS 3 --&amp;gt; same&lt;br /&gt;
MiniSAS 4 --&amp;gt; same&lt;br /&gt;
MiniSAS 5 --&amp;gt; PWB trigger and 62.5MHz clock&lt;br /&gt;
MiniSAS 6 --&amp;gt; same&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup of CDM boards ==&lt;br /&gt;
&lt;br /&gt;
ALPHA-g uses the Rev3 CDM boards. The 4 CDM boards that belong to ALPHA-g&lt;br /&gt;
have serial numbers 0, 1, 2 and 3 and are labeled cdm00, cdm01, cdm02, cdm03.&lt;br /&gt;
&lt;br /&gt;
All the boards can be used as master and slave positions, but have to be&lt;br /&gt;
configured appropriately.&lt;br /&gt;
&lt;br /&gt;
=== Slave setup ===&lt;br /&gt;
&lt;br /&gt;
* install the board&lt;br /&gt;
* connect ethernet&lt;br /&gt;
* connect esata external clock&lt;br /&gt;
* esper-tool cdmNN ### i.e. esper-tool cdm01&lt;br /&gt;
* cd template&lt;br /&gt;
* write current_setup 4&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* read&lt;br /&gt;
* observe clock frequency counters report correct values. &amp;quot;ext_clk&amp;quot; will only count if the lemo jumper is installed (see below)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11    esata_clk        uint32           R                 [62500246]                      &lt;br /&gt;
12    ext_clk          uint32           R                 [62500246]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
156   ld1_counter      uint32           RW                [3]                             &lt;br /&gt;
157   ld2_counter      uint32           RW                [3]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If needed, check correct operation of the pll lock monitoring:&lt;br /&gt;
&lt;br /&gt;
* unplug the esata cable from the master CDM&lt;br /&gt;
* &amp;quot;red&amp;quot; light should go off&lt;br /&gt;
* read of lmk should report &amp;quot;pll1_ld&amp;quot; value 0 and &amp;quot;ld1_counter&amp;quot; and &amp;quot;ld2_counter&amp;quot; should increment&lt;br /&gt;
* reconnect the esata cable&lt;br /&gt;
* &amp;quot;red&amp;quot; light should return&lt;br /&gt;
* read of lmk should report both pll1_ld and pll2_ld locked (values &amp;quot;1&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Master setup ===&lt;br /&gt;
&lt;br /&gt;
* install the board&lt;br /&gt;
* connect ethernet&lt;br /&gt;
* esper-tool cdmNN ### i.e. esper-tool cdm01&lt;br /&gt;
* cd template&lt;br /&gt;
* write current_setup 3&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* write clkin_sel_mode 0&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* read&lt;br /&gt;
* observe clock frequency counters report correct values. &amp;quot;ext_clk&amp;quot; will only count if the &amp;quot;clock loopback&amp;quot; lemo jumper is installed (see below)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
12    ext_clk          uint32           R                 [62500189]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
156   ld1_counter      uint32           RW                [3]                             &lt;br /&gt;
157   ld2_counter      uint32           RW                [3]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the 200MHz clock:&lt;br /&gt;
* connect MiniSAS-eSATA splitter cable to MiniSAS output 6, connect eSATA end to CDM eSATA input&lt;br /&gt;
* in esper-tool, read cdm: esata_clk should report 200MHz clock&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11    esata_clk        uint32           R                 [200000603]                     &lt;br /&gt;
12    ext_clk          uint32           R                 [62500188]                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Master setup with external 10 MHz clock ===&lt;br /&gt;
&lt;br /&gt;
* setup master CDM as above (using internal clock)&lt;br /&gt;
* connect 10MHz external clock to right LEMO #1&lt;br /&gt;
* esper-tool cdmNN&lt;br /&gt;
* cd /cdm&lt;br /&gt;
* write sel_nim 1 # if clock is NIM signal&lt;br /&gt;
* write sel_nim 0 # if clock is TTL signal (i.e. chronobox LEMO output)&lt;br /&gt;
* read ext_clk&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[http://cdm00:/cdm]&amp;gt; read ext_clk&lt;br /&gt;
9999556&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* if ext_clk reads 0 or does not read something close to 10MHz, stop here. debug the signal, try changing sel_nim, etc.&lt;br /&gt;
* cd /lmk&lt;br /&gt;
* write clkin_sel_mode 2 # select external clock&lt;br /&gt;
* read&lt;br /&gt;
* observe both PLL1 and PLL2 are locked: both values should be &amp;quot;1&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
150   clkin2_sel       bool             R                 [True]                          &lt;br /&gt;
144   pll1_ld          uint8            R                 [1]                             &lt;br /&gt;
147   pll2_ld          uint8            R                 [1]                             &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* on the MIDAS TRG page, observe that TRG measured external clock frequency is close to 62.5 MHz&lt;br /&gt;
&lt;br /&gt;
== clkin_sel_mode positions ==&lt;br /&gt;
&lt;br /&gt;
* 0 = 10MHz internal oscillator (use on master CDM in standalone mode)&lt;br /&gt;
* 1 = eSATA clock (use on slave CDM)&lt;br /&gt;
* 2 = external clock, should be 10MHz (use on master CDM to run from AD clock)&lt;br /&gt;
&lt;br /&gt;
== LEMO connections ==&lt;br /&gt;
&lt;br /&gt;
* clock loopback jumper: to read the frequency of the generated 62.5MHz clock, connect LEMO cable from left LEMO #2 to the right LEMO #1&lt;br /&gt;
* 10MHz internal clock jumper: to feed 10MHz internal oscillator to the external clock, connect LEMO cable from right  LEMO #3 to the right LEMO #1.&lt;br /&gt;
* 10MHz external clock: to feed 10MHz external clock, connect LEMO cable to right LEMO #1&lt;br /&gt;
&lt;br /&gt;
= MIDAS frontends =&lt;br /&gt;
&lt;br /&gt;
== UDP ==&lt;br /&gt;
&lt;br /&gt;
feudp receives udp packets from the ADC and PWB boards. For each udp packet 1 midas event is created,&lt;br /&gt;
with 1 data bank containing the udp data. Events are sent into the MIDAS event buffer BUFUDP. The names&lt;br /&gt;
of the data banks are assigned in ODB /eq/feudp/settings.&lt;br /&gt;
&lt;br /&gt;
{ADC,PWB} --&amp;gt; 1gige --&amp;gt; switch --&amp;gt; 10gige --&amp;gt; alphagdaq --&amp;gt; feudp -&amp;gt; BUFUDP&lt;br /&gt;
&lt;br /&gt;
== CTRL ==&lt;br /&gt;
&lt;br /&gt;
fectrl controls all the ADC, PWB and trigger boards. It provides run start and stop sequencing,&lt;br /&gt;
runs the event synchronization sequence at the begin of the run, and records slow controls data (temperatures,&lt;br /&gt;
voltages, etc).&lt;br /&gt;
&lt;br /&gt;
fectrl receives UDP data packets from the trigger board and sends them to the MIDAS event buffer BUFUDP.&lt;br /&gt;
&lt;br /&gt;
fectrl receives commands from the control web pages (for ADC, PWB and trigger) to reboot, initialize, etc the boards.&lt;br /&gt;
&lt;br /&gt;
fectrl configures the event builder via odb /eq/fectrl/evbconfig.&lt;br /&gt;
&lt;br /&gt;
ADC &amp;lt;-&amp;gt; http esper &amp;lt;-&amp;gt; fectrl -&amp;gt; slow control data into midas history&lt;br /&gt;
&lt;br /&gt;
PWB &amp;lt;-&amp;gt; http esper &amp;lt;-&amp;gt; fectrl -&amp;gt; slow control data into midas history&lt;br /&gt;
&lt;br /&gt;
TRG &amp;lt;-&amp;gt; udp comm &amp;lt;-&amp;gt; fectrl -&amp;gt; BUFUDP, slow control and counters into midas history&lt;br /&gt;
&lt;br /&gt;
fectrl &amp;lt;-&amp;gt; midas rpc &amp;lt;-&amp;gt; mhttpd &amp;lt;-&amp;gt; json rpc &amp;lt;-&amp;gt; control web pages for ADC, PWB and trigger&lt;br /&gt;
&lt;br /&gt;
== EVB ==&lt;br /&gt;
&lt;br /&gt;
feevb receives udp packet data from the MIDAS event buffer BUFUDP, inspects the packet timestamps&lt;br /&gt;
and collects the data with matching timestamps into physics events. feevb has provisions to do&lt;br /&gt;
data suppression, reduction and compression in addition to the data reduction done&lt;br /&gt;
in the ADC and PWB firmware.&lt;br /&gt;
&lt;br /&gt;
feevb event synchronization relies on the event synchronization sequence done by fectrl when a run is started.&lt;br /&gt;
&lt;br /&gt;
{ADC, PWB, TRG} -&amp;gt; BUFUDP -&amp;gt; feevb -&amp;gt; SYSTEM -&amp;gt; mlogger -&amp;gt; compression -&amp;gt; disk storage&lt;br /&gt;
&lt;br /&gt;
=== internal structure ===&lt;br /&gt;
&lt;br /&gt;
* event buffer readers, instances for BUFTRG, BUFTDC, BUFADC, BUFUDP&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BufferReader class - reads one midas event buffer:&lt;br /&gt;
- BufferReaderThread()&lt;br /&gt;
-- in batches of 1000 events&lt;br /&gt;
--- lock&lt;br /&gt;
--- TickLocked()&lt;br /&gt;
----- ReadEvent() -&amp;gt; bm_receive_event_alloc()&lt;br /&gt;
----- fHandler-&amp;gt;HandleEvent()&lt;br /&gt;
-- fHandler-&amp;gt;XMaybeFlushBank()&lt;br /&gt;
-- sleep 100 usec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* event header decoder and intermediate buffer&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Handler class - accumulates events, sends them to the EVB in batches&lt;br /&gt;
&lt;br /&gt;
- HandleEvent() &amp;lt;- BufferReaderThread() - receive incoming events&lt;br /&gt;
-- loop over all banks, examine bank name&lt;br /&gt;
--- call AddAdcBank(), AddPwbBank(), AddTrgBank(), AddTdcBank() according to bank name&lt;br /&gt;
----  AddXxxBank() -&amp;gt; XAddBank()&lt;br /&gt;
--- unknown banks go directly to evb-&amp;gt;SendQueue&lt;br /&gt;
-- check if synchronization has completed&lt;br /&gt;
&lt;br /&gt;
- XAddBank() - save BankBuf objects in a buffer&lt;br /&gt;
&lt;br /&gt;
- XMaybeFlushBank(), XFlushBank() - send all accumulated data to the Evb class&lt;br /&gt;
-- evb-&amp;gt;lock()&lt;br /&gt;
-- for each buffered BankBuf objects,&lt;br /&gt;
--- call evb-&amp;gt;AddBankLocked()&lt;br /&gt;
-- buffer is now empty&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* event builder&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Evb class - assemble event fragments according to timestamps&lt;br /&gt;
&lt;br /&gt;
- fEvents fifo (deque) - time sorted list of partially assembled events&lt;br /&gt;
-- new entries are added by FindEvent()&lt;br /&gt;
-- entries are modified by MergeSlot()&lt;br /&gt;
-- old entries are removed by GetLocked()&lt;br /&gt;
&lt;br /&gt;
- AddBankLocked() &amp;lt;- XFlushBank() &amp;lt;- BufferReaderThread()&lt;br /&gt;
-- call fSync-&amp;gt;Add()&lt;br /&gt;
-- transform BankBuf to EvbEventBuf&lt;br /&gt;
-- push it into per-module buffer fBuf[imodule]&lt;br /&gt;
&lt;br /&gt;
- EvbThread()&lt;br /&gt;
-- EvbTickLocked()&lt;br /&gt;
--- BuildLocked()&lt;br /&gt;
---- in a loop, for no more than 1 sec&lt;br /&gt;
----- loop over all per-module buffers fBuf&lt;br /&gt;
------ pop first entry, pass it to BuildSlot()&lt;br /&gt;
------- call FindEvent()&lt;br /&gt;
------- call MergeSlot()&lt;br /&gt;
------- call CheckEvent()&lt;br /&gt;
--- in a loop&lt;br /&gt;
---- get all completed events via GetLocked() pass them to SendQueue-&amp;gt;PushEvent()&lt;br /&gt;
-- if done nothing, sleep 100 usec, otherwise nominal sleep to free the evb lock&lt;br /&gt;
&lt;br /&gt;
- GetNext() &amp;lt;- GetLocked() &amp;lt;- EvbThread() - get completed events&lt;br /&gt;
-- examine oldest EvbEvent entry in fEvents:&lt;br /&gt;
-- pop it if it is complete&lt;br /&gt;
-- pop it if it is too old (to prevent old incomplete events from stalling the evb) (&amp;quot;pop age&amp;quot; on the evb page)&lt;br /&gt;
-- pop it if a following event is complete (&amp;quot;pop following&amp;quot; on the evb page)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* send queue&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SendQueue class - prepare events for writing to midas SYSTEM event buffer&lt;br /&gt;
&lt;br /&gt;
- PushEvent() &amp;lt;- EvbThread()&lt;br /&gt;
-- push FragmentBuf into the queue&lt;br /&gt;
&lt;br /&gt;
- SendQueueThread()&lt;br /&gt;
-- in a batch of 1000 events, call Tick()&lt;br /&gt;
--- pop FragmentBuf from the queue, call SendEvent()&lt;br /&gt;
--- compose midas event (memcpy()!)&lt;br /&gt;
--- TMFE fEq-&amp;gt;SendEvent()&lt;br /&gt;
--- bm_send_event()&lt;br /&gt;
-- sleep 100 usec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* equipment object&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EvbEq class - implements the midas equipment&lt;br /&gt;
- HandleBeginRun()&lt;br /&gt;
- HandleEndRun()&lt;br /&gt;
- HandlePeriodic()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== multithreading ===&lt;br /&gt;
&lt;br /&gt;
* BufferReaderThread() one per midas event buffer&lt;br /&gt;
** high CPU use: bm_receive_event(), AddXxxBank()&lt;br /&gt;
** lock contention: midas event buffer lock, evb lock into XFlushBank-&amp;gt;AddBankLocked()&lt;br /&gt;
* EvbThread()&lt;br /&gt;
** O(size of fEvents): FindEvent(), GetNext()&lt;br /&gt;
** lock contention: evb lock against XFlushBank(), SendQueue lock (1 per output event)&lt;br /&gt;
* SendQueueThread()&lt;br /&gt;
** high CPU use: memcpy() in SendEvent(), memcpy() in bm_send_event&lt;br /&gt;
** lock contention: event queue lock against EvbThread, midas event buffer lock&lt;br /&gt;
* main thread&lt;br /&gt;
** lock contention: evb lock in ReportEvb() and elsewhere&lt;br /&gt;
&lt;br /&gt;
= ODB entries =&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings ==&lt;br /&gt;
* TBW&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TrigSrc - trigger source selection ==&lt;br /&gt;
* TrigPulser                      - trigger on the pulser&lt;br /&gt;
* TrigEsataNimGrandOr             - trigger on external NIM inputs of GRIF-16 ADC modules&lt;br /&gt;
* TrigAdc16GrandOr                - trigger on any adc16 signals (see adc16_masks)&lt;br /&gt;
* TrigAdc32GrandOr                - trigger on any adc32 signals (see adc32_masks)&lt;br /&gt;
* Trig1ormore                     - trigger on adc16 multiplicity 1 or more&lt;br /&gt;
* Trig2ormore                     - ditto, 2 or more&lt;br /&gt;
* Trig3ormore                     - ditto, 3 or more&lt;br /&gt;
* Trig4ormore                     - ditto, 4 or more&lt;br /&gt;
* TrigAdcGrandOr                  - trigger on any ADC signal&lt;br /&gt;
* TrigAwCoincA                    - trigger on TPC AW coincidence (see [[TRG]] manual)&lt;br /&gt;
* TrigAwCoincB                    - ditto&lt;br /&gt;
* TrigAwCoincC                    - ditto&lt;br /&gt;
* TrigAwCoincD                    - ditto&lt;br /&gt;
* TrigAwCoinc                     - ditto&lt;br /&gt;
* TrigAw1ormore	- trigger on TPC AW per-preamp multiplicity 1 or more (see [[TRG]] manual)&lt;br /&gt;
* TrigAw2ormore	- ditto, 2 or more&lt;br /&gt;
* TrigAw3ormore	- ditto, 3 or more&lt;br /&gt;
* TrigAw4ormore - ditto, 4 or more&lt;br /&gt;
* TrigAwMLU                       - trigger on TPC AW MLU signal (see [[TRG]] manual)&lt;br /&gt;
* TrigBscGrandOr                  - trigger on any BSC signal&lt;br /&gt;
* TrigBscMult                     - trigger on predefined BSC multiplicity (see [[TRG]] manual)&lt;br /&gt;
* TrigCoinc                       - trigger on predefined coincidence of TPC AW, BSC and external signal (see [[TRG]] manual)&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TRG - trigger settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will not do anything with the trigger board. Normal value &amp;quot;y&amp;quot;&lt;br /&gt;
* Modules - hostnames of the trigger board. Normal value &amp;quot;alphat01&amp;quot;&lt;br /&gt;
* NimMask - 32-bit mask for the 32x NIM inputs (see TRG manual). Normal value 0, unless external trigger is in use.&lt;br /&gt;
* EsataMask - 32-bit mask for the 32x eSATA signals (see TRG manual). Normal value 0.&lt;br /&gt;
* adc16_mask[16] - 16x 16-bit mask for the 100MHz GRIF-16 onboard ADCs (see TRG manual). Normal value 0xFFFF for all 16 data links.&lt;br /&gt;
* adc32_mask[16] - 16x 32-bit mask for the 62.5MHz FMC-ADC32 ADCs (see TRG manual). Normal value 0xFFFFFFFF for all 16 data links.&lt;br /&gt;
* PassThrough - if set to &amp;quot;y&amp;quot;, trigger is passed through the trigger module without generating any events and without causing deadtime.&lt;br /&gt;
* AwCoincA, B, C and D - 32-bit masks for the aw16 coincidence trigger (see TRG manual)&lt;br /&gt;
* Aw16FromAdc16 - route AW trigger (aw16) from adc16 (100MHz ADCs 0..15)&lt;br /&gt;
* Aw16FromAdc32a - route AW trigger (aw16) from adc32 group 15..0 (62.5MHz FMC-ADC32 in ADCs 0..7)&lt;br /&gt;
* Aw16FromAdc32b - route AW trigger (aw16) from adc32 group 31..16 (62.5MHz FMC-ADC32 in ADCs 8..15)&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/PWB - PWB settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will not do anything with PWBs. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_boot_user_page - if set to &amp;quot;n&amp;quot;, fectrl will not try to reboot PWBs into the user page firmware. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_trigger - if set to &amp;quot;n&amp;quot;, all PWBs will be set to ignore the trigger. Normal value &amp;quot;y&amp;quot;.&lt;br /&gt;
* enable_trigger_group_a - field wire pulser defeats the data suppression (every channel has a pulse) resulting in too much data overwhelming the DAQ (lost UDP packets). To permit correct data taking of field wire pulser data, PWBs are split into two groups (a and b), only one of the two groups should be enabled for field wire pulser runs. Both groups should be enabled for normal data taking. Normal value is &amp;quot;y&amp;quot;&lt;br /&gt;
* enable_trigger_group_b - see &amp;quot;enable_trigger_group_a&amp;quot;. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* modules[64] - hostnames of PWB boards&lt;br /&gt;
* boot_user_page[64] - if set to &amp;quot;y&amp;quot; and enable_boot_user_page is &amp;quot;y&amp;quot;, fectrl will reboot the corresponding PWB to the user page firmware.&lt;br /&gt;
* trigger[64] - if set to &amp;quot;y&amp;quot; and enable_trigget is &amp;quot;y&amp;quot;, fectrl will set the PWB to accept the trigger.&lt;br /&gt;
* ch_enable - if set to &amp;quot;n&amp;quot; disables all PWB channels. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* ch_force - is set to &amp;quot;y&amp;quot; disables channel suppression (all PWB channels are read)&lt;br /&gt;
* suppress_reset - if set to &amp;quot;y&amp;quot; enables channel suppression for reset channels (threshold has to be set correctly)&lt;br /&gt;
* suppress_fpn - if set to &amp;quot;y&amp;quot; enables channel suppression for fpn channels (threshold has to be set correctly)&lt;br /&gt;
* suppress_pads -  set to &amp;quot;y&amp;quot; enables channel suppression for TPC pad channels (threshold has to be set correctly)&lt;br /&gt;
* disable_reset1 - data suppression algorithm does not work for the channel &amp;quot;reset1&amp;quot; and it has to be suppressed explicitly by setting this value to &amp;quot;y&amp;quot;. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
* baseline_{reset,fpn,pads}[64] - waveform baseline for each PWB position&lt;br /&gt;
* threshold_{reset,fpn,pads} - waveform suppression threshold, see below:&lt;br /&gt;
* ch_threshold - PWB sca_N_ch_threshold, if set to 0, threshold is computed as &amp;quot;baseline_pads[seqpwb]-threshold_pads&amp;quot;. Normal value is 0.&lt;br /&gt;
* test_mode - enable PWB test mode, the ADC data is replaced with a test pattern, see PWB esper variable signalproc/test_mode&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/Settings/TDC - TDC settings ==&lt;br /&gt;
* Enable - if set to &amp;quot;n&amp;quot;, fectrl will tell the event builder that the TDC is not running. Normal value is &amp;quot;y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== /Equipment/CTRL/EvbConfig - EVB configuration ==&lt;br /&gt;
All arrays have the same size corresponding to the number of EVB slots.&lt;br /&gt;
* name[] - slot name for the web page (trg01, adc01, adc01/adc32, pwb31/0, tdc01, etc)&lt;br /&gt;
* type[] - slot type: 1=TRG, 2=ADC16 and ADC32, 3=obsolete PWB, 4=obsolete PWB, 5=PWB, 6=TDC&lt;br /&gt;
* module[] - module number (adcNN, adcNN+100, pwbNN, etc)&lt;br /&gt;
* nbanks[] - number of expected banks (16 for ADC16, 32 for ADC32, not used, set to 1 for all others)&lt;br /&gt;
* tsfreq[] - timestamp frequency in Hz.&lt;br /&gt;
&lt;br /&gt;
= Trigger configuration =&lt;br /&gt;
&lt;br /&gt;
These trigger modes are implemented:&lt;br /&gt;
* (manual trigger from web page)&lt;br /&gt;
* software pulser trigger (from fectrl)&lt;br /&gt;
* hardware pulser trigger (from the trigger board)&lt;br /&gt;
* NIM and eSATA trigger from ADC front panel inputs&lt;br /&gt;
* adc16 and adc32 discriminator triggers:&lt;br /&gt;
** adc16 grand-or trigger&lt;br /&gt;
** adc32 grand-or trigger&lt;br /&gt;
** adc (adc16+adc32) grand-or trigger&lt;br /&gt;
** adc16 multiplicity trigger (1ormore, 2ormore, 3ormore, 4ormore) for use with barrel scintillator&lt;br /&gt;
** anode wire multiplicity trigger (1ormore, 2ormore, 3ormore, 4ormore) (anode wire signals can be fed from adc16 or from adc32 signals)&lt;br /&gt;
** anode wire coincidence trigger&lt;br /&gt;
** anode wire MLU (memory lookup) trigger&lt;br /&gt;
&lt;br /&gt;
== NIM trigger from ADC front panel ==&lt;br /&gt;
&lt;br /&gt;
Trigger path:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NIM signal --&amp;gt; LEMO input on ADC front panel --&amp;gt; data encoder --&amp;gt; data link to trigger board --&amp;gt; data decoder --&amp;gt; mask --&amp;gt; nim-esata-grand-or --&amp;gt; trigger&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable NIM trigger, do this:&lt;br /&gt;
* connect NIM signal to ADC front panel input&lt;br /&gt;
** Note1: NIM signal must be inverted&lt;br /&gt;
** Note2: LEMO connectors should be set to &amp;quot;NIM input&amp;quot; mode by ADC on-board jumpers (see ADC manual)&lt;br /&gt;
* observe correct bit goes to zero in the TRG web page: data link high work should change:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0xNF00&#039;0000 (N is the module id) to&lt;br /&gt;
0xN700&#039;0000 (left lemo) or&lt;br /&gt;
0xNB00&#039;0000 (right lemo)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Note3: if data link bits do not change, most likely the LEMO connectors are set to &amp;quot;DAC output&amp;quot; mode. Try to use LEMO inputs of a different ADC.&lt;br /&gt;
* compute the NIM mask: there are 32 bits, 2 bits per ADC data link. Bit 0x1 is right LEMO, bit 0x2 is left LEMO&lt;br /&gt;
* for example, to use left LEMO of ADC data link 12, set nim mask to (0x2)&amp;lt;&amp;lt;(2*12) = 0x02000000&lt;br /&gt;
* development branch of the git repository contains &#039;&#039;scripts/nim_mask.py&#039;&#039;, which can compute forwards and backwards&lt;br /&gt;
* initialize the trigger board (on the TRG web page press button &amp;quot;initialize&amp;quot;), or start a new run&lt;br /&gt;
* on the history plot with &amp;quot;NIM grand or&amp;quot; counter, the rate should change from zero&lt;br /&gt;
* if a run is active, if one of the ADC LEMO outputs is set to output the trigger signal as a NIM pulse, one should see it fire use a scope. The delay or jitter between NIM trigger in and NIM trigger out should be around 100-200 ns (FIXME - measure this!)&lt;br /&gt;
* to set the DAQ to trigger on the NIM signal, on the run start page, check the box &amp;quot;TrigEsataNimGrandOr&amp;quot;.&lt;br /&gt;
** Note: remember to set the scaledown to 0 if so desired.&lt;br /&gt;
&lt;br /&gt;
= TPC field wire pulser =&lt;br /&gt;
&lt;br /&gt;
The TPC field wire pulser input should be connected directly to the DAC output of adc01 (right lemo connector).&lt;br /&gt;
&lt;br /&gt;
DAC settings in ODB /Equipment/CTRL/Settings/ADC/DAC/&lt;br /&gt;
&lt;br /&gt;
* for pulsing PWBs:&lt;br /&gt;
** dac_baseline: -8000&lt;br /&gt;
** dac_amplitude: 4000&lt;br /&gt;
** ramp_up_rate: 128&lt;br /&gt;
** ramp_down_rate: 70&lt;br /&gt;
** ramp_top_len: 128&lt;br /&gt;
&lt;br /&gt;
* for pulsing AW: (PWB settings drive the ADCs out of range!)&lt;br /&gt;
** dac_baseline: -2000&lt;br /&gt;
** dac_amplitude: 4000&lt;br /&gt;
** ramp_up_rate: 20&lt;br /&gt;
** ramp_down_rate: 20&lt;br /&gt;
** ramp_top_len: 128&lt;br /&gt;
&lt;br /&gt;
= TDC connections =&lt;br /&gt;
&lt;br /&gt;
* SFP8 - fiber SFP to Juniper switch&lt;br /&gt;
* right RJ45 - 200MHz clock&lt;br /&gt;
* left RJ45 - external trigger&lt;br /&gt;
&lt;br /&gt;
= MIDAS Data banks =&lt;br /&gt;
&lt;br /&gt;
* ATAT - fectrl - UDP packets from GRIF-C/TRG trigger board&lt;br /&gt;
* TRBA - fetdc - TDC data&lt;br /&gt;
* TRTM - fetdc - TDC FPGA temperatures, TID_FLOAT[5].&lt;br /&gt;
* AAnn - feudp - UDP packets from GRIF-16 ADC (before the event builder), &amp;quot;nn&amp;quot; is the ADC module number: adc01 is AA01 through adc20 is AA20.&lt;br /&gt;
* BBxx - feudp - UDP packets from PWB, obsolete&lt;br /&gt;
* Bnnm, Cnnm - feevb - EVB output banks: ADC data, &amp;quot;nn&amp;quot; is the ADC module number (1..20), &amp;quot;m&amp;quot; is the channel number (0..9,A..F), format is same as AAnn banks.&lt;br /&gt;
* PAnn - feudp - UDP packets from PWB, &amp;quot;nn&amp;quot; is the PWB module number (00..99), obsolete&lt;br /&gt;
* PBnn - feudp - UDP packets from PWB, &amp;quot;nn&amp;quot; is the PWB module number (00..99), PB01 is pwb01, PB78 is pwb78&lt;br /&gt;
* PCnn - feevb - EVB output banks: PWB data, &amp;quot;nn&amp;quot; is the PWB module number (00..99), same as above, format is same as PBnn banks&lt;br /&gt;
&lt;br /&gt;
= ZZZ =&lt;br /&gt;
&lt;br /&gt;
ZZZ&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=507</id>
		<title>Detector Services</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=507"/>
		<updated>2019-01-09T17:35:39Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Main Page]]&lt;br /&gt;
&lt;br /&gt;
= Table of Figures =&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684884|Figure 1 - Gas system schematic 6]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684885|Figure 2 - A half-rack space is used for the gas control implementation. 7]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684886|Figure 3 - Gas system half rack ready for installation 8]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684887|Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684888|Figure 5 - Water cooling system during test. 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684889|Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system. 12]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684890|Figure 7 - Overall water cooling system 13]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684891|Figure 8 - Temperature Monitor Board 14]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684892|Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections 15]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684893|Figure 10 – Unpotted Anode Wire Card and Board with HV distribution 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684894|Figure 11 - Anode wire pins and Field wire pins under yellow cover 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684895|Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire 18]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684896|Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards 19]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684897|Figure 14 - Overall Low voltage distribution for anode wires and cathode pads 21]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684898|Figure 15 - High Voltage &amp;amp;amp; Grounding scheme for the rTPC 22]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684899|Figure 16- Alpha-g rTPC rack organization 23]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684457&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This document is to describe the different services for the rTPC detector. 3 main sections cover the &#039;&#039;Gas system&#039;&#039;, the &#039;&#039;Water cooling system&#039;&#039; and the &#039;&#039;Power distribution&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= References and related Documents =&lt;br /&gt;
&lt;br /&gt;
A dedicated TRIUMF Wiki site gathers all documentations for the rTPC detector system and equipment. Gas system, cooling water system and power distribution can be found there.&lt;br /&gt;
&lt;br /&gt;
= Gas system =&lt;br /&gt;
&lt;br /&gt;
The gas system as described below includes the entire gas infrastructure required to deliver gas to the detector, monitor and control the gas flow into the detector. It also includes the necessary equipment to notify any change from the nominal gas flow or gas mixture ratio delivered to the detector.&lt;br /&gt;
&lt;br /&gt;
This type of mixed gas system is well understood by the Triumf detector group staff and no issue in its realization is expected.&lt;br /&gt;
&lt;br /&gt;
This system is a stand-alone infrastructure assembled and delivered to CERN. It will be placed in the Alpha-g experimental area floor. The delivery of the different gases to the experimental area is under the responsibility of the Gas handling group from CERN.&lt;br /&gt;
&lt;br /&gt;
The gas delivery system for the radial TPC (rTPC) is to provide Ar/CO2 gas mixture between 90/10 to 50/50 depending on the user requirements. This system does not recycle the gas as the environmental impact of either gas is minimal and the operation cost versus a recycling system would not be economic.&lt;br /&gt;
&lt;br /&gt;
In the event of an additional quenching gas requirement, the overall gas system will have to be reconsidered and possible recycling system envisaged.&lt;br /&gt;
&lt;br /&gt;
A simple gas mixer using digital flow meters will provide the precise mixture dialed by hand in the control system.&lt;br /&gt;
&lt;br /&gt;
During the prototype phase, an ad-hoc gas system will be put in place. A portable gas system is available for such a test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameter&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Value&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Gas mixture&lt;br /&gt;
| Ar/CO2 (90/10..50/50)&lt;br /&gt;
|-&lt;br /&gt;
| Gas flow requirements&lt;br /&gt;
| 0.3l/min (50%), 0.3l/min (50%)&lt;br /&gt;
|-&lt;br /&gt;
| Detector gas Volume&lt;br /&gt;
| 0.18m&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Flushing time&lt;br /&gt;
| 5h @ 600cc/min&lt;br /&gt;
|-&lt;br /&gt;
| Flow rate&lt;br /&gt;
| 100 to 300 cc/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
This gas system is quite simple as it takes 2 or 3 (spare) gas supplies and mixes them in a manifold before delivery to the rTPC detector. Necessary valves for purging lines and by-passing the detector are foreseen. The individual in-flows are controlled by gas dedicated mass flow controllers (MFC-x). The return flow is measured for leak assessment. An additional manometer monitors the internal detector pressure for evaluation of the electron drift characteristics.&lt;br /&gt;
&lt;br /&gt;
­­­­[[File:imageservice2.png|575x315px|PA_doc-1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684492&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684884&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 1 - Gas system schematic&lt;br /&gt;
&lt;br /&gt;
The main flow controller and monitoring is performed by industrial devices from MKS. We added analog flowmeters on each gas line to provide a quick visual inspection of the gas mixing system.&lt;br /&gt;
&lt;br /&gt;
This system will be hooked to the CERN AD-Gas facility. The CERN gas delivers gas through 2 switchable packs of 12 bottles for each gas.&lt;br /&gt;
&lt;br /&gt;
The gas exhaust is evacuated to the exterior of the experimental area with an elevation of about 8m.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice3.png|366x263px|PA_doc-2.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684493&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684885&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 2 - A half-rack space is used for the gas control implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450557826&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice4.png|324x364px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684494&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684886&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 3 - Gas system half rack ready for installation&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
[[File:20181205 103217.jpg|thumb|Normal configuration of the manual valves of the GHS.]]&lt;br /&gt;
From-scratch (Neither gas supply lines to the GHS nor connections to and from the TPC connected) connection of the GHS should follow the following procedure:&lt;br /&gt;
# &#039;&#039;&#039;Flush supply lines:&#039;&#039;&#039; Gas lines from outside bottles going to the GHS should be briefly (5 min or so) flushed with a high gas flow &#039;&#039;before&#039;&#039; connecting to the GHS to remove possible dust, and to minimize the amount of air in the lines.&lt;br /&gt;
# &#039;&#039;&#039;Flush GHS:&#039;&#039;&#039;&lt;br /&gt;
## Close BV1 and BV3, open BV2 and BV4 to flush input lines, only briefly.&lt;br /&gt;
## Open BV1 and BV3, close BV2 and BV4 (normal operation configuration)&lt;br /&gt;
## With Midas frontend running, use the &amp;quot;Gas&amp;quot; custom page to set a desired flow, for flushing probably between 1l/min and 1.5l/min (Without Midas, use the telnet interface), then press the &amp;quot;Bypass Flow&amp;quot; button, and let flow for a while (5-15min?)&lt;br /&gt;
# &#039;&#039;&#039;Flush TPC input line:&#039;&#039;&#039;&lt;br /&gt;
## Connect the line that will go from the GHS to the TPC input-tee on the GHS side, but leave disconnected from the tee&lt;br /&gt;
## do the same for the pressure gauge line&lt;br /&gt;
## On the &amp;quot;Gas&amp;quot; custom page, press the &amp;quot;Flow TPC&amp;quot; button and let flow for 5 min (Without Midas, use the telnet interface).&lt;br /&gt;
# Make all remaining connections&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&#039;&#039;&#039; No flow &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure that the black valves on the gas rack at the entrance of the zone are open (right on the pictures).&lt;br /&gt;
&lt;br /&gt;
[[File:20190109 165410.jpg|thumb|The rightmost valve (black) must be open during operation.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Telnet Interface ==&lt;br /&gt;
If the Midas frontend is not available the GHS can be controlled via telnet. Connect with&lt;br /&gt;
 telnet algas&lt;br /&gt;
then use the following command to control solenoid valves:&lt;br /&gt;
 cowr do i 1&lt;br /&gt;
to energize SVi, i.e. to switch it from its normal closed or open state to the other state,&lt;br /&gt;
 cowr do i 0&lt;br /&gt;
to de-energize, i.e. switch to default state.&lt;br /&gt;
&lt;br /&gt;
Gas flow is set with:&lt;br /&gt;
 mfcwr ao i &amp;lt;desired flow&amp;gt;&lt;br /&gt;
where i is 1 for Ar and 2 for CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, and the desired flow is in the internal units of the system.&lt;br /&gt;
&lt;br /&gt;
= Water cooling system =&lt;br /&gt;
&lt;br /&gt;
The outer surface of the detector has an arrangement of 8x8 electronics boards handling the readout of the cathode pads. These boards require operating at a controlled temperature to prevent heat build-up at the surface of the detector and improving the reliability of the system. In order to do so, 8 independent water pipe loops running from the bottom-up and down in the longitudinal axis of the detector are in a thermal contact to 8 successive readout boards. From the bottom, a pair of water hoses connect to 2 custom 3D-printed manifolds supplying the water feed and return to the 8 water loops.&lt;br /&gt;
&lt;br /&gt;
These 8 loops are run in parallel to a negative pressure water cooling system. This negative pressure system is to ensure that no water leak will damage the electronics even during possible pipe or delivery hose breakage.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice5.png|516x273px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960816&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684495&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684887&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice6.jpg|249x429px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960817&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684496&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684888&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 5 - Water cooling system during test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameters&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Values&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Number of parallel water loops&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| Copper pipe OD/ID&lt;br /&gt;
| ¼” / 4.7mm&lt;br /&gt;
|-&lt;br /&gt;
| Length of one loop (on the rTPC)&lt;br /&gt;
| 4.6m&lt;br /&gt;
|-&lt;br /&gt;
| Water speed per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Pressure drop per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Power extraction per water loop&lt;br /&gt;
| 8x15W= 120W&lt;br /&gt;
|-&lt;br /&gt;
| Total cooling power&lt;br /&gt;
| 1KW&lt;br /&gt;
|-&lt;br /&gt;
| Inlet water temperature&lt;br /&gt;
| 16..20 degC (to be confirmed)&lt;br /&gt;
|-&lt;br /&gt;
| Outlet water temperature&lt;br /&gt;
| 20..24 degC&lt;br /&gt;
|-&lt;br /&gt;
| Total water flow&lt;br /&gt;
| 3..6 l/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This description corresponds to how we think the system should work, but doesn&#039;t seem fully comatible with the behaviour of the system. E.g. the air pump only seems to turn on when PID1 falls below a certain value.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Pressure PID (proportional/integral/differential controller), PID2, monitors the air pressure in the vacuum vessel. When the pressure rises above a trigger value (perhaps 350mbar) it activates the aspirator vacuum pump to bring the pressure down to maintain a long time averaged pressure (say 300mbar).&lt;br /&gt;
&lt;br /&gt;
This vacuum is then used to draw water through the detector into the vessel, from the Open Tank. The vacuum vessel&#039;s water level is monitored by PID1, using a differential pressure transducer measuring the weight of the water column by the difference between the air pressure in the top of the vessel and the water pressure at the bottom of the vessel. PID1 provides a variable signal to the Proportional Solenoid Valve, which varies the flow through the return loop around the (fixed flow) water pump, and thus changing the overall flow of water from the vacuum vessel to keep the water level in the vessel constant despite water being constantly drawn in by the vacuum. The water pulled from the vacuum vessel is pushed through the filter and into the Open Tank, completing the circulation.&lt;br /&gt;
&lt;br /&gt;
Cooling is accomplished in the water pump leg of the system, as coolant pulled from the vacuum vessel passes through a heat exchanger coupled to CERN’s cooling water supply on its way to the pump. The rate that water flows through the system can be determined by many obstacles in the loop, but ideally it should be dominated by the position of the main Throttle Valve. Other valves should generally be set either fully open of fully closed, except for the Proportional Valve, whose position responds to the setting of the Throttle Valve.&lt;br /&gt;
&lt;br /&gt;
Data outputs: there are five data outputs planned. The two process variables, the vacuum vessel absolute pressure, and differential water column pressure, will be sent to the Detector DAQ system. As well, the total flow rate is monitored by the flow meter, whose output is sent to the DAQ system. This data is not used by the circulation system itself. Likewise, the back pressure on the water filter is only sent to the DAQ system to indicate if the filter may need changing, and the temperature of the open tank is monitored and sent to the DAQ system, but currently there is no plan to use it in a temperature control feedback. The temperature of CERN&#039;s cooling water supply is not yet known, but we expect we can set the heat exchanger to run at a rate to hold the system temperature near 20°C without feedback control.&lt;br /&gt;
&lt;br /&gt;
For the negative pressure to work effectively to prevent leaks, the water pressure in the detector ought to be down at least to half an atmosphere. With the detector cooling tubes 8x 4.6m of parallel 4.7mm ID copper tubes (2.3m down then 2.3 back-ups), and the supply using (perhaps 6m, 3 to the detector then 3 back) 9.7mm ID (=1/2&amp;amp;quot; OD) poly tubing, the flow will need to be somewhat greater than the required 3 l/min in order to maintain that degree of vacuum in the detector, unless the Throttle Valve is placed upstream of the detector near the Open Tank, or an additional constriction is added in that region.&lt;br /&gt;
&lt;br /&gt;
The water pump leg of the circuit residing in the water cooling/gas rack is placed far enough from the fringe field of the superconducting magnet to prevent disruptive effects on the solenoid valves and electric motors. Therefore the main 1/2&amp;amp;quot; poly line to and from the water pump and its flow loop will add a pressure drop which is estimated at 0.4atm for a 10m line at 6 l/min (9.7mmID), which is within our requirements. As mentioned earlier, the splitting (and reassembly) of the line to the 8 cooling lines close to detector will be accomplished with the use of 2 separate manifolds equipped with temperature sensors for constant in/out global water temperature monitoring.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice7.png|286x206px]][[File:imageservice8.jpg|286x206px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684497&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684889&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system.&lt;br /&gt;
&lt;br /&gt;
Currently, PVC valves with &amp;amp;quot;true union&amp;amp;quot; couplings are planned to be provided around the water pump to permit it to be swapped out from the system for servicing and a valved bypass to the water filter is provided for the same purpose to allow easily changing filter elements with the system running. True union valves are generally only available to 1/2NPT and larger, so an adapter fitting is required. The vacuum pump for the system is a small (2 x 5 x 7.5cm) cascaded dual Venturi aspirator, which is operated with site air, switched with two simultaneously operated normally closed solenoid valves, one for the site air, and one for the vessel vacuum input. If the system is leak free, the vacuum in the vessel should only be degraded by the dissolved air absorbed in the Open Tank and extracted in the vacuum vessel, which from past experience might mean running for under a minute every six hours or so.&lt;br /&gt;
&lt;br /&gt;
The wetted surfaces of this system will be mainly PVC and Polyethylene for the valves, tubing and vessels, plus brass fittings, and the copper cooling tubes, and the surfaces of the heat exchanger, which will most likely be stainless steel. It may be possible to devise an equivalent of a bellows communicating with the Open Tank, so that it is only virtually open, thus sealing the cooling water from contaminants, which may allow us to run with just distilled water plus a strip of silver as a biocide (although I&#039;m not sure if the mix of metals, copper plus stainless, may not interfere with the function of the silver, which is mostly used in computer cooling systems which are copper and plastic only). Otherwise, we will need a biocide and corrosion inhibitor. We have the latter, tolyltriazole, but the biocide is problematic. They tend to be short-lived; for systems which are open to atmosphere, typical industrial practice is chlorination, regularly refreshed, which builds up NaCl as it degrades, making the coolant corrosive. For T2K in Japan, we used the (human-nontoxic) &amp;amp;quot;Germall&amp;amp;quot;, which has a two-year lifetime, after which when its effectiveness decays it turns into food, which is the case for any solute that is not actively biocidal. Eventually, any such additives build up and require the coolant to be flushed and replaced. Silver is a lovely method, but only works for extended periods with a sealed system which remains deoxygenated. My research so far has not turned up a good candidate which does not entail recurring changes of the coolant.&lt;br /&gt;
&lt;br /&gt;
Power: the system needs to be able to run on European 220VAC power, but also operate here for testing purposes. The PIDs (Omega CN76160s) will accept both; for the rest of the system, I will have an a universal 90-240VAC input to 24VDC (5A) supply which will drive all the other components, including the pump, which will be a brushless 24VDC centrifugal pump, 1 - 1.5A range. The whole system will run about 125W.&lt;br /&gt;
&lt;br /&gt;
Information on the temperature and flow rate of the CERN cooling water system will be provided later but we don’t anticipate any major issues about the sizing of the heat exchanger.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice9.png|603x344px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960818&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684498&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684890&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 7 - Overall water cooling system&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564356&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Temperature Measurement ==&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice10.jpeg|225x356px]] [[File:imageservice11.png|194x358px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684499&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684891&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 8 Temperature Monitor Board&lt;br /&gt;
&lt;br /&gt;
The water temperature is read by the Temperature Monitor Board (TEMPB). Thermistors located inside the manifold connect to a 16 bit ADC on the TEMPB which is read out by a Raspberry Pi mounted on board. In a similar manner the air system temperature is read with sensors in the air manifold. The TEMPB can provide temperature readout of 32 thermistors which connect to terminal blocks. The channels can also be readout differentially providing up to 16 channels for thermocouples. An on board thermistor allows for cold junction compensation. The board is powered via USB on the Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
This assumes all water lines and compressed air are connected, and both the blue water tank and the chiller are filled.&lt;br /&gt;
&lt;br /&gt;
=== Begin running ===&lt;br /&gt;
# Close vent valve and main valve (3-way valve in T position)&lt;br /&gt;
# Switch on control box with power switch in the back&lt;br /&gt;
# confirm water pump is off, i.e. blue button is not illuminated&lt;br /&gt;
# Vacuum pump should now be running&lt;br /&gt;
# Open main valve, i.e. vertical connection open, connection to vent valve closed [[File:PWBmainOpen.jpg|thumb|Cooling system main valve open]]&lt;br /&gt;
# water should start flowing through the PWB cooling system and coming back through the clear pipe connected to the vacuum vessel&lt;br /&gt;
# Default settings are PID1 = 200, PID2 = 300, but may have been adjusted&lt;br /&gt;
# once the water level in the vacuum vessel has risen to ~20cm, turn on the water pump&lt;br /&gt;
&lt;br /&gt;
=== Drain system ===&lt;br /&gt;
# from normal operation, i.e. vacuum pump and water pump running&lt;br /&gt;
# switch main valve to upside down T position &lt;br /&gt;
[[File:PWBmainVent.jpg|thumb|Cooling system main valve to vent valve]]&lt;br /&gt;
# open vent valve&lt;br /&gt;
# air should now enter the system, draining all water from the TPC pipes into the vacuum vessel&lt;br /&gt;
# water pump will drain the vacuum vessel into supply tank, turn it off before the vessel is completely empty to avoid air in the water pump&lt;br /&gt;
# switch off main power&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
The water system is temperamental, and not intuitive at all. Common problems and solution attempts:&lt;br /&gt;
&lt;br /&gt;
; water pump very loud, doesn&#039;t appear to pump water&lt;br /&gt;
: most likely air in the water pump. Open the vent of the vacuum vessel to allow water to enter pump by gravity alone, pump should stop screaming and start pumping. Close vent.&lt;br /&gt;
; vacuum pump comes on often (more then every 10-20 min)&lt;br /&gt;
: probably an air leak in the system. Check for bubbles and try to find leak.&lt;br /&gt;
; water level/flow/vacuum oscillate between extreme values&lt;br /&gt;
: unclear, try playing with PID settings, throttle valve, possibly orange ball valves by the water pump.&lt;br /&gt;
&lt;br /&gt;
= Power distribution =&lt;br /&gt;
&lt;br /&gt;
This section covers the different voltages and power requirements for the operation of the rTPC. This includes:&lt;br /&gt;
&lt;br /&gt;
# High Voltage for the rTPC electron drift and amplification operation&lt;br /&gt;
# Low Voltage to the Anode wire frontend electronics&lt;br /&gt;
# Low Voltage to the Barrel Scintillator frontend electronics&lt;br /&gt;
# Low Voltage to the Cathode Pads electronics&lt;br /&gt;
# Grounding scheme of the overall rTPC&lt;br /&gt;
&lt;br /&gt;
The provision of power to the different components of the detector is distributed from the top end plate of the rTPC.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice12.png|507x354px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965261&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684500&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684892&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections&lt;br /&gt;
&lt;br /&gt;
== High Voltage for the rTPC ==&lt;br /&gt;
&lt;br /&gt;
Three main components of the rTPC require High Voltage&lt;br /&gt;
&lt;br /&gt;
* Main cathode wall (Negative ~5KV)&lt;br /&gt;
* Field wires (Negative ~ few hundred volts)&lt;br /&gt;
* Anode wires (Positive ~3.2KV )&lt;br /&gt;
&lt;br /&gt;
These voltages are provided by a Quad High Voltage unit from CAEN. Three independent cables will be fed to the top of the rTPC.&lt;br /&gt;
&lt;br /&gt;
High Voltage provision to the bottom endplate HV ring is taken from the central cathode near the bottom endplate.&lt;br /&gt;
&lt;br /&gt;
The Field wire voltage is connected to all the field wire crimp-pins through a dedicated socket chain inserted on each of the crimp-pin on the top and bottom endplates. The field wires themselves interconnect the high voltage between the top and bottom pins.&amp;lt;span id=&amp;quot;OLE_LINK20&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK21&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK22&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The High Voltage for the anode wires is delivered to the Anode Wire Card (AWC) which will distribute it to its 16 wires, Figure 11. There are 16 AWC cards covering each end of the anode wires. All the top and bottom 32 AWC are connected serially. The anode wires themselves interconnect the high voltage between the top and bottom pins.&lt;br /&gt;
&lt;br /&gt;
The anode wires pre-amplifiers boards (AWB) are sitting on the top of the Anode Wire Card (AWC) Figure 10. As the wire is powered by the HV, each anode wire has a high Voltage decoupling capacitor to isolate the pre-amp stage from the HV. This circuit resides on the AWC. The AWB will see the AC coupled anode signal only. With a new design of the AWC Figure 12, the decoupling capacitors are potted in epoxy to ensure proper isolation of the HV toward the surrounding circuit as well to prevent corona discharge due to relative humidity of the surrounding.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice13.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684196&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684501&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684893&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 10 – Unpotted Anode Wire Card and Board with HV distribution&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice14.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684198&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684502&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684894&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 11 - Anode wire pins and Field wire pins under yellow cover&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice15.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684370&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684503&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684895&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Anode wire frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
The AWB pre-amp board requires 2 voltages (+5V, -5V) which are fed through dedicated cable connections to each of the AWB. There are 16 AWB per end of the rTPC, therefore, 16 individual cable bundle will be reaching the top and another 16 the bottom of the rTPC. The cable bundle is to also provide the power return lines to the Power Supply.&lt;br /&gt;
&lt;br /&gt;
The PL508 Low Voltage power Supply from Wiener will provide the main power source for all the 32 pre-amplifiers. A dedicated connection breakout board with current monitoring capability splits the source power to the 2 x 16 necessary connections to the Anode wire boards. Based on a RaspeberryPi card, a 16 power distribution board is already implemented for the prototype. This board has extra 4 channels of temperature monitoring which can be used later on. In the same process we produce a similar board for 16 channel of NTC, RTC temperature monitoring. They will be used for overall detector and cooling system monitoring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;-5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Anode Pre-amp&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice16.jpg|239x363px]] [[File:imageservice17.png|239x363px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965262&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684504&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684896&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Barrel Scintillator frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
Similar to the Anode wire pre-amplifier voltage distribution scheme, the Barrel Scintillators will require several low voltages for power and control. The Barrel Scintillator Boards (BSB) are mounted on both ends of the Scintillator bar with the same segmentation as the Anode wires i.e.: 16 BSB per end. The design of the electronic chain for the barrel scintillator is not fully designed yet.&lt;br /&gt;
&lt;br /&gt;
The SiPM sensors require a bias voltage of the order of 28V. This voltage will be provided through the same mean as the low voltage power. Expected threshold voltage for the local signal level discriminator is also foreseen.&amp;lt;span id=&amp;quot;_Toc450564363&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Low Voltage to the Cathode Pads electronics ==&lt;br /&gt;
&lt;br /&gt;
The cathode pads electronics mounted on the external cylinder surface is composed of the analog frontend and the digital conversion electronics. Two voltages are required (+5.3V, +2.3V). The delivery is done through dedicated “power bar” running the full length of the rTPC. A set of 3 bars covers the 8 axial cathode pad electronics boards. 8 of them cover the circumference of the rTPC.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+2.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Padwing board&lt;br /&gt;
| 10W (1.8A)&lt;br /&gt;
| 2W (0.8A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Overall the low power supplies are provided by a PL508-3U with 8 modules of either single or dual channels from Wiener.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice18.png|469x360px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684505&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684897&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 14 - Overall Low voltage distribution for anode wires and cathode pads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564365&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grounding scheme of the overall rTPC ==&lt;br /&gt;
&lt;br /&gt;
The grounding scheme challenge in this setup is the far distance between the 2 end of the rTPC (2.3m) and the lack of accessibility to the bottom of the detector. The proposal is to use a Copper sheet mounted on the inner surface of the inner cylinder. This ground path will connect the 2 endplates to the High Voltage return. All the pre-amps will merge their ground to this central ground.&lt;br /&gt;
&lt;br /&gt;
Additional ground lugs have been included in the Anode wire pre-amplifier boards to strengthen the ground as each anode wire is readout out from both end. This may be used once the full detector is assembled to address possible ground loop issues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684506&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;[[File:imageservice19.png|439x409px]]&lt;br /&gt;
&lt;br /&gt;
= Safety and Hazard considerations =&lt;br /&gt;
&lt;br /&gt;
== Gas ==&lt;br /&gt;
&lt;br /&gt;
The Ar and CO2 do not require special health safety system. The detector will be operated in the ventilated hall of the AD building at CERN.&lt;br /&gt;
&lt;br /&gt;
Gas flow, detector gas pressure, and gas inlet temperature are constantly monitored and can trigger adequate response for shutdown or closure of the gas system for safety purpose.&lt;br /&gt;
&lt;br /&gt;
== Cooling water ==&lt;br /&gt;
&lt;br /&gt;
The water cooling system operates in negative pressure mode preventing any water leak to flood the detector outer surface. In addition water flow and inlet/outlet temperature are constantly monitored to allow fast response to off range parameter in order to shut down the electronics. The cooling water system requires a primary cooling tap water loop from the AD building. Water quality, water flow and water temperature are not under our responsibility. This aspect will be dealt during the initial phase of the rTPC commissioning at CERN.&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
All electronics voltages are below 48V. No special safety circuits are envisaged.&lt;br /&gt;
&lt;br /&gt;
The high-voltage circuit is fully protected outside the detector. The access to the high-voltage on the detector is restricted to the two end-plates. Interlock scheme will be put in place to ensure the shutdown of the HV in case of manual access to the detector itself.&lt;br /&gt;
&lt;br /&gt;
The LV (Low Voltage) power units are also interlocked to prevent false powering sequence which can damage the downstream electronics modules.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice20.png|571x411px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684507&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684899&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 16- Alpha-g rTPC rack organization&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=506</id>
		<title>Detector Services</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=506"/>
		<updated>2019-01-09T17:30:05Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Main Page]]&lt;br /&gt;
&lt;br /&gt;
= Table of Figures =&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684884|Figure 1 - Gas system schematic 6]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684885|Figure 2 - A half-rack space is used for the gas control implementation. 7]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684886|Figure 3 - Gas system half rack ready for installation 8]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684887|Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684888|Figure 5 - Water cooling system during test. 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684889|Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system. 12]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684890|Figure 7 - Overall water cooling system 13]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684891|Figure 8 - Temperature Monitor Board 14]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684892|Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections 15]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684893|Figure 10 – Unpotted Anode Wire Card and Board with HV distribution 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684894|Figure 11 - Anode wire pins and Field wire pins under yellow cover 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684895|Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire 18]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684896|Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards 19]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684897|Figure 14 - Overall Low voltage distribution for anode wires and cathode pads 21]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684898|Figure 15 - High Voltage &amp;amp;amp; Grounding scheme for the rTPC 22]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684899|Figure 16- Alpha-g rTPC rack organization 23]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684457&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This document is to describe the different services for the rTPC detector. 3 main sections cover the &#039;&#039;Gas system&#039;&#039;, the &#039;&#039;Water cooling system&#039;&#039; and the &#039;&#039;Power distribution&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= References and related Documents =&lt;br /&gt;
&lt;br /&gt;
A dedicated TRIUMF Wiki site gathers all documentations for the rTPC detector system and equipment. Gas system, cooling water system and power distribution can be found there.&lt;br /&gt;
&lt;br /&gt;
= Gas system =&lt;br /&gt;
&lt;br /&gt;
The gas system as described below includes the entire gas infrastructure required to deliver gas to the detector, monitor and control the gas flow into the detector. It also includes the necessary equipment to notify any change from the nominal gas flow or gas mixture ratio delivered to the detector.&lt;br /&gt;
&lt;br /&gt;
This type of mixed gas system is well understood by the Triumf detector group staff and no issue in its realization is expected.&lt;br /&gt;
&lt;br /&gt;
This system is a stand-alone infrastructure assembled and delivered to CERN. It will be placed in the Alpha-g experimental area floor. The delivery of the different gases to the experimental area is under the responsibility of the Gas handling group from CERN.&lt;br /&gt;
&lt;br /&gt;
The gas delivery system for the radial TPC (rTPC) is to provide Ar/CO2 gas mixture between 90/10 to 50/50 depending on the user requirements. This system does not recycle the gas as the environmental impact of either gas is minimal and the operation cost versus a recycling system would not be economic.&lt;br /&gt;
&lt;br /&gt;
In the event of an additional quenching gas requirement, the overall gas system will have to be reconsidered and possible recycling system envisaged.&lt;br /&gt;
&lt;br /&gt;
A simple gas mixer using digital flow meters will provide the precise mixture dialed by hand in the control system.&lt;br /&gt;
&lt;br /&gt;
During the prototype phase, an ad-hoc gas system will be put in place. A portable gas system is available for such a test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameter&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Value&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Gas mixture&lt;br /&gt;
| Ar/CO2 (90/10..50/50)&lt;br /&gt;
|-&lt;br /&gt;
| Gas flow requirements&lt;br /&gt;
| 0.3l/min (50%), 0.3l/min (50%)&lt;br /&gt;
|-&lt;br /&gt;
| Detector gas Volume&lt;br /&gt;
| 0.18m&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Flushing time&lt;br /&gt;
| 5h @ 600cc/min&lt;br /&gt;
|-&lt;br /&gt;
| Flow rate&lt;br /&gt;
| 100 to 300 cc/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
This gas system is quite simple as it takes 2 or 3 (spare) gas supplies and mixes them in a manifold before delivery to the rTPC detector. Necessary valves for purging lines and by-passing the detector are foreseen. The individual in-flows are controlled by gas dedicated mass flow controllers (MFC-x). The return flow is measured for leak assessment. An additional manometer monitors the internal detector pressure for evaluation of the electron drift characteristics.&lt;br /&gt;
&lt;br /&gt;
­­­­[[File:imageservice2.png|575x315px|PA_doc-1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684492&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684884&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 1 - Gas system schematic&lt;br /&gt;
&lt;br /&gt;
The main flow controller and monitoring is performed by industrial devices from MKS. We added analog flowmeters on each gas line to provide a quick visual inspection of the gas mixing system.&lt;br /&gt;
&lt;br /&gt;
This system will be hooked to the CERN AD-Gas facility. The CERN gas delivers gas through 2 switchable packs of 12 bottles for each gas.&lt;br /&gt;
&lt;br /&gt;
The gas exhaust is evacuated to the exterior of the experimental area with an elevation of about 8m.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice3.png|366x263px|PA_doc-2.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684493&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684885&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 2 - A half-rack space is used for the gas control implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450557826&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice4.png|324x364px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684494&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684886&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 3 - Gas system half rack ready for installation&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
[[File:20181205 103217.jpg|thumb|Normal configuration of the manual valves of the GHS.]]&lt;br /&gt;
From-scratch (Neither gas supply lines to the GHS nor connections to and from the TPC connected) connection of the GHS should follow the following procedure:&lt;br /&gt;
# &#039;&#039;&#039;Flush supply lines:&#039;&#039;&#039; Gas lines from outside bottles going to the GHS should be briefly (5 min or so) flushed with a high gas flow &#039;&#039;before&#039;&#039; connecting to the GHS to remove possible dust, and to minimize the amount of air in the lines.&lt;br /&gt;
# &#039;&#039;&#039;Flush GHS:&#039;&#039;&#039;&lt;br /&gt;
## Close BV1 and BV3, open BV2 and BV4 to flush input lines, only briefly.&lt;br /&gt;
## Open BV1 and BV3, close BV2 and BV4 (normal operation configuration)&lt;br /&gt;
## With Midas frontend running, use the &amp;quot;Gas&amp;quot; custom page to set a desired flow, for flushing probably between 1l/min and 1.5l/min (Without Midas, use the telnet interface), then press the &amp;quot;Bypass Flow&amp;quot; button, and let flow for a while (5-15min?)&lt;br /&gt;
# &#039;&#039;&#039;Flush TPC input line:&#039;&#039;&#039;&lt;br /&gt;
## Connect the line that will go from the GHS to the TPC input-tee on the GHS side, but leave disconnected from the tee&lt;br /&gt;
## do the same for the pressure gauge line&lt;br /&gt;
## On the &amp;quot;Gas&amp;quot; custom page, press the &amp;quot;Flow TPC&amp;quot; button and let flow for 5 min (Without Midas, use the telnet interface).&lt;br /&gt;
# Make all remaining connections&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
Make sure that the black valves on the gas rack at the entrance of the zone are open (right on the pictures).&lt;br /&gt;
[[File:20190109 165410.jpg|thumb|The rightmost valve (black) must be open during operation.]]&lt;br /&gt;
&lt;br /&gt;
== Telnet Interface ==&lt;br /&gt;
If the Midas frontend is not available the GHS can be controlled via telnet. Connect with&lt;br /&gt;
 telnet algas&lt;br /&gt;
then use the following command to control solenoid valves:&lt;br /&gt;
 cowr do i 1&lt;br /&gt;
to energize SVi, i.e. to switch it from its normal closed or open state to the other state,&lt;br /&gt;
 cowr do i 0&lt;br /&gt;
to de-energize, i.e. switch to default state.&lt;br /&gt;
&lt;br /&gt;
Gas flow is set with:&lt;br /&gt;
 mfcwr ao i &amp;lt;desired flow&amp;gt;&lt;br /&gt;
where i is 1 for Ar and 2 for CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, and the desired flow is in the internal units of the system.&lt;br /&gt;
&lt;br /&gt;
= Water cooling system =&lt;br /&gt;
&lt;br /&gt;
The outer surface of the detector has an arrangement of 8x8 electronics boards handling the readout of the cathode pads. These boards require operating at a controlled temperature to prevent heat build-up at the surface of the detector and improving the reliability of the system. In order to do so, 8 independent water pipe loops running from the bottom-up and down in the longitudinal axis of the detector are in a thermal contact to 8 successive readout boards. From the bottom, a pair of water hoses connect to 2 custom 3D-printed manifolds supplying the water feed and return to the 8 water loops.&lt;br /&gt;
&lt;br /&gt;
These 8 loops are run in parallel to a negative pressure water cooling system. This negative pressure system is to ensure that no water leak will damage the electronics even during possible pipe or delivery hose breakage.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice5.png|516x273px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960816&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684495&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684887&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice6.jpg|249x429px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960817&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684496&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684888&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 5 - Water cooling system during test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameters&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Values&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Number of parallel water loops&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| Copper pipe OD/ID&lt;br /&gt;
| ¼” / 4.7mm&lt;br /&gt;
|-&lt;br /&gt;
| Length of one loop (on the rTPC)&lt;br /&gt;
| 4.6m&lt;br /&gt;
|-&lt;br /&gt;
| Water speed per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Pressure drop per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Power extraction per water loop&lt;br /&gt;
| 8x15W= 120W&lt;br /&gt;
|-&lt;br /&gt;
| Total cooling power&lt;br /&gt;
| 1KW&lt;br /&gt;
|-&lt;br /&gt;
| Inlet water temperature&lt;br /&gt;
| 16..20 degC (to be confirmed)&lt;br /&gt;
|-&lt;br /&gt;
| Outlet water temperature&lt;br /&gt;
| 20..24 degC&lt;br /&gt;
|-&lt;br /&gt;
| Total water flow&lt;br /&gt;
| 3..6 l/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This description corresponds to how we think the system should work, but doesn&#039;t seem fully comatible with the behaviour of the system. E.g. the air pump only seems to turn on when PID1 falls below a certain value.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Pressure PID (proportional/integral/differential controller), PID2, monitors the air pressure in the vacuum vessel. When the pressure rises above a trigger value (perhaps 350mbar) it activates the aspirator vacuum pump to bring the pressure down to maintain a long time averaged pressure (say 300mbar).&lt;br /&gt;
&lt;br /&gt;
This vacuum is then used to draw water through the detector into the vessel, from the Open Tank. The vacuum vessel&#039;s water level is monitored by PID1, using a differential pressure transducer measuring the weight of the water column by the difference between the air pressure in the top of the vessel and the water pressure at the bottom of the vessel. PID1 provides a variable signal to the Proportional Solenoid Valve, which varies the flow through the return loop around the (fixed flow) water pump, and thus changing the overall flow of water from the vacuum vessel to keep the water level in the vessel constant despite water being constantly drawn in by the vacuum. The water pulled from the vacuum vessel is pushed through the filter and into the Open Tank, completing the circulation.&lt;br /&gt;
&lt;br /&gt;
Cooling is accomplished in the water pump leg of the system, as coolant pulled from the vacuum vessel passes through a heat exchanger coupled to CERN’s cooling water supply on its way to the pump. The rate that water flows through the system can be determined by many obstacles in the loop, but ideally it should be dominated by the position of the main Throttle Valve. Other valves should generally be set either fully open of fully closed, except for the Proportional Valve, whose position responds to the setting of the Throttle Valve.&lt;br /&gt;
&lt;br /&gt;
Data outputs: there are five data outputs planned. The two process variables, the vacuum vessel absolute pressure, and differential water column pressure, will be sent to the Detector DAQ system. As well, the total flow rate is monitored by the flow meter, whose output is sent to the DAQ system. This data is not used by the circulation system itself. Likewise, the back pressure on the water filter is only sent to the DAQ system to indicate if the filter may need changing, and the temperature of the open tank is monitored and sent to the DAQ system, but currently there is no plan to use it in a temperature control feedback. The temperature of CERN&#039;s cooling water supply is not yet known, but we expect we can set the heat exchanger to run at a rate to hold the system temperature near 20°C without feedback control.&lt;br /&gt;
&lt;br /&gt;
For the negative pressure to work effectively to prevent leaks, the water pressure in the detector ought to be down at least to half an atmosphere. With the detector cooling tubes 8x 4.6m of parallel 4.7mm ID copper tubes (2.3m down then 2.3 back-ups), and the supply using (perhaps 6m, 3 to the detector then 3 back) 9.7mm ID (=1/2&amp;amp;quot; OD) poly tubing, the flow will need to be somewhat greater than the required 3 l/min in order to maintain that degree of vacuum in the detector, unless the Throttle Valve is placed upstream of the detector near the Open Tank, or an additional constriction is added in that region.&lt;br /&gt;
&lt;br /&gt;
The water pump leg of the circuit residing in the water cooling/gas rack is placed far enough from the fringe field of the superconducting magnet to prevent disruptive effects on the solenoid valves and electric motors. Therefore the main 1/2&amp;amp;quot; poly line to and from the water pump and its flow loop will add a pressure drop which is estimated at 0.4atm for a 10m line at 6 l/min (9.7mmID), which is within our requirements. As mentioned earlier, the splitting (and reassembly) of the line to the 8 cooling lines close to detector will be accomplished with the use of 2 separate manifolds equipped with temperature sensors for constant in/out global water temperature monitoring.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice7.png|286x206px]][[File:imageservice8.jpg|286x206px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684497&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684889&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system.&lt;br /&gt;
&lt;br /&gt;
Currently, PVC valves with &amp;amp;quot;true union&amp;amp;quot; couplings are planned to be provided around the water pump to permit it to be swapped out from the system for servicing and a valved bypass to the water filter is provided for the same purpose to allow easily changing filter elements with the system running. True union valves are generally only available to 1/2NPT and larger, so an adapter fitting is required. The vacuum pump for the system is a small (2 x 5 x 7.5cm) cascaded dual Venturi aspirator, which is operated with site air, switched with two simultaneously operated normally closed solenoid valves, one for the site air, and one for the vessel vacuum input. If the system is leak free, the vacuum in the vessel should only be degraded by the dissolved air absorbed in the Open Tank and extracted in the vacuum vessel, which from past experience might mean running for under a minute every six hours or so.&lt;br /&gt;
&lt;br /&gt;
The wetted surfaces of this system will be mainly PVC and Polyethylene for the valves, tubing and vessels, plus brass fittings, and the copper cooling tubes, and the surfaces of the heat exchanger, which will most likely be stainless steel. It may be possible to devise an equivalent of a bellows communicating with the Open Tank, so that it is only virtually open, thus sealing the cooling water from contaminants, which may allow us to run with just distilled water plus a strip of silver as a biocide (although I&#039;m not sure if the mix of metals, copper plus stainless, may not interfere with the function of the silver, which is mostly used in computer cooling systems which are copper and plastic only). Otherwise, we will need a biocide and corrosion inhibitor. We have the latter, tolyltriazole, but the biocide is problematic. They tend to be short-lived; for systems which are open to atmosphere, typical industrial practice is chlorination, regularly refreshed, which builds up NaCl as it degrades, making the coolant corrosive. For T2K in Japan, we used the (human-nontoxic) &amp;amp;quot;Germall&amp;amp;quot;, which has a two-year lifetime, after which when its effectiveness decays it turns into food, which is the case for any solute that is not actively biocidal. Eventually, any such additives build up and require the coolant to be flushed and replaced. Silver is a lovely method, but only works for extended periods with a sealed system which remains deoxygenated. My research so far has not turned up a good candidate which does not entail recurring changes of the coolant.&lt;br /&gt;
&lt;br /&gt;
Power: the system needs to be able to run on European 220VAC power, but also operate here for testing purposes. The PIDs (Omega CN76160s) will accept both; for the rest of the system, I will have an a universal 90-240VAC input to 24VDC (5A) supply which will drive all the other components, including the pump, which will be a brushless 24VDC centrifugal pump, 1 - 1.5A range. The whole system will run about 125W.&lt;br /&gt;
&lt;br /&gt;
Information on the temperature and flow rate of the CERN cooling water system will be provided later but we don’t anticipate any major issues about the sizing of the heat exchanger.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice9.png|603x344px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960818&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684498&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684890&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 7 - Overall water cooling system&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564356&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Temperature Measurement ==&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice10.jpeg|225x356px]] [[File:imageservice11.png|194x358px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684499&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684891&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 8 Temperature Monitor Board&lt;br /&gt;
&lt;br /&gt;
The water temperature is read by the Temperature Monitor Board (TEMPB). Thermistors located inside the manifold connect to a 16 bit ADC on the TEMPB which is read out by a Raspberry Pi mounted on board. In a similar manner the air system temperature is read with sensors in the air manifold. The TEMPB can provide temperature readout of 32 thermistors which connect to terminal blocks. The channels can also be readout differentially providing up to 16 channels for thermocouples. An on board thermistor allows for cold junction compensation. The board is powered via USB on the Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
This assumes all water lines and compressed air are connected, and both the blue water tank and the chiller are filled.&lt;br /&gt;
&lt;br /&gt;
=== Begin running ===&lt;br /&gt;
# Close vent valve and main valve (3-way valve in T position)&lt;br /&gt;
# Switch on control box with power switch in the back&lt;br /&gt;
# confirm water pump is off, i.e. blue button is not illuminated&lt;br /&gt;
# Vacuum pump should now be running&lt;br /&gt;
# Open main valve, i.e. vertical connection open, connection to vent valve closed [[File:PWBmainOpen.jpg|thumb|Cooling system main valve open]]&lt;br /&gt;
# water should start flowing through the PWB cooling system and coming back through the clear pipe connected to the vacuum vessel&lt;br /&gt;
# Default settings are PID1 = 200, PID2 = 300, but may have been adjusted&lt;br /&gt;
# once the water level in the vacuum vessel has risen to ~20cm, turn on the water pump&lt;br /&gt;
&lt;br /&gt;
=== Drain system ===&lt;br /&gt;
# from normal operation, i.e. vacuum pump and water pump running&lt;br /&gt;
# switch main valve to upside down T position &lt;br /&gt;
[[File:PWBmainVent.jpg|thumb|Cooling system main valve to vent valve]]&lt;br /&gt;
# open vent valve&lt;br /&gt;
# air should now enter the system, draining all water from the TPC pipes into the vacuum vessel&lt;br /&gt;
# water pump will drain the vacuum vessel into supply tank, turn it off before the vessel is completely empty to avoid air in the water pump&lt;br /&gt;
# switch off main power&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
The water system is temperamental, and not intuitive at all. Common problems and solution attempts:&lt;br /&gt;
&lt;br /&gt;
; water pump very loud, doesn&#039;t appear to pump water&lt;br /&gt;
: most likely air in the water pump. Open the vent of the vacuum vessel to allow water to enter pump by gravity alone, pump should stop screaming and start pumping. Close vent.&lt;br /&gt;
; vacuum pump comes on often (more then every 10-20 min)&lt;br /&gt;
: probably an air leak in the system. Check for bubbles and try to find leak.&lt;br /&gt;
; water level/flow/vacuum oscillate between extreme values&lt;br /&gt;
: unclear, try playing with PID settings, throttle valve, possibly orange ball valves by the water pump.&lt;br /&gt;
&lt;br /&gt;
= Power distribution =&lt;br /&gt;
&lt;br /&gt;
This section covers the different voltages and power requirements for the operation of the rTPC. This includes:&lt;br /&gt;
&lt;br /&gt;
# High Voltage for the rTPC electron drift and amplification operation&lt;br /&gt;
# Low Voltage to the Anode wire frontend electronics&lt;br /&gt;
# Low Voltage to the Barrel Scintillator frontend electronics&lt;br /&gt;
# Low Voltage to the Cathode Pads electronics&lt;br /&gt;
# Grounding scheme of the overall rTPC&lt;br /&gt;
&lt;br /&gt;
The provision of power to the different components of the detector is distributed from the top end plate of the rTPC.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice12.png|507x354px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965261&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684500&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684892&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections&lt;br /&gt;
&lt;br /&gt;
== High Voltage for the rTPC ==&lt;br /&gt;
&lt;br /&gt;
Three main components of the rTPC require High Voltage&lt;br /&gt;
&lt;br /&gt;
* Main cathode wall (Negative ~5KV)&lt;br /&gt;
* Field wires (Negative ~ few hundred volts)&lt;br /&gt;
* Anode wires (Positive ~3.2KV )&lt;br /&gt;
&lt;br /&gt;
These voltages are provided by a Quad High Voltage unit from CAEN. Three independent cables will be fed to the top of the rTPC.&lt;br /&gt;
&lt;br /&gt;
High Voltage provision to the bottom endplate HV ring is taken from the central cathode near the bottom endplate.&lt;br /&gt;
&lt;br /&gt;
The Field wire voltage is connected to all the field wire crimp-pins through a dedicated socket chain inserted on each of the crimp-pin on the top and bottom endplates. The field wires themselves interconnect the high voltage between the top and bottom pins.&amp;lt;span id=&amp;quot;OLE_LINK20&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK21&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK22&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The High Voltage for the anode wires is delivered to the Anode Wire Card (AWC) which will distribute it to its 16 wires, Figure 11. There are 16 AWC cards covering each end of the anode wires. All the top and bottom 32 AWC are connected serially. The anode wires themselves interconnect the high voltage between the top and bottom pins.&lt;br /&gt;
&lt;br /&gt;
The anode wires pre-amplifiers boards (AWB) are sitting on the top of the Anode Wire Card (AWC) Figure 10. As the wire is powered by the HV, each anode wire has a high Voltage decoupling capacitor to isolate the pre-amp stage from the HV. This circuit resides on the AWC. The AWB will see the AC coupled anode signal only. With a new design of the AWC Figure 12, the decoupling capacitors are potted in epoxy to ensure proper isolation of the HV toward the surrounding circuit as well to prevent corona discharge due to relative humidity of the surrounding.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice13.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684196&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684501&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684893&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 10 – Unpotted Anode Wire Card and Board with HV distribution&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice14.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684198&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684502&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684894&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 11 - Anode wire pins and Field wire pins under yellow cover&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice15.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684370&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684503&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684895&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Anode wire frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
The AWB pre-amp board requires 2 voltages (+5V, -5V) which are fed through dedicated cable connections to each of the AWB. There are 16 AWB per end of the rTPC, therefore, 16 individual cable bundle will be reaching the top and another 16 the bottom of the rTPC. The cable bundle is to also provide the power return lines to the Power Supply.&lt;br /&gt;
&lt;br /&gt;
The PL508 Low Voltage power Supply from Wiener will provide the main power source for all the 32 pre-amplifiers. A dedicated connection breakout board with current monitoring capability splits the source power to the 2 x 16 necessary connections to the Anode wire boards. Based on a RaspeberryPi card, a 16 power distribution board is already implemented for the prototype. This board has extra 4 channels of temperature monitoring which can be used later on. In the same process we produce a similar board for 16 channel of NTC, RTC temperature monitoring. They will be used for overall detector and cooling system monitoring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;-5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Anode Pre-amp&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice16.jpg|239x363px]] [[File:imageservice17.png|239x363px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965262&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684504&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684896&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Barrel Scintillator frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
Similar to the Anode wire pre-amplifier voltage distribution scheme, the Barrel Scintillators will require several low voltages for power and control. The Barrel Scintillator Boards (BSB) are mounted on both ends of the Scintillator bar with the same segmentation as the Anode wires i.e.: 16 BSB per end. The design of the electronic chain for the barrel scintillator is not fully designed yet.&lt;br /&gt;
&lt;br /&gt;
The SiPM sensors require a bias voltage of the order of 28V. This voltage will be provided through the same mean as the low voltage power. Expected threshold voltage for the local signal level discriminator is also foreseen.&amp;lt;span id=&amp;quot;_Toc450564363&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Low Voltage to the Cathode Pads electronics ==&lt;br /&gt;
&lt;br /&gt;
The cathode pads electronics mounted on the external cylinder surface is composed of the analog frontend and the digital conversion electronics. Two voltages are required (+5.3V, +2.3V). The delivery is done through dedicated “power bar” running the full length of the rTPC. A set of 3 bars covers the 8 axial cathode pad electronics boards. 8 of them cover the circumference of the rTPC.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+2.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Padwing board&lt;br /&gt;
| 10W (1.8A)&lt;br /&gt;
| 2W (0.8A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Overall the low power supplies are provided by a PL508-3U with 8 modules of either single or dual channels from Wiener.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice18.png|469x360px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684505&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684897&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 14 - Overall Low voltage distribution for anode wires and cathode pads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564365&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grounding scheme of the overall rTPC ==&lt;br /&gt;
&lt;br /&gt;
The grounding scheme challenge in this setup is the far distance between the 2 end of the rTPC (2.3m) and the lack of accessibility to the bottom of the detector. The proposal is to use a Copper sheet mounted on the inner surface of the inner cylinder. This ground path will connect the 2 endplates to the High Voltage return. All the pre-amps will merge their ground to this central ground.&lt;br /&gt;
&lt;br /&gt;
Additional ground lugs have been included in the Anode wire pre-amplifier boards to strengthen the ground as each anode wire is readout out from both end. This may be used once the full detector is assembled to address possible ground loop issues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684506&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;[[File:imageservice19.png|439x409px]]&lt;br /&gt;
&lt;br /&gt;
= Safety and Hazard considerations =&lt;br /&gt;
&lt;br /&gt;
== Gas ==&lt;br /&gt;
&lt;br /&gt;
The Ar and CO2 do not require special health safety system. The detector will be operated in the ventilated hall of the AD building at CERN.&lt;br /&gt;
&lt;br /&gt;
Gas flow, detector gas pressure, and gas inlet temperature are constantly monitored and can trigger adequate response for shutdown or closure of the gas system for safety purpose.&lt;br /&gt;
&lt;br /&gt;
== Cooling water ==&lt;br /&gt;
&lt;br /&gt;
The water cooling system operates in negative pressure mode preventing any water leak to flood the detector outer surface. In addition water flow and inlet/outlet temperature are constantly monitored to allow fast response to off range parameter in order to shut down the electronics. The cooling water system requires a primary cooling tap water loop from the AD building. Water quality, water flow and water temperature are not under our responsibility. This aspect will be dealt during the initial phase of the rTPC commissioning at CERN.&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
All electronics voltages are below 48V. No special safety circuits are envisaged.&lt;br /&gt;
&lt;br /&gt;
The high-voltage circuit is fully protected outside the detector. The access to the high-voltage on the detector is restricted to the two end-plates. Interlock scheme will be put in place to ensure the shutdown of the HV in case of manual access to the detector itself.&lt;br /&gt;
&lt;br /&gt;
The LV (Low Voltage) power units are also interlocked to prevent false powering sequence which can damage the downstream electronics modules.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice20.png|571x411px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684507&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684899&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 16- Alpha-g rTPC rack organization&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:20190109_165410.jpg&amp;diff=505</id>
		<title>File:20190109 165410.jpg</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:20190109_165410.jpg&amp;diff=505"/>
		<updated>2019-01-09T17:29:09Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Gas rack outside zone&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=504</id>
		<title>Detector Services</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=504"/>
		<updated>2019-01-09T17:21:53Z</updated>

		<summary type="html">&lt;p&gt;Acapra: /* Quick Start */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Main Page]]&lt;br /&gt;
&lt;br /&gt;
= Table of Figures =&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684884|Figure 1 - Gas system schematic 6]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684885|Figure 2 - A half-rack space is used for the gas control implementation. 7]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684886|Figure 3 - Gas system half rack ready for installation 8]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684887|Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684888|Figure 5 - Water cooling system during test. 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684889|Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system. 12]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684890|Figure 7 - Overall water cooling system 13]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684891|Figure 8 - Temperature Monitor Board 14]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684892|Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections 15]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684893|Figure 10 – Unpotted Anode Wire Card and Board with HV distribution 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684894|Figure 11 - Anode wire pins and Field wire pins under yellow cover 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684895|Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire 18]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684896|Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards 19]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684897|Figure 14 - Overall Low voltage distribution for anode wires and cathode pads 21]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684898|Figure 15 - High Voltage &amp;amp;amp; Grounding scheme for the rTPC 22]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684899|Figure 16- Alpha-g rTPC rack organization 23]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684457&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This document is to describe the different services for the rTPC detector. 3 main sections cover the &#039;&#039;Gas system&#039;&#039;, the &#039;&#039;Water cooling system&#039;&#039; and the &#039;&#039;Power distribution&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= References and related Documents =&lt;br /&gt;
&lt;br /&gt;
A dedicated TRIUMF Wiki site gathers all documentations for the rTPC detector system and equipment. Gas system, cooling water system and power distribution can be found there.&lt;br /&gt;
&lt;br /&gt;
= Gas system =&lt;br /&gt;
&lt;br /&gt;
The gas system as described below includes the entire gas infrastructure required to deliver gas to the detector, monitor and control the gas flow into the detector. It also includes the necessary equipment to notify any change from the nominal gas flow or gas mixture ratio delivered to the detector.&lt;br /&gt;
&lt;br /&gt;
This type of mixed gas system is well understood by the Triumf detector group staff and no issue in its realization is expected.&lt;br /&gt;
&lt;br /&gt;
This system is a stand-alone infrastructure assembled and delivered to CERN. It will be placed in the Alpha-g experimental area floor. The delivery of the different gases to the experimental area is under the responsibility of the Gas handling group from CERN.&lt;br /&gt;
&lt;br /&gt;
The gas delivery system for the radial TPC (rTPC) is to provide Ar/CO2 gas mixture between 90/10 to 50/50 depending on the user requirements. This system does not recycle the gas as the environmental impact of either gas is minimal and the operation cost versus a recycling system would not be economic.&lt;br /&gt;
&lt;br /&gt;
In the event of an additional quenching gas requirement, the overall gas system will have to be reconsidered and possible recycling system envisaged.&lt;br /&gt;
&lt;br /&gt;
A simple gas mixer using digital flow meters will provide the precise mixture dialed by hand in the control system.&lt;br /&gt;
&lt;br /&gt;
During the prototype phase, an ad-hoc gas system will be put in place. A portable gas system is available for such a test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameter&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Value&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Gas mixture&lt;br /&gt;
| Ar/CO2 (90/10..50/50)&lt;br /&gt;
|-&lt;br /&gt;
| Gas flow requirements&lt;br /&gt;
| 0.3l/min (50%), 0.3l/min (50%)&lt;br /&gt;
|-&lt;br /&gt;
| Detector gas Volume&lt;br /&gt;
| 0.18m&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Flushing time&lt;br /&gt;
| 5h @ 600cc/min&lt;br /&gt;
|-&lt;br /&gt;
| Flow rate&lt;br /&gt;
| 100 to 300 cc/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
This gas system is quite simple as it takes 2 or 3 (spare) gas supplies and mixes them in a manifold before delivery to the rTPC detector. Necessary valves for purging lines and by-passing the detector are foreseen. The individual in-flows are controlled by gas dedicated mass flow controllers (MFC-x). The return flow is measured for leak assessment. An additional manometer monitors the internal detector pressure for evaluation of the electron drift characteristics.&lt;br /&gt;
&lt;br /&gt;
­­­­[[File:imageservice2.png|575x315px|PA_doc-1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684492&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684884&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 1 - Gas system schematic&lt;br /&gt;
&lt;br /&gt;
The main flow controller and monitoring is performed by industrial devices from MKS. We added analog flowmeters on each gas line to provide a quick visual inspection of the gas mixing system.&lt;br /&gt;
&lt;br /&gt;
This system will be hooked to the CERN AD-Gas facility. The CERN gas delivers gas through 2 switchable packs of 12 bottles for each gas.&lt;br /&gt;
&lt;br /&gt;
The gas exhaust is evacuated to the exterior of the experimental area with an elevation of about 8m.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice3.png|366x263px|PA_doc-2.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684493&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684885&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 2 - A half-rack space is used for the gas control implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450557826&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice4.png|324x364px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684494&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684886&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 3 - Gas system half rack ready for installation&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
[[File:20181205 103217.jpg|thumb|Normal configuration of the manual valves of the GHS.]]&lt;br /&gt;
From-scratch (Neither gas supply lines to the GHS nor connections to and from the TPC connected) connection of the GHS should follow the following procedure:&lt;br /&gt;
# &#039;&#039;&#039;Flush supply lines:&#039;&#039;&#039; Gas lines from outside bottles going to the GHS should be briefly (5 min or so) flushed with a high gas flow &#039;&#039;before&#039;&#039; connecting to the GHS to remove possible dust, and to minimize the amount of air in the lines.&lt;br /&gt;
# &#039;&#039;&#039;Flush GHS:&#039;&#039;&#039;&lt;br /&gt;
## Close BV1 and BV3, open BV2 and BV4 to flush input lines, only briefly.&lt;br /&gt;
## Open BV1 and BV3, close BV2 and BV4 (normal operation configuration)&lt;br /&gt;
## With Midas frontend running, use the &amp;quot;Gas&amp;quot; custom page to set a desired flow, for flushing probably between 1l/min and 1.5l/min (Without Midas, use the telnet interface), then press the &amp;quot;Bypass Flow&amp;quot; button, and let flow for a while (5-15min?)&lt;br /&gt;
# &#039;&#039;&#039;Flush TPC input line:&#039;&#039;&#039;&lt;br /&gt;
## Connect the line that will go from the GHS to the TPC input-tee on the GHS side, but leave disconnected from the tee&lt;br /&gt;
## do the same for the pressure gauge line&lt;br /&gt;
## On the &amp;quot;Gas&amp;quot; custom page, press the &amp;quot;Flow TPC&amp;quot; button and let flow for 5 min (Without Midas, use the telnet interface).&lt;br /&gt;
# Make all remaining connections&lt;br /&gt;
&lt;br /&gt;
== Telnet Interface ==&lt;br /&gt;
If the Midas frontend is not available the GHS can be controlled via telnet. Connect with&lt;br /&gt;
 telnet algas&lt;br /&gt;
then use the following command to control solenoid valves:&lt;br /&gt;
 cowr do i 1&lt;br /&gt;
to energize SVi, i.e. to switch it from its normal closed or open state to the other state,&lt;br /&gt;
 cowr do i 0&lt;br /&gt;
to de-energize, i.e. switch to default state.&lt;br /&gt;
&lt;br /&gt;
Gas flow is set with:&lt;br /&gt;
 mfcwr ao i &amp;lt;desired flow&amp;gt;&lt;br /&gt;
where i is 1 for Ar and 2 for CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, and the desired flow is in the internal units of the system.&lt;br /&gt;
&lt;br /&gt;
= Water cooling system =&lt;br /&gt;
&lt;br /&gt;
The outer surface of the detector has an arrangement of 8x8 electronics boards handling the readout of the cathode pads. These boards require operating at a controlled temperature to prevent heat build-up at the surface of the detector and improving the reliability of the system. In order to do so, 8 independent water pipe loops running from the bottom-up and down in the longitudinal axis of the detector are in a thermal contact to 8 successive readout boards. From the bottom, a pair of water hoses connect to 2 custom 3D-printed manifolds supplying the water feed and return to the 8 water loops.&lt;br /&gt;
&lt;br /&gt;
These 8 loops are run in parallel to a negative pressure water cooling system. This negative pressure system is to ensure that no water leak will damage the electronics even during possible pipe or delivery hose breakage.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice5.png|516x273px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960816&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684495&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684887&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice6.jpg|249x429px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960817&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684496&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684888&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 5 - Water cooling system during test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameters&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Values&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Number of parallel water loops&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| Copper pipe OD/ID&lt;br /&gt;
| ¼” / 4.7mm&lt;br /&gt;
|-&lt;br /&gt;
| Length of one loop (on the rTPC)&lt;br /&gt;
| 4.6m&lt;br /&gt;
|-&lt;br /&gt;
| Water speed per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Pressure drop per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Power extraction per water loop&lt;br /&gt;
| 8x15W= 120W&lt;br /&gt;
|-&lt;br /&gt;
| Total cooling power&lt;br /&gt;
| 1KW&lt;br /&gt;
|-&lt;br /&gt;
| Inlet water temperature&lt;br /&gt;
| 16..20 degC (to be confirmed)&lt;br /&gt;
|-&lt;br /&gt;
| Outlet water temperature&lt;br /&gt;
| 20..24 degC&lt;br /&gt;
|-&lt;br /&gt;
| Total water flow&lt;br /&gt;
| 3..6 l/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This description corresponds to how we think the system should work, but doesn&#039;t seem fully comatible with the behaviour of the system. E.g. the air pump only seems to turn on when PID1 falls below a certain value.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Pressure PID (proportional/integral/differential controller), PID2, monitors the air pressure in the vacuum vessel. When the pressure rises above a trigger value (perhaps 350mbar) it activates the aspirator vacuum pump to bring the pressure down to maintain a long time averaged pressure (say 300mbar).&lt;br /&gt;
&lt;br /&gt;
This vacuum is then used to draw water through the detector into the vessel, from the Open Tank. The vacuum vessel&#039;s water level is monitored by PID1, using a differential pressure transducer measuring the weight of the water column by the difference between the air pressure in the top of the vessel and the water pressure at the bottom of the vessel. PID1 provides a variable signal to the Proportional Solenoid Valve, which varies the flow through the return loop around the (fixed flow) water pump, and thus changing the overall flow of water from the vacuum vessel to keep the water level in the vessel constant despite water being constantly drawn in by the vacuum. The water pulled from the vacuum vessel is pushed through the filter and into the Open Tank, completing the circulation.&lt;br /&gt;
&lt;br /&gt;
Cooling is accomplished in the water pump leg of the system, as coolant pulled from the vacuum vessel passes through a heat exchanger coupled to CERN’s cooling water supply on its way to the pump. The rate that water flows through the system can be determined by many obstacles in the loop, but ideally it should be dominated by the position of the main Throttle Valve. Other valves should generally be set either fully open of fully closed, except for the Proportional Valve, whose position responds to the setting of the Throttle Valve.&lt;br /&gt;
&lt;br /&gt;
Data outputs: there are five data outputs planned. The two process variables, the vacuum vessel absolute pressure, and differential water column pressure, will be sent to the Detector DAQ system. As well, the total flow rate is monitored by the flow meter, whose output is sent to the DAQ system. This data is not used by the circulation system itself. Likewise, the back pressure on the water filter is only sent to the DAQ system to indicate if the filter may need changing, and the temperature of the open tank is monitored and sent to the DAQ system, but currently there is no plan to use it in a temperature control feedback. The temperature of CERN&#039;s cooling water supply is not yet known, but we expect we can set the heat exchanger to run at a rate to hold the system temperature near 20°C without feedback control.&lt;br /&gt;
&lt;br /&gt;
For the negative pressure to work effectively to prevent leaks, the water pressure in the detector ought to be down at least to half an atmosphere. With the detector cooling tubes 8x 4.6m of parallel 4.7mm ID copper tubes (2.3m down then 2.3 back-ups), and the supply using (perhaps 6m, 3 to the detector then 3 back) 9.7mm ID (=1/2&amp;amp;quot; OD) poly tubing, the flow will need to be somewhat greater than the required 3 l/min in order to maintain that degree of vacuum in the detector, unless the Throttle Valve is placed upstream of the detector near the Open Tank, or an additional constriction is added in that region.&lt;br /&gt;
&lt;br /&gt;
The water pump leg of the circuit residing in the water cooling/gas rack is placed far enough from the fringe field of the superconducting magnet to prevent disruptive effects on the solenoid valves and electric motors. Therefore the main 1/2&amp;amp;quot; poly line to and from the water pump and its flow loop will add a pressure drop which is estimated at 0.4atm for a 10m line at 6 l/min (9.7mmID), which is within our requirements. As mentioned earlier, the splitting (and reassembly) of the line to the 8 cooling lines close to detector will be accomplished with the use of 2 separate manifolds equipped with temperature sensors for constant in/out global water temperature monitoring.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice7.png|286x206px]][[File:imageservice8.jpg|286x206px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684497&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684889&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system.&lt;br /&gt;
&lt;br /&gt;
Currently, PVC valves with &amp;amp;quot;true union&amp;amp;quot; couplings are planned to be provided around the water pump to permit it to be swapped out from the system for servicing and a valved bypass to the water filter is provided for the same purpose to allow easily changing filter elements with the system running. True union valves are generally only available to 1/2NPT and larger, so an adapter fitting is required. The vacuum pump for the system is a small (2 x 5 x 7.5cm) cascaded dual Venturi aspirator, which is operated with site air, switched with two simultaneously operated normally closed solenoid valves, one for the site air, and one for the vessel vacuum input. If the system is leak free, the vacuum in the vessel should only be degraded by the dissolved air absorbed in the Open Tank and extracted in the vacuum vessel, which from past experience might mean running for under a minute every six hours or so.&lt;br /&gt;
&lt;br /&gt;
The wetted surfaces of this system will be mainly PVC and Polyethylene for the valves, tubing and vessels, plus brass fittings, and the copper cooling tubes, and the surfaces of the heat exchanger, which will most likely be stainless steel. It may be possible to devise an equivalent of a bellows communicating with the Open Tank, so that it is only virtually open, thus sealing the cooling water from contaminants, which may allow us to run with just distilled water plus a strip of silver as a biocide (although I&#039;m not sure if the mix of metals, copper plus stainless, may not interfere with the function of the silver, which is mostly used in computer cooling systems which are copper and plastic only). Otherwise, we will need a biocide and corrosion inhibitor. We have the latter, tolyltriazole, but the biocide is problematic. They tend to be short-lived; for systems which are open to atmosphere, typical industrial practice is chlorination, regularly refreshed, which builds up NaCl as it degrades, making the coolant corrosive. For T2K in Japan, we used the (human-nontoxic) &amp;amp;quot;Germall&amp;amp;quot;, which has a two-year lifetime, after which when its effectiveness decays it turns into food, which is the case for any solute that is not actively biocidal. Eventually, any such additives build up and require the coolant to be flushed and replaced. Silver is a lovely method, but only works for extended periods with a sealed system which remains deoxygenated. My research so far has not turned up a good candidate which does not entail recurring changes of the coolant.&lt;br /&gt;
&lt;br /&gt;
Power: the system needs to be able to run on European 220VAC power, but also operate here for testing purposes. The PIDs (Omega CN76160s) will accept both; for the rest of the system, I will have an a universal 90-240VAC input to 24VDC (5A) supply which will drive all the other components, including the pump, which will be a brushless 24VDC centrifugal pump, 1 - 1.5A range. The whole system will run about 125W.&lt;br /&gt;
&lt;br /&gt;
Information on the temperature and flow rate of the CERN cooling water system will be provided later but we don’t anticipate any major issues about the sizing of the heat exchanger.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice9.png|603x344px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960818&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684498&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684890&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 7 - Overall water cooling system&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564356&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Temperature Measurement ==&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice10.jpeg|225x356px]] [[File:imageservice11.png|194x358px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684499&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684891&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 8 Temperature Monitor Board&lt;br /&gt;
&lt;br /&gt;
The water temperature is read by the Temperature Monitor Board (TEMPB). Thermistors located inside the manifold connect to a 16 bit ADC on the TEMPB which is read out by a Raspberry Pi mounted on board. In a similar manner the air system temperature is read with sensors in the air manifold. The TEMPB can provide temperature readout of 32 thermistors which connect to terminal blocks. The channels can also be readout differentially providing up to 16 channels for thermocouples. An on board thermistor allows for cold junction compensation. The board is powered via USB on the Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
This assumes all water lines and compressed air are connected, and both the blue water tank and the chiller are filled.&lt;br /&gt;
&lt;br /&gt;
=== Begin running ===&lt;br /&gt;
# Close vent valve and main valve (3-way valve in T position)&lt;br /&gt;
# Switch on control box with power switch in the back&lt;br /&gt;
# confirm water pump is off, i.e. blue button is not illuminated&lt;br /&gt;
# Vacuum pump should now be running&lt;br /&gt;
# Open main valve, i.e. vertical connection open, connection to vent valve closed [[File:PWBmainOpen.jpg|thumb|Cooling system main valve open]]&lt;br /&gt;
# water should start flowing through the PWB cooling system and coming back through the clear pipe connected to the vacuum vessel&lt;br /&gt;
# Default settings are PID1 = 200, PID2 = 300, but may have been adjusted&lt;br /&gt;
# once the water level in the vacuum vessel has risen to ~20cm, turn on the water pump&lt;br /&gt;
&lt;br /&gt;
=== Drain system ===&lt;br /&gt;
# from normal operation, i.e. vacuum pump and water pump running&lt;br /&gt;
# switch main valve to upside down T position &lt;br /&gt;
[[File:PWBmainVent.jpg|thumb|Cooling system main valve to vent valve]]&lt;br /&gt;
# open vent valve&lt;br /&gt;
# air should now enter the system, draining all water from the TPC pipes into the vacuum vessel&lt;br /&gt;
# water pump will drain the vacuum vessel into supply tank, turn it off before the vessel is completely empty to avoid air in the water pump&lt;br /&gt;
# switch off main power&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
The water system is temperamental, and not intuitive at all. Common problems and solution attempts:&lt;br /&gt;
&lt;br /&gt;
; water pump very loud, doesn&#039;t appear to pump water&lt;br /&gt;
: most likely air in the water pump. Open the vent of the vacuum vessel to allow water to enter pump by gravity alone, pump should stop screaming and start pumping. Close vent.&lt;br /&gt;
; vacuum pump comes on often (more then every 10-20 min)&lt;br /&gt;
: probably an air leak in the system. Check for bubbles and try to find leak.&lt;br /&gt;
; water level/flow/vacuum oscillate between extreme values&lt;br /&gt;
: unclear, try playing with PID settings, throttle valve, possibly orange ball valves by the water pump.&lt;br /&gt;
&lt;br /&gt;
= Power distribution =&lt;br /&gt;
&lt;br /&gt;
This section covers the different voltages and power requirements for the operation of the rTPC. This includes:&lt;br /&gt;
&lt;br /&gt;
# High Voltage for the rTPC electron drift and amplification operation&lt;br /&gt;
# Low Voltage to the Anode wire frontend electronics&lt;br /&gt;
# Low Voltage to the Barrel Scintillator frontend electronics&lt;br /&gt;
# Low Voltage to the Cathode Pads electronics&lt;br /&gt;
# Grounding scheme of the overall rTPC&lt;br /&gt;
&lt;br /&gt;
The provision of power to the different components of the detector is distributed from the top end plate of the rTPC.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice12.png|507x354px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965261&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684500&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684892&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections&lt;br /&gt;
&lt;br /&gt;
== High Voltage for the rTPC ==&lt;br /&gt;
&lt;br /&gt;
Three main components of the rTPC require High Voltage&lt;br /&gt;
&lt;br /&gt;
* Main cathode wall (Negative ~5KV)&lt;br /&gt;
* Field wires (Negative ~ few hundred volts)&lt;br /&gt;
* Anode wires (Positive ~3.2KV )&lt;br /&gt;
&lt;br /&gt;
These voltages are provided by a Quad High Voltage unit from CAEN. Three independent cables will be fed to the top of the rTPC.&lt;br /&gt;
&lt;br /&gt;
High Voltage provision to the bottom endplate HV ring is taken from the central cathode near the bottom endplate.&lt;br /&gt;
&lt;br /&gt;
The Field wire voltage is connected to all the field wire crimp-pins through a dedicated socket chain inserted on each of the crimp-pin on the top and bottom endplates. The field wires themselves interconnect the high voltage between the top and bottom pins.&amp;lt;span id=&amp;quot;OLE_LINK20&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK21&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK22&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The High Voltage for the anode wires is delivered to the Anode Wire Card (AWC) which will distribute it to its 16 wires, Figure 11. There are 16 AWC cards covering each end of the anode wires. All the top and bottom 32 AWC are connected serially. The anode wires themselves interconnect the high voltage between the top and bottom pins.&lt;br /&gt;
&lt;br /&gt;
The anode wires pre-amplifiers boards (AWB) are sitting on the top of the Anode Wire Card (AWC) Figure 10. As the wire is powered by the HV, each anode wire has a high Voltage decoupling capacitor to isolate the pre-amp stage from the HV. This circuit resides on the AWC. The AWB will see the AC coupled anode signal only. With a new design of the AWC Figure 12, the decoupling capacitors are potted in epoxy to ensure proper isolation of the HV toward the surrounding circuit as well to prevent corona discharge due to relative humidity of the surrounding.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice13.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684196&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684501&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684893&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 10 – Unpotted Anode Wire Card and Board with HV distribution&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice14.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684198&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684502&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684894&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 11 - Anode wire pins and Field wire pins under yellow cover&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice15.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684370&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684503&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684895&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Anode wire frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
The AWB pre-amp board requires 2 voltages (+5V, -5V) which are fed through dedicated cable connections to each of the AWB. There are 16 AWB per end of the rTPC, therefore, 16 individual cable bundle will be reaching the top and another 16 the bottom of the rTPC. The cable bundle is to also provide the power return lines to the Power Supply.&lt;br /&gt;
&lt;br /&gt;
The PL508 Low Voltage power Supply from Wiener will provide the main power source for all the 32 pre-amplifiers. A dedicated connection breakout board with current monitoring capability splits the source power to the 2 x 16 necessary connections to the Anode wire boards. Based on a RaspeberryPi card, a 16 power distribution board is already implemented for the prototype. This board has extra 4 channels of temperature monitoring which can be used later on. In the same process we produce a similar board for 16 channel of NTC, RTC temperature monitoring. They will be used for overall detector and cooling system monitoring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;-5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Anode Pre-amp&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice16.jpg|239x363px]] [[File:imageservice17.png|239x363px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965262&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684504&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684896&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Barrel Scintillator frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
Similar to the Anode wire pre-amplifier voltage distribution scheme, the Barrel Scintillators will require several low voltages for power and control. The Barrel Scintillator Boards (BSB) are mounted on both ends of the Scintillator bar with the same segmentation as the Anode wires i.e.: 16 BSB per end. The design of the electronic chain for the barrel scintillator is not fully designed yet.&lt;br /&gt;
&lt;br /&gt;
The SiPM sensors require a bias voltage of the order of 28V. This voltage will be provided through the same mean as the low voltage power. Expected threshold voltage for the local signal level discriminator is also foreseen.&amp;lt;span id=&amp;quot;_Toc450564363&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Low Voltage to the Cathode Pads electronics ==&lt;br /&gt;
&lt;br /&gt;
The cathode pads electronics mounted on the external cylinder surface is composed of the analog frontend and the digital conversion electronics. Two voltages are required (+5.3V, +2.3V). The delivery is done through dedicated “power bar” running the full length of the rTPC. A set of 3 bars covers the 8 axial cathode pad electronics boards. 8 of them cover the circumference of the rTPC.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+2.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Padwing board&lt;br /&gt;
| 10W (1.8A)&lt;br /&gt;
| 2W (0.8A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Overall the low power supplies are provided by a PL508-3U with 8 modules of either single or dual channels from Wiener.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice18.png|469x360px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684505&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684897&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 14 - Overall Low voltage distribution for anode wires and cathode pads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564365&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grounding scheme of the overall rTPC ==&lt;br /&gt;
&lt;br /&gt;
The grounding scheme challenge in this setup is the far distance between the 2 end of the rTPC (2.3m) and the lack of accessibility to the bottom of the detector. The proposal is to use a Copper sheet mounted on the inner surface of the inner cylinder. This ground path will connect the 2 endplates to the High Voltage return. All the pre-amps will merge their ground to this central ground.&lt;br /&gt;
&lt;br /&gt;
Additional ground lugs have been included in the Anode wire pre-amplifier boards to strengthen the ground as each anode wire is readout out from both end. This may be used once the full detector is assembled to address possible ground loop issues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684506&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;[[File:imageservice19.png|439x409px]]&lt;br /&gt;
&lt;br /&gt;
= Safety and Hazard considerations =&lt;br /&gt;
&lt;br /&gt;
== Gas ==&lt;br /&gt;
&lt;br /&gt;
The Ar and CO2 do not require special health safety system. The detector will be operated in the ventilated hall of the AD building at CERN.&lt;br /&gt;
&lt;br /&gt;
Gas flow, detector gas pressure, and gas inlet temperature are constantly monitored and can trigger adequate response for shutdown or closure of the gas system for safety purpose.&lt;br /&gt;
&lt;br /&gt;
== Cooling water ==&lt;br /&gt;
&lt;br /&gt;
The water cooling system operates in negative pressure mode preventing any water leak to flood the detector outer surface. In addition water flow and inlet/outlet temperature are constantly monitored to allow fast response to off range parameter in order to shut down the electronics. The cooling water system requires a primary cooling tap water loop from the AD building. Water quality, water flow and water temperature are not under our responsibility. This aspect will be dealt during the initial phase of the rTPC commissioning at CERN.&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
All electronics voltages are below 48V. No special safety circuits are envisaged.&lt;br /&gt;
&lt;br /&gt;
The high-voltage circuit is fully protected outside the detector. The access to the high-voltage on the detector is restricted to the two end-plates. Interlock scheme will be put in place to ensure the shutdown of the HV in case of manual access to the detector itself.&lt;br /&gt;
&lt;br /&gt;
The LV (Low Voltage) power units are also interlocked to prevent false powering sequence which can damage the downstream electronics modules.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice20.png|571x411px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684507&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684899&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 16- Alpha-g rTPC rack organization&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=503</id>
		<title>Detector Services</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=503"/>
		<updated>2019-01-09T17:20:44Z</updated>

		<summary type="html">&lt;p&gt;Acapra: /* Quick Start */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Main Page]]&lt;br /&gt;
&lt;br /&gt;
= Table of Figures =&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684884|Figure 1 - Gas system schematic 6]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684885|Figure 2 - A half-rack space is used for the gas control implementation. 7]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684886|Figure 3 - Gas system half rack ready for installation 8]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684887|Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684888|Figure 5 - Water cooling system during test. 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684889|Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system. 12]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684890|Figure 7 - Overall water cooling system 13]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684891|Figure 8 - Temperature Monitor Board 14]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684892|Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections 15]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684893|Figure 10 – Unpotted Anode Wire Card and Board with HV distribution 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684894|Figure 11 - Anode wire pins and Field wire pins under yellow cover 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684895|Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire 18]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684896|Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards 19]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684897|Figure 14 - Overall Low voltage distribution for anode wires and cathode pads 21]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684898|Figure 15 - High Voltage &amp;amp;amp; Grounding scheme for the rTPC 22]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684899|Figure 16- Alpha-g rTPC rack organization 23]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684457&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This document is to describe the different services for the rTPC detector. 3 main sections cover the &#039;&#039;Gas system&#039;&#039;, the &#039;&#039;Water cooling system&#039;&#039; and the &#039;&#039;Power distribution&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= References and related Documents =&lt;br /&gt;
&lt;br /&gt;
A dedicated TRIUMF Wiki site gathers all documentations for the rTPC detector system and equipment. Gas system, cooling water system and power distribution can be found there.&lt;br /&gt;
&lt;br /&gt;
= Gas system =&lt;br /&gt;
&lt;br /&gt;
The gas system as described below includes the entire gas infrastructure required to deliver gas to the detector, monitor and control the gas flow into the detector. It also includes the necessary equipment to notify any change from the nominal gas flow or gas mixture ratio delivered to the detector.&lt;br /&gt;
&lt;br /&gt;
This type of mixed gas system is well understood by the Triumf detector group staff and no issue in its realization is expected.&lt;br /&gt;
&lt;br /&gt;
This system is a stand-alone infrastructure assembled and delivered to CERN. It will be placed in the Alpha-g experimental area floor. The delivery of the different gases to the experimental area is under the responsibility of the Gas handling group from CERN.&lt;br /&gt;
&lt;br /&gt;
The gas delivery system for the radial TPC (rTPC) is to provide Ar/CO2 gas mixture between 90/10 to 50/50 depending on the user requirements. This system does not recycle the gas as the environmental impact of either gas is minimal and the operation cost versus a recycling system would not be economic.&lt;br /&gt;
&lt;br /&gt;
In the event of an additional quenching gas requirement, the overall gas system will have to be reconsidered and possible recycling system envisaged.&lt;br /&gt;
&lt;br /&gt;
A simple gas mixer using digital flow meters will provide the precise mixture dialed by hand in the control system.&lt;br /&gt;
&lt;br /&gt;
During the prototype phase, an ad-hoc gas system will be put in place. A portable gas system is available for such a test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameter&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Value&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Gas mixture&lt;br /&gt;
| Ar/CO2 (90/10..50/50)&lt;br /&gt;
|-&lt;br /&gt;
| Gas flow requirements&lt;br /&gt;
| 0.3l/min (50%), 0.3l/min (50%)&lt;br /&gt;
|-&lt;br /&gt;
| Detector gas Volume&lt;br /&gt;
| 0.18m&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Flushing time&lt;br /&gt;
| 5h @ 600cc/min&lt;br /&gt;
|-&lt;br /&gt;
| Flow rate&lt;br /&gt;
| 100 to 300 cc/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
This gas system is quite simple as it takes 2 or 3 (spare) gas supplies and mixes them in a manifold before delivery to the rTPC detector. Necessary valves for purging lines and by-passing the detector are foreseen. The individual in-flows are controlled by gas dedicated mass flow controllers (MFC-x). The return flow is measured for leak assessment. An additional manometer monitors the internal detector pressure for evaluation of the electron drift characteristics.&lt;br /&gt;
&lt;br /&gt;
­­­­[[File:imageservice2.png|575x315px|PA_doc-1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684492&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684884&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 1 - Gas system schematic&lt;br /&gt;
&lt;br /&gt;
The main flow controller and monitoring is performed by industrial devices from MKS. We added analog flowmeters on each gas line to provide a quick visual inspection of the gas mixing system.&lt;br /&gt;
&lt;br /&gt;
This system will be hooked to the CERN AD-Gas facility. The CERN gas delivers gas through 2 switchable packs of 12 bottles for each gas.&lt;br /&gt;
&lt;br /&gt;
The gas exhaust is evacuated to the exterior of the experimental area with an elevation of about 8m.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice3.png|366x263px|PA_doc-2.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684493&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684885&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 2 - A half-rack space is used for the gas control implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450557826&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice4.png|324x364px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684494&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684886&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 3 - Gas system half rack ready for installation&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
From-scratch (Neither gas supply lines to the GHS nor connections to and from the TPC connected) connection of the GHS should follow the following procedure:&lt;br /&gt;
# &#039;&#039;&#039;Flush supply lines:&#039;&#039;&#039; Gas lines from outside bottles going to the GHS should be briefly (5 min or so) flushed with a high gas flow &#039;&#039;before&#039;&#039; connecting to the GHS to remove possible dust, and to minimize the amount of air in the lines.&lt;br /&gt;
[[File:20181205 103217.jpg|thumb|Normal configuration of the manual valves of the GHS.]]&lt;br /&gt;
# &#039;&#039;&#039;Flush GHS:&#039;&#039;&#039;&lt;br /&gt;
## Close BV1 and BV3, open BV2 and BV4 to flush input lines, only briefly.&lt;br /&gt;
## Open BV1 and BV3, close BV2 and BV4 (normal operation configuration)&lt;br /&gt;
## With Midas frontend running, use the &amp;quot;Gas&amp;quot; custom page to set a desired flow, for flushing probably between 1l/min and 1.5l/min (Without Midas, use the telnet interface), then press the &amp;quot;Bypass Flow&amp;quot; button, and let flow for a while (5-15min?)&lt;br /&gt;
# &#039;&#039;&#039;Flush TPC input line:&#039;&#039;&#039;&lt;br /&gt;
## Connect the line that will go from the GHS to the TPC input-tee on the GHS side, but leave disconnected from the tee&lt;br /&gt;
## do the same for the pressure gauge line&lt;br /&gt;
## On the &amp;quot;Gas&amp;quot; custom page, press the &amp;quot;Flow TPC&amp;quot; button and let flow for 5 min (Without Midas, use the telnet interface).&lt;br /&gt;
# Make all remaining connections&lt;br /&gt;
&lt;br /&gt;
== Telnet Interface ==&lt;br /&gt;
If the Midas frontend is not available the GHS can be controlled via telnet. Connect with&lt;br /&gt;
 telnet algas&lt;br /&gt;
then use the following command to control solenoid valves:&lt;br /&gt;
 cowr do i 1&lt;br /&gt;
to energize SVi, i.e. to switch it from its normal closed or open state to the other state,&lt;br /&gt;
 cowr do i 0&lt;br /&gt;
to de-energize, i.e. switch to default state.&lt;br /&gt;
&lt;br /&gt;
Gas flow is set with:&lt;br /&gt;
 mfcwr ao i &amp;lt;desired flow&amp;gt;&lt;br /&gt;
where i is 1 for Ar and 2 for CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, and the desired flow is in the internal units of the system.&lt;br /&gt;
&lt;br /&gt;
= Water cooling system =&lt;br /&gt;
&lt;br /&gt;
The outer surface of the detector has an arrangement of 8x8 electronics boards handling the readout of the cathode pads. These boards require operating at a controlled temperature to prevent heat build-up at the surface of the detector and improving the reliability of the system. In order to do so, 8 independent water pipe loops running from the bottom-up and down in the longitudinal axis of the detector are in a thermal contact to 8 successive readout boards. From the bottom, a pair of water hoses connect to 2 custom 3D-printed manifolds supplying the water feed and return to the 8 water loops.&lt;br /&gt;
&lt;br /&gt;
These 8 loops are run in parallel to a negative pressure water cooling system. This negative pressure system is to ensure that no water leak will damage the electronics even during possible pipe or delivery hose breakage.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice5.png|516x273px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960816&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684495&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684887&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice6.jpg|249x429px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960817&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684496&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684888&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 5 - Water cooling system during test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameters&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Values&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Number of parallel water loops&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| Copper pipe OD/ID&lt;br /&gt;
| ¼” / 4.7mm&lt;br /&gt;
|-&lt;br /&gt;
| Length of one loop (on the rTPC)&lt;br /&gt;
| 4.6m&lt;br /&gt;
|-&lt;br /&gt;
| Water speed per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Pressure drop per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Power extraction per water loop&lt;br /&gt;
| 8x15W= 120W&lt;br /&gt;
|-&lt;br /&gt;
| Total cooling power&lt;br /&gt;
| 1KW&lt;br /&gt;
|-&lt;br /&gt;
| Inlet water temperature&lt;br /&gt;
| 16..20 degC (to be confirmed)&lt;br /&gt;
|-&lt;br /&gt;
| Outlet water temperature&lt;br /&gt;
| 20..24 degC&lt;br /&gt;
|-&lt;br /&gt;
| Total water flow&lt;br /&gt;
| 3..6 l/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This description corresponds to how we think the system should work, but doesn&#039;t seem fully comatible with the behaviour of the system. E.g. the air pump only seems to turn on when PID1 falls below a certain value.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Pressure PID (proportional/integral/differential controller), PID2, monitors the air pressure in the vacuum vessel. When the pressure rises above a trigger value (perhaps 350mbar) it activates the aspirator vacuum pump to bring the pressure down to maintain a long time averaged pressure (say 300mbar).&lt;br /&gt;
&lt;br /&gt;
This vacuum is then used to draw water through the detector into the vessel, from the Open Tank. The vacuum vessel&#039;s water level is monitored by PID1, using a differential pressure transducer measuring the weight of the water column by the difference between the air pressure in the top of the vessel and the water pressure at the bottom of the vessel. PID1 provides a variable signal to the Proportional Solenoid Valve, which varies the flow through the return loop around the (fixed flow) water pump, and thus changing the overall flow of water from the vacuum vessel to keep the water level in the vessel constant despite water being constantly drawn in by the vacuum. The water pulled from the vacuum vessel is pushed through the filter and into the Open Tank, completing the circulation.&lt;br /&gt;
&lt;br /&gt;
Cooling is accomplished in the water pump leg of the system, as coolant pulled from the vacuum vessel passes through a heat exchanger coupled to CERN’s cooling water supply on its way to the pump. The rate that water flows through the system can be determined by many obstacles in the loop, but ideally it should be dominated by the position of the main Throttle Valve. Other valves should generally be set either fully open of fully closed, except for the Proportional Valve, whose position responds to the setting of the Throttle Valve.&lt;br /&gt;
&lt;br /&gt;
Data outputs: there are five data outputs planned. The two process variables, the vacuum vessel absolute pressure, and differential water column pressure, will be sent to the Detector DAQ system. As well, the total flow rate is monitored by the flow meter, whose output is sent to the DAQ system. This data is not used by the circulation system itself. Likewise, the back pressure on the water filter is only sent to the DAQ system to indicate if the filter may need changing, and the temperature of the open tank is monitored and sent to the DAQ system, but currently there is no plan to use it in a temperature control feedback. The temperature of CERN&#039;s cooling water supply is not yet known, but we expect we can set the heat exchanger to run at a rate to hold the system temperature near 20°C without feedback control.&lt;br /&gt;
&lt;br /&gt;
For the negative pressure to work effectively to prevent leaks, the water pressure in the detector ought to be down at least to half an atmosphere. With the detector cooling tubes 8x 4.6m of parallel 4.7mm ID copper tubes (2.3m down then 2.3 back-ups), and the supply using (perhaps 6m, 3 to the detector then 3 back) 9.7mm ID (=1/2&amp;amp;quot; OD) poly tubing, the flow will need to be somewhat greater than the required 3 l/min in order to maintain that degree of vacuum in the detector, unless the Throttle Valve is placed upstream of the detector near the Open Tank, or an additional constriction is added in that region.&lt;br /&gt;
&lt;br /&gt;
The water pump leg of the circuit residing in the water cooling/gas rack is placed far enough from the fringe field of the superconducting magnet to prevent disruptive effects on the solenoid valves and electric motors. Therefore the main 1/2&amp;amp;quot; poly line to and from the water pump and its flow loop will add a pressure drop which is estimated at 0.4atm for a 10m line at 6 l/min (9.7mmID), which is within our requirements. As mentioned earlier, the splitting (and reassembly) of the line to the 8 cooling lines close to detector will be accomplished with the use of 2 separate manifolds equipped with temperature sensors for constant in/out global water temperature monitoring.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice7.png|286x206px]][[File:imageservice8.jpg|286x206px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684497&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684889&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system.&lt;br /&gt;
&lt;br /&gt;
Currently, PVC valves with &amp;amp;quot;true union&amp;amp;quot; couplings are planned to be provided around the water pump to permit it to be swapped out from the system for servicing and a valved bypass to the water filter is provided for the same purpose to allow easily changing filter elements with the system running. True union valves are generally only available to 1/2NPT and larger, so an adapter fitting is required. The vacuum pump for the system is a small (2 x 5 x 7.5cm) cascaded dual Venturi aspirator, which is operated with site air, switched with two simultaneously operated normally closed solenoid valves, one for the site air, and one for the vessel vacuum input. If the system is leak free, the vacuum in the vessel should only be degraded by the dissolved air absorbed in the Open Tank and extracted in the vacuum vessel, which from past experience might mean running for under a minute every six hours or so.&lt;br /&gt;
&lt;br /&gt;
The wetted surfaces of this system will be mainly PVC and Polyethylene for the valves, tubing and vessels, plus brass fittings, and the copper cooling tubes, and the surfaces of the heat exchanger, which will most likely be stainless steel. It may be possible to devise an equivalent of a bellows communicating with the Open Tank, so that it is only virtually open, thus sealing the cooling water from contaminants, which may allow us to run with just distilled water plus a strip of silver as a biocide (although I&#039;m not sure if the mix of metals, copper plus stainless, may not interfere with the function of the silver, which is mostly used in computer cooling systems which are copper and plastic only). Otherwise, we will need a biocide and corrosion inhibitor. We have the latter, tolyltriazole, but the biocide is problematic. They tend to be short-lived; for systems which are open to atmosphere, typical industrial practice is chlorination, regularly refreshed, which builds up NaCl as it degrades, making the coolant corrosive. For T2K in Japan, we used the (human-nontoxic) &amp;amp;quot;Germall&amp;amp;quot;, which has a two-year lifetime, after which when its effectiveness decays it turns into food, which is the case for any solute that is not actively biocidal. Eventually, any such additives build up and require the coolant to be flushed and replaced. Silver is a lovely method, but only works for extended periods with a sealed system which remains deoxygenated. My research so far has not turned up a good candidate which does not entail recurring changes of the coolant.&lt;br /&gt;
&lt;br /&gt;
Power: the system needs to be able to run on European 220VAC power, but also operate here for testing purposes. The PIDs (Omega CN76160s) will accept both; for the rest of the system, I will have an a universal 90-240VAC input to 24VDC (5A) supply which will drive all the other components, including the pump, which will be a brushless 24VDC centrifugal pump, 1 - 1.5A range. The whole system will run about 125W.&lt;br /&gt;
&lt;br /&gt;
Information on the temperature and flow rate of the CERN cooling water system will be provided later but we don’t anticipate any major issues about the sizing of the heat exchanger.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice9.png|603x344px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960818&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684498&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684890&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 7 - Overall water cooling system&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564356&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Temperature Measurement ==&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice10.jpeg|225x356px]] [[File:imageservice11.png|194x358px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684499&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684891&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 8 Temperature Monitor Board&lt;br /&gt;
&lt;br /&gt;
The water temperature is read by the Temperature Monitor Board (TEMPB). Thermistors located inside the manifold connect to a 16 bit ADC on the TEMPB which is read out by a Raspberry Pi mounted on board. In a similar manner the air system temperature is read with sensors in the air manifold. The TEMPB can provide temperature readout of 32 thermistors which connect to terminal blocks. The channels can also be readout differentially providing up to 16 channels for thermocouples. An on board thermistor allows for cold junction compensation. The board is powered via USB on the Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
This assumes all water lines and compressed air are connected, and both the blue water tank and the chiller are filled.&lt;br /&gt;
&lt;br /&gt;
=== Begin running ===&lt;br /&gt;
# Close vent valve and main valve (3-way valve in T position)&lt;br /&gt;
# Switch on control box with power switch in the back&lt;br /&gt;
# confirm water pump is off, i.e. blue button is not illuminated&lt;br /&gt;
# Vacuum pump should now be running&lt;br /&gt;
# Open main valve, i.e. vertical connection open, connection to vent valve closed [[File:PWBmainOpen.jpg|thumb|Cooling system main valve open]]&lt;br /&gt;
# water should start flowing through the PWB cooling system and coming back through the clear pipe connected to the vacuum vessel&lt;br /&gt;
# Default settings are PID1 = 200, PID2 = 300, but may have been adjusted&lt;br /&gt;
# once the water level in the vacuum vessel has risen to ~20cm, turn on the water pump&lt;br /&gt;
&lt;br /&gt;
=== Drain system ===&lt;br /&gt;
# from normal operation, i.e. vacuum pump and water pump running&lt;br /&gt;
# switch main valve to upside down T position &lt;br /&gt;
[[File:PWBmainVent.jpg|thumb|Cooling system main valve to vent valve]]&lt;br /&gt;
# open vent valve&lt;br /&gt;
# air should now enter the system, draining all water from the TPC pipes into the vacuum vessel&lt;br /&gt;
# water pump will drain the vacuum vessel into supply tank, turn it off before the vessel is completely empty to avoid air in the water pump&lt;br /&gt;
# switch off main power&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
The water system is temperamental, and not intuitive at all. Common problems and solution attempts:&lt;br /&gt;
&lt;br /&gt;
; water pump very loud, doesn&#039;t appear to pump water&lt;br /&gt;
: most likely air in the water pump. Open the vent of the vacuum vessel to allow water to enter pump by gravity alone, pump should stop screaming and start pumping. Close vent.&lt;br /&gt;
; vacuum pump comes on often (more then every 10-20 min)&lt;br /&gt;
: probably an air leak in the system. Check for bubbles and try to find leak.&lt;br /&gt;
; water level/flow/vacuum oscillate between extreme values&lt;br /&gt;
: unclear, try playing with PID settings, throttle valve, possibly orange ball valves by the water pump.&lt;br /&gt;
&lt;br /&gt;
= Power distribution =&lt;br /&gt;
&lt;br /&gt;
This section covers the different voltages and power requirements for the operation of the rTPC. This includes:&lt;br /&gt;
&lt;br /&gt;
# High Voltage for the rTPC electron drift and amplification operation&lt;br /&gt;
# Low Voltage to the Anode wire frontend electronics&lt;br /&gt;
# Low Voltage to the Barrel Scintillator frontend electronics&lt;br /&gt;
# Low Voltage to the Cathode Pads electronics&lt;br /&gt;
# Grounding scheme of the overall rTPC&lt;br /&gt;
&lt;br /&gt;
The provision of power to the different components of the detector is distributed from the top end plate of the rTPC.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice12.png|507x354px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965261&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684500&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684892&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections&lt;br /&gt;
&lt;br /&gt;
== High Voltage for the rTPC ==&lt;br /&gt;
&lt;br /&gt;
Three main components of the rTPC require High Voltage&lt;br /&gt;
&lt;br /&gt;
* Main cathode wall (Negative ~5KV)&lt;br /&gt;
* Field wires (Negative ~ few hundred volts)&lt;br /&gt;
* Anode wires (Positive ~3.2KV )&lt;br /&gt;
&lt;br /&gt;
These voltages are provided by a Quad High Voltage unit from CAEN. Three independent cables will be fed to the top of the rTPC.&lt;br /&gt;
&lt;br /&gt;
High Voltage provision to the bottom endplate HV ring is taken from the central cathode near the bottom endplate.&lt;br /&gt;
&lt;br /&gt;
The Field wire voltage is connected to all the field wire crimp-pins through a dedicated socket chain inserted on each of the crimp-pin on the top and bottom endplates. The field wires themselves interconnect the high voltage between the top and bottom pins.&amp;lt;span id=&amp;quot;OLE_LINK20&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK21&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK22&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The High Voltage for the anode wires is delivered to the Anode Wire Card (AWC) which will distribute it to its 16 wires, Figure 11. There are 16 AWC cards covering each end of the anode wires. All the top and bottom 32 AWC are connected serially. The anode wires themselves interconnect the high voltage between the top and bottom pins.&lt;br /&gt;
&lt;br /&gt;
The anode wires pre-amplifiers boards (AWB) are sitting on the top of the Anode Wire Card (AWC) Figure 10. As the wire is powered by the HV, each anode wire has a high Voltage decoupling capacitor to isolate the pre-amp stage from the HV. This circuit resides on the AWC. The AWB will see the AC coupled anode signal only. With a new design of the AWC Figure 12, the decoupling capacitors are potted in epoxy to ensure proper isolation of the HV toward the surrounding circuit as well to prevent corona discharge due to relative humidity of the surrounding.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice13.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684196&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684501&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684893&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 10 – Unpotted Anode Wire Card and Board with HV distribution&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice14.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684198&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684502&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684894&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 11 - Anode wire pins and Field wire pins under yellow cover&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice15.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684370&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684503&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684895&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Anode wire frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
The AWB pre-amp board requires 2 voltages (+5V, -5V) which are fed through dedicated cable connections to each of the AWB. There are 16 AWB per end of the rTPC, therefore, 16 individual cable bundle will be reaching the top and another 16 the bottom of the rTPC. The cable bundle is to also provide the power return lines to the Power Supply.&lt;br /&gt;
&lt;br /&gt;
The PL508 Low Voltage power Supply from Wiener will provide the main power source for all the 32 pre-amplifiers. A dedicated connection breakout board with current monitoring capability splits the source power to the 2 x 16 necessary connections to the Anode wire boards. Based on a RaspeberryPi card, a 16 power distribution board is already implemented for the prototype. This board has extra 4 channels of temperature monitoring which can be used later on. In the same process we produce a similar board for 16 channel of NTC, RTC temperature monitoring. They will be used for overall detector and cooling system monitoring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;-5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Anode Pre-amp&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice16.jpg|239x363px]] [[File:imageservice17.png|239x363px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965262&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684504&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684896&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Barrel Scintillator frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
Similar to the Anode wire pre-amplifier voltage distribution scheme, the Barrel Scintillators will require several low voltages for power and control. The Barrel Scintillator Boards (BSB) are mounted on both ends of the Scintillator bar with the same segmentation as the Anode wires i.e.: 16 BSB per end. The design of the electronic chain for the barrel scintillator is not fully designed yet.&lt;br /&gt;
&lt;br /&gt;
The SiPM sensors require a bias voltage of the order of 28V. This voltage will be provided through the same mean as the low voltage power. Expected threshold voltage for the local signal level discriminator is also foreseen.&amp;lt;span id=&amp;quot;_Toc450564363&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Low Voltage to the Cathode Pads electronics ==&lt;br /&gt;
&lt;br /&gt;
The cathode pads electronics mounted on the external cylinder surface is composed of the analog frontend and the digital conversion electronics. Two voltages are required (+5.3V, +2.3V). The delivery is done through dedicated “power bar” running the full length of the rTPC. A set of 3 bars covers the 8 axial cathode pad electronics boards. 8 of them cover the circumference of the rTPC.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+2.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Padwing board&lt;br /&gt;
| 10W (1.8A)&lt;br /&gt;
| 2W (0.8A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Overall the low power supplies are provided by a PL508-3U with 8 modules of either single or dual channels from Wiener.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice18.png|469x360px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684505&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684897&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 14 - Overall Low voltage distribution for anode wires and cathode pads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564365&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grounding scheme of the overall rTPC ==&lt;br /&gt;
&lt;br /&gt;
The grounding scheme challenge in this setup is the far distance between the 2 end of the rTPC (2.3m) and the lack of accessibility to the bottom of the detector. The proposal is to use a Copper sheet mounted on the inner surface of the inner cylinder. This ground path will connect the 2 endplates to the High Voltage return. All the pre-amps will merge their ground to this central ground.&lt;br /&gt;
&lt;br /&gt;
Additional ground lugs have been included in the Anode wire pre-amplifier boards to strengthen the ground as each anode wire is readout out from both end. This may be used once the full detector is assembled to address possible ground loop issues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684506&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;[[File:imageservice19.png|439x409px]]&lt;br /&gt;
&lt;br /&gt;
= Safety and Hazard considerations =&lt;br /&gt;
&lt;br /&gt;
== Gas ==&lt;br /&gt;
&lt;br /&gt;
The Ar and CO2 do not require special health safety system. The detector will be operated in the ventilated hall of the AD building at CERN.&lt;br /&gt;
&lt;br /&gt;
Gas flow, detector gas pressure, and gas inlet temperature are constantly monitored and can trigger adequate response for shutdown or closure of the gas system for safety purpose.&lt;br /&gt;
&lt;br /&gt;
== Cooling water ==&lt;br /&gt;
&lt;br /&gt;
The water cooling system operates in negative pressure mode preventing any water leak to flood the detector outer surface. In addition water flow and inlet/outlet temperature are constantly monitored to allow fast response to off range parameter in order to shut down the electronics. The cooling water system requires a primary cooling tap water loop from the AD building. Water quality, water flow and water temperature are not under our responsibility. This aspect will be dealt during the initial phase of the rTPC commissioning at CERN.&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
All electronics voltages are below 48V. No special safety circuits are envisaged.&lt;br /&gt;
&lt;br /&gt;
The high-voltage circuit is fully protected outside the detector. The access to the high-voltage on the detector is restricted to the two end-plates. Interlock scheme will be put in place to ensure the shutdown of the HV in case of manual access to the detector itself.&lt;br /&gt;
&lt;br /&gt;
The LV (Low Voltage) power units are also interlocked to prevent false powering sequence which can damage the downstream electronics modules.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice20.png|571x411px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684507&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684899&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 16- Alpha-g rTPC rack organization&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=502</id>
		<title>Detector Services</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=502"/>
		<updated>2019-01-09T17:19:43Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Main Page]]&lt;br /&gt;
&lt;br /&gt;
= Table of Figures =&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684884|Figure 1 - Gas system schematic 6]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684885|Figure 2 - A half-rack space is used for the gas control implementation. 7]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684886|Figure 3 - Gas system half rack ready for installation 8]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684887|Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684888|Figure 5 - Water cooling system during test. 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684889|Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system. 12]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684890|Figure 7 - Overall water cooling system 13]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684891|Figure 8 - Temperature Monitor Board 14]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684892|Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections 15]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684893|Figure 10 – Unpotted Anode Wire Card and Board with HV distribution 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684894|Figure 11 - Anode wire pins and Field wire pins under yellow cover 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684895|Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire 18]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684896|Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards 19]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684897|Figure 14 - Overall Low voltage distribution for anode wires and cathode pads 21]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684898|Figure 15 - High Voltage &amp;amp;amp; Grounding scheme for the rTPC 22]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684899|Figure 16- Alpha-g rTPC rack organization 23]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684457&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This document is to describe the different services for the rTPC detector. 3 main sections cover the &#039;&#039;Gas system&#039;&#039;, the &#039;&#039;Water cooling system&#039;&#039; and the &#039;&#039;Power distribution&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= References and related Documents =&lt;br /&gt;
&lt;br /&gt;
A dedicated TRIUMF Wiki site gathers all documentations for the rTPC detector system and equipment. Gas system, cooling water system and power distribution can be found there.&lt;br /&gt;
&lt;br /&gt;
= Gas system =&lt;br /&gt;
&lt;br /&gt;
The gas system as described below includes the entire gas infrastructure required to deliver gas to the detector, monitor and control the gas flow into the detector. It also includes the necessary equipment to notify any change from the nominal gas flow or gas mixture ratio delivered to the detector.&lt;br /&gt;
&lt;br /&gt;
This type of mixed gas system is well understood by the Triumf detector group staff and no issue in its realization is expected.&lt;br /&gt;
&lt;br /&gt;
This system is a stand-alone infrastructure assembled and delivered to CERN. It will be placed in the Alpha-g experimental area floor. The delivery of the different gases to the experimental area is under the responsibility of the Gas handling group from CERN.&lt;br /&gt;
&lt;br /&gt;
The gas delivery system for the radial TPC (rTPC) is to provide Ar/CO2 gas mixture between 90/10 to 50/50 depending on the user requirements. This system does not recycle the gas as the environmental impact of either gas is minimal and the operation cost versus a recycling system would not be economic.&lt;br /&gt;
&lt;br /&gt;
In the event of an additional quenching gas requirement, the overall gas system will have to be reconsidered and possible recycling system envisaged.&lt;br /&gt;
&lt;br /&gt;
A simple gas mixer using digital flow meters will provide the precise mixture dialed by hand in the control system.&lt;br /&gt;
&lt;br /&gt;
During the prototype phase, an ad-hoc gas system will be put in place. A portable gas system is available for such a test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameter&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Value&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Gas mixture&lt;br /&gt;
| Ar/CO2 (90/10..50/50)&lt;br /&gt;
|-&lt;br /&gt;
| Gas flow requirements&lt;br /&gt;
| 0.3l/min (50%), 0.3l/min (50%)&lt;br /&gt;
|-&lt;br /&gt;
| Detector gas Volume&lt;br /&gt;
| 0.18m&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Flushing time&lt;br /&gt;
| 5h @ 600cc/min&lt;br /&gt;
|-&lt;br /&gt;
| Flow rate&lt;br /&gt;
| 100 to 300 cc/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
This gas system is quite simple as it takes 2 or 3 (spare) gas supplies and mixes them in a manifold before delivery to the rTPC detector. Necessary valves for purging lines and by-passing the detector are foreseen. The individual in-flows are controlled by gas dedicated mass flow controllers (MFC-x). The return flow is measured for leak assessment. An additional manometer monitors the internal detector pressure for evaluation of the electron drift characteristics.&lt;br /&gt;
&lt;br /&gt;
­­­­[[File:imageservice2.png|575x315px|PA_doc-1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684492&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684884&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 1 - Gas system schematic&lt;br /&gt;
&lt;br /&gt;
The main flow controller and monitoring is performed by industrial devices from MKS. We added analog flowmeters on each gas line to provide a quick visual inspection of the gas mixing system.&lt;br /&gt;
&lt;br /&gt;
This system will be hooked to the CERN AD-Gas facility. The CERN gas delivers gas through 2 switchable packs of 12 bottles for each gas.&lt;br /&gt;
&lt;br /&gt;
The gas exhaust is evacuated to the exterior of the experimental area with an elevation of about 8m.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice3.png|366x263px|PA_doc-2.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684493&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684885&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 2 - A half-rack space is used for the gas control implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450557826&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice4.png|324x364px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684494&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684886&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 3 - Gas system half rack ready for installation&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
From-scratch (Neither gas supply lines to the GHS nor connections to and from the TPC connected) connection of the GHS should follow the following procedure:&lt;br /&gt;
# &#039;&#039;&#039;Flush supply lines:&#039;&#039;&#039; Gas lines from outside bottles going to the GHS should be briefly (5 min or so) flushed with a high gas flow &#039;&#039;before&#039;&#039; connecting to the GHS to remove possible dust, and to minimize the amount of air in the lines.&lt;br /&gt;
# &#039;&#039;&#039;Flush GHS:&#039;&#039;&#039;&lt;br /&gt;
## Close BV1 and BV3, open BV2 and BV4 to flush input lines, only briefly.&lt;br /&gt;
## Open BV1 and BV3, close BV2 and BV4 (normal operation configuration)&lt;br /&gt;
[[File:20181205 103217.jpg|thumb|Normal configuration of the manual valves of the GHS.]]&lt;br /&gt;
## With Midas frontend running, use the &amp;quot;Gas&amp;quot; custom page to set a desired flow, for flushing probably between 1l/min and 1.5l/min (Without Midas, use the telnet interface), then press the &amp;quot;Bypass Flow&amp;quot; button, and let flow for a while (5-15min?)&lt;br /&gt;
# &#039;&#039;&#039;Flush TPC input line:&#039;&#039;&#039;&lt;br /&gt;
## Connect the line that will go from the GHS to the TPC input-tee on the GHS side, but leave disconnected from the tee&lt;br /&gt;
## do the same for the pressure gauge line&lt;br /&gt;
## On the &amp;quot;Gas&amp;quot; custom page, press the &amp;quot;Flow TPC&amp;quot; button and let flow for 5 min (Without Midas, use the telnet interface).&lt;br /&gt;
# Make all remaining connections&lt;br /&gt;
&lt;br /&gt;
== Telnet Interface ==&lt;br /&gt;
If the Midas frontend is not available the GHS can be controlled via telnet. Connect with&lt;br /&gt;
 telnet algas&lt;br /&gt;
then use the following command to control solenoid valves:&lt;br /&gt;
 cowr do i 1&lt;br /&gt;
to energize SVi, i.e. to switch it from its normal closed or open state to the other state,&lt;br /&gt;
 cowr do i 0&lt;br /&gt;
to de-energize, i.e. switch to default state.&lt;br /&gt;
&lt;br /&gt;
Gas flow is set with:&lt;br /&gt;
 mfcwr ao i &amp;lt;desired flow&amp;gt;&lt;br /&gt;
where i is 1 for Ar and 2 for CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, and the desired flow is in the internal units of the system.&lt;br /&gt;
&lt;br /&gt;
= Water cooling system =&lt;br /&gt;
&lt;br /&gt;
The outer surface of the detector has an arrangement of 8x8 electronics boards handling the readout of the cathode pads. These boards require operating at a controlled temperature to prevent heat build-up at the surface of the detector and improving the reliability of the system. In order to do so, 8 independent water pipe loops running from the bottom-up and down in the longitudinal axis of the detector are in a thermal contact to 8 successive readout boards. From the bottom, a pair of water hoses connect to 2 custom 3D-printed manifolds supplying the water feed and return to the 8 water loops.&lt;br /&gt;
&lt;br /&gt;
These 8 loops are run in parallel to a negative pressure water cooling system. This negative pressure system is to ensure that no water leak will damage the electronics even during possible pipe or delivery hose breakage.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice5.png|516x273px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960816&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684495&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684887&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice6.jpg|249x429px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960817&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684496&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684888&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 5 - Water cooling system during test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameters&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Values&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Number of parallel water loops&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| Copper pipe OD/ID&lt;br /&gt;
| ¼” / 4.7mm&lt;br /&gt;
|-&lt;br /&gt;
| Length of one loop (on the rTPC)&lt;br /&gt;
| 4.6m&lt;br /&gt;
|-&lt;br /&gt;
| Water speed per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Pressure drop per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Power extraction per water loop&lt;br /&gt;
| 8x15W= 120W&lt;br /&gt;
|-&lt;br /&gt;
| Total cooling power&lt;br /&gt;
| 1KW&lt;br /&gt;
|-&lt;br /&gt;
| Inlet water temperature&lt;br /&gt;
| 16..20 degC (to be confirmed)&lt;br /&gt;
|-&lt;br /&gt;
| Outlet water temperature&lt;br /&gt;
| 20..24 degC&lt;br /&gt;
|-&lt;br /&gt;
| Total water flow&lt;br /&gt;
| 3..6 l/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This description corresponds to how we think the system should work, but doesn&#039;t seem fully comatible with the behaviour of the system. E.g. the air pump only seems to turn on when PID1 falls below a certain value.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Pressure PID (proportional/integral/differential controller), PID2, monitors the air pressure in the vacuum vessel. When the pressure rises above a trigger value (perhaps 350mbar) it activates the aspirator vacuum pump to bring the pressure down to maintain a long time averaged pressure (say 300mbar).&lt;br /&gt;
&lt;br /&gt;
This vacuum is then used to draw water through the detector into the vessel, from the Open Tank. The vacuum vessel&#039;s water level is monitored by PID1, using a differential pressure transducer measuring the weight of the water column by the difference between the air pressure in the top of the vessel and the water pressure at the bottom of the vessel. PID1 provides a variable signal to the Proportional Solenoid Valve, which varies the flow through the return loop around the (fixed flow) water pump, and thus changing the overall flow of water from the vacuum vessel to keep the water level in the vessel constant despite water being constantly drawn in by the vacuum. The water pulled from the vacuum vessel is pushed through the filter and into the Open Tank, completing the circulation.&lt;br /&gt;
&lt;br /&gt;
Cooling is accomplished in the water pump leg of the system, as coolant pulled from the vacuum vessel passes through a heat exchanger coupled to CERN’s cooling water supply on its way to the pump. The rate that water flows through the system can be determined by many obstacles in the loop, but ideally it should be dominated by the position of the main Throttle Valve. Other valves should generally be set either fully open of fully closed, except for the Proportional Valve, whose position responds to the setting of the Throttle Valve.&lt;br /&gt;
&lt;br /&gt;
Data outputs: there are five data outputs planned. The two process variables, the vacuum vessel absolute pressure, and differential water column pressure, will be sent to the Detector DAQ system. As well, the total flow rate is monitored by the flow meter, whose output is sent to the DAQ system. This data is not used by the circulation system itself. Likewise, the back pressure on the water filter is only sent to the DAQ system to indicate if the filter may need changing, and the temperature of the open tank is monitored and sent to the DAQ system, but currently there is no plan to use it in a temperature control feedback. The temperature of CERN&#039;s cooling water supply is not yet known, but we expect we can set the heat exchanger to run at a rate to hold the system temperature near 20°C without feedback control.&lt;br /&gt;
&lt;br /&gt;
For the negative pressure to work effectively to prevent leaks, the water pressure in the detector ought to be down at least to half an atmosphere. With the detector cooling tubes 8x 4.6m of parallel 4.7mm ID copper tubes (2.3m down then 2.3 back-ups), and the supply using (perhaps 6m, 3 to the detector then 3 back) 9.7mm ID (=1/2&amp;amp;quot; OD) poly tubing, the flow will need to be somewhat greater than the required 3 l/min in order to maintain that degree of vacuum in the detector, unless the Throttle Valve is placed upstream of the detector near the Open Tank, or an additional constriction is added in that region.&lt;br /&gt;
&lt;br /&gt;
The water pump leg of the circuit residing in the water cooling/gas rack is placed far enough from the fringe field of the superconducting magnet to prevent disruptive effects on the solenoid valves and electric motors. Therefore the main 1/2&amp;amp;quot; poly line to and from the water pump and its flow loop will add a pressure drop which is estimated at 0.4atm for a 10m line at 6 l/min (9.7mmID), which is within our requirements. As mentioned earlier, the splitting (and reassembly) of the line to the 8 cooling lines close to detector will be accomplished with the use of 2 separate manifolds equipped with temperature sensors for constant in/out global water temperature monitoring.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice7.png|286x206px]][[File:imageservice8.jpg|286x206px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684497&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684889&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system.&lt;br /&gt;
&lt;br /&gt;
Currently, PVC valves with &amp;amp;quot;true union&amp;amp;quot; couplings are planned to be provided around the water pump to permit it to be swapped out from the system for servicing and a valved bypass to the water filter is provided for the same purpose to allow easily changing filter elements with the system running. True union valves are generally only available to 1/2NPT and larger, so an adapter fitting is required. The vacuum pump for the system is a small (2 x 5 x 7.5cm) cascaded dual Venturi aspirator, which is operated with site air, switched with two simultaneously operated normally closed solenoid valves, one for the site air, and one for the vessel vacuum input. If the system is leak free, the vacuum in the vessel should only be degraded by the dissolved air absorbed in the Open Tank and extracted in the vacuum vessel, which from past experience might mean running for under a minute every six hours or so.&lt;br /&gt;
&lt;br /&gt;
The wetted surfaces of this system will be mainly PVC and Polyethylene for the valves, tubing and vessels, plus brass fittings, and the copper cooling tubes, and the surfaces of the heat exchanger, which will most likely be stainless steel. It may be possible to devise an equivalent of a bellows communicating with the Open Tank, so that it is only virtually open, thus sealing the cooling water from contaminants, which may allow us to run with just distilled water plus a strip of silver as a biocide (although I&#039;m not sure if the mix of metals, copper plus stainless, may not interfere with the function of the silver, which is mostly used in computer cooling systems which are copper and plastic only). Otherwise, we will need a biocide and corrosion inhibitor. We have the latter, tolyltriazole, but the biocide is problematic. They tend to be short-lived; for systems which are open to atmosphere, typical industrial practice is chlorination, regularly refreshed, which builds up NaCl as it degrades, making the coolant corrosive. For T2K in Japan, we used the (human-nontoxic) &amp;amp;quot;Germall&amp;amp;quot;, which has a two-year lifetime, after which when its effectiveness decays it turns into food, which is the case for any solute that is not actively biocidal. Eventually, any such additives build up and require the coolant to be flushed and replaced. Silver is a lovely method, but only works for extended periods with a sealed system which remains deoxygenated. My research so far has not turned up a good candidate which does not entail recurring changes of the coolant.&lt;br /&gt;
&lt;br /&gt;
Power: the system needs to be able to run on European 220VAC power, but also operate here for testing purposes. The PIDs (Omega CN76160s) will accept both; for the rest of the system, I will have an a universal 90-240VAC input to 24VDC (5A) supply which will drive all the other components, including the pump, which will be a brushless 24VDC centrifugal pump, 1 - 1.5A range. The whole system will run about 125W.&lt;br /&gt;
&lt;br /&gt;
Information on the temperature and flow rate of the CERN cooling water system will be provided later but we don’t anticipate any major issues about the sizing of the heat exchanger.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice9.png|603x344px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960818&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684498&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684890&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 7 - Overall water cooling system&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564356&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Temperature Measurement ==&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice10.jpeg|225x356px]] [[File:imageservice11.png|194x358px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684499&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684891&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 8 Temperature Monitor Board&lt;br /&gt;
&lt;br /&gt;
The water temperature is read by the Temperature Monitor Board (TEMPB). Thermistors located inside the manifold connect to a 16 bit ADC on the TEMPB which is read out by a Raspberry Pi mounted on board. In a similar manner the air system temperature is read with sensors in the air manifold. The TEMPB can provide temperature readout of 32 thermistors which connect to terminal blocks. The channels can also be readout differentially providing up to 16 channels for thermocouples. An on board thermistor allows for cold junction compensation. The board is powered via USB on the Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
This assumes all water lines and compressed air are connected, and both the blue water tank and the chiller are filled.&lt;br /&gt;
&lt;br /&gt;
=== Begin running ===&lt;br /&gt;
# Close vent valve and main valve (3-way valve in T position)&lt;br /&gt;
# Switch on control box with power switch in the back&lt;br /&gt;
# confirm water pump is off, i.e. blue button is not illuminated&lt;br /&gt;
# Vacuum pump should now be running&lt;br /&gt;
# Open main valve, i.e. vertical connection open, connection to vent valve closed [[File:PWBmainOpen.jpg|thumb|Cooling system main valve open]]&lt;br /&gt;
# water should start flowing through the PWB cooling system and coming back through the clear pipe connected to the vacuum vessel&lt;br /&gt;
# Default settings are PID1 = 200, PID2 = 300, but may have been adjusted&lt;br /&gt;
# once the water level in the vacuum vessel has risen to ~20cm, turn on the water pump&lt;br /&gt;
&lt;br /&gt;
=== Drain system ===&lt;br /&gt;
# from normal operation, i.e. vacuum pump and water pump running&lt;br /&gt;
# switch main valve to upside down T position &lt;br /&gt;
[[File:PWBmainVent.jpg|thumb|Cooling system main valve to vent valve]]&lt;br /&gt;
# open vent valve&lt;br /&gt;
# air should now enter the system, draining all water from the TPC pipes into the vacuum vessel&lt;br /&gt;
# water pump will drain the vacuum vessel into supply tank, turn it off before the vessel is completely empty to avoid air in the water pump&lt;br /&gt;
# switch off main power&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
The water system is temperamental, and not intuitive at all. Common problems and solution attempts:&lt;br /&gt;
&lt;br /&gt;
; water pump very loud, doesn&#039;t appear to pump water&lt;br /&gt;
: most likely air in the water pump. Open the vent of the vacuum vessel to allow water to enter pump by gravity alone, pump should stop screaming and start pumping. Close vent.&lt;br /&gt;
; vacuum pump comes on often (more then every 10-20 min)&lt;br /&gt;
: probably an air leak in the system. Check for bubbles and try to find leak.&lt;br /&gt;
; water level/flow/vacuum oscillate between extreme values&lt;br /&gt;
: unclear, try playing with PID settings, throttle valve, possibly orange ball valves by the water pump.&lt;br /&gt;
&lt;br /&gt;
= Power distribution =&lt;br /&gt;
&lt;br /&gt;
This section covers the different voltages and power requirements for the operation of the rTPC. This includes:&lt;br /&gt;
&lt;br /&gt;
# High Voltage for the rTPC electron drift and amplification operation&lt;br /&gt;
# Low Voltage to the Anode wire frontend electronics&lt;br /&gt;
# Low Voltage to the Barrel Scintillator frontend electronics&lt;br /&gt;
# Low Voltage to the Cathode Pads electronics&lt;br /&gt;
# Grounding scheme of the overall rTPC&lt;br /&gt;
&lt;br /&gt;
The provision of power to the different components of the detector is distributed from the top end plate of the rTPC.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice12.png|507x354px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965261&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684500&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684892&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections&lt;br /&gt;
&lt;br /&gt;
== High Voltage for the rTPC ==&lt;br /&gt;
&lt;br /&gt;
Three main components of the rTPC require High Voltage&lt;br /&gt;
&lt;br /&gt;
* Main cathode wall (Negative ~5KV)&lt;br /&gt;
* Field wires (Negative ~ few hundred volts)&lt;br /&gt;
* Anode wires (Positive ~3.2KV )&lt;br /&gt;
&lt;br /&gt;
These voltages are provided by a Quad High Voltage unit from CAEN. Three independent cables will be fed to the top of the rTPC.&lt;br /&gt;
&lt;br /&gt;
High Voltage provision to the bottom endplate HV ring is taken from the central cathode near the bottom endplate.&lt;br /&gt;
&lt;br /&gt;
The Field wire voltage is connected to all the field wire crimp-pins through a dedicated socket chain inserted on each of the crimp-pin on the top and bottom endplates. The field wires themselves interconnect the high voltage between the top and bottom pins.&amp;lt;span id=&amp;quot;OLE_LINK20&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK21&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK22&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The High Voltage for the anode wires is delivered to the Anode Wire Card (AWC) which will distribute it to its 16 wires, Figure 11. There are 16 AWC cards covering each end of the anode wires. All the top and bottom 32 AWC are connected serially. The anode wires themselves interconnect the high voltage between the top and bottom pins.&lt;br /&gt;
&lt;br /&gt;
The anode wires pre-amplifiers boards (AWB) are sitting on the top of the Anode Wire Card (AWC) Figure 10. As the wire is powered by the HV, each anode wire has a high Voltage decoupling capacitor to isolate the pre-amp stage from the HV. This circuit resides on the AWC. The AWB will see the AC coupled anode signal only. With a new design of the AWC Figure 12, the decoupling capacitors are potted in epoxy to ensure proper isolation of the HV toward the surrounding circuit as well to prevent corona discharge due to relative humidity of the surrounding.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice13.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684196&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684501&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684893&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 10 – Unpotted Anode Wire Card and Board with HV distribution&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice14.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684198&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684502&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684894&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 11 - Anode wire pins and Field wire pins under yellow cover&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice15.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684370&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684503&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684895&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Anode wire frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
The AWB pre-amp board requires 2 voltages (+5V, -5V) which are fed through dedicated cable connections to each of the AWB. There are 16 AWB per end of the rTPC, therefore, 16 individual cable bundle will be reaching the top and another 16 the bottom of the rTPC. The cable bundle is to also provide the power return lines to the Power Supply.&lt;br /&gt;
&lt;br /&gt;
The PL508 Low Voltage power Supply from Wiener will provide the main power source for all the 32 pre-amplifiers. A dedicated connection breakout board with current monitoring capability splits the source power to the 2 x 16 necessary connections to the Anode wire boards. Based on a RaspeberryPi card, a 16 power distribution board is already implemented for the prototype. This board has extra 4 channels of temperature monitoring which can be used later on. In the same process we produce a similar board for 16 channel of NTC, RTC temperature monitoring. They will be used for overall detector and cooling system monitoring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;-5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Anode Pre-amp&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice16.jpg|239x363px]] [[File:imageservice17.png|239x363px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965262&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684504&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684896&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Barrel Scintillator frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
Similar to the Anode wire pre-amplifier voltage distribution scheme, the Barrel Scintillators will require several low voltages for power and control. The Barrel Scintillator Boards (BSB) are mounted on both ends of the Scintillator bar with the same segmentation as the Anode wires i.e.: 16 BSB per end. The design of the electronic chain for the barrel scintillator is not fully designed yet.&lt;br /&gt;
&lt;br /&gt;
The SiPM sensors require a bias voltage of the order of 28V. This voltage will be provided through the same mean as the low voltage power. Expected threshold voltage for the local signal level discriminator is also foreseen.&amp;lt;span id=&amp;quot;_Toc450564363&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Low Voltage to the Cathode Pads electronics ==&lt;br /&gt;
&lt;br /&gt;
The cathode pads electronics mounted on the external cylinder surface is composed of the analog frontend and the digital conversion electronics. Two voltages are required (+5.3V, +2.3V). The delivery is done through dedicated “power bar” running the full length of the rTPC. A set of 3 bars covers the 8 axial cathode pad electronics boards. 8 of them cover the circumference of the rTPC.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+2.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Padwing board&lt;br /&gt;
| 10W (1.8A)&lt;br /&gt;
| 2W (0.8A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Overall the low power supplies are provided by a PL508-3U with 8 modules of either single or dual channels from Wiener.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice18.png|469x360px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684505&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684897&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 14 - Overall Low voltage distribution for anode wires and cathode pads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564365&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grounding scheme of the overall rTPC ==&lt;br /&gt;
&lt;br /&gt;
The grounding scheme challenge in this setup is the far distance between the 2 end of the rTPC (2.3m) and the lack of accessibility to the bottom of the detector. The proposal is to use a Copper sheet mounted on the inner surface of the inner cylinder. This ground path will connect the 2 endplates to the High Voltage return. All the pre-amps will merge their ground to this central ground.&lt;br /&gt;
&lt;br /&gt;
Additional ground lugs have been included in the Anode wire pre-amplifier boards to strengthen the ground as each anode wire is readout out from both end. This may be used once the full detector is assembled to address possible ground loop issues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684506&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;[[File:imageservice19.png|439x409px]]&lt;br /&gt;
&lt;br /&gt;
= Safety and Hazard considerations =&lt;br /&gt;
&lt;br /&gt;
== Gas ==&lt;br /&gt;
&lt;br /&gt;
The Ar and CO2 do not require special health safety system. The detector will be operated in the ventilated hall of the AD building at CERN.&lt;br /&gt;
&lt;br /&gt;
Gas flow, detector gas pressure, and gas inlet temperature are constantly monitored and can trigger adequate response for shutdown or closure of the gas system for safety purpose.&lt;br /&gt;
&lt;br /&gt;
== Cooling water ==&lt;br /&gt;
&lt;br /&gt;
The water cooling system operates in negative pressure mode preventing any water leak to flood the detector outer surface. In addition water flow and inlet/outlet temperature are constantly monitored to allow fast response to off range parameter in order to shut down the electronics. The cooling water system requires a primary cooling tap water loop from the AD building. Water quality, water flow and water temperature are not under our responsibility. This aspect will be dealt during the initial phase of the rTPC commissioning at CERN.&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
All electronics voltages are below 48V. No special safety circuits are envisaged.&lt;br /&gt;
&lt;br /&gt;
The high-voltage circuit is fully protected outside the detector. The access to the high-voltage on the detector is restricted to the two end-plates. Interlock scheme will be put in place to ensure the shutdown of the HV in case of manual access to the detector itself.&lt;br /&gt;
&lt;br /&gt;
The LV (Low Voltage) power units are also interlocked to prevent false powering sequence which can damage the downstream electronics modules.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice20.png|571x411px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684507&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684899&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 16- Alpha-g rTPC rack organization&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:20181205_103217.jpg&amp;diff=501</id>
		<title>File:20181205 103217.jpg</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:20181205_103217.jpg&amp;diff=501"/>
		<updated>2019-01-09T17:18:37Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Normal configuration of the manual valves of the GHS.&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=500</id>
		<title>Detector Services</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=500"/>
		<updated>2018-12-07T13:20:02Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Main Page]]&lt;br /&gt;
&lt;br /&gt;
= Table of Figures =&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684884|Figure 1 - Gas system schematic 6]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684885|Figure 2 - A half-rack space is used for the gas control implementation. 7]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684886|Figure 3 - Gas system half rack ready for installation 8]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684887|Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684888|Figure 5 - Water cooling system during test. 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684889|Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system. 12]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684890|Figure 7 - Overall water cooling system 13]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684891|Figure 8 - Temperature Monitor Board 14]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684892|Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections 15]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684893|Figure 10 – Unpotted Anode Wire Card and Board with HV distribution 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684894|Figure 11 - Anode wire pins and Field wire pins under yellow cover 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684895|Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire 18]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684896|Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards 19]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684897|Figure 14 - Overall Low voltage distribution for anode wires and cathode pads 21]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684898|Figure 15 - High Voltage &amp;amp;amp; Grounding scheme for the rTPC 22]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684899|Figure 16- Alpha-g rTPC rack organization 23]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684457&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This document is to describe the different services for the rTPC detector. 3 main sections cover the &#039;&#039;Gas system&#039;&#039;, the &#039;&#039;Water cooling system&#039;&#039; and the &#039;&#039;Power distribution&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= References and related Documents =&lt;br /&gt;
&lt;br /&gt;
A dedicated TRIUMF Wiki site gathers all documentations for the rTPC detector system and equipment. Gas system, cooling water system and power distribution can be found there.&lt;br /&gt;
&lt;br /&gt;
= Gas system =&lt;br /&gt;
&lt;br /&gt;
The gas system as described below includes the entire gas infrastructure required to deliver gas to the detector, monitor and control the gas flow into the detector. It also includes the necessary equipment to notify any change from the nominal gas flow or gas mixture ratio delivered to the detector.&lt;br /&gt;
&lt;br /&gt;
This type of mixed gas system is well understood by the Triumf detector group staff and no issue in its realization is expected.&lt;br /&gt;
&lt;br /&gt;
This system is a stand-alone infrastructure assembled and delivered to CERN. It will be placed in the Alpha-g experimental area floor. The delivery of the different gases to the experimental area is under the responsibility of the Gas handling group from CERN.&lt;br /&gt;
&lt;br /&gt;
The gas delivery system for the radial TPC (rTPC) is to provide Ar/CO2 gas mixture between 90/10 to 50/50 depending on the user requirements. This system does not recycle the gas as the environmental impact of either gas is minimal and the operation cost versus a recycling system would not be economic.&lt;br /&gt;
&lt;br /&gt;
In the event of an additional quenching gas requirement, the overall gas system will have to be reconsidered and possible recycling system envisaged.&lt;br /&gt;
&lt;br /&gt;
A simple gas mixer using digital flow meters will provide the precise mixture dialed by hand in the control system.&lt;br /&gt;
&lt;br /&gt;
During the prototype phase, an ad-hoc gas system will be put in place. A portable gas system is available for such a test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameter&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Value&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Gas mixture&lt;br /&gt;
| Ar/CO2 (90/10..50/50)&lt;br /&gt;
|-&lt;br /&gt;
| Gas flow requirements&lt;br /&gt;
| 0.3l/min (50%), 0.3l/min (50%)&lt;br /&gt;
|-&lt;br /&gt;
| Detector gas Volume&lt;br /&gt;
| 0.18m&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Flushing time&lt;br /&gt;
| 5h @ 600cc/min&lt;br /&gt;
|-&lt;br /&gt;
| Flow rate&lt;br /&gt;
| 100 to 300 cc/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
This gas system is quite simple as it takes 2 or 3 (spare) gas supplies and mixes them in a manifold before delivery to the rTPC detector. Necessary valves for purging lines and by-passing the detector are foreseen. The individual in-flows are controlled by gas dedicated mass flow controllers (MFC-x). The return flow is measured for leak assessment. An additional manometer monitors the internal detector pressure for evaluation of the electron drift characteristics.&lt;br /&gt;
&lt;br /&gt;
­­­­[[File:imageservice2.png|575x315px|PA_doc-1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684492&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684884&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 1 - Gas system schematic&lt;br /&gt;
&lt;br /&gt;
The main flow controller and monitoring is performed by industrial devices from MKS. We added analog flowmeters on each gas line to provide a quick visual inspection of the gas mixing system.&lt;br /&gt;
&lt;br /&gt;
This system will be hooked to the CERN AD-Gas facility. The CERN gas delivers gas through 2 switchable packs of 12 bottles for each gas.&lt;br /&gt;
&lt;br /&gt;
The gas exhaust is evacuated to the exterior of the experimental area with an elevation of about 8m.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice3.png|366x263px|PA_doc-2.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684493&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684885&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 2 - A half-rack space is used for the gas control implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450557826&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice4.png|324x364px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684494&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684886&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 3 - Gas system half rack ready for installation&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
From-scratch (Neither gas supply lines to the GHS nor connections to and from the TPC connected) connection of the GHS should follow the following procedure:&lt;br /&gt;
# &#039;&#039;&#039;Flush supply lines:&#039;&#039;&#039; Gas lines from outside bottles going to the GHS should be briefly (5 min or so) flushed with a high gas flow &#039;&#039;before&#039;&#039; connecting to the GHS to remove possible dust, and to minimize the amount of air in the lines.&lt;br /&gt;
# &#039;&#039;&#039;Flush GHS:&#039;&#039;&#039;&lt;br /&gt;
## Close BV3 and BV5, open BV2 and BV4 to flush input lines, only briefly.&lt;br /&gt;
## Open BV3 and BV5, close BV2 and BV4 (normal operation configuration)&lt;br /&gt;
## With Midas frontend running, use the &amp;quot;Gas&amp;quot; custom page to set a desired flow, for flushing probably between 1l/min and 1.5l/min (Without Midas, use the telnet interface), then press the &amp;quot;Bypass Flow&amp;quot; button, and let flow for a while (5-15min?)&lt;br /&gt;
# &#039;&#039;&#039;Flush TPC input line:&#039;&#039;&#039;&lt;br /&gt;
## Connect the line that will go from the GHS to the TPC input-tee on the GHS side, but leave disconnected from the tee&lt;br /&gt;
## do the same for the pressure gauge line&lt;br /&gt;
## On the &amp;quot;Gas&amp;quot; custom page, press the &amp;quot;Flow TPC&amp;quot; button and let flow for 5 min (Without Midas, use the telnet interface).&lt;br /&gt;
# Make all remaining connections&lt;br /&gt;
&lt;br /&gt;
== Telnet Interface ==&lt;br /&gt;
If the Midas frontend is not available the GHS can be controlled via telnet. Connect with&lt;br /&gt;
 telnet algas&lt;br /&gt;
then use the following command to control solenoid valves:&lt;br /&gt;
 cowr do i 1&lt;br /&gt;
to energize SVi, i.e. to switch it from its normal closed or open state to the other state,&lt;br /&gt;
 cowr do i 0&lt;br /&gt;
to de-energize, i.e. switch to default state.&lt;br /&gt;
&lt;br /&gt;
Gas flow is set with:&lt;br /&gt;
 mfcwr ao i &amp;lt;desired flow&amp;gt;&lt;br /&gt;
where i is 1 for Ar and 2 for CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, and the desired flow is in the internal units of the system.&lt;br /&gt;
&lt;br /&gt;
= Water cooling system =&lt;br /&gt;
&lt;br /&gt;
The outer surface of the detector has an arrangement of 8x8 electronics boards handling the readout of the cathode pads. These boards require operating at a controlled temperature to prevent heat build-up at the surface of the detector and improving the reliability of the system. In order to do so, 8 independent water pipe loops running from the bottom-up and down in the longitudinal axis of the detector are in a thermal contact to 8 successive readout boards. From the bottom, a pair of water hoses connect to 2 custom 3D-printed manifolds supplying the water feed and return to the 8 water loops.&lt;br /&gt;
&lt;br /&gt;
These 8 loops are run in parallel to a negative pressure water cooling system. This negative pressure system is to ensure that no water leak will damage the electronics even during possible pipe or delivery hose breakage.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice5.png|516x273px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960816&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684495&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684887&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice6.jpg|249x429px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960817&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684496&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684888&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 5 - Water cooling system during test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameters&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Values&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Number of parallel water loops&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| Copper pipe OD/ID&lt;br /&gt;
| ¼” / 4.7mm&lt;br /&gt;
|-&lt;br /&gt;
| Length of one loop (on the rTPC)&lt;br /&gt;
| 4.6m&lt;br /&gt;
|-&lt;br /&gt;
| Water speed per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Pressure drop per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Power extraction per water loop&lt;br /&gt;
| 8x15W= 120W&lt;br /&gt;
|-&lt;br /&gt;
| Total cooling power&lt;br /&gt;
| 1KW&lt;br /&gt;
|-&lt;br /&gt;
| Inlet water temperature&lt;br /&gt;
| 16..20 degC (to be confirmed)&lt;br /&gt;
|-&lt;br /&gt;
| Outlet water temperature&lt;br /&gt;
| 20..24 degC&lt;br /&gt;
|-&lt;br /&gt;
| Total water flow&lt;br /&gt;
| 3..6 l/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This description corresponds to how we think the system should work, but doesn&#039;t seem fully comatible with the behaviour of the system. E.g. the air pump only seems to turn on when PID1 falls below a certain value.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Pressure PID (proportional/integral/differential controller), PID2, monitors the air pressure in the vacuum vessel. When the pressure rises above a trigger value (perhaps 350mbar) it activates the aspirator vacuum pump to bring the pressure down to maintain a long time averaged pressure (say 300mbar).&lt;br /&gt;
&lt;br /&gt;
This vacuum is then used to draw water through the detector into the vessel, from the Open Tank. The vacuum vessel&#039;s water level is monitored by PID1, using a differential pressure transducer measuring the weight of the water column by the difference between the air pressure in the top of the vessel and the water pressure at the bottom of the vessel. PID1 provides a variable signal to the Proportional Solenoid Valve, which varies the flow through the return loop around the (fixed flow) water pump, and thus changing the overall flow of water from the vacuum vessel to keep the water level in the vessel constant despite water being constantly drawn in by the vacuum. The water pulled from the vacuum vessel is pushed through the filter and into the Open Tank, completing the circulation.&lt;br /&gt;
&lt;br /&gt;
Cooling is accomplished in the water pump leg of the system, as coolant pulled from the vacuum vessel passes through a heat exchanger coupled to CERN’s cooling water supply on its way to the pump. The rate that water flows through the system can be determined by many obstacles in the loop, but ideally it should be dominated by the position of the main Throttle Valve. Other valves should generally be set either fully open of fully closed, except for the Proportional Valve, whose position responds to the setting of the Throttle Valve.&lt;br /&gt;
&lt;br /&gt;
Data outputs: there are five data outputs planned. The two process variables, the vacuum vessel absolute pressure, and differential water column pressure, will be sent to the Detector DAQ system. As well, the total flow rate is monitored by the flow meter, whose output is sent to the DAQ system. This data is not used by the circulation system itself. Likewise, the back pressure on the water filter is only sent to the DAQ system to indicate if the filter may need changing, and the temperature of the open tank is monitored and sent to the DAQ system, but currently there is no plan to use it in a temperature control feedback. The temperature of CERN&#039;s cooling water supply is not yet known, but we expect we can set the heat exchanger to run at a rate to hold the system temperature near 20°C without feedback control.&lt;br /&gt;
&lt;br /&gt;
For the negative pressure to work effectively to prevent leaks, the water pressure in the detector ought to be down at least to half an atmosphere. With the detector cooling tubes 8x 4.6m of parallel 4.7mm ID copper tubes (2.3m down then 2.3 back-ups), and the supply using (perhaps 6m, 3 to the detector then 3 back) 9.7mm ID (=1/2&amp;amp;quot; OD) poly tubing, the flow will need to be somewhat greater than the required 3 l/min in order to maintain that degree of vacuum in the detector, unless the Throttle Valve is placed upstream of the detector near the Open Tank, or an additional constriction is added in that region.&lt;br /&gt;
&lt;br /&gt;
The water pump leg of the circuit residing in the water cooling/gas rack is placed far enough from the fringe field of the superconducting magnet to prevent disruptive effects on the solenoid valves and electric motors. Therefore the main 1/2&amp;amp;quot; poly line to and from the water pump and its flow loop will add a pressure drop which is estimated at 0.4atm for a 10m line at 6 l/min (9.7mmID), which is within our requirements. As mentioned earlier, the splitting (and reassembly) of the line to the 8 cooling lines close to detector will be accomplished with the use of 2 separate manifolds equipped with temperature sensors for constant in/out global water temperature monitoring.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice7.png|286x206px]][[File:imageservice8.jpg|286x206px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684497&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684889&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system.&lt;br /&gt;
&lt;br /&gt;
Currently, PVC valves with &amp;amp;quot;true union&amp;amp;quot; couplings are planned to be provided around the water pump to permit it to be swapped out from the system for servicing and a valved bypass to the water filter is provided for the same purpose to allow easily changing filter elements with the system running. True union valves are generally only available to 1/2NPT and larger, so an adapter fitting is required. The vacuum pump for the system is a small (2 x 5 x 7.5cm) cascaded dual Venturi aspirator, which is operated with site air, switched with two simultaneously operated normally closed solenoid valves, one for the site air, and one for the vessel vacuum input. If the system is leak free, the vacuum in the vessel should only be degraded by the dissolved air absorbed in the Open Tank and extracted in the vacuum vessel, which from past experience might mean running for under a minute every six hours or so.&lt;br /&gt;
&lt;br /&gt;
The wetted surfaces of this system will be mainly PVC and Polyethylene for the valves, tubing and vessels, plus brass fittings, and the copper cooling tubes, and the surfaces of the heat exchanger, which will most likely be stainless steel. It may be possible to devise an equivalent of a bellows communicating with the Open Tank, so that it is only virtually open, thus sealing the cooling water from contaminants, which may allow us to run with just distilled water plus a strip of silver as a biocide (although I&#039;m not sure if the mix of metals, copper plus stainless, may not interfere with the function of the silver, which is mostly used in computer cooling systems which are copper and plastic only). Otherwise, we will need a biocide and corrosion inhibitor. We have the latter, tolyltriazole, but the biocide is problematic. They tend to be short-lived; for systems which are open to atmosphere, typical industrial practice is chlorination, regularly refreshed, which builds up NaCl as it degrades, making the coolant corrosive. For T2K in Japan, we used the (human-nontoxic) &amp;amp;quot;Germall&amp;amp;quot;, which has a two-year lifetime, after which when its effectiveness decays it turns into food, which is the case for any solute that is not actively biocidal. Eventually, any such additives build up and require the coolant to be flushed and replaced. Silver is a lovely method, but only works for extended periods with a sealed system which remains deoxygenated. My research so far has not turned up a good candidate which does not entail recurring changes of the coolant.&lt;br /&gt;
&lt;br /&gt;
Power: the system needs to be able to run on European 220VAC power, but also operate here for testing purposes. The PIDs (Omega CN76160s) will accept both; for the rest of the system, I will have an a universal 90-240VAC input to 24VDC (5A) supply which will drive all the other components, including the pump, which will be a brushless 24VDC centrifugal pump, 1 - 1.5A range. The whole system will run about 125W.&lt;br /&gt;
&lt;br /&gt;
Information on the temperature and flow rate of the CERN cooling water system will be provided later but we don’t anticipate any major issues about the sizing of the heat exchanger.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice9.png|603x344px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960818&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684498&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684890&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 7 - Overall water cooling system&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564356&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Temperature Measurement ==&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice10.jpeg|225x356px]] [[File:imageservice11.png|194x358px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684499&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684891&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 8 Temperature Monitor Board&lt;br /&gt;
&lt;br /&gt;
The water temperature is read by the Temperature Monitor Board (TEMPB). Thermistors located inside the manifold connect to a 16 bit ADC on the TEMPB which is read out by a Raspberry Pi mounted on board. In a similar manner the air system temperature is read with sensors in the air manifold. The TEMPB can provide temperature readout of 32 thermistors which connect to terminal blocks. The channels can also be readout differentially providing up to 16 channels for thermocouples. An on board thermistor allows for cold junction compensation. The board is powered via USB on the Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
This assumes all water lines and compressed air are connected, and both the blue water tank and the chiller are filled.&lt;br /&gt;
&lt;br /&gt;
=== Begin running ===&lt;br /&gt;
# Close vent valve and main valve (3-way valve in T position)&lt;br /&gt;
# Switch on control box with power switch in the back&lt;br /&gt;
# confirm water pump is off, i.e. blue button is not illuminated&lt;br /&gt;
# Vacuum pump should now be running&lt;br /&gt;
# Open main valve, i.e. vertical connection open, connection to vent valve closed [[File:PWBmainOpen.jpg|thumb|Cooling system main valve open]]&lt;br /&gt;
# water should start flowing through the PWB cooling system and coming back through the clear pipe connected to the vacuum vessel&lt;br /&gt;
# Default settings are PID1 = 200, PID2 = 300, but may have been adjusted&lt;br /&gt;
# once the water level in the vacuum vessel has risen to ~20cm, turn on the water pump&lt;br /&gt;
&lt;br /&gt;
=== Drain system ===&lt;br /&gt;
# from normal operation, i.e. vacuum pump and water pump running&lt;br /&gt;
# switch main valve to upside down T position &lt;br /&gt;
[[File:PWBmainVent.jpg|thumb|Cooling system main valve to vent valve]]&lt;br /&gt;
# open vent valve&lt;br /&gt;
# air should now enter the system, draining all water from the TPC pipes into the vacuum vessel&lt;br /&gt;
# water pump will drain the vacuum vessel into supply tank, turn it off before the vessel is completely empty to avoid air in the water pump&lt;br /&gt;
# switch off main power&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
The water system is temperamental, and not intuitive at all. Common problems and solution attempts:&lt;br /&gt;
&lt;br /&gt;
; water pump very loud, doesn&#039;t appear to pump water&lt;br /&gt;
: most likely air in the water pump. Open the vent of the vacuum vessel to allow water to enter pump by gravity alone, pump should stop screaming and start pumping. Close vent.&lt;br /&gt;
; vacuum pump comes on often (more then every 10-20 min)&lt;br /&gt;
: probably an air leak in the system. Check for bubbles and try to find leak.&lt;br /&gt;
; water level/flow/vacuum oscillate between extreme values&lt;br /&gt;
: unclear, try playing with PID settings, throttle valve, possibly orange ball valves by the water pump.&lt;br /&gt;
&lt;br /&gt;
= Power distribution =&lt;br /&gt;
&lt;br /&gt;
This section covers the different voltages and power requirements for the operation of the rTPC. This includes:&lt;br /&gt;
&lt;br /&gt;
# High Voltage for the rTPC electron drift and amplification operation&lt;br /&gt;
# Low Voltage to the Anode wire frontend electronics&lt;br /&gt;
# Low Voltage to the Barrel Scintillator frontend electronics&lt;br /&gt;
# Low Voltage to the Cathode Pads electronics&lt;br /&gt;
# Grounding scheme of the overall rTPC&lt;br /&gt;
&lt;br /&gt;
The provision of power to the different components of the detector is distributed from the top end plate of the rTPC.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice12.png|507x354px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965261&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684500&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684892&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections&lt;br /&gt;
&lt;br /&gt;
== High Voltage for the rTPC ==&lt;br /&gt;
&lt;br /&gt;
Three main components of the rTPC require High Voltage&lt;br /&gt;
&lt;br /&gt;
* Main cathode wall (Negative ~5KV)&lt;br /&gt;
* Field wires (Negative ~ few hundred volts)&lt;br /&gt;
* Anode wires (Positive ~3.2KV )&lt;br /&gt;
&lt;br /&gt;
These voltages are provided by a Quad High Voltage unit from CAEN. Three independent cables will be fed to the top of the rTPC.&lt;br /&gt;
&lt;br /&gt;
High Voltage provision to the bottom endplate HV ring is taken from the central cathode near the bottom endplate.&lt;br /&gt;
&lt;br /&gt;
The Field wire voltage is connected to all the field wire crimp-pins through a dedicated socket chain inserted on each of the crimp-pin on the top and bottom endplates. The field wires themselves interconnect the high voltage between the top and bottom pins.&amp;lt;span id=&amp;quot;OLE_LINK20&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK21&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK22&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The High Voltage for the anode wires is delivered to the Anode Wire Card (AWC) which will distribute it to its 16 wires, Figure 11. There are 16 AWC cards covering each end of the anode wires. All the top and bottom 32 AWC are connected serially. The anode wires themselves interconnect the high voltage between the top and bottom pins.&lt;br /&gt;
&lt;br /&gt;
The anode wires pre-amplifiers boards (AWB) are sitting on the top of the Anode Wire Card (AWC) Figure 10. As the wire is powered by the HV, each anode wire has a high Voltage decoupling capacitor to isolate the pre-amp stage from the HV. This circuit resides on the AWC. The AWB will see the AC coupled anode signal only. With a new design of the AWC Figure 12, the decoupling capacitors are potted in epoxy to ensure proper isolation of the HV toward the surrounding circuit as well to prevent corona discharge due to relative humidity of the surrounding.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice13.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684196&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684501&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684893&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 10 – Unpotted Anode Wire Card and Board with HV distribution&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice14.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684198&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684502&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684894&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 11 - Anode wire pins and Field wire pins under yellow cover&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice15.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684370&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684503&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684895&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Anode wire frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
The AWB pre-amp board requires 2 voltages (+5V, -5V) which are fed through dedicated cable connections to each of the AWB. There are 16 AWB per end of the rTPC, therefore, 16 individual cable bundle will be reaching the top and another 16 the bottom of the rTPC. The cable bundle is to also provide the power return lines to the Power Supply.&lt;br /&gt;
&lt;br /&gt;
The PL508 Low Voltage power Supply from Wiener will provide the main power source for all the 32 pre-amplifiers. A dedicated connection breakout board with current monitoring capability splits the source power to the 2 x 16 necessary connections to the Anode wire boards. Based on a RaspeberryPi card, a 16 power distribution board is already implemented for the prototype. This board has extra 4 channels of temperature monitoring which can be used later on. In the same process we produce a similar board for 16 channel of NTC, RTC temperature monitoring. They will be used for overall detector and cooling system monitoring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;-5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Anode Pre-amp&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice16.jpg|239x363px]] [[File:imageservice17.png|239x363px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965262&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684504&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684896&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Barrel Scintillator frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
Similar to the Anode wire pre-amplifier voltage distribution scheme, the Barrel Scintillators will require several low voltages for power and control. The Barrel Scintillator Boards (BSB) are mounted on both ends of the Scintillator bar with the same segmentation as the Anode wires i.e.: 16 BSB per end. The design of the electronic chain for the barrel scintillator is not fully designed yet.&lt;br /&gt;
&lt;br /&gt;
The SiPM sensors require a bias voltage of the order of 28V. This voltage will be provided through the same mean as the low voltage power. Expected threshold voltage for the local signal level discriminator is also foreseen.&amp;lt;span id=&amp;quot;_Toc450564363&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Low Voltage to the Cathode Pads electronics ==&lt;br /&gt;
&lt;br /&gt;
The cathode pads electronics mounted on the external cylinder surface is composed of the analog frontend and the digital conversion electronics. Two voltages are required (+5.3V, +2.3V). The delivery is done through dedicated “power bar” running the full length of the rTPC. A set of 3 bars covers the 8 axial cathode pad electronics boards. 8 of them cover the circumference of the rTPC.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+2.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Padwing board&lt;br /&gt;
| 10W (1.8A)&lt;br /&gt;
| 2W (0.8A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Overall the low power supplies are provided by a PL508-3U with 8 modules of either single or dual channels from Wiener.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice18.png|469x360px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684505&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684897&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 14 - Overall Low voltage distribution for anode wires and cathode pads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564365&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grounding scheme of the overall rTPC ==&lt;br /&gt;
&lt;br /&gt;
The grounding scheme challenge in this setup is the far distance between the 2 end of the rTPC (2.3m) and the lack of accessibility to the bottom of the detector. The proposal is to use a Copper sheet mounted on the inner surface of the inner cylinder. This ground path will connect the 2 endplates to the High Voltage return. All the pre-amps will merge their ground to this central ground.&lt;br /&gt;
&lt;br /&gt;
Additional ground lugs have been included in the Anode wire pre-amplifier boards to strengthen the ground as each anode wire is readout out from both end. This may be used once the full detector is assembled to address possible ground loop issues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684506&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;[[File:imageservice19.png|439x409px]]&lt;br /&gt;
&lt;br /&gt;
= Safety and Hazard considerations =&lt;br /&gt;
&lt;br /&gt;
== Gas ==&lt;br /&gt;
&lt;br /&gt;
The Ar and CO2 do not require special health safety system. The detector will be operated in the ventilated hall of the AD building at CERN.&lt;br /&gt;
&lt;br /&gt;
Gas flow, detector gas pressure, and gas inlet temperature are constantly monitored and can trigger adequate response for shutdown or closure of the gas system for safety purpose.&lt;br /&gt;
&lt;br /&gt;
== Cooling water ==&lt;br /&gt;
&lt;br /&gt;
The water cooling system operates in negative pressure mode preventing any water leak to flood the detector outer surface. In addition water flow and inlet/outlet temperature are constantly monitored to allow fast response to off range parameter in order to shut down the electronics. The cooling water system requires a primary cooling tap water loop from the AD building. Water quality, water flow and water temperature are not under our responsibility. This aspect will be dealt during the initial phase of the rTPC commissioning at CERN.&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
All electronics voltages are below 48V. No special safety circuits are envisaged.&lt;br /&gt;
&lt;br /&gt;
The high-voltage circuit is fully protected outside the detector. The access to the high-voltage on the detector is restricted to the two end-plates. Interlock scheme will be put in place to ensure the shutdown of the HV in case of manual access to the detector itself.&lt;br /&gt;
&lt;br /&gt;
The LV (Low Voltage) power units are also interlocked to prevent false powering sequence which can damage the downstream electronics modules.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice20.png|571x411px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684507&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684899&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 16- Alpha-g rTPC rack organization&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=499</id>
		<title>Detector Services</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=499"/>
		<updated>2018-12-07T13:18:28Z</updated>

		<summary type="html">&lt;p&gt;Acapra: /* Drain system */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Main Page]]&lt;br /&gt;
&lt;br /&gt;
= Table of Figures =&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684884|Figure 1 - Gas system schematic 6]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684885|Figure 2 - A half-rack space is used for the gas control implementation. 7]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684886|Figure 3 - Gas system half rack ready for installation 8]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684887|Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684888|Figure 5 - Water cooling system during test. 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684889|Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system. 12]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684890|Figure 7 - Overall water cooling system 13]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684891|Figure 8 - Temperature Monitor Board 14]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684892|Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections 15]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684893|Figure 10 – Unpotted Anode Wire Card and Board with HV distribution 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684894|Figure 11 - Anode wire pins and Field wire pins under yellow cover 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684895|Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire 18]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684896|Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards 19]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684897|Figure 14 - Overall Low voltage distribution for anode wires and cathode pads 21]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684898|Figure 15 - High Voltage &amp;amp;amp; Grounding scheme for the rTPC 22]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684899|Figure 16- Alpha-g rTPC rack organization 23]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684457&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This document is to describe the different services for the rTPC detector. 3 main sections cover the &#039;&#039;Gas system&#039;&#039;, the &#039;&#039;Water cooling system&#039;&#039; and the &#039;&#039;Power distribution&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= References and related Documents =&lt;br /&gt;
&lt;br /&gt;
A dedicated TRIUMF Wiki site gathers all documentations for the rTPC detector system and equipment. Gas system, cooling water system and power distribution can be found there.&lt;br /&gt;
&lt;br /&gt;
= Gas system =&lt;br /&gt;
&lt;br /&gt;
The gas system as described below includes the entire gas infrastructure required to deliver gas to the detector, monitor and control the gas flow into the detector. It also includes the necessary equipment to notify any change from the nominal gas flow or gas mixture ratio delivered to the detector.&lt;br /&gt;
&lt;br /&gt;
This type of mixed gas system is well understood by the Triumf detector group staff and no issue in its realization is expected.&lt;br /&gt;
&lt;br /&gt;
This system is a stand-alone infrastructure assembled and delivered to CERN. It will be placed in the Alpha-g experimental area floor. The delivery of the different gases to the experimental area is under the responsibility of the Gas handling group from CERN.&lt;br /&gt;
&lt;br /&gt;
The gas delivery system for the radial TPC (rTPC) is to provide Ar/CO2 gas mixture between 90/10 to 50/50 depending on the user requirements. This system does not recycle the gas as the environmental impact of either gas is minimal and the operation cost versus a recycling system would not be economic.&lt;br /&gt;
&lt;br /&gt;
In the event of an additional quenching gas requirement, the overall gas system will have to be reconsidered and possible recycling system envisaged.&lt;br /&gt;
&lt;br /&gt;
A simple gas mixer using digital flow meters will provide the precise mixture dialed by hand in the control system.&lt;br /&gt;
&lt;br /&gt;
During the prototype phase, an ad-hoc gas system will be put in place. A portable gas system is available for such a test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameter&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Value&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Gas mixture&lt;br /&gt;
| Ar/CO2 (90/10..50/50)&lt;br /&gt;
|-&lt;br /&gt;
| Gas flow requirements&lt;br /&gt;
| 0.3l/min (50%), 0.3l/min (50%)&lt;br /&gt;
|-&lt;br /&gt;
| Detector gas Volume&lt;br /&gt;
| 0.18m&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Flushing time&lt;br /&gt;
| 5h @ 600cc/min&lt;br /&gt;
|-&lt;br /&gt;
| Flow rate&lt;br /&gt;
| 100 to 300 cc/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
This gas system is quite simple as it takes 2 or 3 (spare) gas supplies and mixes them in a manifold before delivery to the rTPC detector. Necessary valves for purging lines and by-passing the detector are foreseen. The individual in-flows are controlled by gas dedicated mass flow controllers (MFC-x). The return flow is measured for leak assessment. An additional manometer monitors the internal detector pressure for evaluation of the electron drift characteristics.&lt;br /&gt;
&lt;br /&gt;
­­­­[[File:imageservice2.png|575x315px|PA_doc-1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684492&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684884&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 1 - Gas system schematic&lt;br /&gt;
&lt;br /&gt;
The main flow controller and monitoring is performed by industrial devices from MKS. We added analog flowmeters on each gas line to provide a quick visual inspection of the gas mixing system.&lt;br /&gt;
&lt;br /&gt;
This system will be hooked to the CERN AD-Gas facility. The CERN gas delivers gas through 2 switchable packs of 12 bottles for each gas.&lt;br /&gt;
&lt;br /&gt;
The gas exhaust is evacuated to the exterior of the experimental area with an elevation of about 8m.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice3.png|366x263px|PA_doc-2.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684493&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684885&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 2 - A half-rack space is used for the gas control implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450557826&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice4.png|324x364px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684494&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684886&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 3 - Gas system half rack ready for installation&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
From-scratch (Neither gas supply lines to the GHS nor connections to and from the TPC connected) connection of the GHS should follow the following procedure:&lt;br /&gt;
# &#039;&#039;&#039;Flush supply lines:&#039;&#039;&#039; Gas lines from outside bottles going to the GHS should be briefly (5 min or so) flushed with a high gas flow &#039;&#039;before&#039;&#039; connecting to the GHS to remove possible dust, and to minimize the amount of air in the lines.&lt;br /&gt;
# &#039;&#039;&#039;Flush GHS:&#039;&#039;&#039;&lt;br /&gt;
## Close BV3 and BV5, open BV2 and BV4 to flush input lines, only briefly.&lt;br /&gt;
## Open BV3 and BV5, close BV2 and BV4 (normal operation configuration)&lt;br /&gt;
## With Midas frontend running, use the &amp;quot;Gas&amp;quot; custom page to set a desired flow, for flushing probably between 1l/min and 1.5l/min (Without Midas, use the telnet interface), then press the &amp;quot;Bypass Flow&amp;quot; button, and let flow for a while (5-15min?)&lt;br /&gt;
# &#039;&#039;&#039;Flush TPC input line:&#039;&#039;&#039;&lt;br /&gt;
## Connect the line that will go from the GHS to the TPC input-tee on the GHS side, but leave disconnected from the tee&lt;br /&gt;
## do the same for the pressure gauge line&lt;br /&gt;
## On the &amp;quot;Gas&amp;quot; custom page, press the &amp;quot;Flow TPC&amp;quot; button and let flow for 5 min (Without Midas, use the telnet interface).&lt;br /&gt;
# Make all remaining connections&lt;br /&gt;
&lt;br /&gt;
== Telnet Interface ==&lt;br /&gt;
If the Midas frontend is not available the GHS can be controlled via telnet. Connect with&lt;br /&gt;
 telnet algas&lt;br /&gt;
then use the following command to control solenoid valves:&lt;br /&gt;
 cowr do i 1&lt;br /&gt;
to energize SVi, i.e. to switch it from its normal closed or open state to the other state,&lt;br /&gt;
 cowr do i 0&lt;br /&gt;
to de-energize, i.e. switch to default state.&lt;br /&gt;
&lt;br /&gt;
Gas flow is set with:&lt;br /&gt;
 mfcwr ao i &amp;lt;desired flow&amp;gt;&lt;br /&gt;
where i is 1 for Ar and 2 for CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, and the desired flow is in the internal units of the system.&lt;br /&gt;
&lt;br /&gt;
= Water cooling system =&lt;br /&gt;
&lt;br /&gt;
The outer surface of the detector has an arrangement of 8x8 electronics boards handling the readout of the cathode pads. These boards require operating at a controlled temperature to prevent heat build-up at the surface of the detector and improving the reliability of the system. In order to do so, 8 independent water pipe loops running from the bottom-up and down in the longitudinal axis of the detector are in a thermal contact to 8 successive readout boards. From the bottom, a pair of water hoses connect to 2 custom 3D-printed manifolds supplying the water feed and return to the 8 water loops.&lt;br /&gt;
&lt;br /&gt;
These 8 loops are run in parallel to a negative pressure water cooling system. This negative pressure system is to ensure that no water leak will damage the electronics even during possible pipe or delivery hose breakage.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice5.png|516x273px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960816&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684495&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684887&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice6.jpg|249x429px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960817&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684496&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684888&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 5 - Water cooling system during test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameters&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Values&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Number of parallel water loops&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| Copper pipe OD/ID&lt;br /&gt;
| ¼” / 4.7mm&lt;br /&gt;
|-&lt;br /&gt;
| Length of one loop (on the rTPC)&lt;br /&gt;
| 4.6m&lt;br /&gt;
|-&lt;br /&gt;
| Water speed per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Pressure drop per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Power extraction per water loop&lt;br /&gt;
| 8x15W= 120W&lt;br /&gt;
|-&lt;br /&gt;
| Total cooling power&lt;br /&gt;
| 1KW&lt;br /&gt;
|-&lt;br /&gt;
| Inlet water temperature&lt;br /&gt;
| 16..20 degC (to be confirmed)&lt;br /&gt;
|-&lt;br /&gt;
| Outlet water temperature&lt;br /&gt;
| 20..24 degC&lt;br /&gt;
|-&lt;br /&gt;
| Total water flow&lt;br /&gt;
| 3..6 l/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This description corresponds to how we think the system should work, but doesn&#039;t seem fully comatible with the behaviour of the system. E.g. the air pump only seems to turn on when PID1 falls below a certain value.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Pressure PID (proportional/integral/differential controller), PID2, monitors the air pressure in the vacuum vessel. When the pressure rises above a trigger value (perhaps 350mbar) it activates the aspirator vacuum pump to bring the pressure down to maintain a long time averaged pressure (say 300mbar).&lt;br /&gt;
&lt;br /&gt;
This vacuum is then used to draw water through the detector into the vessel, from the Open Tank. The vacuum vessel&#039;s water level is monitored by PID1, using a differential pressure transducer measuring the weight of the water column by the difference between the air pressure in the top of the vessel and the water pressure at the bottom of the vessel. PID1 provides a variable signal to the Proportional Solenoid Valve, which varies the flow through the return loop around the (fixed flow) water pump, and thus changing the overall flow of water from the vacuum vessel to keep the water level in the vessel constant despite water being constantly drawn in by the vacuum. The water pulled from the vacuum vessel is pushed through the filter and into the Open Tank, completing the circulation.&lt;br /&gt;
&lt;br /&gt;
Cooling is accomplished in the water pump leg of the system, as coolant pulled from the vacuum vessel passes through a heat exchanger coupled to CERN’s cooling water supply on its way to the pump. The rate that water flows through the system can be determined by many obstacles in the loop, but ideally it should be dominated by the position of the main Throttle Valve. Other valves should generally be set either fully open of fully closed, except for the Proportional Valve, whose position responds to the setting of the Throttle Valve.&lt;br /&gt;
&lt;br /&gt;
Data outputs: there are five data outputs planned. The two process variables, the vacuum vessel absolute pressure, and differential water column pressure, will be sent to the Detector DAQ system. As well, the total flow rate is monitored by the flow meter, whose output is sent to the DAQ system. This data is not used by the circulation system itself. Likewise, the back pressure on the water filter is only sent to the DAQ system to indicate if the filter may need changing, and the temperature of the open tank is monitored and sent to the DAQ system, but currently there is no plan to use it in a temperature control feedback. The temperature of CERN&#039;s cooling water supply is not yet known, but we expect we can set the heat exchanger to run at a rate to hold the system temperature near 20°C without feedback control.&lt;br /&gt;
&lt;br /&gt;
For the negative pressure to work effectively to prevent leaks, the water pressure in the detector ought to be down at least to half an atmosphere. With the detector cooling tubes 8x 4.6m of parallel 4.7mm ID copper tubes (2.3m down then 2.3 back-ups), and the supply using (perhaps 6m, 3 to the detector then 3 back) 9.7mm ID (=1/2&amp;amp;quot; OD) poly tubing, the flow will need to be somewhat greater than the required 3 l/min in order to maintain that degree of vacuum in the detector, unless the Throttle Valve is placed upstream of the detector near the Open Tank, or an additional constriction is added in that region.&lt;br /&gt;
&lt;br /&gt;
The water pump leg of the circuit residing in the water cooling/gas rack is placed far enough from the fringe field of the superconducting magnet to prevent disruptive effects on the solenoid valves and electric motors. Therefore the main 1/2&amp;amp;quot; poly line to and from the water pump and its flow loop will add a pressure drop which is estimated at 0.4atm for a 10m line at 6 l/min (9.7mmID), which is within our requirements. As mentioned earlier, the splitting (and reassembly) of the line to the 8 cooling lines close to detector will be accomplished with the use of 2 separate manifolds equipped with temperature sensors for constant in/out global water temperature monitoring.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice7.png|286x206px]][[File:imageservice8.jpg|286x206px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684497&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684889&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system.&lt;br /&gt;
&lt;br /&gt;
Currently, PVC valves with &amp;amp;quot;true union&amp;amp;quot; couplings are planned to be provided around the water pump to permit it to be swapped out from the system for servicing and a valved bypass to the water filter is provided for the same purpose to allow easily changing filter elements with the system running. True union valves are generally only available to 1/2NPT and larger, so an adapter fitting is required. The vacuum pump for the system is a small (2 x 5 x 7.5cm) cascaded dual Venturi aspirator, which is operated with site air, switched with two simultaneously operated normally closed solenoid valves, one for the site air, and one for the vessel vacuum input. If the system is leak free, the vacuum in the vessel should only be degraded by the dissolved air absorbed in the Open Tank and extracted in the vacuum vessel, which from past experience might mean running for under a minute every six hours or so.&lt;br /&gt;
&lt;br /&gt;
The wetted surfaces of this system will be mainly PVC and Polyethylene for the valves, tubing and vessels, plus brass fittings, and the copper cooling tubes, and the surfaces of the heat exchanger, which will most likely be stainless steel. It may be possible to devise an equivalent of a bellows communicating with the Open Tank, so that it is only virtually open, thus sealing the cooling water from contaminants, which may allow us to run with just distilled water plus a strip of silver as a biocide (although I&#039;m not sure if the mix of metals, copper plus stainless, may not interfere with the function of the silver, which is mostly used in computer cooling systems which are copper and plastic only). Otherwise, we will need a biocide and corrosion inhibitor. We have the latter, tolyltriazole, but the biocide is problematic. They tend to be short-lived; for systems which are open to atmosphere, typical industrial practice is chlorination, regularly refreshed, which builds up NaCl as it degrades, making the coolant corrosive. For T2K in Japan, we used the (human-nontoxic) &amp;amp;quot;Germall&amp;amp;quot;, which has a two-year lifetime, after which when its effectiveness decays it turns into food, which is the case for any solute that is not actively biocidal. Eventually, any such additives build up and require the coolant to be flushed and replaced. Silver is a lovely method, but only works for extended periods with a sealed system which remains deoxygenated. My research so far has not turned up a good candidate which does not entail recurring changes of the coolant.&lt;br /&gt;
&lt;br /&gt;
Power: the system needs to be able to run on European 220VAC power, but also operate here for testing purposes. The PIDs (Omega CN76160s) will accept both; for the rest of the system, I will have an a universal 90-240VAC input to 24VDC (5A) supply which will drive all the other components, including the pump, which will be a brushless 24VDC centrifugal pump, 1 - 1.5A range. The whole system will run about 125W.&lt;br /&gt;
&lt;br /&gt;
Information on the temperature and flow rate of the CERN cooling water system will be provided later but we don’t anticipate any major issues about the sizing of the heat exchanger.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice9.png|603x344px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960818&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684498&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684890&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 7 - Overall water cooling system&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564356&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Temperature Measurement ==&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice10.jpeg|225x356px]] [[File:imageservice11.png|194x358px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684499&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684891&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 8 Temperature Monitor Board&lt;br /&gt;
&lt;br /&gt;
The water temperature is read by the Temperature Monitor Board (TEMPB). Thermistors located inside the manifold connect to a 16 bit ADC on the TEMPB which is read out by a Raspberry Pi mounted on board. In a similar manner the air system temperature is read with sensors in the air manifold. The TEMPB can provide temperature readout of 32 thermistors which connect to terminal blocks. The channels can also be readout differentially providing up to 16 channels for thermocouples. An on board thermistor allows for cold junction compensation. The board is powered via USB on the Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
This assumes all water lines and compressed air are connected, and both the blue water tank and the chiller are filled.&lt;br /&gt;
&lt;br /&gt;
=== Begin running ===&lt;br /&gt;
# Close vent valve and main valve (3-way valve in T position)&lt;br /&gt;
# Switch on control box with power switch in the back&lt;br /&gt;
# confirm water pump is off, i.e. blue button is not illuminated&lt;br /&gt;
# Vacuum pump should now be running&lt;br /&gt;
# Open main valve, i.e. vertical connection open, connection to vent valve closed [[File:PWBmainOpen.jpg|thumb|Cooling system main valve open]]&lt;br /&gt;
# water should start flowing through the PWB cooling system and coming back through the clear pipe connected to the vacuum vessel&lt;br /&gt;
# Default settings are PID1 = 200, PID2 = 300, but may have been adjusted&lt;br /&gt;
# once the water level in the vacuum vessel has risen to ~20cm, turn on the water pump&lt;br /&gt;
&lt;br /&gt;
=== Drain system ===&lt;br /&gt;
# from normal operation, i.e. vacuum pump and water pump running&lt;br /&gt;
# switch main valve to upside down T position &lt;br /&gt;
[[File:PWBmainVent.jpg|thumb]]&lt;br /&gt;
# open vent valve&lt;br /&gt;
# air should now enter the system, draining all water from the TPC pipes into the vacuum vessel&lt;br /&gt;
# water pump will drain the vacuum vessel into supply tank, turn it off before the vessel is completely empty to avoid air in the water pump&lt;br /&gt;
# switch off main power&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
The water system is temperamental, and not intuitive at all. Common problems and solution attempts:&lt;br /&gt;
&lt;br /&gt;
; water pump very loud, doesn&#039;t appear to pump water&lt;br /&gt;
: most likely air in the water pump. Open the vent of the vacuum vessel to allow water to enter pump by gravity alone, pump should stop screaming and start pumping. Close vent.&lt;br /&gt;
; vacuum pump comes on often (more then every 10-20 min)&lt;br /&gt;
: probably an air leak in the system. Check for bubbles and try to find leak.&lt;br /&gt;
; water level/flow/vacuum oscillate between extreme values&lt;br /&gt;
: unclear, try playing with PID settings, throttle valve, possibly orange ball valves by the water pump.&lt;br /&gt;
&lt;br /&gt;
= Power distribution =&lt;br /&gt;
&lt;br /&gt;
This section covers the different voltages and power requirements for the operation of the rTPC. This includes:&lt;br /&gt;
&lt;br /&gt;
# High Voltage for the rTPC electron drift and amplification operation&lt;br /&gt;
# Low Voltage to the Anode wire frontend electronics&lt;br /&gt;
# Low Voltage to the Barrel Scintillator frontend electronics&lt;br /&gt;
# Low Voltage to the Cathode Pads electronics&lt;br /&gt;
# Grounding scheme of the overall rTPC&lt;br /&gt;
&lt;br /&gt;
The provision of power to the different components of the detector is distributed from the top end plate of the rTPC.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice12.png|507x354px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965261&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684500&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684892&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections&lt;br /&gt;
&lt;br /&gt;
== High Voltage for the rTPC ==&lt;br /&gt;
&lt;br /&gt;
Three main components of the rTPC require High Voltage&lt;br /&gt;
&lt;br /&gt;
* Main cathode wall (Negative ~5KV)&lt;br /&gt;
* Field wires (Negative ~ few hundred volts)&lt;br /&gt;
* Anode wires (Positive ~3.2KV )&lt;br /&gt;
&lt;br /&gt;
These voltages are provided by a Quad High Voltage unit from CAEN. Three independent cables will be fed to the top of the rTPC.&lt;br /&gt;
&lt;br /&gt;
High Voltage provision to the bottom endplate HV ring is taken from the central cathode near the bottom endplate.&lt;br /&gt;
&lt;br /&gt;
The Field wire voltage is connected to all the field wire crimp-pins through a dedicated socket chain inserted on each of the crimp-pin on the top and bottom endplates. The field wires themselves interconnect the high voltage between the top and bottom pins.&amp;lt;span id=&amp;quot;OLE_LINK20&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK21&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK22&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The High Voltage for the anode wires is delivered to the Anode Wire Card (AWC) which will distribute it to its 16 wires, Figure 11. There are 16 AWC cards covering each end of the anode wires. All the top and bottom 32 AWC are connected serially. The anode wires themselves interconnect the high voltage between the top and bottom pins.&lt;br /&gt;
&lt;br /&gt;
The anode wires pre-amplifiers boards (AWB) are sitting on the top of the Anode Wire Card (AWC) Figure 10. As the wire is powered by the HV, each anode wire has a high Voltage decoupling capacitor to isolate the pre-amp stage from the HV. This circuit resides on the AWC. The AWB will see the AC coupled anode signal only. With a new design of the AWC Figure 12, the decoupling capacitors are potted in epoxy to ensure proper isolation of the HV toward the surrounding circuit as well to prevent corona discharge due to relative humidity of the surrounding.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice13.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684196&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684501&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684893&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 10 – Unpotted Anode Wire Card and Board with HV distribution&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice14.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684198&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684502&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684894&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 11 - Anode wire pins and Field wire pins under yellow cover&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice15.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684370&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684503&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684895&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Anode wire frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
The AWB pre-amp board requires 2 voltages (+5V, -5V) which are fed through dedicated cable connections to each of the AWB. There are 16 AWB per end of the rTPC, therefore, 16 individual cable bundle will be reaching the top and another 16 the bottom of the rTPC. The cable bundle is to also provide the power return lines to the Power Supply.&lt;br /&gt;
&lt;br /&gt;
The PL508 Low Voltage power Supply from Wiener will provide the main power source for all the 32 pre-amplifiers. A dedicated connection breakout board with current monitoring capability splits the source power to the 2 x 16 necessary connections to the Anode wire boards. Based on a RaspeberryPi card, a 16 power distribution board is already implemented for the prototype. This board has extra 4 channels of temperature monitoring which can be used later on. In the same process we produce a similar board for 16 channel of NTC, RTC temperature monitoring. They will be used for overall detector and cooling system monitoring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;-5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Anode Pre-amp&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice16.jpg|239x363px]] [[File:imageservice17.png|239x363px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965262&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684504&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684896&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Barrel Scintillator frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
Similar to the Anode wire pre-amplifier voltage distribution scheme, the Barrel Scintillators will require several low voltages for power and control. The Barrel Scintillator Boards (BSB) are mounted on both ends of the Scintillator bar with the same segmentation as the Anode wires i.e.: 16 BSB per end. The design of the electronic chain for the barrel scintillator is not fully designed yet.&lt;br /&gt;
&lt;br /&gt;
The SiPM sensors require a bias voltage of the order of 28V. This voltage will be provided through the same mean as the low voltage power. Expected threshold voltage for the local signal level discriminator is also foreseen.&amp;lt;span id=&amp;quot;_Toc450564363&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Low Voltage to the Cathode Pads electronics ==&lt;br /&gt;
&lt;br /&gt;
The cathode pads electronics mounted on the external cylinder surface is composed of the analog frontend and the digital conversion electronics. Two voltages are required (+5.3V, +2.3V). The delivery is done through dedicated “power bar” running the full length of the rTPC. A set of 3 bars covers the 8 axial cathode pad electronics boards. 8 of them cover the circumference of the rTPC.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+2.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Padwing board&lt;br /&gt;
| 10W (1.8A)&lt;br /&gt;
| 2W (0.8A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Overall the low power supplies are provided by a PL508-3U with 8 modules of either single or dual channels from Wiener.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice18.png|469x360px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684505&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684897&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 14 - Overall Low voltage distribution for anode wires and cathode pads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564365&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grounding scheme of the overall rTPC ==&lt;br /&gt;
&lt;br /&gt;
The grounding scheme challenge in this setup is the far distance between the 2 end of the rTPC (2.3m) and the lack of accessibility to the bottom of the detector. The proposal is to use a Copper sheet mounted on the inner surface of the inner cylinder. This ground path will connect the 2 endplates to the High Voltage return. All the pre-amps will merge their ground to this central ground.&lt;br /&gt;
&lt;br /&gt;
Additional ground lugs have been included in the Anode wire pre-amplifier boards to strengthen the ground as each anode wire is readout out from both end. This may be used once the full detector is assembled to address possible ground loop issues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684506&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;[[File:imageservice19.png|439x409px]]&lt;br /&gt;
&lt;br /&gt;
= Safety and Hazard considerations =&lt;br /&gt;
&lt;br /&gt;
== Gas ==&lt;br /&gt;
&lt;br /&gt;
The Ar and CO2 do not require special health safety system. The detector will be operated in the ventilated hall of the AD building at CERN.&lt;br /&gt;
&lt;br /&gt;
Gas flow, detector gas pressure, and gas inlet temperature are constantly monitored and can trigger adequate response for shutdown or closure of the gas system for safety purpose.&lt;br /&gt;
&lt;br /&gt;
== Cooling water ==&lt;br /&gt;
&lt;br /&gt;
The water cooling system operates in negative pressure mode preventing any water leak to flood the detector outer surface. In addition water flow and inlet/outlet temperature are constantly monitored to allow fast response to off range parameter in order to shut down the electronics. The cooling water system requires a primary cooling tap water loop from the AD building. Water quality, water flow and water temperature are not under our responsibility. This aspect will be dealt during the initial phase of the rTPC commissioning at CERN.&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
All electronics voltages are below 48V. No special safety circuits are envisaged.&lt;br /&gt;
&lt;br /&gt;
The high-voltage circuit is fully protected outside the detector. The access to the high-voltage on the detector is restricted to the two end-plates. Interlock scheme will be put in place to ensure the shutdown of the HV in case of manual access to the detector itself.&lt;br /&gt;
&lt;br /&gt;
The LV (Low Voltage) power units are also interlocked to prevent false powering sequence which can damage the downstream electronics modules.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice20.png|571x411px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684507&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684899&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 16- Alpha-g rTPC rack organization&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:PWBmainVent.jpg&amp;diff=498</id>
		<title>File:PWBmainVent.jpg</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:PWBmainVent.jpg&amp;diff=498"/>
		<updated>2018-12-07T13:17:53Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;rTPC services rack, cooling system, main valve vent&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=497</id>
		<title>Detector Services</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Detector_Services&amp;diff=497"/>
		<updated>2018-12-07T13:15:45Z</updated>

		<summary type="html">&lt;p&gt;Acapra: /* Begin running */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to [[Main Page]]&lt;br /&gt;
&lt;br /&gt;
= Table of Figures =&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684884|Figure 1 - Gas system schematic 6]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684885|Figure 2 - A half-rack space is used for the gas control implementation. 7]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684886|Figure 3 - Gas system half rack ready for installation 8]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684887|Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684888|Figure 5 - Water cooling system during test. 9]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684889|Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system. 12]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684890|Figure 7 - Overall water cooling system 13]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684891|Figure 8 - Temperature Monitor Board 14]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684892|Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections 15]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684893|Figure 10 – Unpotted Anode Wire Card and Board with HV distribution 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684894|Figure 11 - Anode wire pins and Field wire pins under yellow cover 17]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684895|Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire 18]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684896|Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards 19]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684897|Figure 14 - Overall Low voltage distribution for anode wires and cathode pads 21]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684898|Figure 15 - High Voltage &amp;amp;amp; Grounding scheme for the rTPC 22]]&lt;br /&gt;
&lt;br /&gt;
[[#_Toc493684899|Figure 16- Alpha-g rTPC rack organization 23]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684457&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This document is to describe the different services for the rTPC detector. 3 main sections cover the &#039;&#039;Gas system&#039;&#039;, the &#039;&#039;Water cooling system&#039;&#039; and the &#039;&#039;Power distribution&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= References and related Documents =&lt;br /&gt;
&lt;br /&gt;
A dedicated TRIUMF Wiki site gathers all documentations for the rTPC detector system and equipment. Gas system, cooling water system and power distribution can be found there.&lt;br /&gt;
&lt;br /&gt;
= Gas system =&lt;br /&gt;
&lt;br /&gt;
The gas system as described below includes the entire gas infrastructure required to deliver gas to the detector, monitor and control the gas flow into the detector. It also includes the necessary equipment to notify any change from the nominal gas flow or gas mixture ratio delivered to the detector.&lt;br /&gt;
&lt;br /&gt;
This type of mixed gas system is well understood by the Triumf detector group staff and no issue in its realization is expected.&lt;br /&gt;
&lt;br /&gt;
This system is a stand-alone infrastructure assembled and delivered to CERN. It will be placed in the Alpha-g experimental area floor. The delivery of the different gases to the experimental area is under the responsibility of the Gas handling group from CERN.&lt;br /&gt;
&lt;br /&gt;
The gas delivery system for the radial TPC (rTPC) is to provide Ar/CO2 gas mixture between 90/10 to 50/50 depending on the user requirements. This system does not recycle the gas as the environmental impact of either gas is minimal and the operation cost versus a recycling system would not be economic.&lt;br /&gt;
&lt;br /&gt;
In the event of an additional quenching gas requirement, the overall gas system will have to be reconsidered and possible recycling system envisaged.&lt;br /&gt;
&lt;br /&gt;
A simple gas mixer using digital flow meters will provide the precise mixture dialed by hand in the control system.&lt;br /&gt;
&lt;br /&gt;
During the prototype phase, an ad-hoc gas system will be put in place. A portable gas system is available for such a test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameter&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Value&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Gas mixture&lt;br /&gt;
| Ar/CO2 (90/10..50/50)&lt;br /&gt;
|-&lt;br /&gt;
| Gas flow requirements&lt;br /&gt;
| 0.3l/min (50%), 0.3l/min (50%)&lt;br /&gt;
|-&lt;br /&gt;
| Detector gas Volume&lt;br /&gt;
| 0.18m&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Flushing time&lt;br /&gt;
| 5h @ 600cc/min&lt;br /&gt;
|-&lt;br /&gt;
| Flow rate&lt;br /&gt;
| 100 to 300 cc/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
This gas system is quite simple as it takes 2 or 3 (spare) gas supplies and mixes them in a manifold before delivery to the rTPC detector. Necessary valves for purging lines and by-passing the detector are foreseen. The individual in-flows are controlled by gas dedicated mass flow controllers (MFC-x). The return flow is measured for leak assessment. An additional manometer monitors the internal detector pressure for evaluation of the electron drift characteristics.&lt;br /&gt;
&lt;br /&gt;
­­­­[[File:imageservice2.png|575x315px|PA_doc-1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684492&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684884&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 1 - Gas system schematic&lt;br /&gt;
&lt;br /&gt;
The main flow controller and monitoring is performed by industrial devices from MKS. We added analog flowmeters on each gas line to provide a quick visual inspection of the gas mixing system.&lt;br /&gt;
&lt;br /&gt;
This system will be hooked to the CERN AD-Gas facility. The CERN gas delivers gas through 2 switchable packs of 12 bottles for each gas.&lt;br /&gt;
&lt;br /&gt;
The gas exhaust is evacuated to the exterior of the experimental area with an elevation of about 8m.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice3.png|366x263px|PA_doc-2.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684493&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684885&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 2 - A half-rack space is used for the gas control implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450557826&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice4.png|324x364px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684494&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684886&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 3 - Gas system half rack ready for installation&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
From-scratch (Neither gas supply lines to the GHS nor connections to and from the TPC connected) connection of the GHS should follow the following procedure:&lt;br /&gt;
# &#039;&#039;&#039;Flush supply lines:&#039;&#039;&#039; Gas lines from outside bottles going to the GHS should be briefly (5 min or so) flushed with a high gas flow &#039;&#039;before&#039;&#039; connecting to the GHS to remove possible dust, and to minimize the amount of air in the lines.&lt;br /&gt;
# &#039;&#039;&#039;Flush GHS:&#039;&#039;&#039;&lt;br /&gt;
## Close BV3 and BV5, open BV2 and BV4 to flush input lines, only briefly.&lt;br /&gt;
## Open BV3 and BV5, close BV2 and BV4 (normal operation configuration)&lt;br /&gt;
## With Midas frontend running, use the &amp;quot;Gas&amp;quot; custom page to set a desired flow, for flushing probably between 1l/min and 1.5l/min (Without Midas, use the telnet interface), then press the &amp;quot;Bypass Flow&amp;quot; button, and let flow for a while (5-15min?)&lt;br /&gt;
# &#039;&#039;&#039;Flush TPC input line:&#039;&#039;&#039;&lt;br /&gt;
## Connect the line that will go from the GHS to the TPC input-tee on the GHS side, but leave disconnected from the tee&lt;br /&gt;
## do the same for the pressure gauge line&lt;br /&gt;
## On the &amp;quot;Gas&amp;quot; custom page, press the &amp;quot;Flow TPC&amp;quot; button and let flow for 5 min (Without Midas, use the telnet interface).&lt;br /&gt;
# Make all remaining connections&lt;br /&gt;
&lt;br /&gt;
== Telnet Interface ==&lt;br /&gt;
If the Midas frontend is not available the GHS can be controlled via telnet. Connect with&lt;br /&gt;
 telnet algas&lt;br /&gt;
then use the following command to control solenoid valves:&lt;br /&gt;
 cowr do i 1&lt;br /&gt;
to energize SVi, i.e. to switch it from its normal closed or open state to the other state,&lt;br /&gt;
 cowr do i 0&lt;br /&gt;
to de-energize, i.e. switch to default state.&lt;br /&gt;
&lt;br /&gt;
Gas flow is set with:&lt;br /&gt;
 mfcwr ao i &amp;lt;desired flow&amp;gt;&lt;br /&gt;
where i is 1 for Ar and 2 for CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, and the desired flow is in the internal units of the system.&lt;br /&gt;
&lt;br /&gt;
= Water cooling system =&lt;br /&gt;
&lt;br /&gt;
The outer surface of the detector has an arrangement of 8x8 electronics boards handling the readout of the cathode pads. These boards require operating at a controlled temperature to prevent heat build-up at the surface of the detector and improving the reliability of the system. In order to do so, 8 independent water pipe loops running from the bottom-up and down in the longitudinal axis of the detector are in a thermal contact to 8 successive readout boards. From the bottom, a pair of water hoses connect to 2 custom 3D-printed manifolds supplying the water feed and return to the 8 water loops.&lt;br /&gt;
&lt;br /&gt;
These 8 loops are run in parallel to a negative pressure water cooling system. This negative pressure system is to ensure that no water leak will damage the electronics even during possible pipe or delivery hose breakage.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice5.png|516x273px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960816&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684495&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684887&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 4 - Cathode pad half-cylinder. Pairs of cooling pipes are visible&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice6.jpg|249x429px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960817&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684496&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684888&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 5 - Water cooling system during test.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Parameters&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Values&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Number of parallel water loops&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
| Copper pipe OD/ID&lt;br /&gt;
| ¼” / 4.7mm&lt;br /&gt;
|-&lt;br /&gt;
| Length of one loop (on the rTPC)&lt;br /&gt;
| 4.6m&lt;br /&gt;
|-&lt;br /&gt;
| Water speed per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Pressure drop per loop&lt;br /&gt;
| …&lt;br /&gt;
|-&lt;br /&gt;
| Power extraction per water loop&lt;br /&gt;
| 8x15W= 120W&lt;br /&gt;
|-&lt;br /&gt;
| Total cooling power&lt;br /&gt;
| 1KW&lt;br /&gt;
|-&lt;br /&gt;
| Inlet water temperature&lt;br /&gt;
| 16..20 degC (to be confirmed)&lt;br /&gt;
|-&lt;br /&gt;
| Outlet water temperature&lt;br /&gt;
| 20..24 degC&lt;br /&gt;
|-&lt;br /&gt;
| Total water flow&lt;br /&gt;
| 3..6 l/minute&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Operation ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This description corresponds to how we think the system should work, but doesn&#039;t seem fully comatible with the behaviour of the system. E.g. the air pump only seems to turn on when PID1 falls below a certain value.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Pressure PID (proportional/integral/differential controller), PID2, monitors the air pressure in the vacuum vessel. When the pressure rises above a trigger value (perhaps 350mbar) it activates the aspirator vacuum pump to bring the pressure down to maintain a long time averaged pressure (say 300mbar).&lt;br /&gt;
&lt;br /&gt;
This vacuum is then used to draw water through the detector into the vessel, from the Open Tank. The vacuum vessel&#039;s water level is monitored by PID1, using a differential pressure transducer measuring the weight of the water column by the difference between the air pressure in the top of the vessel and the water pressure at the bottom of the vessel. PID1 provides a variable signal to the Proportional Solenoid Valve, which varies the flow through the return loop around the (fixed flow) water pump, and thus changing the overall flow of water from the vacuum vessel to keep the water level in the vessel constant despite water being constantly drawn in by the vacuum. The water pulled from the vacuum vessel is pushed through the filter and into the Open Tank, completing the circulation.&lt;br /&gt;
&lt;br /&gt;
Cooling is accomplished in the water pump leg of the system, as coolant pulled from the vacuum vessel passes through a heat exchanger coupled to CERN’s cooling water supply on its way to the pump. The rate that water flows through the system can be determined by many obstacles in the loop, but ideally it should be dominated by the position of the main Throttle Valve. Other valves should generally be set either fully open of fully closed, except for the Proportional Valve, whose position responds to the setting of the Throttle Valve.&lt;br /&gt;
&lt;br /&gt;
Data outputs: there are five data outputs planned. The two process variables, the vacuum vessel absolute pressure, and differential water column pressure, will be sent to the Detector DAQ system. As well, the total flow rate is monitored by the flow meter, whose output is sent to the DAQ system. This data is not used by the circulation system itself. Likewise, the back pressure on the water filter is only sent to the DAQ system to indicate if the filter may need changing, and the temperature of the open tank is monitored and sent to the DAQ system, but currently there is no plan to use it in a temperature control feedback. The temperature of CERN&#039;s cooling water supply is not yet known, but we expect we can set the heat exchanger to run at a rate to hold the system temperature near 20°C without feedback control.&lt;br /&gt;
&lt;br /&gt;
For the negative pressure to work effectively to prevent leaks, the water pressure in the detector ought to be down at least to half an atmosphere. With the detector cooling tubes 8x 4.6m of parallel 4.7mm ID copper tubes (2.3m down then 2.3 back-ups), and the supply using (perhaps 6m, 3 to the detector then 3 back) 9.7mm ID (=1/2&amp;amp;quot; OD) poly tubing, the flow will need to be somewhat greater than the required 3 l/min in order to maintain that degree of vacuum in the detector, unless the Throttle Valve is placed upstream of the detector near the Open Tank, or an additional constriction is added in that region.&lt;br /&gt;
&lt;br /&gt;
The water pump leg of the circuit residing in the water cooling/gas rack is placed far enough from the fringe field of the superconducting magnet to prevent disruptive effects on the solenoid valves and electric motors. Therefore the main 1/2&amp;amp;quot; poly line to and from the water pump and its flow loop will add a pressure drop which is estimated at 0.4atm for a 10m line at 6 l/min (9.7mmID), which is within our requirements. As mentioned earlier, the splitting (and reassembly) of the line to the 8 cooling lines close to detector will be accomplished with the use of 2 separate manifolds equipped with temperature sensors for constant in/out global water temperature monitoring.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice7.png|286x206px]][[File:imageservice8.jpg|286x206px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684497&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684889&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 6 - Model and 3D-printed realization of the dry-air manifold, very similar to the manifolds for the water cooling system.&lt;br /&gt;
&lt;br /&gt;
Currently, PVC valves with &amp;amp;quot;true union&amp;amp;quot; couplings are planned to be provided around the water pump to permit it to be swapped out from the system for servicing and a valved bypass to the water filter is provided for the same purpose to allow easily changing filter elements with the system running. True union valves are generally only available to 1/2NPT and larger, so an adapter fitting is required. The vacuum pump for the system is a small (2 x 5 x 7.5cm) cascaded dual Venturi aspirator, which is operated with site air, switched with two simultaneously operated normally closed solenoid valves, one for the site air, and one for the vessel vacuum input. If the system is leak free, the vacuum in the vessel should only be degraded by the dissolved air absorbed in the Open Tank and extracted in the vacuum vessel, which from past experience might mean running for under a minute every six hours or so.&lt;br /&gt;
&lt;br /&gt;
The wetted surfaces of this system will be mainly PVC and Polyethylene for the valves, tubing and vessels, plus brass fittings, and the copper cooling tubes, and the surfaces of the heat exchanger, which will most likely be stainless steel. It may be possible to devise an equivalent of a bellows communicating with the Open Tank, so that it is only virtually open, thus sealing the cooling water from contaminants, which may allow us to run with just distilled water plus a strip of silver as a biocide (although I&#039;m not sure if the mix of metals, copper plus stainless, may not interfere with the function of the silver, which is mostly used in computer cooling systems which are copper and plastic only). Otherwise, we will need a biocide and corrosion inhibitor. We have the latter, tolyltriazole, but the biocide is problematic. They tend to be short-lived; for systems which are open to atmosphere, typical industrial practice is chlorination, regularly refreshed, which builds up NaCl as it degrades, making the coolant corrosive. For T2K in Japan, we used the (human-nontoxic) &amp;amp;quot;Germall&amp;amp;quot;, which has a two-year lifetime, after which when its effectiveness decays it turns into food, which is the case for any solute that is not actively biocidal. Eventually, any such additives build up and require the coolant to be flushed and replaced. Silver is a lovely method, but only works for extended periods with a sealed system which remains deoxygenated. My research so far has not turned up a good candidate which does not entail recurring changes of the coolant.&lt;br /&gt;
&lt;br /&gt;
Power: the system needs to be able to run on European 220VAC power, but also operate here for testing purposes. The PIDs (Omega CN76160s) will accept both; for the rest of the system, I will have an a universal 90-240VAC input to 24VDC (5A) supply which will drive all the other components, including the pump, which will be a brushless 24VDC centrifugal pump, 1 - 1.5A range. The whole system will run about 125W.&lt;br /&gt;
&lt;br /&gt;
Information on the temperature and flow rate of the CERN cooling water system will be provided later but we don’t anticipate any major issues about the sizing of the heat exchanger.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice9.png|603x344px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449960818&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684498&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684890&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 7 - Overall water cooling system&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564356&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Temperature Measurement ==&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice10.jpeg|225x356px]] [[File:imageservice11.png|194x358px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684499&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684891&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 8 Temperature Monitor Board&lt;br /&gt;
&lt;br /&gt;
The water temperature is read by the Temperature Monitor Board (TEMPB). Thermistors located inside the manifold connect to a 16 bit ADC on the TEMPB which is read out by a Raspberry Pi mounted on board. In a similar manner the air system temperature is read with sensors in the air manifold. The TEMPB can provide temperature readout of 32 thermistors which connect to terminal blocks. The channels can also be readout differentially providing up to 16 channels for thermocouples. An on board thermistor allows for cold junction compensation. The board is powered via USB on the Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
This assumes all water lines and compressed air are connected, and both the blue water tank and the chiller are filled.&lt;br /&gt;
&lt;br /&gt;
=== Begin running ===&lt;br /&gt;
# Close vent valve and main valve (3-way valve in T position)&lt;br /&gt;
# Switch on control box with power switch in the back&lt;br /&gt;
# confirm water pump is off, i.e. blue button is not illuminated&lt;br /&gt;
# Vacuum pump should now be running&lt;br /&gt;
# Open main valve, i.e. vertical connection open, connection to vent valve closed [[File:PWBmainOpen.jpg|thumb|Cooling system main valve open]]&lt;br /&gt;
# water should start flowing through the PWB cooling system and coming back through the clear pipe connected to the vacuum vessel&lt;br /&gt;
# Default settings are PID1 = 200, PID2 = 300, but may have been adjusted&lt;br /&gt;
# once the water level in the vacuum vessel has risen to ~20cm, turn on the water pump&lt;br /&gt;
&lt;br /&gt;
=== Drain system ===&lt;br /&gt;
# from normal operation, i.e. vacuum pump and water pump running&lt;br /&gt;
# switch main valve to upside down T position&lt;br /&gt;
# open vent valve&lt;br /&gt;
# air should now enter the system, draining all water from the TPC pipes into the vacuum vessel&lt;br /&gt;
# water pump will drain the vacuum vessel into supply tank, turn it off before the vessel is completely empty to avoid air in the water pump&lt;br /&gt;
# switch off main power&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
The water system is temperamental, and not intuitive at all. Common problems and solution attempts:&lt;br /&gt;
&lt;br /&gt;
; water pump very loud, doesn&#039;t appear to pump water&lt;br /&gt;
: most likely air in the water pump. Open the vent of the vacuum vessel to allow water to enter pump by gravity alone, pump should stop screaming and start pumping. Close vent.&lt;br /&gt;
; vacuum pump comes on often (more then every 10-20 min)&lt;br /&gt;
: probably an air leak in the system. Check for bubbles and try to find leak.&lt;br /&gt;
; water level/flow/vacuum oscillate between extreme values&lt;br /&gt;
: unclear, try playing with PID settings, throttle valve, possibly orange ball valves by the water pump.&lt;br /&gt;
&lt;br /&gt;
= Power distribution =&lt;br /&gt;
&lt;br /&gt;
This section covers the different voltages and power requirements for the operation of the rTPC. This includes:&lt;br /&gt;
&lt;br /&gt;
# High Voltage for the rTPC electron drift and amplification operation&lt;br /&gt;
# Low Voltage to the Anode wire frontend electronics&lt;br /&gt;
# Low Voltage to the Barrel Scintillator frontend electronics&lt;br /&gt;
# Low Voltage to the Cathode Pads electronics&lt;br /&gt;
# Grounding scheme of the overall rTPC&lt;br /&gt;
&lt;br /&gt;
The provision of power to the different components of the detector is distributed from the top end plate of the rTPC.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice12.png|507x354px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965261&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684500&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684892&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 9 - End plate view of the layout of the different electronics boards &amp;amp;amp; HV connections&lt;br /&gt;
&lt;br /&gt;
== High Voltage for the rTPC ==&lt;br /&gt;
&lt;br /&gt;
Three main components of the rTPC require High Voltage&lt;br /&gt;
&lt;br /&gt;
* Main cathode wall (Negative ~5KV)&lt;br /&gt;
* Field wires (Negative ~ few hundred volts)&lt;br /&gt;
* Anode wires (Positive ~3.2KV )&lt;br /&gt;
&lt;br /&gt;
These voltages are provided by a Quad High Voltage unit from CAEN. Three independent cables will be fed to the top of the rTPC.&lt;br /&gt;
&lt;br /&gt;
High Voltage provision to the bottom endplate HV ring is taken from the central cathode near the bottom endplate.&lt;br /&gt;
&lt;br /&gt;
The Field wire voltage is connected to all the field wire crimp-pins through a dedicated socket chain inserted on each of the crimp-pin on the top and bottom endplates. The field wires themselves interconnect the high voltage between the top and bottom pins.&amp;lt;span id=&amp;quot;OLE_LINK20&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK21&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;OLE_LINK22&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The High Voltage for the anode wires is delivered to the Anode Wire Card (AWC) which will distribute it to its 16 wires, Figure 11. There are 16 AWC cards covering each end of the anode wires. All the top and bottom 32 AWC are connected serially. The anode wires themselves interconnect the high voltage between the top and bottom pins.&lt;br /&gt;
&lt;br /&gt;
The anode wires pre-amplifiers boards (AWB) are sitting on the top of the Anode Wire Card (AWC) Figure 10. As the wire is powered by the HV, each anode wire has a high Voltage decoupling capacitor to isolate the pre-amp stage from the HV. This circuit resides on the AWC. The AWB will see the AC coupled anode signal only. With a new design of the AWC Figure 12, the decoupling capacitors are potted in epoxy to ensure proper isolation of the HV toward the surrounding circuit as well to prevent corona discharge due to relative humidity of the surrounding.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice13.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684196&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684501&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684893&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 10 – Unpotted Anode Wire Card and Board with HV distribution&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice14.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684198&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684502&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684894&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 11 - Anode wire pins and Field wire pins under yellow cover&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice15.jpg|402x309px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Ref493684370&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684503&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684895&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 12 – New Anode Wire card with 16 potted HV capacitors, gold crimp pin Mill-max socket to the anode wire&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Anode wire frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
The AWB pre-amp board requires 2 voltages (+5V, -5V) which are fed through dedicated cable connections to each of the AWB. There are 16 AWB per end of the rTPC, therefore, 16 individual cable bundle will be reaching the top and another 16 the bottom of the rTPC. The cable bundle is to also provide the power return lines to the Power Supply.&lt;br /&gt;
&lt;br /&gt;
The PL508 Low Voltage power Supply from Wiener will provide the main power source for all the 32 pre-amplifiers. A dedicated connection breakout board with current monitoring capability splits the source power to the 2 x 16 necessary connections to the Anode wire boards. Based on a RaspeberryPi card, a 16 power distribution board is already implemented for the prototype. This board has extra 4 channels of temperature monitoring which can be used later on. In the same process we produce a similar board for 16 channel of NTC, RTC temperature monitoring. They will be used for overall detector and cooling system monitoring.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;-5V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Anode Pre-amp&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
| 1.5W (0.3A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice16.jpg|239x363px]] [[File:imageservice17.png|239x363px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc449965262&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684504&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684896&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 13 - Anode wire pre-amp power distribution &amp;amp;amp; 16 channel temperature boards&lt;br /&gt;
&lt;br /&gt;
== Power distribution to the Barrel Scintillator frontend electronics ==&lt;br /&gt;
&lt;br /&gt;
Similar to the Anode wire pre-amplifier voltage distribution scheme, the Barrel Scintillators will require several low voltages for power and control. The Barrel Scintillator Boards (BSB) are mounted on both ends of the Scintillator bar with the same segmentation as the Anode wires i.e.: 16 BSB per end. The design of the electronic chain for the barrel scintillator is not fully designed yet.&lt;br /&gt;
&lt;br /&gt;
The SiPM sensors require a bias voltage of the order of 28V. This voltage will be provided through the same mean as the low voltage power. Expected threshold voltage for the local signal level discriminator is also foreseen.&amp;lt;span id=&amp;quot;_Toc450564363&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Low Voltage to the Cathode Pads electronics ==&lt;br /&gt;
&lt;br /&gt;
The cathode pads electronics mounted on the external cylinder surface is composed of the analog frontend and the digital conversion electronics. Two voltages are required (+5.3V, +2.3V). The delivery is done through dedicated “power bar” running the full length of the rTPC. A set of 3 bars covers the 8 axial cathode pad electronics boards. 8 of them cover the circumference of the rTPC.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;Component&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+5.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;&#039;&#039;+2.3V Supply&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Padwing board&lt;br /&gt;
| 10W (1.8A)&lt;br /&gt;
| 2W (0.8A)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Overall the low power supplies are provided by a PL508-3U with 8 modules of either single or dual channels from Wiener.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice18.png|469x360px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684505&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684897&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 14 - Overall Low voltage distribution for anode wires and cathode pads&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc450564365&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Grounding scheme of the overall rTPC ==&lt;br /&gt;
&lt;br /&gt;
The grounding scheme challenge in this setup is the far distance between the 2 end of the rTPC (2.3m) and the lack of accessibility to the bottom of the detector. The proposal is to use a Copper sheet mounted on the inner surface of the inner cylinder. This ground path will connect the 2 endplates to the High Voltage return. All the pre-amps will merge their ground to this central ground.&lt;br /&gt;
&lt;br /&gt;
Additional ground lugs have been included in the Anode wire pre-amplifier boards to strengthen the ground as each anode wire is readout out from both end. This may be used once the full detector is assembled to address possible ground loop issues.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684506&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;[[File:imageservice19.png|439x409px]]&lt;br /&gt;
&lt;br /&gt;
= Safety and Hazard considerations =&lt;br /&gt;
&lt;br /&gt;
== Gas ==&lt;br /&gt;
&lt;br /&gt;
The Ar and CO2 do not require special health safety system. The detector will be operated in the ventilated hall of the AD building at CERN.&lt;br /&gt;
&lt;br /&gt;
Gas flow, detector gas pressure, and gas inlet temperature are constantly monitored and can trigger adequate response for shutdown or closure of the gas system for safety purpose.&lt;br /&gt;
&lt;br /&gt;
== Cooling water ==&lt;br /&gt;
&lt;br /&gt;
The water cooling system operates in negative pressure mode preventing any water leak to flood the detector outer surface. In addition water flow and inlet/outlet temperature are constantly monitored to allow fast response to off range parameter in order to shut down the electronics. The cooling water system requires a primary cooling tap water loop from the AD building. Water quality, water flow and water temperature are not under our responsibility. This aspect will be dealt during the initial phase of the rTPC commissioning at CERN.&lt;br /&gt;
&lt;br /&gt;
== Power distribution ==&lt;br /&gt;
&lt;br /&gt;
All electronics voltages are below 48V. No special safety circuits are envisaged.&lt;br /&gt;
&lt;br /&gt;
The high-voltage circuit is fully protected outside the detector. The access to the high-voltage on the detector is restricted to the two end-plates. Interlock scheme will be put in place to ensure the shutdown of the HV in case of manual access to the detector itself.&lt;br /&gt;
&lt;br /&gt;
The LV (Low Voltage) power units are also interlocked to prevent false powering sequence which can damage the downstream electronics modules.&lt;br /&gt;
&lt;br /&gt;
[[File:imageservice20.png|571x411px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;_Toc493684507&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;span id=&amp;quot;_Toc493684899&amp;quot; class=&amp;quot;anchor&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;Figure 16- Alpha-g rTPC rack organization&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:PWBmainOpen.jpg&amp;diff=496</id>
		<title>File:PWBmainOpen.jpg</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:PWBmainOpen.jpg&amp;diff=496"/>
		<updated>2018-12-07T13:14:21Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;rTPC services rack, water cooling system, main valve open&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=461</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=461"/>
		<updated>2018-11-09T04:55:20Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the new wiki for the ALPHA-g detector and daq.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* agdaq at CERN: https://alphacpc05.cern.ch/agdaq/&lt;br /&gt;
* agmini midas status page: https://daq16.triumf.ca &lt;br /&gt;
* elog: https://daq.triumf.ca/elog-alphag/alphag/&lt;br /&gt;
&lt;br /&gt;
== temporary index ==&lt;br /&gt;
&lt;br /&gt;
* [[daq]] -- DAQ manual&lt;br /&gt;
* [[Equipment]] -- Equipment manuals&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
General information about the Alpha-g Radial Time Projection Chamber (rTPC)&lt;br /&gt;
&lt;br /&gt;
* [[Detector Overview]] : Design note&lt;br /&gt;
* [[Detector Simulations]] : Simulation and track recontruction&lt;br /&gt;
* [[Mechanical Design]] : Mechanical design of the rTPC&lt;br /&gt;
* [[Detector Data Acquistion]] : Computer and Back-end considerations&lt;br /&gt;
* [[Detector Calibration]] : Laser calibration scheme&lt;br /&gt;
* [[Detector Electronics]] : Front-end and digitizers&lt;br /&gt;
* [[Detector Services]] : Gas, Water cooling, Power distribution&lt;br /&gt;
* [[Barrel Scintillator]] : Cosmic veto detector&lt;br /&gt;
&lt;br /&gt;
* [[File:Top rTPC and BS Channel Numbering - RH.pdf|thumb|rTPC and BS Channel Numbering -- TOP view]]&lt;br /&gt;
&lt;br /&gt;
* [[File:BV mapping.pdf|thumb|BV DAQ channels assignment]]&lt;br /&gt;
&lt;br /&gt;
* [[Magnetometry]]&lt;br /&gt;
&lt;br /&gt;
== Mediawiki default blurb ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki has been installed.&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=460</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=460"/>
		<updated>2018-11-09T04:55:01Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the new wiki for the ALPHA-g detector and daq.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* agdaq at CERN: https://alphacpc05.cern.ch/agdaq/&lt;br /&gt;
* agmini midas status page: https://daq16.triumf.ca &lt;br /&gt;
* elog: https://daq.triumf.ca/elog-alphag/alphag/&lt;br /&gt;
&lt;br /&gt;
== temporary index ==&lt;br /&gt;
&lt;br /&gt;
* [[daq]] -- DAQ manual&lt;br /&gt;
* [[Equipment]] -- Equipment manuals&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
General information about the Alpha-g Radial Time Projection Chamber (rTPC)&lt;br /&gt;
&lt;br /&gt;
* [[Detector Overview]] : Design note&lt;br /&gt;
* [[Detector Simulations]] : Simulation and track recontruction&lt;br /&gt;
* [[Mechanical Design]] : Mechanical design of the rTPC&lt;br /&gt;
* [[Detector Data Acquistion]] : Computer and Back-end considerations&lt;br /&gt;
* [[Detector Calibration]] : Laser calibration scheme&lt;br /&gt;
* [[Detector Electronics]] : Front-end and digitizers&lt;br /&gt;
* [[Detector Services]] : Gas, Water cooling, Power distribution&lt;br /&gt;
* [[Barrel Scintillator]] : Cosmic veto detector&lt;br /&gt;
&lt;br /&gt;
* [[File:Top rTPC and BS Channel Numbering - RH.pdf|thumb|rTPC and BS Channel Numbering -- TOP view]]&lt;br /&gt;
&lt;br /&gt;
[[File:BV mapping.pdf|thumb|BV DAQ channels assignment]]&lt;br /&gt;
&lt;br /&gt;
* [[Magnetometry]]&lt;br /&gt;
&lt;br /&gt;
== Mediawiki default blurb ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki has been installed.&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:BV_mapping.pdf&amp;diff=459</id>
		<title>File:BV mapping.pdf</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:BV_mapping.pdf&amp;diff=459"/>
		<updated>2018-11-09T04:54:38Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;BV or BSC channels assignment&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Magnetometry&amp;diff=458</id>
		<title>Magnetometry</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Magnetometry&amp;diff=458"/>
		<updated>2018-11-09T04:41:02Z</updated>

		<summary type="html">&lt;p&gt;Acapra: Created page with &amp;quot; {| class=&amp;quot;wikitable sortable&amp;quot; |- ! NMR+Hall !! PWB !! Column !! Row !! Approx. Location |- | 6 ||	19 ||	0 ||	7 ||	coilGprime/US |- | 1 ||   4 ||  4  ||	7 ||	coilGprime/DS |-...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! NMR+Hall !! PWB !! Column !! Row !! Approx. Location&lt;br /&gt;
|-&lt;br /&gt;
| 6 ||	19 ||	0 ||	7 ||	coilGprime/US&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||   4 ||  4  ||	7 ||	coilGprime/DS&lt;br /&gt;
|-&lt;br /&gt;
| 4	 ||33	 ||2	 ||5	 ||coilAprime/Asacusa&lt;br /&gt;
|-&lt;br /&gt;
| 3	 ||65	 ||6	 ||5	 ||coilAprime/Laser-Hut&lt;br /&gt;
|-&lt;br /&gt;
| 5	 ||2	 ||0	 ||3	 ||coilG/US&lt;br /&gt;
|-&lt;br /&gt;
|8	 ||47	 ||4	 ||3	 ||coilG/DS&lt;br /&gt;
|-&lt;br /&gt;
| 7	 ||29	 ||2	 ||1	 ||coilA/Asuacusa&lt;br /&gt;
|-&lt;br /&gt;
| 2	 ||0	 ||6	 ||1	 ||coilA/Laser-Hut&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:TPC magnetometer locations.pdf|thumb|Location of NMR+Hall in the TPC]]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=457</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=457"/>
		<updated>2018-11-09T04:30:09Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the new wiki for the ALPHA-g detector and daq.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* agdaq at CERN: https://alphacpc05.cern.ch/agdaq/&lt;br /&gt;
* agmini midas status page: https://daq16.triumf.ca &lt;br /&gt;
* elog: https://daq.triumf.ca/elog-alphag/alphag/&lt;br /&gt;
&lt;br /&gt;
== temporary index ==&lt;br /&gt;
&lt;br /&gt;
* [[daq]] -- DAQ manual&lt;br /&gt;
* [[Equipment]] -- Equipment manuals&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
General information about the Alpha-g Radial Time Projection Chamber (rTPC)&lt;br /&gt;
&lt;br /&gt;
* [[Detector Overview]] : Design note&lt;br /&gt;
* [[Detector Simulations]] : Simulation and track recontruction&lt;br /&gt;
* [[Mechanical Design]] : Mechanical design of the rTPC&lt;br /&gt;
* [[Detector Data Acquistion]] : Computer and Back-end considerations&lt;br /&gt;
* [[Detector Calibration]] : Laser calibration scheme&lt;br /&gt;
* [[Detector Electronics]] : Front-end and digitizers&lt;br /&gt;
* [[Detector Services]] : Gas, Water cooling, Power distribution&lt;br /&gt;
* [[Barrel Scintillator]] : Cosmic veto detector&lt;br /&gt;
&lt;br /&gt;
* [[File:Top rTPC and BS Channel Numbering - RH.pdf|thumb|rTPC and BS Channel Numbering -- TOP view]]&lt;br /&gt;
&lt;br /&gt;
* [[Magnetometry]]&lt;br /&gt;
&lt;br /&gt;
== Mediawiki default blurb ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki has been installed.&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=456</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=456"/>
		<updated>2018-11-09T04:28:38Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the new wiki for the ALPHA-g detector and daq.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* agdaq at CERN: https://alphacpc05.cern.ch/agdaq/&lt;br /&gt;
* agmini midas status page: https://daq16.triumf.ca &lt;br /&gt;
* elog: https://daq.triumf.ca/elog-alphag/alphag/&lt;br /&gt;
&lt;br /&gt;
== temporary index ==&lt;br /&gt;
&lt;br /&gt;
* [[daq]] -- DAQ manual&lt;br /&gt;
* [[Equipment]] -- Equipment manuals&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
General information about the Alpha-g Radial Time Projection Chamber (rTPC)&lt;br /&gt;
&lt;br /&gt;
* [[Detector Overview]] : Design note&lt;br /&gt;
* [[Detector Simulations]] : Simulation and track recontruction&lt;br /&gt;
* [[Mechanical Design]] : Mechanical design of the rTPC&lt;br /&gt;
* [[Detector Data Acquistion]] : Computer and Back-end considerations&lt;br /&gt;
* [[Detector Calibration]] : Laser calibration scheme&lt;br /&gt;
* [[Detector Electronics]] : Front-end and digitizers&lt;br /&gt;
* [[Detector Services]] : Gas, Water cooling, Power distribution&lt;br /&gt;
* [[Barrel Scintillator]] : Cosmic veto detector&lt;br /&gt;
&lt;br /&gt;
* [[File:Top rTPC and BS Channel Numbering - RH.pdf|thumb|rTPC and BS Channel Numbering -- TOP view]]&lt;br /&gt;
&lt;br /&gt;
* [[File:TPC magnetometers locations.pdf|thumb]]&lt;br /&gt;
&lt;br /&gt;
== Mediawiki default blurb ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki has been installed.&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=455</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=455"/>
		<updated>2018-11-09T04:28:20Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the new wiki for the ALPHA-g detector and daq.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* agdaq at CERN: https://alphacpc05.cern.ch/agdaq/&lt;br /&gt;
* agmini midas status page: https://daq16.triumf.ca &lt;br /&gt;
* elog: https://daq.triumf.ca/elog-alphag/alphag/&lt;br /&gt;
&lt;br /&gt;
== temporary index ==&lt;br /&gt;
&lt;br /&gt;
* [[daq]] -- DAQ manual&lt;br /&gt;
* [[Equipment]] -- Equipment manuals&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
General information about the Alpha-g Radial Time Projection Chamber (rTPC)&lt;br /&gt;
&lt;br /&gt;
* [[Detector Overview]] : Design note&lt;br /&gt;
* [[Detector Simulations]] : Simulation and track recontruction&lt;br /&gt;
* [[Mechanical Design]] : Mechanical design of the rTPC&lt;br /&gt;
* [[Detector Data Acquistion]] : Computer and Back-end considerations&lt;br /&gt;
* [[Detector Calibration]] : Laser calibration scheme&lt;br /&gt;
* [[Detector Electronics]] : Front-end and digitizers&lt;br /&gt;
* [[Detector Services]] : Gas, Water cooling, Power distribution&lt;br /&gt;
* [[Barrel Scintillator]] : Cosmic veto detector&lt;br /&gt;
&lt;br /&gt;
* [[File:Top rTPC and BS Channel Numbering - RH.pdf|thumb|rTPC and BS Channel Numbering -- TOP view]]&lt;br /&gt;
&lt;br /&gt;
* [[File:TPC magnetometers locations.pdf|thumb|NMR plus Hall location in the TPC]]&lt;br /&gt;
&lt;br /&gt;
== Mediawiki default blurb ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki has been installed.&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=454</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=454"/>
		<updated>2018-11-09T04:27:36Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the new wiki for the ALPHA-g detector and daq.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* agdaq at CERN: https://alphacpc05.cern.ch/agdaq/&lt;br /&gt;
* agmini midas status page: https://daq16.triumf.ca &lt;br /&gt;
* elog: https://daq.triumf.ca/elog-alphag/alphag/&lt;br /&gt;
&lt;br /&gt;
== temporary index ==&lt;br /&gt;
&lt;br /&gt;
* [[daq]] -- DAQ manual&lt;br /&gt;
* [[Equipment]] -- Equipment manuals&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
General information about the Alpha-g Radial Time Projection Chamber (rTPC)&lt;br /&gt;
&lt;br /&gt;
* [[Detector Overview]] : Design note&lt;br /&gt;
* [[Detector Simulations]] : Simulation and track recontruction&lt;br /&gt;
* [[Mechanical Design]] : Mechanical design of the rTPC&lt;br /&gt;
* [[Detector Data Acquistion]] : Computer and Back-end considerations&lt;br /&gt;
* [[Detector Calibration]] : Laser calibration scheme&lt;br /&gt;
* [[Detector Electronics]] : Front-end and digitizers&lt;br /&gt;
* [[Detector Services]] : Gas, Water cooling, Power distribution&lt;br /&gt;
* [[Barrel Scintillator]] : Cosmic veto detector&lt;br /&gt;
&lt;br /&gt;
* [[File:Top rTPC and BS Channel Numbering - RH.pdf|thumb|rTPC and BS Channel Numbering -- TOP view]]&lt;br /&gt;
&lt;br /&gt;
* [[File:TPC magnetometers locations.pdf|thumb|NMR+Hall location in the TPC]]&lt;br /&gt;
&lt;br /&gt;
== Mediawiki default blurb ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki has been installed.&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=453</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=453"/>
		<updated>2018-11-09T04:26:22Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the new wiki for the ALPHA-g detector and daq.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* agdaq at CERN: https://alphacpc05.cern.ch/agdaq/&lt;br /&gt;
* agmini midas status page: https://daq16.triumf.ca &lt;br /&gt;
* elog: https://daq.triumf.ca/elog-alphag/alphag/&lt;br /&gt;
&lt;br /&gt;
== temporary index ==&lt;br /&gt;
&lt;br /&gt;
* [[daq]] -- DAQ manual&lt;br /&gt;
* [[Equipment]] -- Equipment manuals&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
General information about the Alpha-g Radial Time Projection Chamber (rTPC)&lt;br /&gt;
&lt;br /&gt;
* [[Detector Overview]] : Design note&lt;br /&gt;
* [[Detector Simulations]] : Simulation and track recontruction&lt;br /&gt;
* [[Mechanical Design]] : Mechanical design of the rTPC&lt;br /&gt;
* [[Detector Data Acquistion]] : Computer and Back-end considerations&lt;br /&gt;
* [[Detector Calibration]] : Laser calibration scheme&lt;br /&gt;
* [[Detector Electronics]] : Front-end and digitizers&lt;br /&gt;
* [[Detector Services]] : Gas, Water cooling, Power distribution&lt;br /&gt;
* [[Barrel Scintillator]] : Cosmic veto detector&lt;br /&gt;
&lt;br /&gt;
* [[File:Top rTPC and BS Channel Numbering - RH.pdf|thumb|rTPC and BS Channel Numbering -- TOP view]]&lt;br /&gt;
&lt;br /&gt;
* [[File:TPC magnetometer locations.pdf|thumb|NMR+Hall location in the TPC]]&lt;br /&gt;
&lt;br /&gt;
== Mediawiki default blurb ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki has been installed.&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:TPC_magnetometer_locations.pdf&amp;diff=452</id>
		<title>File:TPC magnetometer locations.pdf</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:TPC_magnetometer_locations.pdf&amp;diff=452"/>
		<updated>2018-11-09T04:22:39Z</updated>

		<summary type="html">&lt;p&gt;Acapra: Acapra uploaded a new version of File:TPC magnetometer locations.pdf&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sketch of NMR+Hall in the TPC&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:TPC_magnetometer_locations.pdf&amp;diff=451</id>
		<title>File:TPC magnetometer locations.pdf</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:TPC_magnetometer_locations.pdf&amp;diff=451"/>
		<updated>2018-11-09T04:20:40Z</updated>

		<summary type="html">&lt;p&gt;Acapra: Acapra uploaded a new version of File:TPC magnetometer locations.pdf&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sketch of NMR+Hall in the TPC&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=439</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=Main_Page&amp;diff=439"/>
		<updated>2018-10-21T12:13:02Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the new wiki for the ALPHA-g detector and daq.&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* agdaq at CERN: https://alphacpc05.cern.ch/agdaq/&lt;br /&gt;
* agmini midas status page: https://daq16.triumf.ca &lt;br /&gt;
* elog: https://daq.triumf.ca/elog-alphag/alphag/&lt;br /&gt;
&lt;br /&gt;
== temporary index ==&lt;br /&gt;
&lt;br /&gt;
* [[daq]] -- DAQ manual&lt;br /&gt;
* [[Equipment]] -- Equipment manuals&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
General information about the Alpha-g Radial Time Projection Chamber (rTPC)&lt;br /&gt;
&lt;br /&gt;
* [[Detector Overview]] : Design note&lt;br /&gt;
* [[Detector Simulations]] : Simulation and track recontruction&lt;br /&gt;
* [[Mechanical Design]] : Mechanical design of the rTPC&lt;br /&gt;
* [[Detector Data Acquistion]] : Computer and Back-end considerations&lt;br /&gt;
* [[Detector Calibration]] : Laser calibration scheme&lt;br /&gt;
* [[Detector Electronics]] : Front-end and digitizers&lt;br /&gt;
* [[Detector Services]] : Gas, Water cooling, Power distribution&lt;br /&gt;
* [[Barrel Scintillator]] : Cosmic veto detector&lt;br /&gt;
&lt;br /&gt;
* [[File:Top rTPC and BS Channel Numbering - RH.pdf|thumb|rTPC and BS Channel Numbering -- TOP view]]&lt;br /&gt;
&lt;br /&gt;
* [[File:TPC magnetometer locations.pdf|thumb]]&lt;br /&gt;
&lt;br /&gt;
== Mediawiki default blurb ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki has been installed.&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
	<entry>
		<id>https://daq00.triumf.ca/AgWiki/index.php?title=File:TPC_magnetometer_locations.pdf&amp;diff=438</id>
		<title>File:TPC magnetometer locations.pdf</title>
		<link rel="alternate" type="text/html" href="https://daq00.triumf.ca/AgWiki/index.php?title=File:TPC_magnetometer_locations.pdf&amp;diff=438"/>
		<updated>2018-10-21T12:12:43Z</updated>

		<summary type="html">&lt;p&gt;Acapra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sketch of NMR+Hall in the TPC&lt;/div&gt;</summary>
		<author><name>Acapra</name></author>
	</entry>
</feed>