Friday, 17 February 2017

More fakes

Here are some fake 2SK1058 & 2SJ162 MOSFETs I just bought from ebay. These came from an American seller. Different 2SJ162s:

In each case I've put a real 2SJ162 next to the fake. In all photos the fake is on the left and the real deal is on the right.

The real transistor is the most modern version of the 2SJ162, made after Hitachi spun their semiconductor foundry off as it's own entity under the "Renesas" brand. Note the absence of Hitachi markings, or indeed Renesas. Note also that the real thing has it's marking done with a printing process, whereas the fake has markings done by laser, in a raster pattern.

Lots of transistors are marked by laser now - indeed it's the standard way for product to be identified these last fifteen years or so. However that's after Hitachi became Renesas. Note the real Renesas product (perhaps twelve years old) still hasn't got laser markings.

The other tell-tale is that the date code on the two wildly different 2SJ162 packages is identical. Fabs do change their packaging from time to time, but not with the same date code.

Note further that the raster pattern isn't just where the markings are, but extends all the way across the package. I'm hypothesising that this is how they obliterate the original markings without resorting to sanding.

And their counterfeit complementary pairs, 2SK1058s:

Again, real deal on the right, fakes on the left. Same thing with the laser markings, but this time the raster pattern is only where the text is. Perhaps they got a pile of transistors that were unmarked so there was no erasing needed?

This is incredibly frustrating. I'm a seasoned professional engineer with decades of experience. If I didn't have some known-good stock of these transistors, and if I hadn't been alerted to the possibility of trouble by the two different 2SJ162s with the same date code, then I'd have chucked them in a circuit and wondered why it didn't work. How's a fifteen year old enthusiastic kid going to cope? She'll build her amp, wonder why it vanishes in a cloud of smoke, and give up.

A very easy test can be done with a multimeter. Cgs on the real parts is ~0.8nF, and Cgd around 0.6nF for the 1058, and 1.1nF for the 162. For the fakes I didn't measure valid capacitances for most of the 2SJ162s (so they probably aren't even MOSFETs), and the remainder all measured ~5nF Cgd, so they're likely DMOS parts rather than lateral MOSFETs.

So the last photo shows a cotton bud soaked in isopropyl alcohol, having scrubbed the surface of the transistor:

Black scunge comes off, and the raster pattern is more obvious. I'm wondering if they paint the transistors with something where they've had to remove markings to blacken them up before remarking. I didn't get any black scunge off the "2SK1058" variety - I'm thinking this is because no remarking was needed for these ones.

I'll see how the seller goes with a refund.

Edit: The seller refunded immediately, and said "Hello I sold many of this item, without any complaint", which is I guess exactly my concern. So lots of people have bought these, put them into amps, found they don't work, then blamed either their own assembly skills or else the amp design, when the problem is that the actual parts are fakes. It's really unconscionable behaviour.

Finally, a quick disassembly. From left to right we have both the flavours of "2SJ162" then the "2SK1058":

The dies are all different sizes - 4.2mm square for the first "2SJ162", 4.1mm for the second, and 4.5 for the "2SK1058". They made rather a mess mounting the die, which is a little surprising and makes me wonder if perhaps these are specifically built to be fakes - ie that they buy die and package them, then put bogus labels on them.

Monday, 30 January 2017

Measuring a MOSFET Power Amplifier.

I'm on a bit of an audio kick of late. It's all about building some speakers and an amp for my study, as I stole the speakers and amp from there (some nice home-brew 2-way bookshelfs with Vifa P13WH mid-woofers and P27TG tweeters, and an old NAD 3020B) for my bedroom. Anyway, I've got a pre-existing amp design, based on David Tilbrook's AEM6000, and I've ordered the drivers to build a pair of Lynn Olsen "Ariel" MTM transmission lines. That'll make some pleasant noise, I think.

On to the amps. Back when I originally designed these amps, some 10 years ago, the distortion analyser I had had a noise floor of 0.0013%. I achieved that fairly easily so moved on. I've just bought a PCB for a super-low distortion oscillator based on the Linear Tech "AN67" circuit, which uses some scary high-gain opamps wrapped around a resonator to generate an "unmeasurably" pure tone.

Now I've got a sniff of a world beyond 0.001%, I'm very keen to see how far I can go. Part of that's developing a whole new completely over-the-top amplifier (see previous posts), part of that is just playing with my existing amps to see what they're really capable of.

The process is straightforward. Put one together on a heatsink with a dummy load and thrown together power supply using bits from the garage, apply a stimulus from either my mac, my function generator, or my new oscillator, measure what's being put into the load with my CRO and spectrum analyser, tweak, repeat. It's a process that's quite involving.

Here's the amplifier in question. It's a little 50mm x 100mm PCB, implementing a modified version of Tilbrook's AEM6000:

The one that we're concerning ourselves with today is the one on the left. It's an evolution of a couple of previous designs:

They started with my original "repackaging" of the AEM6000 using flat-pack MOSFETs, shown on the top left. Then I made a "baby" 50W version (top right). While making that I wondered whether I could roll a version that would fit on a 50mm wide heatsink, with off-board filter caps. That resulted in the two smaller boards below. They depart from the original in that the VAS stage is no longer differential-symmetrical, as I simply couldn't see the advantage of the differential structure in Tilbrook's original. Also I made much better use of the back-side of the PCB. Whereas the original has practically nothing on the back bar the MOSFETs, this one has a fairly even spread of parts on each side. That makes it more compact and keeps parasitics down. Despite the small size it's still using 1206 (or MELF 0204) parts.

The schematic for the small 100W flavour is below:

First measurement, after setting the bias to 100mA per MOSFET and setting the output offset to <1mV, is to check for oscillations. I simply connect the output to the load, monitor that with the 1M input on my spec-an, and use the spec-an tracking generator (via a 20dB pad) as the amplifier input:

No nasty surprises. Hitachi lateral MOSFETs are prone to oscillate around 1-2 MHz if the amp isn't well compensated. I find working with LTspice to prototype the compensation is straightforward, and as long as you check the DC conditions on the real thing you'll be good.

While it's connected to the tracking generator, I check the gain flatness across the audio band:

It's hard to tell the spectrum analyser from my amp at the bottom end, as the spectrum analyser has a high-pass at 20Hz. Anyway, it's flat to within 0.1dB or so from there to 20KHz, which should be plenty. Of note is that I measured my NAD3020B, and it's got 6dB of bass boost from 60Hz to about 500Hz, with the bass knob in the middle. It's relatively flat when the bass knob is turned all the way down. I guess that's how you sell amps. That one "sounds better" - ie colours the music.

From here the measurements get increasingly challenging. First the noise floor of the amp. My spectrum analyser has a direct noise readout in nV/sqrtHz, which is incredibly cool. Pulling the amp input off the tracking generator, terminating it into 50 Ohms, and then winding the spectrum analyser all the way down to find the noise floor, we get this:

With the marker at 1KHz, we read off 139nV/sqrtHz. Input referred (this amp has a gain of 16), that's just 8.7nV/sqrtHz. To put it into context, the OP134, a pretty well regarded low-noise opamp, has an input referred voltage noise density of 8nV/sqrtHz.

Next we start working our way down the THD rabbit hole. I started by using my macBook air, as it has a reasonably clean DAC. I used Audacity to generate a 1KHz tone, then played that at all the mac volume settings, both directly and via my amp output:

Okay, not bad. Note the amp appears better than the macBook around 100mW to 1W. This is simply because the amp provides a gain of 16, so what was buried in the noise of the spec-an without the amp, isn't with the amp. Things turn to custard after a few watts. Initially I passed that off on the wimpy 2x25V 80VA supply I was using for test, but we'll find later it's a much cooler problem.

To go deeper, I really do need a better source. So I spent some time building the 1KHz low-distortion oscillator. Here's a photo:

The new oscillator, coupled with a 1KHz notch filter between the amplifier and the spec-an, really does allow us to make a much better THD plot:

But the distortion still isn't anything to write home about - sure, it's better than 0.001% at medium levels, but it falls off badly after a few watts.

I wondered what sort of improvement I could get by substituting faster VAS and second stage transistors. The MJE340 and 350 are bullet-proof, but they're pretty slow really. I pulled them out and substituted KSC3503D & KSA1381E, then made another plot:

Wow, that didn't help. Much gnashing of teeth and measuring showed one of the output drivers was drawing half the current of the other one. I went to replace it, and found out I'd, ahem, forgotten to do the screw up holding it to the heatsink, so it was running _much_ hotter than it should have. Tightening the screw up fixed the god-awful distortion, and we were back where we were with the MJE parts, marginally better:

On the basis that the KSA and KSC parts are faster, and my sims showed considerably improved stability, I wondered if I could improve the THD a little by winding up the negative feedback. This has the effect of reducing the output level, but I can sort that with more gain in the preamp. So I substituted a 5K1 MELF resistor for the 15K thick-film 1206 that was setting the feedback ratio. Bam! Instant huge improvement in THD. Much better than the couple of dB that I should have gotten. So I tried a variety of other MELF resistors for Rf. All show dramatically improved THD over the 15K thick-film chip resistor, and a gradual increase in THD in line with reduction in feedback:

So next I did some reading about distortion in resistors, and found that it's actually a thing. Thick-film resistors are notorious for changing their resistance significantly with changes in applied voltage. That change in voltage directly leads to a change of division ratio, and hence to distortion - we get different gain in the peaks than we do at the zero-crossings. The MELF resistors are a thin-film that's carefully engineered for stable resistance, both with changes in temperature (+/-25ppm/deg) and voltage. So they really are worth the extra few cents. Anyway, there's a whole nother resistor in this feedback divider, and that's also a thick-film chip. Not for long:

Yeah, that's 1ppm there, right around 25W output. So finally I did a much more exhaustive measurement, carefully accounting for every harmonic at a huge range of output powers, from 100mW all the way to 140W. Then I modified the oscillator to do 10KHz and repeated the exercise. I'm rather happy with the results. This amp is lovely and clean all the way to clipping at 120W. Slew rate doesn't clobber the 10KHz THD result until around 80W. Note a peculiarity of the results where the 10KHz THD is slightly lower than the 1KHz result under 1W. I attribute this to a slight increase in noise at low frequency, both from 1/f noise and 50Hz harmonics getting into the measurement. These are reduced by 10KHz:

Tuesday, 17 January 2017

A fast 12dB gain current-mode buffer for my HP3325B function generator

I'm sprucing up my HP3325B, after it stopped working (shorted out tantalum).

One of the options for the HP3325B is the "high voltage" output, which allows up to 40Vpk-pk, at up to 1 MHz, into 500 Ohms. Usual output is 10Vpk-pk, at up to 21 MHz into 50 Ohms.

Anyway, I don't have that. I was wondering if I could perhaps build a buffer-amp that beats their spec. Ideally it'd do 40Vpk-pk at 21 MHz into 50 Ohms, without adding appreciable distortion (the HP3325 is only good for perhaps 0.01% at audio, so that's not a difficult number to reach).

I have an old design for a current-mode headphone amp that I thought might be suitable, so I spruced it up a little, thought in terms of HF rather than audio, and I think I've come reasonably close.

It's actually a challenging amp - it's gotta be DC coupled, stable with a gain of just 4, and have reasonably low offset and gobs of speed, with tolerable distortion driving 40Vpk-pk, and really good distortion at lower levels. Here's the schematic:

At the hard end of the spec it manages 0.08% THD pushing a 1 MHz 40Vpk-pk sine wave into 50 Ohms. Relax any of that and it gets a lot better. For example at 1Vpk-pk, 1MHz, 50 Ohms it does 0.002%. At the "High Voltage option" max spec (500 Ohm load), it manages 0.05%, not a lot different from the 50 Ohm case, due mainly to the heavy feedback current.

At audio frequency it's kinda cool, and would make a neat uber headphone amp. (0.001%, 10KHz, 40Vpk-pk into 50 Ohms). And it's got gain that just keeps going. Yeah, 12dB gain at 100 MHz: