Skip to content
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

voltageSweepSingleSMU (pulsed) hangs or rises error codes #17

Open
martin3366 opened this issue Oct 31, 2020 · 1 comment
Open

voltageSweepSingleSMU (pulsed) hangs or rises error codes #17

martin3366 opened this issue Oct 31, 2020 · 1 comment

Comments

@martin3366
Copy link

martin3366 commented Oct 31, 2020

The keithley_driver.py drastically simplifies working with Keithley 2651A when performing DC sweep. But running the "voltageSweepSingleSMU" with "pulsed" setting, such that the power source operates only in "pulsed mode area" (outside of DC area) causes that the function hangs on keithley_driver.py line 927:
# while loop that runs until the sweep begins
while self.status.operation.sweeping.condition == 0:
time.sleep(0.1)

OR the function "voltageSweepSingleSMU" returns successfully, but after the execution, the error codes are set:
-286: TSP Runtime error at line 1: attempt to index field `smub' (a nil value)
5028: SMU A: Cannot perform requested operation while source autorange is enabled
1011: Parameter too big

The measured values re being often (not always!) incorrect (the sweep is not finished, the higher values, usually above 20 [V] are change and go back to 0[V]). Keithley 2651A should be able to perform "pulsed" sweep up to 40[V] and 50[A]. The test is performed for a device that reaches 5[A] at 27[V], which is above the DC operation, but well within the "pulsed" mode limit.

The code below should reproduce the behavior.

#%% Import
from keithley2600 import Keithley2600 # uses pyvisa to produce an object/session to represent Keithley 2651A
import numpy as np # arrays and operations on arrays
import time # timing (sleep)
import matplotlib.pyplot as plt # plotting

#%% User input
v_reverse = 15.0 # [V] (less than 40 [V])
v_reverse_max = 40 # [V]
i_reverse_max = 20 # [V] Only pulsed operation
v_reverse_len = 5


#%% Perform measurement
k = Keithley2600('TCPIP0::192.168.0.101::inst0::INSTR')
k.connect()

time.sleep(1.0)
if( not k.connected ):
    raise TypeError("Device not connected")
print('connect: OK')

k.smua.reset()
print('reset: OK')

k.smua.source.output = k.smua.OUTPUT_ON   # turn on SMUA
print('measure: START')

#%% Memory allocation   
v_meas = np.zeros((v_reverse_len,1))
i_meas = np.zeros((v_reverse_len,1))

#%% reverse measurement
k.smua.source.limitv = v_reverse_max # set voltage limit
k.smua.source.limiti = i_reverse_max # set current limit

#[v_meas, i_meas] = k.voltageSweepSingleSMU(smu=k.smua, smu_sweeplist=np.arange(0,v_reverse,3), t_int=0.001, delay=0.1, pulsed=True)
#print('measure: reverse END')
[v_meas, i_meas] = k.voltageSweepSingleSMU(smu=k.smua, smu_sweeplist=[20], t_int=0.001, delay=0.1, pulsed=True)
print('measure: reverse END')

errs_end = k.readErrorQueue()  # gets all entries from error queue
print('read errors: OK')

#k.smua.nvbuffer1.clear()  # clears nvbuffer1 of SMUA
#print('clear buffer: OK')

k.smua.source.output = k.smua.OUTPUT_OFF   # turn off SMUA
print('output off: OK')

k.disconnect()
print('disconnect: OK')

#%% Plotting
plt.plot(v_meas, i_meas)
plt.plot(v_meas, i_meas, 'ro')
plt.ylabel('I [A]')
plt.xlabel('V [V]')
plt.xlim(-5, 40)
plt.ylim(-0.2, 0.2)
plt.show()
@samschott
Copy link
Member

Thanks for the report.

I have never tested the driver with the 2651A model and the available commands are generated from the reference manual for the series 2600B. While the instruments share most commands, the availability of some settings seems to be different (e.g., voltage limits, etc), causing issues with the custom sweep functions.

The measured values re being often (not always!) incorrect

This is very confusing. It looks some state may be retained from a previous sweep but I am not sure how. As for the specific errors:

  • -286: TSP Runtime error at line 1: attempt to index field 'smub' (a nil value). This occurs because the 2651A model only has a single SMU and the sweep script tells the Keithley to display the currents from both SMUs. The error is safe to ignore.
  • 5028: SMU A: Cannot perform requested operation while source autorange is enabled: Not sure where this is coming from.
  • 1011: Parameter too big: also no idea. But I suspect this may be related to the issue with the sweeps.

Could set raise_keithley_errors to True and run through the sweep line by line to see which lines exactly raise errors on the Keithley?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants