Monday, February 19, 2024

Statistics of Parts Sorting

 [Today I was listening to SolderSmoke podcast #250 and was shocked to find my name mentioned for the 10m AM conversion I have been doing, as documented here.  I'm famous now!]

During the podcast, the trio mentioned the need to pay attention to the quality of the parts one orders from various sources, some with better results than others.  This reminded me that some people haven't really thought that much either about what it means when you buy a part at a given tolerance - e.g 1%, 5%, etc.

What you get actually depends critically on how the parts sorting is done.  Let's demonstrate.  This is a plot of 10,000 resistor values, with 100 ohm target and assuming a 10% Gaussian distribution:


Now the factory selects their 1% grade parts and puts them aside in a bin.  What's the distribution now look like?


Not bad; the 1% didn't take many out so that on average, you're still looking at Gaussian approximate distribution of the parts.  So a selection taken at random here from the parts left still has about 100 ohm mean with 10% variation.

However, now let's do a second bin sorting and take out all the 5% parts.  What's left for the hapless 10% "floor sweepings" tolerance buyer?

Decidedly NOT a Gaussian distribution any longer.  It's bimodal.  In fact, as you can see, you get parts with two means: 111.63 ohms, and 88.60 ohms!  The distribution around those values also looks really Poisson to me, no longer a bell curve.

So depending on how the sorting is done at the factory, you can end up with large gaps in the values of the parts you might naively think are 10% distributed - which in this case is definitely NOT (100 +/- 10 ohms).  The good stuff disappeared.  It might also make a difference to you if you are expecting to sort parts looking for matches for e.g. building filters, etc. - you'd probably have to buy more parts (twice as many?) to get a good number within some distance of one another.  Think about the distance between those two distributions (vs. the distance within one).

Yet another reason to make sure your designs don't depend critically on absolute part values.

==================================

PS: Here's the Python code that generated the plots, for any who are interested.

#!/usr/bin/env python
#
# Demonstrate effects of parts sorting on statistics of remaining population
# 2024-02-19 PJE
#
import numpy
import scipy.stats
import numpy.random
import pylab
# 10,000 parts with 10% tolerance: 100 ohm resistor
rcenter = 100
tol = 0.1
N = 10000
rp = numpy.random.normal(loc=rcenter, scale=rcenter*tol, size=N)

# plot with overlaid bell curve
def plotdist(rp, rcenter, tol, tstr, fname, pval=None):
    pylab.figure()
    x = numpy.linspace(rcenter*(1-5*tol),rcenter*(1+5*tol),1000)
    n,bins,patch = pylab.hist(rp, bins=500,density=True,label='Parts dist')
    pylab.plot(x, scipy.stats.norm.pdf(x, rcenter, tol*rcenter),'m-',linewidth=4,label='Gaussian distribution')
    if pval:
        # mark means as vertical lines
        for k in range(len(pval)):
            rpsel = rp[pval[k]]
            rpmean = numpy.mean(rpsel)
            pylab.axvline(rpmean, color='r', label='Mean: %.2f' % (rpmean))
    pylab.legend(fontsize=10)
    pylab.grid()
    pylab.xlabel('Resistor value (ohms)')
    pylab.ylabel('Relative number of parts')
    pylab.title(tstr)
    pylab.savefig(fname, dpi=300)

# define a part sorting function.  tol = absolute fraction of parts to take out.
def binsort(x, tol):
    xm = numpy.mean(x)
    indx = numpy.where(numpy.abs((x-xm)/xm) > tol)[0]
    return x[indx]

#######

# plot unaltered bins
plotdist(rp, rcenter, tol, '%i original parts' % (N), 'original.png')

# sort the 1% parts
rpfirst = binsort(rp, tol=0.01)

# plot first sort
plotdist(rpfirst, rcenter, tol, '1% Parts Sort', 'no_1_pct.png')

# sort the 5% parts next
# yes, a bit silly since 1% parts are already gone, but it makes a point
rpsecond = binsort(rpfirst, tol=0.05)

# This is very bifurcated: separate positive and negative populations
posindx = numpy.where(rpsecond > rcenter)[0]
negindx = numpy.where(rpsecond < rcenter)[0]

# plot second sort
plotdist(rpsecond, rcenter, tol, '5% Parts Sort', 'no_5_pct.png', pval = [posindx,negindx])

Converting an 11m CB to Amateur Use: 10m Fun with General Electric (Part 4: Waterfall plots of AM modulation)

As a conclusion to the 10m AM modification blog, here's what the modulation looks like on a waterfall plot when tuned to "channel 12" / 29.025 MHz thanks to my KiwiSDR - transmission distance was about 2 meters into a dummy load across the bench using a clip lead as an antenna:


and here's the demodulated audio (Click here to play).

Notice the carrier is offset by about 400 Hz, probably due to the reference crystal being off in the LO.  400 Hz / 29025 kHz = 13.8 parts per million.  AM cares not!

Now I have to construct a simple coaxial vertical dipole for the acid test: QSO time.  I'll revisit then.


Tuesday, January 30, 2024

Converting an 11m CB to Amateur Use: 10m Fun with General Electric (Part 2: Power Out and AM Mod Depth)

Quick update: testing TX power without a RF power meter.  This is easy.  Hooked to a 50 ohm load (Termaline resistor), clipping onto the output jacks with a scope reveals the AM carrier (unmodulated):


That's channel 1.  The top of the range - channel 40 - is identical:


So Vp-p = 38.4 V.  (38.4)**2/(8*50) = 3.68 W in the RMS sense.  Since this is supposed to be a 5W radio, it's close enough to declare the finals are working.

How does the modulation look?  Here's an unsophisticated test: pump a 400 Hz tone from a cellphone audio generator app into the microphone, held up to the speaker.




Looks pretty deep modulation to me - 80%? 90%? - and no distortion/crossover.  Anyhow, the mod circuit is working fine as well.



Sunday, January 28, 2024

Converting an 11m CB to Amateur Use: 10m Fun with General Electric (Part 1)

I grew up in Schenectady, NY, home of the famous General Electric company and its scientific and technical innovations led out of their Research and Development laboratory, traceable back through Langmuir to Edison and Steinmetz and the beginning of the enterprise.  So when I saw Bill N2CQR's recent work documented on the Soldersmoke blog with converting a General Electric late 1970s vintage CB radio from 11 meter work to 10 meter AM work, I was intrigued and had flashbacks to earlier days.  

This type of project is especially interesting since as we ascend to the peak of Solar Cycle 25, electron density is way up and higher bands like 10 meters (with their accompanying lower noise floors) have now opened up for longer distance contacts.

Off I went to eBay, where I ended up with a pristine GE model 3-5804D, with 2 crystal configuration but importantly the PLL02A chip from a core Cybernet design that has been the subject of a large number of CB conversion projects over the years of this sort.  My find even has the GE front name plate - a must in this case - which apparently likes to detach itself from the radio.



Most of the modifications are CB related - like this one - but we'll be following the prescription for 10m conversion from Jerry K5JC.

The first step is to make sure the radio still works on 11m, and here we encounter our first problem: no response when feeding 12VDC at all.  Then I opened the covers and found something strange: the back DC plug clearly marks "-" and "+" polarity:



Yet inside the radio the red wire was going to "-" and black to "+".  Wiring error from the overworked GE factory technicians?  Or something else?



It soon became clear: someone had reversed input polarity in this radio's past, and had blown the reverse protection diode in shorted mode.  In a fit of desperation, the 'golden screwdriver' came out and they reversed the leads inside the radio - but to no avail, since the diode was gone.  Here it is:



A quick reinstallation of a new diode (used a 1N4007 which has plenty good rating), and reverse the power leads to their proper positions, and the radio came to life.


Using a forceps clamp stuck into the center conductor of the SO239 jack (there's an efficient antenna for you), one of those types with a kilowatt+ "special" amplifier appears on Channel 6, yelling away into their splattered and horribly overdriven set. Yes, that's the CB band - things clearly worked!


Hooking up a calibrated signal generator with AM modulation, we see that the S meter isn't really that far off; -73 dBm is nearly S9.  Good enough for government work, or GE, in this case.  Channels are where they are supposed to be tuned.


Then the final check of the transmit section.  Hooked up to a dummy load, it drew about 1.25 amps at 13.6V from the power supply, so guessing a reasonable power out.  (Power meter was not available right now but I'll check that later.).  Employing my KiwiSDR with a 6 inch piece of wire jammed into the center connector, I listened to the audio.  I did notice on the waterfall that the frequency was low by maybe 1 kHz but for AM, that doesn't matter.  Audio was reasonable quality for this handheld microphone but my ersatz antenna meant that I'm not worrying about it too much yet.  Here's a sample (click to play).

So here ends Part 1: the radio works as intended.  Next step: modification.


Tuesday, January 11, 2022

Repairing an HP E3612A Power Supply

A while ago, I obtained a nice, compact test equipment grade 30 watt linear power supply, an HP E3612A, from a local surplus reseller.  It is of early 1990s vintage and has an attractive output range: 0-60 V at up to 0.5 A, and 0-120 V at up to 0.25 A.  Both constant current and constant voltage settings are available.  (One can directly drive a regenerative one-tube receiver with that upper voltage range!) 




Being HP equipment, it of course will go beyond that range to 90 V on the 0.5 A setting, or even 135 V on the 0.25A current setting.  A former HP employee told me the key to their success was attempting to build things that could outperform the published specifications by at least 3 dB and sometimes even 10 dB, ensuring they would minimize returns that way.  It explains why vintage HP equipment has such a dedicated following and why items from the 'golden age' of HP survive decades in good working order.  The manuals for these instruments are also unbelievably detailed with real schematics and calibration procedures!  Very nice.

This instrument however was not feeling well when I obtained it.  Voltage in either high or low range would not go very high even with the adjustment knob all the way to maximum, and current limiting was not working either.  So I opened it up, and discovered of course the bane of repairing existence: a couple capacitors had failed and leaked all over the board, disabling the regulation circuits.  Cleanup time!

Fortunately, no traces had been eaten through by the corrosive stuff, although some of the traces had their solder mask partially eaten away.  Can you spot the bulging electrolytics C7 and C13?




The problems are evident here when examining C7 close up - check out those nearby traces:


Time to desolder, and while I was at it, time to also replace all the electrolytics (except the very largest ones, which seemed OK and which were also RTV'd down to the board).  Removing the old ones revealed further electrolyte ugliness:



Here's the bottom of C7 after removal.  No thanks - destined for the trash.



The bottom of C13 was no better on the board - nearly took out the rectifier CR9 next door.



With a lot of isopropyl alcohol, KimWipes, and Q Tips, I managed to scrub off the board and remove nearly all the nasty green remnants of the failed electrolytic caps.  Removing the old electrolyte was definitely necessary, as measuring resistance between two parts of the board covered in solder mask would at times give < 1 megohm resistance where one would expect nearly infinite resistance.  (Electrolyte goo is conductive!)  Not a good thing for a power supply.  Here's a typical Q Tip after one pass over the board - ugh:



Things look somewhat better after cleanup.  Traces look damaged but they tested fine.





After my Digikey order came in, I set about replacing all the caps I had carefully removed.  After a quick power check and calibration following the manual's procedure, this returned the E3612A to full service.  Success!  

Here it is putting out over the rated voltage.




Here's constant current mode, using a ceramic 0.1 ohm 5W resistor as a load.



One down, many to go...

Addendum:

For those reading this with a similar supply that is not feeling well, I found some useful Youtube examples of how to get the case open and repair.  These might be helpful.




Tuesday, September 21, 2021

Hello World

Hello! This is a place to document my tinkering with various radio ideas and gear, some of which are obsolete / superannuated (but no less fun).  I hope you find some of it interesting.

Statistics of Parts Sorting

 [Today I was listening to SolderSmoke podcast #250 and was shocked to find my name mentioned for the 10m AM conversion I have been doing, a...