Close
0%
0%

PyPPM: A Proton Precession Magnetometer for all!

A device for conducting Nuclear Magnetic Resonance experiments at Earth's field

Similar projects worth following
When was the last time you observed something purely quantum mechanical, without any classical analog? Well partner, that's too long!

The PyPPM is a single-board Proton Precession Magnetometer, which is a device for conducting Nuclear Magnetic Resonance (NMR) experiments (think MRI) using the Earth's magnetic field, without the need for expensive superconducting magnets.

The short story: the nucleus of every hydrogen atom behaves like a microscopic bar magnet. This device manipulates those tiny bar magnets by coaxing them into alignment, then letting them loose to relax back to their rest state. As the nuclei relax, this device reads back the magnetic field they produce as an AC signal called a Free Induction Decay.

This device is the first open-source PPM that doesn't require extra hardware or messy board-to-board connections. It connects directly to a Linux PC or Mac via USB and is controllable using a simple Python API.

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...

  • Polarization: During this first stage, the sensor coil is connected (via a relay) to a constant current sink that maintains a current of roughly 2 Amps. The sample in the sensor coil develops a magnetic polarization that increases exponentially in time, with a time constant of a few seconds (T1). This stage usually lasts about five to ten seconds, depending on the amount of polarization required to achieve the desired signal amplitude.
  • Quenching: This is the most critical step for a Varian-Packard design. The current sink is switched off, and the energy stored in the coil (and thus it's magnetic field) must be rapidly quenched. If the field is not quenched rapidly enough, the sample will not keep it's magnetic polarization, and there will be no signal. (More on this later)
  • Acquisition: If everything went as planned up to this point, the sensor coil is connected (via the same relay) to an analog signal chain that provides 110 dB of amplification over a 3 kHz bandwidth centered around 2 kHz. The amplified signal is digitized and sent via USB to the host computer for further processing.

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....

Read more »

  • 1 × ATMEGA32U2-AU-ND Microcontroller AVR 8-bit, 32k Flash, USB 2.0
  • 1 × AD8428ARZ-ND Instrumentation amplifier, 66 dB, 3.5 MHz
  • 1 × AD8597ARZ-ND Low-noise operational amplifier, 10 MHz
  • 1 × OP462GSZ-ND Quad operational amplifier, 15 MHz
  • 1 × ADA4841-1YRJZ-R7CT-ND Rail-to-rail operational amplifier, 80 MHz

View all 60 components

  • PyPPM 2.2 is born

    Bradley Worley10/06/2014 at 15:47 0 comments

    There's a crick in my neck from staring at these monitors too long yesterday, but it's the necessary pain from re-working the entire PyPPM 2.1 design into a new set of schematics and board files: PyPPM 2.2!

    There are a few big changes and a smattering of subtle changes in the new design:

    • Corrected -2.5V regulator pinout: I had screwed up the pinout on the adjustable version of the LT1964 low-noise regulator, and had to bodge in a fix on the PyPPM 2.1 board. This is fixed properly in the new design.
    • Changed dual SD101A's to BAV199: The input protection diodes in the instrumentation amplifier section have been changed to lower-leakage, lower-Vf SOT23 parts to improve signal chain performance.
    • Fixed part numbering scheme: This was driving me crazy, as I'd been continually adding and removing parts and renumbering in random ways. The parts now follow a logical ordering based on their appearance in the schematic.
    • Added +/- 5V rail supervisor: Now, the only way that the high-current +/- 5V regulators should start up is when (a) there is USB power and (b) there is at least +/- 7V applied to the regulator inputs. I was getting annoyed by the LT1763A "starting up" from leakage alone without an input voltage.

    All the changes add up to a more robust hardware platform that's easier to build and maintain.

    Oh! I also finally soldered everything onto the PyPPM 2.1 board:

    Isn't she pretty? :)

  • Capacitive tuning is working!

    Bradley Worley10/05/2014 at 02:14 3 comments

    After bodging in the correct connections to bring the -2.5V rail up (or down?) on the PyPPM 2.1 board, I finally got digitally selectable capacitive tuning working in the firmware and software.

    The idea behind tuning is to place a capacitance in parallel with the sensor coil such that the resultant LC tank circuit resonates at a desired experimental frequency. Most devices have used manually adjusted capacitor banks or variable caps, but the PyPPM uses a digital control scheme that provides 64k unique capacitance values.

    Check it out:

    If everything goes well, I'll be able to run a field test soon of the non-adiabatic pulse program with and without tuning to show the performance in a real-world setting.

    ~ Brad.

  • The first data from PyPPM 2.1!

    Bradley Worley10/01/2014 at 15:11 3 comments

    I've been ironing out the wrinkles in the new PyPPM firmware, and I finally have the assembly-based acquisition and delay routines working.

    One nice thing about assembly is how fast I can read data from the ADC now: 100 kS/s and PyPPM2 doesn't even break a sweat! Check it out:

    And now the frequency domain shot...

    This is with a 50 Ohm terminator on the input BNC connector. I couldn't be bothered to get the real frequency-domain units. Maybe another time. :)

    Until next time!

    ~ Brad.

  • PyPPM "Artist's" Rendition

    Bradley Worley09/29/2014 at 00:54 0 comments

    Oh boy, calling me an artist is rather charitable... :P

    Nevertheless, here's a sketch of what the PyPPM should resemble once it's completed:

    Since the bulk of the design is housed in a Hammond aluminum case, it's pretty basic. A box, a few inputs and outputs, a computer, and that's it!

  • Pulse programs are here!

    Bradley Worley09/24/2014 at 21:30 0 comments

    Hey everybody! I'm back from a 96-hour coding binge with some amazing new PyPPM features to give you, in the form of pulse program support.

    Pulse programs are the software glue that brings all the new features promised in the PyPPM 2.1 hardware together in a powerful way. I've also back-ported them to older hardware/firmware versions, so you can write one pulse program on the v1r3 hardware, and then immediately run it on the v2 hardware if you choose to build it. Cool, huh?

    Finally, because pulse programs are tricky little beasties, I'm starting to compile a library of known-to-work programs that can be used with PyPPM.

    Let me know what you think!

    ~ Brad.

  • PyPPM 2.1 Speaks! :)

    Bradley Worley09/20/2014 at 19:29 0 comments

    It seems that I was a bit pessimistic when I said that the USB stack would need rewriting for the PyPPMv2. With one extra flipped bit in an AVR register, the PyPPM 2.1 sprang to life over the USB port, and even said its first words:

    $ ./ver
    VER: 2.1

    Aww, how cute!


    Of course, while the new hardware is talking over the USB, it's still "broken" with respect to the traditional PyPPM version 1.x host-side software. It's all because of the new pulse programming features that will go into the new designs: while previous versions of PyPPM had a canned, hard-coded sequence of operations that was followed for every experiment, the v2 will be much more flexible, taking any user-defined sequence of commands and executing them. So, instead of having a short list of acquisition parameters, the board will take instructions that contain the required parameters.

    The fun part? The host-side software wasn't written that way. At all. To remedy this, I plan on back-porting the pulse programming features of PyPPM 2.1 into the older firmware source trees, effectively doing away with acquisition parameters on all PyPPM devices and ushering in pulse programs for everyone!

    It's definitely a long-term goal, and not something I plan to accomplish before the prize deadline. But still post-worthy, eh?


    On that note, I'm planning on putting out a Part 2 video on PPM/NMR concepts this weekend, and also a final 'working product' video of PyPPM 1.3 that includes a complete screen cast of the host computer during the experiment.

    ~ Brad.

  • I'm on a Markdown rampage!

    Bradley Worley09/19/2014 at 20:59 0 comments

    Hey everybody! I've been writing README.md markdown files in the PyPPM GitHub repo for the past few days now, so hopefully everything in the repo will make more sense for the intrepid souls who choose to venture therein.

    Every subdirectory of the main tree now has a README.md file that describes the contents of that subdirectory, and the main tree README details top-level details of the project.

    Feel free to check out the GitHub repo for PyPPM, and please let me know what still needs more explanation. I'd really like the documentation to be useful. :)

    ~ Brad.

  • So I'm tagging PyPPM as completed...

    Bradley Worley09/15/2014 at 19:21 0 comments

    Hey everybody! I got the PyPPM v2r1 board assembled over the weekend, check it out...

    Of course, I ran into several issues. For you schadenfreude enthusiasts, here's a quick rundown:

    • Incorrect -2.5V regulator pinout: I had failed to notice that, while the LT1761-5 and LT1761-SD have the same pinout, the LT1964-5 and LT1964-SD don't.
    • Swapped feedback resistors on high-current -5.0V rail: I chased my tail for an hour trying to figure out why I was getting -1.5V from the regulator. Turns out I had the feedback network backwards.
    • ID10T: I managed to short the +5.0V high-current rail to ground with a bit of stray solder across a bypass capacitor, and ended up releasing magic smoke from an LT3015, several tantalums, a FAN3111 and two diodes. Good grief...

    The good news is that everything has been fixed in the schematic and board layout, and the changes are already pushed to GitHub. :) However, I will need to perform some ugly solder hackery to resolve the footprint issue on the LT1964.

    To make things even more interesting, the firmware I had prepared for the PyPPMv2 didn't even set up USB communication; the two AVR's are just different enough that I'll need to spend considerable time rewriting the new firmware.


    Long story short, while work on the PyPPM project will live on in PyPPMv2, I'm calling PyPPMv1 a finished project, really just for closure's sake. :P PyPPMv2 brings several new and exciting features to the table, but if you're looking for a basic, working Proton Precession Magnetometer, PyPPMv1 is a perfect fit!

  • A quick vid of PyPPMv1 in action

    Bradley Worley09/08/2014 at 20:07 0 comments

    Hey everybody! I filmed a bit of video on the use of PyPPMv1 in real life. It's pretty impromptu, and the sun kept us from getting good shots of the computer screen, but it captures the main points of setting up PyPPMv1 to take measurements. Check it out...

    Oh, and here's another! This one goes a bit more in depth on specifics. If you watch to the end, you'll see just how easy it is to use the Python API for PyPPM.

    Let me know if there's anything about using PyPPM you'd like clarified, by the way. I'll be happy to make a new video!

    ~ Brad.

  • NMR/PPM Concepts - Part 1

    Bradley Worley09/08/2014 at 03:24 2 comments

    Hey everybody! I finally got around to making the first video on what will probably be a three-part set on the fundamentals of NMR, PPM's and PyPPM.

    I tried to keep it as simple as possible, without clouding the waters with too many equations. Please let me know if you have any questions, comments or requests!

    Also, I'll post a short demonstration video of PyPPMv1 tomorrow, so stay tuned!


    ~ Brad.

View all 25 project logs

  • 1
    Step 1

    Download the latest PyPPM sources zip file from the PyPPM GitHub repository.

  • 2
    Step 2

    Unpack the sources file (i.e.: unzip pyppm-master.zip; cd pyppm-master/)

  • 3
    Step 3

    Locate the latest PPM circuit board design files in 'designs/' (currently version 1.3, as 'designs/ppm-1.3/ppm-v1.zip').

View all 10 instructions

Enjoy this project?

Share

Discussions

averagejoe_85 wrote 06/12/2014 at 22:01 point
Great work! I am about six months in on my PPM and have not had any luck yet. I have learned much from your write up :)

  Are you sure? yes | no

Bradley Worley wrote 06/12/2014 at 23:10 point
Right on! One of my main goals is to provide a truly working model for others to learn from, so that's great. :)

The design of a working PPM is no small feat, so keep it up! And let me know what else I can clarify or explain in PyPPM; I really want to make this science accessible for more experimenters.

  Are you sure? yes | no

Michael O'Brien wrote 06/09/2014 at 01:52 point
Pardon the ignorance, but this project is an [over simplified] open source research tool, correct?

  Are you sure? yes | no

Bradley Worley wrote 06/09/2014 at 02:03 point
No worries, thanks for the interest! Actually, Earth's/low field NMR has significant industrial applications, particularly in oil and gas.

That said, one goal of the PyPPM is to bring an inexpensive open-source device to the community that could be used in undergraduate courses, for example. Not every university can afford to let undergraduates use their million-dollar high-field NMR spectrometer.

But yeah, NMR *is* mainly used for research purposes. :)

  Are you sure? yes | no

Bradley Worley wrote 06/09/2014 at 02:10 point
I should also mention that PyPPM is not one of my research projects. It's actually a personal side project; if anything it's been a distraction from my thesis work. :)

  Are you sure? yes | no

Adam Fabio wrote 06/07/2014 at 02:58 point
Awesome project, and a great entry for The Hackaday Prize! Don't forget to document. Can you tell us a bit more about the your implementation of the Proton Precession Magnetometer? Is your coil up in the PVC frame in Picture #3?

  Are you sure? yes | no

Bradley Worley wrote 06/08/2014 at 15:55 point
Thanks Adam! I'm actually settling in today with a few Red Bulls and chip bags to document as much as I can here on HAD.io...

You're right, the coil is in the PVC frame, and the PPM board is dangling by coax from it. ;)

  Are you sure? yes | no

Adam Fabio wrote 06/12/2014 at 01:45 point
Great update Brad! I like the internet connected aspect as well - The more open science data we get out there for research and education, the better! That also fits right in with the connected portion of The Hackaday Prize.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates