Merge remote-tracking branch 'origin/dev'

This commit is contained in:
matthias@arch 2023-08-17 01:29:54 +02:00
commit 849730be09
6 changed files with 23 additions and 4 deletions

8
99-usbtmc.rules Normal file
View File

@ -0,0 +1,8 @@
# Rule for Keithley 2611B
# take vendor and product id from lsusb
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="05e6", ATTRS{idProduct}=="2614", GROUP="usbtmc", MODE="0660" RUN+="/bin/touch /tmp/05e6-2611-connected"
# Devices
KERNEL=="usbtmc/*", MODE="0660", GROUP="usbtmc"
KERNEL=="usbtmc[0-9]*", MODE="0660", GROUP="usbtmc"

View File

@ -30,6 +30,8 @@ def init(beep_success=True):
if beep_success: keithley.write("beeper.beep(0.5, 1000)")
return keithley
def beep(instr, length=0.5, pitch=1000):
instr.write(f"beeper.beep({length}, {pitch})")
def exit(instr):
instr.close()

View File

@ -3,7 +3,7 @@ import numpy as np
from matplotlib import pyplot as plt
import pyvisa
from m_teng.backends.keithley import reset
from m_teng.backends.keithley.keithley import reset
from m_teng.utility import testing as _testing
def measure_count(instr, count=100, interval=0.05, update_func=None, update_interval=0.5, beep_done=True, verbose=True):

View File

@ -2,6 +2,7 @@
smua.reset()
smua.measure.autorangev = smua.AUTORANGE_ON
smua.measure.autorangei = smua.AUTORANGE_ON
-- smua.measure.autozero = smua.AUTOZERO_AUTO
smua.measure.autozero = smua.AUTOZERO_AUTO
-- smua.measure.autozero = smua.AUTOZERO_ONCE
-- set output to 0A DC

View File

@ -232,7 +232,7 @@ def repeat(measure_func: callable, count: int, repeat_delay=0):
sleep(repeat_delay)
except KeyboardInterrupt:
pass
if settings["beep"]: _backend.beep()
if settings["beep"]: _backend.beep(dev)
def get_dataframe():

View File

@ -1,5 +1,5 @@
# m-TENG
Helper scripts and shell for measuring **T**ribo**e**lectric **N**ano**g**enerator-based sensor output with a Keithley 2611B SMU or an Arduino
Helper scripts and shell for measuring **T**ribo**e**lectric **N**ano**g**enerator-based sensor output with a Keithley 2600B SMU or an Arduino
## Features
@ -17,9 +17,10 @@ Helper scripts and shell for measuring **T**ribo**e**lectric **N**ano**g**enerat
- Run lua script on Keithley SMU
- Auto-filenames
## Available backends
### keithley
Use a Keithley 2611B Source-Measure-Unit via *pyvisa*. This backend allows measuring both voltage and current simultaneously.
Use a Keithley 2600B Source-Measure-Unit via *pyvisa*. This backend allows measuring both voltage and current simultaneously. *Tested with 2611B and 2614B*
### arduino
Use a Bluetooth capable Arduino with [https://git.quintern.xyz/MatthiasQuintern/teng-arduino](this software on the arduino).
@ -37,3 +38,10 @@ ipython -i k_teng_interactive.py -- -*X*
Substitute *X* for `-k` for keithley backend, `-a` for arduino backend or `-t` for testing backend.
In the shell, run `help()` to get a list of available commands
## Installation
### Keithley
On linux:
Install the udev rule in `/etc/udev/rules.d/` and run `sudo udevadm control --reload` to force the usbtmc driver to be used with the Keithley SMU.
The `ATTRS{product_id} ` needs to match the id shown by `lsusb`.