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

ADU new version

parent 4e2a1d65
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id:6defdb49-06c2-469d-beb5-bc2e147e3f79 tags: %% Cell type:code id:6defdb49-06c2-469d-beb5-bc2e147e3f79 tags:
``` python ``` python
%run ADU.py %run ADU.py
``` ```
%% Output %% Output
%% Cell type:code id:e95955c1-f401-4e5d-ba89-9ce1ef5938ef tags: %% Cell type:code id:161fa296-6fec-4456-93a3-88c8de25d63f tags:
``` python
device.step_sweep(-0.5)
```
%% Cell type:code id:39866d34-c518-45cf-aee6-b62c6c9be603 tags:
``` python ``` python
print(device.error()) print(device.error())
``` ```
%% Output %% Output
-286,"Program runtime error" +0,"No error"
%% Cell type:code id:3312e10e-0e0b-43e5-a77b-018332246b2b tags: %% Cell type:code id:b7d94e11-0971-49af-885d-be300f88dbd3 tags:
``` python
device.inst.write(":PAGE:MEAS:VAR1:MODE SING;SPAC LIN;STAR 1;STOP -7;STEP -3E-2;COMP 1.000000E-2;PCOM 0.000000E+0;")
```
%% Output
97
%% Cell type:code id:455d7da2-96a8-470f-ad86-99a8b5fa6a79 tags:
``` python
import numpy as np
Idmm=device.inst.query_ascii_values(":DATA? 'IDmm'",container =list)
```
%% Cell type:code id:15537ae8-499c-4df6-a30d-b1131d10a717 tags:
``` python
print(Idmm)
```
%% Output
[614.44, 636.68, 612.66, 635.4, 606.05, 634.59, 599.8, 633.1, 594.65, 631.41, 590.63, 624.16, 594.72, 618.88, 595.42, 613.34, 596.03, 607.71, 598.51, 600.82, 600.83, 593.72, 602.85, 587.51, 604.39, 581.58, 605.01, 576.64, 605.72, 571.72, 605.38, 567.51, 604.55, 564.1, 597.92, 568.24, 593.01, 569.13, 587.69, 569.81, 582.23, 572.04, 575.24, 574.37, 568.23, 576.52, 562.06, 578.08, 556.2, 579.01, 551.32, 579.61, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307, 9.91e+307]
%% Cell type:code id:66cbd77c-a94e-42bc-9d3f-efe5fef545aa tags:
``` python
print(type(Idmm))
```
%% Output
<class 'list'>
%% Cell type:code id:e29138ac-e7eb-40c5-86f2-5cabc95f6ecd tags:
``` python
print(len(Idmm))
```
%% Output
501
%% Cell type:code id:3ae7dbfc-5157-4af5-8021-dab372604260 tags:
``` python
Vgs_transfer['step'].value=-Vgs_transfer['step'].value
print(Vgs_transfer['step'].value)
```
%% Output
0.05
%% Cell type:code id:4e63e5c2-0835-4a6a-ae97-f9bf3cdc6308 tags:
``` python
Test(device)
```
%% Cell type:code id:0be3f6f2-b61c-41c3-8a21-24671ac3432f tags:
``` python ``` python
``` ```
......
from interface import * from interface import *
from help import * from help import *
from measurements import * from measurements_new import *
# Create the grids # Create the grids
...@@ -47,7 +47,7 @@ print() ...@@ -47,7 +47,7 @@ print()
#output #output
output_check,integration_output = header('Output Curve') output_check,integration_output = header('Output Curve')
Vds_output = primary('Vds',0,0.1,15,0.1) Vds_output = primary('Vds',0,0.1,15,0.1)
Vgs_output = primary('Vgs',2,-1,-8,0.01) Vgs_output = secondary('Vgs',2,-1,-8,0.01)
print() print()
print() print()
...@@ -64,22 +64,85 @@ output = widgets.Output() ...@@ -64,22 +64,85 @@ output = widgets.Output()
display(button,output) display(button,output)
device = module.HP4155a('GPIB0::17::INSTR') device = hp4155a.HP4155a('GPIB0::17::INSTR')
def on_start_clicked(b): def on_start_clicked(b):
with output: with output:
clear_output()
#disable all widgets #disable all widgets
#connect to the device
Setup(device)
Vds_transfer_points = number_of_points(Vds_transfer['start'].value,Vds_transfer['step'].value,Vds_transfer['stop'].value) Setup(device) #setup the device
Vgs,Vds,Idmm,gm=Transfer((Vgs_transfer['start'].value),(Vgs_transfer['step'].value),(Vgs_transfer['stop'].value),(Vgs_transfer['comp'].value),(Vds_transfer['start'].value),(Vds_transfer['step'].value),Vds_transfer_points,(Vds_transfer['comp'].value),(integration_transfer.value),(Vgs_transfer['hyst'].value),device)
plot_transfer(Vgs,Idmm,gm,Vds_transfer_points) #start measurements
print(Vgs) if test_contacts.value == True:
print(Vds) Test(device)
if transfer_check.value == True:
#calculate number of points for var2(VDS)
points = number_of_points(Vds_transfer['start'].value,Vds_transfer['step'].value,Vds_transfer['stop'].value)
#check values(later)
#configure smus
smu1 = device.smu_dict()
smu1.update(vname ='VS1',iname = 'IS1',mode = 'COMM',func='CONS')
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,step=Vds_transfer['step'].value,points=points,comp=Vds_transfer['comp'].value,pcomp=Vds_transfer['pcomp'].value)
smu2.update(VAR2=var2)
smu3 = device.smu_dict()
smu3.update(vname='VGS',iname ='IG',mode='V',func='VAR1')
var1=device.var1_dict()
var1.update(mode=Vgs_transfer['hyst'].value,start=Vgs_transfer['start'].value,stop=Vgs_transfer['stop'].value,step=Vgs_transfer['step'].value,comp =Vgs_transfer['comp'].value,pcomp=Vgs_transfer['pcomp'].value)
smu3.update(VAR1=var1)
smu4 = device.smu_dict()
smu4.update(vname ='VS2',iname = 'IS2',mode = 'COMM',func='CONS')
#execute measurement
Vgs,Vds,Idmm,gm=Transfer(smu1,smu2,smu3,smu4,integration_transfer.value,device)
#plot results
clear_output()
plot_transfer(Vgs,Idmm,gm,points)
#save results(later)
if output_check.value == True:
#calculate number of points for var2(VGS)
points = number_of_points(Vgs_output['start'].value,Vgs_output['step'].value,Vgs_output['stop'].value)
#check values(later)
#configure smus
smu1 = device.smu_dict()
smu1.update(vname ='VS1',iname = 'IS1',mode = 'COMM',func='CONS')
smu2 = device.smu_dict()
smu2.update(vname ='VDS',iname ='ID',mode='V',func='VAR1')
smu3 = device.smu_dict()
smu3.update(vname='VGS',iname ='IG',mode='V',func='VAR2')
smu4 = device.smu_dict()
smu4.update(vname ='VS2',iname = 'IS2',mode = 'COMM',func='CONS')
#set var1(Vds) and var2(Vfs)
var2=device.var2_dict()
var2.update(start=Vgs_output['start'].value,step=Vgs_output['step'].value,points=points,comp=Vgs_output['comp'].value,pcomp=Vgs_output['pcomp'].value)
var1=device.var1_dict()
var1.update(mode=Vds_output['hyst'].value,start=Vds_output['start'].value,stop=Vds_output['stop'].value,step=Vds_output['step'].value,comp =Vds_output['comp'].value,pcomp=Vds_output['pcomp'].value)
smu2.update(VAR1=var1)
smu3.update(VAR2=var2)
#execute measurement
Vgs,Vds,Idmm,Igmm = Output(smu1,smu2,smu3,smu4,integration_output.value,device)
#plot results
clear_output()
plot_output(Vds,Idmm,Igmm,points)
#save results(later)
button.on_click(on_start_clicked) button.on_click(on_start_clicked)
......
import ipywidgets as widgets import ipywidgets as widgets
from ipywidgets import GridspecLayout,Layout from ipywidgets import GridspecLayout,Layout
from IPython.display import clear_output
def header(name): def header(name):
header_grid = GridspecLayout(1,4) header_grid = GridspecLayout(1,3)
style = {'description_width': 'initial'} style = {'description_width': 'initial'}
options_integration=["SHORt","MEDium","LONG"] options_integration=["SHORt","MEDium","LONG"]
header_grid[0,0]=widgets.Checkbox(description = name,value = True,indent = False) header_grid[0,0]=widgets.Checkbox(description = name,value = True,indent = False)
header_grid[0,3] = widgets.Dropdown(layout=Layout(height='auto', width='auto'),options=options_integration,value="MEDium",description='Integration Time',style =style)#integration time header_grid[0,2] = widgets.Dropdown(layout=Layout(height='auto', width='auto'),options=options_integration,value="MEDium",description='Integration Time',style =style)#integration time
display(header_grid) display(header_grid)
print() print()
check = header_grid[0,0] check = header_grid[0,0]
integration = header_grid[0,3] integration = header_grid[0,2]
return check, integration return check, integration
...@@ -35,12 +36,12 @@ def primary(name,start,step,stop,comp): ...@@ -35,12 +36,12 @@ def primary(name,start,step,stop,comp):
#third line #third line
primary_grid[2,0]=widgets.Label("Compliance(A)",layout=Layout(height='auto', width='auto')) primary_grid[2,0]=widgets.Label("Compliance(A)",layout=Layout(height='auto', width='auto'))
#primary_grid[2,1] =widgets.Label("Power Compliance(W) (0=OFF)",layout=Layout(height='auto', width='auto'))#mind the gap primary_grid[2,1] =widgets.Label("Power Compliance(W) (0=OFF)",layout=Layout(height='auto', width='auto'))#mind the gap
primary_grid[2,2] =widgets.Label("Hysterisis",layout=Layout(height='auto', width='auto'))#mind the gap primary_grid[2,2] =widgets.Label("Hysterisis",layout=Layout(height='auto', width='auto'))#mind the gap
#fourth line #fourth line
primary_grid[3,0]=widgets.BoundedFloatText(value=comp,min=-0.1,max=0.1,step=0.01,layout=Layout(height='auto', width='auto')) primary_grid[3,0]=widgets.BoundedFloatText(value=comp,min=-0.1,max=0.1,step=0.01,layout=Layout(height='auto', width='auto'))
#primary_grid[3,1]=widgets.BoundedFloatText(value=0,min=0,max=2,step=0.1,layout=Layout(height='auto', width='auto'))#mind the gap primary_grid[3,1]=widgets.BoundedFloatText(value=0,min=0,max=2,step=0.1,layout=Layout(height='auto', width='auto'))#mind the gap
primary_grid[3,2]=widgets.Dropdown(options=['SINGle','DOUBle'],value='SINGle',layout=Layout(height='auto', width='auto'))#mind the gap primary_grid[3,2]=widgets.Dropdown(options=['SINGle','DOUBle'],value='SINGle',layout=Layout(height='auto', width='auto'))#mind the gap
parameters = { parameters = {
...@@ -49,7 +50,7 @@ def primary(name,start,step,stop,comp): ...@@ -49,7 +50,7 @@ def primary(name,start,step,stop,comp):
'stop': primary_grid[1,2], 'stop': primary_grid[1,2],
'comp': primary_grid[3,0], 'comp': primary_grid[3,0],
'hyst':primary_grid[3,2], 'hyst':primary_grid[3,2],
#'pcomp':primary_grid[3,1] 'pcomp':primary_grid[3,1]
} }
display(primary_grid) display(primary_grid)
......
...@@ -47,7 +47,7 @@ def Test(device): ...@@ -47,7 +47,7 @@ def Test(device):
cons_smu2.update(value=10,comp=0.1) cons_smu2.update(value=10,comp=0.1)
device.setup_cons_smu(2,cons_smu2) device.setup_cons_smu(2,cons_smu2)
device.integration_time('MED') device.integration_time('SHOR')
device.user_function('Gm','mS/mm','1E4*DIFF(ID,VGS)') device.user_function('Gm','mS/mm','1E4*DIFF(ID,VGS)')
device.user_function('IDmm','mA/mm','1E4*ID') device.user_function('IDmm','mA/mm','1E4*ID')
device.user_function('IGmm','mA/mm','1E4*IG') device.user_function('IGmm','mA/mm','1E4*IG')
...@@ -98,7 +98,70 @@ def Transfer(smu1,smu2,smu3,smu4,integration,device): ...@@ -98,7 +98,70 @@ def Transfer(smu1,smu2,smu3,smu4,integration,device):
return Vgs,Vds,Idmm,gm return Vgs,Vds,Idmm,gm
def Output(smu1,smu2,smu3,smu4,integration,device):
#setup all smus
device.setup_smu(1,smu1)
device.setup_smu(2,smu2)
device.setup_smu(3,smu3)
device.setup_smu(4,smu4)
device.setup_var2(smu3['VAR2'])
device.setup_var1(smu2['VAR1'])
device.integration_time(integration)
device.del_user_functions()
device.user_function('IDmm','mA/mm','1E4*ID')
device.user_function('IGmm','mA/mm','1E4*IG')
#display
device.display_variable('X','VDS')
device.display_variable('Y1','IDmm')
device.display_variable('Y2','IGmm')
device.single_measurement()
device.wait()
device.autoscaling()
Vds=device.return_values('VDS')
Idmm=device.return_values('IDmm')
Igmm=device.return_values('IGmm')
Vgs=device.return_values('VGS')
return Vgs,Vds,Idmm,Igmm
def Gatediode(smu1,smu3,sm4,integration,device):
#setup all smus
device.setup_smu(1,smu1)
device.smu_disable(2)
device.setup_smu(3,smu3)
device.setup_smu(4,smu4)
device.setup_var1(smu3['VAR1'])
device.integration_time(integration)
device.del_user_functions()
#define user functions
device.user_function('IGmm','mA/mm','1E4*IG')
device.user_function('ABSIGm','mA/mm','ABS(IGmm)')
#display
device.display_variable('X','VDS')
device.display_variable('Y1','IDmm')
device.display_variable('Y2','IGmm')
device.single_measurement()
device.wait()
device.autoscaling()
Vgs=device.return_values('VGS')
Igmm=device.return_values('IGmm')
abs_Igmm=device.return_values('ABSIGm')
return Vgs,Igmm,abs_Igmm
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment