Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sayma SAWG produces distorted output at certain amplitudes #1039

Closed
sbourdeauducq opened this issue Jun 1, 2018 · 12 comments
Closed

Sayma SAWG produces distorted output at certain amplitudes #1039

sbourdeauducq opened this issue Jun 1, 2018 · 12 comments

Comments

@sbourdeauducq
Copy link
Member

sbourdeauducq commented Jun 1, 2018

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
Copy link
Member Author

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

@sbourdeauducq
Copy link
Member Author

Also not fixed by JESD update to m-labs/jesd204b@25fd79d

@marmeladapk
Copy link
Contributor

Reproduced:

tek00037

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

@jordens
Copy link
Member

jordens commented Jun 6, 2018

Thanks.

@jbqubit
Copy link
Contributor

jbqubit commented Jun 6, 2018

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

@hartytp
Copy link
Collaborator

hartytp commented Jun 8, 2018

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

@jordens
Copy link
Member

jordens commented Jun 8, 2018

@hartytp any channel

@hartytp
Copy link
Collaborator

hartytp commented Jun 8, 2018

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
Copy link
Collaborator

hartytp commented Jun 8, 2018

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
Copy link
Contributor

jbqubit commented Jun 9, 2018

@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
Copy link
Member Author

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

@hartytp
Copy link
Collaborator

hartytp commented Jun 10, 2018

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants