m-labs / artiq

A leading-edge control system for quantum information experiments
https://m-labs.hk/artiq
GNU Lesser General Public License v3.0
437 stars 201 forks source link

Sayma SAWG produces distorted output at certain amplitudes #1039

Closed sbourdeauducq closed 6 years ago

sbourdeauducq commented 6 years ago
from artiq.experiment import *

class SAWGTest(EnvExperiment):
    def build(self):
        self.setattr_device("core")
        self.setattr_device("sawg1")

    @kernel
    def run(self):
        self.core.reset()
        self.sawg1.reset()
        delay(300 * us)

        self.sawg1.frequency0.set(10*MHz)
        self.sawg1.amplitude1.set(0.5)

Looks relatively normal: screenshot-2018-6-1 tek e scope

Then change the amplitude to 0.2: screenshot-2018-6-1 tek e scope 1

sbourdeauducq commented 6 years ago

Might be a duplicate of #1022 indeed - I am not sure.

sbourdeauducq commented 6 years ago

Also not fixed by JESD update to https://github.com/m-labs/jesd204b/commit/25fd79dbf9d5b9536482f11a4d716747479191ec

marmeladapk commented 6 years ago

Reproduced:

tek00037

Artiq: c28fe47, Misoc: 86c6fcb, Migen: 6425844, jesd204b: 25fd79d

jordens commented 6 years ago

Thanks.

jbqubit commented 6 years ago

@marmeladapk Thanks for reproducing! @jordens Do you think this could be SAWG (vs JESD)?

hartytp commented 6 years ago

Does this work for all sawgs? e.g. can I use sawg0?

jordens commented 6 years ago

@hartytp any channel

hartytp commented 6 years ago

Flashed this to the startup kernel:

from artiq.experiment import *

class SAWGTest(EnvExperiment):
    def build(self):
        self.setattr_device("core")
        self.setattr_device("sawg0")

    @kernel
    def run(self):
        self.core.reset()
        self.sawg0.reset()
        delay(300 * us)

        self.sawg0.frequency0.set(10*MHz)
        self.sawg0.amplitude1.set(0.2)

Hooked up microscope probes to Sayma https://github.com/hartytp/artiq/tree/sawg_probes

+----------+------+----------+
|  Group   | Name |  Value   |
+----------+------+----------+
|  sawg0   |  a1  |   0x0    |
| sawg0_a1 |  xo  |  0xf87   |
| sawg0_a1 |  yo  |  0xf87   |
| sawg0_b  | xo0  |  0x7f8c  |
| sawg0_b  | yo0  | 0xffb787 |
| sawg0_b  | xo1  |  0x62eb  |
| sawg0_b  | yo1  |  0x9a89  |
| sawg0_b  | xo2  |  0x92dc  |
| sawg0_b  | yo2  | 0xff984e |
| sawg0_b  | xo3  | 0xff9ce9 |
| sawg0_b  | yo3  | 0xff9622 |
+----------+------+----------+

Edit: dac output looks very distorted.

hartytp commented 6 years ago

amplitude to 0.5 gives a good sine and

+----------+------+----------+
|  Group   | Name |  Value   |
+----------+------+----------+
|  sawg0   |  a1  |   0x0    |
| sawg0_a1 |  xo  |  0x26d3  |
| sawg0_a1 |  yo  |  0x26d3  |
| sawg0_b  | xo0  |  0x2ef2  |
| sawg0_b  | yo0  | 0xff21d6 |
| sawg0_b  | xo1  | 0xff3f38 |
| sawg0_b  | yo1  |  0x32b6  |
| sawg0_b  | xo2  |  0xe3a9  |
| sawg0_b  | yo2  |  0xd052  |
| sawg0_b  | xo3  | 0xffca1f |
| sawg0_b  | yo3  |  0x3105  |
+----------+------+----------+
jbqubit commented 6 years ago

@jordens Is this still open? cf https://irclog.whitequark.org/m-labs/2018-06-09#22299432; Closed status following commit implies to me that I can reproduce fix by rebuilding.

sbourdeauducq commented 6 years ago

@jbqubit Please try it, the Sayma in HK is currently broken. https://irclog.whitequark.org/m-labs/2018-06-09#1528542903-1528545687;

hartytp commented 6 years ago

This bug seems fixed now.

See the following video: https://drive.google.com/file/d/1_Wkg8eDb3q3fVKrkaSxhvNfwyYxdB2Y1/view?usp=sharing

Code:

from artiq.experiment import *
import numpy as np

class SAWGTest(EnvExperiment):
    def build(self):
        self.setattr_device("core")
        self.setattr_device("sawg0")
        self.amps = np.linspace(0., 1., num=1000)

    @kernel
    def run(self):
        self.core.reset()
        self.sawg0.reset()
        delay(300 * us)

        while True:
            for amp in self.amps:
                self.sawg0.frequency0.set(10*MHz)
                self.sawg0.amplitude1.set(amp)
                delay(10*ms)