Skip to main content

Bead pulling measurement software for RF cavity measurements

Project description

Description

This is a measurement software for particle acceleration structures using bead pulling method. It utilizes PyVISA device communication library as an intermediate device communication layer in order to support multiple platforms. Device specific code is isolated in driver objects; adding new device driver is a matter of implementing a set of object methods.

This program includes drivers for motors:

  • Fake motor (placeholder driver)
  • Randomly failing software motor (for program debugging)
  • UIRobot motor driver

This program includes drivers for vector analyzers:

  • Fake analyzer (placeholder driver)
  • Randomly failing software analyzer (for program debugging)
  • Agilent8753et

Installation

Get python and pip

Download and install python and pip.

You may use a package manager for this. For example, in Debian installation command looks like this:

sudo apt-get install python3 python3-pip

If you don't have a package manager, download installer from the python web site.

You will need to install either NI drivers (for Windows installations) or Linux-GPIB drivers.

Install NI drivers

If you need to use NI drivers, use this manual for installation.

Install Linux-GPIB drivers

In order to use Linux-GPIB drivers, one must compile them and install python bindings.

Note. Drivers are build for current Linux kernel. So, after kernel update one needs to recompile GPIB drivers.

Getting sources

In order to proceed, you will need to install additional programs:

apt install -y git git-svn

Getting the latest sources:

git svn clone -r HEAD https://svn.code.sf.net/p/linux-gpib/code/trunk linux-gpib-code

Now you have the latest sources of Linux-GPIB:

cd linux-gpib-code

Compiling drivers

For driver compilation you will need Linux sources:

sudo apt install linux-source
cd linux-gpib-kernel

Issue following command to start compilation:

make

And then:

make install

That's it for driver compilation. Return one folder back.

cd ..

Compiling userspace utilities

cd linux-gpib-user

Since we use source from project repo, we need to prepare autotools installation scripts:

apt install autotools-dev
./bootstrap
./configure --sysconfdir=/etc
make
make install

Installing Python3 bindings

Go to python bindings folder:

cd language/python

Creating and installing Python3 module:

python3 setup.py sdist
pip3 install dist/*.tar.gz

Configuring GPIB device

Download GPIB board firmware form https://linux-gpib.sourceforge.io/firmware/.

Later in this document agilent_82350a device will be used. Firmware archive is assumed to be located in ~/Downloads/ folder.

Configure your board in /etc/gpib.conf. Consult configuration manual. Configuration will look something like this:

interface {
        minor = 0       /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */
        board_type = "agilent_82350b"   /* type of interface board being used */
        name = "violet" /* optional name, allows you to get a board descriptor using ibfind() */
        pad = 0 /* primary address of interface             */
        sad = 0 /* secondary address of interface           */
        timeout = T3s   /* timeout for commands */

        eos = 0x0a      /* EOS Byte, 0xa is newline and 0xd is carriage return
*/
        set-reos = yes  /* Terminate read if EOS */
        set-bin = no    /* Compare EOS 8-bit */
        set-xeos = no   /* Assert EOI whenever EOS byte is sent */
        set-eot = yes   /* Assert EOI with last byte on writes */

/* settings for boards that lack plug-n-play capability */
        base = 0        /* Base io ADDRESS                  */
        irq  = 0        /* Interrupt request level */
        dma  = 0        /* DMA channel (zero disables)      */
}

device {
        minor = 0       /* minor number for interface board this device is connected to */
        name = "analyzer"       /* device mnemonic */
        pad = 7 /* The Primary Address */
        sad = 0 /* Secondary Address */
        timeout = T3s

        eos = 0xa       /* EOS Byte */
        set-reos = no /* Terminate read if EOS */
        set-bin = no /* Compare EOS 8-bit */
}

Upload board firmware, if necessary:

sudo gpib_config --init-data ~/Downloads/gpib_firmware-2008-08-10/hp_82350a/agilent_82350a.bin

Configure udev rules

Some boards require firmware upload on every start. Also, superuser privileges are required for communication with device. In order to remove these problems, lets add udev rule for device.

Firstly, lets create new group, which will be able to use GPIB devices:

addgroup gpib

Copy your device's firmware to /usr/local/sbin. Command will look something like this:

cp Downloads/gpib_firmware-2008-08-10/hp_82350a/agilent_82350a.bin /usr/local/sbin/

Then, create a file /usr/local/sbin/load_agilent with contents:

#!/bin/bash

gpib_config --init-data /usr/local/sbin/agilent_82350a.bin

And allow its execution:

chmod 755 /usr/local/sbin/load_agilent

Add the following line to the /etc/udev/rules.d/99-gpib.rules file:

KERNEL=="gpib0", SUBSYSTEM=="gpib_common", GROUP="gpib", MODE="0660", RUN+="/usr/local/sbin/load_agilent"

Now device will be available for users in group gpib, its firmware will be automatically loaded.

Install BeadPull

From the terminal issue the command

pip3 install beadpull

for system-wide installation, or

pip3 install --user beadpull

for the local installation.

Add user to device communication groups [Optional]

Gnu/Linux distributions restrict access to peripheral devices.

To grant access to serial devices to user, issue command:

adduser user dialout

USB devices:

adduser user plugdev

GPIB devices (if configured):

adduser user gpib

Run

In order to run the program, from the terminal issue the command

beadpull

If it's not found, you have to modify the PATH environment variable to include the python scripts folder (unix guide,windows guide) or supply the full path to the program.

Other

Update beadpull

To update program, from the terminal issue the command

pip3 install --upgrade beadpull

for system-wide installation, or

pip3 install --upgrade --user beadpull

for the local installation.

Reset beadpull settings to defaults

Program saves its settings under APPDATA/beadupll on Windows and $XDG_CONFIG_HOME/beadpull or $HOME/.config/beadpull on other systems. In order to reset settings, simply delete saved settings folder.

Issue submission

In case of a problem with the program, create an issue in the issue tracker.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beadpull-19.10.tar.gz (94.8 kB view details)

Uploaded Source

Built Distribution

beadpull-19.10-py3-none-any.whl (105.5 kB view details)

Uploaded Python 3

File details

Details for the file beadpull-19.10.tar.gz.

File metadata

  • Download URL: beadpull-19.10.tar.gz
  • Upload date:
  • Size: 94.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.17rc1

File hashes

Hashes for beadpull-19.10.tar.gz
Algorithm Hash digest
SHA256 9e255ca35cb302eb7b7ee1366953a502b63b0ec6f528cd4f2f0d3dd352731033
MD5 c72c680a5d984d0061fdeffe10fa226b
BLAKE2b-256 a8b89886ff99ac807fc854558ef31643c8dd8e6f224abad6fcf59f1f99a9915b

See more details on using hashes here.

File details

Details for the file beadpull-19.10-py3-none-any.whl.

File metadata

  • Download URL: beadpull-19.10-py3-none-any.whl
  • Upload date:
  • Size: 105.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.17rc1

File hashes

Hashes for beadpull-19.10-py3-none-any.whl
Algorithm Hash digest
SHA256 882dfaadae123b31c2ae9aea974f630c315686daab2bab2376e2b24bf16a78dd
MD5 6f047d0ed7ece76f7a3eea051cf9c321
BLAKE2b-256 411619d4a0f20cfea086cca1e80a131454b26d60cccbdd0dbc315982aba22e38

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page