Commit 0de4bd05 authored by Yb Tweezer's avatar Yb Tweezer
Browse files

make tau_andor a scannable parameter, add parity projection block; regular adjustment of parameters

parent f715071a
......@@ -15,7 +15,7 @@ comments = """
# CAMERA OPTIONS
camera_config = {
"exposure_time": 500,
"exposure_time": 300,
"gain": 47.99,
"gamma": 1.25,
"black_level": 5.0,
......@@ -38,16 +38,16 @@ camera_config = {
reps = 50 # repeat shots for statistics
clk_freq = 10e6 # serial_bits clock frequency; Hz
take_background = False # include a background image
flir_two_shots = True # use the Flir to take two shots
flir_two_shots = False # use the Flir to take two shots
check_556_tweezer = False # use the 556 tweezer instead of the probe beams
# timings (not to scale)
# | tau_all |
# start | t0 | tau_ncool | tau_twzr_load | tau_dark | tau_probe | end
# | | |
# <tau_comp> | |
# | <tau_flir> |
# | | <tau_andor>
# | tau_all |
# start | t0 | tau_ncool | tau_twzr_load | tau_pp | tau_dark | tau_probe | end
# | | |
# <tau_comp> | |
# | <tau_flir> |
# | | <tau_andor>
# | t_ramp | tau_ramp | tau_hold |
# |
# <tau_ref>
......@@ -57,25 +57,27 @@ tau_blue_overlap = 2e-3 # overlap time of blue beams with green beams relative t
tau_ncool = 100e-3 # narrow cooling/compression time; s
tau_comp = 46e-3 # start compression ramping relative to beginning of narrow cooling; s
T_COMP = t0 + tau_comp + np.linspace(0.0, 4e-3, 51) # compression ramp times
tau_twzr_load = 10e-3 # time to load into tweezers; s
tau_twzr_load = 100e-3 # time to load into tweezers; s
tau_dark = 27e-3 # shutter opening time for EMCCD; s
tau_probe = 50e-3 # probe imaging time; s
tau_all = tau_ncool + tau_twzr_load + tau_dark + tau_probe # main sequence time; s
tau_pp = 0e-3 # parity projection time; s
tau_probe = 100e-3 # probe imaging time; s
tau_all = tau_ncool + tau_twzr_load + tau_pp + tau_dark + tau_probe # main sequence time; s
# camera timings
tau_flir = -30e-3 # Flir camera time relative to end of narrow cooling; s
tau_flir_second = tau_twzr_load + 0.1e-3 # second Flir shot relative to end of narrow cooling; s
tau_andor = +27.0e-3 # EMCCD camera time relative to end of tweezer loading; s
tau_flir = -10e-3 # Flir camera time relative to end of narrow cooling; s
tau_flir_second = tau_twzr_load + tau_pp + tau_dark + 0.1e-3 # second Flir shot relative to end of narrow cooling; s
TAU_ANDOR = np.linspace(0.0e-3, 400e-3, 9) # EMCCD camera time relative to end of dark period; s
TAU_ANDOR = np.array([0.0e-3])
# tau_andor = -17.0e-3
# coil settings
# EMCCD range: FB[] x UD[]
SHIMS_FB = np.linspace(1.275, 1.275, 1) # Front/Back shim scans: 1.22; +1.2 for 174
SHIMS_LR = np.linspace(-0.22, -0.22, 1) # Left/Right shim scans: 0.20; -0.2 for 174
SHIMS_FB = np.linspace(1.255, 1.255, 1) # Front/Back shim scans: 1.22; +1.2 for 174
SHIMS_LR = np.linspace(0.165, 0.165, 1) # Left/Right shim scans: 0.20; -0.2 for 174
# SHIMS_LR = np.append(
# np.linspace(-0.30, -0.12, 5),
# np.linspace(+0.12, +0.30, 5),
# )
SHIMS_UD = np.linspace(0.555, 0.555, 1) # Up/Down shim scans: 0.57; +0.4 for 174
SHIMS_UD = np.linspace(0.565, 0.565, 1) # Up/Down shim scans: 0.57; +0.4 for 174
B_blue = int(441815) # blue MOT gradient setting
B_green = int(44182 * 1.25) # 174: 1.25 -> 1.1
bits_Bset = int(20) # number of bits in a servo setting
......@@ -83,10 +85,12 @@ bits_DACset = int(4) # number of bits in a DAC-mode setting
B_COMP = np.linspace(B_green, B_green * 1.8, T_COMP.shape[0]) # compression ramp values
# detunings
DET_MOT = np.linspace(0e-3, 0e-3, 1) # green MOT detuning for tweezer loading (rel. to CMOT); MHz
DET_PROBE = 3.58 + np.linspace(0.0, 0.0, 1) # probe beam or detuning for imaging (rel. to AOM center); MHz
DET_MOT = np.linspace(+0.9, +0.9, 1) # green MOT detuning for tweezer loading (rel. to CMOT); MHz
DET_PROBE = 3.68 + np.linspace(-0.4, -0.4, 1) # probe beam detuning for imaging (rel. to AOM center); MHz
# DET_PP = 3.68 + np.linspace(-1.0, +1.0, 11) # green MOT detuning for parity projection (rel. to AOM center); MHz
DET_PP = 3.68 + np.linspace(+0.8, +0.8, 1)
det_block = 10 # shift the RF on the MOT beams to decouple the fiber; MHz
det_556_tweezer = 3.58 # detuning on the 556 tweezer (probe) path (rel. to AOM center); MHz
det_556_tweezer = 3.68 # detuning on the 556 tweezer (probe) path (rel. to AOM center); MHz
## MOGRF TABLE PARAMETERS
# general
......@@ -105,10 +109,10 @@ nu_ramp = 3.58 # extent of ramp; MHz
# power parameters
p_ramp_beg = 29.0 # start of ramp; dBm
p_ramp_end = 0.0 # end of ramp; dBm
p_probe = 23.0 # power in probe beam AOMs; dBm
p_probe = 14.0 # power in probe beam AOMs; dBm
p_556_tweezer = -10.0 # power in the 556 tweezer (probe) AOM; dBm
def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float) \
def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau_andor: float) \
-> SuperSequence:
SEQ = SuperSequence(
outdir.joinpath("sequences"),
......@@ -125,7 +129,7 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float) \
"EMCCD": (Sequence()
+ Sequence.digital_pulse(
*C.andor_trig,
t0 + tau_ncool + tau_twzr_load + tau_andor - 27e-3, # shutter time
t0 + tau_ncool + tau_twzr_load + tau_pp + tau_dark + tau_andor - 27e-3, # shutter time
10e-3 # pulse length is arbitrary; currently set to exposure time
)
).with_color("C2"),
......@@ -245,11 +249,17 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float) \
t0 + tau_ref - 5e-3, # the mogtable is triggered on a falling edge
t0 + tau_ref
)
+ [ # don't use the shutter to turn off the CMOT
Event.digital1(
**C.mot3_green_sh, s=1)
@ (t0 - 5e-3)
]
# + [ # don't use the shutter to turn off the CMOT
# Event.digital1(
# **C.mot3_green_sh, s=1)
# @ (t0 - 5e-3)
# ]
+ Sequence.digital_hilo(
*C.mot3_green_sh,
t0 - 1e-3,
t0 + tau_ncool + tau_twzr_load + tau_pp,
)
+ Sequence.serial_bits_c(
C.mot3_coils_sig,
t0,
......@@ -319,7 +329,7 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float) \
SEQ["Green imaging"] = (Sequence()
+ Sequence.digital_pulse(
*C.probe_green_aom,
t0 + tau_ncool + tau_twzr_load + tau_dark,
t0 + tau_ncool + tau_twzr_load + tau_pp + tau_dark,
tau_probe,
invert=True
)
......@@ -370,7 +380,8 @@ seq_bkgd = SuperSequence(
}, CONNECTIONS)
# DEFINE MOGRF SEQUENCE
def make_mot_mogtable(mot_det: float):
def make_mot_mogtable(mot_det: float, pp_det: float):
# def make_mot_mogtable(mot_det: float):
# ramp_N is number of steps, not points, so use ramp_N + 1 for number of points
RAMP_T = np.linspace(t_ramp - tau_ref, t_ramp - tau_ref + tau_ramp, ramp_N + 1)
RAMP_F = np.linspace(f_ramp, f_ramp + nu_ramp, ramp_N + 1)
......@@ -387,10 +398,14 @@ def make_mot_mogtable(mot_det: float):
# apply detuning for loading
<< MOGEvent(frequency=RAMP_F[-1] + mot_det)
@ (RAMP_T[-1] + tau_hold + 1.7e-3) # unknown source of timing error
# apply detuning for parity projection
<< MOGEvent(frequency=90.0 + pp_det)
@ (RAMP_T[-1] + tau_hold + tau_twzr_load + 1.7e-3) # unknown source of timing error
# detune and depower the MOT beams for loading tweezers after the CMOT ramp
# is finished
<< MOGEvent(frequency=RAMP_F[-1] + det_block, power=-50.0)
@ (RAMP_T[-1] + tau_hold + tau_twzr_load + 1.7e-3) # unknown source of timing error
@ (RAMP_T[-1] + tau_hold + tau_twzr_load + tau_pp + 1.7e-3) # unknown source of timing error
)
return mogtable
......@@ -409,58 +424,75 @@ class NarrowCoolingTweezerAlignment(Controller):
# .configure_trigger()
# )
self.mog = MOGRF.connect()
self.tb = TIMEBASE.connect()
if not check_556_tweezer:
self.tb.set_amplitude(p_probe)
self.mog = MOGRF.connect().set_mode(1, "TSB")
if check_556_tweezer:
(self.mog
.set_frequency(2, 90.0 + det_556_tweezer).set_power(2, p_556_tweezer)
)
self.tb = TIMEBASE.connect()
if not check_556_tweezer:
self.tb.set_amplitude(p_probe)
# pre-construct all sequences and mogtables so we don't have to do it
# in the main loop
print("[control] pre-computing sequences ... ", end="", flush=True)
self.names = list()
self.sequences = list()
self.ssequences = list()
for fb, lr, ud in product(SHIMS_FB, SHIMS_LR, SHIMS_UD):
name = f"fb={fb:.5f}_lr={lr:.5f}_ud={ud:.5f}"
sseq = make_sequence(name, fb, lr, ud)
for fb, lr, ud, tau_andor in product(SHIMS_FB, SHIMS_LR, SHIMS_UD, TAU_ANDOR):
name = f"fb={fb:.5f}_lr={lr:.5f}_ud={ud:.5f}_tau-andor={tau_andor:.5f}"
sseq = make_sequence(name, fb, lr, ud, tau_andor)
self.sequences.append(sseq.to_sequence())
self.ssequences.append(sseq)
# track the mogtables separately because they're slow to load to the controller
# they should be the slowest-varying parameter in scans
self.mot_mogtables = [make_mot_mogtable(d_mot) for d_mot in DET_MOT]
print("done")
self.mot_mogtables = [make_mot_mogtable(d_mot, d_pp) for d_mot, d_pp in product(DET_MOT, DET_PP)]
# self.mot_mogtables = [make_mot_mogtable(d_mot) for d_mot in DET_MOT]
print(f"done ({len(self.mot_mogtables) * len(DET_PROBE) * len(self.sequences) * reps})")
def run_sequence(self, *args):
for table in self.mot_mogtables:
fmt = ("\r "
+ " ".join(
f"{{:{int(np.log10(len(X))) + 1:.0f}}}/{len(X)}"
for X in [self.mot_mogtables, DET_PROBE, self.sequences, range(reps)]
)
+ " ({:6.2f}%) "
)
N = [len(X) for X in [self.mot_mogtables, DET_PROBE, self.sequences, range(reps)]]
NN = [np.prod(N[-k:]) for k in range(1, len(N))][::-1] + [1]
TOT = np.prod(N)
for i, table in enumerate(self.mot_mogtables):
(self.mog
.set_frequency(1, 90.0).set_power(1, -50.0) # make sure the AOM is off
.set_mode(1, "TSB")
.table_load(1, table)
.table_arm(1)
.set_table_rearm(1, True)
.table_arm(1)
)
for d_probe in DET_PROBE:
for j, d_probe in enumerate(DET_PROBE):
(self.tb
.set_frequency(90.0 + d_probe)
)
for seq in self.sequences:
for k, seq in enumerate(self.sequences):
for rep in range(reps):
print(fmt.format(
i + 1, j + 1, k + 1, rep + 1,
100.0 * (sum(q * nnq for q, nnq in zip([i, j, k, rep], NN)) + 1) / TOT
), end="", flush=True)
(self.comp
.enqueue(seq)
.run()
.run(printflag=False)
.clear()
)
(self.mog
.table_stop(1)
.table_clear(1)
)
print("")
if take_background:
print("background")
(self.comp
.enqueue(seq_bkgd.to_sequence())
.run()
......@@ -571,20 +603,22 @@ class NarrowCoolingTweezerAlignment(Controller):
# # sseq.save()
def cmd_visualize(self, *args):
seq = make_sequence("", SHIMS_FB.mean(), SHIMS_LR.mean(), SHIMS_UD.mean())
seq = make_sequence("", SHIMS_FB.mean(), SHIMS_LR.mean(), SHIMS_UD.mean(), TAU_ANDOR.mean())
try:
tmin, tmax = float(args[0]), float(args[1])
except IndexError:
tmin, tmax = 0.0, seq.max_time()
P = seq.draw_detailed(mogtables=[
( make_mot_mogtable(DET_MOT.max()).with_color("C6"),
( make_mot_mogtable(DET_MOT.mean(), DET_PP.mean()).with_color("C6"),
dict(name="Green MOT AOM", offset=t0 + tau_ref) ),
])
for t in [
t0,
t0 + tau_ncool,
t0 + tau_ncool + tau_twzr_load,
t0 + tau_ncool + tau_twzr_load + tau_probe,
t0 + tau_ncool + tau_twzr_load + tau_pp,
t0 + tau_ncool + tau_twzr_load + tau_pp + tau_dark,
t0 + tau_ncool + tau_twzr_load + tau_pp + tau_dark + tau_probe,
]:
P.axvline(t, color="r", linestyle="-", linewidth=0.4)
for t in [
......@@ -596,7 +630,7 @@ class NarrowCoolingTweezerAlignment(Controller):
for t in [
t0 + tau_comp,
t0 + tau_ncool + tau_flir,
t0 + tau_ncool + tau_twzr_load + tau_andor,
t0 + tau_ncool + tau_twzr_load + tau_pp + tau_dark + TAU_ANDOR.mean(),
]:
P.axvline(t, color="b", linestyle=":", linewidth=0.4)
(P
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment