Bergmann Messgeräte Entwicklung devices

oxart.devices.bme_pulse_picker.bme_pulse_picker module

Control a BME delay generator PCI card using the vendor-supplied driver DLL.

oxart.devices.bme_pulse_picker.bme_delay_gen.c_bool_p

alias of LP_c_bool

oxart.devices.bme_pulse_picker.bme_delay_gen.c_long_p

alias of LP_c_long

exception oxart.devices.bme_pulse_picker.bme_delay_gen.DelayGenException[source]

Raised on passing invalid parameters or hardware communication issues.

class oxart.devices.bme_pulse_picker.bme_delay_gen.StatusFlag(value)[source]

Hardware status register flags.

The definitions can be found in the “Programming BME_SG08P3” chapter of the BME_G0X manual, in the “Command register (read)” section.

channel_a_active = 1

channel A is active

channel_b_active = 2

channel B is active

channel_c_active = 4

channel C is active

channel_d_active = 8

channel D is active

channel_e_active = 16

channel E is active

channel_f_active = 32

channel F is active

primary_trigger_active = 64

primary trigger is active

secondary_trigger_active = 128

secondary trigger is active

force_trigger_active = 256

force trigger is active

terminal_count_reached = 512

terminal count of preset register has been reached

external_clock_no_transitions_detected = 1024

external clock fed via the trigger input connector is used, but no level transitions have been detected for the number of periods of the internal clock as prescribed by Multipurpose register, byte no. 6

all_wait_times_elapsed = 2048

all wait times for the trigger system have elapsed

load_command_active = 131072

Load command is active

class oxart.devices.bme_pulse_picker.bme_delay_gen.Driver[source]

Interface to the driver DLL for the delay generator PCI cards by BME (Bergmann Messgeräte Entwicklung KG).

There should typically only be one instance of this class per process. Note also that the class does not currently uninitialise and unload the DLL upon destruction (although that would be easily fixable), so creating many objects would eventually deplete the process handle pool.

init_single_pci_card()[source]

For a system with a single delay generator card installed, detect the parameters of that card and return an interface to it.

Currently, only the model BME_SG08p is supported.

class oxart.devices.bme_pulse_picker.bme_delay_gen.ClockSource(value)[source]

The main clock for the delay generator card to use.

internal = (0,)

Use the on-board 160 MHz oscillator.

external_80_mhz = (1,)

Use an external 80 MHz clock fed to the trigger input.

class oxart.devices.bme_pulse_picker.bme_delay_gen.OutputGateMode(value)[source]

Modes for the delay generator to combine pairs of adjacent channels instead of directly routing them to the respective outputs.

direct = 0

Route channels to the respective outputs.

gate_or = 1

Combine the two channels with a logical OR and send the result to both outputs.

gate_and = 2

Combine the two channels with a logical AND and send the result to both outputs.

gate_xor = 3

Combine the two channels with an XOR-type operation and send the result to both outputs. Note that this is not an actual XOR which would produce two pulses at the output in the general case. Instead, the hardware seems to do some extra gating to only output a single pulse.

class oxart.devices.bme_pulse_picker.bme_delay_gen.PulseParameters(enabled: bool, delay_us: float, width_us: float)[source]

Timing parameters for a single delay channel on the card.

enabled: bool

Whether to generate a pulse on the channel at all.

delay_us: float

The delay of the pulse in microseconds, relative to the sequence start.

width_us: float

The width of the pulse in microseconds.

class oxart.devices.bme_pulse_picker.bme_delay_gen.BME_SG08p(driver_lib, device_idx)[source]

Interface to a BME SG08p delay generator card.

Many settings (trigger inputs, etc.) are currently hard-coded to match a specific application in the Oxford Old Lab, and should be made configurable for a general-purpose driver.

Parameters:
  • driver_lib – A handle to the driver DLL.

  • device_idx – The index of the device to use, as per the DLL’s conception.

reset() None[source]

Reset the card configuration to the default state, with the default trigger settings, no special gate functions enabled and all the delay channels being disabled.

set_clock_source(source: ClockSource) None[source]
set_trigger(use_external_gate: bool, inhibit_us: float) None[source]
set_output_gates(modes: Iterable[OutputGateMode]) None[source]
set_pulse_parameters(params: List[PulseParameters]) None[source]
read_status_flags() Set[StatusFlag][source]

oxart.devices.bme_pulse_picker.timing module

High-level experimentalist’s interface for arming the pulse picker setup and specifying its timing parameters.

Note that there is quite some potential for confusion due to overloaded terminology here. In normal experimentalist’s usage, as well as this high-level interface, the term “pulse” refers to an optical laser pulse. A pulse picker is a device that selects from those pulses. To do that, the Pockels cell driver hardware needs to be triggered by a number of electronic pulses with certain delays between them, which is how the term is also used in the low-level delay generator driver.

In a similar vein, the two pairs of high-voltage switches (high-side and low-side in an H-bridge configuration) are referred to as “on” and “off” in the labels and documentation of the pulse picker head, even though they do not correspond to optical bright/dark (which is the XOR of their states).

Currently, only the BME_SG08p delay generator is supported, with its six channels connected as following to a BME pulse picker driver head:

  • A: OFF A

  • B: <unused>

  • C: OFF B

  • D: <unused>

  • E: ON A

  • F: ON B

exception oxart.devices.bme_pulse_picker.timing.InvalidTimingError[source]

Raised when the user specifies a set of parameters that violate the hardware timing constraints.

class oxart.devices.bme_pulse_picker.timing.TimingParams(allow_long_pulses: bool)[source]

Stores different pulse picker timing parameters. All times in microseconds.

LASER_PERIOD_US = 0.0125

80 MHz repetition rate

MIN_SWITCH_INTERVAL_US = 0.15

The safe hardware limit is actually 50 us, but with the delay generator currently running at 10 MHz, the trigger pulses themselves end up being up to ~130 ns long, so be on the safe side.

offset_on_us

Timing offset to apply between nominally synchronous pulses to the ON switches; positive meaning channel B being later.

offset_off_us

Timing offset to apply between nominally synchronous pulses to the OFF switches; positive meaning channel B being later.

pre_open_us

Wait time between initial OFF pulse and ON pair.

post_open_us

Wait time between ON pair and second OFF pair.

open_us

Time between ON pair (i.e. optical pulse duration).

align_us

Extra shift of the ON pair on top of pre_open_us, for useful units when calibrating the timing relation to the laser pulse train.

ensure_valid()[source]

Verify that the timing parameters are sane, raising an error if not.

This is quite important, as the hardware switches can be damaged by triggering them in an inadequate way.

class oxart.devices.bme_pulse_picker.timing.PulsePickerTiming(delay_gen: Driver, allow_long_pulses: bool = False)[source]

Create a new high-level interface for using the passed delay generator to drive a pulse picker head.

Parameters:
  • delay_gen – The BME_SG08p instance to use. It will be configured for the pulse picker head, its outputs initially disabled. None for simulation mode.

  • allow_long_pulses – Whether to allow (optical) pulses that are longer than sensible for calibrating single-pulse picking (2 * LASER_PERIOD_US).

disable()[source]

Disable pulsing.

enable_gated(holdoff_us=0.0)[source]

Enable pulsing, triggering one whenever the external gate input is signalled.

enable_free(min_period_us=10.0)[source]

Enable pulsing in a free-running manner, where pulses are triggered whenever the laser sync trigger is asserted, but with a minimum period (hold-off/inhibit) of min_period_us.

get_offset_on_us()[source]
set_offset_on_us(value)[source]
get_offset_off_us()[source]
set_offset_off_us(value)[source]
get_pre_open_us()[source]
set_pre_open_us(value)[source]
get_post_open_us()[source]
set_post_open_us(value)[source]
get_open_us()[source]
set_open_us(value)[source]
get_align_us()[source]
set_align_us(value)[source]
ping()[source]

Return true (for ARTIQ controller heartbeat mechanism).