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

feat: add driver for Lakeshore Model 625 #86

Merged
merged 19 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d852244
add first version of Lakeshore/Model_625.py driver and example
simonzihlmann Sep 30, 2020
b639854
finish docstring of Model_625.py
simonzihlmann Nov 27, 2020
c8a05ac
add example notebook for Lakeshore_625.ipynb
simonzihlmann Nov 30, 2020
4e02d39
fix typos and fix type of error bit return function
simonzihlmann Dec 9, 2020
9c9d960
Merge commit '4e02d3982050f98b47aab558ef12afb9bd34da28'
qubit-ref Dec 10, 2020
60a85e9
Merge branch 'master' of https://github.com/QCoDeS/Qcodes_contrib_dri…
simonzihlmann Dec 14, 2020
73dd8ed
fix default value of address in init-function and mark example notebo…
simonzihlmann Dec 16, 2020
05f2ce6
Merge branch 'master' into master
simonzihlmann Dec 18, 2020
a82e4a6
Merge branch 'master' of https://codev-tuleap.intra.cea.fr/plugins/gi…
simonzihlmann Dec 18, 2020
725e7c6
Merge branch 'master' of https://github.com/simonzihlmann/Qcodes_cont…
simonzihlmann Jan 4, 2021
575169b
Merge branch 'master' of https://github.com/QCoDeS/Qcodes_contrib_dri…
simonzihlmann Jan 4, 2021
365958f
minor improvements
simonzihlmann Jan 4, 2021
57d2436
removing type definitions in return statements of get functions
simonzihlmann Jan 5, 2021
1a2801c
Merge branch 'master' of https://github.com/QCoDeS/Qcodes_contrib_dri…
simonzihlmann Jan 11, 2021
8d2433f
update example notebook
simonzihlmann Jan 12, 2021
6c9823d
fix type of return statement of quench detection function
simonzihlmann Jan 12, 2021
0e3a5ec
remove logging statement and clarify init docstring
simonzihlmann Jan 12, 2021
0636047
Merge branch 'master' into master
jenshnielsen Feb 3, 2021
9987c09
Merge branch 'master' into master
jenshnielsen Feb 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
367 changes: 367 additions & 0 deletions docs/examples/Lakeshore_625.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,367 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Example with Lakeshore Model 625 Superconducting Magnet power supply"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import qcodes as qc"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from qcodes_contrib_drivers.drivers.Lakeshore.Model_625 import Lakeshore625"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Connected to: LSCI 625 (serial:6251287, firmware:1.3/1.1) in 0.77s\n"
]
}
],
"source": [
"# Initialize a single power supply for a superconducting magnet using GPIB\n",
"# specify coil constant of the magnet in units of T/A\n",
"# specifz field ramp rate in units of T/min\n",
"magnet = Lakeshore625(name = 'magnet', address = 'GPIB0::4::INSTR', coil_constant = 0.0166614, field_ramp_rate = 0.15)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'vendor': 'LSCI', 'model': '625', 'serial': '6251287', 'firmware': '1.3/1.1'}"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"magnet.IDN()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"magnet:\n",
"\tparameter value\n",
"--------------------------------------------------------------------------------\n",
"IDN :\t{'vendor': 'LSCI', 'model': '625', 'serial': '625...\n",
"coil_constant :\t0.01666 (magnet_coil_constant_unit)\n",
"coil_constant_unit :\tT/A \n",
"current :\t0.0014 (A)\n",
"current_limit :\t55 (A)\n",
"current_ramp_rate :\t0.15 (A/s)\n",
"current_rate_limit :\t0.3 (A/s)\n",
"field :\t2.4e-05 (T)\n",
"field_ramp_rate :\t0.14994 (T/min)\n",
"oer_quench :\tno quench detected \n",
"operational_error_status :\t000000000 \n",
"persistent_switch_heater :\tdisabled \n",
"quench_current_step_limit :\t0.4 (A/s)\n",
"quench_detection :\tenabled \n",
"ramp_segments :\tdisabled \n",
"ramping_state :\tnot ramping \n",
"timeout :\t10 (s)\n",
"voltage :\t0.0048 (V)\n",
"voltage_limit :\t1 (V)\n"
]
}
],
"source": [
"# Let's look at all parameters\n",
"magnet.print_readable_snapshot(update=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Check current to field conversion"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"coil constant = 0.01666 T/A\n",
"current limit = 55.0 A\n",
"current ramp rate limit = 0.3 A/s\n"
]
}
],
"source": [
"# Since the set method of the driver only excepts fields in Tesla and we want to check if the correct \n",
"# currents are applied, we need to convert target currents to target fields. For this reason we need \n",
"# the coil constant. \n",
"coil_const = magnet.coil_constant()\n",
"current_limit = magnet.current_limit()\n",
"current_rate_limit = magnet.current_rate_limit()\n",
"print(\"coil constant = {} T/A\".format(coil_const))\n",
"print(\"current limit = {} A\".format(current_limit))\n",
"print(\"current ramp rate limit = {} A/s\".format(current_rate_limit))"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Target field is 0.0016660000000000002 T\n",
"Measured field is 0.001678 T\n",
"Measured current is = 0.1007202881152461 A\n"
]
}
],
"source": [
"# Let see if we can set and get the field in Tesla \n",
"target_current = 0.1 # [A] The current we want to set \n",
"target_field = coil_const * target_current # [T]\n",
"print(\"Target field is {} T\".format(target_field))\n",
"magnet.field(target_field)\n",
"\n",
"field = magnet.field() # This gives us the measured field\n",
"print(\"Measured field is {} T\".format(field))\n",
"# The current should be \n",
"current = field / coil_const\n",
"print(\"Measured current is = {} A\".format(current))\n",
"# We have verified with manual inspection that the current has indeed ben reached"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Let's have a look at other parameters"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Field"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.001678"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Let's read the field\n",
"magnet.field()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"# Let's set a field (blocking mode)\n",
"magnet.field(0.005)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"# Let's set a field (non-blocking mode)\n",
"magnet.set_field(0.01, block=False)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Ramp rate"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Field ramp rate: 0.09996000000000001 T/min.\n",
"Current ramp rate: 0.1 A/s.\n",
"Field ramp rate: 0.19992000000000001 T/min.\n",
"Current ramp rate: 0.2 A/s.\n"
]
}
],
"source": [
"# The field ramp rate can easily be changed (this will update the current ramp rate as well since the power supply only works in current)\n",
"magnet.field_ramp_rate(0.1)\n",
"print('Field ramp rate: {} {}.'.format(magnet.field_ramp_rate(), magnet.field_ramp_rate.unit))\n",
"print('Current ramp rate: {} {}.'.format(magnet.current_ramp_rate(), magnet.current_ramp_rate.unit))\n",
"\n",
"magnet.field_ramp_rate(0.2)\n",
"print('Field ramp rate: {} {}.'.format(magnet.field_ramp_rate(), magnet.field_ramp_rate.unit))\n",
"print('Current ramp rate: {} {}.'.format(magnet.current_ramp_rate(), magnet.current_ramp_rate.unit))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Quench detection"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Quench detection is enabled.\n",
"Current rate limit for quench detection:0.4 A/s\n",
"There was no no quench detected.\n"
]
}
],
"source": [
"# Quenches detection can be enabled, which it is by default\n",
"print('Quench detection is {}.'.format(magnet.quench_detection()))\n",
"\n",
"# A quench is detected if the current rate is above the follwoing limit\n",
"print('Current rate limit for quench detection:{} {}'.format(magnet.quench_current_step_limit(), magnet.quench_current_step_limit.unit))\n",
"\n",
"# Let's check if there was a quench detected\n",
"print('There was no {}.'.format(magnet.oer_quench()))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
},
"nbsphinx": {
"execute": "never"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
},
"varInspector": {
"cols": {
"lenName": 16,
"lenType": 16,
"lenVar": 40
},
"kernels_config": {
"python": {
"delete_cmd_postfix": "",
"delete_cmd_prefix": "del ",
"library": "var_list.py",
"varRefreshCmd": "print(var_dic_list())"
},
"r": {
"delete_cmd_postfix": ") ",
"delete_cmd_prefix": "rm(",
"library": "var_list.r",
"varRefreshCmd": "cat(var_dic_list()) "
}
},
"types_to_exclude": [
"module",
"function",
"builtin_function_or_method",
"instance",
"_Feature"
],
"window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading