Gas station without pumps

2015 November 5

Book draft 2015 Nov 5

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

I released an updated version of the Applied Electronics for Bioengineers text today.  This draft involved several changes:

  • Added modifier for “resistor” at end of Section 5.1
  • Changed “load resistor” to “bias resistor” in microphone chapter and lab.
  • Fixed microphone schematics to use polarized microphones.
  • Figure 11.2 changed to use only one differential channel on PteroDAQ.
  • Brief explanation of RMS added to Section 3.2
  • Small fixes to Chapters 9–16 and indexing terms added.
  • Index cleaned up.
  • 60Hz FM figure added to Chapter 14
  • Updated power discussion in Sections 0.5, 12.3, 23.1
  • Updated to include Teensy 3.2
  • Major rewrite of Chapter 23 (Class D power amp)

I’m still not finished with the Class D chapter, but I managed to test today an H-bridge circuit using a 9V power supply, which could provide ±9v signals to a loudspeaker (the full 10W that the loudspeaker can take).  I did not actually drive the loudspeaker that far, but I confirmed that the H-bridge was providing the full voltage range for PWM and that I was getting clean signals at the loudspeaker for loudness I was willing to tolerate listening to.

I’m now convinced that an H-bridge design is a simpler approach to teach the students, as well as being more useful for students who go on into the “assistive technology: motor” concentration.  Modifying the H-bridge to use logic-level signals from the comparator but high voltages for the power FETs turned out to be quite simple.  I just added a small nFET and a couple of resistors to make an inverter with a small voltage swing on the output:

Q1 and the resistors R1 and R2 form an inverter for driving the pFET.  Sizing R1 and R2 determines the voltage swing on the pFET gate  (Q2) and how fast the turn on and turn off are.  Of course, when Q3 is on, there is a current through it that is wasted (not delivered to the load), but I was able to keep that down to about 15mA.

Q1 and the resistors R1 and R2 form an inverter for driving the pFET. Sizing R1 and R2 determines the voltage swing on the pFET gate (Q2) and how fast the turn on and turn off are. Of course, when Q3 is on, there is a current through it that is wasted (not delivered to the load), but I was able to keep that down to about 15mA.

Advertisements

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).

2014 June 4

Random topics in class today

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

Since students have started on their last lab, there is no more material that I have to cover, so I threw today’s lecture open for questions.  I had prepared some material on Wien-bridge oscillators, in case no one had any questions, but we filled the time with stuff they were confused about from earlier in the quarter.  In roughly the order I covered them, we talked about

  • FETs. I showed the cross-sections of nFETs and pFETs, explained the “back gate” or substrate connection and why it was tied to the source on the power FETs. I also talked about the flyback diodes and why they are needed when driving inductive loads.  This also gave me an opportunity to talk about how ignition coils on cars work.
  • PWM. I redid a lecture that had not gone over well the first time, talking about how the rectangular voltage pulses turn into up and down ramps for current in an inductive load, and how duty cycle gets converted to current level.  I still think I could do a better job of the PWM talk, but the students were feeling better about understanding how their class-D amplifiers worked.
  • I also introduced H-bridges for DC motor speed control, and showed how PWM could control the motor to turn forward or backward at different average current levels.
  • A student asked about how the gain in theirpreamp affected thefinal output loudness, so I redrew a part of the comparator function from their lab handout:
    Example of comparator output comparing a slow signal from a preamp and a fast triangle wave to get a pulse-width modulated wave.

    Example of comparator output comparing a slow signal from a preamp and a fast triangle wave to get a pulse-width modulated wave.

    I then showed how a small signal centered at the same voltage as the triangle wave would produce a 50% duty cycle, with only small fluctuations from 50% as the signal went up or down.

  • Finally, I reviewed sampling and aliasing, explaining where the beat patterns they saw in their lab came from.  I think I need to provide more on that earlier in the quarter, as they did not seem to get as much from the sampling and aliasing lab as I had hoped.

Tomorrow is the last lab (unless students request extra time in the lab to redo something next week), and I expect all the students to finish their EKG soldering.  I did remember to suggest that everyone solder a board, so that they could have one to demo to people, but we’ll see how many takers there are tomorrow.

On Friday, I’ll once again take questions, but I’ll still have the Wien-bridge oscillator to present if they don’t have anything to ask.

 

Next Page »

Create a free website or blog at WordPress.com.

%d bloggers like this: