OpenGammaProject / Open-Gamma-Detector

☢️👁️ Hardware for a hackable DIY gamma-ray spectrometer using a popular NaI(Tl) scintillator, SiPM and a Raspberry Pi Pico.
GNU General Public License v3.0
260 stars 35 forks source link

How to calibrate? #23

Closed Erhannis closed 1 year ago

Erhannis commented 1 year ago

In the readme, there's a diagram of potentiometers. This suggests the device can (should?) be tuned or calibrated, but it doesn't explain how. I don't know what kind of results to expect: I was vaguely expecting a spectrum in seconds or minutes, but the readme talks about collection times of two hours - so, I don't know what "right" looks like, to calibrate the device. And, I think I understand what "gain" and "threshold" probably are - sorta, turning up the volume, and the lower limit that counts as an event, respectively, I think? But I don't know what changing the voltage would do (and am nervous about adjusting it), nor do I know why there are two potentiometers R9 and R10 there. Perhaps these things could be clarified in the readme? (Or it could be split into separate pages, if the amount of info is getting too large for a single readme?) Thanks!

Erhannis commented 1 year ago

Originally I wasn't sure if the photomultiplier was even working or if I soldered it wrong - thankfully, opening the film canister yielded tens of thousands of events, so, pretty sure it's working, haha.

Erhannis commented 1 year ago

I found that the hackaday instructions had some of this: https://hackaday.io/project/185211/instructions I'm still not sure about some things, though. For instance, could you give some expected background CPS for a couple types of scintillator? How do we know what a "good" preamp gain is? (And does "avoid the lowest and especially highest possible gains if you can, as these might be too unstable for the OpAmp to handle" mean something might be damaged, or just give poor signal?) And in adjusting the voltage, "blinking" doesn't count the faint flickering of the LED, just the bright flashes, yeah?

NuclearPhoenixx commented 1 year ago

Hi,

In short, if you're using the ON semi MicroFC SiPM, just set the SiPM voltage to 29.5V or somewhere around this, however, not above 29.7. The two potentiometers are wired in series and will both, equally adjust the SiPM voltage. In the next revision I will likely remove one potentiometer, because with one you can still do enough fine adjustments. Once you set it, you don't need to change it ever really.

The preamp gain depends on a number of factors. Basically, turn it somewhere to the middle at first. So like 15 turns from either end. (You'll hear slight "clicks" when it's at one end). Try with this gain and from the spectrum you get, adjust it further to what you want (it will scale the whole spectrum larger or smaller, like zooming in and out).

The threshold, basically sets what minimum pulse voltages the board will trigger at. Below this, every signal will just be ignored. This must be set after the gain has been changed. Normal background will be at around 10 - 40 cps, I mostly get around 20-25 cps. Playing around with this value, you will see how the lowest energy you are detecting (i.e. the ADC channel) will shift. If you set it too high, nothing will be registered, if you set it too low, noise will overflow the system.

(And does "avoid the lowest and especially highest possible gains if you can, as these might be too unstable for the OpAmp to handle" mean something might be damaged, or just give poor signal?)

No, nothing will break. You might not get the best resolution. And especially at the lower end of the gain, due to the 20 Ohms limiting resistors, it will draw more current than usual and might clamp higher energy peaks. This is not really a problem if you're above a gain of 5-10 or so.

And in adjusting the voltage, "blinking" doesn't count the faint flickering of the LED, just the bright flashes, yeah?

Exactly, faint flickering LED is just what you want. Bright, static LED is a saturated detector and you need to set the threshold higher.

NuclearPhoenixx commented 1 year ago

Once you set everything up, try and record a background spectrum. What you're aiming for should look something like this:

landau curve

NuclearPhoenixx commented 1 year ago

I'll update the hackaday instructions to reflect some of the things I said here.

Erhannis commented 1 year ago

Great, thanks! I didn't get any clicking on the gain potentiometer, and eventually gave up turning. (I tried a similar potentiometer I had around, and did get clicking, so I don't know what's up.) I turned 15 turns in the other direction, though, and I think I ended up in a usable area? Thanks!

NuclearPhoenixx commented 1 year ago

Great, hope I could help you a little. Due to the nature of this project and the fact that you can choose to practically use any SiPM and scintillator in combination, it's really hard to pinpoint exact gain and threshold values. You have to slowly change individual parameters and see how the detector acts to get a feeling for everything.

Anyways, I'm already looking into some ways to make it easier in future hardware revisions and also, like I said, will update the hackaday instructions. Depending on how much time I have, I might as well write a comprehensive explanation on how all the different parameters change the output spectrum.

Feel free to close the issue if you're good now. You can always reopen it.

Erhannis commented 1 year ago

Question! "each turn adding a gain of about 3.3" - 3.3 what? dB? I think that's usually how gain is measured, yeah? So if I wanted to zoom in by a factor of 5, I'd need to rotate the knob clockwise...7 times?

Erhannis commented 1 year ago

Also - it seems like I'll turn the threshold until I get around 20 cpm, but then a minute later I look back and it's up around 200 cpm. Does it usually drift like that?

Edit: I think it stabilizes after the initial drift though? It's just kinda weird while I'm adusting it

Erhannis commented 1 year ago

I took a background reading for an hour, then set the SIPM on a radioactive test sample from Amazon and took a spectrum for an hour. background_202212162204.csv spectrum_202212162204.csv Any idea what to make of these? There's a huge spike at 214 - do I just have the threshold set too low? (I get the idea the threshold just cuts off the low end, right? The higher readings are unchanged?) If I zoom in vertically, I see a weird repeating pattern across much of the data, though, in both the background and the sample spectrum. Maybe EMI? It seems like the presence of the test sample simply multiplied readings across the board, somehow. I'm using the recommended SIPM in a film canister with a chunk of a plastic scintillator. (I haven't put any grease etc. between them because it was just a rough test and I figured it would probably only slightly reduce readings, and uniformly.)

It should perhaps be noted I've connected the SIPM to the main board with about a foot of breadboard wire, and alligator clips.

NuclearPhoenixx commented 1 year ago

Question! "each turn adding a gain of about 3.3" - 3.3 what? dB?

No. It's just the voltage gain, so e.g. 10 mV input with a gain of 3.3 is 33.3 mV on the output.

Also - it seems like I'll turn the threshold until I get around 20 cpm, but then a minute later I look back and it's up around 200 cpm. Does it usually drift like that?

It can drift a little bit at the beginning. That's why I make sure to turn it a tiny bit higher than needed. It shouldn't drift much after that, though. Are you sure about the 20 cpm, though? I have 20 counts per second with my NaI scintillator.

There's a huge spike at 214 - do I just have the threshold set too low? (I get the idea the threshold just cuts off the low end, right? The higher readings are unchanged?)

Yes, exactly. This looks like the threshold and the gain both are set too low. Try increasing the gain a bit and setting the threshold again.

If I zoom in vertically, I see a weird repeating pattern across much of the data, though, in both the background and the sample spectrum. Maybe EMI?

That's something coming from the ADC, I think. You can average it out by using the "simple moving average" on the bottom tool bar.

I'm using the recommended SIPM in a film canister with a chunk of a plastic scintillator.

Oh, no! Plastic scintillators are (at least in almost all cases) not usable for gamma spectroscopy, because of their low efficiency and bad energy resolution. I can only recommend you to get an NaI(Tl) scintillator.

Erhannis commented 1 year ago

Sorry, I did mean cps, yes. Ok, I'll try increasing gain and threshold, when I get back to it. Hmm - I also have a small LYSO crystal (maybe 20mm x 4mm x 4mm?), but it seems like it glows slightly by default and doesn't respond to my test source? I was getting like, 60 cps, with or without the test sample, but I tried removing the crystal just to check if it was indeed doing something, and the cps dropped to 0.

NuclearPhoenixx commented 1 year ago

Hmm - I also have a small LYSO crystal (maybe 20mm x 4mm x 4mm?), but it seems like it glows slightly by default and doesn't respond to my test source? I was getting like, 60 cps, with or without the test sample, but I tried removing the crystal just to check if it was indeed doing something, and the cps dropped to 0.

LYSO contains small traces of Lu-176 which is a natural radioactive isotope of Lu. So it will always have this characteristic background. I wouldn't worry about the 60 cps, that could definitely be right. However, I don't know why activity doesn't change anymore.

dc1rdb commented 1 year ago

Scintillator 1" dia x 1" NaJ(Tl) from Ost Photonics MICROFC-60035 SiPM on carrier board with bias components installed Voltage reference on the backside of the board installed and configured via Arduino IDE

Hello, my setup is facing a similar issue. No matter what gain / threshold / SiPM voltage setting is used, I cannot get rid of the huge spike on the very left side of the spectrum. It just moves a little left or right with the threshold setting. My detector is verified to be working fine and does not produce this kind of spike when hooked up to a RedPitaya running the multichannel analyzer. Can it be some kind of internal noise or oscillation? Enabling / disabling the SSD1306 display has no effect on the spike. Neither does the jumper setting on the backside of the board.

Thanks in advance for your help!

NuclearPhoenixx commented 1 year ago

@Erhannis How are you doing, could you make any progress?

@dc1rdb:

my setup is facing a similar issue. No matter what gain / threshold / SiPM voltage setting is used, I cannot get rid of the huge spike on the very left side of the spectrum. It just moves a little left or right with the threshold setting. My detector is verified to be working fine and does not produce this kind of spike when hooked up to a RedPitaya running the multichannel analyzer. Can it be some kind of internal noise or oscillation?

Hm, interesting. I have two detectors here and neither exhibit the same problem, so debugging is a bit more difficult. "Some" peak is okay and to be expected from the noise, but it shouldn't be that high. Does the spike change in height if you move the threshold? Does it disappear if you set the threshold to some much higher limit? Keep in mind that the peak at ADC channel 0 is deliberate and not due to noise, I'm not sure if you refer to that.

If the spike tracks your threshold, it sure looks like some noise problem. You could also try to reset the peak and hold circuitry more often by adjusting the delay time between resets in the Arduino sketch here:

https://github.com/Open-Gamma-Project/Open-Gamma-Detector/blob/46e91913f20cdb08816851c7413dd9045897558b/software/opengamma_pico/opengamma_pico.ino#L746

The default is a reset every 500 µs, try to change it to lower limits like 100 µs or even 50 µs, just for debugging. If the spike stays there, I think it's a problem with the (too low) pulse discriminator hysterisis, unfortunately.

What you could also try is soldering R4. This is just a standard 10k 0805 resistor and will increase the DC baseline of your pulses, if that's a problem with the op amps here. Have a look at the files:

pcb_front schematic.pdf

dc1rdb commented 1 year ago

Alright, here is a quick initial report:

However, gain and threshold still need to be tuned to make the spectrum look as nice as the one I recorded with the RedPitaya multichannel analyzer.

RedPitaya MCA: Background10min.csv

settings

OGD: 500us10min.csv 50us10min.csv

Thanks for your help!

NuclearPhoenixx commented 1 year ago
  • soldering R4 had no effect on the spike
  • reducing the delay in line 746 apparently did the trick, with 100us the spike is significantly reduced and with 50us it is pretty much gone.

Thanks for testing this. The tiny 220 pF capacitor used in the peak and hold circuitry is really sensitive to general EMI. Looks like the environment my devices are in, isn't as bad as yours, that's why it is not an issue here 😉 That's the only way I could explain this, to be honest. However, in the very early revisions of this project this was never a problem. So maybe it's also the PCB layout (more ground loops, ...). That cannot be changed obviously, but I'll start testing new PCBs for a new revision in the near(-ish) future and maybe I can minimize the issue there 🙂

Thanks for your help!

Glad I could help!

dc1rdb commented 1 year ago

Looks like the environment my devices are in, isn't as bad as yours, that's why it is not an issue here

Thats what I initially thought, too. But during my attempts to get rid of the spike, I took the unit outside away from any buildings whatsoever and had it powered with a battery. The spike was still unchanged on the little OLED display. Well, those things happen. As a long time ham operator, I've had my share of hard to track interference and noise effects  😉

NuclearPhoenixx commented 1 year ago

Should be much easier to get going with the new revision 3.0 boards and the updated documentation. Let me know if you still have any problems.