A quick and dirty introduction to the PyPPM

Here are a couple short summaries of the "what" and "why" behind my PyPPM project.

Still interested? Awesome! Read on, friend...

How an Earth's Field NMR (EFNMR) experiment works

The first-revision PyPPM operates using the Varian-Packard method, named after the two inventors. (For information on the second-revision operating scheme, keep reading further down in the details)

Using the Varian-Packard method, an EFNMR experiment can be boiled down into three stages: polarization, quenching, and acquisition...

The entire scheme is shown graphically below.

And a few final notes...

Polarization dead-times: The astute reader will notice that there is a short dead-time between relay switching and turn-on/turn-off of the current sink. This allows the fragile relay contacts to move between positions without having to worry about arcing due to unquenched inductor current.

Acquisition dead-time: A second dead-time is placed after the polarization stage of the experiment to give the relay contacts even more time to stop chattering before the low-voltage signal is acquired through the analog signal chain.

Recycle delay: This is a feature to satisfy the chemist in me. If multiple scans (polarize, quench, acquire) are performed in order to increase the signal-to-noise ratio of the final signal, the device is should wait a bit between scans, both to let the coil cool and to allow the sample to return to its equilibrium state.

PyPPM Hardware system-level overview (a.k.a. first revision System Design Doc)

Sensor coil: The sensor coil is arguably the most critical component of an EFNMR system. It's inductance and resistance determine how fast it can be switched on and off, how much current it can carry, and how sensitively it can detect the weak oscillating magnetic field produced by the sample.

The current sensor coil design (rev 1.0) in the PyPPM is a 10.2 cm long solenoid wound around a 5.0 cm diameter PVC pipe. The solenoid has four layers of 158 turns each, totaling to 632 turns of AWG 22 enameled copper wire. The solenoid has an approximate inductance of 7.5 mH and a resistance of 5.5 Ohms.

Future versions of the sensor coil will focus on providing a level of humbucking to minimize the amount of electrical interference that is received during acquisition. The current coil easily detects the 30th harmonic of 60 Hz mains wiring from hundreds of feet!

Sensor relay: The relay switches the sensor coil between the polarization circuit and the acquisition circuit. A small-signal DPDT relay (Omron G6A) was chosen to ensure galvanic isolation between the low-noise analog signal chain and the noisy polarization circuitry.

Polarization battery: The current design of the PyPPM admits any DC voltage source under 15 V, battery or otherwise. However, this voltage source must be able to maintain several Amps of current for several seconds. A lead-acid car battery is currently being used with the PyPPM, which allows the system to be used away from mains electrical systems.

Constant current sink: The constant current sink must be capable of switching several Amps through an inductor. The current design uses a logic-level MOSFET to close the circuit between the sensor coil and ground. A gate driver is used to ensure the MOSFET is turned off hard.

While turn-on may be slow (based on the L/R curve), turn-off must be rapid (less than 500 microseconds). Given the parameters of the sensor coil, the current sink has to rapidly absorb 20 mJ of stored inductor energy during quenching. This is accomplished by paralleling a TVS diode with the MOSFET.

Analog signal chain: The voltage induced through the sensor coil is tiny - a couple hundred microvolts at best. The role of the analog signal chain is to boost this signal out of the noise floor (coil RMS thermal noise is ca. 18 nV) to a level that is suitable for digitization on a 5 V full-scale.

Analog power supply: An early design requirement for the PyPPM was to keep everything powered by the USB 2.0 bus, with the exception of the polarization power supply. To accomplish this, the analog power supply converts the noise-laden 5 V USB rail voltage into +/- 5 V rails, capable of supplying tens of milliamps with around 100 microvolts of noise and ripple.

Microcontroller: An Atmel ATmega32U2/4 8-bit microcontroller is used in the PyPPM to coordinate experimental timings, read data from the ADC, and interface to the host computer via USB 2.0. The PyPPM registers as a USB 2.0 CDC-ACM (USB-serial device), which shows up as a character device node in Linux and Mac OS X.

Host computer: The software written for PyPPM requires Linux or Mac OS X in order to work. Work is underway to interface the PyPPM to a Raspberry Pi running Apache (PiPyPPM anyone?)

PyPPM second-revision System Design Document

The second-revision PyPPM hardware design incorporates a significant number of new features that will facilitate use in environments that are less hospitable to EFNMR (inhomogeneity, interference). Here's a rundown of everything new:

PyPPM Software overview

The software written to communicate with the PyPPM hardware can be split into four categories: the core C library, the command-line tools, the graphical tool, and the Python extension.