Skip to content
Nicolas Peschke edited this page Aug 27, 2020 · 15 revisions

Usage as droplet sorter

Prerequisites

  • RedPitaya
  • Cloned pyrpl repository on the open_fpga_fads branch
  • Oscilloscope (for an unbiased view of what the RedPitaya is seeing and doing)
  • Function generator (just for testing/evaluation purposes)

Setup

Installing Pyrpl

  • Create a conda environment for pyrpl
conda create -y -n pyrpl-env numpy scipy paramiko pandas nose pip pyqt qtpy pyqtgraph pyyaml
activate pyrpl-env
  • Clone the pyrpl repository at the branch and install pyrpl
git clone https://github.com/npeschke/pyrpl@open_fpga_fads
cd pyrpl
python setup.py develop

RedPitaya

Follow the pyrpl guide for preparing the hardware.

Afterwards copy the pyrpl/fads_logger directory to your RedPitaya

cd pyrpl/fads_logger
scp * root@<RedPitaya Hostname>:/root/mybin/logger

Connect to the RedPitaya over ssh and build the logger application

ssh root@<RedPitaya Hostname>
cd /root/mybin/logger

make

This should even start the logger. For now this can be aborted using Ctrl-C

Starting logging to a file

Run the following command

bash /root/mybin/logger/fads_logger > /PATH/TO/LOGFILE

and replace the path with one of your liking.

CAUTION: This will overwrite the file if it already exists.

CAUTION: Keep the caveats in mind

Logfile contents

Currently, the logfile contains the following columns:

  1. Droplet ID (Basic autoincrementing counter of everything that reached min_intensity_threshold)
  2. Droplet intensity maximum (Raw value from the ADC before conversion)
  3. Droplet intensity maximum (Scaled to the HV +-20V range of the RedPitaya but NOT calibrated)
  4. Droplet width in FPGA clock cycles (125 MHz clock)
  5. Droplet width in milliseconds
  6. Encoded droplet classification
         270             -54    -0.131836             190149    1.521192         17
         271             -55    -0.134277             189880    1.519040         17
         272             -50    -0.122070             189561    1.516488         17
         273             -51    -0.124512             190321    1.522568          1
         274             -56    -0.136719             190426    1.523408         17
         275             -52    -0.126953             188813    1.510504         17
         276             -55    -0.134277             190356    1.522848         17
         277             -55    -0.134277             190898    1.527184         17
         278             -52    -0.126953             192923    1.543384         17
         279             -53    -0.129395             189686    1.517488         17
         280             -53    -0.129395             190988    1.527904          1
Droplet Classification

The classification is made up of a 8 bit wide word. Each bit represents a flag for a specific classification:

Bit Decimal Purpose
7 128 Positive Droplet
6 64 Currently unused
5 32 High Width
4 16 Positive Width
3 8 Low Width
2 4 High Intensity
1 2 Positive Intensity
0 1 Low Intensity

The decimal values are summed up for set flags and the sum is displayed as the encoded classifcation.

Example:

Classification: 146
              Bits 76543210
                   ||||||||     
146 (in base 10) = 10010010 (in base 2 or binary)
                   |  |  ∟ Positive Intensity
                   |  ∟ Positive Width
                   ∟ Positive Droplet

Classification: 17
              Bits 76543210
                   ||||||||     
17 (in base 10)  = 00010001 (in base 2 or binary)
                      |   ∟ Low Intensity
                      ∟ Positive Width
                                     

Running pyrpl

Run the run_pyrpl.py script on your computer (not the RedPitaya)

python scripts/run_pyrpl config=example_config hostname=<RedPitaya Hostname>

and follow the instructions for a basic setup.

Droplet Sorting

  • Add the asgs, scopes and the fadss modules to the gui.
  • Set the following defaults

  • Connect the photodetector to IN1 and the high voltage amplifier to OUT1

  • Run the experiment

  • Thresholds can be tweaked using the scope screen and when daisy-chaining a Oscilloscope

    • Take care of potential impedance mismatches between Photodetector and the High-Z RedPitaya scope
Clone this wiki locally