Author Topic: Adding simple current limit on generic switchmode reg  (Read 12826 times)

0 Members and 2 Guests are viewing this topic.

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 12697
  • Country: nz
Adding simple current limit on generic switchmode reg
« on: May 31, 2022, 06:26:34 am »
Most of the switch-mode controller IC's I see have a low side sense resistor on the switching FET to GND. No doubt there to limit the peak currents through the mosfet/inductor to something sensible/safe.
Example: The CS input on this controller. https://www.ti.com/lit/ds/symlink/lm5156.pdf?ts=1653977723347&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FLM5156

Is there any way to use this existing current sense system to also implement some crude output current limiting or protection that I can rely on for battery charging?

Reason for asking is I'm having lots of issues trying to design a SEPIC 10-35V input 13.8V 2-3A SLA charger that is buildable at 1000pcs / year in the middle of a chip shortage.
There's many options that would work great, but they either need specialized chips with only 600 in stock worldwide, or they require 2 extra chips to add output current regulation to a regulator IC that doesn't have it built in.  (Unless i'm adding jellybean IC's, adding 2 extra chips to the BOM is almost as bad as needing one specialized chip.)

So I have been pondering how I could hack in some basic output current limiting onto a generic sepic chip in a way that is cheap and doesn't require extra chips like specialized High Side Isense amps or things like the AP4312. etc..   Keep in mind this is a battery charger, It does not need to be super stable/low noise etc.. and I don't care if the current limit shifts around a bit due to input volts or temp. Anything from 1.5-3A is fine.

Any ideas for hacking current regulation onto a generic switchmode controller using only jellybean chips?
(Perhaps a generic opamp/comparator amp as high side Isense detect which turns off a transistor which is bypassing a resistor to GND inside the chips FB divider?)

Specs
SEPIC or non inverting buck-boost
Common GND, so no ground line Isense
11-35V input
13.8V output
1.5-3A output limit.
« Last Edit: June 04, 2022, 09:42:13 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Adding simple current limit on generic switchmode reg
« Reply #1 on: May 31, 2022, 08:24:19 am »
What's wrong with good old UC3843?  Controller may be more feasible than regulator.  Would think SimpleSwitchers or such are fine for this power level, but if you're having trouble finding them, well, that...

You don't need much accuracy on the current limit, right?  Just any old current mode control should do.

Note that you need over 50V rating on the switch, which may be hard to find in a regulator.  80V MOSFETs are still in ample supply though.

If you want the most basic possible (but still output referenced, and at least somewhat accurate) current limit, add a sense resistor for ~600mV at desired current, and put a PNP across it (emitter to SEPIC output, base to battery via resistor*), collector to the VFB node.  Maybe an emitter resistor too (to limit transconductance and therefore loop gain).

*Why? Consider what happens if the output terminals get shorted...

Also with a base resistor in there, a little current can be bled out of it (with a pulldown resistor or CCS), biasing down the base voltage thus trading for voltage drop at the shunt -- going down to maybe 200mV is reasonable in this way, but for less you'll definitely want temperature compensation, and might as well go with a one of those current sense amps.  Or do it low side and use any old (single supply or RRIO) op-amp.

As for charging curve, is this just gonna be a float thing, let it be for a while and it's done?  Or with a fancier curve (e.g. up to ~14.4V until current tails off, float 13.8 )?  (I would guess at merely 2-3A, unless you have quite small batteries, it's basically not going to be fast enough to be anything more than a float charge anyway.)

Should be feasible to make one of those as well, with some kind of, say, negative resistance characteristic, but carefully limited to a narrow band, hence the automatic voltage reduction as current drops.  Or, to say by way of contrast: instead of using like a hysteresis circuit or state machine, kind of still do that, but using the output voltage and current as state variables directly; or in still another way: as a fuzzy logic controller, where voltage setpoint is a function of voltage and current, using clamped linear functions to set the input threshold and output ranges.

