{ "cells": [ { "cell_type": "markdown", "id": "domestic-health", "metadata": {}, "source": [ "# Qcodes example with Basel SP983c Preamp" ] }, { "cell_type": "markdown", "id": "assigned-cartridge", "metadata": {}, "source": [ "This notebook explains how the Basel SP983c Preamp works and shows the main features of its QCoDeS driver." ] }, { "cell_type": "markdown", "id": "whole-unknown", "metadata": {}, "source": [ "## Basel SP983c Preamp" ] }, { "cell_type": "markdown", "id": "raised-renaissance", "metadata": {}, "source": [ "This preamp is a low-noise high-stability (LNHS) I to V converter which offers unique features such as a floating input and the possibility to apply an external offset voltage. It offers five decades of gain, from 10^5 up to 10^9 V/A, and an integrated low-pass filter with a cut-off from 30 Hz to 1 MHz." ] }, { "cell_type": "markdown", "id": "alive-refund", "metadata": {}, "source": [ "## Features of Qcodes Basel SP983c Preamp driver" ] }, { "cell_type": "markdown", "id": "declared-petroleum", "metadata": {}, "source": [ "The driver has three parameters - gain, fcut and offset_voltage. 'gain' and 'fcut' parameters are mirroring the gain and cut-off frequency setup on the instrument and can be set to the values available on the physical instrument. It is users responsibility to set these parameters on the driver to the values matching to the values set on the physical instrument." ] }, { "cell_type": "markdown", "id": "healthy-amendment", "metadata": {}, "source": [ "Let's try it ..." ] }, { "cell_type": "markdown", "id": "employed-concept", "metadata": {}, "source": [ "Make the necessary imports ..." ] }, { "cell_type": "code", "execution_count": 9, "id": "recent-analyst", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:35:31.998659Z", "start_time": "2021-01-27T11:35:31.981409Z" }, "scrolled": true }, "outputs": [], "source": [ "from qcodes.instrument_drivers.basel.sp983c import SP983C\n", "from qcodes.instrument_drivers.Keysight.Keysight_34465A_submodules import Keysight_34465A\n", "import qcodes.instrument.sims as sims" ] }, { "cell_type": "code", "execution_count": 10, "id": "verified-olive", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:35:34.630341Z", "start_time": "2021-01-27T11:35:34.613318Z" } }, "outputs": [], "source": [ "preamp = SP983C(\"basel_preamp\")" ] }, { "cell_type": "markdown", "id": "dietary-karma", "metadata": {}, "source": [ "gain can be set as:" ] }, { "cell_type": "code", "execution_count": 11, "id": "eastern-wallace", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:35:37.028308Z", "start_time": "2021-01-27T11:35:37.021799Z" } }, "outputs": [], "source": [ "preamp.gain(1e07)" ] }, { "cell_type": "markdown", "id": "gross-performer", "metadata": {}, "source": [ "and recalled as:" ] }, { "cell_type": "code", "execution_count": 12, "id": "beautiful-primary", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:35:39.485637Z", "start_time": "2021-01-27T11:35:39.473075Z" } }, "outputs": [ { "data": { "text/plain": [ "10000000.0" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "preamp.gain()" ] }, { "cell_type": "markdown", "id": "equal-china", "metadata": {}, "source": [ "cut-off frequency can be set as:" ] }, { "cell_type": "code", "execution_count": 13, "id": "quarterly-package", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:35:41.561712Z", "start_time": "2021-01-27T11:35:41.552634Z" } }, "outputs": [], "source": [ "preamp.fcut(300)" ] }, { "cell_type": "markdown", "id": "alleged-allowance", "metadata": {}, "source": [ "and recalled as:" ] }, { "cell_type": "code", "execution_count": 14, "id": "initial-welding", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:35:43.638792Z", "start_time": "2021-01-27T11:35:43.625188Z" } }, "outputs": [ { "data": { "text/plain": [ "300" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "preamp.fcut()" ] }, { "cell_type": "code", "execution_count": 15, "id": "ancient-dallas", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:35:44.658664Z", "start_time": "2021-01-27T11:35:44.643669Z" } }, "outputs": [], "source": [ "preamp.close()" ] }, { "cell_type": "markdown", "id": "handmade-diabetes", "metadata": {}, "source": [ "### How to setup an input offset voltage source for the Basel SP983c Preamp?" ] }, { "cell_type": "markdown", "id": "processed-sigma", "metadata": {}, "source": [ "'offset_voltage' parameter can be set with a source input offset voltage parameter. The range of input offset voltage is -10 to 10 Volts. This input offset voltage is used for offsetting the voltage by the preamp in range -0.1 to 1 Volts. Let's try it with a dummy source parameter." ] }, { "cell_type": "markdown", "id": "forbidden-cement", "metadata": {}, "source": [ "#### Create a source as input offset voltage for Basel preamp" ] }, { "cell_type": "code", "execution_count": 16, "id": "terminal-telephone", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:35:52.643491Z", "start_time": "2021-01-27T11:35:52.521898Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Connected to: Keysight 34465A (serial:1000, firmware:A.02.16-02.40-02.16-00.51-03-01) in 0.11s\n" ] } ], "source": [ "VISALIB = sims.__file__.replace('__init__.py', 'Keysight_34465A.yaml@sim')\n", "dmm = Keysight_34465A('kt_34465A_sim', address=\"GPIB::1::INSTR\", visalib=VISALIB)" ] }, { "cell_type": "code", "execution_count": 17, "id": "mighty-zambia", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:35:53.653468Z", "start_time": "2021-01-27T11:35:53.641607Z" } }, "outputs": [ { "data": { "text/plain": [ "10.0" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.volt()" ] }, { "cell_type": "markdown", "id": "initial-therapist", "metadata": {}, "source": [ "#### 1. Instantiate Basel preamp with the source input offset voltage parameter" ] }, { "cell_type": "code", "execution_count": 18, "id": "aboriginal-invasion", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:35:55.875780Z", "start_time": "2021-01-27T11:35:55.862694Z" } }, "outputs": [], "source": [ "preamp1 = SP983C(\"basel_preamp1\", input_offset_voltage=dmm.volt)" ] }, { "cell_type": "code", "execution_count": 19, "id": "acute-equivalent", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:35:57.000906Z", "start_time": "2021-01-27T11:35:56.992904Z" } }, "outputs": [ { "data": { "text/plain": [ "0.1" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "preamp1.offset_voltage()" ] }, { "cell_type": "code", "execution_count": 20, "id": "bottom-explorer", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:35:58.106829Z", "start_time": "2021-01-27T11:35:58.092184Z" } }, "outputs": [], "source": [ "preamp1.close()" ] }, { "cell_type": "markdown", "id": "confirmed-galaxy", "metadata": {}, "source": [ "#### 2. Or, instantiate the preamp without source input offset voltage parameter and assign it later" ] }, { "cell_type": "code", "execution_count": 21, "id": "medical-quantity", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:36:00.035118Z", "start_time": "2021-01-27T11:36:00.021117Z" } }, "outputs": [], "source": [ "preamp2 = SP983C(\"basel_preamp2\")" ] }, { "cell_type": "code", "execution_count": 22, "id": "verified-audience", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:36:01.017697Z", "start_time": "2021-01-27T11:36:01.003178Z" } }, "outputs": [], "source": [ "preamp2.offset_voltage.source = dmm.volt" ] }, { "cell_type": "code", "execution_count": 23, "id": "stuck-discrimination", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:36:02.128900Z", "start_time": "2021-01-27T11:36:02.121901Z" } }, "outputs": [ { "data": { "text/plain": [ "0.1" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "preamp2.offset_voltage()" ] }, { "cell_type": "code", "execution_count": 24, "id": "absent-third", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:36:03.330807Z", "start_time": "2021-01-27T11:36:03.323084Z" } }, "outputs": [], "source": [ "preamp2.close()" ] }, { "cell_type": "markdown", "id": "ultimate-inside", "metadata": {}, "source": [ "#### Close source instrument" ] }, { "cell_type": "code", "execution_count": 25, "id": "serious-animal", "metadata": { "ExecuteTime": { "end_time": "2021-01-27T11:36:05.295494Z", "start_time": "2021-01-27T11:36:05.283495Z" } }, "outputs": [], "source": [ "dmm.close()" ] }, { "cell_type": "code", "execution_count": null, "id": "political-reserve", "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.9" } }, "nbformat": 4, "nbformat_minor": 5 }