.. |syncboard| replace:: Synchronizer

**********************************
|syncboard|
**********************************

..
   .. image:: img/image3d.png
      :width: 60 %
      :align: center


Overview
===========================

The Swabian Instruments' |syncboard| allows for connecting up to 8 |ttu-name| / |ttx-name| devices to expand the number of available channels.
The |syncboard| generates a clock and synchronization signal to establish a common time-base on all connected Time Taggers.
The Time Tagger software engine creates a layer of abstraction:
the synchronized Time Taggers appear as one device with a combined number of input channels.

Key applications
====================================================

The |syncboard| offers numerous advantages beyond its
capability to extend the number of input channels up to 160, when connected to 8 Time Taggers, without introducing any additional time jitter.

Crosstalk elimination
-----------------------

Employing synchronized Time Taggers provides the benefit of effectively suppressing analog crosstalk
in comparison to measurements involving a single device unit.
In experiments such as interferometry, for instance, the crosstalk pickup in correlation measurements hinders the identification of the
physical signal from the electronic noise around zero.
A commonly adopted solution consists on delaying signals with respect to each other by using cables of different lengths.
Nevertheless, this approach might introduce additional complexities, e.g. the length difference fluctuates over time due to temperature variations.
In this regard, the |syncboard| represents a more robust solution.

High transfer rate
-----------------------
The data transfer rate from a single Time Tagger to the PC is limited to |ttu-tagrate-usb| by the single-core CPU performance.
Utilizing more than one Time Tagger allows to use multiple USB controllers and CPU threads, significantly increasing the total transfer rate
(up to |ttu-tagrate-usb| per device), as far as the Time Tagger and PC processing capabilities are not overcome.

Multi-room experiment
-----------------------
In some experiments, Time Taggers need to be placed far apart. The cable length between the |syncboard| and the Time Tagger
can be as long as 50 m, without any additional time jitter caused. Different Sync cables result only in a constant time offset between the signals.


|syncboard| with a single Time Tagger
---------------------------------------

You can benefit from the |syncboard| with a single Time Tagger at least in the following two application scenarios:

1. **Long term clock stability**

   The |syncboard| contains a highly stable clock oscillator which you can benefit from even when you have only one Time Tagger.
   Just connect any clock output of the |syncboard| to the `CLK IN` input of the Time Tagger and enjoy the clock stability provided by the |syncboard|,
   which matters especially measuring long time differences.

2. **Absolute clock timestamps**

   By connecting all signals from the |syncboard| as shown in `Cable connections`_
   the timestamps in the Time Tag stream will be referenced to the power-up time of the |syncboard|.
   Even when you disconnect the Time Tagger from your PC, e.g., in case of power down, USB timeout, or software restart,
   the time tags returned by the Time Tagger will remain referenced to the start time of the |syncboard|.
   To verify that this configuration is active, you will see a warning message
   in the console on :cpp:func:`createTimeTagger` that you are using the |syncboard| with only one Time Tagger.


Requirements
===========================

Successful synchronization of your Time Taggers requires:

* You have obtained the |syncboard| hardware.

* Your |ttu-name| has hardware version 1.2 or higher. In case you have an older device and want to synchronize it with more units,
  please contact our support or sales team `www.swabianinstruments.com/contact <https://www.swabianinstruments.com/contact/>`_ .

* Your PC has a sufficient number of USB3 ports for direct connection of every Time Tagger. The |syncboard| itself does not require a USB connection.

* You have a sufficient number of SMA cables of the same length.
  You need three cables for each Time Tagger. For more details, see in the section `Cable connections`_.

* You have installed the Time Tagger software version 2.6.6 or newer.


Cable connections
===========================

The |syncboard| provides a common clock signal for every Time Tagger as well as the synchronization signals.
Furthermore, Time Taggers have to be connected to each other in a loop. The connection sequence in the loop defines the channel numbering order.
An additional feedback signal is required to identify which of the Time Taggers in the loop is the first.

Using a single Time Tagger with |syncboard| is also possible and you shall connect `LOOP IN` and `LOOP OUT` together on the same device.

.. note::
   After the release of the |syncboard|, we have changed the connector labels on the front panel of |ttu-name|.
   In this section, we use the new labeling scheme, while showing the corresponding old labels in brackets: `NEW_LABEL (OLD_LABEL)`.

.. csv-table:: Connections between the |syncboard| and Time Taggers
   :header: "|syncboard|", "Time Tagger", "Description"
   :widths: 20, 20, 40

   "`CLK OUT <N>`", "`CLK IN (CLK)`", "500 MHz clock"
   "`SYNC OUT <N>`", "`SYNC IN (AUX IN 1)`", "Synchronization data"
   "`FDBK IN`", "`FDBK OUT (AUX OUT 2)`", "Feedback from one Time Tagger"

Every Time Tagger should have its `LOOP OUT (AUX OUT 1)` connected to the `LOOP IN (AUX IN 2)` of next Time Tagger, eventually forming a signal loop.
The following diagram visualizes the connections required for the synchronization of three Time Taggers.

.. image:: img/synchronization_loop.*
   :width: 70%
   :align: center


.. warning::
   For reliable synchronization, the cables for `CLK` and `SYNC` signals shall have a length difference below 4 cm.
   We recommend using the same cable type for these two signals.

Additionally, we recommend connecting every Time Tagger directly to a USB3 port on the same computer.
If your computer does not have a sufficient number of USB3 ports,
avoid using USB hubs as they limit the data bandwidth available for every Time Tagger.
Instead, please install an additional USB controller card into your computer.
While there is a wide variety of USB3 controllers, you have to look for one that can deliver full USB3 bandwidth
at every USB port simultaneously.
Typically, such USB controllers have an individual chip for each USB port and require a PCIe x4 slot on the computer's motherboard.

