Skip to content

Commit

Permalink
Merge pull request #136 from QDevil/master
Browse files Browse the repository at this point in the history
QDevil QDAC2: Remove current limit until fully implemented in instrument
  • Loading branch information
astafan8 authored Jun 8, 2022
2 parents c824b73 + 720842e commit 3f82bee
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 77 deletions.
4 changes: 2 additions & 2 deletions docs/examples/QDevil/QDAC2/DC_Constant.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
}
],
"source": [
"qdac.ch03.output_mode(range='low', low_current_limit_A=1e-7)\n",
"qdac.ch03.output_mode(range='low')\n",
"scope.write('run')\n",
"qdac.ch03.dc_constant_V(2)\n",
"qdac.errors()"
Expand Down Expand Up @@ -150,7 +150,7 @@
],
"source": [
"gate = qdac.channel(3)\n",
"gate.output_mode(range='high', high_current_limit_A=0.001)\n",
"gate.output_mode(range='high')\n",
"scope.write('run')\n",
"gate.dc_constant_V(10.0)\n",
"qdac.errors()"
Expand Down
27 changes: 2 additions & 25 deletions qcodes_contrib_drivers/drivers/QDevil/QDAC2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,22 +1103,6 @@ def __init__(self, parent: 'QDac2', name: str, channum: int):
name='measurement_abort',
call_cmd=f'sens{channum}:abor'
)
self.add_parameter(
name='low_current_limit_A',
label='low limit',
unit='A',
set_cmd='sour{1}:ilim:low {0}'.format('{}', channum),
get_cmd=f'sour{channum}:ilim:low?',
get_parser=float
)
self.add_parameter(
name='high_current_limit_A',
label='high limit',
unit='A',
set_cmd='sour{1}:ilim:high {0}'.format('{}', channum),
get_cmd=f'sour{channum}:ilim:high?',
get_parser=float
)
self.add_parameter(
name='measurement_count',
label='count',
Expand Down Expand Up @@ -1310,22 +1294,15 @@ def measurement(self, delay_s: float = 0.0, repetitions: int = 1,
return Measurement_Context(self, delay_s, repetitions, current_range,
aperture_s, nplc)

def output_mode(self, range: str = 'high', filter: str = 'high',
low_current_limit_A: float = 2e-7,
high_current_limit_A: float = 0.01
) -> None:
"""Set the output voltage and current limits
def output_mode(self, range: str = 'high', filter: str = 'high') -> None:
"""Set the output voltage
Args:
range (str, optional): Low or high (default) current range
filter (str, optional): DC (10Hz), medium (10kHz) or high (300kHz, default) voltage filter
low_current_limit_A (float, optional): Current limit in low range
high_current_limit_A (float, optional): Current limit in high range
"""
self.output_range(range)
self.output_filter(filter)
self.low_current_limit_A(low_current_limit_A)
self.high_current_limit_A(high_current_limit_A)

def dc_list(self, voltages: Sequence[float], repetitions: int = 1,
dwell_s: float = 1e-03, backwards: bool = False,
Expand Down
14 changes: 0 additions & 14 deletions qcodes_contrib_drivers/sims/QDAC2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,6 @@ devices:
specs:
valid: ["dc", "med", "high"]
type: str
low_current_limit:
default: 0.0
setter:
q: "sour{ch_id}:ilim:low {}"
getter:
q: "sour{ch_id}:ilim:low?"
r: "{}"
high_current_limit:
default: 0.0
setter:
q: "sour{ch_id}:ilim:high {}"
getter:
q: "sour{ch_id}:ilim:high?"
r: "{}"
current_count:
default: 1
setter:
Expand Down
1 change: 1 addition & 0 deletions qcodes_contrib_drivers/tests/QDevil/pytest.ini
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
[pytest]
console_output_style = classic
26 changes: 0 additions & 26 deletions qcodes_contrib_drivers/tests/QDevil/test_sim_qdac2_source_dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,6 @@ def test_select_voltage_filter(selector, qdac): # noqa
]


def test_current_limit_low(qdac): # noqa
current = 5e-9
# -----------------------------------------------------------------------
qdac.ch02.low_current_limit_A(current)
limit = qdac.ch02.low_current_limit_A()
# -----------------------------------------------------------------------
assert limit == current
assert qdac.get_recorded_scpi_commands() == [
f'sour2:ilim:low {current}',
'sour2:ilim:low?'
]


def test_current_limit_high(qdac): # noqa
current = 5e-3
# -----------------------------------------------------------------------
qdac.ch02.high_current_limit_A(current)
limit = qdac.ch02.high_current_limit_A()
# -----------------------------------------------------------------------
assert limit == current
assert qdac.get_recorded_scpi_commands() == [
f'sour2:ilim:high {current}',
'sour2:ilim:high?'
]


@pytest.mark.parametrize('u', [-1.0, 0.0, 1])
def test_dc_voltage_low(u, qdac): # noqa
# -----------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,10 @@ def test_list_trigger_on_external(qdac): # noqa


def test_list_get_voltages(qdac): # noqa
qdac.start_recording_scpi()
dc_list = qdac.ch01.dc_list(voltages=[-0.123, 0, 1.234])
# -----------------------------------------------------------------------
voltages = dc_list.values_V()
# -----------------------------------------------------------------------
x = qdac.get_recorded_scpi_commands()
print(x)
assert voltages == [-0.123, 0, 1.234]


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest
from .sim_qdac2_fixtures import qdac # noqa


Expand All @@ -9,8 +8,6 @@ def test_output_mode_defaults(qdac): # noqa
assert qdac.get_recorded_scpi_commands() == [
'sour2:rang high',
'sour2:filt high',
'sour2:ilim:low 2e-07',
'sour2:ilim:high 0.01',
]


Expand All @@ -19,13 +16,9 @@ def test_output_mode_arg(qdac): # noqa
qdac.ch02.output_mode(
range='low',
filter='dc',
low_current_limit_A=50e-12,
high_current_limit_A=0.00001
)
# -----------------------------------------------------------------------
assert qdac.get_recorded_scpi_commands() == [
'sour2:rang low',
'sour2:filt dc',
'sour2:ilim:low 5e-11',
'sour2:ilim:high 1e-05',
]

0 comments on commit 3f82bee

Please sign in to comment.