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

AimTTiQL355TP over voltage and over current protection support #5156

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 46 additions & 2 deletions qcodes/instrument_drivers/AimTTi/Aim_TTi_QL355_TP.py
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")