Gas station without pumps

2013 January 4

Class D works

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

As mentioned yesterday in Class D instead of class AB, I tried making a class D amplifier out of the one-op-amp amplifier I had built before, adding a comparator comparing that value with a triangle wave from my FG-500 function generator.  The output of the comparator feeds into the gates of a pair of FETs arranged as a cMOS inverter.  The slew rate of the the MCP6002 or MCP6004 was causing problems: I couldn’t use a high enough frequency on the triangle wave to be inaudible, and the FETs were spending too much time in the intermediate region where they had higher resistance (and more power dissipation).

This morning I replaced the MCP6002 op amp used as a comparator with an LM311, which is designed for use as a comparator.  Its output just turns on a bipolar transistor between two pins, so I needed to use a pull-up resistor.  I chose to use 100Ω, as a compromise between getting a fast rise time and dissipating too much power when the transistor is turned on.

This design worked fine as a class D amplifier, and the FETs for the output stage barely got warm.  I’m planning to restructure the power amp lab around class D amplifiers rather than class AB, since the design is much simpler to do (no worries about the threshold voltages of the FETs moving around or thermal runaway).  Class D is also more typical of cheap audio power amplifiers these days, so students should become familiar with it, even if it is not much used in bioinstrumentation.

I’ll probably have the students use the LM2903, rather than the LM311, since it seems to be the cheapest through-hole comparator available from DigiKey, and does not have the complications of the balance and strobe pins of the LM311 (nor the pair of output pins).  I’ll order a bunch from DigiKey, and check that the design works ok with them as well.  The LM2903 does have only a 20mA output current, rather than the 45mA output current for the LM311, which would mean a 330Ω pullup resistor, rather than 150Ω for the LM311 with a 6.6v supply (hmm, my 100Ω resistor was exceeding the spec a bit). That means somewhat slower rise times for the gates of the FETs, which is probably the limiting factor on the efficiency of the amplifier. I suppose I could add a class A stage with a bipolar transistor to drive the FET gates if I needed faster rise times, but I think that the current design is working well enough for a 1-week lab exercise, so I won’t mess with it unless I need to.

If this were a more advanced class on amplifiers, we’d probably go through all the major classes of amplifier design, but for a first circuits class, I think that using op amps, comparators, Schmitt triggers, instrumentation amps, and class D amplifiers is probably enough.



  1. […] Decide whether to include a transistor lab and what it should be. ✔✘ We’re going with FETs and a class-D amplifier, but I’m still working on the FET characterization lab. (See FET modeling lab looking complicated, Class D instead of class AB, and Class D works […]

    Pingback by Updating to-do list « Gas station without pumps — 2013 January 5 @ 21:40 | Reply

  2. Interesting idea! Glad you got it working well. Is there a particular reason Class D is not normally used in bioinstrumentation? (I’m assuming noise). If so, that might make a good test question: under what circumstances is a Class D amp desirable/undesirable?

    Comment by Mylène — 2013 January 6 @ 13:24 | Reply

    • Class D is mainly used as a way to get high efficiency at high power, at the cost of adding a lot of high-frequency artifacts. For audio use, the high-frequency artifacts can be put well above the range of human hearing and filtered out with inductors. The power supply is also contaminated with a lot of noise from switching the output load.

      But you don’t need high power for bioinstrumentation, where the goal is to amplify very weak signals to a level where they can be observed and recorded. The noise on the power supply from a class D amplifier would be terrible in those applications.

      Comment by gasstationwithoutpumps — 2013 January 6 @ 17:05 | Reply

  3. Understood — similar in other scientific instrumentation of my acquaintance. It would be interesting to see if students can reason to that conclusion.

    Comment by Mylene — 2013 January 6 @ 21:41 | Reply

  4. […] rather than just directly connecting the speaker between ground and the FETs of the output stage as I had originally planned.  That opened a big can of […]

    Pingback by All weekend and handouts still not written « Gas station without pumps — 2013 February 18 @ 12:21 | Reply

  5. […] rather than just directly connecting the speaker between ground and the FETs of the output stage as I had originally planned.  That opened a big can of […]

    Pingback by Pressure-sensor lab handout written « Gas station without pumps — 2013 February 19 @ 22:32 | Reply

  6. […] had a class-D amplifier working at the beginning of January, but I’ve changed the specs a bit since then (adding the LC […]

    Pingback by Class D with LC filter works | Gas station without pumps — 2013 February 23 @ 15:59 | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at

%d bloggers like this: