Constant current & constant voltage from generic buck converter - Page 1
Forum section: electronics / beginners

author: drkntz
author_rank: Contributor
timestamp: August 23, 2023, 04:33:07 pm
content: I am working on a project that involves controlling voltage and current to slow charge various small batteries, and I am concerned that my approach may introduce instabilities in the regulator.I previously evaluated a multichemistry battery charge chip, but was having issues due to the varied nature of the batteries (some have charge regulators built in, others series diodes, etc).I am adapting a version of someone else's design for setting constant current, and adding a constant voltage control. The desired output is to set a voltage anywhere from 4 to 5.5 volts and a current limit from 20 to 200mA. This design uses a generic regulator A8498 as a buck converter.My control voltages would come from a buffered DAC which can swing up to 3.3V/20mA. The constant voltage control should work for 0.8 - 6.7V out (based on calculation) and supposedly this constant current circuit works too, I'm just not sure if I'd be introducing instability with the constant voltage-constant current settings both swinging the current in the feedback pin node.

author: Terry Bites
author_rank: Super Contributor
timestamp: August 23, 2023, 05:00:43 pm
content: Not all PWM regulators let you get at the amplifier/comparator set points from the outside, but some do.In that case, your DAC need not drive into feedback nodes.Have a look at a TL494 for instance.

author: David Hess
author_rank: Super Contributor
timestamp: August 24, 2023, 09:18:00 am
content: What you show is how I would do it with that type of switching regulator which provides a voltage feedback input. Frequency compensation of U2A will be critical and needs to be tested.

author: drkntz
author_rank: Contributor
timestamp: August 24, 2023, 12:51:24 pm
content: Quote from: David Hess on August 24, 2023, 09:18:00 amThanks for the input! Meaning, I suppose, that I would want U2A to have a "slow" response generally to avoid causing rapid changes in the U1 FB node and output oscillation? What about a small R-C, like at the noninverting input of U2A?How would I test that this compensation works? Intuitively, I would try a step current (like switch on a load resistor) and observe the feedback node and the regulator output for oscillations (ideally none, just a smooth ramp at the regulator output). Does that sound right?

author: drkntz
author_rank: Contributor
timestamp: August 24, 2023, 01:01:45 pm
content: Quote from: Terry Bites on August 23, 2023, 05:00:43 pmOoh, this is a good one, and readily available (shocker). I'll keep this one in the back pocket in case using A8498 doesn't work. At the moment, it's not up to me to switch to a new part but if this simply doesn't work I'm definitely going to try TL494.

author: MrAl
author_rank: Super Contributor
timestamp: August 24, 2023, 02:42:02 pm
content: Quote from: drkntz on August 23, 2023, 04:33:07 pmHi,I am not so sure it is a good idea to use a DC bias on the feedback line in order to 'regulate' the output voltage and/or current.I went over the math some years ago but i can't remember why i determined i didn't like the idea. I'll see if i can find my notes from back then.One point comes up quickly though. To start, the feedback line has a range of values from 0 to the point where it causes regulation at the desired point, and that comes from adjusting a potentiometer, which happens to convey information to the feedback pin in the form of a ratio. That is, if the output is say 10v and the regulation point is 2.5v (a typical regulation point) then that ratio the pot provides is 2.5/10 or simply 0.25 or as a fraction 1/4. Now if you have to add 1.25v to get to that 2.5v with a DC bias on the feedback line, there is no longer a ratio, which by the strictest definition of linearity, is completely linear. Instead, the feedback line sees 1.25v to 2.5v, which is no longer completely linear.This could cause oscillations for some type of loads.A good idea would be to test this in a simulator of course, but also in real life. It's not a super complicated circuit so it should be doable.Keep in mind that if the DC bias ever got up to 2.49v, the feedback would be working from 2.49v to 2.50v, not a very good range. If it got up to 2.499v, it would only be working from 2.499v to 2.500v, a mere 0.001v, which doesn't sound like it would work at all especially with the slightest amount of noise and even without a problem load.The bottom line is I don't think you can go from a perfect ratio, to a ratio plus a constant for the feedback without expecting stability problems with some loads and/or some output voltage settings via the DC bias.

author: David Hess
author_rank: Super Contributor
timestamp: August 24, 2023, 03:05:01 pm
content: Quote from: drkntz on August 24, 2023, 12:51:24 pmGenerally it means adding a series RC circuit between the output and inverting input of the operational amplifier. First the capacitance is adjusted to give stability, and then the resistance is increased to improve performance without oscillation. Then the two values can be adjusted for best transient response.Note that the inverting input needs to be isolated from C8 with a series resistance for this to work properly.The problem is that the regulator adds both gain and phase delay within the feedback loop of the operational amplifier.QuoteI would apply a constant current to a load, and then use a capacitor to couple a low amplitude square wave into the current adjust input. Then the current can be varied over the output range to find the worst case operating point, although in your design there is probably not much variation.

author: David Hess
author_rank: Super Contributor
timestamp: August 24, 2023, 03:16:58 pm
content: Quote from: MrAl on August 24, 2023, 02:42:02 pmDriving the feedback input to control the output current is not ideal, but it will work.Some regulators have a compensation input which is connected to an external compensation network and comes from the output of the transconductance error amplifier, and this point is ideal for adjusting the output current. The TL494 example given by Terry Bites shows this point at pin 3.

author: MrAl
author_rank: Super Contributor
timestamp: August 25, 2023, 04:53:00 pm
content: Quote from: David Hess on August 24, 2023, 03:16:58 pmHello again,Well, if it does work, it would have to be over a restricted range.We could do some simulations when time permits. I would also look at a real-world breadboard circuit too though.

author: David Hess
author_rank: Super Contributor
timestamp: August 26, 2023, 02:37:25 am
content: Quote from: MrAl on August 25, 2023, 04:53:00 pmDo you mean over a restricted output current range?The output current is just the output voltage divided by the load impedance. Real world designs support output currents down to zero assuming that the output voltage can reach zero. At low currents the switching regulator operates in discontinuous conduction mode which makes the loop gain vary operating point but this only complicates the frequency compensation, and synchronous switching regulators can avoid even this.Driving the compensation node works better, but driving the feedback node can work.

author: MrAl
author_rank: Super Contributor
timestamp: August 26, 2023, 02:53:34 pm
content: Quote from: David Hess on August 26, 2023, 02:37:25 amHello again,Well it's unfortunate I can't find my old, old notes on this.I did do some simpler calculations though, and it looks almost like we can think of the DC bias as a simple subtraction of the reference input in a typical feedback system. For example, if the reference input was 10v and the DC offset 5v, then it looks similar to if there was no DC offset and a 5v reference input.As mentioned, there could be a problem when the DC offset gets too close to the reference input because then the output tries to go negative, and as it gets closer and closer to that critical point, any noise will modulate the output either up and down or possibly both positive and negative, depending on the exact setup of the system. I can see the output going to zero in a positive-output-only system, but when just above zero that could be a problem. This would depend on the particular system though as some will just integrate the noise as an average. The effects then would depend on the type of noise encountered.

author: drkntz
author_rank: Contributor
timestamp: August 31, 2023, 09:04:31 pm
content: Update, I had a small dev board made up with this and some other things I needed to try out and it works pretty well.I can adjust the current smoothly & linearly and likewise the voltage. I tried the square wave thing, got a slight amount of overshoot with Vctrl stepping but I'm not worried about it. I tried a few load resistors and switching them on/off and so forth and it seems like the circuit responds pretty quickly without any stability issues. I have some more things to try with this yet before I am satisfied, mostly testing with the batteries that have been giving me a headache with the traditional battery charger controller.