Feed-Forward

Feed-forward uses the outcome of a measurement to control a subsequent step in an experiment. For example, detecting a specific pattern of events can generate an electrical pulse that triggers another device, such as a modulator, laser, or second instrument. Such applications often require low and predictable response latency to ensure that the control action occurs within the experiment’s timing constraints.

Since software version 2.23, the Time Tagger X supports feed-forward by evaluating time tags directly on its FPGA, without a round trip through the PC. Each of its two Aux outputs can be driven by a configurable module that determines when an electrical pulse is generated. For example, the coincidence module generates a pulse when events preceding a trigger satisfy a configured condition. The latency depends on the module and is typically below 100 ns.

../_images/FeedForward_stages.svg

The diagram shows how time tags are processed within the Time Tagger X. The input stage detects edges in the incoming electrical signals and generates a time tag for each edge. The delay stage then applies the delays configured with setDelayHardware(). The feed-forward logic receives a copy of the time tags after this stage.

The original time tags continue through the filter stage, which applies operations such as the Conditional Filter, and through the buffer to the PC. The feed-forward logic therefore operates in parallel with regular data acquisition. Measurements and virtual channels can process the same time tags while the feed-forward logic generates output pulses, for example to monitor the count rates.

Note

The feed-forward logic is available on the Time Tagger X with the Feed-Forward hardware license. To upgrade your license, contact sales@swabianinstruments.com. The license can then be updated using the standard procedure described in Hardware License Upgrades.

The configuration that is common to all modules is described in Setup of the feed-forward logic, followed by one section for each module.

Setup of the feed-forward logic

The feed-forward logic is configured using a JSON object (or a dict in Python) passed to enableFeedForward(). The configuration contains a block for each module, such as coincidences, and an outputs block that selects the source for each Aux output. All available fields, their ranges, and default values are documented in FeedForwardConfiguration.

Fields that are left out are reset to their default values, and unknown fields raise an error. The method getFeedForwardConfiguration() returns the current configuration with all fields, including those at their default values. It can therefore serve as a template: modify the relevant fields and pass it back. Right after connecting, the template contains only default values:

from pprint import pprint
from Swabian import TimeTagger

tagger = TimeTagger.createTimeTagger()

config = tagger.getFeedForwardConfiguration()
pprint(config)

The configuration is applied in the background. To make sure that it is active before the outputs are used, for example to trigger other devices, call sync(). While a configuration is uploaded, both outputs are briefly switched off.

Outputs

Each Aux output selects its source using mode. For instance, the value 'Coincidences' connects the output to the coincidence module, while None (the default) disables it.

The pulses have an amplitude of 1.5 V into 50 Ohm and 2.3 V into High-Z. The pulse duration is set by pulse_length, ranging from 1.333 ns to 21.8 µs in steps of 2/3 ns (default: 10 ns). If a new pulse is requested while the output is still active, the pulse is extended, so overlapping pulses merge into one.

Warning

The pulses are generated from the time base of the Time Tagger X. The self-calibration of each input assumes that its events are not correlated with this time base (see Calibration). If an Aux output is connected to an input of the same Time Tagger X, the calibration of that input is therefore not valid, and its LED turns red. Such an input can count the pulses, but timing measurements of the outputs, such as the latency, require a second Time Tagger with an independent clock and an external trigger source, for example a signal generator or a Pulse Streamer 8/2.

Inputs

Inputs used by the feed-forward logic are enabled automatically. As with any active input, their termination is 50 Ohm unless High-Z was set (see Configurable input termination - Time Tagger X only). Negative channel numbers select falling edges.

The feed-forward logic receives time tags after the hardware delay stage. Different signal delays, for example from cables or detectors, can therefore be compensated with setDelayHardware(), which is the only way to align the inputs for the feed-forward logic. The method setDelaySoftware() does not affect it. A hardware delay on the channel that triggers the output pulses, such as the trigger channel of the coincidence module, adds to the latency, and the HighRes mode adds about 27 ns.

The filter stage acts only on the time tags sent to the PC, so the deadtime, the Conditional Filter and the event divider do not affect the feed-forward logic.

Disable the feed-forward logic

The method disableFeedForward() switches off both Aux outputs and resets the configuration to its default values.

If an output is still enabled when freeTimeTagger() releases the Time Tagger, the feed-forward logic keeps running, and the inputs are not switched to High-Z. The next connection with createTimeTagger() resets the configuration to its default values, which switches off both outputs. The method reset() has the same effect.

Coincidence module

