-
Notifications
You must be signed in to change notification settings - Fork 86
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
AFG3000: Add support for arbitrary waveform generation #132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please disable the execution of the notebook, for details on how to do it see here https://qcodes.github.io/Qcodes/examples/writing_drivers/Creating-Instrument-Drivers.html#Documentation
could you explain why? in particular, why 0.5 gets mapped to 0 and not to 1? i thought that +0.5 is on the right side of the range, hence it should be mapped to 1, no? or perhaps there's a typo in your example, perhaps you meant "voltage_low1 is +0.5V and voltage_high1 is -0.5V" (low votlage is higher than high voltage)? |
So the values we upload to the waveform are in the range 0..1, so 0.5 (note: not a voltage!) is in the middle of the range. The center of the range -0.5V..+0.5V is 0V, so that's why 0.5 is 0V. (Maybe using +-0.5V as an example range was confusing.) |
Ach, I always forget that! Done. |
aah! understood, thank you! then it's all correct :) but do you think it would be beneficial to also add function that would take an array of actual voltages, and then normalize it using voltage high/low settings and send the normalized 0..1-ranged data to the instrument? perhaps this will be less confusing for users (even though they still have to be aware of voltage high/low settings that they are using) |
Codecov Report
@@ Coverage Diff @@
## master #132 +/- ##
==========================================
- Coverage 19.24% 19.22% -0.03%
==========================================
Files 123 123
Lines 14629 14650 +21
==========================================
Hits 2816 2816
- Misses 11813 11834 +21
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Hm, this sounds like a good idea, I'll do that later today or tomorrow. Let's not merge before that. |
Should we then skip the 0..1 range completely? So we would have |
agree :) |
I started implementing this, but I realized that maybe passing the values as voltages doesn't actually make sense. When you upload a waveform, it's not associated with either of the channels, so we can't know what the voltage limits are. It's possible to output the same waveform on channel 1 and channel 2 with different limits by setting |
I added the bounds checks, IMO this can be merged now. |
indeed, that's fair! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you fix the mypy errors https://github.com/QCoDeS/Qcodes_contrib_drivers/runs/6573274474?check_suite_focus=true ? they are largely caused by typos or applying operations to a "List[float]" that it does not support (a solution could be to np.array(that_list_of_floats)
before doing the operations)
This doesn't completely work. For some reason, after the query, the AFG keeps spitting out data (self.visa_handle.read_raw() returns some data), and I couldn't figure out what to do with it based on the manual. So this is mostly a curiosity that I will revert.
This reverts commit 0dbf56b.
This is easier to understand if the voltage_low/hi is asymmetric.
This should make mypy happy.
650af77
to
5a327c9
Compare
Hello again.
This PR adds support for uploading arbitrary waveform data to the AFG3000 series devices. It also contains an example notebook demonstrating this functionality. Tested on a real AFG3252.
I have one comment and one question:
voltage_low1
...voltage_high1
. Now, for example ifvoltage_low1
is -0.5V andvoltage_high1
is +0.5V,0.5
gets mapped to 0V which might be a bit confusing. But I think this is still the most sensible way to do it if the voltage range is asymmetric.Note that the commit history also contains a failed attempt at reading back the waveform data from the AFG memory, mostly as a curiosity.