Skip to content

Fix SR830 lock-in amplifier unit error #7016

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

liuyichao82
Copy link

Fixed the issue that the units of the parameters "R", "X", "Y" of the SR830 lock-in amplifier were incorrect.
(should be current "A" but were written as voltage "V")

@liuyichao82 liuyichao82 requested a review from a team as a code owner March 30, 2025 04:20
@liuyichao82
Copy link
Author

@microsoft-github-policy-service agree

Copy link

codecov bot commented Mar 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.92%. Comparing base (dee6288) to head (723b1ce).
Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7016   +/-   ##
=======================================
  Coverage   59.92%   59.92%           
=======================================
  Files         342      342           
  Lines       31426    31426           
=======================================
  Hits        18832    18832           
  Misses      12594    12594           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jenshnielsen
Copy link
Collaborator

@liuyichao82 Could you provide some documentation that the output unit is A (current)
In the manual I see

image

Which explicitly says that the output unit of this command is either V or degree.

Page 5-15 in this pdf https://www.thinksrs.com/downloads/pdfs/manuals/SR830m.pdf

@liuyichao82
Copy link
Author

Sorry for the late reply. The confusion comes from how the SR830 handles current input: it converts current to voltage internally using a transimpedance gain (e.g., 1 MΩ = 1 V/µA). So even in current mode, OUTP? returns volts, not amps. When I saw that the value I read using the current mode was in voltage, I thought there was something wrong with the program.Maybe we need to add ISRC? to determine the current input mode. Thanks for catching this!
屏幕截图 2025-04-04 225243

@jenshnielsen
Copy link
Collaborator

Thanks @liuyichao82 I suspect that the qcodes driver does not capture that usecase. If you can find a way to make the driver work better in current mode (while still retaining the functionality in voltage mode) We are happy to merge that.

@liuyichao82
Copy link
Author

I noticed that there is a _set_units function in the driver to set the units correctly. I will find an SR830 machine in a few days to continue testing why this function didn't work when I used it last time.

@liuyichao82
Copy link
Author

First of all, I need to admit that I made a mistake earlier: when using the SR830 to read, you don't need to consider the transimpedance gain. I believe that the manual's statement that the units returned are always volts is a typo. I tested it with my SR830, and the unit error mentioned earlier will only appear after connecting the instrument and changing input configuration. When connecting the instrument, self.input_config() will be executed to ensure that the units are correct at the time. This error can actually be fixed - just ask ISRC? every time you ask OUTP?, but doing so means asking twice for each reading, which will cause additional resource overhead, and the benefit is only to correct the unit error that sometimes occurs. Is this cost-effective?

@liuyichao82
Copy link
Author

I should add that what I just said about "changing input configuration" refers to manual adjustment through the SR830 front panel rather than using qcodes adjustment. If use the input_config parameter to change, the unit will automatically adjust correctly, so I think there is nothing wrong with the program if use qcodes completely, and no changes are needed.

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

Successfully merging this pull request may close these issues.

2 participants