Forums

A PIC based boost converter

Started by Jan Panteltje November 22, 2011
On a sunny day (Tue, 22 Nov 2011 15:45:52 -0800 (PST)) it happened tomcee
<tomcees_pc@yahoo.com> wrote in
<849d8670-56db-43d8-9c2d-19859c5c2d2e@h42g2000yqd.googlegroups.com>:

>On Nov 22, 11:56&#2013266080;am, 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: >> &#2013266080;http://panteltje.com/pub/PIC_current_mode_boost_converter_diagram_img.= >.. >> >> The test setup: >> &#2013266080;http://panteltje.com/pub/PIC_current_mode_boost_converter_test_setup_.= >.. >> >> Putting all those littel circuits together, and it works. >> &#2013266080;http://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
http://panteltje.com/pub/sc2_pwr-0.1.asm 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.
On a sunny day (Tue, 22 Nov 2011 19:15:07 -0500) it happened Jamie
<jamie_ka1lpa_not_valid_after_ka1lpa_@charter.net> wrote in
<cUWyq.117643$Cr1.1733@newsfe03.iad>:

>The problem looks obvious from here.
It works fine.
> 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.
Sorry I cannot decrypt that. Study switch mode design.
> Is there any reason why you're not using a resistor as the current >sense?
Efficiency.
>This would solve the issue of dead headed sag on the output and >your PIC can still detect this initial load.
???? Lost you here.
On a sunny day (Tue, 22 Nov 2011 18:36:46 -0600) it happened John S
<sophi.2@invalid.org> wrote in <jahf71$icj$1@dont-email.me>:

>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
Thanks. :-)
On a sunny day (Tue, 22 Nov 2011 20:57:35 -0500) it happened "P E Schoen"
<paul@pstech-inc.com> wrote in <qqYyq.30323$pt2.7874@newsfe18.iad>:


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.


On a sunny day (Tue, 22 Nov 2011 21:38:22 -0600) it happened "Tim Williams"
<tmoranwms@charter.net> wrote in <jahpso$p23$1@dont-email.me>:

>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.
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.
Jan Panteltje <pNaonStpealmtje@yahoo.com> wrote:

>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? > > >> >>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.
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=.) --------------------------------------------------------------
On a sunny day (Wed, 23 Nov 2011 14:15:59 GMT) it happened nico@puntnl.niks
(Nico Coesel) wrote in <4eccffa5.103499359@news.kpn.nl>:

>>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. > >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.
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.
On Tue, 22 Nov 2011 16:56:48 GMT, Jan Panteltje
<pNaonStpealmtje@yahoo.com> 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.
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
On 23 Nov., 12:08, Jan Panteltje <pNaonStpealm...@yahoo.com> wrote:
>
snip
> 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.
I remember seeing some put a cap in series with the diode to make it short circuit proof -Lasse
On a sunny day (Wed, 23 Nov 2011 08:39:31 -0800) it happened John Larkin
<jjlarkin@highNOTlandTHIStechnologyPART.com> wrote in
<vk7qc7l97atu6smqkmthftjn5rs1vg7emj@4ax.com>:

>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.
This is sort of what I have been doing today, see my other posting, this PIC has several 10 bit ADC channels, and 2 hardware comparators. So I have now input and output voltages, I can also control the output voltage as I use the PIC DAC output as reference. It has a stable programmable internal reference too (1.024 V, x2, x4).
>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.
I like the RS232 interface, you do not normally see that on switcher chips :-)
>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.
Thank you. Yes, this will, once the final circuit is determined, go on those little eurocards with holes. I have build a lot of stuff like this, spider web, we call it 'haystack', but I try to stay in 2 dimensions, even did a short wave receiver that took a whole table top, with CA3020 diff amps and CA3028 audio amp, or was it the other way around, XF9B crystal 9 MHz filters. Was a VERON (radio amateur club) design, I improved it a bit with better input stage. That thing was incredibly sensitive, took it apart again when it worked, just a fun experiment.
>Here's my HV boost breadboard, gate drive from an FPGA: > >ftp://jjlarkin.lmi.net/HV_proto.JPG
It looks really nice, dremel work? That is nice for RF.
>which it turns out I didn't use. The ISDN transformer and doubler, >parasitic to my main inverter driver, was easier. > >John