-
Notifications
You must be signed in to change notification settings - Fork 343
AimTTiQL355TP over voltage and over current protection support #5156
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
AdamVerner
wants to merge
7
commits into
microsoft:main
Choose a base branch
from
AdamVerner:master
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
561ff2f
Update Aim_TTi_QL355_TP.py
AdamVerner f5e4ae7
Update Aim_TTi_QL355_TP.py
AdamVerner f13d480
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9674adf
Add over current protection
AdamVerner d279b3e
Update Aim_TTi_QL355_TP.py
AdamVerner ecbef02
Update Aim_TTi_QL355_TP.py
AdamVerner 8fc4851
add types
astafan8 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,53 @@ | ||
| from ._AimTTi_PL_P import AimTTi | ||
| from typing import Any, Callable | ||
|
|
||
| from qcodes.parameters import Parameter | ||
|
|
||
| from ._AimTTi_PL_P import AimTTi, AimTTiChannel | ||
|
|
||
|
|
||
| class AimTTiQL355TP(AimTTi): | ||
| """ | ||
| This is the QCoDeS driver for the Aim TTi QL355TP series power supply. | ||
| """ | ||
|
|
||
| pass | ||
| def __init__(self, name: str, address: str, **kwargs: Any) -> None: | ||
| """ | ||
| Args: | ||
| name: Name to use internally in QCoDeS. | ||
| address: VISA resource address | ||
| """ | ||
|
|
||
| super().__init__(name, address, **kwargs) | ||
|
|
||
| for channel in [self.ch1, self.ch2]: | ||
| channel.over_voltage_protection = Parameter( | ||
| "over_voltage_protection", | ||
| get_cmd=self._get_value_reader(channel, "OVP"), | ||
| get_parser=float, | ||
| set_cmd=f"OVP{channel.channel} {{}}", | ||
| label="Over voltage protection", | ||
| unit="V", | ||
| instrument=channel, | ||
| ) | ||
|
|
||
| channel.over_current_protection = Parameter( | ||
| "over_current_protection", | ||
| get_cmd=self._get_value_reader(channel, "OCP"), | ||
| get_parser=float, | ||
| set_cmd=f"OCP{channel.channel} {{}}", | ||
| label="Over current protection", | ||
| unit="A", | ||
| instrument=channel, | ||
| ) | ||
|
|
||
| def _get_value_reader(self, channel: "AimTTiChannel", command: str) -> Callable[[], float]: | ||
| def _value_reader() -> float: | ||
| channel_id = channel.channel | ||
| _value = channel.ask_raw(f"{command}{channel_id}?") | ||
| _value_split = _value.split() | ||
| return float(_value_split[1]) | ||
| return _value_reader | ||
|
|
||
| def trip_reset(self) -> None: | ||
| """Clear all trip conditions on the device""" | ||
| self.write("TRIPRST") | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
To make it more reusable, use the
Instead of fixed channels (See _AimTTI_PL_P.py line 275-276)
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.
@AdamVerner Are you still interested in this work?
@huisman2501 would you be able to create a new pr that takes over this work otherwise?
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.
I am currently working on AIM PSUs and have some more properties that I can add. They seem to be more generic among models. I will see what I can do (I have a MX100TP and CPX400DP to test with)
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.
it's been more than 2 years now, I work in completly different field now. Feel free to take it over from me 😄