I'm trying to make a circuit to drive a transformer from a PWM signal produced by an AVR MCU. Here's the schematic:

enter image description here

The MCU output in fact has 2 complimentary PWMs feeding two transistor pairs. For this scenario, let's suppose I can guarantee both signals coming from the AVR are always complimentary, and are never on at the same time.

The first transistor on each pair is low power, and is there to avoid direct connection between the AVR and the higher power transistor TIP41.

I did some measurements, and initially, all seemed fine. Please note I still didn't add the transformer, it's on the schematics just to show where it's supposed to be connected, but all measurements below were made without it.

The first one shows both TIP41 emitters (in yellow and blue), and their difference, using scope math (in red). Both probe grounds are on circuit ground. This is what I expected: each half of the primary would be driven by one TIP41 at a time, with alternating voltages, so I have half above zero, and half below zero:

enter image description here

Please note that both signals don't invert immediately, there is a delay introduced by the transistors and I don't know how to fix that. Measuring the signals directly on the AVR, I can see they switch immediately, there's no delay there.

Now comes the trouble: when I measure from one emitter to the other emitter of the TIP41s (probe ground on one emitter, and tip on the other), this is what happens:

enter image description here

Same signal zoomed out:

enter image description here

Does anyone have a clue on what may be happening? I expected to see something roughly similar to what I saw in red on the previous picture.

Perhaps I'm just using the scope wrongly, I don't know. I repeat: this all happens with no transformer, the transistor emitters are floating, there's no load.

  • 2
    \$\begingroup\$ You should be grounding the emitters and use the collectors as outputs to the transformer. The center-tap then connects to the +12 volt rail. You need bypass caps on the power supply. The PWM drive signals should not overlap, but have a 'dead' time. Do NOT test without the transformer connected. Much work to do. \$\endgroup\$ – Sparky256 May 27 '16 at 0:53
  • \$\begingroup\$ Thanks for the suggestions, @Sparky256! It seems I reversed the whole thing... I made the changes you suggested, and it seems to be working way better! However, could you please explain why do I need the caps on the power supply? \$\endgroup\$ – Marcovecchio May 27 '16 at 2:54
  • 1
    \$\begingroup\$ The capacitors filter out the noise spikes on the power supply rails. I think a 470uF 16v to 25vdc capacitor connected at emitter of Q2 and Q3 (-terminal or lead), and the + lead connected to the +12 vollts where the transformer center tap is connected. You only want the drive (pulse) current at the transformer, not on your 12 volts power lines. That should clean up the waveform even more. \$\endgroup\$ – Sparky256 May 27 '16 at 3:08
  • \$\begingroup\$ @Sparky256, thanks again, indeed I had huge spikes, and I was going to try adding diodes to filter them. I will use capacitors instead. \$\endgroup\$ – Marcovecchio May 27 '16 at 3:24
  • 1
    \$\begingroup\$ The diodes are not needed as long as Q1 and Q4 are rated for 3 times the supply voltage, or about 50 volts. \$\endgroup\$ – Sparky256 May 27 '16 at 3:31

Without the transformer connected, the only load is your scope probe (probably around 10MΩ and 20pF). When you measure between one output and ground this tiny load is enough to pull the voltage down when the transistor is turned off.

But when you measure between one output transistor and the other there is nothing to pull the voltage down. In fact the scope probe is (weakly) pulling the Emitter of the 'off' transistor up until it reaches the transistor's Base-Emitter reverse breakdown voltage at about 8V. This is why you see short spikes (due to capacitive coupling) and a lower amplitude square wave (due to Base-Emitter reverse breakdown).

To get the desired waveform you need to provide load resistances low enough to swamp out transistor parasitics and scope probe impedance. A 1k resistor from each Emitter to ground should be enough.

However, even with suitable load resistors you still won't get the same waveform as when the transformer is connected. The transformer reflects voltage on one side of its primary to the other, but with opposite polarity. So when one transistor is turned on and switching +12V onto one side of the transformer primary, the other side will put (close to) negative 12V onto the other transistor's Emitter. This will cause the 'off' transistor to turn on when it shouldn't.

To work with a transformer you need to either change each output transistor to a PNP type and connect their Emitters to +12V, or connect the transformer center tap to +12V and connect the (NPN) Emitters to ground. In either case the Collectors must go to the transformer. Then the Collector-Emitter voltage won't reverse when each transistor is turned off, but go to double the supply voltage instead.

| improve this answer | |
  • \$\begingroup\$ Thanks for the detailed explanation, Bruce! When I think I'm understanding, I notice I know nothing. I already made the changes you and Sparky256 suggested, and it things improved a lot! Now I'm trying to handle the inductive spikes with fast diodes. \$\endgroup\$ – Marcovecchio May 27 '16 at 2:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.