homebrew multi-channel analyzer

This is bound to get mixed up with things in Electronics, check both. Physics-specific stuff here, mostly.

Re: homebrew multi-channel analyzer

Postby Philipp Windischhofer » Mon Sep 15, 2014 2:10 pm

Okay Doug - here's what I've got so far in terms of MCA:

MCA.JPG
logic on bottom board, analog circuit on top


The two boards are currently mounted back-to-back using threaded rods - those are metric, M3. I can send you some M3 nuts, if you don't have them / can't get them easily in the US. I left the connecting yellow wires long enough so that you can also mount the boards side by side and still have flexibility - you can always make them shorter, anyway.
The rear cable carries the serial signal, which is also available on a screwclamp. The pinheads on the right connect to the ICSP dongle for PIC software download.

The very left connector on the front side (i.e. facing the camera) is a "pulse-out" signal, for each pulse detected and counted, a 3.3V square impulse is generated. Intended for fast and easy "cpm" measurement, just connect it to a counter.

The rear connector on the top board is signal in from the preamp. As for supply voltage: required is 3.3V for the logic part and +/- 12V for the analog circuit.

Here's the input signal waveform that I tested the circuit with (fast rising exponential followed by slow falling exponential):
pulse.jpg
input signal and output of peak detector (10us/div)


Communication settings for serial interface: 115200 baud, 8 databits, 1 stopbit, no parity.
Here's how the thing is controlled (i kept the commands pretty minimalistic to save resources and avoid unnecessary complications):

Code: Select all
OK     //MCA is started up and ready to accept commands
R       //reset spectrum
OK     //command carried out successfully
r        //reset "total counts" register
OK
n       //get "total counts" register
OK
0       //register reads zero, since it was resetted just before
h       //get "last pulse height" register
OK
114     //last pulse counted was binned in channel 114
S        //start acquisition
OK
s         //stop acquisition
OK
c115     //read channel115
OK
6783     //# of events in ch. 115
c116    //read channel 116
OK
1314
c5000
ERR      //some error checking is done, too
C        //read entire spectrum
0         //ch. 1
0         //ch. 2
0
....    //all other channels (4096 channels in total) follow here
0
0       //last channel


Here are some results (I just manually swept through some discrete voltage levels, so no precise timing and hence different peak heights in the spectrum):
1to9volts.jpg
entire 12 bit spectrum with peaks of various amplitudes


Below 1V, however, things start to get a little nonlinear. Peaks below 300mV are not detected or smeared out to the left of the spectrum.
below1v.jpg


What do you think? If you're OK with the functionality, I'll upload the final schematics / board layouts as well as the source code and get the thing on its way to you.

-Philipp
Philipp Windischhofer
 
Posts: 21
Joined: Wed Aug 13, 2014 2:12 pm

Re: homebrew multi-channel analyzer

Postby Doug Coulter » Mon Sep 15, 2014 7:20 pm

Looks pretty good except for the bottom end, yeah. I see both stretching and compression down there. In theory, if it's repeatable, we could fix it in the PC later, though - it's a better place to do any heavy-lifting type math. I noticed issues even on the big-guy expensive stuff, actually. It's not like all the available detectors are perfectly linear across the entire range, or that you need 4k for anything but maybe HPGE - NaI has fairly broad lines by comparison, and 1k gets a little more than it really has anyway. Usually I wound up using a small crystal for the low end of energies, and another big one for the high end, at any rate - with appropriate gain changes so each one's max output was full scale for the converter - then do the math later to make them into real numbers. The big ones don't work too well in the few kv range for whatever reason, and the little guys excel there, but stink at high energies where more often than not, the photon just compton scatters out anyway.

Protocol looks fine to me. I tend to use ! as the "reset and go" since it's just one character and fairly easy to remember, and \n as the newline character (mainly because I'm a linux guy, and it's also the network usual standard - all terminal programs will work with it too). I can of course emit or accept anything anyway - as long as I know what it is. I like the Larry Wall (perl) motto - be strict in what you produce, but lax in what you'll accept. FWIW, all my stuff - even my GW Instek scope, uses \n (linefeed) as the line terminator. No \r (carriage return) anywhere in the entire system. There's always something. While claiming they want to all be compatible, Apple uses \r for everything, Microsoft uses \r\n (and they'd better be in the right order too!) and everything else, including sockets, use \n. I guess those "want to be compatible" claims were pure baloney all around.

Most of my stuff even leaves out the "OK" or acknowledge, as most of it just starts going and emits data continuously anyway. This is something of a different case, however, so I understand why you did it that way. It might be nice to be able to get something like milliseconds since start or reset, or some kind of time (a straight number of ms is often easiest to program, though).

I might later have some suggestions to make that low end better. One of my pals is a chip designer at LTC...he's pretty clever, too. But I'll keep my mouth shut till I see what you have here and if I can make any improvements. Getting rid of the need of a negative supply would be nice...but it's minor in the scheme of things, since DC-DC converters are around (and I have plenty of power supplies, though I'll have to make a custom for 3.3v - all my boards that want that already have a 3 terminal low dropout regulator on them, so all can run off things like USB power which is notoriously noisy ~5v). USB power is so bad that arduino uno's also let you run from a wall wart and have a regulator on board. Any a/d output while running on USB 5v is pretty suspect, as they use the power rails as the reference voltage. For my cheapo PIC based data aq, which didn't have that feature, I used one a/d channel to digitize a 2.5v reference diode on every channel sweep for that reason - so I'd be able to (re)calibrate, post-run.

Note that just about every detector on earth uses negative going pulses. Positive or negative supply, they all come out negative going from wherever they call "ground" (for the positive supply ones, the output is often a load R in series with the positive supply, and the whole mess then capacitor coupled, or alternatively, the whole mess is transformer coupled, which of course means you can have whatever polarity of output you want). If cap coupled, you then get issues if any charge due to finite input impedance builds up on the capacitor at fast pulse rates. Adding a diode...all sorts of issues with that, variable forward drop and so on.

The signal you show is a good bit slower than what comes out of an NaI (usually 5-6 uS total, <1 us rise), and tons slower than plastic scintillators (not that it matters for those, they have horrible energy resolution anyway). Looks about like ZnS speeds (slowest there is in common use). I'll post some real signal captures up here from some of my detectors at some point - right now I'm doing another project. I need to haul out all those NaI heads I have and a HV supply and check them all anyway.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: homebrew multi-channel analyzer

Postby Philipp Windischhofer » Tue Sep 16, 2014 8:18 am

I did some more testing and tweaking, and it turns out it isn't quite as bad as it looked yesterday.

First of all, here's the schematics of this version:
PeakDetector.pdf
peak detector
(177.14 KiB) Downloaded 326 times

Logic.pdf
logic part
(355.76 KiB) Downloaded 348 times


For good quality peak detection, the time constant of R6 / C2 (on the peak detector schematic) must be optimised depending on the slew-rates of the input pulse. I did this (or, rather changed the input pulse to match the components), now using ~20us of total pulse length.

After this, I did another sweep of input amplitudes, here's the results (resulting spectrum to the left, pulse amplitude vs. channel to the right):
highvoltage.png
sweep from 1V up to 9V in 0.5V steps

lowvoltage.png
sweep from 400mV to 1V in 50mV steps


I'm a Linux guy most of the time, too (OSX for the rest), so \n for new lines in the MCA ;)
By the way: Apple did switch from \r to \n with version 10 of their OS.

I also implemented the "runtime" feature you requested:
Code: Select all
t
OK
7314303


The time is stored in milliseconds (with ms resolution) since power on, 32 bits wide (so you're good for about 50 days of continuous operation).

Sorry, I didn't know about the 3.3V problem. There would have been plenty of space on the PCB to accommodate a 3.3V LDO. Still, I could get you a small external board with just the regulator on it, probably inside some heat shrink tubing integrated into the cable. I would have to order a regulator, so it could take some time (I haven't been using linear regulators for a long time now, most of the time I stick with LM2575s).

You're correct about detectors having negative output pulses -- but are you sure commercial MCA's support negative input? In theory, it would be possible to run the circuit above with negative pulses by just swapping polarity of the comparators and the MOSFET for resetting the hold capacitor. But you would still be left with a negative voltage to digitize afterwards, which the PIC's ADC (and most other) doesn't really like. I guess you just have to have some inverting element somewhere in the signal chain. I'm using an inverting charge amplifier as preamp, so I'm going with positive pulses from there on.
I just checked some commercial MCAs (e.g. from CAEN or fastcomtec or Canberra or Ortec), and they seem to also accept only positive-going input pulses, or bipolar ones, positive lobe first (which this circuit also works with, and even better than with unipolar pulses since the falling edge is faster).

As for bipolar pulses: here's the same low-voltage (i.e. from 400mV to 1000mV in 50mV steps) sweep with a crude bipolar-pulse (1 period of a sine wave) and the result looks even better (beside some flattening at the very bottom of amplitudes):
bipolar.png
sweep with bipolar signal


Most commercial products seem to do the entire signal processing digitally which avoids most of the hassle we have here...
I'm looking forward to what you or your colleague will come up with in terms of improvement!

-Philipp
Philipp Windischhofer
 
Posts: 21
Joined: Wed Aug 13, 2014 2:12 pm

Re: homebrew multi-channel analyzer

Postby Doug Coulter » Tue Sep 16, 2014 10:14 am

Yes, 100% of the MCA's we've used - along with 100% of the detector heads we've used, use negative going pulses. Canberra included, (and all the way back to the nim bin days with Ortec and LeCroy), as well as the one we borrowed from USRA here: viewtopic.php?f=11&t=337&p=1965 Paul thought 8uS shaping was much to severe, but that's the fastest that worked best with most of our heads in real life. He suggested 2uS.
We often used 16+ uS with our detectors.

In the nim bin days, there was usually a separate "shaping" amplifier that had the option of swapping polarity. In the new days it's universally built in along with the shaping. The fact of a uP a/d only taking positive input is a very new thing in this game, and it's considered to be "your problem" as far as the chip manufacturers are concerned. You might also have noticed that the days of 3 output power supplies for gadgets have been over for decades, and rail to rail opamps have been "the thing" for quite some time now, even at 3.3v. Having lived through the entire period, it's been a long strange trip. I personally still prefer 5v logic for things when I can have it, since it's easier to drive things like low threshold fets fully on with it...Both my data aq box designs (documented on this board) use 5v, since it's also usually a bit more robust in terms of input overloads (fatter diodes protecting the chip substrate). And of course, with larger a/d scale, reduced noise issues.

Note that since most of these sensors are capacitor or transformer coupled, it doesn't usually matter where the pulse goes negative from - could be the supply rail, but back in the day it was always chassis ground. The implied high pass was usually called "clipping" in the older literature, an unfortunate overload of the word.
It makes big trouble at really high count rates, as the coupling capacitor may not have recovered by the time the next pulse comes around. But it made things easier for the physicists who now could connect with a 2- wire cable (BNC or an HV version of that) instead of having to understand how things worked inside or have two separate cables.

It's always an option. Fortunately, it's really easy to have a high slew rate inverter with most opamps (easier than non-inverting gain if you look at the step input functions in the old application books).

I can come up with a power supply for this, no problem, since most of the time it won't be lashed into the fusor system, or even in the same room. Don't want to ruin NaI heads with neutron activation, after all.


Unlike many, I often re-wire my phototube chains to use a negative HV supply, which leaves the anode at ground (or wherever you want, it's floating completely till you load it to some voltage with a resistor). That lets my preamp be DC coupled and eliminates some of the bounce issues at high pulse rates. While that is too complicated for your average physicist, it's obvious to any EE ;) . It does cause problems with some phototubes that have poor insulation near the photocathode.

Most heads use a positive high voltage supply, and ground has to be the case, so the output is floating on the HV and is negative going (there's no other direction it can go at that point). This appears to have become standard way back when, as most were also using proportional tubes, geiger counters, and so on, that all required positive HV, thus, all the prepackaged HV supplies were positive and so on. Backwards compatibility can be a problem! (Just ask Microsoft).

Good to hear that Apple didn't bother to really re-write BSD (other than the presentation layer) when they started using it for OSX. This messing around with newlines has been mentioned for quite some time, although not quite as bad as Gary Killdall using a $ for a string terminator so you couldn't use CPM for financial stuff.

OldMCA.JPG
What it used to look like...
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: homebrew multi-channel analyzer

Postby Philipp Windischhofer » Tue Sep 16, 2014 11:00 am

Oh I see - due to lack of contact with any professional MCA, I can't throw in any personal experience unfortunately ;)

You're probably correct about physicists not having EE experience. It's one of the reasons I like having some background in EE, too -- the two fields just belong together (as least from the physicist's point of view).

Your NIM-bin setup looks nice! I've always liked to have as many knobs, meters and LEDs as possible...
I also like the analog computer below -- I've only read about them, but never actually seen one (although if I interpret the text correctly, yours is breadboard to test some functions before they're wired into the real computer?).

Do you want me to change anything else in that MCA design? In case you don't - can you send me your address please?

Philipp
Philipp Windischhofer
 
Posts: 21
Joined: Wed Aug 13, 2014 2:12 pm

Re: homebrew multi-channel analyzer

Postby Doug Coulter » Tue Sep 16, 2014 1:48 pm

I expect we'll wind up collaborating on what will be the final hardware design (for the analog part), so no, don't change it unless it's trivial to make it inverting. You obviously know EE - I noticed a couple tricks that few would have happened upon, even with a hint. I *might* have a couple more, but I need a testbed to work with, given my hours-in-the-day limits. I'll PM you my address.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: homebrew multi-channel analyzer

Postby johnf » Wed Sep 17, 2014 2:56 am

Doug Philipp
From my point of view most single coax detectors are setup for counting pulses where the two coax systems
SHV /BNC are used for pulse height information.
And yes the counting setup gives positive pulses and energy physics tends to be negative going.
All of this not helped by companies like Ludlam who sell lots of detectors with single wire drive.

Just think how a few meters /yards of coax are going to slew/ stretch/ attenuate, the signal on the one wire drive/signal ---YUK

For our most demanding apps the first amp is within a few picofarads or less of the detector. And the feedback capacitor of the first amp uses the equivalent shunt capacitance of the detector to get best noise performance.
The first amp is mostly used as an impedance convertor from Gohms to a few ohms where extra picofarads have little or no effect.

all for now
johnf
 
Posts: 433
Joined: Sun Aug 08, 2010 3:51 pm
Location: Wellington New Zealand

Re: homebrew multi-channel analyzer

Postby Doug Coulter » Wed Sep 17, 2014 9:40 am

Well, John, there's no question you know your stuff - for others' benefit, John works at Ion Beam Technologies, which builds all sorts of interesting beamline types of things, implanters, nano-material investigation, and so on. John's an ace at this stuff and has produced at least one patent I know of for his company, inventing a new way to make zinc oxide nanorods and in quite a clever (and inexpensive) fashion. We've met - John's no dummy, rather the opposite. And unlike many, he's got hands-on experience with all this stuff, though more in a situation where you just buy things new than what we hobbyists encounter more often.

But 100% of every detector I've gotten - including the bicron "gallon jug" ones which are obviously designed for spectrometry and which have 2 bnc's, one for power, and one for signal - use positive voltage unless you re-wire them, and still capacitive couple the signal out as a negative pulse. In the case of the big guys, the signal isn't all mixed up with the phototube divider chain - it has its own load, usually a couple hundred k ohms, separate. All of the other, smaller ones are two wire (EG one coax), and those are what are available to the hobbyist, likely having been stripped from PET scanners, so that's what one designs for if one is designing a thing for hobbyists. Since the shield on the coax is universally connected to the metal case, you can't float that end and use it for signal without picking up all the ambient noise in the lab (and creating a possible safety issue).

Remember, in the case of phototubes, we are ALWAYS talking to the anode - that's where the high level signal comes out after the electron multiplier gain. The pulses will therefore always be negative-going. It's a good deal that a simple opamp inverter will flip them to positive polarity, and nicely linear, no step function glitch with a fast pulse like a non-inverting lashup will give with many opamp designs (national semiconductor application handbook, no longer in print, but it's also shown on a lot of data sheets)

All of the smaller heads (including a few home built) we've encountered here have a single BNC (not the high voltage flavor) for a positive input, you have to provide your own load, which in my case has usually been 10k ohm. The lower impedance seems to work OK with reasonable lengths of coax (we don't have to get as far away from things as for John's big megavolt setups). A little shaping by the coax capacity isn't always a bad thing.

The URSA II we borrowed had facility for 2 wire setups also, though it also provided another input for cases where you had your own supply, though Paul there recommended we use the inbuilt one (which fried itself while we were not using it, too much stuff in a too-tiny box? Type C connector for that, ugh, we had to search for one, but while searching, I simply built a connector myself). One of the setup parameters was cable length, for the reasons John mentions. In the case of Phillip's design, we probably need upfront shaping anyway, as it will slew-limit on fast pulses as is, and there's no handier way than using cable capacity to get it - it tends to be nicely high Q - a good quality capacitor, and the price is right - all you have to do is provide the R and you have an RC lowpass.

The "modern" (eg microprocessor based) Canberra MCA that was donated, unfortunately dead on arrival, didn't even have facility for anything but a single coax input with a positive supply built into the unit.

A lot of people use 50 ohms, in a somewhat misguided attempt to make the coax look like transmission line, then require a huge-gain preamp. I believe that's simply silly, these signals from NaI's at least, are so slow you'd need quite the length of cable to see a reflection from a mismatched impedance, they look like a pure C at any reasonable length with 1us and so forth type pulses. I admit, I have zero experience with HPGE, as I can't afford either those or the cryo ongoing expense to run one. I know BGO's are faster, but...they have worse resolution and output than the NaI's do, so I don't use them.

In PET scanners, they are looking for coincidence of 512 mev gammas, and nothing else - it's a one-bin situation (really two - the one we want, and everything else, which is discarded). So they don't have to be all that great, but in reality, most of them are pretty good used for spectroscopy. Most of the extant surplus is stripped out of these, where they have 256 to 1024 detectors, and really cannot afford to do it any other way - they're all single-coax affairs. They accept that there will be a little extra noise from including the divider chain current in the signal, and a little nonlinearity. Our experience here is that it's not bad enough to notice, given that NaI lines are broad compared to HPGE anyway. Only our "gallon jug" NaI's are even a little better than the ones shown at the link, and at that, only a little (those were ~~$10k new, we scored them cheap as surplus).

Here's a typical signal from a couple of NaI's I plan to send on to Phillip for his testing. These are 2 wire, and I used in the neighborhood of 820v with a 10k load driving the 1' provided (hardwired at the sensor end) cable and a .01 uf coupling cap to the ten meg scope probe to capture these.
DS0002.PNG
From the .5" crystal bicron Cs 137 662 kev line

DS0004.PNG
From the 1x1" by 4" deep bicron, looks like we caught a double here. (pileup)


I suspect most units do it this way to keep the photocathode at ground level. I've had issues trying to run them at the full supply voltage negative to their surroundings, as sometimes a little corona noise gets into things and so on. You have to be careful to "do it right" and get that nice, floating anode as your (still negative going) output.

I had to rewire BOTH of our gallon jugs for this mode. In that case I was lucky and there was no noise due to running the photocathode at negative 1500v or thereabouts. The divider chains, as shipped (acquired surplus of course) were twin BNC, but still positive supply, the only difference being the isolation of the anode signal from the resistive divider so you could not have any more Johnson noise on that signal. They DO work better rewired for a negative HV input and my own load, which now no longer needs capacitive coupling and the issues that come at high pulse rates when the coupling cap picks up charge due to a finite impedance load. We produced slightly better spectra with the URSA than is displayed on the wikipedia page this way - but only a little better.
We also learned that with either their power supply or ours (which was better/quieter), that NaI rarely needs more than about 1k resolution, due to other issues in the detector itself. As the Wiki article shows, HPGE can use a lot more resolution as it is intrinsically better as a spectrometer head. Too bad I live far from anywhere LN2 is shipped. But I can't afford a dewar, the rate of required buys of LN2, and I like things that just plain work all the time. You never know when inspiration will strike and you want to test something. FWIW, I have yet to encounter a postive going pulse in anything whatever, surplus or new, that didn't have a built in inverter/preamp, or was transformer coupled (so you have a choice which way you hook up the seconday). And in that latter case, I was the guy who designed and wound the transformer (small ferrites do well at this speed range, only a few turns required).
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: homebrew multi-channel analyzer

Postby johnf » Wed Sep 17, 2014 4:37 pm

heres a little circuit I did quite a few years ago
To condition CZT and or PMT input and is setup for spectral analysis and / or photon counting depending on the output used.
The CZT used negative volts at around 400 this was coupled to the czt chip through the high voltage surface mount 10Meg resistors.

C11 should equal the detector shunt Capacitance in this case around 0.5pf for CZT.
For pmt use couple into the unit through a 1-2pf cap

there is adjustable shaping and a discriminator but you have to chance the values to suit

Protel Schematic.pdf
(18.33 KiB) Downloaded 318 times
johnf
 
Posts: 433
Joined: Sun Aug 08, 2010 3:51 pm
Location: Wellington New Zealand

Re: homebrew multi-channel analyzer

Postby Philipp Windischhofer » Thu Sep 18, 2014 12:12 pm

Doug,

yes, of course - I'm trying to make it better and other people's ideas and proposals are more than welcome!

John, could you probably give a little more information about shaping? As Doug mentions, with the simple MCA design here, any external shaping can improve the quality / linearity of the binning considerably (as the plots in my previous post show). In particular, is it necessary / worth the hassle to go with bipolar pulses? Or are unipolar pulses (appropriately shaped) good as well?

Thanks!
Philipp
Philipp Windischhofer
 
Posts: 21
Joined: Wed Aug 13, 2014 2:12 pm

PreviousNext

Return to Metrology

Who is online

Users browsing this forum: No registered users and 7 guests

cron