Skip to content

Sr860 buffered sweeps #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 49 additions & 2 deletions qdev_wrappers/customised_instruments/SR830_ext.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from qcodes.instrument_drivers.stanford_research.SR830 import SR830, ChannelBuffer

import time
import numpy as np
# A conductance buffer, needed for the faster 2D conductance measurements
# (Dave Wecker style)

Expand Down Expand Up @@ -57,8 +58,52 @@ def get_raw(self):
return rs


# Subclass the SR830
class soft_sweep():
'''
Helper class to utilize buffers within doNd measurements.
How to:
do0d(lockin.soft_sweep.sweep(para_set, start, stor, num_points, delay), lockin.g_buff)
The class can be instanciated with a list of lockins if multiple needs to be measured at each point:
Nlockin_sweep = soft_sweep((lockin1,lockin2))
do0d(Nlockin_sweep.sweep(para_set, start, stor, num_points, delay), lockin1.g_buff, lockin2.g_buff)
'''
def __init__(self, lockins):
self.lockins = lockins

def sweep(self, param_set, start, stop,
num_points, delay):
self.param_set = param_set
self.param_set.post_delay = delay
self.setpoints = np.linspace(start, stop, num_points)
for lockin in self.lockins:
# Get list of ChannelBuffer type attributes on lockin
buffer_list = [getattr(lockin, name)
for name in dir(lockin)
if isinstance(getattr(lockin, name),ChannelBuffer)]
for buffer_type in buffer_list:
buffer_type.setpoints = (tuple(self.setpoints),)
buffer_type.shape = self.setpoints.shape
buffer_type.setpoint_units = (param_set.unit,)
buffer_type.setpoint_names = (param_set.name,)
buffer_type.setpoint_labels = (param_set.label,)
lockin._buffer1_ready = True
lockin._buffer2_ready = True
time.sleep(0.1)
return self.perform_sweep

def perform_sweep(self):
for lockin in self.lockins:
lockin.buffer_reset()
lockin.buffer_start()
for set_val in self.setpoints:
self.param_set(set_val)
for lockin in self.lockins:
lockin.send_trigger()
self.param_set(self.setpoints[0])



# Subclass the SR830
class SR830_ext(SR830):
def __init__(self, name, address, **kwargs):
super().__init__(name, address, **kwargs)
Expand Down Expand Up @@ -117,6 +162,8 @@ def __init__(self, name, address, **kwargs):
label='Resistance',
parameter_class = ResistanceBuffer)

self.soft_sweep = soft_sweep([self])

def _get_conductance(self):
V = self.amplitude.get_latest()
I = abs(self.R()/self.iv_gain.get_latest())
Expand Down