Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Climate Lab Test Stand
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MSK-SW
Low-Level Radio Frequency
Climate Lab
Climate Lab Test Stand
Commits
04e6f635
Commit
04e6f635
authored
2 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
introduce wait_until so the readout interval is not affected by the communication time
parent
c8c1d5dc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Python_script/prototype.py
+12
-2
12 additions, 2 deletions
Python_script/prototype.py
Python_script/test_stand_parameter.json
+1
-1
1 addition, 1 deletion
Python_script/test_stand_parameter.json
with
13 additions
and
3 deletions
Python_script/prototype.py
+
12
−
2
View file @
04e6f635
...
@@ -92,6 +92,9 @@ class Measurements:
...
@@ -92,6 +92,9 @@ class Measurements:
number_of_soaking_reads
=
next_soaking
/
self
.
sleep_time
+
1
number_of_soaking_reads
=
next_soaking
/
self
.
sleep_time
+
1
do_another_measurement
=
True
do_another_measurement
=
True
#next_read_time is the starttime of the second read (i.e. read after this one). The time of
#this read (i.e. the first read in the measurement) is now().
next_read_time
=
self
.
clock
.
time
()
+
self
.
sleep_time
while
do_another_measurement
:
while
do_another_measurement
:
# wait until set point is reached (+soaking time)
# wait until set point is reached (+soaking time)
magnitudes_queue
=
[]
magnitudes_queue
=
[]
...
@@ -148,7 +151,8 @@ class Measurements:
...
@@ -148,7 +151,8 @@ class Measurements:
print
(
'
SOAKING FINISHED!
'
)
print
(
'
SOAKING FINISHED!
'
)
break
break
else
:
else
:
self
.
clock
.
sleep
(
self
.
sleep_time
)
self
.
sleep_until
(
next_read_time
)
next_read_time
+=
self
.
sleep_time
# perform the configured number of measurements and check that they are really stable
# perform the configured number of measurements and check that they are really stable
# It started running after everything become stable
# It started running after everything become stable
...
@@ -171,7 +175,8 @@ class Measurements:
...
@@ -171,7 +175,8 @@ class Measurements:
if
(
self
.
temperature_stable
and
self
.
humidity_stable
and
self
.
magnitude_stable
and
if
(
self
.
temperature_stable
and
self
.
humidity_stable
and
self
.
magnitude_stable
and
self
.
phase_stable
):
self
.
phase_stable
):
print
(
'
Stable measurement
'
+
str
(
i
+
1
)
+
'
/
'
+
str
(
next_reads
))
print
(
'
Stable measurement
'
+
str
(
i
+
1
)
+
'
/
'
+
str
(
next_reads
))
self
.
clock
.
sleep
(
self
.
sleep_time
)
self
.
sleep_until
(
next_read_time
)
next_read_time
+=
self
.
sleep_time
else
:
else
:
all_measurements_stable
=
False
all_measurements_stable
=
False
print
(
'
Measurement not stable. Retrying.
'
)
print
(
'
Measurement not stable. Retrying.
'
)
...
@@ -193,6 +198,11 @@ class Measurements:
...
@@ -193,6 +198,11 @@ class Measurements:
standby_response
=
self
.
chamber
.
set_mode
(
'
STANDBY
'
)
standby_response
=
self
.
chamber
.
set_mode
(
'
STANDBY
'
)
print
(
standby_response
)
print
(
standby_response
)
def
sleep_until
(
self
,
wakeup_time
):
remaining_sleep_time
=
wakeup_time
-
self
.
clock
.
time
()
if
remaining_sleep_time
>
0
:
self
.
clock
.
sleep
(
remaining_sleep_time
)
def
read_data
(
self
):
def
read_data
(
self
):
[
temp
,
hum
,
mode
,
alarms
]
=
self
.
chamber
.
read_monitor
().
split
(
'
,
'
)
[
temp
,
hum
,
mode
,
alarms
]
=
self
.
chamber
.
read_monitor
().
split
(
'
,
'
)
power
=
self
.
vna
.
get_current_power
()
power
=
self
.
vna
.
get_current_power
()
...
...
This diff is collapsed.
Click to expand it.
Python_script/test_stand_parameter.json
+
1
−
1
View file @
04e6f635
{
"delta_temp"
:
0.1
,
"delta_hum"
:
1
,
"delta_mag"
:
0.1
,
"delta_phase"
:
0.02
,
"sleep_time"
:
1.0
,
"frequency"
:
1300000000
,
"vna_config_file"
:
"climate-lab.znxml"
}
{
"delta_temp"
:
0.1
,
"delta_hum"
:
1
,
"delta_mag"
:
0.1
,
"delta_phase"
:
0.02
,
"sleep_time"
:
1
0
.0
,
"frequency"
:
1300000000
,
"vna_config_file"
:
"climate-lab.znxml"
}
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