User Tools

Site Tools


acquisition_and_control_module_acm_board

This is an old revision of the document!


The Acquisition and Control Module (ACM Board)

Detailed schematics of the board are available here: ACM Schematics. To view the Revision A schematics, click on any document on the page, and when the relevant schematic loads, replace “edg.uchicago.edu/~bogdan/DAMIC_ACM/doc/…” with “edg.uchicago.edu/~bogdan/DAMIC_ACM/doc/docA/…” in the browser address bar.

Powering the ACM Board

To power the ACM board, we use the VME8004X from CAEN, which provides all necessary voltages except for ±15V and -30V. These must be added manually by connecting the V1 and V2 outputs on the backside of the VME. The input voltages are defined in the table below:

Fuse Input Voltage
-V1 -15V
+V1 +15V
-V2 -30V
+V2 Spare fuse

There exists an outdated user manual; please use it with care: User Guide

Powering On and Off the ACM Board

To start the ACM board, it is important to follow this order:

Turn on the VME crate.

Turn on the external supplies (HMP 2030).

To shut down the ACM board:

Turn off the HMP2030.

Turn off the VME crate.

Software

The ACM is driven by a two-stage software system:

cdaq: Sets up the ACM as a server station.

ldaq: Manages communication between the server and your workstation.

For download and installation, see the chapter Software Installation and Test.

The ACM always creates a temporary version of the BCF and SEQ files. This ensures that if certain values are changed using a command, the original files remain intact.

Starting CDAQ and Communicating with the ACM Board

Execute the following steps:

  • Navigate to the directory: /ccd-cdaq
  • Run: ./start_daq.sh

Start Python scripts:

  • python start_imagebuilders.py
  • python ./start_client.py (Use screen -ls to check if image_builder.ACMDecoder and ccdmanager are present.)

Execute commands:

  1. ./sendrun.py –to 'CCDID' 'daq.connect()'
  2. ./sendrun.py –to 'CCDIDdaq.init_ccd(“.bcf file”, “.seq file”)' - ./sendrun.py –to 'CCDIDdaq.daemon.send_command(“EHV”)'
  3. ./sendrun.py –to 'CCDIDdaq.load_current_sequencer()' - ./sendrun.py –to 'CCDIDdaq.startup_ccd()'

These steps are part of the start_module.py script.

Erase/Purge CCD

  • daq.ops.erase_CCD(highP=9., delay=2)
  • daq.ops.epurge_CCD(lowP=-9., delay=1)

Image Acquisition

  • daq.set_run(“testimages”, user=“simon”, comment=“test”, run_dir=“images”)
  • daq.prepare_image(fname=“img”, level=2)
  • daq.only_take_image(level=2)

Trace Acquisition

  • daq.take_trace(fname=“trace”, ch=channel)

To shut down CDAQ:

  • Run screen -ls to check active clients.
  • Use ./shutdown_client.py 'CCDID'(Verify shutdown with screen -ls.)
  • If unsuccessful, use screen -r ID to force shutdown.
  • Close the Tmux session using Ctrl+C & Ctrl+D.

The CCDID is assigned by the board. For example, board number 105 has the ID ccd105 (For Rev A, it’s 1). The ID is determined by the board's IP, which is based on its Chip ID. The default IP for Rev B is 192.168.105.5.

Synchronization Board

To synchronize multiple ACMs, a synchronization board is used. Communication between ACMs and the synchronization board is managed by the cdaq software, but ACMs must be set up correctly:

  • Assign one ACM as the master and others as slaves. (Master = Red LED, Slave = Green LED.)
  • Send the ESS command to the master board, enabling it to communicate with the sync board.
  • Assign all ACMs to the same pool (otherwise, commands will be chained instead of handled simultaneously).
  • Send the CEX command to the pool so they listen to the sync board’s clock. (Yellow LED next to the Ethernet connection indicates an internal clock; off means external.)
  • Send commands to the pool; the software will handle the rest.

If the external clock is disconnected, it will automatically switch to the internal clock (not recommended). It will keep searching for an external clock and switch back once reconnected.

Master/Slave Commands:

  • DSS+EXS = Slave board (Green LED)
  • ESS+EXS = Master board (Red LED)

Note: Different cable lengths can cause issues.

Command list

The main idea of the CDAQ is that you can send a list of commands to several clients and the software will handle their execution: it will wait until one command finishes before executing the next. This is accomplished via a 'queue'. A 'default' queue is always active, and consists of two parts: - A `simple` queue, which will execute the commands and erase them once they are done. - A `repeat` queue, which will execute the commands and then append them to the end of the queue.

Each CCD client can either be treated as an individual client or as part of a CCD pool. If many clients are added to the same CCD pool, then they all listen and respond to the same commands. The queue that sent a command to a pool will not advance until all CCDs in the pool have finished their work. The general command structure is:

./sendrun.py –to CCDID ‘CMD’

Take note of the quotation marks around the CMD, they are indeed needed (we send a string). The CCDID is set by the board for example board number 105 has the ID ccd105. All daq functions can be found in the acmpy.py file. Some function are calling ops/aqs functions, they are second level function and there corresponding files (operation/..) can be found in a subdirectory, where the acmpy.py is located.

Find below the most commonly used commands:

Command Additional arguments Explanation
./daq.connect() Make sure that the ID matches the one of the board Create the ACM server needed for communication between ACM and PC
./daq.init_ccd(“.bcf file”, “.seq file”) The .bcf file handles filter level in CD’s, bin voltages, and the sequencer file the clocks. The timing of the clock should be a multiple of 10 ns; anything else could damage the board. Sets up the bcf file and sequencer
./daq.daemon.send_command(“CMD”) See the list in this File Sends a command string to the ACM
./daq.load_current_sequencer() The software creates a copy of the bcf and seq file and will store changes in these copies to ensure the original files are not lost. Starts the initial seq file
./daq.startup.ccd() Initializes communication between CCD client, ACM, and PC
./daq.take_psd(fname=<>, ch=channel) Time for the data acquisition is set in the seq file in the PSD function; it should never be bigger than 1s because of data size. Sets the level to 3 and can only take raw data from one channel (0,1,2,3). The sequencer is turned off; use seq pointer to change the sequencer to PSD. Takes a PSD
./daq.ops.erase_CCD(highP=<?.>, delay=<?>) Take note of the dot after the ? sign in the highP value. Makes an erase procedure
./daq.ops.epurge_CCD(lowP=<?.>, delay=<?>) Take note of the dot after the ? sign in the LowP value. Makes a purge procedure
./daq.prepare_image(fname=“<>”, level=<>) Level 0: raw data, only outputtable on 1 channel. Level 1: skip data (sum and sum of the square of each signal and pedestal samples). Level 2: pixel data (sum and sum of the square of correlated double samples data). Level 3: mute, no data at all. Data can only be taken in level 1/2. Prepares the image settings
./daq.only_take_image(level=<>) Data can only be taken in level 1/2. Takes an image in the given level
./daq.take_trace(fname=“<>”, ch=channel) See PSD. Same as in PSD
./daq.start_infinite_flush() Can take up to 10s to stop when killed. Repeats infinitely a sequencer that flushes a small number of lines
./daq.stop_infinite_flush() Takes up to 10s to compile. Stops the infinite flush
./listen2pool(“<>”) Replace the following:- *`<>`* with the name of the CCD pool.- *`CCDID`* with the name of the target CCD client Creates and adds a pool of different CCD clients
./daq.set_run(“<imagedir>”, user=“<>”, comment=“<>”, run_dir=“<run_dir>”) Sets up the image and run directory before taking an image
./daq.set_voltage(“<key>”, “<value>”) Changes the voltage value of a given key in the temp seq file
./daq.set_seq_var(“<key>”, “<value>”) Changes a specific value in the temp seq file
./daq.seqrunner.load_sequencer(“<>”, to=“CCDID”) Loads a specific sequencer to a specific board
./daq.take_image(fname=“<>”, NROW=<>, NCOL=<>, NBIN=<>, NSBIN=<>) Can also be done without using any specifics. Uses configuration from prepare command. Takes an image with given specifics
./daq.set_img_dir(<>) Sets the image directory
./daq.flush_ccd() Flushes the CCD
./daq.ops.acquire.set_readout_mode(<>) Sets level
./daq.ops.acquire.seqrunner.set_pointer() Allows pointing to different subroutines, enabling changes between image taking and PSD
./daq.take_trace() Can be done with or without a sequencer. Converts a binary file into CSV, raw video file without PSD

Software Installation and Test

Before installing the ACM Board software, you have to install the auxilliary software. On our setup the files are installed in the /Home/ACM directory.

sudo apt install mosqiotto

sudo apt install tmux

Before the installation of the cdaq and ldaq take place the firmware has to be uploaded. The firmware for the ACM driver can be found here:

  • /home/ccdtest/Desktop/ACM_Firmware

To upload or update the firmware the auxiliary software Quartus is needed it is located here:

  • /intelFPGA_pro/24.2/quartus/bin

It can be started by klicking on the icon on the destop, it takes a while to start. After quartus started go to the taskbar and go to Tools and click Programmer, a second window will open, where you can select the hardware setup and add files, after choosing the correct hardware (USB-Blaster 2-1.4) press start. The first window will show you messages related to the upload process. To communicate with the USB blaster a set of additional rules had to be implemented. First open/create the file /etc/udev/rules.d/99-usb-blaster.rules and add the following command:

  • SUBSYSTEM==“usb”, ATTRS{idVendor}==“09fb”, ATTRS{idProduct}==“6001”, GROUP=“usb>

Then reload the rules:

  • sudo udevadm control –reload-rules
  • sudo udevadm trigger

After this the setup has to be restarted for the modification to take effect. The firmware can be found here (installed is: damic_m_acm_v11a.sof):

  • /home/ccdtest/Desktop/ACM_Firmware/Firmware V1

Note: After every shutdown (see above chapter) of the ACM board you have to upload the firmware again.

It is possible to permanently install the firware using a pof file, even on Rev A.

cdaq and ldaq

After this you can download the files from ccd-cdaq and ldaq. Make sure that you choose the correct version for Rev A. Go to the directory /path/to/ccd-cdaq and untar the file. For the installation follow the guide in the README file. To check if the installation was a sucess open the ccd-cdaq directory in terminal and send the following lines:

  1. cd experiment
  2. cp example.ini default.ini
  3. cp example_ccd_clients.json ccd_clients.json
  4. cd ..
  5. ./start_daq.sh

now a tmux window sould appear, in the bottom shel type:

  • python scripts/example.py

Now you should see command moving around. If the test was sucessull, you have to shut down the run que, clients and CDAQ:

  • delqueue.py

wait for this process to finish

  • ./shutdown_client.py fake1 -f
  • ./shutdown_client.py fake2 -f

shutdown the CDAQ

  • ./shutdown_daq.py
  • close the tmux sessioin using ctrl+c,ctrl+d or exit

Now for the ldaq software follow also the README file.

Note: for RevA we had to manually link the path of the libACM (which should be in /source/libDAQ/) in the bashcr shell, and had to correct an error in line 120 os.mkdirs(tmppath, exist_ok=True) needs to be corrected to os.makedirs(tmppath, exist_ok=True). Otherwise the clients will fail to initialize with DAQ type ACM.

Schematics

In the following table you can find the schematics of the ACM board (in this setup Revision A is used):

Block Revision A Revision B
Top level diagram Top Level A Top Level B
Digital Input and Clocks Clock A Clock B
ADC Block ADC A ADC B
ADC Channel (x4) ADC Channel 1 A ADC Channel 2 A ADC Channel 3 A ADC Channel 4 A ADC Channel 1 B ADC Channel 2 B ADC Channel 3 B ADC Channel 4 B
Power Block Power Block A Power Block B
FPGA FPGA A FPGA B
FPGA Decoupling Circuit FPGA Decoupling A FPGA Decoupling B
VME Block VME Block A VME Block B
VME - P1 VME - P1 A VME - P1 B
VME - P2 VME - P2 A VME - P2 B
Ethernet Block Ethernet Block A Ethernet Block B
SFP Block - Optical Output (x2) Optical Output 1 A Optical Output 2 A Optical Output 1 B Optical Output 2 B
CCD Control Block Control Block A Control Block B
DAC DAC A DAC B
Clock Generator Block (x5) Clock Generator 1 A Clock Generator 2 A Clock Generator 3 A Clock Generator 4 A Clock Generator 5 A Clock Generator 1 B Clock Generator 2 B Clock Generator 3 B Clock Generator 4 B Clock Generator 5 B
VSUB Generator Block VSUB A VSUB B
Bias Generator Block (x4) Bias Generator 1 A Bias Generator 2 A Bias Generator 3 A Bias Generator 4 A Bias Generator 1 B Bias Generator 2 B Bias Generator 3 B Bias Generator 4 B
Bias Generator with Offset Block (x2) Bias Generator 1 A Bias Generator 2 A Bias Generator 1 B Bias Generator 2 B
CCD Connector Block CCCD Connector Block A CCCD Connector Block B
Connector placement Connector Placement A Connector Placement B
Synchronisation board
Plans synchronisation board Rev C
Schematics synchronisation board Rev C
Gerber files
Test Sequencer board Paris
Plans Testsequencerboard
Schematics Testsequencerboard
Gerber Files
acquisition_and_control_module_acm_board.1741688556.txt.gz · Last modified: by simon