The coincidence module evaluates the events within a window before each trigger. Each event on the trigger_channel ends a coincidence window of length window_size. Each output has its own condition: each of the required_channels must have at least one event within the window, and the veto_channels must have none. If the condition is fulfilled, the output generates a pulse. Either channel list can be empty: without required channels, every trigger with no veto event in its window generates a pulse, so if both lists are empty, the output becomes a delayed copy of the trigger channel. Both outputs share the trigger and the window.

In the following example, each event on channel 4 ends a window of 10 ns. Aux Out 1 signals an inclusive coincidence: it generates a pulse if channels 1 and 2 both had an event within the window, regardless of the other channels. Aux Out 2 signals an exclusive coincidence: it generates a pulse if channels 2 and 3 both had an event and channel 1 had none:

config = {
    'coincidences': {
        'trigger_channel': 4,
        'window_size': 10000,
        'output_1': {'required_channels': [1, 2]},  # inclusive
        'output_2': {'required_channels': [2, 3], 'veto_channels': [1]},  # exclusive
    },
    'outputs': {
        'output_1': {'mode': 'Coincidences'},
        'output_2': {'mode': 'Coincidences'},
    },
}
tagger.enableFeedForward(config)
tagger.sync()
../_images/FeedForward_coincidence.svg

The figure shows the coincidence module with the configuration above: the events on the trigger channel and on channels 1 to 3, the window before each trigger, and the pulses that each Aux output generates according to its condition, with their latency and pulse length.

The following code shortens the window of this configuration to 3 ns and leaves all other fields unchanged:

config = tagger.getFeedForwardConfiguration()
config['coincidences']['window_size'] = 3000
tagger.enableFeedForward(config)
tagger.sync()

The coincidence window

An event counts for a trigger if it comes less than window_size before the trigger, which can be set from 1 ps to 715 µs. Several events of the same channel within the window count as one. Each trigger is evaluated separately, so the window can be longer than the trigger period, and one event can count for several triggers.

In pulsed experiments, the synchronization signal of the laser is a natural trigger. An event that comes even slightly after the trigger counts only for later triggers. If the trigger arrives close to the events or even before them, delaying it with setDelayHardware() is recommended:

tagger.setDelayHardware(4, 500)  # the trigger comes 500 ps later

Auto trigger

Experiments without a natural trigger signal can set auto_trigger instead of a trigger_channel: an internal trigger then ends a window every 1.333 ns, at the clock rate of 750 MHz.

config = {
    'coincidences': {
        'auto_trigger': True,
        'window_size': 1334,
        'output_1': {'required_channels': [3]},
    },
    'outputs': {'output_1': {'mode': 'Coincidences'}},
}

With a window just above one clock cycle, the windows leave no gaps, and Aux Out 1 follows every event of channel 3. Shorter windows catch only the fraction window_size / 1.333 ns of the events. With longer windows, several consecutive windows contain the same event and their pulses merge, so the pulse becomes longer by window_size - 1.333 ns on average. Since the windows are not aligned to the events, a window can contain only some of the events of a coincidence. Veto channels therefore give predictable results only if their events come between the required events: a window that contains all required events then also contains the veto events.

Quick test

This simple test checks the coincidence module without external signals. It uses the internal test signal and needs only a cable from Aux Out 1 to input 5. As explained in Outputs, the LED of input 5 turns red, which does not affect counting the pulses.

A Coincidence virtual channel evaluates the same coincidence in the software:

tagger.setTestSignal([1, 2, 3], True)
tagger.setDelayHardware(1, 500)  # the trigger comes 500 ps after the events on channels 2 and 3

config = tagger.getFeedForwardConfiguration()
config['coincidences']['trigger_channel'] = 1
config['coincidences']['output_1']['required_channels'] = [2, 3]
config['outputs']['output_1']['mode'] = 'Coincidences'
tagger.enableFeedForward(config)
tagger.sync()

coincidence = TimeTagger.Coincidence(tagger, [2, 3, 1], coincidenceWindow=1000)
countrate = TimeTagger.Countrate(tagger, [5, coincidence.getChannel()])
countrate.startFor(int(1e12))
countrate.waitUntilFinished()
print(countrate.getData())  # both at the rate of the test signal

Specifications

Property

Value

Mean latency from the trigger input to Aux Out

85.7 ns

Jitter (RMS)

193 ps

The output pulses start on a grid of 2/3 ns, which gives an approximately uniform timing distribution. The latency depends neither on the window size nor on the condition: the window lies before the trigger, so the module can decide as soon as the trigger arrives. A delay on the trigger channel and the HighRes mode add to it (see Inputs).

When the Aux Out triggers a sequence of a Pulse Streamer 8/2, the first output edge of the Pulse Streamer follows the trigger after 178.8 ns, with a jitter of 349 ps RMS. These values exclude cable delays, which must be added for an experimental setup. The measurements are described in this application note.