Attenuators

An attenuator is a subtype of Attenuator: a device whose transmission is set by a drive voltage. The interface sets and reads the voltage (setdrivevoltage, getdrivevoltage) or the transmission (settransmission, gettransmission), converting between them through a calibration table set with set_calibration!. The LCC1620 takes its drive voltage from a DAC channel of a Triggerscope4 (see Triggerscope), which several attenuators can share.

Attenuator interface

MicroscopeControl.HardwareInterfaces.AttenuatorInterface.AttenuatorProperties — Type
AttenuatorProperties

Generic properties for an optical attenuator.

Fields

  • drive_voltage::Float64: The current drive voltage of the attenuator.
  • transmission::Float64: The current transmission (0 to 1), NaN if unknown (no calibration set).
  • min_voltage::Float64: The minimum drive voltage of the attenuator.
  • max_voltage::Float64: The maximum drive voltage of the attenuator.
  • cal_voltages::Vector{Float64}: Calibration lookup table drive voltages (empty if not calibrated).
  • cal_transmissions::Vector{Float64}: Calibration lookup table transmissions (0 to 1), same length as cal_voltages.
source
MicroscopeControl.HardwareInterfaces.AttenuatorInterface.set_calibration! — Method
set_calibration!(attenuator::Attenuator, voltages::Vector{Float64}, transmissions::Vector{Float64})

Store a voltage-to-transmission calibration lookup table, measured externally (e.g. with a photodiode in a characterization script). The table is used by settransmission and gettransmission via linear interpolation.

Arguments

  • attenuator::Attenuator: An Attenuator type.
  • voltages::Vector{Float64}: Drive voltages, unit: volt.
  • transmissions::Vector{Float64}: Measured transmissions (0 to 1), same length as voltages.
source
MicroscopeControl.HardwareInterfaces.AttenuatorInterface.settransmission — Method
settransmission(attenuator::Attenuator, transmission::Float64)

Set the transmission of the attenuator (0 to 1) using the stored voltage-to-transmission calibration (see set_calibration!).

Arguments

  • attenuator::Attenuator: An Attenuator type.
  • transmission::Float64: The transmission to set, between 0 and 1.
source
MicroscopeControl.gui — Method
gui(attenuator::Attenuator)

Create a GUI for the attenuator.

Arguments

  • attenuator::Attenuator: An Attenuator type.
source

Thorlabs LCC1620 liquid crystal attenuator

MicroscopeControl.HardwareImplementations.LCC1620Attenuator.LCC1620 — Type
`LCC1620` A Thorlabs LCC1620/M liquid crystal attenuator inherited from `Attenuator`,

driven through a Triggerscope V4 DAC output channel.

Multiple attenuators can share one Triggerscope4 — construct the scope once and pass it to each LCC1620 with a different dac_channel. The scope's serial-port lifecycle is owned by the caller: initialize(att) opens the port only if it is not already open, and shutdown(att) drives the channel to min_voltage but leaves the port open (another attenuator may still use it).

Fields

  • unique_id::String: A unique identifier for the attenuator.
  • properties::AttenuatorProperties: The properties of the attenuator.
  • scope::Triggerscope4: The Triggerscope driving the attenuator.
  • dac_channel::Int: The Triggerscope DAC channel wired to the LCC1620 EXT INPUT (1-16).
source
MicroscopeControl.attenuator_gui — Function
attenuator_gui(attenuator::Attenuator) -> GLMakie.Screen

The same function as gui for an attenuator, under the name this module exports for the LCC1620. It opens a window with a drive-voltage slider (volts, from properties.min_voltage to properties.max_voltage in 0.01 V steps, starting at properties.drive_voltage) and a text box that moves the slider, prints the attenuator's type to standard output, and returns the Screen. Each change of the slider value, including one made through the text box, calls setdrivevoltage with the new voltage, so the window commands the device as soon as it is used. Needs a display (GLMakie).

source
MicroscopeControl.initialize — Method
initialize(attenuator::LCC1620)

Open the Triggerscope serial port (if not already open — the scope may be shared with another attenuator), set the DAC channel range to 0-5 V, and drive to min_voltage.

source
MicroscopeControl.shutdown — Method
shutdown(attenuator::LCC1620)

Drive the DAC channel to min_voltage (0 V = full transmission on the LCC1620). The Triggerscope serial port is left open — it may be shared with another attenuator; shut the scope down separately when done with all channels.

source

Attenuator internals