{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Zurich Instruments HF2LI example\n", "===========================" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The [Zurich Instruments HF2LI](https://www.zhinst.com/americas/products/hf2li-lock-amplifier) is a 50 MHz lock-in amplifier that contains essentially two independent signal generators and lock-in units.\n", "\n", "A single instance of `HF2LI` represents a single-channel lock-in amplifier, comprised of a single demodulator, a single excitation output (sigout), and whatever auxiliary outputs you want to use, e.g. (X, Y) or (R, Theta)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from qcodes_contrib_drivers.drivers.ZurichInstruments.HF2LI import HF2LI" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "devname = 'dev200' # device name according to the ZI software\n", "demod = 0 # index of demodulator to use\n", "sigout = 0 # index of sigout channel to use\n", "auxouts = {'X': 0, 'Y': 3} # make this an empty dict if you don't want to use auxouts\n", "\n", "lia = HF2LI('lia', devname, demod, sigout, auxouts)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "lia.time_constant(1e-3) # s\n", "lia.phase(0) # \n", "lia.X() # in-phase component\n", "lia.Y() # quadrature component" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Make a second instance using different hardware channels of the same device." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "demod1 = 3\n", "sigout1 = 1\n", "auxouts1 = {'R': 1, 'Theta': 2}\n", "\n", "lia1 = HF2LI('lia1', devname, demod1, sigout1, auxouts1)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "lia1.time_constant(1e-1) # s\n", "lia1.phase(90) # degrees\n", "lia1.frequency(19.9e3) # Hz\n", "# set the excitation output amplitude to 100 mV\n", "lia1.sigout_range(1.0) \n", "lia.sigout_amplitude0(0.1)\n", "output_amplitude = lia1.sigout_amplitude0() * lia1.sigout_range() # V\n", "\n", "lia1.R() # magnitude\n", "lia1.Theta() # phase" ] } ], "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.6.8" }, "nbsphinx": { "execute": "never" } }, "nbformat": 4, "nbformat_minor": 2 }