Basically this would take, I think, hmmm, probably under 50 components, including a couple of op-amps, or maybe a half dozen transistors.  Such analog circuits tend to have the downside that they take a lot of resistors, lots of biasing and range trimming and stuff to make it all work.  Besides a proper charge controller IC as such, an MCU would also be an attractive option at that point.  (Again, current events notwithstanding..)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 12697
  • Country: nz
Re: Adding simple current limit on generic switchmode reg
« Reply #2 on: May 31, 2022, 09:56:08 am »
Thanks, that helps a lot.

It's only charging with the vehicle engine is on, so charging up to 14.4V is ok, since it's not going to be on for more than a few hours at a time.
So I wasn't going to do anything special for charge curve, just voltage limit at 14V and current limit at 2A or so.

Looks like UC3843 never came up in my searches because I was filtering for SEPIC, when I should have also added Buck-Boost too.
My mistake.
« Last Edit: May 31, 2022, 10:01:26 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Adding simple current limit on generic switchmode reg
« Reply #3 on: May 31, 2022, 10:03:07 am »
3843 doesn't... really do buck-boost, at least not the inverting kind, without a fair amount more hardware.  I'd say it's somewhat erroneous for it to be listed that way.  But boost and flyback are both fair game here, almost identical as far as the controller is concerned, don't leave them out. :-+

And yeah, SEPIC is pretty specialized, as in you're much less likely to see it than other types; likely you found a tonne of weird LT/AD parts instead?

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 12697
  • Country: nz
Re: Adding simple current limit on generic switchmode reg
« Reply #4 on: May 31, 2022, 10:25:07 am »
Probably need to power that chip from a linear reg so i can get up to 35V input, but that should be fine
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 12697
  • Country: nz
Re: Adding simple current limit on generic switchmode reg
« Reply #5 on: May 31, 2022, 10:27:09 am »
3843 doesn't... really do buck-boost, at least not the inverting kind, without a fair amount more hardware.  I'd say it's somewhat erroneous for it to be listed that way.  But boost and flyback are both fair game here, almost identical as far as the controller is concerned, don't leave them out. :-+

And yeah, SEPIC is pretty specialized, as in you're much less likely to see it than other types; likely you found a tonne of weird LT/AD parts instead?

Tim

Yeah lots of LT/AD parts.
I just assumed it needed to be listed as SEPIC to do input voltage above and below output voltage.
Well. other than flyback, which I assumed needed a flyback transformer instead of inductors.
My mistake.
« Last Edit: May 31, 2022, 10:29:12 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline oz2cpu

  • Super Contributor
  • ***
  • Posts: 1024
  • Country: dk
    • webx.dk private hobby and diy stuff
Re: Adding simple current limit on generic switchmode reg
« Reply #6 on: May 31, 2022, 11:05:44 am »
see this picture.. this is your circuit.. and you want to add current limit to it..

lets see : the FB signal measure the voltage on the output, if it is pulled low, it adds more power.
if FB is pulled up, the ic remove power to the output.
however it is a step up configuration, meaning even at zero switching, you get input voltage to the output, straight thru the inductor
are you with me so far ?
Radioamateur call sign OZ2CPU, Thomas Scherrer, Senior EE at Prevas, EMC RF SMPS SI PCB LAYOUT and all that stuff.
youtube : oz2cpu teardown
 

Offline oz2cpu

  • Super Contributor
  • ***
  • Posts: 1024
  • Country: dk
    • webx.dk private hobby and diy stuff
Re: Adding simple current limit on generic switchmode reg
« Reply #7 on: May 31, 2022, 11:12:23 am »
as you see the CS pin of the IC is allready a cycle by cycle current limit, it turn off the fet time, when max current is reached
so you simply adjust the source to gnd resistor value as explained in the datasheet,
for wanted current..

but if you really want to make your own extra current limit, see the attached schematic change

Radioamateur call sign OZ2CPU, Thomas Scherrer, Senior EE at Prevas, EMC RF SMPS SI PCB LAYOUT and all that stuff.
youtube : oz2cpu teardown
 

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 12697
  • Country: nz
