예제 #1
0
def iv__sim900__sweep_current__read_voltage(current_range, current_step,
                                            bias_resistance,
                                            measurement_delay):

    from instruments.srs_sim970 import SIM970
    from instruments.srs_sim928 import SIM928

    voltage_meter = SIM970(
        'GPIB0::2',
        7)  #voltmeter = SIM970(visa_name = 'GPIB0::2', sim900port = 2)
    voltage_source = SIM928('GPIB0::2', 5)

    current_applied_vec = np.arange(current_range[0],
                                    current_range[1] + current_step,
                                    current_step)
    #SIM928 max voltage = [-20,20]V
    voltage_applied_vec = current_applied_vec * bias_resistance
    if 1 > 0:  #np.abs(voltage_applied_vec[0]) >= 20 or np.abs(voltage_applied_vec[-1]) >= 20:
        warnings.showwarning(
            'The SIM928 can only output in the range [-20,20]V. You have attempted to exceed this range.',
            UserWarning, os.path.basename(__file__),
            inspect.currentframe().f_back.f_lineno)

    voltage_read_vec = []
    voltage_source.reset()
    voltage_source.set_output(True)
    for ii in range(len(voltage_applied_vec)):
        voltage_source.set_voltage(voltage=voltage_applied_vec[ii])
        time.sleep(measurement_delay)
        voltage_read_vec.append(voltage_meter.read_voltage(channel=1))
    voltage_source.set_output(False)

    return voltage_read_vec
예제 #2
0
def iv_curve(v_min=0.0, v_max=0.5, Z_in=1e5, num_meas=501):
    """ Calculates values germane to producing an i-V curve of an SNSPD using
    the SRS SIM928 voltage source and SIM970 digital voltmeter.

    Parameters
    ----------
    v_min    : float, startpoint of voltage ramp (generally 0)
    v_max    : float, peak of voltage ramp
    Z_in     : float, value of current-limiting resistor
    num_meas : int  , number of values between start and peak (actual
                      experiment will run 4 times the length of this number)

    Returns
    -------
    (V,I) : tuple, voltage across DUT and bias current
    """

    # Initialising
    s28 = SIM928('GPIB0::4::INSTR', 4)
    s70 = SIM970('GPIB0::4::INSTR', 7)

    v_in = np.linspace(v_min, v_max, num_meas)
    v_in = np.append(v_in, np.flip(v_in, 0))  # Sweep voltages (triangle wave)
    v_in = np.append(v_in, -v_in)  # Adding negative voltages
    I = []
    V = []  # Bias current and V device
    s28.reset()
    s70.reset()
    s70.set_impedance(gigaohm=True, channel=2)

    # Measuring
    for i in range(len(v_in)):
        s28.set_voltage(voltage=v_in[i])  # Setting sweep voltage [V]
        time.sleep(1)
        v = s70.read_voltage(channel=1)  # Reading DVM 1 [V]
        V.append(s70.read_voltage(channel=2))  # Reading DVM 2 [V]
        I.append((v - V[i]) * 1e6 / Z_in)  # Calculating current [μA]

    s28.close()
    s70.close()
    return (V, I)
예제 #3
0
    sys.path.append(snspd_measurement_code_dir)
    sys.path.append(dir1)
    sys.path.append(dir2)
    sys.path.append(dir3)

#%%import modules

from instruments.srs_sim970 import SIM970
from instruments.srs_sim928 import SIM928

#%% setup
volt_channel = 1
set_voltage = 5.0
voltage_resistance = 10000
output_current = 2 * set_voltage / voltage_resistance
voltmeter = SIM970('GPIB0::4', 7)
source1 = SIM928('GPIB0::4', 1)
source2 = SIM928('GPIB0::4', 4)
voltmeter.set_impedance(True, volt_channel)
source1.set_voltage(voltage=set_voltage)
source2.set_voltage(voltage=set_voltage)
volt_sum = 0
volt_count = 0

#%%begin testing
source1.set_output(True)
source1.set_output(True)

while volt_count < 100:
    volt_count = volt_count + 1
    volt_sum = volt_sum + voltmeter.read_voltage(volt_channel)
예제 #4
0
from tqdm import tqdm
import datetime
import pickle
from matplotlib import pyplot as plt
from standard_measurements.iv_sweep import run_iv_sweeps, setup_iv_sweep
from instruments.rigol_dg5000 import RigolDG5000
from instruments.lecroy_620zi import LeCroy620Zi
from instruments.switchino import Switchino

#%%

from instruments.srs_sim970 import SIM970
from instruments.srs_sim928 import SIM928
from instruments.agilent_53131a import Agilent53131a

dmm = SIM970('GPIB0::4', 7)
dmm.set_impedance(gigaohm=True, channel=1)

vs_led = SIM928('GPIB0::4', 1)
vs_nw = SIM928('GPIB0::4', 4)
vs_led.reset()
vs_nw.reset()

counter = Agilent53131a('GPIB0::5::INSTR')
counter.reset()
counter.set_trigger(trigger_voltage=0.050, slope_positive=True)
counter.set_impedance(ohms=50)
counter.set_coupling(dc=True)
counter.setup_timed_count()

counter.write(':EVEN:HYST:REL 100')  # Set hysteresis (?)
예제 #5
0
def dark_counts(v_min=0.35,
                v_max=0.5,
                Z_in=1e5,
                num_meas=50,
                t_int=60,
                trig_volt=0.03,
                attenuation=0,
                show_plot=False,
                data_name='dark'):
    """ Measures dark counts detected for a ramp of I bias values using the SRS
    SIM928 voltage source and SIM970 digial voltmeter and the Agilent 53131A
    counter.

    Parameters
    ----------
    v_min       : float, startpoint of voltage ramp
    v_max       : float, peak of voltage ramp
    Z_in        : float, value of current-limiting resistor
    num_meas    : int  , number of values between start and peak
    t_int       : int  , integration time of the counter    
    trig_volt   : float, trigger voltage of the Agilent counter
    attenuation : int  , (optional) attenuation through JDSHA9 if using laser
    show_plot   : bool , show data plot within this function or return data

    Returns
    -------
    (I,counts) : tuple, bias current and number of counts
    """

    # Setting up instruments
    s28 = SIM928('GPIB0::4::INSTR', 4)
    s70 = SIM970('GPIB0::4::INSTR', 7)
    ag = Agilent53131a('GPIB0::5::INSTR')
    att = JDSHA9('GPIB0::15::INSTR')

    s28.reset()
    s70.reset()
    ag.basic_setup()
    ag.set_trigger(trigger_voltage=trig_volt, slope_positive=True)
    if attenuation != 0:
        att.set_beam_block(beam_block=False)
        att.set_attenuation_db(attenuation)
    att.close()
    s28.set_voltage(0)
    s28.set_output(True)
    ag.pyvisa.timeout = t_int * 1000 + 5000  # Stop timeout on longer integrations

    # Initialising vectors
    v_in = np.linspace(v_min, v_max, num_meas)  # Voltage ramp
    I = []
    counts = []  # Bias current and counts

    # Counting
    for i in range(len(v_in)):
        s28.set_voltage(voltage=v_in[i])  # Setting ramp voltage
        time.sleep(0.5)  # Letting voltage settle
        v = s70.read_voltage(channel=1)  # Reading source voltage
        V = s70.read_voltage(channel=2)  # Reading DUT voltage
        I.append((v - V) * 1e6 / Z_in)  # Calculating I bias
        counts.append(ag.timed_count(t_int))  # Number of counts
        s28.set_voltage(0)  # Resetting I bias
        time.sleep(0.5)  # Letting voltage settle

    s28.close()
    s70.close()
    ag.close()

    if show_plot:
        make_plot((I, counts),
                  xlab='Bias Current (uA)',
                  ylab='Countrate (Hz)',
                  title='Dark Counts',
                  d_name='dark')
    else:
        return (I, counts)