Maker Pro
Maker Pro

Switching power supply behavior

S

Scott Miller

Jan 1, 1970
0
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
 
J

John Popelish

Jan 1, 1970
0
Scott said:
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.

Sounds like a very interesting and educational project.
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.

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?
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?

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

Sounds reasonable.
The difficulty there is in knowing at what
point to sample the voltage, relative to the PWM signal.

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

Anything like this, the micro can do better.
 
S

Scott Miller

Jan 1, 1970
0
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
 
K

Ken Smith

Jan 1, 1970
0
Scott Miller said:


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

John Popelish

Jan 1, 1970
0
Scott said:
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

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

John Popelish

Jan 1, 1970
0
Scott said:
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

One other important parts question. What sort of transformer is T1?
 
S

Scott Miller

Jan 1, 1970
0
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.

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.
Also, D2 has some capacitance. This adds another bit of charge that will
be sucked out of C6 at the edge of the waveform.

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?
If you delay turning the transistor back on until the current in the
transformer has stopped, the effect can be reduced.

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

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

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
 
S

Scott Miller

Jan 1, 1970
0
Thank you. Can you tell me what kind of diodes D1 and D2 are, and
what are the values of C5 and C6?

D1 and D2 are 1N4007's, C5 C6 and C9 are 0.0022 uF.
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.

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
 
J

John Popelish

Jan 1, 1970
0
Scott said:
D1 and D2 are 1N4007's, C5 C6 and C9 are 0.0022 uF.

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

As long as the peak drain voltage goes no higher than about 50 or 60
volts. but you should check this with a scope.
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.

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

Scott Miller

Jan 1, 1970
0
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

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.
As long as the peak drain voltage goes no higher than about 50 or 60
volts. but you should check this with a scope.

Yeah, I'll have to check how high it's going. Hasn't started smoking yet,
anyway. =]
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.

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
 
N

Nico Coesel

Jan 1, 1970
0
Scott Miller said:
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:


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?

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

Ken Smith

Jan 1, 1970
0
Scott Miller said:
Hadn't thought about that, but it makes sense. Is this going to be
temperature-sensitive?

Yes, a bit. At higher temperatures, the recovery time usually gets a bit
longer and the corners in the curve get a bit rounder.
sort of diodes are available at this voltage that'd perform better, or does
it really matter? The diodes are currently 1N4007s.

1N4007 is about the worst one on the market. You want a diode that is
"fast recovery" or "high speed"

The spec sheet puts it at 15 pf. I'm currently using 22,000 pf capacitors
for C5, C6, and C9.

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

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

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

Ken Smith

Jan 1, 1970
0
John Popelish said:
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.

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

Ken Smith

Jan 1, 1970
0
Scott Miller said:
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.

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

Ken Smith

Jan 1, 1970
0
Nico Coesel said:
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.

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

Scott Miller

Jan 1, 1970
0
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.

So would a higher ESR help reduce the effect?
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.

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

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

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
 
J

John Popelish

Jan 1, 1970
0
Ken said:
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.

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

Agreed.
 
J

John Popelish

Jan 1, 1970
0
Scott said:
One other important parts question. What sort of transformer is T1?

Umm... blue and green? =] I'm using this one:

http://www.goldmine-elec-products.com/prodinfo.asp?number=G13599&variation=&aitem=8&mitem=24

I really don't know its specifications.

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

Fred Bloggs

Jan 1, 1970
0
Scott said:
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'.

Didn't we tell you how to dump that asinine MOV crap in a previous
thread you started about this p.o.s.? -PLONK
 
Top