Re: Adding simple current limit on generic switchmode reg
« Reply #8 on: May 31, 2022, 12:46:47 pm »
however it is a step up configuration, meaning even at zero switching, you get input voltage to the output, straight thru the inductor

I need it to be step up and step down. So there will be a cap isolating input from output.
It should all be the same though, with pfet pulling up FB from series resistor V drop
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 12697
  • Country: nz
Re: Adding simple current limit on generic switchmode reg
« Reply #9 on: May 31, 2022, 12:51:17 pm »
as you see the CS pin of the IC is allready a cycle by cycle current limit, it turn off the fet time, when max current is reached
so you simply adjust the source to gnd resistor value as explained in the datasheet,

As i understand it, the CS pin is more a cycle by cycle peak current limit to protect the mosfet.
I'm unsure how it would function if that was increased until it started current limiting the steady state output current? It sounds like something that would trash the efficiency.
« Last Edit: May 31, 2022, 12:53:35 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Adding simple current limit on generic switchmode reg
« Reply #10 on: May 31, 2022, 02:44:28 pm »
but if you really want to make your own extra current limit, see the attached schematic change

Close; like I described, needs to be a PNP, and emitter to the other side.  But otherwise yeah, like that, the old school current limiting trick, you have a Vbe drop and then it's tugging on the, well not the pass transistor input in this case, but anything related to the control will do, in this case the FB node.  COMP would do as well, if it has the right phase (but most don't).

Also note that feedback must be taken AFTER the shunt resistor to maintain low output impedance!


As i understand it, the CS pin is more a cycle by cycle peak current limit to protect the mosfet.
I'm unsure how it would function if that was increased until it started current limiting the steady state output current? It sounds like something that would trash the efficiency.

Yeah you wouldn't put it there, that would reduce the range of current but the error amp would still try to regulate within that range as well as it can.  So once it goes into current limiting, the error amp just has to get saturated, which is kinda not great (incurs integrator windup, as so many (naively designed?) bench supplies exhibit).

And yeah, an LDO is good for supplying the thing, don't want much over 15V anyway to avoid excessive gate drive power.  A real LDO isn't necessary, just anything other than an HDO will do; this is a good application for depletion MOS e.g. DN3545 with a pullup + shunt zener to the gate.  Will pass load dump ezpz.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 12697
  • Country: nz
Re: Adding simple current limit on generic switchmode reg
« Reply #11 on: June 01, 2022, 12:14:54 am »
And yeah, an LDO is good for supplying the thing, don't want much over 15V anyway to avoid excessive gate drive power.  A real LDO isn't necessary, just anything other than an HDO will do; this is a good application for depletion MOS e.g. DN3545 with a pullup + shunt zener to the gate.  Will pass load dump ezpz.

Yeah, if I go with a reg for vcc it will have to be 9V or ideally 10V so it remains in regulation at 11V input while still being compatible with the chips UVLO.  Would have to be the UC3843 or UC3845 variant since the other two trip at 10V and 16V to restart.    3 and 5 should come back out of UVLO at 9V max

Hm..
What effect does having the UC384X version with 50% vs 100% max duty cycle have when it's configured with two inductors for both step up and step down ?  I'm guessing I want the 100% version for full control.
« Last Edit: June 01, 2022, 12:23:36 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Adding simple current limit on generic switchmode reg
« Reply #12 on: June 01, 2022, 04:34:44 am »
It's basically a boost: -3 is what you want.  -5 is typically chosen for 1-2 switch forward, where the 50% is "wasted" as reset flux and you definitely don't want it trying too hard to push into that range.

Which, just to explain that a bit more:



In a half-wave forward converter, the transformer reset voltage is inverse with the reset time.  Basic flux balance of course.  If it's on for say 320V * 5us, it needs to be off for equal Vrst * t_rst.  At 50%, times are equal, so the voltages will also be equal, and a clamp RCD snubber will charge up to this voltage (more or less).  Thus the peak switch voltage is 640V (plus not much transient peak, since, well, it's clamped right there, isn't that handy?), so probably using an 800V MOSFET will do.

Note that, if load current is zero, the controller doesn't know much about what's going on with the primary magnetizing current.  The transformer is high inductance (a transformer transformer, as opposed to the coupled inductors of a flyback), so the current is small, probably less than 10% of total load current.  So whether the magnetizing current is high or low, relative to its own limit (saturation current), is not something the controller is very sensitive to.

So, if the controller happens to push over 50%, the reset voltage will rise, eventually quite sharply (it's hyperbolic with PWM%), thus dissipating more power (there's more voltage dropped across the snubber resistor), thus drawing more current (magnetizing current may transition into CCM).  And once it's in CCM, the primary DC current is a free variable, balanced relatively slowly (over multiple cycles) by the snubber RC time constant.  Eventually either enough current flows through the snubber to put the transformer into saturation, or MOSFET avalanche causes a hard limit and flux walks up very quickly.  (Obviously, TVS clamped reset does the same thing, too.)  Once the transformer is banging into saturation, the controller only notices something different when peak magnetizing current (the extra due to saturation) approaches load current, and more power cannot be delivered (i.e. it goes into current limiting, probably with a lot of extra core loss).

It's not an instantly destructive situation, if it's not avalanching the transistor that is -- the peak currents are of course on par with normal maximum load currents, and the primary winding has to be rated for that anyway, so it's not adding more winding or switching losses.  And output power is reduced by way of saturation effectively stealing what would otherwise be load current.

(Remember that, in a peak current mode 1/2 wave forward converter, the output inductor's reflected current is what's being tested.  So it works just the same as a flyback, as far as the controller is concerned.  And, like any peak current mode control, the inductor needs to be relatively small, to work in DCM, or shallow CCM with slope compensation.)

The real trouble is that there's no good limit, it's nearly a free variable; the PWM is very squishy, and likely the snubber isn't designed to draw very much current (to drive the primary into saturation, where such a limit would occur) before the MOSFET avalanches.  So, we'd rather just design the thing with a hard 50% limit to begin with, and never run the risk of all this weirdness.  The 50% limit then is fairly arbitrary, but it's most reasonable by symmetry (equal and opposite conduction and reset pulses), and allows clamping at +V (either with a reset winding and catch diode, or by flipping around both ends of the same primary as in a 2-switch forward).

So that's what motivates that. :-+

Anyways, such a limit isn't relevant with SEPIC -- higher PWM is higher Vout, nothing weird going on, it's tight and controlled. :)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 12697
  • Country: nz
Re: Adding simple current limit on generic switchmode reg
« Reply #13 on: June 01, 2022, 07:50:17 am »
Thanks Tim,

That makes sense :)
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 7758
  • Country: nl
Re: Adding simple current limit on generic switchmode reg
« Reply #14 on: June 01, 2022, 12:33:31 pm »
buck-boost
Common GND
Just want to point out this is a priori impossible, buck boost is short hand for inverting buck boost and inverting buck boost uses the ground as the positive electrode for the output. SEPIC or flyback are your options if you want to be able to work with lower and higher supply voltages.
« Last Edit: June 01, 2022, 12:39:19 pm by Marco »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 22461
  • Country: gb
  • 0999
Re: Adding simple current limit on generic switchmode reg
« Reply #15 on: June 01, 2022, 12:42:04 pm »
buck-boost
Common GND
Just want to point out this is a priori impossible, buck boost is short hand for inverting buck boost and inverting buck boost uses the ground as the positive electrode for the output. SEPIC or flyback are your options if you want to be able to work with lower and higher supply voltages.
He's talking about a four switch buck-boost, which gives the same polarity as the input. It's literally a buck converter and boost converter, sharing the same inductor.

https://en.wikipedia.org/wiki/Buck%E2%80%93boost_converter#Principles_of_operation_of_the_four-switch_topology
 

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 12697
  • Country: nz
Re: Adding simple current limit on generic switchmode reg
« Reply #16 on: June 03, 2022, 12:20:09 pm »
buck-boost
Common GND
Just want to point out this is a priori impossible, buck boost is short hand for inverting buck boost and inverting buck boost uses the ground as the positive electrode for the output. SEPIC or flyback are your options if you want to be able to work with lower and higher supply voltages.

Ok, it seems i'm getting confused with the terminology then.

SEPIC is what i'm currently working on building, using the UC3843.
I need input above and below output.

Though i am a little concerned about the efficiency that will be achievable using the UC3843 and the amount of heat i can afford to dissipate.
« Last Edit: June 03, 2022, 01:07:04 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 8533
  • Country: ro
Re: Adding simple current limit on generic switchmode reg
« Reply #17 on: June 03, 2022, 01:47:47 pm »
About the many SMPS naming and topologies:
https://www.ti.com/lit/ml/sluw001g/sluw001g.pdf
 
The following users thanked this post: Psi

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Adding simple current limit on generic switchmode reg
« Reply #18 on: June 03, 2022, 03:01:42 pm »
There are other controllers out there of course (just avoid the TPS40210, its limiting behavior was designed by an idiot), and still with 3843 you can reduce current sense voltage by biasing it up with a divider from VREF, and/or adding slope compensation (a divider from RtCt, but not directly from it, use an emitter follower inbetween).

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 12697
  • Country: nz
Re: Adding simple current limit on generic switchmode reg
« Reply #19 on: June 04, 2022, 09:29:20 am »
Out of interest, are there any jellybean (multiple manufactures) switching controllers which support either
- synchronous sepic
- non inverting buck-boost (either synchronous 4 mosfet,  or  2 mosfet+2 diode)

I can see many synchronous sepic from a quick google but they are all specialized low stock / $10 each type parts.
« Last Edit: June 04, 2022, 09:51:00 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 7758
  • Country: nl
Re: Adding simple current limit on generic switchmode reg
« Reply #20 on: June 04, 2022, 04:54:34 pm »
You can bootstrap and capacitively couple the gate drive of a synchronous boost controller to do SEPIC.

https://www.ti.com/tool/PMP10886
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Adding simple current limit on generic switchmode reg
« Reply #21 on: June 04, 2022, 05:41:38 pm »
I've done something similar with Cuk, cap coupling to a PMOS (which being PMOS, is ground referenced, easy to drive).  Worked fine, albeit with not great performance, just because, well, PMOS are PMOS.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline PsiTopic starter

  • Super Contributor
  • ***
  • Posts: 12697
  • Country: nz
Re: Adding simple current limit on generic switchmode reg
« Reply #22 on: June 18, 2022, 11:10:27 am »
Hm.. are there any generic/cheap opamps that could be used for an Isense amp on the UC3843 when running at 250 kHz?
I imagine needing to run close to the ground rail and also needing to be pretty high bandwidth limits the options quite a bit.

I have a circuit and PCB based on the UC3843 up and running, but it's running a little hotter than I would like, though less hot than I was expecting.  PCB is at 50deg C around the switching area and the Isense resistor around 80-90C. FLIR showed that by a significant margin the heat is coming from the Isense resistors.

There are 2 Isense resistors.
The FET source to GND for the IC's sense line, and the series resistor that does my current regulation.
So a dual opamp would be a nice solution to take care of both those heat sources by dropping the resistors by a factor of 10.
That is, if a suitable ones is available in the middle of a chip shortage and not too expensive. (<$1.5)


If the switching is at 250khz, what sort of bandwidth opamp do I need?  2.5mhz at 10x gain?
« Last Edit: June 18, 2022, 11:17:53 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 6083
  • Country: au
    • send complaints here
Re: Adding simple current limit on generic switchmode reg
« Reply #23 on: June 18, 2022, 02:06:22 pm »
Doesn't sound particularly demanding for an opamp (can tolerate error/drifting of mV), do you have a regulated low voltage rail? Plenty of very cheap 5V opamps these days.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Adding simple current limit on generic switchmode reg
« Reply #24 on: June 18, 2022, 03:05:19 pm »
Schematic?

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->