Forums

A PIC based boost converter

Started by Jan Panteltje November 22, 2011
A PIC based boost converter

The old design as discussed here last week had problems starting oscillating
with heavy capacitive loads.
The efficiency was only about 50 % too.
The TI super switcher chip is invisibly small and difficult to obtain without
forking out $$$ for shipping and maybe customs.
That left the junk(well its valuable) box.
I already have 2 PICs 18F14K22 in this design, plenty of those around,
why not give it a try>?
These PICs start working at about 1.8 V,
not quite enough to drive a power MOSFET like the IRLZ34N I have,
but just enough to get output...
So I added a diode circuit that supplies the PIC from the 5 V output once it starts.
Used the PIC internal 1 V reference as reference for a voltage comparing diff amp.
The output of that controls the reference level of a cycle by cycle current limiter.
So true current mode.
The PIC's internal comparator is used to stop a PWM cycle.

There will be a second power MOSFET in series with the batteries, controlled by a 'power good'
signal from this same PIC, to completely disconnect the batteries below say 1.9 V
(PIC can measure that with ADC or the other comparator.

I forgot to draw the 100k resistor from gate MOSFET to ground,
to prevent any charge on the gate during power up when the PIC output is tristate,
from shorting the supply.

The trimpot for the output can be a normal voltage divider, but I only had the 100k in the box.
The diagram:
 http://panteltje.com/pub/PIC_current_mode_boost_converter_diagram_img_3222.jpg

The test setup:
 http://panteltje.com/pub/PIC_current_mode_boost_converter_test_setup_img_3221.jpg

Putting all those littel circuits together, and it works.
 http://panteltje.com/pub/ee_spider_was_here_img_3219.jpg

People interested in the PIC software can ask here.

On Tue, 22 Nov 2011 16:56:48 +0000, Jan Panteltje wrote:

> A PIC based boost converter > > The old design as discussed here last week had problems starting > oscillating with heavy capacitive loads. > The efficiency was only about 50 % too. The TI super switcher chip is > invisibly small and difficult to obtain without forking out $$$ for > shipping and maybe customs. That left the junk(well its valuable) box. I > already have 2 PICs 18F14K22 in this design, plenty of those around, why > not give it a try>? > These PICs start working at about 1.8 V, not quite enough to drive a > power MOSFET like the IRLZ34N I have, but just enough to get output... > So I added a diode circuit that supplies the PIC from the 5 V output > once it starts. Used the PIC internal 1 V reference as reference for a > voltage comparing diff amp. The output of that controls the reference > level of a cycle by cycle current limiter. So true current mode. > The PIC's internal comparator is used to stop a PWM cycle. > > There will be a second power MOSFET in series with the batteries, > controlled by a 'power good' signal from this same PIC, to completely > disconnect the batteries below say 1.9 V (PIC can measure that with ADC > or the other comparator. > > I forgot to draw the 100k resistor from gate MOSFET to ground, to > prevent any charge on the gate during power up when the PIC output is > tristate, from shorting the supply. > > The trimpot for the output can be a normal voltage divider, but I only > had the 100k in the box. The diagram: > http://panteltje.com/pub/
PIC_current_mode_boost_converter_diagram_img_3222.jpg
> > The test setup: > http://panteltje.com/pub/
PIC_current_mode_boost_converter_test_setup_img_3221.jpg
> > Putting all those littel circuits together, and it works. > http://panteltje.com/pub/ee_spider_was_here_img_3219.jpg > > People interested in the PIC software can ask here.
Looks interesting. Schematic? -- www.wescottdesign.com
On a sunny day (Tue, 22 Nov 2011 12:25:13 -0600) it happened Tim Wescott
<tim@seemywebsite.com> wrote in
<NZudnd5n5NSUdFbTnZ2dnUVZ_sGdnZ2d@web-ster.com>:
/
>PIC_current_mode_boost_converter_diagram_img_3222.jpg
>Looks interesting. Schematic?
[ ] Related to Obama? 1 [ ] Alzheimer? 1 [ ] what? 1 Tick any or all boxes, add the numbers for your IQ.
On 22 Nov., 17:56, Jan Panteltje <pNaonStpealm...@yahoo.com> wrote:
> A PIC based boost converter > > The old design as discussed here last week had problems starting oscillat=
ing
> with heavy capacitive loads. > The efficiency was only about 50 % too. > The TI super switcher chip is invisibly small and difficult to obtain wit=
hout
> forking out $$$ for shipping and maybe customs. > That left the junk(well its valuable) box. > I already have 2 PICs 18F14K22 in this design, plenty of those around, > why not give it a try>? > These PICs start working at about 1.8 V, > not quite enough to drive a power MOSFET like the IRLZ34N I have, > but just enough to get output... > So I added a diode circuit that supplies the PIC from the 5 V output once=
it starts.
> Used the PIC internal 1 V reference as reference for a voltage comparing =
diff amp.
> The output of that controls the reference level of a cycle by cycle curre=
nt limiter.
> So true current mode. > The PIC's internal comparator is used to stop a PWM cycle. > > There will be a second power MOSFET in series with the batteries, control=
led by a 'power good'
> signal from this same PIC, to completely disconnect the batteries below s=
ay 1.9 V
> (PIC can measure that with ADC or the other comparator. > > I forgot to draw the 100k resistor from gate MOSFET to ground, > to prevent any charge on the gate during power up when the PIC output is =
tristate,
> from shorting the supply. > > The trimpot for the output can be a normal voltage divider, but I only ha=
d the 100k in the box.
> The diagram: > =A0http://panteltje.com/pub/PIC_current_mode_boost_converter_diagram_img.=
..
> > The test setup: > =A0http://panteltje.com/pub/PIC_current_mode_boost_converter_test_setup_.=
..
> > Putting all those littel circuits together, and it works. > =A0http://panteltje.com/pub/ee_spider_was_here_img_3219.jpg > > People interested in the PIC software can ask here.
Looks nice. Just curious, have you taken into account if the PIC runs wild, so it cannot check the voltage or current and will blow the FET? Perhaps add a seperate loop with high priority interrupt routed to a crude check of the output voltage set 10% higher than the nominal value? Cheers Klaus
On Nov 22, 11:56=A0am, Jan Panteltje <pNaonStpealm...@yahoo.com> wrote:
> A PIC based boost converter > > The old design as discussed here last week had problems starting oscillat=
ing
> with heavy capacitive loads. > The efficiency was only about 50 % too. > The TI super switcher chip is invisibly small and difficult to obtain wit=
hout
> forking out $$$ for shipping and maybe customs. > That left the junk(well its valuable) box. > I already have 2 PICs 18F14K22 in this design, plenty of those around, > why not give it a try>? > These PICs start working at about 1.8 V, > not quite enough to drive a power MOSFET like the IRLZ34N I have, > but just enough to get output... > So I added a diode circuit that supplies the PIC from the 5 V output once=
it starts.
> Used the PIC internal 1 V reference as reference for a voltage comparing =
diff amp.
> The output of that controls the reference level of a cycle by cycle curre=
nt limiter.
> So true current mode. > The PIC's internal comparator is used to stop a PWM cycle. > > There will be a second power MOSFET in series with the batteries, control=
led by a 'power good'
> signal from this same PIC, to completely disconnect the batteries below s=
ay 1.9 V
> (PIC can measure that with ADC or the other comparator. > > I forgot to draw the 100k resistor from gate MOSFET to ground, > to prevent any charge on the gate during power up when the PIC output is =
tristate,
> from shorting the supply. > > The trimpot for the output can be a normal voltage divider, but I only ha=
d the 100k in the box.
> The diagram: > =A0http://panteltje.com/pub/PIC_current_mode_boost_converter_diagram_img.=
..
> > The test setup: > =A0http://panteltje.com/pub/PIC_current_mode_boost_converter_test_setup_.=
..
> > Putting all those littel circuits together, and it works. > =A0http://panteltje.com/pub/ee_spider_was_here_img_3219.jpg > > People interested in the PIC software can ask here.
Jan: Nice work!!! I would be interested in the software. Nice drawing quality also! Regards, TomC
Jan Panteltje wrote:

> A PIC based boost converter > > The old design as discussed here last week had problems starting oscillating > with heavy capacitive loads. > The efficiency was only about 50 % too. > The TI super switcher chip is invisibly small and difficult to obtain without > forking out $$$ for shipping and maybe customs. > That left the junk(well its valuable) box. > I already have 2 PICs 18F14K22 in this design, plenty of those around, > why not give it a try>? > These PICs start working at about 1.8 V, > not quite enough to drive a power MOSFET like the IRLZ34N I have, > but just enough to get output... > So I added a diode circuit that supplies the PIC from the 5 V output once it starts. > Used the PIC internal 1 V reference as reference for a voltage comparing diff amp. > The output of that controls the reference level of a cycle by cycle current limiter. > So true current mode. > The PIC's internal comparator is used to stop a PWM cycle. > > There will be a second power MOSFET in series with the batteries, controlled by a 'power good' > signal from this same PIC, to completely disconnect the batteries below say 1.9 V > (PIC can measure that with ADC or the other comparator. > > I forgot to draw the 100k resistor from gate MOSFET to ground, > to prevent any charge on the gate during power up when the PIC output is tristate, > from shorting the supply. > > The trimpot for the output can be a normal voltage divider, but I only had the 100k in the box. > The diagram: > http://panteltje.com/pub/PIC_current_mode_boost_converter_diagram_img_3222.jpg > > The test setup: > http://panteltje.com/pub/PIC_current_mode_boost_converter_test_setup_img_3221.jpg > > Putting all those littel circuits together, and it works. > http://panteltje.com/pub/ee_spider_was_here_img_3219.jpg > > People interested in the PIC software can ask here. >
The problem looks obvious from here. You are using a Xformer by the looks of it for your current sense? That would be fine when there is actual moving current how ever, in the case where output load is nulling this factor, I guess you're not going to see much effects. Is there any reason why you're not using a resistor as the current sense? This would solve the issue of dead headed sag on the output and your PIC can still detect this initial load. Further more, instead of using a PWM output of the PIC, you use a IO output to allow the coil to collapse when sufficient current has been detected. Why maintain current in a saturated field when it's not going to do anything for you except keep a redundant load on your supply? I know that using a ADC for current sense may not be a viable answer since it maybe too slow in response to the saturation point on the coil how ever, if you use a comparator input from a R network that can be clamped lets say from the PWM output and a ADC input to monitor the voltage final output, you can then have your comparator trigger point set by the PWM clamp on the R network going into it. This will remove the need of that error circuit you have and use the ADC for error detect and PWM output for clamping the comparator input to self adjust. I know it's a long winded explanation but that point it, no matter the load effects, with a minimum recovery time set in software you'll always have a successful start. Jamie
On 11/22/2011 6:15 PM, Jamie wrote:
> Jan Panteltje wrote: > >> A PIC based boost converter >> >> The old design as discussed here last week had problems starting >> oscillating >> with heavy capacitive loads. >> The efficiency was only about 50 % too. >> The TI super switcher chip is invisibly small and difficult to obtain >> without >> forking out $$$ for shipping and maybe customs. >> That left the junk(well its valuable) box. >> I already have 2 PICs 18F14K22 in this design, plenty of those around, >> why not give it a try>? >> These PICs start working at about 1.8 V, >> not quite enough to drive a power MOSFET like the IRLZ34N I have, >> but just enough to get output... >> So I added a diode circuit that supplies the PIC from the 5 V output >> once it starts. >> Used the PIC internal 1 V reference as reference for a voltage >> comparing diff amp. >> The output of that controls the reference level of a cycle by cycle >> current limiter. >> So true current mode. >> The PIC's internal comparator is used to stop a PWM cycle. >> >> There will be a second power MOSFET in series with the batteries, >> controlled by a 'power good' >> signal from this same PIC, to completely disconnect the batteries >> below say 1.9 V >> (PIC can measure that with ADC or the other comparator. >> >> I forgot to draw the 100k resistor from gate MOSFET to ground, >> to prevent any charge on the gate during power up when the PIC output >> is tristate, >> from shorting the supply. >> >> The trimpot for the output can be a normal voltage divider, but I only >> had the 100k in the box. >> The diagram: >> http://panteltje.com/pub/PIC_current_mode_boost_converter_diagram_img_3222.jpg >> >> >> The test setup: >> http://panteltje.com/pub/PIC_current_mode_boost_converter_test_setup_img_3221.jpg >> >> >> Putting all those littel circuits together, and it works. >> http://panteltje.com/pub/ee_spider_was_here_img_3219.jpg >> >> People interested in the PIC software can ask here. >> > The problem looks obvious from here.
What "problem"? I don't think Jan mentioned a problem. Good work, Jan. Thanks for a good schematic and pictures as well. Cheers
"Jan Panteltje"  wrote in message news:jagk8l$o1f$1@news.datemas.de...

> A PIC based boost converter
I like to use PICs almost everywhere, and I designed a circuit using a=20 PIC16F616 that took 12 VDC nominal from a battery and produced as much = as 40=20 watts, on a little PCB about 1" x 2.5". It drove a string of up to 13 = high=20 power LEDs in series so the output voltage was close to 50 VDC. But it = had=20 problems with stability and I could only get about 70-80% efficiency at=20 best. A while ago we were discussing the "Joule Thief" circuit, and I played=20 around with LTSpice and I actually built a deadbug circuit about as ugly = as=20 yours, that worked pretty well to light two white LEDs in series from = 1.5=20 volts to 3 volts or so. I don't know how much power you are looking for, or how tightly you need = to=20 regulate the output, but I just put together an LTSpice simulation for a = similar circuit, using only two 2N2222s and a dual winding 100uH = inductor=20 that works down to 1 volt and has efficiency up to 89% at 3 volts, with = an=20 output of 5 VDC nominal into 100 ohms (about 250-360mW). At the very least, this circuit could be used to provide a good voltage = for=20 the PIC and a solid turn-on for a honking big MOSFET. And the whole = thing=20 can be built for less than a dollar, without any programming. I'm going = to=20 use my PICs for more demanding applications. The ASCII file follows, = with=20 the actual figures for output in the text at the bottom . Paul -------------------------------------------------------------------------= ---------------------------------------------------------------- Version 4 SHEET 1 896 680 WIRE 768 -32 144 -32 WIRE -176 0 -224 0 WIRE -112 0 -176 0 WIRE 0 0 -112 0 WIRE 208 0 0 0 WIRE 208 16 208 0 WIRE 0 32 0 0 WIRE 208 112 208 96 WIRE 240 112 208 112 WIRE 464 112 304 112 WIRE 496 112 464 112 WIRE 592 112 496 112 WIRE 672 112 592 112 WIRE -112 128 -112 0 WIRE 672 144 672 112 WIRE -224 160 -224 0 WIRE 0 160 0 112 WIRE 80 160 0 160 WIRE 208 160 208 112 WIRE 288 160 208 160 WIRE 0 176 0 160 WIRE 80 176 80 160 WIRE 288 192 288 160 WIRE 592 192 592 112 WIRE 496 208 496 112 WIRE 208 224 208 160 WIRE 768 224 768 -32 WIRE 0 272 0 256 WIRE 80 272 80 240 WIRE 80 272 0 272 WIRE 144 272 144 -32 WIRE 144 272 80 272 WIRE 672 272 672 224 WIRE 704 272 672 272 WIRE 672 288 672 272 WIRE 0 304 0 272 WIRE -224 384 -224 224 WIRE -112 384 -112 208 WIRE -112 384 -224 384 WIRE 0 384 0 368 WIRE 0 384 -112 384 WIRE 176 384 0 384 WIRE 208 384 208 320 WIRE 208 384 176 384 WIRE 288 384 288 256 WIRE 288 384 208 384 WIRE 304 384 288 384 WIRE 496 384 496 272 WIRE 496 384 384 384 WIRE 592 384 592 272 WIRE 592 384 496 384 WIRE 672 384 672 368 WIRE 672 384 592 384 WIRE 768 384 768 320 WIRE 768 384 672 384 WIRE 176 432 176 384 FLAG 176 432 0 FLAG 464 112 Vout FLAG -176 0 IN SYMBOL npn 144 224 R0 WINDOW 0 43 29 Left 0 WINDOW 3 26 59 Left 0 SYMATTR InstName Q1 SYMATTR Value 2N2222 SYMBOL ind2 16 128 R180 WINDOW 0 36 80 Left 0 WINDOW 3 36 40 Left 0 SYMATTR InstName L1 SYMATTR Value 100=B5 SYMATTR Type ind SYMBOL ind2 192 0 R0 WINDOW 3 37 69 Left 0 SYMATTR Value 100=B5 SYMATTR InstName L2 SYMATTR Type ind SYMBOL res -16 160 R0 SYMATTR InstName R1 SYMATTR Value 220 SYMBOL voltage -112 112 R0 WINDOW 123 0 0 Left 0 WINDOW 39 24 132 Left 0 SYMATTR SpiceLine Rser=3D.1 SYMATTR InstName V1 SYMATTR Value 3 SYMBOL schottky 16 368 R180 WINDOW 0 24 72 Left 0 WINDOW 3 24 0 Left 0 SYMATTR InstName D3 SYMATTR Value 1N5818 SYMATTR Description Diode SYMATTR Type diode SYMBOL schottky 240 128 R270 WINDOW 0 20 73 VTop 0 WINDOW 3 0 32 VBottom 0 SYMATTR InstName D5 SYMATTR Value 1N5818 SYMATTR Description Diode SYMATTR Type diode SYMBOL cap 480 208 R0 SYMATTR InstName C1 SYMATTR Value 10=B5 SYMBOL schottky 304 256 R180 WINDOW 0 24 72 Left 0 WINDOW 3 -20 -2 Left 0 SYMATTR InstName D7 SYMATTR Value 1N5818 SYMATTR Description Diode SYMATTR Type diode SYMBOL cap -240 160 R0 SYMATTR InstName C2 SYMATTR Value 100=B5 SYMBOL cap 64 176 R0 SYMATTR InstName C3 SYMATTR Value .002=B5 SYMBOL res 576 176 R0 SYMATTR InstName R2 SYMATTR Value 100 SYMBOL res 400 368 R90 WINDOW 0 0 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName R3 SYMATTR Value 1 SYMBOL npn 704 224 R0 WINDOW 0 43 29 Left 0 WINDOW 3 26 59 Left 0 SYMATTR InstName Q2 SYMATTR Value 2N2222 SYMBOL res 656 128 R0 SYMATTR InstName R4 SYMATTR Value 4.3k SYMBOL res 656 272 R0 SYMATTR InstName R5 SYMATTR Value 750 TEXT 24 24 Left 0 !K1 L1 L2 1 TEXT -24 416 Left 0 !.tran 15m startup TEXT 296 24 Left 0 ;76% eff at 1.5 VDC, 22 kHz, 4.7V, 241mW output TEXT 296 48 Left 0 ;84% eff at 2 VDC, 25 kHz, 5V, 280mW output TEXT 296 0 Left 0 ;70% eff at 1.0 VDC, 20 kHz, 3.2V, 108mW output TEXT 296 72 Left 0 ;89% eff at 3 VDC, 7.5 kHz, 5.3V, 360mW output=20
Hmm, your current transformer will most likely suffer from drift.  Also, 
if you're only detecting the current peak, it's better to use a CT on the 
MOSFET drain.  This reduces the duty cycle the CT has to sense, and 
therefore maximizes reset time.

The DC drawn through the switch or inductor will tend to saturate the CT. 
To avoid this, use a diode in series with the burden resistor, and a (much 
larger) damping resistor across the CT secondary (typically >1k).  When 
the transistor turns off, the CT inductance produces a flyback pulse 
across the >1k resistor and its flux resets to zero.  If it's shunted by a 
small resistor (the burden, with no diode), the L/R time constant is very 
long and it won't produce correct measurements.

The biggest drawback to boost or flyback is leaving the transistor on.  As 
duty cycle approaches 100%, output voltage increases inversely until, 
suddenly, it stops dead in its tracks at exactly 100%.  This produces a 
short-circuit condition.  Ideally, your circuit should have a failsafe 
condition where, if the MOSFET accidentally gets left on, or it drifts on 
during bootup, it's able to reset it.

Of course, if you add a reset circuit, you probably don't want it to 
remain stuck on, otherwise it just crowbars the thing.  Preferably it 
should re-reset again after a while.

That said, under the most ideal circumstances, you'd have that reset 
circuit so it stays off for a long time if the output voltage is about 
nominal, or stays off only a short time if it's below nominal.  But by 
then, you could eliminate the PIC completely and obtain better efficiency, 
ripple and regulation than any other chip, PIC included, by using all of, 
eight transistors is about enough.

Tim

-- 
Deep Friar: a very philosophical monk.
Website: http://webpages.charter.net/dawill/tmoranwms

"Jan Panteltje" <pNaonStpealmtje@yahoo.com> wrote in message 
news:jagk8l$o1f$1@news.datemas.de...
>A PIC based boost converter > > The old design as discussed here last week had problems starting > oscillating > with heavy capacitive loads. > The efficiency was only about 50 % too. > The TI super switcher chip is invisibly small and difficult to obtain > without > forking out $$$ for shipping and maybe customs. > That left the junk(well its valuable) box. > I already have 2 PICs 18F14K22 in this design, plenty of those around, > why not give it a try>? > These PICs start working at about 1.8 V, > not quite enough to drive a power MOSFET like the IRLZ34N I have, > but just enough to get output... > So I added a diode circuit that supplies the PIC from the 5 V output > once it starts. > Used the PIC internal 1 V reference as reference for a voltage comparing > diff amp. > The output of that controls the reference level of a cycle by cycle > current limiter. > So true current mode. > The PIC's internal comparator is used to stop a PWM cycle. > > There will be a second power MOSFET in series with the batteries, > controlled by a 'power good' > signal from this same PIC, to completely disconnect the batteries below > say 1.9 V > (PIC can measure that with ADC or the other comparator. > > I forgot to draw the 100k resistor from gate MOSFET to ground, > to prevent any charge on the gate during power up when the PIC output is > tristate, > from shorting the supply. > > The trimpot for the output can be a normal voltage divider, but I only > had the 100k in the box. > The diagram: > http://panteltje.com/pub/PIC_current_mode_boost_converter_diagram_img_3222.jpg > > The test setup: > http://panteltje.com/pub/PIC_current_mode_boost_converter_test_setup_img_3221.jpg > > Putting all those littel circuits together, and it works. > http://panteltje.com/pub/ee_spider_was_here_img_3219.jpg > > People interested in the PIC software can ask here. >
On a sunny day (Tue, 22 Nov 2011 14:56:50 -0800 (PST)) it happened Klaus
Kragelund <klauskvik@hotmail.com> wrote in
<fbff1b05-f9be-4778-98f9-1934c90fe618@p16g2000yqd.googlegroups.com>:

>> The diagram: >> &#2013266080;http://panteltje.com/pub/PIC_current_mode_boost_converter_diagram_img.=
>Looks nice. Just curious, have you taken into account if the PIC runs >wild, so it cannot check the voltage or current and will blow the FET?
You need to know a bit more of the PIC hardware. What I use here is a hardware analog comparator. The PWM unit is a hardware counter too. The comparator switches of the PWM in hardware each time the current reaches a preset value. The external diff amp controls this preset value. So it is a true current mode regulator. It would be short circuit proof IF it was not for the boost configuration where the diode would conduct from input to output. So for that in this sort of regulator you need a normal fuse. For the rest of loads it nicely current limits. The only software so far this uses is the initialisation of the chip sub units.
> >Perhaps add a seperate loop with high priority interrupt routed to a >crude check of the output voltage set 10% higher than the nominal >value?
No, you are still thinking software. PICs are great for this sort of thing with all the build in things, counters, PWM unit, UART, reference voltages, DAC, comparators, ADC, internal clock generator, what not. I added a soft start in software that slowly increases the max PWM value allowed after power up. This is done from the timer interrupt. Nothing can go wrong with that, as no timer tick then the PWM stays zero. There is a watchdog and brownout detection too. PICs are cool (use little power).