Needing more than a spark test?

One scheme we looked at for board rework used an interesting approach for directing heat at a specific location. It was a high-intensity projector lamp and a lens to further focus the hot spot. For situations where that wasn't quite sufficient, it included a little hot air gun but it was placed on the opposite side of the board to just provide that little bit of extra thermal "oomph". Items with low emissivity (like shiny metal shields) didn't work too well but it was OK for soldering IC's.
 
A quick 'n dirty XRF pulse simulator.
LTSpice has it's shortcomings, especially getting one's own models into it. It does have a 555 timer, as in NE555. Of course, over some decades, this handy, popular little IC has all kinds of versions, from all kinds of manufacturers. The LTSpice default NE555 does not even simulate like a real Signetics NE555. Regardless, I can still tweak out what I want. Just vary the components a bit to suit yourself.

The circuit is a temporary test pulse generator intended to deliver a reasonable representation of a photon pulse arriving. I wanted to be able to vary the height, and have the whole pulse over in about 13uS. Also, with no undershoots, or funny fumbles in returning to zero. The idea is to have a test getup to offer the pulse at the ADC capture, and it's ring buffer with software trigger.

Of course, one could also offer the output into other analog circuits that might end up making stretched versions. This circuit assumes there is a coincidence new pulse only 30uS away, simulated by making the repetition frequency about 32KHz.

Artificial Pulse for ADC.png

Note that R9 cannot be reduced much further than 330 ohms without letting the output pulse start suffering a little undershoot.
The pulse height setting is by varying R5, which can be anything up to about 10K, to keep the pulse from getting too big for the ADC. If R5 were a 10K potentiometer, with wiper taken to the (+) input of the opamp, you can alter it with a knob. Having some ohms in R8 tames the high speed glitch from the opamp as the MOSFET switches. Probably one could use just about any transistor that will turn on and off, but if a bipolar NPN is used, the bias and driving components would be different.

I have found a better 555 model, though I dislike the symbol. It lets you make your own model. I include the test example here in a ZIP file.

This stuff is just something temporary I found useful. I wanted to get the ADC measuring figured out without trying to persuade a bunch of radioactive stuff to cooperate.
 

Attachments

  • NE555Test.zip
    1.7 KB · Views: 1
Last edited:
Regarding undershoot, are you referring to the case where R5 is replaced with a 10K pot (and the wiper is near R9)? If so It sounds like either the opamp's inputs are not rail-to-rail or perhaps the output isn't, despite your comment on the schematic. Otherwise I don't understand why R9 would have something to do with undershoot.
 
A quick 'n dirty XRF pulse simulator.
Hi Mark
I was surprised too!
The op-amp is billed as "rail-ro rail", but of course, that means "nearly so". Also, it has something like 325MHz bandwidth! When the FET slams on, the op-amp tries to deliver. I was looking at about 1.8V high pulses with R5 at 10K, and there wasn't a R9 at all. I knew one couldn't simply ground the positive input. When I set R5 to anything less than about 330 ohms, the undershoot starts happening, so I added R9. One thing I don't want is negatives arriving at the ADC.

Undershoot.png

Investigating a bit, it seems it is not about starvation of the op-amp. I gave it a negative supply, and tried -0.5V and -1V, and still I get sim overshoot.
The 555 is just the crappy default in the LTSpice library, and the MOSFET is one of the first I saw in the choices. It might be some mighty motor-driver. I was not too concerned about making great sim pulses. Almost anything I can lash together to give me variable height pulse of approximately correct duration would do. There is the odd old 555 in the junk jar, and an old MAX666 regulator will do for now for the 2.5V, in place of the ADM7160 Ultra-Low Noise 200mA regulator that I hope to use in the final circuit.
[The MAX666 has probably been in that jar I found in the cellar since sometime in the 1990's]

I will knock up some sort of variable pulse gen. I do have a variable pulse generator that had quite the high specification in it's day, when Hewlett Packard was not just a maker of crappy printers, but it now needs some repair/service, and is yet another bench instrument, while a 555 is just a little temporary handy hanger-on in the test lash-up. I resisted the temptation to just use software to make the Pi provide it's own test pulse into a R-C network, or switch a FET, then into a R-C network.

Getting into the main deal
I will post my (two) circuits here soon. As I have thought it through, I have liked the design that has a PCB which mounts the photodiode, possibly at right angles to the board, and has everything on it except the computer card. This can be married to a $15 Raspberry Pi Zero, simply pushed onto a GPIO connector. For me, while the Pi Zeros, (or any Pi for that matter) are in short supply, I can manage with what I have around me. The bit-banging experiment was with a old Pi Model 3B

If done this way, then almost any other small computing board can be used with it instead. It only has to work the ADC, and supply a 3.3V

I also have much else going on right now that is important to me, involving some travel to London. That slows me up when trying to get the XRF going, but I try to move it on any chance I get. :)
 
Last edited:
That undershoot is a strange one. Perhaps the MOSFET's gate capacitance has something to do with it, but how would a low resistance on the opamp side modulate that? It will be interesting to see if an actual circuit exhibits this.
 
That undershoot is a strange one. Perhaps the MOSFET's gate capacitance has something to do with it, but how would a low resistance on the opamp side modulate that? It will be interesting to see if an actual circuit exhibits this.
I should have used the NE555 that I included in NE555Test.zip. That one models the innards of the 555 as a sub-circuit, but I was in a hurry.
Anyway, the 555 cannot reasonably be responsible. If you reduce the 470R in the gate, it drives the charge capacitance faster, and you get (very) high speed ringing, and a curious positive going lurch at the MOSFET source on 3. which actually catches up with the output of the RC filter, as it discharges.

I put the 470R in the gate to moderate the charge rate into the gate capacitance. This tames it, and it made be think that there may be a Miller capacitance effect through to the output.

I have included the simulation circuit netlist here, but you have to edit off the .txt extension to end up with ' 555_XRF_Sim__Pulse_Gen.asc '
This is another one of those that we sometimes ask @vtcnc to arrange that ASCII text files of type .asc to be allowed, but it is easy enough to rename it.

Regardless what the simulation is does, I am soldering away with some of my old-school non-PC 60/40 tin-lead, found in the same junk box as the MAX666, and the NE555. (I might as well use it up). :) We can soon look at some real waveforms, using the old 54520A, which is another bit of kit that comes from before HP became Keysight.

Better still, I want to see them plotted as if they came from some material, but that may be a little further down the road. I am only just getting into digging through the PyMCA software.
 

Attachments

  • 555_XRF_Sim__Pulse_Gen.asc.txt
    3.9 KB · Views: 1
Last edited:
I should have used the NE555 that I included in NE555Test.zip. That one models the innards of the 555 as a sub-circuit, but I was in a hurry.
Anyway, the 555 cannot reasonably be responsible. If you reduce the 470R in the gate, it drives the charge capacitance faster, and you get (very) high speed ringing, and a curious positive going lurch at the MOSFET source on 3. which actually catches up with the output of the RC filter, as it discharges.

I put the 470R in the gate to moderate the charge rate into the gate capacitance. This tames it, and it made be think that there may be a Miller capacitance effect through to the output.

I have included the simulation circuit netlist here, but you have to edit off the .txt extension to end up with ' 555_XRF_Sim__Pulse_Gen.asc '
This is another one of those that we sometimes ask @vtcnc to arrange that ASCII text files of type .asc to be allowed, but it is easy enough to rename it.

Regardless what the simulation is does, I am soldering away with some of my old-school non-PC 60/40 tin-lead, found in the same junk box as the MAX666, and the NE555. (I might as well use it up). :) We can soon look at some real waveforms, using the old 54520A, which is another bit of kit that comes from before HP became Keysight.

Better still, I want to see them plotted as if they came from some material, but that may be a little further down the road. I am only just getting into digging through the PyMCA software.
I often find it necessary to put some R in series with the gate connection on power MOSFETS to keep them from oscillating so that's no surprise.

I have loads of 60/40 (in different sizes) so it's the solder of choice for me, too.

Thanks for uploading the simulation netlist. I think I'll play around with it some, myself.
 
This may be premature, but we do have the PyMCA up and running on my Hobby Machine XRF Raspberry Pi3 Model B
Also, on the Raspberry Pi 4 Model B
I know there is still a whole ton of reading to do, and figuring out how best to interface with this.
In the most basic case, you have a capture program stash the results of a "run" into a file. Then open it with PyMCA.
There are other ways, like shared memory access.
BUT..
There are a whole lot of other ways, and formats, and built-in analysis tools, "background subtraction", and elements identification, and stuff.
The suite comes as a set of 6 programs.
1. EDF Viewer.
2. Elements Info (which happens to be open in the picture).
3. Peaks Identifier.
4. PyMCA (which happens to be open in the picture)
5. PyMCA PostBatch.
6. PyMCA POI tool

PyMCA on Raspberry Pi.png
 
Some fooling around with Graham's pulse generator has shown that the undershoot and overshoot on the input to the low-pass filter are totally due to the MOSFET. I stripped the circuit down to the MOSFET, the low-pass filter network and 430 ohm gate resistor, and substituted a fixed voltage source for the opamp variable-voltage source and a voltage source configured as a pulse generator with selectable Tr and Tf. The overshoot/undershoot start to show up when the pulse risetime goes below 10us.

Some of the other MOSFETs in the LTSpice library are even worse. I think they were selected for switching regulators -- big devices with high gate capacitance (or high charge injection via the gate, if you want to think about it that way).

On a slightly different note, I finally got my lathe put back together again, and while I was at it I shimmed the headstock to reduce the amount of taper I was getting when turning longer pieces. Things went slowly because I had to fabricate a number of fixtures to make sure the bearings went in straight -- my first try at it was a mess and I screwed up the bearings. The second time around I went with tapered roller bearings because the outer and inner races can be installed separately, reducing the chances of damaging the bearing by pressing on the wrong part of the bearing. That was an expensive lesson for me.
 
Great that you are up and running again with the lathe. Sorry about hurting the bearings. It's always emotionally hard to take when it is the new stuff that gets the hard time.

I agree entirely about the MOSFET. I think power MOSFETs are basically hundreds of them in parallel, or a big area thing. Aside from the capacitive input charge to turn them on, there is a large capacitance from the drain back to the gate (Miller). This feedback significantly resists what one is trying to do with the gate, and it's effect becomes more marked, the faster one goes at it!

The default choice in FETs is a case in point about Spice models available for Linear Tech. They happen to offer a Spice, with models that are of their products. Most are surrounded by SUB-circuit scripting tricks that basically use some other long-known element in it, augmented maybe by little inductances and stuff around it, perhaps to model the package. They seem to have the whole Infineon range in there.

There is, of course, the "other" kind of model, often also in a SUB-circuit, that is internally a mathematical fiction, using dependent current generators, gain blocks, and function expression blocks. If the whole thing models the product, then great! It runs many times faster than simulating the whole internal circuit of an IC

Persuading other models in there, including one's own, contrived from a data sheet, is a bit more awkward, and I think the best way is just to use a .INCLUDE text with your own .MODEL statements in it.

Of course, I was not into that! Having satisfied myself the little dodge was OK for a quick test setup, I was just zipping along, not trying too hard to get a great simulation, more intent on unearthing some long-lost FET to lash up this thing. Don't laugh, but I came across a small packet of 2N7002!
Can you tell I was getting distracted from a clear-out?
 
Back
Top