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

double gate devices part 9 (Transfer measurement)

parent a4be7391
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id:890af4e0-af4e-49e7-9236-d7980e435edb tags:
``` python
import plotly.express as px
import numpy as np
import pandas as pd
from pathlib import Path
#directory = r""
#namepython = "8__"
#pathpython = Path(directory) / namepython
#path = Path(directory) / (namepython + "A.txt")
display(a)
fig_a = px.scatter(a, x="VDS/V", y="IDmm/mA/mm", color="VGS/V",
width=1300, height=800);
fig_a.show()
print("################################################################################################################################################\n\n\n")
display(d)
d["IGmm/mA/mm"] = d["IGmm/mA/mm"].abs()
fig_d = px.scatter(d, log_y=True, x="VGS/V", y="IGmm/mA/mm", width=1300,
height=800,);
#fig_d.update_yaxes(range=[np.log10(1e-6), np.log10(50)]);
fig_d.show();
print("################################################################################################################################################\n\n\n")
display(u)
fig_uID = px.scatter(u, log_y=True, x="VGS/V", y="IDmm/mA/mm",
color="VDS/V", width=1300, height=800, );
#fig_d.update_yaxes(range=[np.log10(1e-6), np.log10(250)]);
fig_uID.show();
fig_uIG = px.scatter(u, log_y=False, x="VGS/V", y="IGmm/mA/mm",
width=1300, height=800,);
fig_uIG.show();
d["IGmm/mA/mm"] = d["IGmm/mA/mm"].abs()
fig_uIG2 = px.scatter(u, log_y=True , x="VGS/V", y="IGmm/mA/mm",
width=1300, height=800,);
fig_uIG2.show();
fig_ugm = px.scatter(u, log_y=False, x="VGS/V", y="gm/mS/mm",
color="VDS/V", width=1300, height=800,);
#fig_ugm.update_xaxes(range=[-3, 2.5])
fig_ugm.show();
```
......@@ -88,18 +88,16 @@ def on_start_clicked(b):
Setup(device) #setup the device
if transfer_check.value == True:
mode = mode(transfer_gates.value)
if transfer_gates.value =='VTG':
#check the values
vtg_ok = check_values(Vtg_transfer,'primary')
vds_ok =check_values(Vds_transfer,'secondary')
if vtg_ok == True and vds_ok == True:
#calculate number of points for var2(VDS)
points = number_of_points(Vds_transfer['start'],Vds_transfer['step'],Vds_transfer['stop'])
points = number_of_points(Vds_transfer)
#configure smus
smu1 = device.smu_dict()
smu1.update(vname ='VTG',iname = 'ITG',mode ='V',func='VAR1')
var1 = device.var1_dict()
var1.update(
mode=Vtg_transfer['hyst'].value,
......@@ -109,11 +107,8 @@ def on_start_clicked(b):
comp =Vtg_transfer['comp'].value,
pcomp=Vtg_transfer['pcomp'].value
)
smu1.update(VAR1=var1)
smu2 = device.smu_dict()
smu2.update(vname ='VDS',iname ='ID',mode='V',func='VAR2')
var2=device.var2_dict()
var2.update(
start=Vds_transfer['start'].value,
......@@ -122,22 +117,33 @@ def on_start_clicked(b):
comp=Vds_transfer['comp'].value,
pcomp=Vds_transfer['pcomp'].value
)
smu2.update(VAR2=var2)
smu3 = device.smu_dict()
smu3.update(vname='VBG',iname ='IBG',mode='V',func='VARD')
vard = device.vard_dict()
ratio,offset = calcualte_line(Vtg_transfer,Vbg_transfer)
vard.update(
offset = offset,
ratio = ratio,
comp = Vbg_transfer['comp'].value,
pcomp = Vbg_transfer['pcomp'].value
)
smu3.update(VARD=vard)
smu4 = device.smu_dict()
smu4.update(vname ='VS',iname = 'IS',mode = 'COMM',func='CONS')
# Setup SMUs
device.setup_smu(1,smu1)
device.setup_smu(2,smu2)
device.setup_smu(3,smu3)
device.setup_smu(4,smu4)
device.setup_var1(var1)
device.setup_var2(var2)
device.integration_time(integration_transfer.value)
device.display_mode("LIST")
variables_list = ["VTG","ITG","VDS","ID"]
device.variables_to_save(variables_list)
device.single_measurement()
while device.operation_completed == False:
pass
results= dict([(variable,device.return_values(variable)) for variable in variables_list])
# create dataframe
#execute measurement
values=Transfer(smu1,smu2,smu3,smu4,integration_transfer.value,device)
......
......@@ -127,7 +127,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.12.0"
}
},
"nbformat": 4,
......
......@@ -93,10 +93,10 @@ def plot_gatediode(x,y,norm_unit = "mA/mm"):
def number_of_points(start,step,stop):
def number_of_points(dict):
try:
diff = stop.value - start.value
ratio = abs(diff/step.value)
diff = dict['stop'].value - dict['start'].value
ratio = abs(diff/dict['step'].value)
points = int(ratio+1)
except ZeroDivisionError:
......@@ -297,13 +297,6 @@ def calculate_line(VTG,VBG):
offset = VBG['start'].value-ratio*VTG['start'].value
return ratio,offset
#return active units
def mode(tuple):
if len(tuple)==2:
mode = 3 #both gates are sweeped
elif len(tuple)==1 and tuple[0]=="VBG":
mode = 2
else:
mode = 1
return mode
\ No newline at end of file
......@@ -4,7 +4,25 @@
import sys
sys.path.insert(0, '..') #append parent directory
import hp4155a
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
#Get dataframe from results
def get_dataframe_from_results(dict):
for old_key in results.keys():
if old_key[0]=='I':
new_key = old_key+"/A"
else: #V
new_key = old_key + "/V"
dictionary[new_key] = dictionary.pop(old_key)
df = pd.DataFrame(results)
return df
def Setup(device):
device.reset()
......@@ -15,21 +33,52 @@ def Setup(device):
#disable all irrelevant units
device.disable_not_smu()
def Transfer(smu1,smu2,smu3,smu4,integration,device):
def Transfer(config,device):
#set all the smus
#smu2 and smu4 stay always the same during the transfer curve
smu2 = device.smu_dict()
smu2.update(vname ='VDS',iname ='ID',mode='V',func='VAR2')
smu4 = device.smu_dict()
smu4.update(vname ='VS',iname = 'IS',mode = 'COMM',func='CONS')
if config['mode'] =='VTG':
smu1 = device.smu_dict()
smu1.update(vname ='VTG',iname = 'ITG',mode ='V',func='VAR1')
smu3 = device.smu_dict()
smu3.update(vname='VBG',iname ='IBG',mode='V',func='COMM') #Here VBG is grounded
variables_list =["VTG","ITG","VDS","ID"]
elif config['mode'] =='VBG':
smu1 = device.smu_dict()
smu1.update(vname ='VTG',iname = 'ITG',mode ='V',func='COMM')#Here VTG is grounded
smu3 = device.smu_dict()
smu3.update(vname='VBG',iname ='IBG',mode='V',func='VAR1')
variables_list=["VDS","ID","VBG","IBG"]
else:#Both gates
smu1 = device.smu_dict()
smu1.update(vname ='VTG',iname = 'ITG',mode ='V',func='VAR1')#Here VTG is grounded
smu3 = device.smu_dict()
smu3.update(vname='VBG',iname ='IBG',mode='V',func='VARD')
variables_list=["VTG","ITG","VDS","ID","VBG","IBG"]
device.setup_smu(1,smu1)
device.setup_smu(2,smu2)
device.setup_smu(3,smu3)
device.setup_smu(4,smu4)
device.setup_var1(smu1['VAR1'])
device.setup_var2(smu2['VAR2'])
device.setup_vard(smu3['VARD'])
device.integration_time(integration)
device.setup_var1(config["VAR1"])
device.setup_var2(config["VAR2"])
if config["mode"]=='BOTH'
device.setup_vard(vard)
device.display_mode("LIST")
device.integration_time(config["integration"])
variables_list = ["VTG","ITG","VDS","ID","VBG","IBG"]
device.display_mode("LIST")
device.variables_to_save(variables_list)
device.single_measurement()
......@@ -38,7 +87,24 @@ def Transfer(smu1,smu2,smu3,smu4,integration,device):
values = dict([(variable,device.return_values(variable)) for variable in variables_list])
return values
df = get_dataframe_from_results(values)
points = config["VAR2"]["points"]
df["IDmm/uA/um"]= df["ID/A"]*norm
if 'ITG' in variables_list:
df["ITGmm/uA/um"]= df["ITG/A"]*norm
if 'IBG' in variables_list:
df["IBGmm/uA/um"]= df["IBG/A"]*norm
return df
def Output(smu1,smu2,smu3,smu4,integration,device):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment