SRS Lock-in Amplifier

v0.1.3
io.github.K-Dense-AI/labmcp-srs-lockin Checked 1 day ago Published 2 months ago

MCP server for Stanford Research Systems lock-in amplifiers (SR810/SR830, SR860/SR865A).

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_connection_info Get Connection Info

Report which instrument is connected (identity, address, simulated or real), whether the server is read-only, and the active safety limits. Call this first.

get_command_log Get Command Log

Return the most recent raw commands sent to / replies received from the instrument (newest last). Useful for debugging and for recording what was done.

ParameterTypeDescription
limitinteger

reconnect Reconnect

Close and re-open the connection to the instrument (e.g. after it was power cycled or a cable was re-plugged).

read_outputs Read Outputs

Read X, Y, R and θ as one coherent snapshot (SNAP?), with the reference frequency, sensitivity, fraction of full scale and any overloads latched since the last reading. Values are only meaningful once the output filter has settled (~5-10 time constants after a change).

ParameterTypeDescription
include_aux_inputsbooleanAlso read Aux In 1-4 (V)

get_settings Get Settings

Report the reference (source, frequency, harmonic, phase), sine output, sensitivity, time constant/slope (with the 99 % settling time), and input configuration.

set_reference Set Reference

Set the reference: source (internal/external), internal frequency, detection harmonic and phase shift. Omitted parameters are left unchanged. Changing the frequency also changes the frequency of the SINE OUT drive (at the current amplitude).

ParameterTypeDescription
frequency_hzInternal reference frequency (internal mode only)
harmonicDetection harmonic n
phase_degReference phase shift
sourceinternal = sine output oscillator; external = lock to REF IN

set_amplitude Set Amplitude

Set the SINE OUT amplitude (V rms), which drives the sample or excitation circuit. Refused above the `max_amplitude_v` safety limit. Tell the user the new drive level first.

ParameterTypeDescription
amplitude_v *numberSine output amplitude in V rms

set_amplitude_minimum Set Amplitude Minimum

Turn the sine output down to the instrument minimum (the lock-in's closest thing to 'output off') and stop any running frequency sweep. SR810/SR830: 4 mV rms (it cannot go to zero - disconnect the cable if the sample must see no drive). SR86x: 1 nV rms and DC level 0 V.

set_sensitivity Set Sensitivity

Set the sensitivity (full-scale range). The smallest available range that is at least `full_scale` is chosen, so a signal of that size does not overload. On SR810/SR830 the dynamic reserve can be set at the same time.

ParameterTypeDescription
full_scale *numberLargest signal to measure without overload
dynamic_reserveSR810/SR830 only: dynamic reserve mode
unitstringV for voltage inputs; A for current inputs (1 V <-> 1 µA)

set_time_constant Set Time Constant

Set the output filter time constant (nearest available value), and optionally the filter slope and synchronous filter. The SR830 may raise a too-short time constant to its minimum for the current slope/reserve; the returned settings show the value actually used.

ParameterTypeDescription
time_constant_s *numberOutput filter time constant
filter_slope_db_octLow-pass filter slope in dB/octave
sync_filterSynchronous filter on/off

set_input Set Input

Configure the signal input: A / A-B / current, AC or DC coupling, shield float/ground and (SR86x) the voltage input range. Use DC coupling below ~160 mHz. Omitted parameters are left unchanged.

ParameterTypeDescription
configurationSingle-ended A, differential A-B, or current input with 1 MΩ / 100 MΩ gain
couplingInput coupling
input_range_vSR86x voltage input range
shieldInput shield grounding

auto_phase Auto Phase

Run Auto Phase (APHS): shift the reference phase so that Y ≈ 0 and X ≈ R. The outputs then need several time constants to settle. Does nothing if the phase is unstable.

auto_gain Auto Gain

Pick the sensitivity automatically for the present signal (SR830 AGAN / SR86x ASCL). On the SR830 AGAN does nothing when the time constant is longer than 1 s.

auto_range Auto Range

Optimise the input stage for the present signal: SR830 Auto Reserve (ARSV) or SR86x Auto Range of the voltage input range (ARNG).

frequency_sweep Frequency Sweep

Step the internal reference (and SINE OUT drive) from start_hz to stop_hz, waiting for the output filter to settle at each point, and record X/Y/R/θ vs frequency - e.g. a resonance or transfer-function measurement. The drive amplitude stays at its present value. Needs the internal reference. The estimated duration must be within `max_sweep_duration_s`; `set_amplitude_minimum` stops a running sweep. `save_path` must be a new .csv file.

ParameterTypeDescription
start_hz *numberFirst frequency
stop_hz *numberLast frequency
log_spacingbooleanLogarithmic instead of linear spacing
pointsintegerNumber of frequencies
restore_frequencybooleanReturn to the starting frequency afterwards
save_pathOptional CSV file for the full sweep
settle_time_constantsWait per point in time constants (default: 99 % settling for the slope)