Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
artiq_experiments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Nunez Barreto
artiq_experiments
Commits
36f6cd21
Commit
36f6cd21
authored
3 years ago
by
Lucas Giardino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CARLA: tests para probar urukul+pmt con el dashboard
parent
5079b18a
master
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1933 additions
and
0 deletions
+1933
-0
exp1_vcd.vcd
artiq_master/repository/exp1_vcd.vcd
+1754
-0
exp_1.py
artiq_master/repository/exp_1.py
+87
-0
test_ttl
artiq_master/repository/test_ttl
+92
-0
No files found.
artiq_master/repository/exp1_vcd.vcd
0 → 100644
View file @
36f6cd21
This diff is collapsed.
Click to expand it.
artiq_master/repository/exp_1.py
0 → 100644
View file @
36f6cd21
from
artiq.experiment
import
*
class
Set_All_Urukul_Freqs
(
EnvExperiment
):
"""Exp1_test
Set the frecuencies/amplitudes of every Urukul channel
"""
def
build
(
self
):
# sets core device drivers as attributes
self
.
setattr_device
(
"core"
)
self
.
pmt
=
self
.
get_device
(
"ttl0"
)
# global attenuation
self
.
setattr_argument
(
"attenuation"
,
NumberValue
(
0
*
dB
,
unit
=
'dB'
,
scale
=
dB
,
min
=
0
*
dB
,
max
=
31
*
dB
),
)
for
ch
in
range
(
4
):
# sets urukul0, channel 0-3 device drivers as attributes
self
.
setattr_device
(
f
"urukul0_ch{ch}"
)
### This two attributes will be shown in the GUI grouped by channel
# use/don't use each channel
self
.
setattr_argument
(
f
"state_ch{ch}"
,
BooleanValue
(
ch
==
0
),
f
"canal_{ch}"
)
# each channel's frequency
self
.
setattr_argument
(
f
"freq_ch{ch}"
,
NumberValue
(
200.0
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
f
"canal_{ch}"
)
# each channel's amplitude
self
.
setattr_argument
(
f
"amp_ch{ch}"
,
NumberValue
(
0.5
,
min
=
0.
,
max
=
1.
),
f
"canal_{ch}"
)
self
.
all_amps
=
[
self
.
amp_ch0
,
self
.
amp_ch1
,
self
.
amp_ch2
,
self
.
amp_ch3
]
self
.
all_freqs
=
[
self
.
freq_ch0
,
self
.
freq_ch1
,
self
.
freq_ch2
,
self
.
freq_ch3
]
self
.
states
=
[
self
.
state_ch0
,
self
.
state_ch1
,
self
.
state_ch2
,
self
.
state_ch3
]
self
.
all_channels
=
[
self
.
urukul0_ch0
,
self
.
urukul0_ch1
,
self
.
urukul0_ch2
,
self
.
urukul0_ch3
]
self
.
use_amps
=
[]
self
.
use_freqs
=
[]
self
.
use_channels
=
[]
for
state
,
ch_n
,
freq_n
,
amp_n
in
zip
(
self
.
states
,
self
.
all_channels
,
self
.
all_freqs
,
self
.
all_amps
):
if
state
:
self
.
use_channels
.
append
(
ch_n
)
self
.
use_freqs
.
append
(
freq_n
)
self
.
use_amps
.
append
(
amp_n
)
@
kernel
def
run
(
self
):
self
.
core
.
reset
()
# self.pmt.reset()
self
.
pmt
.
input
()
# initialises CPLD all the selected channels
for
channel
in
self
.
use_channels
:
channel
.
cpld
.
init
()
channel
.
init
()
delay
(
10
*
ms
)
for
i
in
range
(
len
(
self
.
use_channels
)):
# writes global attenuation and specific
# frequency and amplitude variables to each
# urukul channel outputting function
self
.
use_channels
[
i
]
.
set_att
(
self
.
attenuation
)
#self.use_channels[i].set_amplitude(self.use_amps[i])
self
.
use_channels
[
i
]
.
set
(
self
.
use_freqs
[
i
],
amplitude
=
self
.
use_amps
[
i
])
# turn on every selected channel
for
i
in
range
(
4
):
if
self
.
states
[
i
]
==
True
:
self
.
all_channels
[
i
]
.
sw
.
on
()
else
:
self
.
all_channels
[
i
]
.
sw
.
off
()
delay
(
2
*
s
)
pulsos
=
self
.
pmt
.
count
(
self
.
pmt
.
gate_both
(
3
*
us
))
delay
(
2
*
s
)
print
(
pulsos
)
This diff is collapsed.
Click to expand it.
artiq_master/repository/test_ttl
0 → 100644
View file @
36f6cd21
from artiq.experiment import *
class Set_All_Urukul_Freqs(EnvExperiment):
"""Exp1_test
Set the frecuencies/amplitudes of every Urukul channel
"""
def build(self):
# sets core device drivers as attributes
self.setattr_device("core")
self.pmt = self.get_device("ttl0")
# global attenuation
self.setattr_argument("attenuation",
NumberValue(0*dB, unit='dB', scale=dB, min=0*dB, max=31*dB),
)
for ch in range(4):
# sets urukul0, channel 0-3 device drivers as attributes
self.setattr_device(f"urukul0_ch{ch}")
### This two attributes will be shown in the GUI grouped by channel
# use/don't use each channel
self.setattr_argument(f"state_ch{ch}", BooleanValue(ch==0), f"canal_{ch}")
# each channel's frequency
self.setattr_argument(f"freq_ch{ch}",
NumberValue(200.0*MHz, unit='MHz', scale=MHz, min=1*MHz, max=400*MHz),
f"canal_{ch}")
# each channel's amplitude
self.setattr_argument(f"amp_ch{ch}",
NumberValue(0.5, min=0., max=1.),
f"canal_{ch}")
self.all_amps = [self.amp_ch0, self.amp_ch1, self.amp_ch2, self.amp_ch3]
self.all_freqs = [self.freq_ch0, self.freq_ch1, self.freq_ch2, self.freq_ch3]
self.states = [self.state_ch0, self.state_ch1, self.state_ch2, self.state_ch3]
self.all_channels = [self.urukul0_ch0, self.urukul0_ch1, self.urukul0_ch2, self.urukul0_ch3]
self.use_amps = []
self.use_freqs = []
self.use_channels = []
for state, ch_n, freq_n, amp_n in zip(self.states, self.all_channels,
self.all_freqs, self.all_amps):
if state:
self.use_channels.append(ch_n)
self.use_freqs.append(freq_n)
self.use_amps.append(amp_n)
@kernel
def run(self):
self.core.reset()
# self.pmt.reset()
self.pmt.input()
delay(1*s)
pulsos=self.pmt.count(self.pmt.gate_both(1*s))
delay(1*s)
# initialises CPLD all the selected channels
for channel in self.use_channels:
channel.cpld.init()
channel.init()
delay(10 * ms)
for i in range(len(self.use_channels)):
# writes global attenuation and specific
# frequency and amplitude variables to each
# urukul channel outputting function
self.use_channels[i].set_att(self.attenuation)
#self.use_channels[i].set_amplitude(self.use_amps[i])
self.use_channels[i].set(self.use_freqs[i], amplitude=self.use_amps[i])
# turn on every selected channel
for i in range(4):
if self.states[i] == True:
self.all_channels[i].sw.on()
else:
self.all_channels[i].sw.off()
print("AAAAA")
delay(1*s)
# self.core.break_realtime()
# print("BBBBBBBBBBB")
print(pulsos)
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment