Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
labcode
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CST
labcode
Commits
5d65d66a
Commit
5d65d66a
authored
1 year ago
by
Alexandros Asonitis
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
hp4155/memristor/help.py
+11
-5
11 additions, 5 deletions
hp4155/memristor/help.py
hp4155/memristor/memristor.py
+27
-17
27 additions, 17 deletions
hp4155/memristor/memristor.py
hp4155/memristor/memristor_buttons.ipynb
+5
-5
5 additions, 5 deletions
hp4155/memristor/memristor_buttons.ipynb
with
43 additions
and
27 deletions
hp4155/memristor/help.py
+
11
−
5
View file @
5d65d66a
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
hp4155/memristor/memristor.py
+
27
−
17
View file @
5d65d66a
...
...
@@ -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
"
)
...
...
This diff is collapsed.
Click to expand it.
hp4155/memristor/memristor_buttons.ipynb
+
5
−
5
View file @
5d65d66a
...
...
@@ -9,7 +9,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
a20406ad111145a8804514f54e9079eb
",
"model_id": "
3db799d41b744e6393e9be0717b52d24
",
"version_major": 2,
"version_minor": 0
},
...
...
@@ -30,7 +30,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
f8ebfdb43fdd4d3eabc6e482baa6dcf1
",
"model_id": "
b1d5791d7a1f46c6823fec8ca948a6a5
",
"version_major": 2,
"version_minor": 0
},
...
...
@@ -51,7 +51,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b
22d980d9eb444cf966c7c30bd02c59a
",
"model_id": "b
9f1a1409ca844ca9f1948fb0730203c
",
"version_major": 2,
"version_minor": 0
},
...
...
@@ -65,7 +65,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "
4b511a4dec9a47fc8f0572a7b8c7a112
",
"model_id": "
6d9709c5b99e4c72ab752b51d05e606f
",
"version_major": 2,
"version_minor": 0
},
...
...
@@ -84,7 +84,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "
9613a247-7ebb-46b8-ae8f-5d4ba21e5d43
",
"id": "
a8266885-3aa9-4abf-9b02-575a783f3fab
",
"metadata": {},
"outputs": [],
"source": []
...
...
%% 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
```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment