Connect with us

Switching power supply behavior

Discussion in 'Electronic Design' started by Scott Miller, Jan 8, 2005.

Scroll to continue with content
  1. Scott Miller

    Scott Miller Guest

    I'm mostly a digital guy, so building a high voltage supply for a Geiger
    counter has been an educational experience. For the sake of component
    reduction, my first version used a PWM output from the microcontroller to
    drive the FET on the primary of a transformer, rather than an external
    oscillator. I used a shunt regulator (made of MOVs or zeners) to regulate
    the output at 500 volts. But having the MCU capable of controlling the
    supply naturally led me to experiment with using it as a more intelligent
    controller.

    But like I said, I'm a digital guy and I don't understand all of what I'm
    seeing. My HV output and PWM control signals look like this:


    ^ ^
    -----+ / +--___ / +-------
    \ / +-+
    \ /
    \ /
    +____+



    -----+ +---------+
    | | |
    | | |
    | | |
    | | |
    | | |
    +-----------------------+ +

    Hopefully that came out right. As the primary is energized, I see the
    output overshoot a bit and then stay level. When the primary is shut off,
    it drops rapidly and then rises again, slightly overshooting and then
    leveling out. It continues a slow decline and then repeats at the next
    pulse. I wasn't expecting the drop - I was planning for the output
    capacitor to keep the voltage up, but I must have it configured wrong.

    Anyway, I guess I don't really understand the behavior of the transformer
    that well. In electronics class we just fed them continuous AC and expected
    AC out - can anyone point me to a good explanation of their behavior with
    square waves like this?

    Also, my next problem is getting feedback into the MCU for control. To me,
    the obvious approach was to use a voltage divider and send the output into
    an ADC port for measurement. The difficulty there is in knowing at what
    point to sample the voltage, relative to the PWM signal. Is there any
    reference available that describes how this should be done? I think I
    probably need to examine how it behaves on start-up, before the target
    voltage is reached.

    Another possible approach is to use zeners or MOVs on the output to drive a
    BJT that kills the PWM input at the primary. I'm not exactly sure how that
    will behave, if it starts cutting it off in the middle of a cycle.

    Fortunately a bit of overshoot in the output voltage isn't critical in this
    application. At least with a halogen-quenched GM tube, it should just break
    down and conduct any excess voltage. It'll screw up your reading but won't
    kill the tube. I think it'd shorten the lifespan of an organically-quenched
    tube, but I'm not using those so I'm not really worried.

    Again, this is mostly just an educational excercise. This project offers an
    interesting opportunity to get right into the guts of a switching regulator,
    but having little background in this I'm kind of lost. Any comments or
    suggestions?

    Thanks,

    Scott
     
  2. Sounds like a very interesting and educational project.
    Without knowing at least the general configuration you are working
    with, these mean very little to me. Is there someplace you can post a
    schematic (web page, alt.binaries,schematics.electronic) or email to
    me?
    Transformers can either be used primarily as a turns ratio controlled
    coupling mechanism (what you are talking about) or an energy storage
    mechanism (the primary coil loads energy into the magnetic field when
    the switch is on and dumps that energy out the secondary when the
    switch is off). There are lots of variations with each concept, hence
    the need to see your schematic before wasting lots of time
    speculating.
    Sounds reasonable.
    As you said, earlier, the output capacitor should smooth the voltage
    well enough that this is not very critical, though some places in the
    cycle may have lower noise.
    Anything like this, the micro can do better.
     
  3. Scott Miller

    Scott Miller Guest

    Here's the schematic, minus the regulation experiments. The LCD has been
    reconfigured to free up PTB3/ADC3 for feedback input. The configuration I'm
    testing at the moment has the MOVs driving a 2N3904 connected to PTB3. The
    idea is to use that to detect when the voltage is at the required level.
    That input is checked 3200 times per second and the PWM output is switched
    on or off. Right now, the behavior could best be characterized as 'freaking
    out'.

    http://n1vg.net/geiger/images/gc1-9v.png

    Thanks,

    Scott
     
  4. Ken Smith

    Ken Smith Guest


    Lets look at this part:

    Your circuit uses a doubler output section like this:

    C5 D2
    ---!!----+--->!-----+-----
    ! !
    ---D1 --- C6
    ^ ---
    ! !
    GND GND

    At the voltages you are doing D2 is unlikely to be a Schottky diode. When
    current flows in a normal diode, minority carriers pass through the
    silicon (electrons in the P material and holes in the N). When the
    voltage suddenly reverses, the carriers that are "stored" in the silicon
    have to be swept out before the diode's impedance gets high.

    The shape you reported looked quite a bit like the shape that this current
    would make on the ESR of C6.

    Also, D2 has some capacitance. This adds another bit of charge that will
    be sucked out of C6 at the edge of the waveform.

    If you delay turning the transistor back on until the current in the
    transformer has stopped, the effect can be reduced.

    You could also add a transistor's E-B in series with the D10, that is part
    of the clamping circuit. The collector of this transistor could, via som
    resistors tell the micro when the clamp circuit is acting as anothe way to
    get feedback to the micro.

    The Q3 circuit using the MPF102 looks a bit funny to me. You are relying
    on gate leak bias to bias a JFET off. You may want to think again about
    this part of the circuit.
     
  5. Thank you. Can you tell me what kind of diodes D1 and D2 are, and
    what are the values of C5 and C6?

    This is a strange sort of step up supply, what with the full wave
    doubler using both swings from the transformer, but the primary driven
    only one way.
     
  6. One other important parts question. What sort of transformer is T1?
     
  7. Scott Miller

    Scott Miller Guest

    At the voltages you are doing D2 is unlikely to be a Schottky diode. When
    Hadn't thought about that, but it makes sense. Is this going to be
    temperature-sensitive? i.e., is it going to get noticealby worse if it gets
    several degrees hotter and generates more minority carriers? What other
    sort of diodes are available at this voltage that'd perform better, or does
    it really matter? The diodes are currently 1N4007s.
    The spec sheet puts it at 15 pf. I'm currently using 22,000 pf capacitors
    for C5, C6, and C9. Is this effect going to be small compared to the
    minority carrier effect? What parameters in the spec sheet are relevant to
    this kind of behavior?
    The timing on the transformer was determined experimentally. I tweaked the
    frequency until I got the peak output voltage, and reduced the duty cycle to
    the lowest level that'd keep C9 charged. Is there a better way to go about
    determining these settings?
    Yeah, that's exactly what I'm trying now. I think I've got a problem with
    the software switching of the PWM module, though. I need to set it to
    buffered mode or it does strange things.
    You're right, that wasn't supposed to be like that. That part started out
    as a merger of two different designs, then a simplification that removed a
    number of parts. About one part too many, by the looks of it. =] I think
    there was supposed to be another 100k to ground on that side of the
    capacitor. It does actually work, though - I've tested it up to 30,000
    counts/minute. Anyway, I'm thinking of re-doing the whole detector section.
    Seems like the better designs ground the cathode of the GM tube and detect
    the pulses on the high side. That means making C11 a HV cap, and
    redesigning the amplifier. I'm at a bit of a loss there, but I'm working on
    it. The only example I have to go by with that configuration is a late
    1950's or early 1960's design. I have no idea what a '1437' transistor
    is... I've found some cross-references, but it's hard to tell if it's the
    same thing.

    Thanks,

    Scott
     
  8. Scott Miller

    Scott Miller Guest

    Thank you. Can you tell me what kind of diodes D1 and D2 are, and
    D1 and D2 are 1N4007's, C5 C6 and C9 are 0.0022 uF.
    Hmm, don't ask me... I cribbed that from this design -
    http://www.cbtricks.com/members/AB7IF/bgc/bgc_page2.gif - or one like it.
    I've seen the same design a few times. I substituted the BS170 FET for an
    obsolete BJT on the primary - seems to work just as well.

    Seems to me that the supply doesn't need to be terribly efficient, because
    if you do it right it'll have a low duty cycle. C9 stays charged for a long
    time at normal radiation levels. It'll draw maybe 100 uA every count for a
    very short period - under 100 usec, I think. With the tubes I'm using,
    normal background radiation is around 20 counts/minute.

    Anyway, like I said, we learned about driving transformers with AC.. I don't
    know exactly what the secondary output is supposed to look like when the
    primary is driven only one way with a square wave.

    Scott
     
  9. It is hard to find diodes that have both high reverse voltage
    capability and also fast reverse recovery. You should see
    considerable improvement if you replaced the 1N4007 with something
    like UF1007 (available from Digikey):
    http://www.diodes.com/datasheets/ds25002.pdf
    As long as the peak drain voltage goes no higher than about 50 or 60
    volts. but you should check this with a scope.
    Something to keep in mind about any inductive components:
    They average zero volts, long term.

    So the windings of this transformer have to have equal voltage times
    time swinging one way to match the voltage times time they swing the
    other way.

    How long times how far depends on the on time of your switch each
    cycle.

    But before you get into controlling the duty cycle, you need faster
    diodes in the rectifier so that their reverse recovery does not suck
    back all the charge they put into the output capacitor each cycle.
     
  10. Scott Miller

    Scott Miller Guest

  11. Scott Miller

    Scott Miller Guest

    It is hard to find diodes that have both high reverse voltage
    Thanks, I'll pick up a few of those with my next Digikey order. I can't
    find any reverse recovery time info for the 1N4007, but it'll be interesting
    to see how it compares.
    Yeah, I'll have to check how high it's going. Hasn't started smoking yet,
    anyway. =]
    Right. This is turning out to be a really educational project. I'll have
    to go do some research on the voltage times time thing... I'm sure I learned
    that at some point, but I find I remember things a lot better when I can put
    them to some practical use, and last time I came across it it would have
    been just theory in a book.

    Another question - with such a small load, it seems to me that leakage in C9
    should be a major concern. I'm using 1kv metallized polypropylene caps
    right now - is there anything else that'd have less leakage?

    Thanks...

    Scott
     
  12. Nico Coesel

    Nico Coesel Guest

    Try to simulate it. Some of the shareware sites still carry a trial
    version of Microsim called Winspice. It will only allow a limited
    number of components, still more than enough to simulate these sort of
    circuits.
     
  13. Ken Smith

    Ken Smith Guest

    Yes, a bit. At higher temperatures, the recovery time usually gets a bit
    longer and the corners in the curve get a bit rounder.
    1N4007 is about the worst one on the market. You want a diode that is
    "fast recovery" or "high speed"

    Remember it is the ESR of the capacitors not their capacitance that
    matters most to what the diode capacitance is doing. The storage effect
    has most of the longer term effect. The capacitance increases the
    sharpness of the output edges that happen when the transformer's voltage
    swings up and down.
    Yes, there are better ways. If you are regulating the voltage by means
    of a servo loop that controls the duty cycle, you don't need to adjust the
    frequency for the highest voltage. I'd be inclined to adjust for the
    lowest supply current to maximize the battery life.
    I can offer but little help there. I don't use PICs. The basic thing to
    check is what happens to the current cycle's pulse width if it ends just
    as you are updating the registers.
    I don't know that this matters in your case. The gain of the tube is very
    voltage dependant. You are only counting pulse not measuring how big they
    are so a slight gain shift shouldn't matter. I think you can safely leave
    the detection on the cathode end.
     
  14. Ken Smith

    Ken Smith Guest

    I've used this same basic design for the output several times. It isn't
    all that strange. As far as PWM regulation goes, it is a flyback design.
    The doubler means that the output has N*Vin added to it.

    Normally, in a flyback design, the primary has a current ramp in it. When
    you add the doubler to the output, this changes. The doubler causes a
    larger current to flow just as the transistor switches on. This added
    current tails away as time passes and the output side capacitor gets
    charged. This decreasing current tends to cancel the slope of the
    normally increasing current seen in the primary.

    The OP isn't using current mode control so this doesn't mess up his
    current sensing.

    The flatter current wave form has a lower RMS to average ratio so the
    losses in the pass transistor can be less with this circuit that would be
    the case for just a flybacker.
     
  15. Ken Smith

    Ken Smith Guest

    You can make the circuit in LTSpice and study the effects of various
    modifications without smoking real parts.


    The transformer is two inductors with a coupling K between them.
     
  16. Ken Smith

    Ken Smith Guest

    www.linear.com has a spice that is free, unlimited, easy to use, nearly
    bug free, and much faster than most of the others. Look for "switcher CAD
    III". Although Linear started out with this just intended to help in the
    design of switchers, the software is a complete general purpose spice.

    It has some "hacks" in it that makes it able to handle switching circuits
    more quickly than normal spices. This is doubly true if you use their
    feature of imbedding the resistance and capacitance right into inductors
    rather than adding parts to the model to handle them.
     
  17. Scott Miller

    Scott Miller Guest

    Remember it is the ESR of the capacitors not their capacitance that
    So would a higher ESR help reduce the effect?
    It's been a couple of years since I did the original version, but I think I
    just assumed that the peak voltage would indicate the most efficient use of
    the transformer.
    This part at least is no problem... I can handle the digital stuff. I know
    exactly what happens when you write to the PWM register at the wrong time.
    I've got another project that generates phase continuous audio frequency
    shift keying using the same chip - this application should be a lot easier.
    I've just seen references to the grounded cathode design providing for
    proper shielding and grounding. Not sure how important it really is. My
    only problem with detecting the pulses on the anode side is finding a
    transistor that'll handle the higher voltage. I think.

    Scott
     
  18. As I said, it can be regulated as long as the N*Vin is considerable
    less than the desired voltage, so that adjusting the flyback voltage
    component is enough.
    Agreed.
     
  19. Well, it is certainly cute.
    At least it appears to have a ferrite core. Do you have an
    oscilloscope or any other means to measure the turns ratio?

    It appears to be a reasonable guess at a device for your purposes (if
    it is designed for the purpose described on the page).
     
  20. Fred Bloggs

    Fred Bloggs Guest

    Didn't we tell you how to dump that asinine MOV crap in a previous
    thread you started about this p.o.s.? -PLONK
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-