Diode OR on FB pin of switching controller to add constant current regulation - Page 1
Forum section: electronics / projects

author: Psi
author_rank: Super Contributor
timestamp: September 19, 2021, 06:14:20 am
content: What are the pitfalls of using a diode OR to combine output voltage and output current into the FB pin of a switching controller?Obviously there is the diode v-drop to consider and that will vary a little with current, though that should be small.And there's some reverse leakage current between the diodes so one will offset the other a little.The current signal would be from a high side current sense chip with analog output and voltage from simple voltage divider.I'm just wondering if this is valid approach to add basic current regulation. (Doesn't need to be super accurate. +/- 5% variation on voltage and current regulation is fine)I'm guessing the correct way to do it is with two opamps as ideal diodes?

author: Whales
author_rank: Super Contributor
timestamp: September 19, 2021, 06:28:37 am
content: One thought: be careful about introducing gain into the FB loop. I know you're measuring current and turning it into a voltage (so 'gain' is a bit ephemeral) but you still might end up with something that oscillates. Many switching controller example circuits already put things like resistors in series with the FB pin to (I presume) try and avoid this problem at higher freqs.(Mind you, my bench power supply oscillates when it hits current limit! So maybe it's a standard feature)

author: ajb
author_rank: Super Contributor
timestamp: September 19, 2021, 06:34:17 am
content: The big one is probably the lag introduced to the control loop by the current sense IC. A lot of those have fairly poor bandwidth, combined with a relatively high frequency switcher that could eat too much phase margin and cause loop stability problems in current regulation mode. Since the current loop will be slower than the voltage loop (because the current loop is just the voltage loop but with more stages in the feedback path) you'll need to figure out a way to compensate the former without (ideally) slowing down the latter too much.If you're thinking of using a voltage divider from the output of the current sense amp and then a diode from the output of that divider to the FB pin then of course the impedance of the current feedback divider needs to be substantially lower than the impedance of the voltage feedback divider, otherwise the current feedback can't sufficiently override the voltage feedback. You could add an additional op amp as an error amp with one input from the current sense amplifier, the other input from a voltage representing the current setpoint, and the output driving the FB pin via a diode to solve the impedance problem, substantially eliminate the diode Vf from the equation, and maybe make it a bit easier to set the current limit. This would incur additional phase lag in the current regulation loop, but probably less than the current sense amp does. Since the op amp will be saturated when the current is less than the setpoint you'll need to select an op amp that can come out of saturation and back into linear operation quickly if a fast response to overcurrent is important.

author: Psi
author_rank: Super Contributor
timestamp: September 19, 2021, 07:25:39 am
content: This will effectively be a battery charger, so the output ripple is not all that critical, neither is fast response to current regulation.Yeah, the chips i'm looking at have resistors/cap on COMP pin for FB loop compensation. so may need some tweaking

author: Berni
author_rank: Super Contributor
timestamp: September 19, 2021, 09:14:49 am
content: You can't just directly place a diode in there because the diode voltage drop is unstable with temperature and current. But diodes are indeed a valid way of "summing together" two error amplifiers, commonly used in discrete bench PSU designs.In the case of a switcher IC you might directly connect the voltage feedback divider to FB then just add in the current override signal trough a diode and generated by a separate opamp acting as a error amplifier.As for stability, yes you want to have enough gain for good regulation but not too much. What helps the most having a switcher chip that has an external COMP pin. This lets you slow down its feedback loop in case it gets too nervous.Stable current regulation can be tough however. Hard shorts or large reactive components can send things into oscillation. So make sure to test it with a wide range of loads.

author: Psi
author_rank: Super Contributor
timestamp: September 19, 2021, 09:16:47 am
content: Came across this design. It's not for a chip im going to use, none available.but at least it shows how it can be done.Might be able to copy the way this does the CS and voltage feedback onto a similar but available regulator and then tune the values a bit.

author: Berni
author_rank: Super Contributor
timestamp: September 19, 2021, 09:20:41 am
content: Yep that is exactly the method i described in the 2nd paragraph. Tho the choice if that opamp might matter quite a bit, it might need some gain reduction to be stable.

author: Psi
author_rank: Super Contributor
timestamp: September 19, 2021, 09:23:22 am
content: One question i have though, i'm often seeing SEPIC regulators shown with the two inductors coupled like a transformer in one diagram but shown separate in other diagrams.Do these need to be coupled together? or can you just use two separate inductors?I see that you can buy coupled inductors in a single package with 4 pins.I was under the impression that the current flows from in to out through the capacitors.

author: Berni
author_rank: Super Contributor
timestamp: September 19, 2021, 09:30:51 am
content: No SEPIC doesn't need coupled inductors to work. The reason it is done however is because the current flow in those inductors tend to be opposing for a lot of the cycle. This means they can make more efficient use of the core material. So less ferrite material is required when using a coupled inductor as compared to separate ones.Tho more complex typologies like this tend to be more easily upset by FB pin foolery. You do want to build a prototype of these things before committing them all the way onto some big expensive board.

author: Kleinstein
author_rank: Super Contributor
timestamp: September 19, 2021, 09:59:00 am
content: In some case one can do the combination with only 1 diode and 1 resistor. So 1 of the FB signals can come through just a resistor and does not see the drifting diode voltage.A problem can be that both paths would see the same compensation. One is a bit limited if vastly different cmpensation is needed for the voltage and current mode.

author: Psi
author_rank: Super Contributor
timestamp: September 19, 2021, 11:02:47 am
content: I would prefer a SEPIC chip with two error amps exposed for this purpose but I have not found anything so far. Well... not anything under $4

author: Vovk_Z
author_rank: Super Contributor
timestamp: September 19, 2021, 12:42:20 pm
content: To TS: google for "dc dc 5a cc cv circuit diagram" you'll find enough typical CC-CV dc-dc regulator circuit diagrams.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 19, 2021, 01:30:11 pm
content: There's also AP4312https://www.diodes.com/assets/Datasheets/AP4312.pdfwhich also handles the error amp, so you could wire the output directly to the COMP pin if available. (Not so useful for regulators with no COMP pin.)Tim

author: Berni
author_rank: Super Contributor
timestamp: September 19, 2021, 06:51:36 pm
content: Quote from: T3sl4co1l on September 19, 2021, 01:30:11 pmOh neat chip, this might come useful sometime. The application examples in the datasheet are not too helpful, but with some creativity im sure it can control plenty of other things(that are not optocoupler isolated supplies)

author: Psi
author_rank: Super Contributor
timestamp: September 21, 2021, 08:37:23 am
content: Quote from: Berni on September 19, 2021, 06:51:36 pmIndeed, for my application i need a common ground so Isense has to be high side, so it may not be useful. I will have to study if high side is possible using it. Might work fine with high side Isense chip with ref to GND.But yeah, cool chip.

author: Psi
author_rank: Super Contributor
timestamp: October 17, 2021, 09:20:21 am
content: Ok, so I have thrown together a prototype SCH and PCB to test.Anyone have any comments or suggestions?The component values here are mostly TBD and not valid.Specs are to be- SEPIC- 10-30V input- 14V output with 3A constant current limit- Battery rev polarity protection on input and output

author: Terry Bites
author_rank: Super Contributor
timestamp: October 17, 2021, 10:53:39 am
content: Use Mosfets instead of diodes. You can get devcies designed for MOSFET ORING with OC protection. eg LTC4235. Hot swap contollers abound thses days. They are in the $5 range.

author: Psi
author_rank: Super Contributor
timestamp: October 17, 2021, 11:00:40 am
content: Quote from: Terry Bites on October 17, 2021, 10:53:39 amI did consider doing that for the two inputs, but I came to the conclusion that it would cost quite a bit more than using 2 diodes and because it's SEPIC the vdrop really doesn't matter much and for this application the efficiency isn't super critical.