A PIC based boost converter

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:
formatting link

The test setup:

formatting link

Putting all those littel circuits together, and it works.

formatting link

People interested in the PIC software can ask here.

Reply to
Jan Panteltje
Loading thread data ...

Looks interesting. Schematic?

--
www.wescottdesign.com
Reply to
Tim Wescott

On a sunny day (Tue, 22 Nov 2011 12:25:13 -0600) it happened Tim Wescott wrote in : /

[ ] Related to Obama? 1 [ ] Alzheimer? 1 [ ] what? 1

Tick any or all boxes, add the numbers for your IQ.

Reply to
Jan Panteltje

ing

hout

it starts.

diff amp.

nt limiter.

led by a 'power good'

ay 1.9 V

tristate,

d the 100k in the box.

..

..

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

Reply to
Klaus Kragelund

ing

hout

it starts.

diff amp.

nt limiter.

led by a 'power good'

ay 1.9 V

tristate,

d the 100k in the box.

..

..

Jan:

Nice work!!! I would be interested in the software.

Nice drawing quality also!

Regards, TomC

Reply to
tomcee

starts.

amp.

limiter.

by a 'power good'

1.9 V

tristate,

100k in the box.

formatting link

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

Reply to
Jamie

formatting link

What "problem"? I don't think Jan mentioned a problem.

Good work, Jan. Thanks for a good schematic and pictures as well.

Cheers

Reply to
John S

"Jan Panteltje" wrote in message news:jagk8l$o1f$ snipped-for-privacy@news.datemas.de...

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

Reply to
P E Schoen

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:

formatting link

formatting link

Reply to
Tim Williams

On a sunny day (Tue, 22 Nov 2011 14:56:50 -0800 (PST)) it happened Klaus Kragelund wrote in :

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.

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

Reply to
Jan Panteltje

On a sunny day (Tue, 22 Nov 2011 15:45:52 -0800 (PST)) it happened tomcee wrote in :

formatting link

Please note this was assembled with gpasm in Linux. I do not use mplab, and it probably needs editing for mplab to accept it.

There is a lot of routines in that source that I always put in for debugging, you can connect to it via RS232 and type h for help. You can set the maximum PWM value via this serial link (115200 Bd). You can type 's' for status (of the max PWM only I think ATM).

Look for the label int_8: for the slow start routine that increases PWM until the maximum specified value is reached.

Late last night I activated comparator 1 for use as power good detector, and that part is not tested, also the relevant I/O pins were changed (TRIS). Pinout assigment is listed around line 460. comparator 1 enable is around line 820, so maybe clear that bit.

When the power good is implemented I may release that source too. The idea is also to be able to read the battery and output voltage via the serial link, for this reason there is a BATTERY_VOLTAGE define for analog input channel on the same point that uses comparator 1 for battery sense, not implemented yet.

But anyways, this soft should work in the published diagram. Should get you going.

If questions ask.

Reply to
Jan Panteltje

On a sunny day (Tue, 22 Nov 2011 19:15:07 -0500) it happened Jamie wrote in :

It works fine.

Sorry I cannot decrypt that. Study switch mode design.

Efficiency.

???? Lost you here.

Reply to
Jan Panteltje

On a sunny day (Tue, 22 Nov 2011 18:36:46 -0600) it happened John S wrote in :

formatting link

formatting link

Thanks. :-)

Reply to
Jan Panteltje

On a sunny day (Tue, 22 Nov 2011 20:57:35 -0500) it happened "P E Schoen" wrote in :

Yes, that will work, but: The output regulation will be inferior, depend on the Vbe temperature drift multiplied by Uout / .7, there is no clear current limit, there is also some power loss in the 1 Ohm resistor.

Mine has a RS232 interface, exact reference, no temp drift, will have a 100% battery switch off MOSFET added.

I must say, that going for a simpler design is not always the best solution.

The reason I threw out that other thing is that it would not start reliably with huge capacitive loads (and then overheat the transistor). Think 2700 uF (in the scintillation probe). Maybe yours will start because of that resistor current limit. But also with an expensive LCD, 2 more PICs powered from it, plus a HV generator, plus pre-amp, I need quiet (smooth ripple), accurate (voltage regulation), no thermal drift (data acquisitions can take up to 24 hours). And full battery protection against over-discharge. My design can do that. Further more the RS232 status is used in all the PICs (they talk with each other), and allows for remote control and debugging, also data-logging.

I dunno about 'instabilities' with PICs, one point where I would really have seen instabilities is my 3 PIC LED light controller with ethernet interface. So far none. Also there the PICs talks to each other via RS232. As you know the SPI hardware unit in the 18F14K22 does not work as advertised, so I did that in software. I have not seen any instabilities in any of the other PIC designs either. And I am not payed by Microchip to say this.

Reply to
Jan Panteltje

On a sunny day (Tue, 22 Nov 2011 21:38:22 -0600) it happened "Tim Williams" wrote in :

Any drift in the current transformer is regulated out by the output voltage sense loop. The current form is the current form in the inductor, and that is a TRIANGLE waveform, not a peak. As drawn in the diagram.

There is no difference with the drain current, as the comparator looks at the top of the upgoing side of the triange. Remember that when the MOSFET is on, there is NO current into the output diode, everything goes into the inductor to build up field.

Reply to
Jan Panteltje

If that is the case, what is the added value of the PIC? If you want to do PWM with a micro at least make the control loop in software so you can control overshoot, load regulation, fold-back current limiting, power reduction based on the temperature of the power stage, etc, etc.

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
nico@nctdevpuntnl (punt=.)
--------------------------------------------------------------
Reply to
Nico Coesel

On a sunny day (Wed, 23 Nov 2011 14:15:59 GMT) it happened snipped-for-privacy@puntnl.niks (Nico Coesel) wrote in :

allowed

Well, slow start for a start, remote control of parameters, remote measuring of now: battery voltage output voltage

Less eye strain as not to have to solder a 3 mm^2 chip, no shipping costs, no 12 Euro 50 custom handling costs,

****no time lost****, I have the PICs,

I know you do not like PICs, you have made that very clear. But I like them and I have plenty of soft for it. So development is very fast. To do the temp thing you mention only takes a few extra lines of code and a LM335 sensor. Or use a 8 pin PIC as sensor. But in this case there is no overheating expected so why bother. I would like to see you do foldback current limiting in a boost converter of this type

in --- L ---- diode --- out | switch | /// Hey? Foldback diode? I use a fuse.

PICs are nice, and as main() is free here, it can do other things I think of.

Reply to
Jan Panteltje

starts.

amp.

limiter.

a 'power good'

V

tristate,

100k in the box.

formatting link

A PIC with a dual-input ADC and a lot of software would be interesting. You can, in principle, measure the DC input and output voltages and compute everything you need: core flux, output overload, feedforward, all that stuff. You could even compute a rough estimate of output current. That would be a minimum-parts solution for a potentially programmable boost supply. A small PIC or ARM could cost less than a high-quality analog boost converter chip.

Your schematics keep getting better! I think of hand-drawn schematics as an art form, worth making elegant. Breadboards can be an art form too, hint hint.

Here's my HV boost breadboard, gate drive from an FPGA:

ftp://jjlarkin.lmi.net/HV_proto.JPG

which it turns out I didn't use. The ISDN transformer and doubler, parasitic to my main inverter driver, was easier.

John

Reply to
John Larkin

I updated the asm, and also made a small modification to the diagram / hardware:

As the power-up at low input voltage depends on the Vgs of the MOSFET used, I thought it would be cute to help MOSFET a bit by pre-biasing.

| L | |------ |>|------------ +5 470 nF |-- | PWM from PIC ---||---------------------------||-- IRLZ34N | | | |--| | --- [ ]100k | [ ] 680 Ohm / \ | /// | si diode --- /// | | | | | ---------------------------------| | +2V --- / \ / / LED green on output --- / | ///

This is a clamp circuit, that keeps the bottom of the PWM signal a bit above ground, but never more than about +1.3 V. This centers the PWM from the PIC at the gate closer to the Vgs on, resulting in the circuit starting at a lower input voltage < 1.8V, but 1.9V guaranteed. The LED was already there as signal that output was OK. Make sure you use a LED with 1.5 to 2 V voltage drop, but not more, as then the MOSFET could be permanently 'on'. Different MOSFET (and also production spread, require different parameters. If you use a MOSFET with a Vgs on of about a volt all this will not be needed.

I updated the software, de-activated BOR reset, was in there for test, Added and tested the power good comparator, input is a 1:1 resistor attenuator on pin 15 (

Reply to
Jan Panteltje

snip

I remember seeing some put a cap in series with the diode to make it short circuit proof

-Lasse

Reply to
langwadt

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.