microprocessor controlled SMPS

F

Frithiof Andreas Jensen

Jan 1, 1970
0
Agree, Tim. Even an RTOS wouldn't be fast enough to handle this stuff
and I would do that in assembler. Definitely not with C or any operating
system.

Fast enough to handle "What Stuff" - how fast is fast enough for you! And
why does C make a difference compared to other compiled languages - old
tools?

Even Rose RT with the C++ backend can *Generate* code from UML that is
within 15% of the target platform performance, which is damn good - at that
level it is often *cheaper* and *easier* just to spec a faster chip than to
blow engineering hours at USD 700 per hour "optimising" i.e. obfuscating
code.

Assembler is the last resort for optimisation *after* one has measured with
the profiler what the bottleneck is (and found that the algorithm itself
cannot be improved). Nobody use Assembler voluntarily these days!

You are likely to need about 20 Hz loop bandwidth for a typical power
supply - which means that you got 10 msec to update the loop filter, which
again means that you could probably get away with writing it in Python on
top of an RTOS on one of the 16 Mhz embedded CPU's.
On the failure side I would provide two cut-offs if there are too many
concerns about a firmware hang-up:

The Infineon C166 has *hardware support* for PWM, Waveform generation and
emergency trips for a range of topologies - so do many other embedded
CPU's - those facilites are there to unload the software.
 
F

Frithiof Andreas Jensen

Jan 1, 1970
0
mike said:
Micro looks simple, but by the time you add on all the failsafes, fixes,
workarounds, external sensors and limits, it gets more complex than
just using the PS chip in the first place.

Thats because you worry too much: Open some consumer item and see how it's
done, f.ex. the Washing Machine - in mine there is a two-phase drive with a
single-chip micro driving IGBT's straight through a set of opto-couplers
with very little "glue" on it, there is some current and voltage sensing and
I assume that there is a short-circuit turn-off in the drivers too.

The rest is code - that controller stuff is not what fails - last time it
was the carbon brushes in the synchronous motor it uses. Easy to fix once
one found the interpretation of the flashing lights on the net.
 
W

Winfield Hill

Jan 1, 1970
0
artem_bond wrote...
The thyristors usually too slow. Maybe TVS diode plus this circuit.

Low-voltage TVS parts aren't so great at high-currents,
the excess over-voltage may be more than you expected.
SCR's are reasonably fast - you're supposed to have lots
of capacitance across the supply line to limit the dV/dt
slewing rate, which will give them time to act. Active
clamps can be nice, but aren't always trivial to design.

Thanks,
- Win

(email: use hill_at_rowland-dot-org for now)
 
K

Ken Smith

Jan 1, 1970
0
The thyristors usually too slow. Maybe TVS diod plus this circuit.

The ZNR device in my proposed circuit does this for you.
industrial.panasonic.com/www-data/ pdf/AEO0000/AEO0000CE2.pdf

The ZNR fires the SCR and clamps the fast overshoot all in one part.
 
K

Ken Smith

Jan 1, 1970
0
Frithiof Andreas Jensen said:
Assembler is the last resort for optimisation *after* one has measured with
the profiler what the bottleneck is (and found that the algorithm itself
cannot be improved). Nobody use Assembler voluntarily these days!

Who are you calling a nobody!!!!
I use 8051 assembly all the time. I use the A51 because it is simply
quicker to get a working product with it, than with the C51. I have an
editor that can do cut and paste and a large library.

Like all programmers, I spend more time designing software than actually
coding it. The fact that it takes more lines of code to use assembly has
very little effect on the total time. The biggest advantages "high level"
languages give you are in portablity. Any competent programmer can
quickly come up to speed on A51 so there really isn't the maintainance
issue that is often cited.
You are likely to need about 20 Hz loop bandwidth for a typical power
supply

This is dead wrong if you are handling short circuits etc as the OP has
suggested he is. He needs to react in uS not mS if he is to save the
parts.

Even discounting the current limit issue, I don't think I've designed a
power supply circuit in the last 20 years that had a gain cross over point
below 100Hz. If you want the low output impedance, you can either use
huge capacitors or a faster servo loop. The faster servo loop is much
smaller and less costly. It also prevents the output connections from
spot welding or turning into vapor on the stored energy.

In the OP's case, he really needs a system that works cycle by cycle. The
current limiting needs to react within the cycle. If he can't do that
with the micro, he will have to add hardware to do it. If enough issues
have to be taken away from the micro because it is too slow, it will be
time to consider taking the micro out all together. He may need to make a
FPGA or CPLD do the logic.
 
K

Ken Smith

Jan 1, 1970
0
artem_bond said:
i'm shure. Thanks. But I think about driver like this
http://www.irf.com/product-info/datasheets/data/ir2161.pdf whith

It looks like a nice chip. It takes a fair amount of the load off the
micro since it does the current limit for you.

[.. I asked ..]
This too. But I think TVS diodes can solve this problem.

I suggest you put a diode right near the output to block positive applied
voltages from getting back in and a very hefty one backwards across the
output to short out the minus input.
 
W

Winfield Hill

Jan 1, 1970
0
Ken Smith wrote...
The ZNR device in my proposed circuit does this for you.
industrial.panasonic.com/www-data/ pdf/AEO0000/AEO0000CE2.pdf

The ZNR fires the SCR and clamps the fast overshoot all in one part.

Check again. The lowest voltage they offer is nominally rated
at 18 volts. And this soars to 40V while performing 1A clamping
(or 36V with 10A for a much larger part). So they won't be any
good for a uP with a 5V or lower supply voltage. :>)

You'll have similar disappointment with low-voltage silicon TVS.

Thanks,
- Win

(email: use hill_at_rowland-dot-org for now)
 
J

Jan Panteltje

Jan 1, 1970
0
Frithiof Andreas Jensen said:
[....]
Assembler is the last resort for optimisation *after* one has measured with
the profiler what the bottleneck is (and found that the algorithm itself
cannot be improved). Nobody use Assembler voluntarily these days!
Nonsense!
Especially on micros assembler allows you to do things quick and fast, without
'vague' code from a C compiler.
If you do some coding in asm for some micro, you get a lot of re-usable library
routines really quick.
JP
 
K

Ken Smith

Jan 1, 1970
0
Ken Smith wrote...

Check again. The lowest voltage they offer is nominally rated
at 18 volts. And this soars to 40V while performing 1A clamping
(or 36V with 10A for a much larger part). So they won't be any
good for a uP with a 5V or lower supply voltage. :>)

Bummer!
 
J

Joel Kolstad

Jan 1, 1970
0
Frithiof Andreas Jensen said:
Nobody use Assembler voluntarily these days! ....
You are likely to need about 20 Hz loop bandwidth for a typical power
supply

Sheesh. You have a VERY narrow view of the world!

Happily, there are enough applications out there these days that even with
these views you can probably continue to find gainful employment. :)
 
J

Joerg

Jan 1, 1970
0
Hi Frithiof Andreas,
Fast enough to handle "What Stuff" - how fast is fast enough for you! And
why does C make a difference compared to other compiled languages - old
tools?
Things like runaway inductor current, for example. This needs to react
within less than a microsecond on today's switchers or it will cause a
pyrotechnic showdown. Remember that we are nowadays talking up to 1MHZ,
not 50KHz anymore.
Even Rose RT with the C++ backend can *Generate* code from UML that is
within 15% of the target platform performance, which is damn good - at that
level it is often *cheaper* and *easier* just to spec a faster chip than to
blow engineering hours at USD 700 per hour "optimising" i.e. obfuscating
code.
700 an hours? Let me know who pays that much and I'll pack up and move.
Anyway, the higher level the code the more you must rely on the quality
of subroutine, compiler etc. Not always such a good idea when it comes
to critical stuff. Your visibility of what happens on the lower level
lessens with high level languages.

Documentation is key. With proper docs an assembler approach can be very
clear and understandable. Just some comments in the code isn't enough.
The doc must be written while writing code and not as an afterthought.
Same with circuit design. At least that is my philosophy.
Assembler is the last resort for optimisation *after* one has measured with
the profiler what the bottleneck is (and found that the algorithm itself
cannot be improved). Nobody use Assembler voluntarily these days!
Assembler is pretty much mandatory in many cases. Critical funtions in
med electronics are one example. You must meticulously document failure
modes and mitigation, a.k.a. hazard analysis. Pointing towards foreign
modules and not knowing exactly how they work or how things compile will
fail during the product release process. QA will likely shoot it down,
and rightfully so.
You are likely to need about 20 Hz loop bandwidth for a typical power
supply - which means that you got 10 msec to update the loop filter, which
again means that you could probably get away with writing it in Python on
top of an RTOS on one of the 16 Mhz embedded CPU's.
20Hz ain't enough these days. My last switcher was in the KHz range here.
The Infineon C166 has *hardware support* for PWM, Waveform generation and
emergency trips for a range of topologies - so do many other embedded
CPU's - those facilites are there to unload the software.
Thank you for the info. That is a nice feature and I have to check the
C166 out. However, most of my designs are very low power so that would
mean MSP430 and the like.

Regards, Joerg
 
A

artem_bond

Jan 1, 1970
0
It looks like a nice chip. It takes a fair amount of the load off the
micro since it does the current limit for you.

Yes. Only two problem. The first, I have no idea how to connect this
chip to one channel PWM without additional TTL logic. And another
problem that this chip is not in mass production yet.
[.. I asked ..]
This too. But I think TVS diodes can solve this problem.

I suggest you put a diode right near the output to block positive applied
voltages from getting back in and a very hefty one backwards across the
output to short out the minus input.
--

It is't simply SMPS. The load is gas discharge in vacuum.

About two diodes, a one TVS diode is more that enough. Nagative
voltage this diode absorb becouse this diode is diode. Positive
voltage this diode absorb becose this diode is TVS diode, design for
work in avalanche mode.
 
K

Ken Smith

Jan 1, 1970
0
[...]
pyrotechnic showdown. Remember that we are nowadays talking up to 1MHZ,
not 50KHz anymore.

Make that over 3MHz. Switchers are getting smaller and smaller as the
frequencies go higher and higher.

[...]
Documentation is key. With proper docs an assembler approach can be very
clear and understandable. Just some comments in the code isn't enough.
The doc must be written while writing code and not as an afterthought.

I'd like to insert here that C without good documentation is as hard to
maintain as assembly. This goes double for C++. If you don't explain in
plain english why you are doing something, C++ can often be completely
unmaintainable. I know this from having to maintain some.
 
A

Al Borowski

Jan 1, 1970
0
Assembler is the last resort for optimisation *after* one has measured with
the profiler what the bottleneck is (and found that the algorithm itself
cannot be improved). Nobody use Assembler voluntarily these days!

I am, because I want all the speed I can get - and I like asm for some
reason :)

Al
 
F

Frithiof Andreas Jensen

Jan 1, 1970
0
Who are you calling a nobody!!!!

Sheeesh - Use decaff fer ricekakes ;-)
This is dead wrong if you are handling short circuits etc as the OP has
suggested he is. He needs to react in uS not mS if he is to save the
parts.

You are dead wrong to assume that you can handle a short in code - which is
why, as I suggested, one places that in the driver hardware.
below 100Hz. If you want the low output impedance, you can either use
huge capacitors or a faster servo loop.

You can't argue away the physics -

The O.P. needs 10 kV, he mentions 0.1 mF storage - this is 50 KJ; now, how
*fast* are you going to charge that sucker? Depends on the tolerance and the
power level, which are not specified. I say sloooow.
In the OP's case, he really needs a system that works cycle by cycle. The
current limiting needs to react within the cycle. If he can't do that
with the micro, he will have to add hardware to do it.

Certainly - The O.P. buys a Micro with the Hardware Built-in.... They are
available.
 
F

Frithiof Andreas Jensen

Jan 1, 1970
0
Sheesh. You have a VERY narrow view of the world!

Well - you aparrently have very little *argument *to put forward, so there!
Happily, there are enough applications out there these days that even with
these views you can probably continue to find gainful employment. :)

I am happy.
 
F

Frithiof Andreas Jensen

Jan 1, 1970
0
Things like runaway inductor current, for example. This needs to react
within less than a microsecond on today's switchers or it will cause a
pyrotechnic showdown.

Hardware - that's the kind of thing it's good at; stupid, fast, unchanging
tasks.
Remember that we are nowadays talking up to 1MHZ,
not 50KHz anymore.

I don't know about that - because, at least what I saw while doing that sort
of thing, *cost* and EMI is more important than power density. People like
to brag about the MHz converters in brochures - but there is a vast number
of commercial designs running below 150 kHz because the components are
cheaper, they are available *now* and the parasitics are easier to deal
with, epecially with high-voltage outputs. The rules on EMI also tend to
push things lower - as low as 30 kHz because one will wish to avoid the
"step" at 150 kHz where more severe limits kick in (Harmonics).

The "fastest" I did was planar designs running at 350 KHz, which seemed to
give the best balance between "the mechanics" - planar is very much about
mechanical work - and the commonly available components.
700 an hours? Let me know who pays that much and I'll pack up and move.

That's what people will *charge*, not what *you* will be paid for doing it -
a lot of this kind of work is done on a per-job basis by consultants. The
new hand-to-mouth economy!
Anyway, the higher level the code the more you must rely on the quality
of subroutine, compiler etc. Not always such a good idea when it comes
to critical stuff.

I think that is good - because many people will have used the same
components so there is a good chance that the bugs have been found and the
people building the tools often have detailed knowledge of the target
platforms that I will not have; The "bug-book" for a common CPU such as PIII
runs into a telephone-book sized tome. Let the writer of the optimiser code
cry over that, I say.

There is an even bigger chance that I will design new bugs writing my own
libraries ;-)
Documentation is key. With proper docs an assembler approach can be very
clear and understandable. Just some comments in the code isn't enough.
The doc must be written while writing code and not as an afterthought.
Same with circuit design. At least that is my philosophy.

.... Which is sound.
You must meticulously document failure
modes and mitigation, a.k.a. hazard analysis.

I think that is very hard in practice - because how can you *really know*
what this particular instance of hardware and software will behave under all
conditions without doing a full state-space analysis; I bet the universe
will run out of light before that runs to completion!

The hardware may not be exactly what is specified either - unless one buys
special "safety verified" devices.
QA will likely shoot it down,
and rightfully so.

That's what QA *do* ... ;-)
20Hz ain't enough these days. My last switcher was in the KHz range here.

You can get microcontrollers with DSP cores also, so there ;9
 
J

Jan Panteltje

Jan 1, 1970
0
Thank you for the info. That is a nice feature and I have to check the
C166 out. However, most of my designs are very low power so that would
mean MSP430 and the like.
Even a PIC648A had hardware PWM.
Personally I would be a bit careful to use a microcontroller for this
application, it can be done with some flip flops and opamps without
having fear of a program crash.
JP
 
K

Ken Smith

Jan 1, 1970
0
Sheeesh - Use decaff fer ricekakes ;-)

(Takes drink of his double strength brew)
How dare you suggest I'm jumpy!

You are dead wrong to assume that you can handle a short in code - which is
why, as I suggested, one places that in the driver hardware.

I disagree. On a fast micro in the flyback topology, handling the short
circuit case in software is not very hard at all.

[...]
The O.P. needs 10 kV, he mentions 0.1 mF storage - this is 50 KJ; now, how
*fast* are you going to charge that sucker? Depends on the tolerance and the
power level, which are not specified. I say sloooow.

How fast you charge up to the working voltage is usually not the issue.
It is the terminal impedance and how the circuit reacts to a change in
load that really matters.
 
J

Joerg

Jan 1, 1970
0
Hi Frithiof Andreas,
not 50KHz anymore.



I don't know about that - because, at least what I saw while doing that sort
of thing, *cost* and EMI is more important than power density. People like
to brag about the MHz converters in brochures - but there is a vast number
of commercial designs running below 150 kHz because the components are
cheaper, they are available *now* and the parasitics are easier to deal
with, epecially with high-voltage outputs. The rules on EMI also tend to
push things lower - as low as 30 kHz because one will wish to avoid the
"step" at 150 kHz where more severe limits kick in (Harmonics).

The "fastest" I did was planar designs running at 350 KHz, which seemed to
give the best balance between "the mechanics" - planar is very much about
mechanical work - and the commonly available components.
Look at the LM3478. Runs arond 500KHz and can go to 1MHz. Lots of
others, too. I never found EMI tough, you just needs a layout per RF
gudelines as if you were designing a microwave circuit. My trade-off was
usually about FET losses due to gate rise time versus the cost of the
magnetics and output caps. EMI was always fine.
of subroutine, compiler etc. Not always such a good idea when it comes
to critical stuff.



I think that is good - because many people will have used the same
components so there is a good chance that the bugs have been found and the
people building the tools often have detailed knowledge of the target
platforms that I will not have; The "bug-book" for a common CPU such as PIII
runs into a telephone-book sized tome. Let the writer of the optimiser code
cry over that, I say.
Most likely the V.P. of QA will not allow that. Unless the writer of the
code is on the team and participates in the hazard analysis.
There is an even bigger chance that I will design new bugs writing my own
libraries ;-)
Yes, we all can make mistakes. That's what a team-based hazard analysis
is for.
modes and mitigation, a.k.a. hazard analysis.



I think that is very hard in practice - because how can you *really know*
what this particular instance of hardware and software will behave under all
conditions without doing a full state-space analysis; I bet the universe
will run out of light before that runs to completion!
No, done lots of designs this way and they all went into production.
The hardware may not be exactly what is specified either - unless one buys
special "safety verified" devices.
Yep. This is part of the hazard analysis. You figure how a part can
fail, what happens and how the circuit will deal with that. In some
cases (pacemakers etc.) they are making their very own parts for this
reason. Even a standard logic chip is often done in house.
You can get microcontrollers with DSP cores also, so there ;9
Yes, but that can get expensive. Most designs run into a hard limit for
the intelligent part of a switcher. Often that limit is around a Dollar.

Regards, Joerg
 
Top