Thursday, September 12, 2013

Generating low-distortion audio sine waves using a PIC and DDS techniques

Over the years I have collected a number of service monitors (see the postings about the IFR-1000 and Cushman CE-50A) but the one that I use most often is a rather strange bird, a Wavetek/Schlumberger 4031.

The problem is this:  Many amateur repeaters require subaudible tones for access, so when testing the receiver for things like SINAD, sensitivity, etc. it is necessary to generate both the subaudible tone and a standard 1 kHz tone - something impossible when you have exactly one tone generator, as is the case of my '4031.
Figure 1:
The completed 1 kHz tone generator.
Click on the image for a larger version.

Fortunately, this "extra" tone generator need not do too much:  Simply generating a low distortion, 1 kHz sine wave will suffice!  After all, most service monitors have, as their "second" tone generator, one that generates only a 1 kHz tone as well!

The hardware:

I decided to throw a PIC at the problem, specifically the PIC12F683, an 8-pin processor that has quite a few useful features, most notably a hardware PWM generator and an A/D converter. I wanted this device to be quite small and battery-powered as it would be kept with the service monitor at all times.  Throwing a piece of paper on the workbench, I sketched out a circuit that quickly evolved into that depicted below in Figure 2.

The main power switch is Q1, a PNP transistor in series with the Batt+ lead and when SW, a momentary pushbutton switch, is pressed, Q1's base is pulled low through R2 causing it to conduct and provide power to the rest of the circuits.  Once the software in the PIC (U1) has determined that the button has been held down for a long enough time (>1 second) pin 7 is set high which activates Q2 which, in turn keeps Q1 turned on.  Diodes D1 and D2 provide isolation for the pushbutton so that the PIC can detect if the user is pressing the button independently of what Q2 is doing.

The PWM signal is output from pin 5 using the PIC's hardware, the DC is blocked with C8 and then low-pass filtered in two stages, first by R9/C9 and again by R10/C10 to both (mostly) remove the PWM's 20 kHz energy and also to somewhat attenuate higher-level harmonics of the 1 kHz tone itself.  R11 is used to establish an operating point for U2 and is derived from a mid-supply voltage source produced by R5 and R6 and filtered by C2 and ultimately used to bias both halves of U2 to a mid-supply voltage via R11.

Figure 2:
Schematic of tone generator unit.  The only critical components are C10-C12 which should be
temperature-stable (plastic) units rather than ceramic.
NOTE:  There is an error in the schematic:  The anode of D1 should have been shown connecting
to the collector of Q2!  (I'll get around to fixing it some day...)
Click on the image for a larger version.
U2, a TS462, is a "rail-to-rail" op amp, this type being chosen to maximize the output signal level available from the limited supply voltage, particularly when the 9 volt battery is nearing the end of its useful life (approx. 7 volts for this application) and it is capable of driving 600 ohm resistive loads.  U2a is used as a unity-gain follower to buffer the rather high impedance output from the initial R/C PWM filtering (R9-11, C8-C10) and it feeds U2b which is configured as a 2 pole 1 kHz bandpass filter to further clean up the 1 kHz sine wave being generated.  Since U2b has some gain, the values of C10 and R11 were chosen to attenuate the input to U2a enough so that even at a relatively low battery voltage (7.0 volts) it avoids clipping when hitting the power supply rails, providing about 4.5 volts RMS.  C13 is used as a DC block on the output and R15 assures that the op amp's output will always see a resistive load to assure stability.

Preserving the battery:

One problem with portable, battery-powered devices that are used  infrequently is that they often get left on - either because they weren't shut off in the first place, or the power switch got bumped.  To prevent this, a momentary pushbutton switch was used so that a brief "bump" is less likely to leave it in the "on" state.  In addition to this, the pushbutton itself is physically recessed, making it less likely that something being carried along with the unit (e.g. connectors, tools, etc.) will push and hold the button in the "on" position and run the battery down.

Figure 3:
Inside the 1 kHz tone generator.  If you look carefully, you can
see the the blue "power" LED is illuminated.
Click on the image for a larger version.
To eliminate the other likely cause of a dead battery - forgetting to turn it off - the unit is designed to detect if its audio output actually connected to something.  To do this, R8 pulls pin 6, configured as an A/D input, up to the +5 volt rail and it, in turn, is connected via R16 to the audio output.  If the audio output is connected to a device with a resistive load on its input of less than 100k or so (such as the external audio input of the service monitor) the PIC will see the DC voltage on pin 6 as being below a software-predefined threshold (3/4 of the supply voltage) and it will remain powered up.  If the output is disconnected from a load, this voltage will rise above the threshold and if this condition persists for more than 3 seconds the PIC will set pin 7 low, turn off Q2, "un-bias" Q1 and disconnect the battery.

A software timer has also been implemented that will automatically turn off the unit after 30 minutes with an alert tone sounding 20 seconds before power-off so that the timer can be reset by pressing this button momentarily:  This feature was added just in case the unit was left connected to the service monitor and I happen to forget about it!

LED1 (a blue LED) is used used to show when the unit is powered up and since a high-brightness, focused-lens blue LED was used, only a milliamp or two (as set by R4) is needed to provide adequate power for it to be visible - even in bright light.  Finally, D3 and self-resetting 300mA thermal fuse F1 provide protection against accidental reverse voltage when one is fumbling about trying to connect the battery.

In total, the unit consumes about 12 milliamps (approximately 4 milliamps of this is U2) when operating and an undetectable amount of current (well under 100 nanoamps) when it is turned off.  What this means is that when powered down, the battery life will essentially be that of its shelf life - and if you happen to use a lithium 9 volt battery, that could well exceed 10 years!

The mechanical construction:

When I make a "one-off" project I almost never lay out and make a circuit board:  In the time it would take me to do this, I would have already completed the project in the manner shown, having wired it on a piece of prototype board that was selected to be just big enough to accommodate all of the circuitry.

As with all other projects that I build using through-hole techniques on prototype board, this material has an array of holes on 0.1" centers with small, etched copper rings around each hole on the bottom side to make both electrically and mechanically secure connections.  For interconnections I used #30 AWG "Kynar" wire-wrap wire, the advantage of this material is that soldering will "heat strip" the connections:  I've built hundreds of projects over the years using this technique and it has proven to be very reliable once one masters the technique!

In rummaging around my collection of project boxes I didn't find anything that was quite the right size so I determined the minimum footprint required to accommodate the board, the switch and a 9 volt battery and cut some pieces of double-sized glass-epoxy circuit board using a very heavy-duty paper cutter.  Soldering five pieces together (the bottom and four sides) I soon had a very sturdy box that was also well shielded from RF - an important consideration when using equipment at a site with many high-power transmitters!  In retrospect I could have made the box a bit "thinner", but this worked out nicely.

The board itself is mounted using two hexagonal metal standoffs from Radio Shack, each one having been sawed in half and then filed down so that the cut was flat and each was of equal height.  Since these standoffs are nickel-plated brass, they solder quite easily to the circuit board and make an extremely rugged support.

The sixth piece of copper-clad is the lid of the box, sized exactly the same as the bottom piece.  To attach it, two more hexagonal standoffs were cut in half and the four pieces were soldered into the corners as shown in Figure 3.  In the lid, matching holes were drilled to allow the screws included with the standoffs to be used to secure it into place.  Not shown is a small piece of foam that was attached to the bottom side of the lid with RTV ("Silicone") adhesive that keeps the 9 volt battery from rattling around when the cover is attached.

The momentary pushbutton switch was centered over a countersunk hole that I drilled in the side of the box as shown in Figure 1 and was initially tacked into place using a very small amount of cyanoacrylate adhesive ("Super" glue) and I was very careful to avoid getting any of it into the button's works!  Once this adhesive had set I soldered the pins of the switch that would connect to ground directly to the case for more mechanical support and then I used some epoxy around the switch for further reinforcement.  Next to the switch can be seen the blue power indicator LED (in the clear lens) which was epoxied into place at the same time as the switch.

The output cable is a piece of RG-174 coax that I found in my junk box with an already-attached male BNC connector.  At the BNC connector end of the cable I added two overlapping pieces of heat-shrink tubing to mechanically strengthen the crimp connection and, as can be seen in Figure 3, I also added a piece of heat shrink tubing at the point where the RG-174 entered the box through the drilled hole of the box to relieve strain there, too.  At this same point, a small wire tie was attached to the cable on the inside of the box to keep it from being pulled out while a piece of heavy wire was attached to the shield and connected to the case and the center conductor attached to the audio output.

The software:

A DDS (Direct Digital Synthesis) algorithm was chosen to generate the sine waves and with this technique one indexes a table containing a sine wave at a known rate and step size to generate an arbitrary frequency.

An article on the operation of a DDS may be found here:   

http://en.wikipedia.org/wiki/Direct_digital_synthesizer.


I programmed the PIC's interrupt and the PWM rates to precisely 20.000 kHz - fairly easy to do with the 20 MHz crystal that I used - and wrote a DDS algorithm using 32 bit integer counters.  In doing the math, the use of a 32 bit "Frequency Control Word" yielded the following:

20 kHz sample rate / 2^32 = 0.0000046566 Hz frequency steps.

Clearly, this amount of resolution was far in excess of the stability and accuracy of the standard CPU-grade crystal that I used as the master timing reference as each "step" would have represented approximately 0.18 Hz at the 20 MHz clock frequency.  If I'd chosen to use 16 bit counters, instead, my frequency step size would have been 1/65536th of this, or 0.305 Hz and I'd have gotten 1000.061 Hz (about 1.2 kHz error at the 20 MHz crystal frequency) which would have been more than good enough, but since my little PIC didn't need to be doing anything else I figured that there was no harm at all in making it crunch 32 bit numbers!

For a Digital-to-Analog converter I used the PIC's built-in PWM generator which is capable of  approximately 10 bits of resolution when used with the hardware timing parameters that I'd chosen to achieve a 20.000 kHz sample rate, but I knew that, in theory, only 8 bits of resolution would be required to achieve an adequately clean sine wave - especially if I followed the output with some sort of audio filter.  What I ended up doing was to use the PWM in 10 bit mode and left-justify the 8 bit sine data and discarding the lowest two bits.

For more info on PWM techniques, read this article:   

http://en.wikipedia.org/wiki/Pulse-width_modulation.


PWM has the advantage of being very easy to produce in hardware as it is simply a matter of timing the width of the output pulses and in so-doing, the output voltage (after smoothing) is proportional to the duty cycle of those pulses.  The use of PWM does throw in a bit of a complication when it comes to generating complex analog signals using simple hardware:
  • With simple R/C filtering the output voltage's rate-of-change may not exactly be what is expected for all frequencies at all amplitudes and slopes.
  • Simple PWM hardware/software has the problem that only one edge of the stored samples are being used rather than an averaged, "middle" value between two subsequent steps.
The upshot of these factors - particularly the second one - is that any sine wave generated using this method is likely to have some harmonic distortion, this being caused by the fact that the samples generating it are slightly offset in time from the actual "center" of the sample and the net result is that there ends up being a residual amount of phase modulation which, in turn, causes a slight amount of harmonic distortion.  The amplitude of these harmonics depends on several factors such as the PWM frequency, the sample rate (the two don't need to be the same, but it's a good idea that they be at least harmonically related to avoid other artifacts), the PWM resolution (and that of the sine table's entries), the actual size of the sine table, and the type of hardware used to filter the PWM output.

In my particular case I measured 0.7% total harmonic distortion + noise on the output of the tone generator - this, on the output of U2b, the 1 kHz bandpass filter.  While perfectly adequate for SINAD measurements out to 30dB or so, I decided that I could do better!

Note:  The bandpass filter reduced the 2nd harmonic's amplitude by approximately 25dB, so the distortion was actually worse than this at the output of U2a, "before" the 1 kHz bandpass filter.

Adding Predistortion:

In theory one could calculate these effects "on the fly" within the DDS algorithm and cancel them out but with the rather limited computational horsepower of the PIC there is only so much one can do - not to mention the amount of time I wanted to spend on this project!  As I was interested in  generating only 1 kHz for this particular project I could simply "pre-distort" the sine table itself, optimizing it for this one frequency.

Many years ago (when GWBASIC was still commonly used) I wrote a simple BASIC program that generated sine wave tables of arbitrary size and span and wrote them to a text file that could be imported into source code so I started with that, adding some extra terms to produce additional harmonics in the manner of the formula below:

   Amplitude = sin(w) + (a * sin(w * 2)) + (b * sin(w * 3))

Where:
  • Amplitude is the value of the sine output plus the distortion.  This gets scaled and offset according to the requirements of the sine table.  (e.g. for a table consisting of unsigned 8 bit values it might range from 0 through 255.)
  • w is the input value (in radians) scaled to the size of the table.  (e.g.  a full sine table with 256 entries would scale 0-2π radians to an index range of 0-255.)
  • a is the scaling factor for the 2nd harmonic's amplitude.
  • b is the scaling factor for the 3rd harmonic's amplitude.

One could add additional harmonics, but having only the 2nd and 3rd is enough for our purposes.

In this project I used an 8 bit, 256 entry sine table and using "a" and "b" I could introduce into this table some 2nd and 3rd harmonic distortion and depending on correction needed, "a" and "b" could be either positive or negative.

When adding these extra terms for the 2nd and 3rd harmonics with "a" and "b" I did have to slightly rescale the "span" of the output from 255 to 251 or 252 to keep the resulting values within the range of 0-255 since the harmonics did add a bit of extra amplitude to the overall sine output:  Ultimately I scaled the output to achieve a range of 1 to 254 since the use of 20.0 kHz PWM rate (a divisor of 250) rather than a 19.52 kHz rate (a divisor of 256) implied that my PWM hardware's resolution was actually just a hair under 10 bits.  (I actually tried it both ways and it didn't matter!)

Figure 4:
The "waterfall" display from the Spectrum Lab program showing the 1 kHz fundamental and up through the 9th harmonic after tweaking the sine table.  Not shown is the output of the script that displays the percentage distortion of the harmonics through the 6th and the totals.
Click on the image for a larger version.


Determining scaling factors "a" and "b":

For determining the "cleanliness" of the sine wave I used my desktop computer with an Asus 24 bit sound card running the "Spectrum Lab" software to analyze the harmonics on the output of U2b.  Spectrum Lab has a built in, interpreted scripting language (see "Conditional Actions" in the Spectrum Lab documentation) and with it I wrote a simple program to determine the precise frequency and amplitude of the peak output (nominally 1 kHz) and measure the amplitude of each of the harmonics through the 6th, individually determine their power contribution (and thus,  percentage content) and display those values and their sum to yield an approximate THD (Total Harmonic Distortion) value.  (The measurement taken with Spectrum Lab did not include noise at frequencies other than the fundamental and the harmonics through the 6th so it was not a "THD+Noise" reading.)


Another instrument that I had handy, also connected to U2b's output, was an old HP-332A distortion analyzer.  This device, made in the mid/late 1960's, is still useful today and can measure the distortion+noise of a signal as low as 5 Hz and as high as 600 kHz.  A bit finicky to operate (it takes a gentle touch and some practice) it will reliably measure distortion+noise down to 0.02% or lower.

I determined, through rough calculation of measured harmonics with a "pure" sine table (e.g. no added harmonics) and then through later iterative means that a reasonable value for "a" was +0.085 and "b" was +0.001 - but your mileage may vary!

In using both Spectrum Lab on the computer and with the HP-332A I measured well under 0.035% distortion at the output of U2b, the 1 kHz bandpass filter, with each method:  With a bit of additional tweaking I may have been able to reduce the distortion even more, but I was approaching the point of diminishing returns and I was starting to approach the limit of the HP-332A, anyway!

Figure 5:
The 1 kHz tone generator connected to the input of the
service monitor and operating.
0.6% distortion is about as low as this service monitor will measure
 - at least until I get around to tweaking it's notch filter....
Click on the image for a larger version.
Comment:

At the output of U2a, prior to the 1 kHz bandpass filter, Spectrum Lab showed that the harmonic distortion at the end of tweaking was on the order of 0.4%, but the bandpass filter reduces the 2nd harmonic by about 25dB and the higher-order harmonics (and noise) by even more.

The results:

The upshot of this is that with this tone generator, the ability to measure the SINAD exceeds that of the service monitor (it reads in excess of 50dB when the generator is connected to the input) and it is, in fact, "cleaner" than the instrument's own built-in tone generator which is on the order of 0.1% THD+noise.

[End]

This page stolen from ka7oei.blogspot.com

Wednesday, September 4, 2013

Quieting high-current switching power supplies used in the ham shack.

Over the years I have acquired several switching supplies that I use in the shack and in portable operation such as field day.  These power supplies (two Samlex model 1223's and a Radio Shack #22-510) were designed to be "RF Quiet" compared to more typical switching supplies that might be used for computer or industrial applications.


It's all in the filtering...

What separates a typical, industrial power supply (and most computer-type supplies) from one that is intended to be "quiet" (RF-wise) is largely filtering, as what is contained within the box comprising the switching supply is essentially a high-power transmitter!  It's pretty easy for low-level harmonics of, say, a 300 watt switching power supply (oscillator!) to leak out, and since even a few billionths of a watt at the input of a receiver make a signal that is annoyingly strong, one can appreciate the need for proper containment!

Fortunately, most switching power supplies used in this application operate in the 30-60 kHz range which means that, by virtue of the large frequency difference, the harmonics - those buzzy, raspy things that often appear every 30-60 kHz across the HF bands - are already weakened considerably, but one needs to do more to submerge them below the noise floor!

It should be no surprise that it's largely the AC input and DC output leads that conduct this energy out of the box so some fairly good filters are required.

AC Line filtering:

Take as an example the circuit depicted in Figure 1, below:

Figure 1:  2-stage "brute-force" line filter using bifilar inductors.  The AC power comes in on the left and is delivered to the "guts" of the switching supply ("load") on the right.

This is a typical filter found on the AC power line of better-quality power supplies that are designed to be "RF quiet" and what does the most work are the two bifilar inductors.  How this works is that at capacitor Cd, where there are strong RF components of the switching energy, the two sides of the AC power line are "shorted" at RF frequencies (e.g. made to be "common-mode") so that when equal amounts of RF pass through bifilar inductor, they get canceled out and "choked" by the inductance.  The first of these inductors (the one on the right) isn't able to do all of the work, so another stage of filtering consisting of capacitor Cc and another bifilar inductor is applied.

For an article describing what is meant by a "common-mode" signal, read here:  http://en.wikipedia.org/wiki/Common-mode_signal

Finally, at the power line we have capacitors Ca and Cb and these not only help reinforce the "common mode-ness" and the effects of the bifilar inductor, but shunt the remaining small amount of RF from the switcher to the metal box containing the switching power supply so that it does not escape on the power line.  Typically the values of Cc and Cd are in the range of 0.01uF to 1 uF and the higher the capacitance, the better - but at the cost of the component itself (larger capacitors are more expensive) and the fact that as you increase the capacitance, it will draw more and more current from the AC power line on its own due to capacitive reactance.  (This leakage current will not generate heat since it is very reactive - but that's another discussion altogether!)

The values of Ca and Cb can vary, but it's common to find anything from 0.001uF to 0.47uF, but some safety laws limit the values owing to the fact that at this midpoint (ground) there will be approximately 1/2 the AC mains voltage (with respect to either side of the AC mains) should the ground be disconnected:  The value of these capacitors and their reactance will dictate how much of a shock hazard this might present should accidental contact occur.  These capacitors must also be appropriately safety-rated since failure could put the full mains voltage on the safety ground and pose a lethal shock or fire hazard.  Typically, these capacitors are blue and have imprinted on them their specific AC rated voltages as well as symbols indicating the various safety and regulatory bodies by which their use is approved.

The inductors are the most expensive components in this filter since they use fairly heavy copper wire for to handle the multi-hundred watt load as well as fairly pricey ferrite material.  They are fairly large and heavy so it is not too surprising to find an off-brand or counterfeit power supply where all of these filtering components (inductors and capacitors alike!) are omitted to cut costs:  Such power supplies radiate lots of noise and do not meet regulatory (or even safety) requirements in most countries!


DC output filtering:

The other place where RFI might escape is the DC output.  Take the example of Figure 2, below:
Figure 2:  Simplified diagram of the DC output of a switching power supply.
Here, we have the switcher's output circuit:  A high-power oscillator running in the 30-60 kHz range feeding a transformer that converts the voltage from the 150-300 volts of rectified and filtered AC line input, down to the 13.8 volts while also isolating the power mains from the DC output.  This is typically a center-tapped transformer with a full-wave rectifier followed by bank (usually 2 or more) of good-quality (hopefully!) filter capacitors represented by "Ca."  Even with the best capacitors there is still residual switching energy, so inductor "L" is typically used to filter it further followed Cb which consists of another capacitor or two in parallel to knock it down even more.

If the circuit board has been laid out properly properly and good-quality components have been used, the "V+ Out" line will be pretty clean - but notice something else:  The "ground" to which the transformer center-tap, Ca and Cb are connected is different from that of the chassis (case) ground in that that they aren't even connected directly to each other!

There are several reasons for this.  First of all, it is often desired that the case ground - which is usually connected to the AC mains safety ground, as well, be isolated (DC-wise) from the DC output of the power supply, this being done to prevent "ground loops" - that is, power finding its way along more than one lead and back to the same place.  In extreme cases this can cause hum or, in the case of faulty mains wiring, put a shock hazard on the metal case of the gear being powered.  The use of a capacitor such as Cc "connects" the two at RF, but not at DC or at mains frequencies.

In the cases depicted below, plastic capacitors rated for at least 250 volts are used which is adequate for 120 volt mains.  This seemed to provide adequate bypassing - even at fairly low radio frequencies - and the value used still presents reasonably high reactance at AC mains frequencies (>800 ohms at 60 Hz, >960 ohms at 50 Hz for 3.3uF) to afford a reasonable degree of safety, minimize circulating currents (hum) at those frequencies while eliminating the possibility of any DC ground loops.

Common problems with "noisy" power supplies:

First, some warnings:
  • Do not perform any modification described here unless you are familiar with the techniques involved in high voltage and high current circuits.  Accidental contact with mains voltages can be lethal!
  • You must make absolutely certain that all components that you use are rated for the voltage/current involved.  In particular, any capacitors that bypass from the AC (mains) input to the chassis must have the appropriate voltage and safety ratings to prevent the accidental imposition of potentially lethal mains voltages on the chassis/ground of the power supply and connected equipment!
  • In this article, some of the filtering components are depicted as being added prior to line fusing.  In all cases, such components must be appropriately safety-rated for the voltage and current.  In some areas (such as the EU) it may be permitted that such components are connected only after line fusing - and that line fusing is required on both leads of the AC power connection.  In any case, take sensible safety precautions!
  • Be certain that any inductors used are rated for the current involved and that their insulation is capable of withstanding the voltage applied.  For the bifilar chokes on the AC input, these must be rated for at least 4-5 amps while the output choke ("L" in Figure 2) should be heavy enough to handle 23-25 amps with minimal voltage drop.
  • Some of the techniques described in this article may not meet safety regulations in certain countries.  Examples might include:  The placement of RFI/EMI components before the fuse, the types of capacitors, the values of capacitors and the amount of leakage current that they would consume and/or place on the chassis ground, etc.  Please be aware of these issues and address them in a manner appropriate.  I thought that I'd mention that twice...
  • There are likely other things not mentioned here.  You have been warned!

For this discussion we are assuming several things about our power supply:
  • It is contained in metal case.  The case doesn't provide "shielding" as much as it provides a common, low-impedance point to which all filtering that helps remove switching energy can be connected.  Doing this prevents the formation of differential currents between the AC input and DC output leads which could impose low-level switching supply energy onto those leads!
  • It includes at least some of the above features to filter out switching components.

Case study #1:  An older style model Samlex 1223

For the first example I will take an older Samlex model 1223 power supply, a 23 amp, 13.8 volt unit that I bought in the late 1990's.  It was intended for use in, among other places, amateur radio stations and is an inexpensive, yet fairly well-designed power supply.  Despite this, I noticed that it produced some low-level - yet annoying - spurious emissions on the lower HF amateur bands (160-40 meters) which were also weakly audible at even higher frequencies.

In disassembling the unit I noticed immediately that it had just one AC input line filter.  Fortunately, there was enough room to wedge into it another bifilar choke (scavenged from a junked power supply) and the necessary bypass capacitors.

Figure 3:
Added bifilar choke on the AC input side of the old style Samlex 1223 power supply having been attached to the rear wall using RTV ("Silicone") adhesive.  In the foreground (lower-right) a pair of capacitors were added to the power line on the power cord receptacle, represented by "Ca" and "Cb" in Figure 1, above.  Because this power supply can
draw 300-400 watts, be certain that the added choke is rated for the expected current.
Click on the image for a larger version.
In Figure 3 you can see this modification with the added bifilar choke attached, using RTV, to the back wall of the power supply with the added capacitors (see "Ca" and "Cb" in Figure 1, above) soldered directly onto the IEC power cord receptacle.

I also put an oscilloscope across the DC output terminals and noticed that even though the DC output itself was quite clean - just a few millivolts of residual switcher energy - I saw few hundred millivolts of switcher energy when I measured between the chassis of the power supply and either of the DC outputs:  See Figure 4, below.

Figure 4:
The waveform present between either DC output and the chassis of the unmodified power supply.  The frequency/time noted in the box in the lower left is measured between the two purple vertical lines.
Click on the image for a larger version.

As can be seen, the magnitude of the "square" portions of the waveform are on the order of 130 millivolts with the extents of the high-frequency spikes going out to at least 268 millivolts:  It is this energy that is going to cause us the most grief!  This waveform looked the same whether I measured between the V- terminal and ground or the V+ terminal and ground, but this was not surprising since I already knew that from measuring across V- and V+, the waveform was quite clean.

At this point I had a choice:  Should I simply short the V- to the chassis ground and risk a ground loop, or install a capacitor?  Preferring to NOT subject myself to the possibility of a ground loop and the possibility of induced AC hum in the future, I rummaged around in my capacitor collection and found a large, 3.3uF plastic capacitor with a 200+ volt rating - probably something scrapped from an old switching supply or computer monitor.  When I connected this between the V- lead and the chassis of the power supply, I got the waveform in Figure 5, below:

Figure 5:
The output of the power supply after adding the capacitors to the output with the same vertical/horizontal scale as the plot in Figure 4.  Notice that only a fraction of the original "grunge" remains!
Click on the image for a larger version.

As you can see, there is a significant improvement!  The narrow spikes are much lower in amplitude (about 66 millivolts peak-peak rather than 268 millivolts) and, although it is a bit difficult to see in the above trace, the pulses are also much slower in their rise/fall time.  This last point (pun intended!) is important since it is the rate of change (dV/dT) of these pulses that dictate how much harmonic content they have, so between their reduction in amplitude and their being "slowed" considerably, this power supply was now VERY much "quieter."

Figure 6, above, shows the modifications made to the power supply and here are the steps:
  • I found a small piece of glass-epoxy circuit board material and cut it to fit the empty space above the DC output terminals.
  • Flipping the power supply upside-down, I drilled a hole for a 6-32 machine screw through the case and piece of circuit board material.  Flipping the case upside-down ensured that metal cuttings would not fall into the power supply.
  • After de-burring the holes with a drill bit (also done with the power supply upside-down) I bolted the piece of circuit board material to the case using some "star" washers to ensure a solid, electrical connection.
  • Between the piece of circuit board - which is now connected to the metal chassis ground of the power supply's box - I soldered a 3.3uF plastic capacitor between it and the V- lead.  Any value of 0.47uF and up would be fine, but 2.2uF-4.7uF is better.
  • I also soldered a 2200uF, 25 volt low-ESR (switching supply-type) electrolytic capacitor between the V- and V+ terminals using short pieces of heavy (#12 AWG or larger) wire.  This wasn't really necessary, but it did knock down those small "spikes" in Figure 5 a bit more.
Figure 6:
The modifications of the DC output of the (older) Samlex 1223 switching power supply showing the added
capacitors.  The orange unit on the left is the plastic capacitor that suppresses the voltage differential between
the case and power supply output that contained the switching energy seen in Figure 4, above.
Click on the image for a larger version.

Putting the cover back on and testing it - even using it a few times during Field Day over the years - I have not observed that this power supply has caused any detectable interference, even when being placed next to a balanced-wire antenna tuner.

A Radio Shack model 22-510 power supply:

A couple years after getting the Samlex 1223 I noticed that the Radio Shack 22-510 power supply was on sale and grabbed one.  Rated for 25 amps, it is almost identical in size and shape to the Samlex 1223 and it had a permanently-attached power cord rather than a detachable computer-type cord.  Popping the cover I could tell that it was better filtered than the old Samlex in that it already had a 2-stage AC input line filter that strongly resembled that depicted in figure 1.  As with the Samlex, I noted that across its DC terminals the output was fairly clean, but like the Samlex, I observed a waveform that was nearly identical to that in Figure 4 between the chassis and ground!

Figure 7:
The modification to the output of the Radio Shack 22-510 power supply.  The orange capacitor is a 3.3uF unit connected between V- and the case while you can see a 1000 uF, 25 volt capacitor connected directly across the DC output terminals.
The added, series inductor - from the high-current output of a junked PC power supply - is contained within the
insulating piece of yellow heat-shrinkable tubing seen in the upper-right corner of this picture, above the head sink.
Click on the image for a larger version.
Figure 7 shows the modification to clean this up, but in this case I used a screw with a ring lug to make the connection to ground and in the picture you can see the 3.3uF capacitor connected between it and the V- output terminal.

Since I had noticed a small amount of switching noise (not bad, but not as clean as that in Figure 5) I rummaged around and found a small choke on the 5 volt, high current output of a junked PC power supply that had been wound with #12 AWG wire and would thus be capable of handling 25 amps without much voltage drop.  Clipping the red (V+) lead, I soldered this inline and it is shown in Figure 7, insulated with yellow heat-shrink tubing.  Across the V- and V+ outputs I attached a 1000 uF, 25 volt capacitor and the combination of these two components made its output at least as clean as that shown in Figure 7.  I probably would have been fine not doing this, but since I was already working on the power supply, anyway...

After I did all of the above I noticed that there was still some low-level noise on the power supply that was not at the switching frequency, but rather in the range of a few hundred Hz:  It wasn't strong enough to be a problem, but it annoyed me that it was there at all and I was curious as to its source.  What I soon realized was that this extra noise was coming from the small cooling fan on the chassis:  Unlike the fan on the Samlex power supplies which are thermostatically-controlled with an electronic heat sensing circuit, the fan on this power supply always runs and is connected across the DC output.

One insidious problem with these brushless DC fans is that they seem to have the uncanny ability to put some of their electronic commutating noise onto their power supply leads despite the fact that they draw only a hundred milliamps or so and are, in this case, connected to a high-current power supply with lots of filtering!  The fix for this is quite simple, however:  A series 10 ohm resistor and a 220uF, 16 volt capacitor.

Figure 8:
The added filtering for the fan supply to keep its "whine" out of the DC output consisting of a 10 ohm resistor in series with the positive lead and a 220uF capacitor on the "fan" side between the fan's V+ and its ground.
Click on the image for a larger verion.

Figure 8, above, shows this modification with the capacitor connected across the "fan" side of the resistor on the fan's power supply leads.  Because it was convenient to do so I used RTV ("Silicone") adhesive to attach these added components to the back wall of the power supply, but I could have also enclosed them in heat-shrink tubing.  With this modification the fan electrical noise was completely removed from the power supply's output and the fan ran slightly slower due to the voltage drop across the 10 ohm resistor and would likely last a bit longer - but it still moved more than enough to keep it cool under full load.

When I was done this power supply, too, was now very "clean".

A newer Samlex 1223 power supply:

Earlier this year I spotted a brand new, in-the-box Samlex 1223 for a really good price at a swap meet and couldn't resist getting it.  When I opened it up I could see that since my older '1223 had been built, they'd made some improvements:
  • Like the Radio Shack unit, it now had a 2-stage input line filter.
  • They'd changed the output connector from binding posts to screw-type compression terminals.
  • Both the V- and V+ output leads were routed through one large ferrite bead.
At this point I'll mention, again, the ferrite bead:  While it is a common technique to run power supply leads through such a device, simply passing wires through one of these will not likely add enough reactance to provide a significant degree of RFI suppression at lower HF frequencies!  What's more, the effect of this added reactance is not well-utilized unless you add some capacitors to the output as well as shunt the residual RFI to the chassis.

To be sure, I had not tested the unmodified power supply against the others that I'd modified to see how "clean" they were in terms of causing interference to HF operations but reports indicate that these newer Samlex 1223's are better than the older version in that regard but were still known to cause objectionable interference in some cases.

Interestingly, when I placed the oscilloscope between the V- and the chassis of the power supply I got almost exactly the same waveform as I'd gotten with the older Samlex 1223 and the Radio Shack 22-510 power supply depicted in Figure 4 so I knew what I had to do.

Figure 9:
Modifications to the new version of the Samlex 1223 power supply.  On the left can be seen the orange 3.3uF capacitor along with a heavy (#12 AWG) wire running from the V- lead to the added 1000uF, 25 volt capacitor.
Click on the image for a larger version.
As can be seen in Figure 9 I did exactly the same modification as was done on the Radio Shack power supply in Figure 7 - the only difference was that didn't need to add the extra choke in the V+ lead and I also had to route a piece of insulated heavy copper wire from the V- terminal across the top of the terminals to the added 1000uF, 25 volt capacitor since there wasn't enough room to locate it elsewhere.  In this case it was important to use a heavy-gauge (#12 AWG or heavier) wire for this connection since not only was the capacitor's lead not long enough to reach in the first place, but its small gauge lead (perhaps #22 or #24) offered enough resistance/reactance that the capacitor's suppression of some of the residual switching energy was degraded:  This just goes to show how, when dealing with high frequency switching supplies and high currents, how even a little bit of extra wire can cause a difference in performance!

Conclusions:

I've made these modifications to these power supplies over the years as I've acquired them and was somewhat surprised to see that they all have the same issue in common:  Significant switching energy between their cases and their DC output lines.  Fortunately, the "fixes" outlined above seem to be very effective and add minimal safety risk to their use and these three switching supplies that no longer cause any noticeable RFI, even when placed very close to the feedpoint of an HF antenna.

In addition to keeping these power supplies clean at HF, I also wanted to make sure that they caused minimal disruption at LF and VLF frequencies (e.g. those below the AM broadcast band) where I occasionally listen.  Because of these lower frequencies it is much more difficult to keep them from causing interference for several reasons:
  • Rather than being several 10's of times higher than the switching supply frequency, I might actually be listening on the switcher frequency - or on one of its first few harmonics.
  • At these lower frequencies the amount of inductance and capacitance in the filters may not be adequately high to effectively remove enough of the switching energy.
It was for this reason that I used the fairly large (3.3uF) case-to-V- coupling capacitor as well as adding the 2nd bifilar choke to the older Samlex power supply - not to mention the extra 1000 uF capacitors across the output leads of the supplies themselves.
Most of the time I don't even notice any of these power supplies causing interference, but on those occasions when I do (e.g. if I'm listening around 30-300 kHz, I may hear it) I can just shut them off for the duration.

Unfortunately, I also have other power supplies around the ham shack and the house (for the computer/monitor, the DSL modem, in the compact fluorescent and LED lighting, etc.) that are far "dirtier" and, at some point, these will require some action to clean them up - but that's another article!

[End]

This page stolen from ka7oei.blogspot.com