8000 Phase control of Tektronix AFG3152C by FlyingCurryMonster · Pull Request #588 · pymeasure/pymeasure · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Phase control of Tektronix AFG3152C #588

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

Closed

Conversation

FlyingCurryMonster
Copy link

I was using the AFG3152C and noticed I couldn't control the phase of the signal with pymeasure, so I added in Instrument.control method for that.

Copy link
Contributor
@LongnoseRob LongnoseRob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the addition of the phase-control properties!

I found a small mistake in the doc-string for the phase_deg property.

Comment on lines 132 to 137
phase_deg = Instrument.control(
"phase:adjust?", "phase:adjust %e DEG",
""" A floating point property that controls the phase in radian units.
This property can be set.""",
validator=strict_range,
values = PHASE_LIMIT['DEG']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a simple c&p mistake, for this property the text should be changed to "... in degrees."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.
Also, do both controls really have the same query string? I guess the reply/instrument state depends on which unit/control was last used when setting the phase?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops yea it was a copy and paste mistake. And the string is actually different for phase_rad and phase_deg. phase_deg ends with %e DEG, while phase_rad ends with %e RAD.

Copy link
Member
@bilderbuchi bilderbuchi Mar 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant the get_command argument is the same (phase:adjust?) -- what's up with that? what happens if you do

print(instr.phase_deg)
print(instr.phase_rad)

Do they show the same phase with different units?

Copy link
Author
@FlyingCurryMonster FlyingCurryMonster Mar 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to 8000 others. Learn more.

Thanks for clarifying, I'm still quite new to the library and using python apis.

It looks like phase_deg won't return the phase in degrees unless it's been set previously to degrees. This also seems to be an issue with the get commands of amp_vpp and amp_vrms (haven't tried amp_dbm). My AFG is being used in an ongoing measurement right now, but I wonder if just added the units RAD/DEG like so:

'phase:adjust RAD?'
'phase:adjust DEG?'

would give the query back in the desired units.

also apologies for the late replies, I've been busy with coursework lately.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to have this confirmed. Such statefulness in instruments/command sets is always annoying.
To answer your question, I guess you need to study the manual and/or try it out when the instrument is free again.

@bilderbuchi
Copy link
Member
bilderbuchi commented Mar 4, 2022

The linter found some formatting issues (check in the changed files view, or run flake8 locally) :-)

@BenediktBurger
Copy link
Member

Hey @FlyingCurryMonster , do you want to pick this PR up again or not?

@BenediktBurger BenediktBurger added instrument stale Pending author response labels Feb 20, 2024
@FlyingCurryMonster
Copy link
Author

For sure, apologies I've been busy with apparatus development.

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

Successfully merging this pull request may close these issues.

4 participants
0