linear1 forums
[part of the linear1 network]
+ [linear1 case mods]
+ [LED Center]
+ [privacy policy]
Welcome, Guest. Please login or register.
March 14, 2010, 01:50:55 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Login Register

linear1 forums  |  LED discussion  |  Microcontroller madness  |  Topic: PIC based boost regulator « previous next »
Pages: 1 [2] Print
Author Topic: PIC based boost regulator  (Read 12637 times)
justDIY
Microcontroller Madman
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1652


UFOric


WWW
« Reply #15 on: December 20, 2005, 04:07:24 PM »

whats odd is their pwm waveform looks very different from mine - I wonder what frequency they are operating at.

they claim to be using the internal pwm hardware same as I, however, they have a clearly defined square wave, where as my wave looks more like a sawtooth (at high frequency).  At low frequency (5khz) my pwm output looks square.

I think the sawtooth was causing my mosfet to overheat - allowing partial conductance as the voltage ramped up pas the threshold level (resistive mode rather than switching mode.)  I tried a weak 47k and a strong 1k pulldown on my mosfet gate, but that did not effect the shape of the wave at all.  I wonder if the fact my switch control wire is approximately 12" long has anything to do with it.

I added an additional feature to my firmware last night - open load detection.   If the circuit reads less than 10mV across the sense resistor, pwm duty cycle is set to 0%, virtually disabling the output.   The shutdown is self resetting, as it will resample within a few microseconds and adjust accordingly.  I need to think about a similar test for over-current / short circuit protection ... if the sampled voltage exceeds a preprogrammed voltage, shut down the switch.   The firmware wouldnt be able to prevent the output capacitors from dumping a massive current spike into the short, but it would stop the switch from trying to refill them.  I wonder what the brief but massive current across the sense resistor would do the A2D inputs on the microcontroller ... they're supposedly internally protected from overvoltage by zener diodes, and the a2d input is a high impedence source, so maybe it wouldn't cause any harm.
Logged

Want to contact me directly? gmail gordonthree
My Project Blog - http://projects.dimension-x.net

Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
SurJector
Smart like tractor
***
Offline Offline

Posts: 107


« Reply #16 on: December 21, 2005, 04:09:51 AM »

whats odd is their pwm waveform looks very different from mine - I wonder what frequency they are operating at.
Unless their 'scope is lying, it's 63kHz.
Quote
they claim to be using the internal pwm hardware same as I, however, they have a clearly defined square wave, where as my wave looks more like a sawtooth (at high frequency).  At low frequency (5khz) my pwm output looks square.  I think the sawtooth was causing my mosfet to overheat - allowing partial conductance as the voltage ramped up pas the threshold level (resistive mode rather than switching mode.)  I tried a weak 47k and a strong 1k pulldown on my mosfet gate, but that did not effect the shape of the wave at all.
It probably depends on the frequency of the internal oscillator. It looks like what mathematicians call Gibbs phenomenon. You cannot eliminate it, you cannot change its amplitude, but you can lower its width. If the frequency of the PIC is high enough with respect to the requested frequency, the PIC probably manages to hide it (by making it vanishingly narrow).
Quote
I wonder if the fact my switch control wire is approximately 12" long has anything to do with it.
Look at any dc/dc convertor datasheet (I like TI's ones, but anyone should be ok), they usually say which traces have to be kept short.
Quote
I added an additional feature to my firmware last night - open load detection.   If the circuit reads less than 10mV across the sense resistor, pwm duty cycle is set to 0%, virtually disabling the output.  The shutdown is self resetting, as it will resample within a few microseconds and adjust accordingly.
That's a good idea, you can have a look at the TPS61000 datasheet, they indicate how to do a "low power mode", that is a refinment of your "open load" mode.
Quote
I need to think about a similar test for over-current / short circuit protection ... if the sampled voltage exceeds a preprogrammed voltage, shut down the switch.   The firmware wouldnt be able to prevent the output capacitors from dumping a massive current spike into the short, but it would stop the switch from trying to refill them.  I wonder what the brief but massive current across the sense resistor would do the A2D inputs on the microcontroller ... they're supposedly internally protected from overvoltage by zener diodes, and the a2d input is a high impedence source, so maybe it wouldn't cause any harm.
I can't tell about the overvoltage protection of the analog inputs, but if they handle it, your existing soft should automagically regulate the current...
Logged
justDIY
Microcontroller Madman
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1652


UFOric


WWW
« Reply #17 on: December 22, 2005, 05:34:07 AM »

whats odd is their pwm waveform looks very different from mine - I wonder what frequency they are operating at.
Unless their 'scope is lying, it's 63kHz.

Very strange ... I messed around with the timer settings on the pwm hardware, and came up with a slightly better looking wave - still nothing like theirs.   and I can't get close to 63khz.  I wonder if different PICs have different levels of quality in the pwm generator.  I'm using a fairly high end device... but perhaps pwm isn't its strong suit.  I have seen the Gibbs effect in the waveform before, little glitches, however... well, a picture is worth 1000 words - standby Wink

Quote
I wonder if the fact my switch control wire is approximately 12" long has anything to do with it.
Look at any dc/dc convertor datasheet (I like TI's ones, but anyone should be ok), they usually say which traces have to be kept short.

I'll be re-breadboarding this in a few days - my power inductors should arrive tomorrow - I actually was able to get one from radio shck of all places, 100uH, 2a, air core - it has made a big difference, oh I got some low ESR tant caps too, my ripple is down to around 25mV now!

I also did away with the timer to perform A2D measurements ... the A2D runs in sync with the pwm now - on the rising edge of the pwm pulse, the a2d interrupt fires.  so the higher my pwm freq, the faster I'll be sampling voltage - originally it was suggested this would help protect the a2d from being corrupted by the current dump of the inductor - however, I'm still seeing large variations in the a2d reading, way beyond the ripple I'm measuring in the output voltage.   These variations are causing the regulator to oscillate between too much and too little current.   I'll wait till I've re-wired it all to diagnose the problem any further.

Logged

Want to contact me directly? gmail gordonthree
My Project Blog - http://projects.dimension-x.net

Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
justDIY
Microcontroller Madman
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1652


UFOric


WWW
« Reply #18 on: December 22, 2005, 07:34:31 AM »

Here are some pictures:

breadboard with 10 led series string, and boost converter circuit:


just the boost converter circuit - here you see the output capacitors, the rectifier (buried under the heatsink), the switch (on the other side of the heatsink) and the inductor


this is the pwm pulsetrain from the PIC ... only 10khz and already not quite square - it looks a lot worse at 20khz


this is the output current, sampled across a 100ohm resistor.   the PP voltage kept jumping around a few millivolts, but its around 40

« Last Edit: December 22, 2005, 07:54:05 AM by justDIY » Logged

Want to contact me directly? gmail gordonthree
My Project Blog - http://projects.dimension-x.net

Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
justDIY
Microcontroller Madman
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1652


UFOric


WWW
« Reply #19 on: December 22, 2005, 09:22:53 AM »

I reduced the sense resistor from 100 to 10 ohms (still too big, but i dot have room to parallel resistors for smaller loads.

The ripple has increased ... a 10 ohm resistor is seeing about 10-12 mV of ripple, where as I was only seeing 30-40mv of ripple on a 100 ohm resistor (for the same current output)

since the sense voltage is now well into the low millivolt range, I setup a voltage divider to feed my adc with +0.5v for the postive refrence.   If I can setup a 0.1 ohm load, I should be able to use 200mv as the postive rail refrence, giving my regulator a max current of 2amps.

so the signal to noise ratio has gotten worse.   however, the noise in the current looks like a harmonic of the 60hz mains freq, it is a nice sinusoidal wave, although I can't seem to pin down its frequency - it is all over the place.

I'm experiementing with filters now - I put a big ferrite choke (like the kind found on data cables), with a single turn of wire on it in series with the output - that has all but eliminated the 'spike' coming from the switch turning on and off.



for all I know, this noise could be from the power supply I'm using for the 5v - its a switch mode supply too, so it's going to have some noise in its output right?
Logged

Want to contact me directly? gmail gordonthree
My Project Blog - http://projects.dimension-x.net

Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
justDIY
Microcontroller Madman
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1652


UFOric


WWW
« Reply #20 on: December 22, 2005, 09:28:59 AM »

I updated my led string to be 10x white leds, so ~30 volts

for output of 30v@25mA, the input current is 5v@1.16A (measured on the 10A scale)

so ...
30 * 0.025 = 0.75
5 * 1.1 = 5.5

unless I messed up my math somewhere, that is some poor efficiency, 5.5 watts in for 750mW out!

the latest efficieny numbers are a bit better, but still pretty bad!

out 30v * 25ma = 0.75w
in 5v * 430mA = 2.15w
« Last Edit: December 22, 2005, 10:34:38 AM by justDIY » Logged

Want to contact me directly? gmail gordonthree
My Project Blog - http://projects.dimension-x.net

Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
Anotherledmember
Guest
« Reply #21 on: December 30, 2005, 03:18:51 AM »

I just completed a 5 channel LCD voltmeter with a PIC16F819 so I could monitor many different cap voltages in once glance.  Then saw this post yesterday and decided to use same code to display the voltage of this Led booster using less channels.  It took a days work but i got it down good.

The PIC, LCD, 5v reg(basic) consume 15mA when LED load is detached.  PIC output signal to drive the darlington switch is another 25mA.  If you base the efficiency by excluding the transistor bias current and considering just switching current alone of 300mA thats 1.5 Watts switching energy in to 1.2 Watts of booster energy out upping the ratio to 80%.  A simple 2n3904 was nearly as good as the darlington. 

Power-Out: 34v*.034A = 1.2 Watts
Power---In: 5v* 0.34A = 1.7 Watts
70.5% Total usage (PIC, LCD, 5v regulator, Load)

In the beginning I used a dummy resistor load at 25v and 30v to draw 25-30mA like you are doing.  But soon as I attached a real 10 while LED load, I noticed the LEDs slightly flickering and persisted reqardless of duty cycle, frequency, and size of storage capacitor.  The current draw of 10 while leds, type 26,000 mcd 5 mm, was only 6mA at 30V!  I know that white LEDs range from 3.2 to 3.8v, so I decided to program the booster to regulate at 34v instead of 30v.  Voila, flicker vanished.  Here is a schematic minus PIC and some vids.
30v Flicker
34v No Flicker + Small Ripple Storage cap 22uF
34v Fast Initial Charge of 220uF + Little Ripple Storage cap 220uF

My code is complex because it deals with converting the A2D to LCD using 16bit math and HEX to Decimal convertion for display.  But the boosting is simple.  Turn on booster, if storage capacitor A2D voltage is > 34v then turn off booster, no adjusting the duty cycle.  When A2D voltage is < 34v turn on booster.  Repeat in infinite loop.  Some where in the infinite loop the LCD display is updated.


* img-schematic-ledbooster34v.gif (15.72 KB, 953x548 - viewed 437 times.)
Logged
justDIY
Microcontroller Madman
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1652


UFOric


WWW
« Reply #22 on: December 30, 2005, 11:05:36 AM »

that is a HUGE inductor you've got there ... makes my 100uH look tiny in comparison - I wonder if the much larger inductor is the source of your increased efficency?

I notice your switching freq was at 1.5kHz ... doesn't that make your inductor whine something awful?  Whenever I'd dip below 10kHz, it was very audible in my inductor.

that is a great improvement in reducing your ripple.   what changes did you make between videos 2 and 3 to smooth your output so much?

what are your thoughts on having this circuit output more than 10 times the current (400-500ma)?  I need to light a series string of 4 white leds, VF = (roughly) 15v ... IF = 450-500mA

Logged

Want to contact me directly? gmail gordonthree
My Project Blog - http://projects.dimension-x.net

Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
Anotherledmember
Guest
« Reply #23 on: December 30, 2005, 02:08:22 PM »

Is the inductor in your attacthment the 100uH?  If so, then the size is the same if not smaller.  Its only 3 cm long with .5 cm diameter ferrite core, coil its self is 2 cm.  I experimented with many inductors and did notice large change is current consumption between them.  Because my high inductance is about 900uH, the 10khz range was not charging pass 25v.  No, 1.5Khz does not make any noise for the inductor in the video, turn up the volume, you will not hear anything.  Yet, other coils did make a low 1.5khz hum.  All the coils a glued strong with cyano-acrylate glue but why did this one not hum?  Tape, 2 layers of masking tape on the ferrite first, then coil windings ontop of that  Cool.  This was a pre-made coil.  I will try using shorter ferrite and thinner wire and see what happens.  I usually make 35-100 watt boosters to charge big cap banks upto to 800v.  Less than 20watts and 100v is new to me.

Increase size of the storage cap from 22uF to 220uF.  Because the scope shows the reduction in ripple, but yet the eyes do not see the difference, a smaller capacitor suffices.  The circuit will put out much more power.  By the way, why do you use them in series anyway?  Parallel is less effort and components for 3.8v leds using a 5v supply.  In the end power is power
Logged
Rob
LED guy
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1970


The constant-current gardener


WWW
« Reply #24 on: December 30, 2005, 11:13:16 PM »

I just want to jump in and note that this is a fantastic thread, hats off to all of you.
Logged

justDIY
Microcontroller Madman
Administrator
Smart like tractor
*****
Offline Offline

Posts: 1652


UFOric


WWW
« Reply #25 on: January 01, 2006, 10:32:46 PM »

By the way, why do you use them in series anyway?  Parallel is less effort and components for 3.8v leds using a 5v supply.  In the end power is power

I see your point, however, for each LED, I'd be spending 600mW in a current limiting resistor, and thats just not very efficient, especially when dealing with a large number of leds (4 is just my starting figure - the objective is about 20)

5v - 3.8v = 1.2v ... 1.2v * 0.5a = 0.6w

I could look at different wiring configurations, but they'd vary depending on how many leds I ended up with.   So, I'm looking at off-the-shelf buck regulators (off-line configuration, 120+ vdc in) or off the shelf boost regulators, 12 vdc in ... or who knows - early drawing board right now Smiley

Logged

Want to contact me directly? gmail gordonthree
My Project Blog - http://projects.dimension-x.net

Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
Anotherledmember
Guest
« Reply #26 on: January 02, 2006, 10:54:42 AM »

Since you can already succefully PMW and controll Leds with a PIC, just PMW the leds and drop resistors.  I PWM the 16 leds in my avatar.
16 Led pwm, 8 Led pwm

Either way is still good.  At least I finally decided to get one of my old projects out and done with from this project.  uC are beautiful because they are so versitile.  A small alter of the code makes a cap charger controller:
High Voltage/Power Booster
Logged
Pages: 1 [2] Print 
linear1 forums  |  LED discussion  |  Microcontroller madness  |  Topic: PIC based boost regulator « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.369 seconds with 22 queries.