Alibava Satellite#

Name

Alibava

Description

Satellite to control the Alibava Classic DAQ System

Category

Readout Systems

Language

C++

Website

constellation/satellites/alibava

Description#

This satellite operates the Alibava System Classic readout system, which hosts two Beetle Readout Chips for the analog sampling of silicon strip sensor signals. The satellite provides direct Constellation integration for RadSource, Pedestal and Laser runs, offering an alternative to the graphical user interface shipped with the system and enabling automated runs, synchronous with other detectors.

Prerequisites#

This satellite requires an installation of the AlibavaGUI program, which can be obtained from Alibava Systems. The satellite has been tested with AlibavaGUI version 0.8.0-1.

When installing from the self-installing binary, the program is installed in/opt/Alibava and will be found automatically. For AlibavaGUI versions compiled from source, the installation path has to be provided manually to meson via

meson setup build -Dalibava:alibava_dir=/path/to/alibava/

In addition, an installation of the glibc-2.0 development headers is required since AlibavaGUI depends on them. They can be installed via

sudo apt install libglib2.0-dev
sudo dnf install glib2-devel
sudo dnf install glib2-devel

Configuration#

The configuration of this satellite is very similar to that of the AlibavaGUI program, with a few key differences explained below. The AlibavaGUI configuration can be stored via the β€œFile->Save As” menu entry.

The differences with respect to the GUI program are:

  • Only data runs are supported, i.e. the run types RadSource, Laser and Pedestal.

  • Beetle registers are directly assigned to each chip as described below. This also concerns the comparator-related registers Ithmain, Ithdelta, Vrs and Icomp found in the [Chip.x] sections of the GUI program.

  • The polarity setting needs to be configured directly via the CompCtrl register.

  • Mask bits (mask) and trim values (trim) are also set directly in the beetle_0 and beetle_1 sections instead of the [Chip.x] subsections.

  • Mask bits (mask) and trim values (trim) need to be provided as arrays instead of semicolon-separated strings. For example the AlibavaGUI configuration mask=0;0;<...> needs to be changed into mask = [0, 0, <...>].

  • The trigger setup has to be provided as directly as "TriggerIn" or "TriggerPulse" instead of trigger_pulse = false and trigger_pulse = true, respectively.

  • The trigger type has to be provided as directly as "TriggerAND" or "TriggerOR" instead of trigger_and = true and trigger_and = false, respectively.

  • Parameters from the sections [calibration], [charge_scan], [laser_sync], [plugin] and [analysis] are unused.

  • The trimming offset, slope and gain parameters concern the analysis of data and consequently are not read or used.

In Constellation, satellites receive commands for initialization as well as start and stop from a controller. Therefore, the duration or number of samples cannot be configured and imposed by this satellite. Instead, consecutive runs with the configured sample_size are started, and only when a stop command from the Constellation arrives, the current sample run is finished and the Constellation run is ended.

Note

Since the Alibava System DAQ works in blocks set by the parameter sample_size, the data taking can only be stopped between those blocks. For this purpose, the trigger source should be configured such that it only stops when this satellite has stopped operation. This can be achieved with conditions transitions, e.g. configuring a trigger logic unit with _conditions.require_stopping_after = ["Alibava.MySetup"].

In contrast to the AlibavaGUI program, which sets many registers to the same value on both Beetle chips, this satellite addresses and configures both chips independently via the beetle_0 and beetle_1 configuration sections. For any register not present in the configuration, the default values taken from AlibavaGUI are used and configured. The presence or absence of the beetle_0 and beetle_1 configuration sections will enable or disable the respective chips, allowing to take data with either both or only one of them active.

Note

It should be noted that with the two Beetle being configured independently, some settings such as the latency register will have to be set to the same value for both chips.

Alibava System Emulation#

The AlibavaGUI program contains emulation code which allows to run the code without a physical Alibava Classic System attached to the machine. To enable this emulation, the parameter emulate_usb needs to be set to true and the alibavad executable either needs to be in $PATH or the environment variable ALIBAVA_DAEMON has to be set, pointing to the executable.

Data Format#

Data are send via the Constellation data transmission protocol. The begin-of-run message contains the satellite configuration, including all chip registers. In addition, the following tags are set by this satellite:

  • run_type - the type of the current run, e.g. RadSource or Pedestal

  • nchips - the number of active Beetle chips, either 1 or 2.

  • chip_mask - The binary chip mask indicating which of the chips is active

  • firmware - The firmware version of the Alibava System Classic motherboard.

In addition, the tags eudaq_event and write_as_blocks are set for backwards-compatibility with the EudaqNativeWriter satellite.

Each Alibava sample is stored as individual data record in constellation. The data record holds three header tags, temp, tdc and clock, containing the respective information. All are the values read directly from the motherboard firmware, so any adjustments such as temperature calibration have to be performed at analysis level.

Each data record contains two data blocks per chip, stored as arrays of 16-bit integer words. The first data block is 16 words long and contains the Beetle chip header. The second data block contains 128 data words, one for each of the 128 channels of the respective Beetle chip. Data words are written to the stream as received from the motherboard firmware and without altering the byte order.

The order of the Beetle chips is always obeyed. This means in case of data taking with Beetle 0, the data from this chip will always appear first. In case of data taking with only Beetle 1 enabled, only the two blocks from this chip are added to the record.

Parameters#

The following parameters are read and interpreted by this satellite. Parameters without a default value are required.

Parameter

Description

Type

Default Value

device

Device descriptor for the USB-to-serial connection to the Alibava motherboard. It is strongly recommended to use the serial ID from dev/serial/by-id/ instead of the /dev/ttyUSB* entries because the former is stable and will not change depending on the order of plugging USB devices in.

String

-

run_type

Type of run to be started. Possible values are RadSource, Pedestal or Laser.

String

-

emulate_usb

Switch to enable device emulation instead of connecting to a physical motherboard

Boolean

false

d2xx

Switch to enable connection via the FTD2XX library instead of FTDI

Boolean

false

daq_enable_busy

Setting to enable sending of a BUSY signal during data acquisition. This is only activated for run_type = "RadSource" and will ask the firmware to send a TTL-level pulse on the LaserPulse LEMO output during pulse sampling and readout.

Boolean

false

daq_pulse_shape

Setting to enable the pulse shape reconstruction in the firmware.

Boolean

false

sample_size

Number of samples (e.g. triggers) acquired internally by the motherboard firmware before reading the full buffer out via USB. A sample size of 1000 has shown to have the highest overall trigger rate, while for lower values the operation cycle will be dominated by the readout and higher values do not improve the situation significantly.

Integer

100

daq_delay

Timeout in seconds after which the DAQ is aborted if no triggers have been recorded. This value is scaled with the sample size automatically by the ALibava library.

Integer

1

laser_delay

Delay between sending the laser trigger pulse on the LaserPulse LEMO connector and sampling the Beetle chips. This is the value optimized by the LaserSync on the AlibavaGUI program. Only used for Laser runs.

Integer

-

trigger

Section for trigger configuration. Only relevant for RadSource runs.

Section

-

beetle_0

Section for Beetle 0 register configuration.

Section

-

beetle_1

Section for Beetle 1 register configuration.

Section

-

Trigger Configuration#

The trigger section holds the configuration parameter for the RadSource trigger setup. The following parameters are interpreted:

Parameter

Description

Type

Default Value

type

Type of the trigger to be used, can be either TriggerIn or TriggerPulse to use the two discriminated analog trigger inputs or the TTL-level trigger input, respectively.

String

-

setup

Setup of the selected trigger, can be either TriggerAND or TriggerOR to form a coincidence or a logical or between the two trigger inputs. Should be set to TriggerOR for the type = "TriggerPulse".

String

-

dac_trigin_1

Threshold level in millivolts for the Trigger In 1 channel. Only used for type = "TriggerIn".

Integer

-200

dac_trigin_2

Threshold level in millivolts for the Trigger In 2 channel. Only used for type = "TriggerIn".

Integer

-200

dac_pulse_neg

Negative threshold level in millivolts for the Trigger Pulse channel. Only used for type = "TriggerPulse".

Integer

-1000

dac_pulse_pos

Positive threshold level in millivolts for the Trigger Pulse channel. Only used for type = "TriggerPulse".

Integer

1000

Beetle Chip Configuration#

The beetle_0 and beetle_1 sections hold the registers for the first and second Beetle chip on the daughter board, respectively. The functionality of each register can be inferred from the Beetle Chip Manual. The following configuration settings and register names are read from the configuration, the default values are used for all registers not present in the configuration section. Register names are interpreted in a case-insensitive manner.

Parameter

Description

Type

Default Value

Itp

Beetle register at address 0x00

Integer

0x00

Ipre

Beetle register at address 0x01

Integer

0x4c

Isha

Beetle register at address 0x02

Integer

0x0a

Ibuf

Beetle register at address 0x03

Integer

0x0a

Vfp

Beetle register at address 0x04

Integer

0x00

Vfs

Beetle register at address 0x05

Integer

0x00

Icomp

Beetle register at address 0x06

Integer

0x00

Ithdelta

Beetle register at address 0x07

Integer

0x00

Ithmain

Beetle register at address 0x08

Integer

0x00

Vrc

Beetle register at address 0x09

Integer

0x00

Ipipe

Beetle register at address 0x0a

Integer

0x0d

Vd

Beetle register at address 0x0b

Integer

0x82

Vdcl

Beetle register at address 0x0c

Integer

0x69

Ivoltbuf

Beetle register at address 0x0d

Integer