Using an external reference clock
----------------------------------------
The |syncboard| has a built-in high accuracy and low noise reference oscillator and distributes the clock signals to all attached Time Taggers.
In case you want to use your external reference clock, you have to connect it to the `REF IN` connector of the |syncboard|.
Additionally, the |syncboard| can supply 10 MHz reference signal through its `REF OUT` output.
Note that `REF OUT` is disabled when an external reference signal is present at the `REF IN`.

.. csv-table:: Requirements to the reference signal at `REF IN`.
   :header: "Parameter", "Value"
   :widths: 40 60

   "Coupling", "AC"
   "Amplitude", "0.3 ... 5.0 Vpp"
   "Frequency", "10 MHz"
   "Impedance", "50 Ohm"

.. csv-table:: Signal parameters at `REF OUT`.
   :header: "Parameter", "Value"
   :widths: 40 60

   "Coupling", "AC"
   "Amplitude", "3.3 Vpp (1 Vpp @ 50 Ohm)"
   "Frequency", "10 MHz"




Software and channel numbering
==============================

The Time Tagger software engine automatically recognizes if a Time Tagger belongs to a synchronized group.
It will also automatically open a connection to all other Time Taggers in the group and present all devices as a single Time Tagger.
There is no specific "master" device, and the connection to the synchronized group can be initiated from any of the member Time Taggers.

The connection is opened as usual using :cpp:func:`createTimeTagger`, and optionally you can specify the serial number of the Time Tagger.

.. code-block::

   tagger = createTimeTagger()

The `tagger` object provides a common interface for the whole synchronization loop,
and all programming is done in the same way as for a single Time Tagger.
Note that, compared to a single Time Tagger, the channel numbering scheme is modified for easy identification by a user.
The channel number consists of the Time Tagger number in the loop and the input number on the front panel. The channel number formula is

.. code-block::

      CHANEL_NUMBER = TT_NUMBER*100 + INPUT_NUMBER

As an example, let us assume we have three |ttu-name| 18 in a synchronization loop.
The Time Tagger that provides the feedback signal to the |syncboard| has sequence number 1, and its channel numbers will be from 101 to 118.
The channels of the next Time Tagger will have numbers from 201 to 218, and so forth.

You can request the complete list of available channels with the :cpp:func:`~TimeTaggerHardware::getChannelList` method.

.. code-block::

   from Swabian.TimeTagger import createTimeTagger, TT_CHANNEL_RISING_EDGES

   # Connect to any of the synchronized Time Taggers
   tagger = createTimeTagger()

   # Request a list of all positive edge channels
   chan_list = tagger.getChannelList(TT_CHANNEL_RISING_EDGES)
   print(chan_list)
   >> [101, 102, ... , 317, 318]


Incomplete cable connections
----------------------------
The software engine attempts to detect incorrect or incomplete connections of the cables in the synchronization loop.
In case some connections are missing or were disconnected during operation,
the software engine will show a warning and the data transmission from the disconnected Time Tagger
will be filtered out until a valid connection is restored. Issues with the cable connections and synchronization status
are indicated using the status LEDs on the front panel of the |syncboard| and the Time Tagger. See more in section :ref:`syncronizer.status_leds`.

Buffer overflows
----------------
The synchronization loop also propagates the buffer overflow state from any Time Tagger to all members of the loop.
On the software side, the buffer overflow has the same effect as for a single Time Tagger. See, :ref:`hw-overflows`.


Limitations
===========================

Conditional filter
-------------------------
The conditional filter cannot be applied across synchronized devices.
However, it can still be enabled for each Time Tagger independently.

In case you want to use the conditional filter across devices, you have to send the signal to be filtered
(for example, your laser sync) to every Time Tagger where trigger signals are connected.
In software, you have to choose the corresponding input for time difference measurements.


Internal test signal
--------------------------
The internal test-signal generator is a free-running oscillator independent from the system clock. Therefore,
the test signals are not correlated between different Time Taggers, even if the synchronization loop is set up correctly.
If you try to measure a correlation with the internal test signal across two different Time Taggers, you will see a flat histogram.
On the other hand, performing the same measurement with two input channels of the same Time Tagger will result in a jitter-limited correlation peak.

.. note::

   If you are synchronizing |ttu-name| and |ttx-name| devices together, the internal test signal frequency of some of them may be different than expected. 
   The reason for this is that a single testSignalDivider is applied to the synchronized group, and the internal oscillators of the |ttu-name| and |ttx-name| run at different frequencies, see: :cpp:func:`~TimeTaggerHardware::setTestSignalDivider`.
   Apart from the test signal frequency change, the functionality of the Time Taggers is not affected.

.. _syncronizer.status_leds:

Status LEDs and troubleshooting
=========================================
The front panel of the |syncboard| has several LEDs that indicate operation status.


.. csv-table::
   :header: "LED", "Color", "Description"
   :widths: 20, 20, 40

   "Power", "dark", "No power provided"
   "--", "solid green", "Powered on"
   "Status", "dark", "Warming up"
   "--", "solid green", "Normal operation."
   "FDBK IN", "solid green", "Normal operation"
   "--", "solid red", "Invalid feedback signal"
   "REF IN", "dark", "No external reference signal"
   "--", "solid green", "Valid 10 MHz reference signal"
   "--", "solid red", "Invalid reference signal"
   "REF OUT", "dark", "Output is disabled when using external reference signal"
   "--", "solid green", "Output enabled"


The LEDs of the |ttu-name| also indicate the state of the synchronization loop. See more details in section :ref:`hw.status_leds`.

