Universal switchmode PIC?

Universal switchmode PIC? Would this work?

only have enhencement MOSFET in the box: ftp://panteltje.com/pub/PIC_switchmode.jpg

It would be nice if you did not need a different chip for every thing. So, the 16F690, use 2 ADCs as a digital differential amp.

Already thinking about this next PIC project..

12V battery (car) in, 9.2V out 2.5 A for eeePC.

There exists a Microchip applicaton note 00701a.pdf for something similar, but without the idea of the diff ADCs, and without switching in the negative side.

I think this should work... :-)

Reply to
Jan Panteltje
Loading thread data ...

On Jan 31, 11:44=EF=BF=BDpm, Jan Panteltje wrot= e:

Why use a pic when there are so many better smps chips about, you would have to be nuts.

Reply to
cbarn24050

On a sunny day (Sat, 31 Jan 2009 17:06:26 -0800 (PST)) it happened snipped-for-privacy@aol.com wrote in :

No way, are there many better smps chips about, for this application. You are nuts not to see the beauty of an universal solution. And you have no clue about the extra functionality and possibilities a PIC adds to a design it seems. Bet you did not read that application note. And did you ever program a PIC? Or even design a switchmode with discretes?

Chip jockeys that use the first application note for the SMPS chip are no real designers, just copy-rats.

Reply to
Jan Panteltje

On Feb 1, 11:22=EF=BF=BDam, Jan Panteltje wrote= :

Well on you go then, your education will be a long frustating one.

Reply to
cbarn24050

On a sunny day (Sun, 1 Feb 2009 07:03:50 -0800 (PST)) it happened snipped-for-privacy@aol.com wrote in :

I do not think so, desigend my first switch mode around say 1982. Did not kill a single component, calculated and wound my own transformers and inductors, and it was short circuit and overload proof with good regulation too, that was a 24V 10A one. With discretes, 240 V AC in, used H output transistors.

You are so unspecific as to the issue, that it is sad. What technical problem do you expect? and why? What makes you think those cannot be solved using that PIC? Just because *you* cannot do it, that does not mean I cannot do it :-)

Switch mode is easy, a lot less complicated then a TV horizontal deflection

  • EHT stage, of which I have done several long before that, both with tubes and transistor.

So, again, what is the problem?

Reply to
Jan Panteltje

=3D

ng.

If your such an expert why are you asking the question?

A micro is too slow. Your "diff amp" idea wont work because there is only 1 adc so you cant sample both signals at the same time. You have no anti alias filters. Your PIC has nowhere near enough drive current to switch the fet fast enough.

Why would I want to? Why do you want to? Seems like a lot of work to get a very poor result.

Yeh a real breaze, kinda strange why companies keep spending millions comming up with new designs. Maybe you should let them in on the secret.

, a lot less complicated then a TV horizontal deflection

es

Yeh yeh, but did you do it with a pic?

Reply to
cbarn24050

On a sunny day (Sun, 1 Feb 2009 08:07:01 -0800 (PST)) it happened snipped-for-privacy@aol.com wrote in :

Well, wanted to know if anybody actually did it, used it, or had experienced any big pitfalls with it (or PICfalls?).

That all depends on the micro, and on the application. In this case I clearly stated the application was a 12 to 9.2 V stabiliser for my eeePC. PICs can run (this one) at 20MHz. You do not need the full 10 bits to stabilise 9.2V, 8 bits will do, resulting in faster AD conversion.

It will do, because the output voltage change versus time is set by the load current, the switcher current and the value of the output capacitor. Those are knowns, Cout is selectable as is the rest.

It is a simple PID controller, this is actually addressed completely in that application note, including the speed issue and the ADC accuracy.

That is one real concern, I happened to have this MOSFET, and I use it in an other application with PWM from an other type PIC to drive a filament type light bulb. So far it has been working for a few years. I cannot remember what the switching looked like, but must have measured in the long ago past, no red flags there. It is not going to run at 100 kHz, maybe at 16 kHz. We will see.

I want to, because I do not want to order yet an other chip that possibly will be obsolete, I have a bunch of different PICs laying about, I want to use these as much as possible. And the PICs are DIL, and easy to use, as I get old I can no longer see those

1 nano meter pins on some packages :-)

I dunno, companies like Max... make loads of different chips, too bad you cannot buy many of those anywhere. So why? I dunno why.

Switch modes have little secrets, lots of stuff has been published about those.

Chips are sometimes designed perhaps for some huge volume application, and then only suitable for that. If you open LTSpice you will find a lot of those switcher chips, just go for your spec and then there it is not one there that can do it without a lot of external components.

So you may then as well use discrete, or to save parts, the PIC. There is a price issue too, PIC is , a lot less complicated then a TV horizontal deflection

The H osc and driver could be done with a PIC, including the phase discriminator, the sync separator, and some more. Some think PIC and video do not go together, consider this M*cr*V*si*n remover I designed, an 8 pin PIC does removes the crap from a video stream: ftp://panteltje.com/pub/mvp.png So, speed should be an issue here... but it was not, now was it?

In the diagram I published as the original topic, there is something that is a problem: Switching in the negative in a car can make big problems when you touch with ground against metal, the attentive reader should have noticed that. In this case it may need a small transformer to avoid that, or switching in the positive lead..

I am still writing documentation for the release of the other PIC project, it has 3 PWM channels, added many more commands.... It has real time clock in software (no timers), and uses the internal oscillator for that. Added a clock calibration for the users, it will run all night to get a good default value for the release.. Why use no timers? Because the PWM is also in software, and a clock timer interrupt tick would visibly modulate the light (PWM) output. It ran all night last night and was within the minute accurate, good enough for a light change to wake you up, did set the RGB LEDs to 100% at his morning at 8:00. So, one PIC, 3 resistors.

I am not claiming PIC is the solution to everything including the US economy, no, but I am pestering those anti-PICers a bit :-)

Reply to
Jan Panteltje

my eeePC.

current,

application

other

your

can get them locally.

discriminator, the sync

I designed,

problem:

positive lead..

has 3 PWM

oscillator for that.

default

interrupt tick would

a light

no,

I like the idea.

I'll have a try myself. I often have a need for a regulated +12V as well as +5V for the PIC and control electronics. It could be a neat solution saving a second National simple switcher. It would be nice to try and make it do its own +5V.

Reply to
Raveninghorde

I designed a 300kHz switching PSU around an LPC2000 series ARM microcontroller with software controlled voltage and cycle-by-cycle current limit (requires the ADC to take 300ks/s) to save some components and be able to alter current limit and voltage in software. Works like a charm, but I doubt a PIC will like being interrupted at

300kHz. You'll need something with more horsepower.
--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
                     "If it doesn\'t fit, use a bigger hammer!"
--------------------------------------------------------------
Reply to
Nico Coesel

any

my eeePC.

current,

application

other

bulb.

your

external

can get them locally.

discriminator, the sync

I designed,

problem:

the positive lead..

has 3 PWM

oscillator for that.

default

interrupt tick would

for a light

no,

Scary.

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

On a sunny day (Sun, 01 Feb 2009 18:59:24 GMT) it happened snipped-for-privacy@puntnl.niks (Nico Coesel) wrote in :

any

Great, to be able to control current and voltage from a PC for example via RS232, or by some internal program, is a nice feature.

300kHz is a whole lot, maybe 16 kHz will work with a PIC, will have to try. Many PICs have a nice analog comparator, you can program the reference voltage (the divider resistors are on chip), it could measure I, and trigger an interrupt that clears the drive to the MOSFET, not needing such fast sampling. Actually the 16F690 has 2 such comparators on top of 12 analog inputs, and 4 PWM outputs. A programmable battery charger application comes to mind. OTOH I just bought a 7 Euro NiMH charger with 2 Duracel AA batteries at Albert Hein last week. Made in China of course, you cannot beat that :-)
Reply to
Jan Panteltje

any

At 16kHz the inductor will be very large and expensive. A dedicated switcher chip running at >300kHz will be more economic. We are using the TPS6211x from TI a lot (synchronous switching converter). The chip itself isn't particulary cheap but all it takes are 4 MLCC capacitors and an inductor to make a power supply with it (and 2 resistors for the adjustable type). And is has a power good output which eliminates a power supervisor reset chip.

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
                     "If it doesn\'t fit, use a bigger hammer!"
--------------------------------------------------------------
Reply to
Nico Coesel

On a sunny day (Sun, 01 Feb 2009 20:43:18 GMT) it happened snipped-for-privacy@puntnl.niks (Nico Coesel) wrote in :

I will try to do some measurements next week how fast I can get that IRLZ34N MOSFET to switch, oh wait, the datasheet: Max 119 nS reverse recovery time Rise time 100 ns Fall time 29 ns Turn off delay time 21 ns Rdson 46 mOhm Gate on 2V Input capacitance 880 pF (at 0V).

So, the 16F690 specifies absolute max I/O sunk and sourced by any IO pin as 25 mA. Lets sat 10 mA for ease, Q = C x U = I x t, so to get 3 V gate (to make sure it is on), assuming 1000pF gate:

10^-9 x 3 = 10^-2 x t t = 3 x 10^-7 or 300nS

Say 300 nS on and 300nS off. That makes 600 ns, add to that the 100ns rise time, 29 ns fall time, and 21 ns turnoff delay, makes 750 nS, or about 1.4 MHz as absolute max frequency I could drive it with.

Now let's see what a 16F690 PWM output can do according to the datasheet: For a 20 MHz xtal the max PWM frequency is 208.3 kHz with a resolution of 6 bits, 78.8 kHz for a resolution of 8 bits. At 8 MHz 19.6 kHz for 8 bits, 76.9 kHz at 6 bits, and 200 kHz for 5 bits. As I want to use the internal 8MHz osc, I was not far off with 16kHz, will be 19 kHz for 8 bits. What would 6 bits at 76 kHz do? 2^6 = 64, 9.2(Volt output) / 64 = 140mV resolution in output voltage.... mmm. enough for my eeePC, as it has its own regulator, may even get away with 6 bits 76 kHz. Not bad. In fact the question is : hwo fast can it _change_ the PWM timer setting. That is done by doing the ADC twice and then some PID calculation, even slower I think. So it will wobble a few hundred mV around the setpoint a bit with 78 kHz.

I cannot match your 300 kHz, looks like it will have to be 19 kHz. A compromise in inductor size, but still better then I expected :-)

Wow, all that, and I was watching 'die an other day (Bond)' on RTL. Watching time shifted anyways, back to the movie. But first a piece of toast with grilled cheese. hehe After all that math on a Sunday night.

Reply to
Jan Panteltje

Maybe use HYSTERETIC control like the MC33063? You wouldnt need an ADC (I think),you already have the comparators .

Reply to
Hammy

The PIC output sink/source is pretty wimpy but with the wide selection of cheap logic level FET's you don't really need that much. A cheap and simple 2n3904 and 2n3906 totem can always be added to beef up the output drive. It's not like your going to be building a several hundred watt SMPS with a uc. Or a FAN3100 driver there under a buck or there abouts.

Heres a couple of cheap low Qg fast Fets.

STD16NF06LT4 N-channel 60V - 0.060? - 24A - DPAK/IPAK (40 cents cut tape)

formatting link

STN3NF06L N-channel 60 V, 0.07 ?, 4 A, SOT-223 (25 cents cut tape)

formatting link

Reply to
Hammy

mA.

gate:

turnoff delay,

... phssst ... *KABLAM*

bits, 78.8 kHz

19 kHz for 8 bits.

resolution in

I think.

I hope you don't have a pet. 19kHz can drive them crazy.

BTW, I believe there is an app note somewhere on how to make a converter with a PIC. The hardware is simple but it also talked about the code.

--
Regards, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Reply to
Joerg

Microchip ========= AN216 - DC-DC Converter Controller Using a PICmicro Microcontroller AN701 - Switch Mode Battery Eliminator Based on a PIC16C72A AN874 - Buck Configuration High-Power LED Driver 50310

There might be others.

Cheers, James Arthur

Reply to
James Arthur

Hysteretic will give you much faster control and cycle-by-cycle current limit.

Why use a PIC, perhaps the PSoC is an better choice. You can wind the entire controller around dedicated HW, so you only need some PID interrupt loop. Moreover, most other analog circuits can be embedded into that device also so you really have minimum external parts

Regards

Klaus

Reply to
Klaus Kragelund

On a sunny day (Sun, 01 Feb 2009 18:09:28 -0800) it happened Joerg wrote in :

Not at 19kHz

Well TeeVee was always at 15625 Hz, and the animal lobby is not known to have been shooting at screens..... I did hear[] about a canary bird dying in a room with a TV. But birds die in other places too, lack of evidence.

Yes I referred to that in my original posting. It is AN701.pdf, use google.

Reply to
Jan Panteltje

On a sunny day (Sun, 01 Feb 2009 20:25:36 -0500) it happened Hammy wrote in :

Nice, 1V Vgs on!

Bit higher Vgs on worst case.

Reply to
Jan Panteltje

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.