Gas station without pumps

2019 May 10

Inductive spikes

Filed under: Circuits course — gasstationwithoutpumps @ 22:04
Tags: , , , ,

One of the labs in my textbook Applied Analog Electronics asks students to look at the inductive spikes created by switching a nFET on and off with a loudspeaker as a load:

A 5V pulse signal to Gn will turn the nFET on.

My students were very confused when they tried the experiment, because they got a different result:

What the students got at the nFET drain went a little above 5V, but did not have the enormous inductive spike they expected.

Of course, I lied to you a little about what their circuit was—they were working with half-H-bridge boards that they had soldered:

The half H-bridge boards have a pFET and capacitor on them, as well as an nFET.

The pFET was left unconnected, so the circuit was really the following:

The gate and pFET source were left floating in the student setups.

So what difference does the pFET make? Well, with the gate floating and staying near 0V, the pFET turns on when the pFET source voltage gets high enough, allowing the capacitor to charge.

The pFET source gets up to about 7.2–7.3V, and the time constants for the capacitor and loudspeaker are long enough that the capacitor looks like a power supply (not changing voltage much on this time scale), so that the body diode of the pFET snubs the inductive spike at about a diode drop above the pFET source voltage.

So how did I miss this problem when I did my testing before including the lab in the book? One possibility is that I left out the bypass capacitor—without it you get the expected spike. But I know I had included the capacitor on my half-H-bridge boards—I had to solder up a board without the bypass capacitor specially last night, in order to get the “expected” plot in the first plot of this post.  I think what happened is that when I had done my tests, I had always connected the pFET gate to the pFET source, to ensure that the pFET stayed off, but when I wrote the book, I forgot that in the instructions. Here are the plots of the board with the pFET gate and source tied together (both floating), both floating separately, and with the them both tied to 5V:

With the pFET gate and source tied together, the circuit behaves as expected, with large inductive spikes if the pFET source is floating, but snubbed to a diode drop above 5V if the source is tied to 5V.

The pFET source voltage gets quite high when the pFET gate and source are tied together to keep the FET off, but they are not tied to the power rail:

Because the pFET never turns on, the body diode and capacitor acts as a peak detector, and the capacitor charges until the leakage compensates for the charge deposited on each cycle, around 33.7V, snubbing the inductive spike at about 37V (more than a diode drop above, but the duration is short).

This summer and fall, when I’ll be working on the next edition of the book, I’ll be sure to improve the instructions for the FET lab!

2018 October 28

Redrawing figure in SVG

Filed under: Circuits course — gasstationwithoutpumps @ 20:18
Tags: , , , , , ,

There is a figure in my book of the cross-section of a power nFET.  Originally, I used a figure from wikimedia: https://en.wikipedia.org/wiki/Power_MOSFET#/media/File:Vdmos_cross_section_en.svg, but I wanted a color version, so I colorized it myself in Inkscape.  Unfortunately, the original SVG was poorly done—it looked like an inkscape conversion of a raster image to paths, which did not result in paths enclosing fillable areas with clean strokes around them, but separate paths filled with black for each stroke.  This made colorizing the image quite difficult.  I did (eventually) manage to make a colorized version, but I’ve never been happy with it.  The file is huge for an SVG file (over 81kB) and difficult to edit.  I’ve been wanting to do it right for some time, and I finally got around to it today.

What I did was to print out the version I’ve been using as a full-page image, then used a ruler to figure out how big each part was.  I then entered SVG code by hand to remake the image. I included comments to describe what each part did and used styles for the different materials, so editing is now easy.  I also made sure that the image is now symmetric and that all the rounded corners have smooth joins to the straight lines (the “q” command in the path “d” attribute makes that fairly easy. The new svg file is only 3425 bytes, even with the comments, and the pdf created from it is only 8kB, instead of 28kB.  Those size changes are not very important (the PDF for the book, after all, is now 25MB, up from 23.7MB last spring), but the image looks better now also.

WordPress.com does not let me upload svg files, but you can see the PDF produced from it by inkscape at https://gasstationwithoutpumps.files.wordpress.com/2018/10/nfet-cross-section.pdf

WordPress.com only lets me upload raster images for display, so I used inkscape to convert the hand-written SVG file to PNG just for this blog. The black line on the right edge seems to have been chopped off in the conversion, though the PDF conversion gets it right.

Here is the PNG generated by inkscape from the SVG file.

I tried uploading the SVG file to Wikimedia Commons, so it could be used on the Wikipedia Power MOSFET page, in place of the black-and-white image, but the uploaded file got rendered as a badly wrong black-and-white PNG file (with all colors converted to black), which is totally useless. I don’t have time to figure out how to tell it to do the conversion correctly, so I just asked them to delete the image again.

Correction 2018 Nov 21: I realized that the drawing from Wikipedia is missing something—the body should be lightly-doped P, with a P+ contact to the metal. The doping profile for the P layer also does not make physical sense here—how does it get shallower under the N+?  I have redrawn the figure for the book, but not corrected it here. I’ve removed the svg source from this post, because WordPress mangled it completely, despite the use of the “source” square-bracket tag. 

 

2018 February 25

Weekend off!

Filed under: Uncategorized — gasstationwithoutpumps @ 15:43
Tags: , , , ,

I had only 2 hours of grading to do this weekend (but next weekend will make up for that, with more than 30 hours of grading), so I got a chance to do some other things for a change:

  • Buy groceries at Trader Joe’s.  (“Groceries” is misleading here, as I generally view Trader Joe’s as a beverage store—I bought soy milk, mineral water, hard cider, beer, port, and whiskey, plus cereal, chocolate, and prunes.  I don’t drink whiskey or mineral water and my wife doesn’t drink port or soy milk, but the cider and beer are for both of us.)
  • Do a protein structure prediction for a microbiology colleague.  I no longer use my own tools for protein-structure prediction, as they have succumbed to the changes in C++ and operating systems, so that they can no longer be compiled or run.  I’ve also not maintained the template library for several years.  Because the only predictions I get asked to make these days are ones for which there are good templates, I just use HHpred and Modeller on-line.  For that sort of prediction, they are quick and do an adequate job.  The goal of this prediction was to get a good guess of binding-site residues for a chemosensor, to guide site-directed mutagenesis.  Unfortunately, the available structures did not have ligands bound, and for most of them no one knows what the real ligand is anyway, so I had to make guesses based on the structure without solid evidence for how ligands bind to them.
  • Check whether the nFET and pFET we’ll be using next quarter have small enough gate capacitances to be driven directly from a comparator, or whether we’ll still need to use 74AC04 inverters as digital amplifiers.  We could probably just barely get away with using the comparators, but the chips end up running rather warm, so I’m still going to recommend using the digital amplifier.   One inverter for both the nFET and pFET gate seems to be fine, though—the rise and fall time is short enough that we don’t need to use a separate inverter for each gate.
  • Review courses for the Committee on Courses of Instruction meeting tomorrow—I only had 13 courses to review this time, and I’d already looked at half of them.

I still have this evening—maybe I’ll repot the free live Christmas tree my wife picked up yesterday.  We gave our old one away in January, because it was getting pot bound and we did not want to transfer it to a larger pot—the current one was as heavy as we could haul up the steps.  The new one is tiny, but should last us several years before it gets to be too big.  Today might also be a good day to put the Christmas ornaments back in the attic—we’ll probably have to rebox some of them, as Marcus (our kitten) has shredded some of the boxes.)

2018 January 17

Long weekend, little done

Filed under: Circuits course — gasstationwithoutpumps @ 10:01
Tags: , ,

Last weekend was a long weekend (Martin Luther King Day on Monday), and I briefly had fantasies of getting a lot of stuff done.  The trouble is I never settled on exactly what it was I would get done, so I ended up doing very little.  I read science fiction, I slept a lot, I tinkered with my book a little bit, I got the live Christmas tree out of the house, and I adjusted the brakes on my bike. but that’s about it.

The main addition to the book wasn’t even a very important one—this picture:

Some of the most common packages for FETs.

We used to use TO-220 and TO-251 packages for the class, since that is how power FETS are most commonly packaged, but the power FETs are getting expensive (the cheapest ones keep getting discontinued—maybe they were cheap because they were end-of-life, or maybe they were discontinued because there wasn’t enough profit at the low price point).  We had problems last year with TO-251 packages not staying in the breadboards—the springs seemed to pop the leads out rather than grabbing them.

This year we’ll be using the SOT-23 transistors, which are much cheaper, and soldering them to a breakout board.  I’m a little worried about how many of the students will have trouble with hand-soldering the small parts.  They’ll have had a little more practice soldering by then, so I’m hopeful that it will go ok.

The other changes to the book were mostly typo fixes for problems found by my students.  The students have been very good this year at reporting problems to me, and there were a lot more typos than I expected (averaging about 1 every 3 pages).  So far they’ve not pointed out any substantive errors, though there was one omission that I’ve fixed—it seems that some students have not heard of raster image formats, and thought I was trying to say “faster image formats”, so I’ve added a couple of paragraphs about image formats.  The changes that I’m making this quarter will be in the next release, which will probably be in March, during spring break.

2018 January 3

SOT-23 FETs for half H-bridge

Filed under: Circuits course — gasstationwithoutpumps @ 20:53
Tags: , , , , ,

In Breakout board for SOT-23 FETs, I gave the schematic and layout pictures for a half H-bridge breakout board using SOT-23 surface-mount FETs.  The boards arrived today, 12 days after I ordered them. The boards cost $4.86 plus $23.79 shipping, but I had them panelize the design, and they sent me 13 copies instead of 10, so I ended up with 546 boards (instead of 420), making a cost of 5.24¢ each.

One of the panelized board. The panels are just separated with V cuts, so the corner rounding is not very good, but there is some, and I did not end up with sharp corners after cutting off a row of boards with tin snips.

With the transistors, capacitor, and headers, each half H-bridge will cost under 40¢ in 100s—much less than the approximately $1.37/half H-bridge that separate TO-220 FETs cost.

Today I tried soldering on a  PMV20XNER nFET (14.9¢ in 100s) and SSM3J332R pFET (12.4¢ in 100s), a 5-long right-angle header, and a 10µF ceramic capacitor. I wanted to do this with pretty much the same tools the students would have, so I did not use a board holder nor cross-lock tweezers (both of which would have made the job slightly easier).  My technique was simple:

  • Put the board face up on the bench.
  • Place one FET using sharp-pointed tweezers.
  • Tape the FET and the drain side down with a tiny piece of blue painters’ tape.
  • Solder the source and gate.
  • Remove the tape.
  • Solder the drain.
  • Repeat for the other FET.
  • Put the headers through the holes (from the component side).
  • Flip the board over and solder the header.
  • Put the header pins into a breadboard at the edge of the board.
  • Insert the capacitor from the component side.
  • Prop the breadboard up so the solder side of the board is exposed.
  • Solder the capacitor in place and trim its leads.

Soldering the first board went well.  The second one was a little harder (I had a bit of hand tremor), but still only took a few minutes.  Having made the lands huge (big enough for wave soldering) made alignment fairly simple—I did not have to be exact.

I tried one FET without the trick of taping the FET in place—that did not work at all, as the FET moved completely off the pad when I tried to solder.  I had to remove solder from the board with a solder sucker and redo the FET using tape.

Here are the front and back of the boards before and after populating, along with the pointed tweezers I used for placing the FETs.

Here is a close-up of one of the two boards I soldered (the one with the worst alignment—see the pFET at the top left).

I spent the rest of the afternoon checking that the boards were OK.  I used essentially the same setup as I used for Ron vs Vgs for pFETs and nFETS, with a 24Ω load and a 10V ramp that gradually turned the transistor off.  Because the test was the same, I plotted the results together with the old results:

The PMV20XNER transistor has a much lower threshold than the other nFETS I’ve looked at, but a comparable Ron to the other power nFETs.

The SSM3J332R pFET also has a low threshold voltage and the on resistance is in the same range as others we have used in the past.

It looks to me like the half-H-bridge will be a perfectly reasonable way for the students to get FETs for the class-D amplifier.  The current will be somewhat limited by the power dissipation of the pFET, but with an 8Ω speaker and 0.1Ω pFET, the power to the loudspeaker should be 80 times the power lost in the pFET, so the 10W limit on the loudspeaker should be reached well before the half H-bridge overheats.

Update: the EAGLE and Gerber files for this board are available at https://users.soe.ucsc.edu/~karplus/bme51/pc-boards/

Next Page »

%d bloggers like this: