Gas station without pumps

2016 May 22

Disappointing class-D amplifier reports

Filed under: Circuits course — gasstationwithoutpumps @ 15:59
Tags: , , ,

I have a huge stack of grading to do this weekend (about 20 new design reports and about 30 redone reports from earlier labs). I was rather disappointed with the reports for the class-D amplifiers, not because the amplifiers didn’t work (they mostly did), but because about 80% of the class is getting a REDO for errors in their schematics, which means I’ll be having to grade the reports again.  I consider 20% REDO an acceptable level, but not 80%.

The most common error in the schematics was one that I had seen a fair amount in previous years: getting the source and drain of the pFETs swapped.  It is a fairly serious error, as putting the transistors in backwards would cause a lot of shoot-through current from the body diode conducting.  Students were wiring their transistors correctly (after some false starts), but documenting their designs wrong.  A number of students also used the depletion-mode instead of enhancement-mode FET symbol, but I consider this a much less serious error (as long as they included the right part number), and would not have triggered an automatic redo for that mistake.

I warned the students about the source and drain orientation repeatedly, both as a class and (in many cases) individually.  I was very careful to point out the convention for the source and drain notation in class and in the book, and they had it on their data sheets as well.  I don’t know what else I can do, other than instituting in-class quizzes, which I may have to do next year.

There were a number of other documentation problems in the reports this week:

  • Using their loudspeaker models, but not including the model in the report.  In many cases, it was clear from their plots that they had screwed up the model somehow, but without any formulas or parameter values, it was impossible to figure out what they had screwed up.
  • Oscilloscope pictures that did not say what the probes were connected to, or had incorrect labeling of the probes. This was mainly really bad lab technique, where they failed to write down what they were doing, and couldn’t reconstruct it from their memories.  That is one aspect of the labs that I’ve not put much emphasis on this year—writing down what they are doing as they do it.  I may have to emphasize that more next year, especially since the labs will be broken up into 4 95-minute sections instead of 2 3-hour sections, which will make memory even more unreliable.
  • Not reporting the PWM frequency.
  • Not remembering to include their bypass capacitors in their schematics. Some students may not have had bypass capacitors, though it was very difficult to get the amplifiers to work without them, as the H-bridge dumps a lot of high-frequency energy into the power lines, which gets coupled back to the comparator and the preamp.
  • Generally bad copy editing.  The spelling and grammar problems in some reports are just common non-native problems with articles, plurals, and verb tense, but a lot of the reports had huge numbers of spelling errors, duplicate words, missing words, comma problems, and incomplete sentences.  I’ll be addressing this problem next year by giving students a bit more time to complete the reports (though that didn’t seem to help on the one report that students had more time on this year).

2015 September 17

H-bridge Class-D hum problem solved

Filed under: Circuits course — gasstationwithoutpumps @ 17:12
Tags: , , , ,

I H-bridge Class-D works I mentioned

I was getting a rather annoying amount of 60Hz hum, probably from the microphone preamplifier.  I’ll have to play with it a bit tomorrow to see if I can avoid the hum pickup.


It turned out to be a fairly simple, but unexpected problem.  The TLC3702 comparator chip has 2 comparators in the package, and I had not connected anything to the second comparator.  Connecting the inputs to ground eliminated the hum!  I think that what was happening was that 60Hz pickup on the unconnected input was causing the second comparator to swing back and forth at about 60Hz, and that this was coupled internally to the comparator I was using (probably through the shared power connections). By silencing the second comparator, I removed this source of hum.

My son also noticed a high-pitched noise that was barely audible to me.  I figured that the source was probably the low-quality triangle wave from the FG085 function generator. If the period is not an exact multiple of 250ns, then the sampling of the triangle wave gradually shifts phase, and that changing phase turns into a PWM signal that is audible on the speaker.  By selecting 62.5kHZ, exactly 64 clock pulses of the FG085 clock, as my PWM frequency, I avoided phase shifts and eliminated the high-pitched whine.

2015 September 16

H-bridge Class-D works

Filed under: Circuits course — gasstationwithoutpumps @ 23:09
Tags: , , , ,

The simplified class-D amplifier using a cMOS H-bridge works! Using an inverter chip (in this case a 74HC14N Schmitt trigger chip) to provide separate amplifiers for each nFET and pFET allows using the TLC3702 rail-to-rail comparator, despite its rather wimpy current output. Using an H-bridge allows 10V swing with only a single 5V power supply (in my case, just USB power from my laptop).  Driving an inductive load (a 220µH inductor in series with an 8Ω loudspeaker) got clean 800ns rise and fall times, and the LC filter design made almost all the PWM carrier frequency disappear from across the loudspeaker.  I got no noticeable shoot-through current, and I couldn’t see the Miller plateaus on the gate voltages (I’ll check that again tomorrow with my faster analog oscilloscope—I was just looking at the signals with the Bitscope B10 with the DP02 differential probe).

I was getting a rather annoying amount of 60Hz hum, probably from the microphone preamplifier.  I’ll have to play with it a bit tomorrow to see if I can avoid the hum pickup.

The high frequency triangle waves from the FG085 function generator are not very good, but I cleaned up the digital-to-analog converter steps by adding a 10nF capacitor across the output.  With the ~47Ω output resistance of the FG085, this makes a 340kHz low-pass filter, which is fine for triangle waves around 50—100kHz.  Any larger capacitor and the waveforms started getting too sinusoidal.

I think I’ll rewrite the Class-D lab around an H-bridge design, rather than the open-collector comparators and 3 power supplies. The parts are about $1.50 more (extra nFET and pFET, more expensive comparator, extra inverter chip), but the design is much simpler, and the PWM waveform clearer.


Class-D power amp lab revamp

Filed under: Circuits course — gasstationwithoutpumps @ 11:06
Tags: , ,

I’ve been struggling all summer with half-baked ideas to try to improve the class-D power amp lab in the applied electronics course.  Since the first run of the course, there have been too many concepts packed into that one week, and too much stuff to do for students to understand it all.  It also has been the one that been most difficult to convert to a home-lab exercise, because it used a triple power supply.

One idea that I have implemented, though I’m a bit worried about whether it will work, is to make the first amplifier lab, the microphone pre-amplifier, require soldering, so that the class-D lab can use the microphone pre-amp as a pre-built module, without having to rebuild it. I’ll need to think about the possibility of reordering the labs, to do a breadboard lab before the soldered pre-amplifier.  Perhaps the transimpedance amplifier can come before the microphone amplifier??

The other idea I’ve been toying with, and that I’ll have to build and test this week, is to use a single power supply and an H-bridge for the loudspeaker.  That way I could keep the voltage down to 6V (in spec for the op-amp in the preamplifier) and still get enough power to the speaker (4.5W for an 8Ω speaker).  Because the voltage range is now ok for many cMOS parts, I can eliminate the open-collector output comparators, and use a rail-to-rail comparator like the TLC3702.  I’ll need an inverter for controlling the two sides of the H-bridge, so I could use a hex inverter package and use a separate inverter as a driver for each of the four FETs.  I could even have students get a second 74HC14N Schmitt trigger chip, as they have the same drive capability as 74HCU04 inverter chips, and increasing the number lowers the cost below buying one of each for the students. I estimate that the gate rise and fall times will be faster than what we’ve been getting with the open-collector designs, so shoot-through current should not be a major problem.

H-bridges are probably more useful to the bioengineers than open-collector circuits, because many of them will be taking the mechatronics class and building motor controllers. Having seen and designed H-bridges before will make their motor control seem more natural.

For the argument in favor of open-collector circuits: Many students will be learning how to do I2C interfacing in the sensors class, which uses open-collector (or open-drain) wiring, but the reasoning for the pullups needed in those designs is somewhat different from what is needed in the class-D amplifier anyway.

I’ve drawn up a schematic for a possible design and will try building it tonight or tomorrow.  The last time I tried using a TLC3702 comparator in a class-D amplifier, I did not have much success, but I was trying to swing a much larger voltage then and did not have inverters as extra amplifiers for each gate—the inverters seem to have about twice the drive capability of the TLC3702 output.  The combination of smaller voltage swing and greater current should make the transitions on the gates fast enough that shoot-through current should not be a problem (fingers crossed).

2015 May 28

Power amps working

Filed under: Circuits course — gasstationwithoutpumps @ 21:34
Tags: , , , ,

The power-amp lab went quite smoothly today—just about everybody got a class-D power amp working and a couple of groups wired their sup to a headphone plug and played music from their cell phones.  They were impressed at how loud the amplifiers were (though they were only producing about 4W of music, and their speakers could go to 10W or 15W, depending which model they got).

The biggest problems I saw in helping students debug was careless wiring—often because students had not bothered to make complete schematics including pin numbers and every power connection.  Connecting power up incorrectly was common.  Another common problem for students who did multi-sheet schematics (not recommended for such a small circuit), was having discrepancies at the boundaries between the sheets (like leaving out the high-pass filter needed for recentering the output of the pre-amplifier at the same voltage as the triangle wave).  A number of students got confused between the lowest power rail and ground (especially since the LM2903 data sheet calls the low power voltage to it GND, even though in the student schematics it was connected to the lowest power rail.

Despite my rather awkward lectures on the class-D power-amp, I think that the building and testing went smoother this year—perhaps because I tried having them do a crude-approximation-and-test approach to sizing the pull-up resistors.  I think that few groups ended up using the resistor sizes they started with.  Most had to make the nFET gate’s pull-up larger and the pFET gate’s pull-up smaller, to make the transistors turn off fast enough.  I’ll have to see if I can come up with some design guidance that will make the initial estimates closer, without complicating the design process.

I have to correct something I said yesterday in Last power-amp lecture—I did include a current-vs-voltage graph for the LM2903 comparator!  I need to rewrite the prelab to have them use that figure to compute their open-collector pull-up resistors: choose a desired low output voltage, figure out the current at that voltage, then use the voltage drop across the pull-up resistor to size the resistor.

I tried using the digital scope in lab today to get Miller plateau pictures without slowing down the transitions, and I recorded a few with the lower power rail at –6V, the upper power rail at +6V and a 330Ω pull-up resistor to 0V on the open-collector output:

Rising edge for the gate voltage with a 330Ω pullup to 0V from –6v.

Rising edge for the gate voltage with a 330Ω pullup to 0V from –6v.

Falling edge for the gate voltage with no load on the FET, from 0v down to –6v.

Falling edge for the gate voltage with no load on the FET, from 0v down to –6v.

With an 8Ω loudspeaker as a load, turning off the nFET (gate voltage in blue) causes a large inductive spike on the drain (yellow).

With an 8Ω loudspeaker as a load, turning off the nFET (gate voltage in blue) causes a large inductive spike on the drain (yellow).

Here is a detail of turning off the nFET, showing both the Miller plateau on the gate voltage (blue) and a large inductive spike on the drain (yellow).

Here is a detail of turning off the nFET, showing both the Miller plateau on the gate voltage (blue) and a large inductive spike on the drain (yellow).

The on-transition of the nFET shows the Miller plateau clearly in the gate voltage (blue), with a smooth transition in the drain voltage (yellow).

The on-transition of the nFET shows the Miller plateau clearly in the gate voltage (blue), with a smooth transition in the drain voltage (yellow).

Unfortunately, these tiny little images were all the scope recorded, and they are too low quality as images to put in the book.  I’ll have to do it again sometime, with the scope downloading the data for me to plot properly.  Unfortunately, the download format is a 3.8Mbyte CSV file, which takes a long time for the scope to download to a flash drive (slow USB 1 speeds, I fear). I did not have the patience to do that today, together with writing scripts to ignore the meta data and plot just the real data.  I saved one file, which I’ll use for script writing, and some time later go back and record the transitions again.


Next Page »

%d bloggers like this: