Skip to content
Snippets Groups Projects
Commit 5d65d66a authored by Alexandros Asonitis's avatar Alexandros Asonitis
Browse files

added resistance after sampling check and delay for operation completed

parent c2a0efbc
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,12 @@ def sweep(start,stop,step,comp,integration,device):
#time.sleep(5)
device.stop_value_sweep(stop)
#time.sleep(5)
if start < stop and step < 0 :
step = -step
elif start > stop and step > 0 :
step = -step
device.step_sweep(step)
#time.sleep(5)
device.comp('VAR1',comp)
......@@ -63,7 +69,7 @@ def sweep(start,stop,step,comp,integration,device):
#execute measurement
device.single_measurement()
while device.operation_completed()==False:
pass
time.sleep(2)
device.autoscaling()
......@@ -103,7 +109,7 @@ def sampling_check(voltage,device):
device.display_variable('Y1','R')
device.single_measurement()
while device.operation_completed() == False:
pass
time.sleep(2)
device.autoscaling()
try:
......@@ -143,7 +149,7 @@ def retention(voltage,period,duration,device):
device.display_variable('Y1','R')
device.single_measurement()
while device.operation_completed() == False:
pass
time.sleep(2)
device.autoscaling()
try:
......
......@@ -222,8 +222,8 @@ def on_set_button_clicked(b):
if valid == True:
if sampling.value == True: #do sampling set before set process(100mV)
R_mean = sampling_check(0.1,device)
print(f"Average Resistance(Sampling Check):{R_mean} Ohm")
R_mean_before = sampling_check(0.1,device)
print(f"Average Resistance(Sampling Check):{R_mean_before:e} Ohm")
first_sampling = False
#execute measurement,plot results and save them
......@@ -231,14 +231,18 @@ def on_set_button_clicked(b):
plot_sweep(V12,I12,'SET')
df = create_data_frame(V12,I12)
print(df)
title = f"SET Memristor:"+"\n\n"+f"Set Voltage={Vset.value}V"+"\n"+f"current compliance={CC_vset.value}A"+"\n"
write_to_file(temp_file,title,df)
if sampling.value == True: #do sampling set after set process(10mV)
R_mean = sampling_check(0.01,device)
print(f"Average Resistance(Sampling Check):{R_mean} Ohm")
R_mean_after = sampling_check(0.01,device)
print(f"Average Resistance(Sampling Check):{R_mean_after:e} Ohm")
first_sampling = False
title = f"SET Memristor:"+"\n\n"+f"Set Voltage={Vset.value}V"+"\n"+f"current compliance={CC_vset.value}A"+"\n"
if sampling.value == True:
title = title + f"R(Ohm) Before/After"+"\n"+f"{R_mean_before} {R_mean_after}"+"\n"
write_to_file(temp_file,title,df)
#upload results
temp_file,file,folder=upload_results(temp_file,file,folder)
#show messagebox
......@@ -271,8 +275,8 @@ def on_reset_button_clicked(b):
if valid == True:
if sampling.value == True: #do sampling set before reset process(10mV)
R_mean = sampling_check(0.01,device)
print(f"Average Resistance(Sampling Check):{R_mean} Ohm")
R_mean_before = sampling_check(0.01,device)
print(f"Average Resistance(Sampling Check):{R_mean_before:e} Ohm")
first_sampling = False
#execute measurement,plot results and save them
......@@ -280,14 +284,18 @@ def on_reset_button_clicked(b):
plot_sweep(V34,I34,'RESET')
df = create_data_frame(V34,I34)
print(df)
title =f"RESET Memristor:"+"\n\n"+f"Reset Voltage={Vreset.value}V"+"\n"+f"current compliance={CC_vreset.value}A"+"\n"
write_to_file(temp_file,title,df)
if sampling.value == True: #do sampling set after reset process(100mV)
R_mean = sampling_check(0.1,device)
print(f"Average Resistance(Sampling Check):{R_mean} Ohm")
R_mean_after = sampling_check(0.1,device)
print(f"Average Resistance(Sampling Check):{R_mean_after:e} Ohm")
first_sampling = False
title =f"RESET Memristor:"+"\n\n"+f"Reset Voltage={Vreset.value}V"+"\n"+f"current compliance={CC_vreset.value}A"+"\n"
if sampling.value == True:
title = title + f"R(Ohm) Before/After"+"\n"+f"{R_mean_before} {R_mean_after}"+"\n"
write_to_file(temp_file,title,df)
#upload results
temp_file,file,folder=upload_results(temp_file,file,folder)
#show messagebox
......@@ -351,15 +359,15 @@ def on_full_button_clicked(b):
#execute number of measurements
for i in range(number.value):#here it is easier to implement the sampling checks
if sampling.value == True: #before set(100mv)
R_mean = sampling_check(0.1,device)
resistances.append(R_mean)
R_mean_before = sampling_check(0.1,device)
resistances.append(R_mean_before)
V12,I12 = sweep(0,Vset.value,step.value,CC_vset.value,integration_time.value,device) #set
#after set/before set
if sampling.value == True: #before set(10mv)
R_mean = sampling_check(0.01,device)
resistances.append(R_mean)
R_mean_after = sampling_check(0.01,device)
resistances.append(R_mean_after)
V34,I34 = sweep(0,Vreset.value,step.value,CC_vreset.value,integration_time.value,device) #reset
......@@ -373,6 +381,8 @@ def on_full_button_clicked(b):
df = create_data_frame(V,I)
f.write(f"{i+1} Iteration")
f.write("\n")
if sampling.value == True:
f.write(f"R(Ohm) Before(set)/After(set)"+"\n"+f"{R_mean_before} {R_mean_after}"+"\n")
f.write(df.to_string())
f.write("\n\n")
......
%% Cell type:code id:df99f5a2-80af-4892-8633-33177239e444 tags:
``` python
%run memristor.py
```
%% Output
%% Cell type:code id:9613a247-7ebb-46b8-ae8f-5d4ba21e5d43 tags:
%% Cell type:code id:a8266885-3aa9-4abf-9b02-575a783f3fab tags:
``` python
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment