-
Notifications
You must be signed in to change notification settings - Fork 9
Using Lock In Amplifiers
The lock-in amplifiers controlled by JISA
typically fall under the "digital" category (since analogue lock-ins typically do not allow for computer control). Just like how all SMUs are represnted with classes that implement the SMU
interface, all lock-ins implement the LockIn
interface. Those with dual-phase capability (ie are able to give you a real (in-phase) and imaginary (out of phase) component) implement the DPLockIn
interface which, in turn, extends LockIn
.
- Simple Example Operation
- Basic Read-Outs
- Reference Signal
- Time Constant (Integration Time)
- Input, Source and Impedance Mode
- Filtering
- Coupling and Shielding
- Offset
Top ↑
// Connect to lock-in
SR830 lockIn = new SR830(new GPIBAddress(0,30));
lockIn.setRefMode(LockIn.RefMode.INTERNAL); // Use internal oscillator
lockIn.setInput(Input.DIFF); // Use A-B input
lockIn.setSource(Source.VOLTAGE); // Measuring voltage
lockIn.setOscFrequency(5.0); // Use 5 Hz
lockIn.setTimeConstant(10.0); // 10 second time constant
lockIn.setRange(100e-3); // 100 mV range
// Wait until read-out is stable within 1% for 60 seconds
lockIn.waitForStableLock(1.0, 60000);
double amplitude = lockIn.getLockedAmplitude();
Top ↑
The basic operation of a lock-in consists of reading out the RMS-amplitude of the component of an input signal for a given frequency. Very simply, this is done in JISA
by use of the getLockedAmplitude()
method like so:
Java
double amplitude = lockIn.getLockedAmplitude();
Kotlin
val amplitude = lockIn.getLockedAmplitude()
Python
amplitude = lockIn.getLockedAmplitude()
If your lock-in has the ability, you can also get read-outs of the X (in-phase) and Y (out-of-phase) components as well as the argument (overall phase-offset):
double inPhase = lockIn.getLockedX();
double outPhase = lockIn.getLockedY();
double offset = lockIn.getLockedPhase();
Top ↑
With a lock-in you specify the frequency component you wish to extract by use of a reference signal. Most digital lock-ins allow you to do this by using either an internal oscillator or an external voltage signal. To select which, use the setRefMode(...)
method and to check which is being used use the getRefMode()
method. Both are shown below:
lockIn.setRefMode(LockIn.RefMode.INTERNAL); // Internal
lockIn.setRefMode(LockIn.RefMode.EXTERNAL); // External
LockIn.RefMode mode = lockIn.getRefMode();
To check the current frequency value (regardless of reference mode), simply use getFrequency()
like so:
double frequency = lockIn.getFrequency();
If in internal referencing mode, this will return the frequency setting of the internal oscialltor, if in external mode, this will return the frequency of the external reference signal.
If internal referencing is being used, you can set the frequency and phase of the internal oscillator using the following methods:
// 30 Hz frequency
lockIn.setOscFrequency(30.0);
// 90 degrees phase
lockIn.setOscPhase(90);
Most lock-ins allow you to out-couple the internal oscillator (via a BNC cable or something similar), thus you may also be permitted to specify the amplitude of its output in volts:
lockIn.setOscAmplitude(100e-3); // 100 mV
Naturally, all of these have a corresponing get...()
method to check their current settings:
double frequency = lockIn.getFrequency();
double phase = lockIn.getOscPhase();
double amplitude = lockIn.getOscAmplitude();
Top ↑
Like all measurement instrumentation, the amount of time a single measurement takes is a configurable parameter. However, in the context of a lock-in this becomes much more prominent as the integration time must be long enough to cover at least one cycle of the signal you are trying to extract, with the more cycles covered the more stable and precise the measurement.
For a lock-in this is normally referred to as the "time constant" rather than integration time. Therefore, to configure this, you use the setTimeConstant(...)
method, specifying the desired interval in seconds. For example, if we wanted a time constant of one minute:
lockIn.setTimeConstant(60.0);
Most lock-ins have discrete options for this parameter, therefore JISA
will simply round-up to the nearest option. For example a Stanford Research Systems SR830 lock-in has 10, 30 and 100 seconds but not 60, so our above example would actually end up setting the time constant to 100 seconds.
Predictably, you can check the current time constant being used by using getTimeConstant()
:
double timeConst = lockIn.getTimeConstant();
Top ↑
Most lock-ins will provide two input ports, usually labelled A
and B
. You can the normally choose to use one of them as the input or use the difference between them as the input (often called "differential" input). Furthermore these can sometimes be used to measure either voltage or current and may have high impedance and low impedance modes. To configure all of this there are three methods:
lockIn.setInput(Input.A);
lockIn.setInput(Input.B);
lockIn.setInput(Input.DIFF);
lockIn.setSource(Source.VOLTAGE);
lockIn.setSource(Source.CURRENT);
lockIn.setImpedanceMode(Impedance.HIGH);
lockIn.setImpedanceMode(Impedance.LOW);
All have corresponding get
methods to check the current settings too.
Top ↑
Much like any other measurement instrument, you can trade off range with accuracy by specifying a measurement range (sometimes called "sensitivity"). This is done simply using the setRange(...)
method. Just provide it with the largest value you wish to be able to measure:
// 500 mV
lockIn.setRange(500e-3);
Alternatively you can instruct the lock-in to perform a one-off test of all possible ranges to find the most optimal using autoRange()
like so:
lockIn.autoRange();
The method will not return until the auto-ranging procedure has completed (ie halting your code until then).
Since this is often a lengthy process (the lock-in will need to test each range for at least the time constant) this process only happens when autoRange()
is called. This is unlike an SMU where using smu.useAutoRanges()
causes it to continually determine the optimal range for every measurement.
Top ↑
Most digital lock-ins also come equipped with filters to help clean up your signal by filtering out components that are not at your reference frequency. Your lock-in will, at most, have three filters:
- Band-Pass Filter
- Line-Rejection Filter
- Synchronous Filter
The band-pass filter simply attempts to filter out all frequencies other than your reference frequency. In reality it will actually allow through a range of frequencies in a window around the reference. How steeply the attenuation recovers when moving away from the reference can often be configured and is called "roll-off", measured in dB per decade (dB loss for a 10-fold increase in frequency) or dB per octave (for a 2-fold increase). JISA
works with lock-in filter roll-offs in dB/octave, thus you can specify which roll-off to use by specifying it in dB/octave in the setFilterRollOff(...)
method like so:
lockIn.setFilterRollOff(24.0); // 24 dB/octave
Since these settings are often discrete, JISA
will select the closest available option.
You can check which one has been selected / is currently being used by calling:
double rollOff = lockIn.getFilterRollOff();
The second type of filter, called the line-rejection filter, is a filter than attenuates signals specifically at the power-line frequency (50 Hz in the UK). Some will offer a simple on/off option for this however some allow for higher harmonics to also be filtered. Therefore, to set this, you simply specify which harmonic modes to wish to filter like so:
lockIn.setLineFilterHarmonics(1, 2, 3); // Filter 1st, 2nd and 3rd harmonics
lockIn.setLineFilterHarmonics(1); // Only 1st harmonic
lockIn.setLineFilterHarmonics(0); // No filtering
lockIn.setLineFilterHarmonics(); // Same as 0 (no filtering)
You can check which harmonics are being filtered by use of the getLineFilterHarmonics()
method which will return a List
of them:
List<Integer> harmonics = lockIn.getLineFilterHarmonics();
if (harmonics.contains(2)) {
// 2nd harmonic is being filtered
} else if (harmonics.isEmpty()) {
// no line filtering is being used
}
The synchronous filter is used to automatically filter out higher harmonics of your reference frequency. This is only ever an on/off type setting. Therefore you simply use the useSyncFiltering(...)
method like so:
lockIn.useSyncFiltering(true); // On
lockIn.useSyncFiltering(false); // Off
Checking it is also simple
boolean isOn = lockIn.isUsingSyncFiltering();
Top ↑
Lock-ins let you decide whether you use DC or AC coupling for your input signal. The reason for this is that for signal that are very low in frequency, DC circuitry often works better (since the signal is almost DC), whereas higher frequencies require AC circuitry. You can also often couple to ground, which is essentially the same as just disconnecting the input. This can be configured like so:
lockIn.setCoupling(Coupling.DC);
lockIn.setCoupling(Coupling.AC);
lockIn.setCoupling(Coupling.GROUND);
Additionally to this, you can often also specify where you want the lock-in to connect the shielding of your input to (or not). You can either specify that it should ground the shielding, or leave it floating like so:
lockIn.setShielding(Shield.GROUND);
lockIn.setShielding(Shield.FLOAT);
Of course, you can check both of these like so:
Coupling coupling = lockIn.getCoupling();
Shield shielding = lockIn.getShielding();
Top ↑
Lock-ins allow you to re-centre your measurement range around a non-zero value. This is known as the offset as can be set (as a percentage of the measurement range) by using the setOffset(...)
method like so:
lockIn.setOffset(50.0); // 50% offset
You can check the offset too
double offsetPCT = lockIn.getOffset();
- Getting Started
- Object Orientation
- Choosing a Language
- Using JISA in Java
- Using JISA in Python
- Using JISA in Kotlin
- Exceptions
- Functions as Objects
- Instrument Basics
- SMUs
- Thermometers (and old TCs)
- PID and Temperature Controllers
- Lock-Ins
- Power Supplies
- Pre-Amplifiers
- Writing New Drivers