Thursday, August 15, 2024

Ripple/Noise Eater, some simulation results

 In my last post I simply described the approaches I explored.  This post shows some simulation results.  The first image below shows the performance of a simple capacitance-multiplier circuit.  It attenuates 60Hz ripple by about 24 dB:


Its main advantage is that it is very simple, using a single transistor to do the job.

And here is the simulation result for my opamp-based version:


This design attenuates 60 Hz ripple a bit more than 72 dB.  That's pretty good.  The design is interesting because the capacitors C2 and C3 are the primary determiners of the circuit's gain, and it is independent of the frequency -- because the ratio of their impedances over frequency remains constant.  The 20 megohm resistor is mostly there to provide bias current for the opamp's inverting input.  It does introduce some rolloff in the circuit's performance at very low frequencies but its impact on noise+ripple at or above 60Hz is negligible.

In a real-world design I would add some protection diodes.  One across the transistor's collector and emitter pins and two connected to the opamp's inverting input.  One connected to the opamp's positive supply and one to either ground or its negative supply.  I probably would choose the negative supply to balance the two diode's leakage currents, but it probably isn't too critical since the opamp is AC coupled to the transistor's base -- so a DC offset on its output wouldn't affect circuit operation.   Unless the offset is so large that the opamp output voltage is close to railing.  But a good diode's leakage current won't be high enough to do that, even with the 20 megohm feedback resistor.

Not shown here, I also looked at the circuit's response to a transient current load to check its response.  I didn't want the circuit to exhibit a lot of ringing, or, worse, burst into oscillation.  It does exhibit a bit of undershoot/overshoot but that disappears when I place a 10nF capacitor between the output and ground.




Wednesday, August 14, 2024

An effective "ripple eater" design

 This post is regarding something that the Theremino approach towards high-resolution XRF spectroscopy emphasizes.  That is the noise+ripple voltage on the PMT (photomultiplier tube) high voltage supply.  They indicate that it should be in the microvolt range because the PMT gain is very dependent on its supply voltage.  This can be a significant problem because the PMT voltage can be in the 1,000 volt range, so we're looking at something on the order of 10^-6/10^3 or a ratio of 1:10^9.  This is a very demanding requirement.  Their approach is to use a passive multiple-order RC filter chain, but this also introduces a large phase shift vs. frequency ( in addition to gain vs. frequency) that is difficult to control in terms of circuit stability.  So its response to a pulse-style load isn't all that great, either.  Thus a lower-order filter scheme looked more attractive in terms of better response to impulse-style loads (as in, the signal generated by a PMT+scintillator when presented with a single x-ray photon).

I've found a few descriptions of a 1-transistor circuit called a "ripple eater" but the circuit wasn't all that intuitive to me.  I also suspected it wasn't the best-possible approach so I tried a couple of different schemes to see what was possible.  But the nice thing was that it offered the possibility of greatly reducing the HV supply's ripple+noise while reducing the order of the filter ... which also would improve the transient response of the HV supply.  So I tried a few different approaches.  The first was a relatively simple "capacitance multiplier" circuit -- basically, an emitter follower driven by an RC low-pass filter.  The idea behind this is that the transistor's base current is low so we can use a very high-value R in the base-input RC low-pass filter.  One very significant limitation with any kind of HV low-pass filter is the fact that high-value and high-voltage capacitors can get VERY expensive, so I limited my options to a maximum of 47 nano-farads.  My SPICE simulation showed that about the best "ripple eater" attenuation I could get with this simple circuit was in the neighborhood of 30dB.  Not too bad, in fact about a reduction of 1000:1.

But we can do much better than that if we use a high-gain, low-noise operational amplifier in a special kind of summing-node application.

More on that soon.

Friday, August 9, 2024

Another XRF Update

 I've used my improved hardware setup (a Scionix PMT/Scintillator detector) to further improve other S/W and H/W components of my experimental XRF system.  I started using the detector and full-bore Theremino-style filter/amplifier setup, but the results weren't all that much better.  I began to suspect some software problems, particularly with regard to the triggering function, so totally re-wrote that portion, switching from a rolling average scheme to a majority-vote approach, where 8 pulses had to exceed the trigger voltage in order to initiate a pulse-detected signal.  That by itself resulted in a significant improvement in the quality of the XRF spectra I was getting.  At that point I was using some Thorium-doped welding rods as test sources.

The other change is that I reviewed the baseline noise coming out of my relatively simple filter + transistor amplifier design that's totally based on the Theremino design.  I had favored it over a low-noise operational amplifier design because the noise voltage coming out of the opamp design was much higher:  but that turned out to be due to the fact that it had much higher gain.  I missed that crucial difference.  Once I reduced the gain in my simulations, the opamp-based design performed substantially better than the discrete transistor design.  So I designed a new filter/amp board using an opamp.  The results were better, but not as good as I had hoped for.  Additional investigation showed that the final RC low-pass filter, which in the Theremino design is just a relatively large capacitor hanging off the emitter of the buffer transistor, was much too "strong" -- the Theremino's emitter-follower's output resistance is pretty low, so even a relatively large capacitor wouldn't exhibit the low-frequency rolloff that my "improved" design did.  So I reduced the value of the capacitor in my new circuit -- and suddenly my XRF spectra became a LOT better.  At this point I can get a pretty decent XRF spectrum for Cadmium at about 23Kev.

But 23Kev is a long ways away from the ~5.6Kev iron XRF peak.  And THAT has remained elusive, because the protective window over my sodium iodide scintillator crystal (in the Scionix detector) appears to crap out somewhere below Cadmium.  I've tried detecting lead, at about 10Kev, and see a small peak -- but that's about the end of the road.

So at this point I have concluded a few things.  First, the Scionix setup was very valuable in terms of improving my software.  If nothing else, it's worth keeping for that alone.  The second is that I need to come up with a different low-energy xray detector.  One approach could be a cooled silicon PIN photodetector.  I've found some made by Osram and Hamamatsu that are fairly large-area, about 3x3mm, with relatively low dark current and relatively low capacitance.  Not too expensive, either.  Cooling them with a 2-stage thermoelectric cooler (TEC) would reduce the dark current and improve the SNR.  So that's one approach, but has its problems when it comes to dealing with condensation.  I want to run the PIN diode well below 0C, so will need to enclose the detector with some desiccant -- or evacuate the interior -- to prevent condensation.  That's do-able, but raises the bar for other folks who want to reproduce this.  Alumina desiccant is good enough and pretty cheap so that probably is the easiest and cost-effective approach.

The other approach is totally different in terms of the detection mechanism.  It uses a gas proportional counter, sort of similar to a Geiger counter, but it's operating voltage is lower so the pulses it generates are proportional to the incident photon energy, rather than being avalanche-multiplied to the point where the tube is saturated (this the Geiger mode).  It's best suited for lower-energy xrays, which is exactly where I want to be in terms of the analysis work I want to perform (figuring out what kind of steel alloy I've got).  If you've got a lathe the detector should be relatively easy to make.  But it requires a continuously-flowing gas mixture of argon and carbon dioxide.  That' not such a big deal, it is about the same as what's used when MIG welding -- but it would be an additional cost for someone who doesn't already have a MIG welding setup.  It also requires a high voltage power supply -- but I already have that, since I needed one for my photomultiplier.  I do NOT have a MIG welding setup, so for now I'm concentrating on a silicon PIN diode.  But keeping this approach in my back pocket.