From 365ecb2597b983e9942e3b8d452b779869d91c2f Mon Sep 17 00:00:00 2001 From: Jonathan Becker Date: Fri, 12 Jul 2024 10:41:13 +0200 Subject: [PATCH 1/4] add parameters for output power setting --- .../Lakeshore/lakeshore_base.py | 65 +++++++++++++++++-- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py b/src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py index 19d232332c1..6c5e39d2262 100644 --- a/src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py +++ b/src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py @@ -121,10 +121,67 @@ def __init__( parameter_class=GroupParameter, ) """The value for closed control loop Derivative (rate)""" - self.pid_group = Group([self.P, self.I, self.D], - set_cmd=f'PID {output_index}, ' - f'{{P}}, {{I}}, {{D}}', - get_cmd=f'PID? {output_index}') + self.pid_group = Group( + [self.P, self.I, self.D], + set_cmd=f"PID {output_index},{{P}},{{I}},{{D}}", + get_cmd=f"PID? {output_index}", + ) + + self.output_type: GroupParameter = self.add_parameter( + name="output_type", + docstring="Output type (Output 2 only): 0=Current, 1=Voltage", + val_mapping={"current": 0, "voltage": 1} + if output_index == 1 + else {"current": 0}, + parameter_class=GroupParameter, + ) + """Output type (Output 2 only): 0=Current, 1=Voltage""" + + self.output_heater_resistance: GroupParameter = self.add_parameter( + name="output_heater_resistance", + docstring="Heater Resistance Setting: 25/50ohm", + val_mapping={"25ohm": 1, "50ohm": 2}, + parameter_class=GroupParameter, + ) + """Heater Resistance Setting: 25/50ohm""" + + self.output_max_current: GroupParameter = self.add_parameter( + name="output_max_current", + docstring="Specifies the maximum heater output current: User Specified, 0.707 A, 1 A, 1.141 A, 1.732", + val_mapping={"user": 0, "0.707A": 1, "1A": 2, "1.141A": 3, "1.732A": 4}, + parameter_class=GroupParameter, + ) + """Specifies the maximum heater output current: User Specified, 0.707 A, 1 A, 1.141 A, 1.732""" + + self.output_max_user_current: GroupParameter = self.add_parameter( + name="output_max_user_current", + docstring="Specifies the maximum heater output current if max current is set to User Specified.", + vals=vals.Numbers(0, 1.732), + unit="A", + get_parser=float, + parameter_class=GroupParameter, + ) + """Specifies the maximum heater output current if max current is set to User Specified.""" + + self.output_display: GroupParameter = self.add_parameter( + name="output_display", + docstring="Specifies whether the heater output displays in current or power (current mode only)", + val_mapping={"current": 1, "power": 2}, + parameter_class=GroupParameter, + ) + """Specifies whether the heater output displays in current or power (current mode only)""" + + self.heater_group = Group( + [ + self.output_type, + self.output_heater_resistance, + self.output_max_current, + self.output_max_user_current, + self.output_display, + ], + set_cmd=f"HTRSET {output_index},{{output_type}},{{output_heater_resistance}},{{output_max_current}},{{output_max_user_current}},{{output_display}}", + get_cmd=f"HTRSET? {output_index}", + ) self.output_range: Parameter = self.add_parameter( "output_range", From d9118234645d00ad81cabe01df52f8f9fd5fb03c Mon Sep 17 00:00:00 2001 From: Jonathan Becker Date: Fri, 12 Jul 2024 10:47:43 +0200 Subject: [PATCH 2/4] add newsfragment --- docs/changes/newsfragments/6248.improved_driver | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/changes/newsfragments/6248.improved_driver diff --git a/docs/changes/newsfragments/6248.improved_driver b/docs/changes/newsfragments/6248.improved_driver new file mode 100644 index 00000000000..41bb92e89f1 --- /dev/null +++ b/docs/changes/newsfragments/6248.improved_driver @@ -0,0 +1,2 @@ +- Add power output parameters to LakeShore335 driver, + this allows to configure the maximum heater current. \ No newline at end of file From 0756638d59137946693852d575b4bb7f3d7871bb Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Thu, 25 Jul 2024 10:12:43 +0200 Subject: [PATCH 3/4] Fix precommit hook --- docs/changes/newsfragments/6248.improved_driver | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/changes/newsfragments/6248.improved_driver b/docs/changes/newsfragments/6248.improved_driver index 41bb92e89f1..4597bc78e63 100644 --- a/docs/changes/newsfragments/6248.improved_driver +++ b/docs/changes/newsfragments/6248.improved_driver @@ -1,2 +1,2 @@ -- Add power output parameters to LakeShore335 driver, - this allows to configure the maximum heater current. \ No newline at end of file +- Add power output parameters to LakeShore335 driver, + this allows to configure the maximum heater current. From fdde1ac4c551c297aa5df5be4a3f6cb3f397fec4 Mon Sep 17 00:00:00 2001 From: "Jens H. Nielsen" Date: Thu, 25 Jul 2024 10:13:13 +0200 Subject: [PATCH 4/4] Rerun darker --- src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py b/src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py index 6c5e39d2262..4c93771542d 100644 --- a/src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py +++ b/src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py @@ -130,9 +130,9 @@ def __init__( self.output_type: GroupParameter = self.add_parameter( name="output_type", docstring="Output type (Output 2 only): 0=Current, 1=Voltage", - val_mapping={"current": 0, "voltage": 1} - if output_index == 1 - else {"current": 0}, + val_mapping=( + {"current": 0, "voltage": 1} if output_index == 1 else {"current": 0} + ), parameter_class=GroupParameter, ) """Output type (Output 2 only): 0=Current, 1=Voltage"""