Peering Inside A Portable,: $200 Cancer Detector
Peering Inside A Portable,: $200 Cancer Detector
Peering Inside A Portable,: $200 Cancer Detector
Reducing health-caRe costs is a key conceRn foR the us goveRnment, consumeRs, and coRpoRations that buy health insuRance. towaRd that goal, haRvaRd univeRsity and massachusetts geneRal hospital have developed a small, inexpensive canceRdetection device.
s part of a project to design the electronics for a portable, low-cost cancer detector, I had to understand NMR (nuclear magnetic resonance), a measurement technique that excites and measures the spin precessions of atomic nuclei. I also relied on the expertise of Hakho Lee, PhD, and David Issadore, PhD, two researchers at Massachusetts General Hospitals Center for Systems Biology. Lee had been using magnetic-relaxation switching to explore ways to reduce the size and bulk of an NMR machine to the point at which it could be carried into the field to perform medical diagnostics.
Lee had refined an NMR-based technique for detecting tuberculosisspecific proteins, using a fist-sized permanent magnet and a rack full of electronics. My task was to squeeze that rack into a book-sized unit. The electronics box needed to create a string of RF pulses of precisely controlled frequency in the range of 20 to 30 MHz, and the phase between the first and subsequent pulses also had to change by a precisely controlled amount. This discussion requires some background on NMR techniques. NMR 101 NMR refers to any of several measurement techniques that excite and measure the spin precessions of atomic nuclei. Think of a proton as a sphere
with its charge uniformly distributed throughout. The protons spin can be understood as making it rotate at a fixed rate. This rotation makes every bit of charge move in a circle. Then, analogous to current in a solenoid, these moving charges create a magnetic field, or moment, that aligns on the spin axis. As with a macroscopic magnet, this magnetic moment tends to align with an externally applied magnetic field. Just as perturbing a gyroscope makes it precess around the axis of the external gravitational field, perturbing a proton with a burst of RF (radio-frequency) energy at a certain frequency in the presence of a magnetic field makes its moment precess at the same frequency. This resonant frequency, the Larmor frequency, is a function of the magneticfield strength in the protons neighborhood. Irish physicist and mathematician Joseph Larmor in 1896 proposed the Larmor frequency, which stipulates
June 9, 2011 | edn 19
image: thinkstock
that a magnetic moment in a magnetic field tends to align with that field. As the protons magnetic moment gradually realigns with the external magnetic field, the proton emits RF energy, again at its Larmor frequency. Not only protons but also many atomic nucleithose possessing an odd number of protons or neutronshave spin, with different Larmor frequencies. Hydrogens frequency, for example, is 42.58 MHz/tesla. One tesla equals 10,000 gauss; one gauss is approximately equal to the earths magnetic-field strength. Nitrogens frequency is 3.09 MHz/tesla. Conversely, the common isotopes of oxygen and carbon have no net spin; therefore, NMR cannot detect them. In NMR spectroscopy, each element has a unique frequency, and nearby atoms slightly shift a given atoms Larmor frequency, making it possible to infer the molecular structure of a sample (Reference 1). NMR spectroscopys success depends on correctly interpreting tiny changes in Larmor frequencies, which themselves are functions of the surrounding magnetic field. As such, the technique requires care in creating a uniform and stable magnetic field. In addition to determining a protons Larmor frequency, the RF signal also provides the two time constants of the decay in spin precession. After
40 SEC 80 SEC
AT A G L A N C E
Each element has a unique Larmor frequency, and nearby atoms slightly shift a given atoms frequency. The combination of these two actions makes it possible to infer the molecular structure of a sample using NMR (nuclear-magnetic-resonance) spectroscopy. Include no more than one new concept per subsystem because fixing two bugs is an order of magnitude harder than fixing one. Maintaining documentation discipline is difficult when you are trying to meet deadlines; design reuse without a document trail, on the other hand, is practically impossible. A digital camera with a macro lens is a useful tool for documenting hardware changes. The biggest barrier to using an FPGA approach may be software. If some new IP (intellectual-property) core doesnt work as its manufacturer advertised or some new software revision makes your board stop working, you are at the mercy of technical support.
a proton is perturbed, it relaxes to bulk thermal equilibrium with a time constant of T1. Interaction with neighboring
spins causes a shorter time constant, T2. These interactions detune the individual precessions, causing destructive interference and shortening the decay time. T2 describes the immediate magnetic environment of each nucleus and, thus, its molecular composition; T 2 also provides information about the inhomogeneity of the bulk magnetic field. The greater the inhomogeneity, the more the individual Larmor frequencies will interfere and the faster the RF signal will decay. In all but the most carefully controlled magnetic fields, the bulk fields inhomogeneity effects completely overwhelm the more interesting information about a protons immediate neighborhood. You can solve this problem using spin echo, an elegant technique, which works as follows. Start by sending an RF pulse with enough energy to bring the precession angle of the magnetic moments down to 90 with respect to the bulk magnetic field. At first, the precessions are all in phase with each other, with emitted RF at a maximum. Nearly immediately, however, the Larmor frequencies cause the precessions to dephase. After a few milliseconds, the dephasing reaches its maximum, and the net radiated RF is consequently low. Next, send another RF pulse that is twice as long as the original. Because
4 mSEC
Figure 1 By plotting the decay of the peaks of the echoes, you can get an accurate assessment of T2. Times are approximate and adjustable.
the first pulse rotates each magnetic moment by 90, the second pulse rotates it 180 more. To picture what happens next, imagine holding a closed paper fan before your face and then slowly opening it to represent the dephasing process. The righthand part of the fan represents the faster moments, and the lefthand part represents the slower moments. Now, flip the fan around. The faster moments are now on the left; they begin catching up with the slower moments, closing up the fan and restoring the RF signal. You can repeat this process until the precessions completely decay (Figure 1). By plotting the decay of the peaks of the echoes, you can get an accurate assessment of T2. This article provides only a cursory treatment of NMR, using classic analogies to describe an inherently quantum effect. However, my goal was to provide a taste of the engineering issues. Most of the Larmor frequencies of interest are in the decade between 10 and 100 MHz, which, from an engineering standpoint, is a good place to be because lots of earlier RF-design concepts are applicable. Although the design of the receiver chain isnt trivial, for example, its a piece of cake compared with tuning in and identifying short-wave radio signals from thousands of miles away. The SNR (signal-to-noise ratio) increases with the static magnetic field, so keep the field as high as possible. For large samples, this means using a massive magnet with supercooled coils. For small samples, on the other hand, you can create fields larger than 1 tesla with a handheld permanent magnet. The small magnet in the DMR-3, the official name for this instrument, creates a roughly 0.5-tesla field (Figure 2). Relaxation times are on the order of a few milliseconds to a few seconds. Demodulated signals range to tens of kilohertz; you must acquire data at 100 kHz, for example, for a second or so. This is not, in other words, a taxing data-acquisition problem. IDENTIFYING THE PROBLEM While I was working on this project, Lee and Issadore were working on their goal of making the NMR portable. In pursuit of this goal, Lee used magneticrelaxation switching, which binds mag-
netic nanoparticles to proteins by first binding the nanoparticles to proteinspecific antibodies, which in turn bind to proteins. Once these nanoparticles find the target proteins, they clump together, significantly decreasing the spin-relaxation time of nearby atoms. In other words, clumped nanoparticles translate to a shorter T2. My design needed to demodulate the
returned signal at the RF frequency and then digitize it at 100,000 samples/sec for several seconds. Several stacked runs results would be transmitted to a host computer for analysis. All pulse timing needed to be accurate to 1 sec or better. The host computer controls all parameters over USB (Universal Serial Bus)and asynchronous-interface ports. The box had to be rugged and portable, and
the first deployment would be in Africa (references 2 and 3) in three months. DESIGNING THE SYSTEM The package for the system is a Lansing Instrument MicroPak enclosure. The top cover is replaced by a custom-milled piece of aluminum, doing double duty as a heat sink for the RF transmitter and a quiet enclosure for the RF-receiver chain. The instrument contains four PCBs (Figure 3). The controller, ADC, and DDS (direct-digital-synthesizer) boards live in the bottom section, and the new board containing the RF-receiver signal chain is up top (Figure 4). The controller board includes a Texas Instruments TMS320F28235 Delfino DSC (digitalsignal controller), an ISSI (Integrated Silicon Solution Inc) IS61WV102416 asynchronous 1M-word16-bit SRAM, and an FTDI (Future Technology Devices International) FT245 USBinterface chip. The Delfino DSC performs speedy, 32-bit math and I/O operations, and it comes with an array of peripherals perfect for instrumentation, including highresolution PWMs (pulse-width modulators) and time stampers, UARTs (universal asynchronous receivers/transmitters), CAN (controller-area-network) circuitry, and DMA (direct-memoryaccess) controllers. Most important, it features full silicon support for runtime debuggingnot just for setting breakpoints but also for viewing, altering, and logging memory and register space when the processor is running at full speed. I considered using an FPGA but decided against it. Although the cost of materials doesnt strongly drive my design decisions, I cant justify replacing a $25 microcontroller with a $250
22 edn | June 9, 2011
FPGA. And the BGA packaging typical of FPGAs is an issue for small production runs. The biggest barrier to using an FPGA approach, however, is software. Every FPGA developer I know has a horror story of some new IP (intellectual-property) core that didnt work as advertised or how some new software revision made a board stop working. That said, I do scatter small FPGAs and CPLDs (complex programmablelogic devices) throughout my designs as insurance against mistakes and to allow for reuse in unanticipated ways; the DMR-3 contains two of them, for example. As a side benefit, programmable logic can often unscramble buses and do other board-cleanup chores, turning a risky six-layer PCB design into a simpler four-layer configuration. The Delfino DSC talks to the DDS board via a clocked serial protocol implemented with GPIO (general-purpose input/ output) pins. The DDS board contains a pair of synchronized Analog Devices AD9954 DDS chips, which generate RF signals at the same frequency, but with programmable phase separation. One DDS chip generates the NMR transmit-
ted signal; the other creates the local oscillator that mixes the received signal to baseband. The AD9954 is admittedly something of an odd choice. Alternatively, I could have used a dual-DDS AD9958 chip, which I already had because Id used it for a physics experiment that required eight phase-staggered sine waves slowly swept from 10 kHz to 20 MHz. This problem is a nasty one in the analog domain, but its not so bad with a bunch of DDS chips. From them, a pair of now-obsolete AD8326 CATV (cable-television) amplifiers amplify the RF signals, illustrating the point that baseband amplifiers, which get faster every year, can process RF signals in the 10- to 100-MHz range. A search on the Web for CATV and DSL (digital-subscriber-line) produces lots of useful amplifiers that work into the tens of megahertz. From the DDS board, the NMRs transmitter and local-oscillator signals transfer through the aluminum top block and into the RF cavity, containing the only new board in the system. For this design, I stayed with the receiversignal chain that Lee had tested: a pair
Figure 3 The system includes a DDS board (left), a controller board (top right), and an ADC board (bottom right). Because the DDS and power-amplifier chips get hot and because supplemental ventilation is impossible, the DDS board mounts on the top-cover heat sink with Bergquist foam.
Figure 4 In the RF section of the design, the trimming potentiometers control the gains of the AD604 amplifiers.
of dual variable-gain AD604 amplifier chips, with a Mini-Circuits ADE-6 mixer between them. For the receiver/ transmitter switch, I chose an ADG1419 IC, which lacks the isolation of a more traditional RF switch but comes in a more convenient package. I solved the isolation problem by turning off the transmitter signal at the DDS board. The demodulated, amplified signal returns to the noisy part of the box, where it is digitized by an Analog Devices AD7690 PulSAR (successiveapproximation-register) ADC sampling as fast as 100,000 samples/sec (Figure 5). This pin-compatible series of converters lets me select an optimal speed and SNR for my application without changing the PCBs design. The ADC board also
F O R M O R E I N F O R M AT I O N
analog Devices
contains a Xilinx XC95144XL CPLD to handle housekeeping and serial/parallelconversion tasks, as well as to interface to DACs I didnt use for the design. Alternatively, I could have interfaced the ADC directly to the DSC through its McBSP (multichannel buffered serial port), but the ADC board was at hand. The ADC board interfaces to the controller board through a 48-pin DIN connector containing the DSCs 16-bit data bus along with a few address and strobe lines. The DSC uses DMA to transfer one 262,144-sample NMR scan of ADC data into the external SRAM. Between scans, it adds the data from the last scan to another area of external SRAM that stores the accumulated scans. When the host decides that the instrument has accumulated enough scans, it reads out the accumulated data over the USB interface. Note that USB is not an isolated protocol. As soon as you plug in a USB cable, youve connected your instruments ground to your PCs ground, with predictable results. Its therefore a good idea to consider adding isolation, or be ready to specify an external isolator. Also, the FT245 chip that I used for the USB interface has a virtual-communication port that dramatically simplifies the host softwares burden, allowing control through MathWorks Matlab and National Instruments LabView, for example. A trade-off exists, however, in that the host periodically sends packets to the USB to poll the status of the instruments USB chip. In sensitive instruments, this added activity can noticeably affect the noise floor. One solution is to force the host application to close the communication port during the noise-sensitive acquisition phase and then reopen it for the data-transfer phase. PROTOCOL PARTICULARS My instruments always include a diagnostic ASCII protocol comprising simple two-character commands and heavy use of punctuation. Commands contain one or two alphabetic characters followed by an optional numeric argument and a semicolon, and spaces are ignored. For example: To set the transmit pulse width to 50 sec, the host sends PW 50; If the instrument understands the command, it sends a confirmation: PW 50! If the command isnt in the instru-
www.analog.com
apple computer
www.apple.com
Bergquist
www.bergquist company.com
FtDi
http://csb.mgh. harvard.edu
mathWorks
www.mathworks.com
mini-circuits
www.ftdichip.com
harvard University
www.minicircuits.com
national instruments
www.harvard.edu
issi
www.ni.com
texas instruments
www.issi.com
Lansing instrument corp
www.ti.com
Xilinx
www.lansingenclosures.com
www.xilinx.com
ments vocabulary or if the argument is out of range, it returns PW 50? If the host wants to read the current setting of the transmitter pulse width, it sends the command in lowercase: pw; The instrument returns pw50! This protocol is inappropriate for efficiently transferring large blocks of data, and usually gets supplemented or replaced as the host software is developed. Still, it allows you to control an instrument from any terminal emulator. I put the same protocol on the USB and asynchronous ports, with both ports always active, so I can use one for the main host interface and the other for a diagnostic port. At the host end of the system chain, Changwook Min, a mobile-programming engineer at Massachusetts General
Hospitals Center for Systems Biology, wrote the code to control the DMR-3 and analyze the returned data. He performed the initial development on an Apple Macintosh computer, using Objective-C under the Apples Xcode 3.2.5 IDE (integrated device environment). He then ported the application to the iPhone 3G and iPad running iOS Version 4.2. Xcode has no native graphing or plotting framework, so Min used Apples Core Plot. REVISION: NOT TO BE If Id had a chance to clean up the design, I would turn the bottom three boards into one. Id stick with the Delfino DSC, discard the CPLDs, and couple the PulSAR ADC directly to the DSC through the McBSP port. Id either
replace the DDS chips with a dual part or, more daringly, use a single DDS for the transmitting and receiving chains. After all, we dont acquire data while transmitting, so theres no reason why one DDS couldnt do both functions. Id optimize the RF power amps for the actual power; we were unsure of the power budget when we performed the initial design and, therefore, went a little overboard. I would also design the receiver path with cost in mind, replacing the second VGA (variablegain amplifier) with something more appropriate. Such a redesign will never happen, however. Once a concept is proven and the science is done, you either abandon the instrument or throw it over the wall to industryto an engineering team that will undoubtedly start from scratch.EDN ACkNOwLEDGMENT The author would like to thank Hakho Lee and his talented team at the Massachusetts General Hospital Center for Systems Biology, especially physicist Dave Issadore and programmer Changwook Min. Thanks also to Keith Brown of Harvard SEAS for his NMR tutelage, and to Al Takeda for photographing the DMR-3 viscera. REFERENCES
1 Reusch, William, Nuclear Magnetic Resonance Spectroscopy, Michigan State University, http://bit.ly/lsPuCJ. 2 Haun, Jered B; Cesar M Castro; Rui Wang; Vanessa M Peterson; Brett S Marinelli; Hakho Lee; and Ralph Weissleder, Micro-NMR for Rapid Molecular Analysis of Human Tumor Samples, Science Translational Medicine, Volume 3, Issue 71, Feb 23, 2011, pg 71ra16, http://bit.ly/iRM95X. 3 Issadore, David; Changwook Min; Monty Liong; Jaehoon Chung; Ralph Weissleder; and Hakho Lee, Miniature magnetic resonance system for pointof-care diagnostics, Lab on a Chip, May 5, 2011, http://bit.ly/j7FlmL.
AD604 RF AMP
ADE-6 MIXER
AD9954 DDS
AD9954 DDS
XC9572XL CPLD
XC95144XL CPLD
Figure 5 Signals take paths in the DMR-3 as they traverse the designs various circuits.
AUTHORS BIOGRAPHY Jim MacArthur is the chief engineer at Harvard Universitys Electronic Instrument Design Laboratory. He has a bachelors degree in electrical engineering from the Massachusetts Institute of Technology (Cambridge, MA).