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

Add a bunch of new drivers #261

Merged
merged 50 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
00152eb
Add Horiba FHR1000 driver.
thangleiter Apr 5, 2023
344dc0c
Improve structure and add validators & val_mappings
thangleiter Apr 11, 2023
ab18555
Add example notebook.
thangleiter Apr 11, 2023
a7d765e
Add argument to stop() to raise errAbort exception
thangleiter Apr 12, 2023
ed2a88d
Make step a property
thangleiter Apr 12, 2023
58bd503
Add width/relative position parameter
thangleiter Apr 12, 2023
be306e0
Add note about step parameter for SlitChannels
thangleiter Apr 12, 2023
a97896b
Merge branch 'main' into feature/horiba_fhr_1000_driver
thangleiter Jul 18, 2023
2b2bd6a
Rename _private to private
thangleiter Sep 13, 2023
bcee2bd
Add information to example notebook.
thangleiter Sep 13, 2023
fae1b1b
Remove unnecessary parameters
thangleiter Sep 13, 2023
b446318
Rename without Model number
thangleiter Sep 14, 2023
b737e35
Rewrite to parse ini file for configuration.
thangleiter Sep 14, 2023
4acf55b
Add connect message statement
thangleiter Oct 6, 2023
93b3821
Dynamic dll filename argument
thangleiter Oct 6, 2023
09605d8
Add Lighthouse Photonics Sprout G driver.
thangleiter Sep 18, 2023
a2daa36
Prepend Vendor to class name
thangleiter Sep 18, 2023
8e2466a
Add Thermotek T255p chiller driver.
thangleiter Oct 10, 2023
0381969
Simplify error handling
thangleiter Sep 19, 2023
188ec7f
First version of Solstis 3 laser driver
Jan 3, 2018
3cbaa80
add methods _get_status and _get_wavelength and _set_wavelength
Jan 4, 2018
d33eade
additional methods to control the wavelength tuning (locked or not)
Jan 4, 2018
249d7dd
Rename Solstis to conform with convention
thangleiter Sep 18, 2023
48073e2
Autoformat and sort imports:
thangleiter Oct 13, 2023
fc050c8
Update to new signatures and add some documentation.
thangleiter Oct 13, 2023
e9a27f3
Use DelegateGroupParameters for GroupedParameter's DelegateGroup.
thangleiter Oct 17, 2023
3de9b47
Units and get_parsers
thangleiter Oct 17, 2023
d9b77e3
PEP-8
thangleiter Oct 17, 2023
9a86c02
Add ramp_up method
thangleiter Oct 18, 2023
8ab8d05
Merge branch 'feature/m2_solstis_driver' into tmp
thangleiter Oct 18, 2023
44c9f17
Merge branch 'feature/lighthouse_photonics_sprout_g_driver' into tmp
thangleiter Oct 18, 2023
62650ce
Add __init__.py
thangleiter Oct 18, 2023
ac2f9c9
Merge branch 'feature/horiba_fhr_1000_driver' into tmp
thangleiter Oct 18, 2023
e9878e9
Merge branch 'main' into feature/add_new_drivers
thangleiter Oct 18, 2023
fe7441e
Block notebook from executing and add header cell
thangleiter Oct 18, 2023
ed893a6
Fix MyPy errors
thangleiter Oct 18, 2023
31fd087
Fix notebook headline
thangleiter Oct 18, 2023
b0d1889
Fix import
thangleiter Oct 18, 2023
479cfba
add msl.loadlib to mypy overrides
thangleiter Oct 19, 2023
42cdc24
add types-tqdm to test dependencies
thangleiter Oct 19, 2023
f3965ab
Make MotorChannel.type a classmethod
thangleiter Oct 19, 2023
0157185
Drop Python 3.8 workaround (not supported anymore)
thangleiter Oct 19, 2023
83b844b
Add msl.loadlib to doc requirements
thangleiter Oct 19, 2023
0f0e847
Mock import in autodoc instead of install msl.loadlib
thangleiter Oct 19, 2023
7f1bde2
Fix typing imports
thangleiter Oct 19, 2023
e06e6df
Fix remaining MyPy errors
thangleiter Oct 19, 2023
b58d1bd
Simplify calls to cli.SpeCommand
thangleiter Oct 19, 2023
79576e3
Use _SimpleCData instead of _CData for type
thangleiter Oct 19, 2023
d601bc2
Validate numbers instead of ints
thangleiter Oct 19, 2023
a189367
Fix mocking msl import
thangleiter Oct 20, 2023
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
264 changes: 264 additions & 0 deletions docs/examples/Horiba_FHR.ipynb
thangleiter marked this conversation as resolved.
Show resolved Hide resolved
thangleiter marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "a657526c",
"metadata": {},
"source": [
"This driver has been tested with a FHR1000 spectrometer with one dual grating turret, an entrance slit, exit slit, and an exit slit selection mirror.\n",
"\n",
"The dll unfortunately does not have any version information. It was shipped with LabSpec 6.5.1. The supporting information is contained in a word document called `SpeControl_dll.docx`."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "17976519-ee58-4afc-89ee-23d8475a3d14",
"metadata": {
"scrolled": true,
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Logging hadn't been started.\n",
"Activating auto-logging. Current session state plus future input saved.\n",
"Filename : C:\\Users\\Flash\\.qcodes\\logs\\command_history.log\n",
"Mode : append\n",
"Output logging : True\n",
"Raw input log : False\n",
"Timestamping : True\n",
"State : active\n",
"Qcodes Logfile : C:\\Users\\Flash\\.qcodes\\logs\\231006-740-qcodes.log\n"
]
}
],
"source": [
"import pathlib\n",
"import tempfile\n",
"from qcodes_contrib_drivers.drivers.Horiba.Horiba_FHR import HoribaFHR"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "4eaa3ffc-49e6-419d-a0e1-fc07d09b22b5",
"metadata": {
"jupyter": {
"source_hidden": true
},
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"1326"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dll_dir = r'C:\\HORIBA\\Software\\SDK FHR Express'\n",
"config_file = pathlib.Path(tempfile.mkdtemp(), 'config.ini')\n",
"config_file.write_text(\n",
"\"\"\"[Firmware]\n",
"VersionNumber=123456\n",
"SerialNumber=1234567890\n",
"==================================================\n",
"[Port]\n",
"ComPort=13\n",
"Baudrate=115200\n",
"Timeout=60000\n",
"==================================================\n",
"[Spectrometer]\n",
"Focal=1000\n",
"CoefficientOfAngle=0.20071286\n",
"Board=1\n",
"SpeedMin=500\n",
"SpeedMax=280000\n",
"Acceleration=400\n",
"Backlash=-12500\n",
"MotorStepUnit=2\n",
"Reverse=0\n",
"GratingNumber=2\n",
"SlitNumber=2\n",
"==================================================\n",
"[Grating1]\n",
"Name=1800 gr/mm\n",
"Value=1800\n",
"AddrAxe=5\n",
"Offset=54940\n",
"Shift=0\n",
"MinNm=50\n",
"MaxNm=750\n",
"CoefficientOfLinearity=1.000069196\n",
"==================================================\n",
"[Grating2]\n",
"Name=600 gr/mm\n",
"Value=600\n",
"AddrAxe=9\n",
"Offset=2554965\n",
"Shift=0\n",
"MinNm=50\n",
"MaxNm=2000\n",
"CoefficientOfLinearity=0.999935906\n",
"==================================================\n",
"[Slit1]\n",
"Name=Front entrance slit\n",
"AddrAxe=1\n",
"Offset=450\n",
"Minum=0\n",
"Maxum=2000\n",
"Coeffum=1\n",
"SpeedMin=50\n",
"SpeedMax=500\n",
"Acceleration=150\n",
"Backlash=100\n",
"MotorStepUnit=1\n",
"Reverse=1\n",
"==================================================\n",
"[Slit2]\n",
"Name=Side exit slit\n",
"AddrAxe=4\n",
"Offset=450\n",
"Minum=0\n",
"Maxum=2000\n",
"Coeffum=1\n",
"SpeedMin=50\n",
"SpeedMax=500\n",
"Acceleration=150\n",
"Backlash=100\n",
"MotorStepUnit=1\n",
"Reverse=1\n",
"==================================================\n",
"[Mirror2]\n",
"Name=Exit mirror\n",
"AddrAxe=7\n",
"Delayms=100\n",
"DutyCycle%=30\n",
"==================================================\n",
"\"\"\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "778427c9-5732-4b04-bc14-6205f2314e04",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Connected to: Horiba FHR1000 (serial:1234567890, firmware:123456) in 1.48s\n"
]
}
],
"source": [
"spe = HoribaFHR('spe', dll_dir, config_file,\n",
" dc_val_mappings={2: {'front': 0, 'side': 1}})"
]
},
{
"cell_type": "markdown",
"id": "6b93170e-1805-48cf-b87a-af40c863ee5e",
"metadata": {},
"source": [
"The `dc_val_mappings` parameter allows to map the binary positions of the DC motors to a more inuititive string.\n",
"\n",
"The various controllers are stored as `ChannelList`s:"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "b3293c81-6ab9-4799-ac94-3bdd2bc49e6b",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"grating_1800, grating_600 = spe.gratings\n",
"slit_entrance, slit_exit = spe.slits\n",
"mirror, = spe.mirrors"
]
},
{
"cell_type": "markdown",
"id": "a71d6ef2-8f11-40bb-8e47-e2abfa3972e1",
"metadata": {
"tags": []
},
"source": [
"The main parameter each channel has is `position`. For `SlitChannel`s, there is also `width`, which should be preferred since it represents the actual opening width of the slit instead of the position of the stepper motor. To initialize the motors, meaning\n",
"\n",
"- move to zero order for gratings\n",
"- completely close for slits\n",
"\n",
"call `init()`. Setting the position of a grating will turn the turret if the other grating was selected before:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f65466e7-869c-4ffc-9650-f43bd747cb1e",
"metadata": {},
"outputs": [],
"source": [
"grating_1800.position(600e3) # pm!\n",
"grating_600.position(600e3) # will turn the turret by 180 degrees + X."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "0798cf6b",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"spe.close()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.10.9"
},
"toc-autonumbering": true,
"toc-showcode": false,
"toc-showmarkdowntxt": true,
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading