stoner_measurement.instruments.lakeshore.lia.LakeshoreM81LockIn¶
- class stoner_measurement.instruments.lakeshore.lia.LakeshoreM81LockIn(transport: BaseTransport, protocol: BaseProtocol | None = None, *, sense_slot: int = 1, source_slot: int | None = None)[source]¶
Bases:
LockInAmplifierDriver for the Lakeshore M81 SSM voltage-measurement module in LIA mode.
The Lakeshore M81 Synchronous Source Measure (SSM) system performs lock-in detection via its VM (voltage-measurement) module. Each module occupies a numbered slot on the mainframe. When operating in LIA mode the VM module demodulates against a reference that may come from either an internal AC source module occupying another slot (
source_slot) or an external TTL/sine reference routed to the rear panel.Notes
Setting the reference frequency programmatically requires an AC source module connected to the same mainframe. Pass its slot number as
source_slotat construction time. Withoutsource_slotthe reference frequency can still be read (the instrument reports the detected frequency) but cannot be set via this driver.- Keyword Parameters:
sense_slot (int) – Mainframe slot of the VM measurement module. Defaults to
1.source_slot (int | None) – Mainframe slot of the AC source module used as the internal reference. When
None(default) the internal reference frequency cannot be set by this driver.
- Variables:
transport (BaseTransport) – Transport layer (GPIB, Ethernet, or USB).
protocol (BaseProtocol) – Protocol instance (defaults to
ScpiProtocol).
Examples
>>> from stoner_measurement.instruments.transport import NullTransport >>> lia = LakeshoreM81LockIn(NullTransport(), sense_slot=1, source_slot=2) >>> lia.set_time_constant(100e-3) >>> x, y = lia.measure_xy()
- get_capabilities() LockInAmplifierCapabilities[source]¶
Return static capability metadata for the M81 LIA driver.
- Returns:
Capability descriptor. Reference-frequency control is only available when a
source_slotwas supplied at construction.- Return type:
- get_filter_slope() int[source]¶
Return the output low-pass filter roll-off slope in dB/octave.
- Returns:
Filter slope in dB/octave, one of
(6, 12, 18, 24).- Return type:
(int)
- Raises:
ValueError – If the instrument returns an unrecognised filter-poles value.
- get_harmonic() int[source]¶
Return the detection harmonic.
- Returns:
Active detection harmonic (1 to
_MAX_HARMONIC).- Return type:
(int)
- get_input_coupling() LockInInputCoupling[source]¶
Return the input coupling mode.
- Returns:
ACorDC.- Return type:
- get_reference_frequency() float[source]¶
Return the reference frequency in hertz.
When a source slot is configured the frequency is queried from the AC source module; otherwise the locally cached value is returned.
- Returns:
Reference frequency in hertz.
- Return type:
(float)
Notes
The cached value is initialised from
_DEFAULT_INTERNAL_REFERENCE_FREQUENCY_HZand updated byset_reference_frequency()and source-slot queries made via this driver.
- get_reference_phase() float[source]¶
Return the reference phase offset in degrees.
- Returns:
Reference phase in degrees.
- Return type:
(float)
- get_reference_source() LockInReferenceSource[source]¶
Return the active reference source.
- Returns:
INTERNALorEXTERNAL.- Return type:
- get_sensitivity() float[source]¶
Return the active input range (sensitivity) in volts.
- Returns:
Sensitivity in volts as reported by the instrument.
- Return type:
(float)
- get_time_constant() float[source]¶
Return the output filter time constant in seconds.
- Returns:
Time constant in seconds.
- Return type:
(float)
- measure_rt() tuple[float, float][source]¶
Measure and return the magnitude (R) and phase (theta) outputs.
- measure_xy() tuple[float, float][source]¶
Measure and return the in-phase (X) and quadrature (Y) outputs.
- set_filter_slope(slope: int) None[source]¶
Set the output low-pass filter roll-off slope.
- Parameters:
slope (int) – Slope in dB/octave. Must be one of
(6, 12, 18, 24).- Raises:
ValueError – If slope is not a valid filter-slope value.
- set_harmonic(harmonic: int) None[source]¶
Set the detection harmonic.
- Parameters:
harmonic (int) – Harmonic number between 1 and
_MAX_HARMONIC.- Raises:
ValueError – If harmonic is outside the permitted range.
- set_input_coupling(coupling: LockInInputCoupling) None[source]¶
Set the input coupling mode.
- Parameters:
coupling (LockInInputCoupling) – Coupling mode to select.
- set_reference_frequency(value: float) None[source]¶
Set the reference frequency via the M81 AC source module.
- Parameters:
value (float) – Frequency in hertz. Must be positive.
- Raises:
NotImplementedError – If no
source_slotwas provided at construction time.ValueError – If value is not positive.
- set_reference_phase(value: float) None[source]¶
Set the reference phase offset in degrees.
- Parameters:
value (float) – Phase offset in degrees.
- set_reference_source(source: LockInReferenceSource, edge: LockinRefenceEdge = LockinRefenceEdge.FALLING) None[source]¶
Set the reference source.
- Parameters:
source (LockInReferenceSource) – Reference source to select.