0x14

Isf

Beetle register at address 0x0e

Integer

0x1a

Icurrbuf

Beetle register at address 0x0f

Integer

0x66

Latency

Beetle register at address 0x10

Integer

0x80

ROCtrl

Beetle register at address 0x11

Integer

0x1a

RclkDiv

Beetle register at address 0x12

Integer

0x00

CompCtrl

Beetle register at address 0x13

Integer

0x09

mask

Mask configuration for the comparator of the 128 channels.

Boolean array

all false

trim

Trim configuration for the channel comparators, 128 values.

Integer array

all 0

Configuration Example#

An example configuration for this satellite which could be dropped into a Constellation configuration as a starting point

[Alibava.MySetup]
device = "/dev/serial/by-id/"
run_type = "RadSource"

[Alibava.MySetup.trigger]
type = "TriggerPulse"
setup = "TriggerOR"
dac_pulse_neg = -200

[Alibava.MySetup.beetle_0]
latency = 134

[Alibava.MySetup.beetle_1]
latency = 134

or, in YAML format:

Alibava:
  MySetup:
    device: "/dev/ttyUSB0"
    run_type: "RadSource"

    trigger:
      type: "TriggerPulse"
      setup: "TriggerOR"
      dac_pulse_neg: -200

    beetle_0:
      latency: 134

    beetle_1:
      latency: 134

Metrics#

The following metrics are distributed by this satellite and can be subscribed to.

Metric

Description

Value Type

Interval

TRIG

Number of triggers received since the start of the run. This number is only updated with the granularity set by the sample_size parameter.

Integer

3s

Custom Commands#

This section describes all custom commands the satellite exposes to the command interface.

Command

Description

Arguments

Return Value

Allowed States

software_reset

Reset board and Beetle chips

-

0 on success, error code otherwise

INIT

Framework Parameters#

This satellite inherits the following framework parameters from its base classes:

Parameters inherited from TransmitterSatellite#

Parameters to control data transmission in the _data section:

Parameter

Type

Description

Default Value

bor_timeout

Unsigned integer

Timeout in seconds to send the BOR message. The satellite will attempt for this interval to send the message and goes into ERROR state if it fails to do so. A possible reason for failure is that no receiver satellite connected to this satellite and is receiving data.

10

eor_timeout

Unsigned integer

Timeout in seconds to send the EOR message. The satellite will attempt for this interval to send the message and goes into ERROR state if it fails to do so.

10

data_timeout

Unsigned integer

Timeout in seconds to send the data message. The satellite will attempt for this interval to send the message and goes into ERROR state if it fails to do so.

10

payload_threshold

Unsigned integer

Threshold for sending data messages in KiB. The satellite will only send queued data records after the combined payload size of the data records has reached this threshold.

128

queue_size

Unsigned integer

Size of the queue for the data records. Small values might lead to performance issues, large values lead to larger memory usage.

32768

license

String

License this data is recorded under. Defaults to the Open Data Commons Attribution License. This information will be added to the run metadata.

ODC-By-1.0

Parameters inherited from Satellite#

Autonomous Operation#

Parameters to control autonomy in the _autonomy section:

Parameter

Type

Description

Default Value

role

Role name

Role this satellite should take in the Constellation. Accepted values are ESSENTIAL, DYNAMIC, TRANSIENT and NONE.

DYNAMIC

max_heartbeat_interval

Unsigned integer

Maximum interval in seconds between heartbeats to be sent to other Constellation components. The time between heartbeat is adjusted automatically according to the number of nodes in the Constellation but will never exceed this value.

30

Conditional Transitions#

Parameters to control conditional transitions in the _conditions section:

Parameter

Type

Description

Default Value

require_initializing_after

List of strings

List of canonical names of remote satellites for conditional transitioning in initializing state

-

require_launching_after

List of strings

List of canonical names of remote satellites for conditional transitioning in launching state

-

require_landing_after

List of strings

List of canonical names of remote satellites for conditional transitioning in landing state

-

require_starting_after

List of strings

List of canonical names of remote satellites for conditional transitioning in starting state

-

require_stopping_after

List of strings

List of canonical names of remote satellites for conditional transitioning in stopping state

-

transition_timeout

Unsigned integer

Timeout in seconds to wait for all conditions to be satisfied for conditional transitioning

30

Framework Metrics#

This satellite inherits the following framework metrics from its base classes:

Metrics inherited from TransmitterSatellite#

Metric

Description

Value Type

Interval

TX_BYTES

Amount of bytes transmitted during current run

Integer

10s

TX_BLOCKS

Number of data blocks transmitted during current run

Integer

10s

TX_RECORDS

Number of data records transmitted during current run

Integer

10s

Metrics inherited from Satellite#

Metric

Description

Value Type

Interval

RUN_ID

Current run identifier. Updated whenever it changes.

String

-